Skip to main content
. 2022 Aug 16;22(16):6133. doi: 10.3390/s22166133
Algorithm 2 Digital Twin synchronization
Input:ProfDT,  DTn, DID, IPsrcn, IPdstn, tstmpn, bdupper, bdlower, PA, CertDT, DTprvK, DTpubK, PAID, PPrvK, PPubK
  1. Begin:

  2. Design new ProfDT:

  3. Select time boundary

  4. Vendor = bdupperhh:mm:ss, bdlowerhh:mm:ss

  5. Assign time boundary to ProfDT

  6.    for (DT=1 to DTn) do

  7.    ProfDT (bdupper, bdlower) = Vendor (bdupper, bdlower)

  8.     End for

  9. Authenticate:

  10. Encrypt DT Certificate

  11. Encrypt CertDT with DTprvK

  12. DTn(DTprvK(CertDT)) → Blockchain

    Decrypt and Verify DT Certificate

  13.    if  DTn(DTpubK(CertDT)) = True

  14.     return DT authentication successful

  15.    else

  16.     CertDT not found. Authentication failed

  17.    end if

  18. Encrypt PA ID

  19. Encrypt PAID with PPrvK

  20. PA( PPrvK)) → Blockchain

  21. Decrypt and Verify PA ID

  22.    if PA (PPubK (PAID) = True

  23.           return PA authentication successful; initiate DT Sync

  24.    else

  25.         PAID not found. Authentication failed

  26.    end if

  27. Initate Sync

  28. Verify DTn ProfDT with the PA

  29.    if  ProfDT (bdupper, bdlower) = Vendor (bdupper, bdlower)

  30.          return Initiate Sync

  31.       if  PADIDIPsrcn, IPdstn, tstmpn = DT DIDIPsrcn, IPdstn, tstmpn

  32.             return packets match

  33.           DT DIDIPsrcn, IPdstn, tstmpn → Blockchain

  34.          else

  35.                Profiles mismatch. Update security vendor.

  36.              DT DIDIPsrcn, IPdstn, tstmpn)) → Blockchain

  37.            end if

  38.         else

  39.             return ProfDT profile mismatch. Update security vendor

  40.         end if

  41. End