Research Article
A Secure and Efficient Access Control Scheme for Shared IoT Devices over Blockchain
Figure 4
The execution flowchart of ending service in the smart contract. Note: (I) The user calls the interface UserEndServer() to start ending the service process and updates the end of service flag User\_END submitted by the user as 1. (II) The GWN calls the interface GWNEndServer() to start ending the service process and updates the end of service flag GWN\_END submitted by the GWN as 1. (III) The IoT device calls the interface IoTEndServer() to start ending the service process and updates the end of service flag IoT\_END submitted by the IoT device as 1. (IV) It confirms whether all the three parties have submitted the service ending request through the ending service flag when the user, GWN, and IoT device call the process of service ending. If not all the ending requests are submitted, it notifies the user, the GWN, or the IoT device to wait for other parties to submit the ending request within a certain period of time. (V) When all three parties have completed the submission, the expenses shall be settled. And, it records this service as the historical data for follow-up tracking and notifies the user, GWN, and IoT device that the service is finished.