Skip to main content
. 2025 Jul 30;25(15):4695. doi: 10.3390/s25154695
Algorithm 4 ProductionLine task
  •   1:

    Require: Define the source code path of the smart contract: path

  •   2:

    Ensure: All the results of the implementation of the rules: λ

  •   3:

    SCAddr,depdepSC(path)                                                                                          ▷ Deploy the smart contract

  •   4:

    u1AddrsetUser()                                           ▷ Call the "setUser" operation to create a user on the blockchain

  •   5:

    u2AddrsetUser()

  •   6:

    d1AddrsetUser()                                        ▷ Call the "setUser" operation to create a device on the blockchain

  •   7:

    d2AddrsetUser()

  •   8:

    callFunction(SCAddr,addDevice(d1Addr))                                                          ▷ Add devices to the smart contract

  •   9:

    callFunction(SCAddr,addDevice(d2Addr))

  • 10:

    callFunction(SCAddr,updateStatus(d1Addr,Idle))                 ▷ Initialize the status of the devices on the blockchain

  • 11:

    callFunction(SCAddr,updateStatus(d2Addr,Running))

  • 12:

    Define the output sets resulting from the execution of rule1: Ω

  • 13:

    ΩRule1(u1Addr,d1Addr,SCAddr)                                                                                    ▷ Execute rules detection

  • 14:

    Define the output sets resulting from the execution of rule2: ω

  • 15:

    ωRule2(u1Addr,d1Addr,d2Addr,SCAddr)

  • 16:

    return All the results of the implementation of the rules: λωΩ