A lock control method and system based on blockchain, and electronic lock

Through the blockchain-based lock control method, the unlocking transaction identifier generated by the blockchain and the public key of the lock owner are used for verification, which solves the problem of low security of electronic locks in the existing technology and achieves higher security and protective measures.

CN115035637BActive Publication Date: 2025-02-18BEIJING XITA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210590455.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-02-18
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

In the prior art, electronic locks transmit temporary passwords through the network, resulting in lower security.

Method used

The lock control method based on blockchain is adopted, and the lock-opening transaction identifier generated by the blockchain is obtained and verified with the lock owner's public key to determine whether to unlock the lock and avoid transmission of temporary passwords.

Benefits of technology

Improves the security of electronic locks, prevents illegal users from obtaining ownership of locks, and avoids the risk of transmitting sensitive information on the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035637B_ABST
    Figure CN115035637B_ABST
Patent Text Reader

Abstract

The present invention discloses a lock control method and system based on blockchain, and an electronic lock, and relates to the field of computer technology. A specific implementation of the method includes: obtaining an unlocking transaction identifier generated by blockchain; sending the unlocking transaction identifier and the stored public key of the lock owner to a server; receiving a verification result sent by the server; and determining whether to unlock the lock according to the verification result. This implementation can improve the security of the electronic lock.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a lock control method and system based on blockchain, and an electronic lock. Background Art

[0002] Electronic locks are widely used because of their convenience in opening doors. In some practical scenarios, the lock owner is often required to grant unlocking permissions to other users, such as granting unlocking permissions to temporary visitors, cleaners, etc.

[0003] In the prior art, the lock owner sets a temporary password for the electronic lock through an application installed in a terminal, and informs the temporary password to an authorized user, who then enters the temporary password in the electronic lock to unlock the electronic lock.

[0004] However, this method requires the transmission of a temporary password over the network, which has low security. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a lock control method and system based on blockchain, and an electronic lock, which can improve the security of the electronic lock.

[0006] In a first aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0007] Get the unlocking transaction identifier generated by the blockchain;

[0008] Sending the unlocking transaction identifier and the stored public key of the lock owner to the server;

[0009] Receiving the verification result sent by the server;

[0010] Determine whether to unlock according to the verification result.

[0011] In a second aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0012] Receive the unlocking transaction identifier and the lock owner's public key sent by the electronic lock;

[0013] Obtaining the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier;

[0014] Verifying the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner;

[0015] The verification result is sent to the electronic lock.

[0016] In a third aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0017] Send an unlock transaction to the blockchain;

[0018] Obtaining an unlocking transaction identifier generated by the blockchain according to the unlocking transaction;

[0019] The unlocking transaction identifier is provided to the electronic lock.

[0020] In a fourth aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0021] Sending a create contract transaction to a blockchain, so that the blockchain deploys a smart contract according to the create contract transaction;

[0022] A transfer transaction is sent to the blockchain, so that the blockchain transfers the resources in the contract account from the authorized user to the access user according to the transfer transaction.

[0023] In a fifth aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0024] Deploy smart contracts in the blockchain based on the contract creation transaction sent by the authorization end;

[0025] According to the transfer transaction sent by the authorization end, the resources in the contract account are transferred from the authorized user to the access user;

[0026] The smart contract is called according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result;

[0027] Among them, the smart contract includes the public key of the authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly.

[0028] In a sixth aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0029] Get the unlocking transaction identifier generated by the blockchain;

[0030] Obtaining the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier;

[0031] Verifying the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner;

[0032] Determine whether to unlock based on the verification result.

[0033] In a seventh aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0034] The authorization end sends a contract creation transaction to the blockchain;

[0035] The blockchain deploys a smart contract according to the create contract transaction; wherein the smart contract includes a public key of an authorized user;

[0036] The authorization end sends a transfer transaction to the blockchain;

[0037] The blockchain transfers the resources in the contract account from the authorized user to the accessing user according to the transfer transaction;

[0038] The access terminal sends an unlocking transaction to the blockchain;

[0039] The blockchain calls the smart contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; wherein the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly;

[0040] The access terminal obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock;

[0041] The electronic lock sends the unlocking transaction identifier and the stored public key of the lock owner to the service end;

[0042] The server obtains the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verifies the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner, and sends the verification result to the electronic lock;

[0043] The electronic lock determines whether to unlock according to the verification result.

[0044] In an eighth aspect, an embodiment of the present invention provides a lock control method based on blockchain, comprising:

[0045] The authorization end sends a contract creation transaction to the blockchain;

[0046] The blockchain deploys a smart contract according to the create contract transaction; wherein the smart contract includes a public key of an authorized user;

[0047] The authorization end sends a transfer transaction to the blockchain;

[0048] The blockchain transfers the resources in the contract account from the authorized user to the accessing user according to the transfer transaction;

[0049] The access terminal sends an unlocking transaction to the blockchain;

[0050] The blockchain calls the smart contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; wherein the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly;

[0051] The access terminal obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock;

[0052] The electronic lock obtains the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verifies the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, and determines whether to unlock according to the verification result.

[0053] In a ninth aspect, an embodiment of the present invention provides an electronic lock, comprising:

[0054] An acquisition module, configured to acquire an unlocking transaction identifier generated by the blockchain;

[0055] A sending module, configured to send the unlocking transaction identifier and the stored public key of the lock owner to the server;

[0056] A receiving module, configured to receive the verification result sent by the server;

[0057] The unlocking module is configured to determine whether to unlock the door according to the verification result.

[0058] In a tenth aspect, an embodiment of the present invention provides a server, including:

[0059] A receiving module configured to receive an unlocking transaction identifier and a public key of a lock owner sent by the electronic lock;

[0060] An acquisition module, configured to acquire an unlocking transaction result and a public key of an authorized user from the blockchain according to the unlocking transaction identifier;

[0061] a verification module configured to verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner;

[0062] The sending module is configured to send the verification result to the electronic lock.

[0063] In an eleventh aspect, an embodiment of the present invention provides an access terminal, including:

[0064] A sending module, configured to send an unlocking transaction to the blockchain;

[0065] An acquisition module is configured to acquire an unlocking transaction identifier generated by the blockchain according to the unlocking transaction;

[0066] The sending module is configured to provide the unlocking transaction identifier to the electronic lock.

[0067] In a twelfth aspect, an embodiment of the present invention provides an authorization terminal, including:

[0068] A first sending module is configured to send a create contract transaction to a blockchain, so that the blockchain deploys a smart contract according to the create contract transaction;

[0069] The second sending module is configured to send a transfer transaction to the blockchain, so that the blockchain transfers the resources in the contract account from the authorized user to the access user according to the transfer transaction.

[0070] In a thirteenth aspect, an embodiment of the present invention provides a blockchain, including:

[0071] A creation module configured to deploy a smart contract in the blockchain based on a create contract transaction sent by an authorization end;

[0072] A transfer module, configured to transfer resources in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorization end;

[0073] A calling module, configured to call the smart contract according to the unlocking transaction sent by the access terminal, and generate an unlocking transaction identifier and an unlocking transaction result;

[0074] Among them, the smart contract includes the public key of the authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly.

[0075] In a fourteenth aspect, an embodiment of the present invention provides an electronic lock, comprising:

[0076] An acquisition module is configured to acquire an unlocking transaction identifier generated by a blockchain; and acquire an unlocking transaction result and a public key of an authorized user from the blockchain according to the unlocking transaction identifier;

[0077] a verification module configured to verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner;

[0078] The unlocking module is configured to determine whether to unlock the door according to the verification result.

[0079] In a fifteenth aspect, an embodiment of the present invention provides a lock control system based on blockchain, including:

[0080] The authorization terminal is used to send a contract creation transaction to the blockchain; send a transfer transaction to the blockchain;

[0081] The blockchain is used to deploy a smart contract according to the contract creation transaction; wherein the smart contract includes a public key of an authorized user; according to the transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to the unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly;

[0082] An access terminal is used to send an unlocking transaction to the blockchain; obtain the unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock;

[0083] The electronic lock is used to send the unlocking transaction identifier and the stored public key of the lock owner to the service end; determine whether to unlock the lock according to the verification result;

[0084] The server is used to obtain the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner, and send the verification result to the electronic lock.

[0085] In a sixteenth aspect, an embodiment of the present invention provides a lock control system based on blockchain, including:

[0086] The authorization terminal is used to send a contract creation transaction to the blockchain; send a transfer transaction to the blockchain;

[0087] The blockchain is used to deploy a smart contract according to the contract creation transaction; wherein the smart contract includes a public key of an authorized user; according to the transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to the unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly;

[0088] An access terminal is used to send an unlocking transaction to the blockchain; obtain the unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock;

[0089] The electronic lock is used to obtain the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, and determine whether to unlock according to the verification result.

[0090] In a seventeenth aspect, an embodiment of the present invention provides an electronic device, including:

[0091] one or more processors;

[0092] a storage device for storing one or more programs,

[0093] When the one or more programs are executed by the one or more processors, the one or more processors implement the methods described in the first to sixth aspects above.

[0094] In an eighteenth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the method described in any of the above embodiments is implemented.

[0095] One embodiment of the above invention has the following advantages or beneficial effects: for the unlocking transaction initiated by the current user, on the one hand, the blockchain verifies whether the current user is an authorized user based on the smart contract, and on the other hand, the server or the electronic lock can determine whether the authorized user is the lock owner by comparing the public key of the lock owner with the public key of the authorized user, and determine whether to unlock the electronic lock based on the verification results of the above two aspects, which can improve the security of remote control of the electronic lock. The embodiment of the present invention saves the ownership of the electronic lock in the blockchain in the form of resources to prevent the ownership of the electronic lock from being obtained by illegal users. At the same time, temporary passwords or private keys of authorized users and other information are not transmitted in the network, further improving the security of the electronic lock.

[0096] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0098] Figure 1 is a flow chart of a blockchain-based lock control method applied to an electronic lock provided by an embodiment of the present invention;

[0099] Figure 2 It is a flowchart of a blockchain-based lock control method applied to a server provided by an embodiment of the present invention;

[0100] Figure 3 is a flowchart of a blockchain-based lock control method applied to an access terminal provided by an embodiment of the present invention;

[0101] Figure 4 is a flowchart of a blockchain-based lock control method applied to an authorization end provided by an embodiment of the present invention;

[0102] Figure 5 is a flowchart of a blockchain-based lock control method applied to a blockchain provided by an embodiment of the present invention;

[0103] Figure 6 is a flow chart of a blockchain-based lock control method applied to an electronic lock provided by another embodiment of the present invention;

[0104] Figure 7 is a flowchart of a blockchain-based lock control method applied to a lock control system provided by an embodiment of the present invention;

[0105] Figure 8 is a flowchart of a blockchain-based lock control method applied to a lock control system provided by another embodiment of the present invention;

[0106] Fig. 9 is a schematic diagram of an electronic lock provided by an embodiment of the present invention;

[0107] Fig.10 is a schematic diagram of a server provided by an embodiment of the present invention;

[0108] Fig.11 is a schematic diagram of an access terminal provided by an embodiment of the present invention;

[0109] Fig.12 is a schematic diagram of an authorization terminal provided by an embodiment of the present invention;

[0110] Fig.13 is a schematic diagram of a blockchain provided by an embodiment of the present invention;

[0111] Fig.14 is a schematic diagram of an electronic lock provided by another embodiment of the present invention;

[0112] Fig.15 is a schematic diagram of a blockchain-based lock control system provided by an embodiment of the present invention;

[0113] Fig.16 is a schematic diagram of a blockchain-based lock control system provided by another embodiment of the present invention;

[0114] Fig.17 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0115] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0116] like Figure 1 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to an electronic lock. The method includes:

[0117] Step 101: Obtain the unlocking transaction identifier generated by the blockchain.

[0118] The blockchain distinguishes different unlocking transactions through unlocking transaction identifiers. For example, the current user can initiate different unlocking transactions to the blockchain at different time points. The blockchain can distinguish different unlocking transactions through unlocking transaction identifiers. The unlocking transaction identifier can be a transaction hash. In some application scenarios, the smart contract address can also be used as the unlocking transaction identifier.

[0119] Step 102: Send the unlocking transaction identifier and the stored public key of the lock owner to the server.

[0120] The lock owner's public key can be pre-stored in the electronic lock by the lock owner. The server can obtain the authorized user's public key and unlocking transaction result from the blockchain based on the unlocking transaction identifier. The lock owner's public key is used to verify the identity of the authorized user. If the authorized user's public key is the same as the lock owner's public key, it means that the authorized user is the lock owner.

[0121] The unlocking transaction results include success or failure. The success of the unlocking transaction is used to indicate that the unlocking transaction has passed the verification of the blockchain, and the failure of the unlocking transaction is used to indicate that the unlocking transaction has not passed the verification of the blockchain.

[0122] Step 103: Receive the verification result sent by the server.

[0123] Step 104: Determine whether to unlock the door based on the verification result.

[0124] The verification result is used to indicate whether the unlocking transaction is legal. If it is legal, the electronic lock is opened; otherwise, the electronic lock remains closed.

[0125] In one embodiment of the present invention, the method may further include: sending an unlocking result notification to the access terminal. For example, if the electronic lock is opened, the electronic lock sends an unlocking success notification to the access terminal, otherwise it sends an unlocking failure notification.

[0126] In an embodiment of the present invention, the electronic lock can provide the unlocking transaction identifier to the server, so that the server can obtain the unlocking transaction related information from the blockchain according to the unlocking transaction identifier, thereby verifying the unlocking transaction. In this process, the electronic lock does not transmit information such as private keys or temporary passwords to other parties, preventing such information from being obtained by illegal users, thereby improving the security of the electronic lock.

[0127] In one embodiment of the present invention, sending the unlocking transaction identifier and the stored public key of the lock owner to the server includes:

[0128] The unlocking transaction identifier, the stored public key of the lock owner and the identifier of the electronic lock are sent to the server.

[0129] Considering that a lock owner may own multiple electronic locks, in order to distinguish authorized electronic locks, the embodiment of the present invention also provides the identifier of the current lock to the server.

[0130] like Figure 2 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to a server, including:

[0131] Step 201: receiving the unlocking transaction identifier and the public key of the lock owner sent by the electronic lock.

[0132] Step 202: Obtain the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier.

[0133] Step 203: Verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner.

[0134] Step 204: Send the verification result to the electronic lock.

[0135] The server verifies the legitimacy of unlocking transactions from multiple angles, which can improve the security of electronic locks.

[0136] In one embodiment of the present invention, the unlocking transaction is verified according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner, including:

[0137] Determine whether the unlocking transaction is successfully executed according to the unlocking transaction result. If yes, determine whether the public key of the authorized user and the public key of the lock owner are the same. If yes, determine that the unlocking transaction verification is passed.

[0138] The embodiments of the present invention can conveniently verify the legitimacy of the accessing user, the validity of the unlocking transaction, etc. based on the unlocking transaction result. Based on the comparison between the public key of the authorized user and the public key of the lock owner, it can be determined whether the authorized user is the lock owner. The unlocking transaction can be verified from the perspectives of the authorized user and the accessing user, thereby improving the security of the electronic lock. In actual application scenarios, it is also possible to first determine whether the public key of the authorized user is the same as the public key of the lock owner. If they are the same, then determine whether the unlocking transaction is successfully executed based on the unlocking transaction result. Of course, the two verification processes can also be performed simultaneously.

[0139] In one embodiment of the present invention, receiving the unlocking transaction identifier and the public key of the lock owner sent by the electronic lock includes:

[0140] Receiving the unlocking transaction identifier, the public key of the lock owner and the identifier of the electronic lock sent by the electronic lock;

[0141] Obtain the unlock transaction result and the public key of the authorized user from the blockchain according to the unlock transaction identifier, including:

[0142] Obtain the authorized lock identifier, unlocking transaction timestamp, unlocking transaction result, and authorized user's public key from the blockchain according to the unlocking transaction identifier;

[0143] If the public key of the authorized user is the same as the public key of the lock owner, the method further comprises:

[0144] Determine whether the identification of the authorization lock and the identification of the electronic lock are the same. If so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold. If so, perform a check to determine whether the unlocking transaction has passed.

[0145] The embodiment of the present invention verifies the validity of the unlocking transaction through the timestamp of the unlocking transaction, ensuring the safety of the electronic lock after the time threshold has passed. The lock identification verifies whether the electronic lock is an authorized lock to avoid affecting the safety of other locks of the lock owner. The public key of the lock owner verifies whether the authorized user is the lock owner to prevent illegal users from impersonating the lock owner to authorize other users.

[0146] like Figure 3 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to an access terminal. The method includes:

[0147] Step 301: Send an unlock transaction to the blockchain.

[0148] If the user wants to open the electronic lock, he needs to send an unlocking transaction to the blockchain through the access terminal to trigger the blockchain to execute the unlocking method.

[0149] Step 302: Obtain the unlock transaction identifier generated by the blockchain based on the unlock transaction.

[0150] Step 303: Provide the unlocking transaction identifier to the electronic lock.

[0151] The access end triggers the verification process of the blockchain and the server by initiating an unlocking transaction. This verification process is implemented based on the blockchain, which can prevent the rights and interests information of the electronic lock from being tampered with and improve the security of the entire control process.

[0152] In one embodiment of the present invention, providing the unlocking transaction identifier to the electronic lock includes:

[0153] A QR code is generated according to the unlocking transaction identifier; and the QR code is displayed so that the electronic lock can obtain the unlocking transaction identifier by scanning the QR code.

[0154] In the embodiment of the present invention, the electronic lock can obtain the unlocking transaction identification more conveniently by scanning the QR code. In the actual application scenario, the electronic lock can also obtain the unlocking transaction identification by scanning the barcode. The current user can also view the unlocking transaction identification through the installed access terminal and manually input the unlocking transaction identification into the electronic lock.

[0155] like Figure 4 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to an authorization end, and the method also includes:

[0156] Step 401: Send a create contract transaction to the blockchain so that the blockchain deploys a smart contract according to the create contract transaction.

[0157] Step 402: Send a transfer transaction to the blockchain, so that the blockchain transfers the resources in the contract account from the authorized user to the access user according to the transfer transaction.

[0158] The authorized user can publish the resources to be authorized to the access user to the blockchain by creating a contract transaction. The resources in the contract account are used to represent the key of the electronic lock. The authorized user can transfer the resources in his contract account to the access user through a transfer transaction, that is, transfer the key of the electronic lock to the access user. The embodiment of the present invention stores the key of the electronic lock in the form of resources in the blockchain, and the authorized user can authorize other users to use the key of the electronic lock through the authorization terminal. Due to the immutability of the blockchain, the key of the electronic lock can be circulated more safely between users, ensuring the safety of the electronic lock.

[0159] like Figure 5 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to blockchain. The method includes:

[0160] Step 501: Deploy the smart contract in the blockchain according to the create contract transaction sent by the authorization end.

[0161] Step 502: According to the transfer transaction sent by the authorization end, the resources in the contract account are transferred from the authorized user to the access user.

[0162] Step 503: Call the smart contract according to the unlock transaction sent by the access terminal to generate an unlock transaction identifier and an unlock transaction result.

[0163] Among them, the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly.

[0164] The blockchain stores the keys of electronic locks in the form of resources. Authorized users transfer the keys of electronic locks by transferring resources, and the owner of the resources has the right to unlock the locks. Users can initiate unlocking transactions for the resources in their accounts. For example, the resources in user A's account represent the keys of electronic lock a. If user A wants to open electronic lock a, user A initiates an unlocking transaction, which is used to call the smart contract corresponding to the resource. In one embodiment of the present invention, the transfer transaction includes: accessing the public key of the user;

[0165] Smart contracts also include: validity period;

[0166] The smart contract is called according to the unlock transaction sent by the access end to generate the unlock transaction identifier and unlock transaction result, including:

[0167] Verify whether the current user is the access user based on the public key of the access user. If so, call the unlocking method in the smart contract to determine whether the current time is within the valid time period. If so, generate an unlocking transaction identifier and an unlocking transaction result to indicate that the unlocking transaction is successfully executed.

[0168] The authorized user and the access user can agree in advance on a valid time period, for example, 14:00-18:00.

[0169] In the embodiment of the present invention, the unlocking transaction is signed with the private key of the accessing user. Therefore, the embodiment of the present invention verifies the signature by the public key of the accessing user to determine whether the current user who sends the unlocking transaction is the accessing user who holds the resource. The present invention verifies the unlocking transaction from the two perspectives of valid time and accessing user to improve the security of the electronic lock. In the actual application scenario, it is possible to first verify whether the current time is within the valid time period, and then verify whether the current user is the accessing user. The two verification processes can also be verified simultaneously.

[0170] In one embodiment of the present invention, the smart contract is an NFT (Non-Fungible Token) smart contract, and the resource is an NFT. In actual application scenarios, NFTs can be issued on the blockchain based on ERC-721, ERC-1155 protocols, etc. NFTs can be used as key certificates to facilitate transfers. If an authorized user authorizes multiple electronic locks, multiple smart contracts can be deployed in the blockchain, and each smart contract corresponds to an NFT.

[0171] like Figure 6 As shown, an embodiment of the present invention provides a lock control method based on blockchain, which is applied to an electronic lock. The method includes:

[0172] Step 601: Obtain the unlocking transaction identifier generated by the blockchain.

[0173] Step 602: Obtain the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier.

[0174] Step 603: Verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner.

[0175] Step 604: Determine whether to unlock the door based on the verification result.

[0176] The embodiment of the present invention integrates the functions of the server in the above embodiment into the electronic lock, shortens the control process and improves the control efficiency. The server is separated from the electronic lock to reduce the cost of the electronic lock.

[0177] In one embodiment of the present invention, the unlocking transaction is verified according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, including:

[0178] Determine whether the unlocking transaction is successfully executed according to the unlocking transaction result. If yes, determine whether the public key of the authorized user and the public key of the lock owner are the same. If yes, determine that the unlocking transaction verification is passed.

[0179] In one embodiment of the present invention, obtaining the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier includes:

[0180] Obtain the authorized lock identifier, unlocking transaction timestamp, unlocking transaction result, and authorized user's public key from the blockchain according to the unlocking transaction identifier;

[0181] If the public key of the authorized user is the same as the public key of the lock owner, the method further comprises:

[0182] Determine whether the identification of the authorization lock and the identification of the electronic lock are the same. If so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold. If so, perform a check to determine whether the unlocking transaction has passed.

[0183] like Figure 7 As shown, an embodiment of the present invention provides a blockchain-based lock control method, which is applied to a blockchain-based lock control system. The method includes:

[0184] Step 701: The authorization end sends a create contract transaction to the blockchain.

[0185] The access user and the authorized user communicate in advance to determine the valid time period, such as 8:00-9:00.

[0186] Step 702: The blockchain deploys a smart contract based on the creation of the contract transaction; wherein the smart contract includes the public key of the authorized user.

[0187] This smart contract is an NFT smart contract, which records the following information: the identification of the authorized lock, the effective time period, the public key of the authorized user, and the unlocking method. Call the unlocking method to execute: determine whether the current time is within the effective time period. If so, the unlocking transaction result is successful, otherwise, the unlocking transaction result is failed. The signature of the NFT owner must be held when calling the unlocking method, that is, the unlocking transaction must be signed with the private key of the access user. The public key of the authorized user and the identification of the authorized lock are not allowed to be modified, but the authorized user can modify the effective time period.

[0188] The creation contract transaction is signed with the private key of the authorized user. The blockchain can verify whether the creation contract transaction is initiated by the authorized user based on the public key of the authorized user included in the creation contract transaction. If the public key carried in the creation contract transaction does not match the private key used for the signature, the blockchain will not respond to the creation contract transaction to prevent illegal users from endangering the security of the electronic lock.

[0189] After the smart contract is deployed on the blockchain, an NFT is obtained in the contract account, which can be transferred to other users.

[0190] The authorization end and the access end may be a blockchain wallet, or other applications that can implement the embodiments of the present invention.

[0191] Step 703: The authorization end sends the transfer transaction to the blockchain.

[0192] Before step 703, the guest user provides his public key to the authorized user, which can be done verbally or through the access terminal. The transfer transaction may include the address of the contract account, the public key of the authorized user, and other information.

[0193] Step 704: The blockchain transfers the resources in the contract account from the authorized user to the accessing user based on the transfer transaction.

[0194] After the smart contract is deployed on the blockchain, the authorized user can view the NFT he holds through the blockchain wallet and transfer it to the visiting user through the blockchain wallet. After the blockchain transfers the NFT from the authorized user to the visiting user, the visiting user can receive the NFT from the authorized user in his blockchain wallet.

[0195] The transfer transaction is signed with the private key of the authorized user, and the blockchain can verify whether the transfer transaction is legal based on the public key of the authorized user.

[0196] In actual application scenarios, a transfer transaction may also include a transfer method, which determines whether the transfer transaction is signed with the private key of the authorized user. Specifically, the blockchain calls the transfer method in the smart contract according to the transfer transaction to determine whether the transfer transaction is signed with the private key of the authorized user. If so, the resources in the contract account are transferred from the authorized user to the access user.

[0197] The smart contract can also include the attribute: owner, which is used to record the holder of the electronic lock key, that is, the holder of the resource.

[0198] Step 705: The access end sends an unlocking transaction to the blockchain.

[0199] The access end sends an unlocking transaction to the blockchain for the NFT held by the accessing user, and the unlocking transaction is signed with the accessing user's private key.

[0200] Step 706: The blockchain calls the smart contract according to the unlocking transaction and generates an unlocking transaction identifier and an unlocking transaction result; wherein the authorized user's public key, unlocking transaction identifier and unlocking transaction result are stored correspondingly.

[0201] The blockchain calls the unlocking method in the smart contract according to the unlocking transaction and obtains the unlocking transaction result and transaction hash.

[0202] Step 707: The access end obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock.

[0203] The access end queries the blockchain and obtains the transaction hash. The electronic lock obtains the transaction hash by scanning the QR code.

[0204] Step 708: The electronic lock sends the unlocking transaction identifier and the stored public key of the lock owner to the server.

[0205] The electronic lock sends the pre-stored lock owner's public key and transaction hash to the server.

[0206] Step 709: The server obtains the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verifies the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner, and sends the verification result to the electronic lock.

[0207] Step 710: The electronic lock determines whether to unlock based on the verification result.

[0208] For the unlocking transaction initiated by the current user, on the one hand, the blockchain verifies whether the current user is an authorized user based on the smart contract. On the other hand, the server or the electronic lock can determine whether the authorized user is the lock owner by comparing the public key of the lock owner with the public key of the authorized user. The verification results of the above two aspects are combined to determine whether to open the electronic lock, which can improve the security of remote control of the electronic lock. The embodiment of the present invention saves the ownership of the electronic lock in the blockchain in the form of resources to prevent the ownership of the electronic lock from being obtained by illegal users. At the same time, temporary passwords or private keys of authorized users and other information are not transmitted in the network, further improving the security of the electronic lock.

[0209] like Figure 8 As shown, an embodiment of the present invention provides a lock control method based on blockchain, including:

[0210] Step 801: The authorization end sends a create contract transaction to the blockchain.

[0211] Step 802: The blockchain deploys a smart contract based on the creation of the contract transaction; wherein the smart contract includes the public key of the authorized user.

[0212] Step 803: The authorization end sends a transfer transaction to the blockchain.

[0213] Step 804: The blockchain transfers the resources in the contract account from the authorized user to the accessing user based on the transfer transaction.

[0214] Step 805: The access end sends an unlocking transaction to the blockchain.

[0215] Step 806: The blockchain calls the smart contract according to the unlocking transaction and generates an unlocking transaction identifier and an unlocking transaction result; wherein the authorized user's public key, unlocking transaction identifier and unlocking transaction result are stored correspondingly.

[0216] Step 807: The access end obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock.

[0217] Step 808: The electronic lock obtains the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verifies the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, and determines whether to unlock the lock according to the verification result.

[0218] The embodiment of the present invention integrates the functions of the server in the above-mentioned embodiment into the electronic lock, shortens the control process and improves the control efficiency.

[0219] like Fig. 9 As shown, an embodiment of the present invention provides an electronic lock, comprising:

[0220] An acquisition module 901 is configured to acquire an unlocking transaction identifier generated by a blockchain;

[0221] The sending module 902 is configured to send the unlocking transaction identifier and the stored public key of the lock owner to the server;

[0222] The receiving module 903 is configured to receive the verification result sent by the server;

[0223] The unlocking module 904 is configured to determine whether to unlock the door according to the verification result.

[0224] In one embodiment of the present invention, the sending module 902 is configured to send the unlocking transaction identifier, the stored public key of the lock owner and the identifier of the electronic lock to the server.

[0225] like Fig.10 As shown, an embodiment of the present invention provides a server, including:

[0226] The receiving module 1001 is configured to receive the unlocking transaction identifier and the public key of the lock owner sent by the electronic lock;

[0227] The acquisition module 1002 is configured to obtain the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier;

[0228] A verification module 1003 is configured to verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner;

[0229] The sending module 1004 is configured to send the verification result to the electronic lock.

[0230] In one embodiment of the present invention, the verification module 1003 is configured to determine whether the unlocking transaction is successfully executed based on the unlocking transaction result. If so, determine whether the public key of the authorized user and the public key of the lock owner are the same. If so, determine that the unlocking transaction verification is passed.

[0231] In one embodiment of the present invention, the receiving module 1001 is configured to receive the unlocking transaction identifier, the public key of the lock owner and the identifier of the electronic lock sent by the electronic lock; the obtaining module 1002 is configured to obtain the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; the verification module 1003 is configured to determine whether the identifier of the authorized lock and the identifier of the electronic lock are the same, if so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, execute to determine whether the unlocking transaction verification is passed.

[0232] like Fig.11 As shown, an embodiment of the present invention provides an access terminal, including:

[0233] The sending module 1101 is configured to send an unlocking transaction to the blockchain; and provide an unlocking transaction identifier to the electronic lock.

[0234] The acquisition module 1102 is configured to obtain an unlocking transaction identifier generated by the blockchain according to the unlocking transaction.

[0235] In one embodiment of the present invention, the sending module 1101 is configured to generate a QR code according to the unlocking transaction identifier; and display the QR code so that the electronic lock can obtain the unlocking transaction identifier by scanning the QR code.

[0236] like Fig.12 As shown, an embodiment of the present invention provides an authorization terminal, including:

[0237] A creation module 1201 is configured to send a create contract transaction to the blockchain, so that the blockchain deploys the smart contract according to the create contract transaction;

[0238] The transfer module 1202 is configured to send a transfer transaction to the blockchain, so that the blockchain transfers the resources in the contract account from the authorized user to the access user according to the transfer transaction.

[0239] like Fig.13 As shown, an embodiment of the present invention provides a blockchain, including:

[0240] A creation module 1301 is configured to deploy a smart contract in the blockchain according to a create contract transaction sent by an authorization end;

[0241] The transfer module 1302 is configured to transfer the resources in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorization end;

[0242] The calling module 1303 is configured to call the smart contract according to the unlocking transaction sent by the access terminal, and generate an unlocking transaction identifier and an unlocking transaction result;

[0243] Among them, the smart contract includes the public key of the authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly.

[0244] In one embodiment of the present invention, the transfer transaction includes: the public key of the accessing user; the smart contract also includes: the valid time period; the calling module 1303 is configured to verify whether the current user is the accessing user based on the public key of the accessing user, and if so, call the unlocking method in the smart contract to determine whether the current time is within the valid time period, and if so, generate an unlocking transaction identifier and an unlocking transaction result for indicating that the unlocking transaction is successfully executed.

[0245] In one embodiment of the present invention, the smart contract is a non-fungible token NFT smart contract, and the resource is NFT.

[0246] like Fig.14 As shown, an embodiment of the present invention provides an electronic lock, comprising:

[0247] The acquisition module 1401 is configured to acquire an unlocking transaction identifier generated by the blockchain; and acquire an unlocking transaction result and a public key of an authorized user from the blockchain according to the unlocking transaction identifier;

[0248] A verification module 1402, configured to verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner;

[0249] The unlocking module 1403 is configured to determine whether to unlock the door according to the verification result.

[0250] In one embodiment of the present invention, the verification module 1402 is configured to determine whether the unlocking transaction is successfully executed based on the unlocking transaction result. If so, determine whether the public key of the authorized user and the public key of the lock owner are the same. If so, determine that the unlocking transaction verification is passed.

[0251] In one embodiment of the present invention, the acquisition module 1401 is configured to obtain the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; the verification module 1402 is configured to determine whether the identifier of the authorized lock and the identifier of the electronic lock are the same, and if so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, execute to determine whether the unlocking transaction verification is passed.

[0252] like Fig.15 As shown, an embodiment of the present invention provides a lock control system based on blockchain, including:

[0253] Authorization terminal 1501 is used to send a contract creation transaction to blockchain 1502; send a transfer transaction to blockchain 1502;

[0254] Blockchain 1502 is used to deploy a smart contract according to a create contract transaction; wherein the smart contract includes a public key of an authorized user; according to a transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to an unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly;

[0255] The access terminal 1503 is used to send an unlocking transaction to the blockchain 1502; obtain an unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock 1504;

[0256] The electronic lock 1504 is used to send an unlocking transaction identifier and a stored public key of the lock owner to the server 1505; and determine whether to unlock the lock according to the verification result;

[0257] The server 1505 is used to obtain the unlocking transaction result and the public key of the authorized user from the blockchain 1502 according to the unlocking transaction identifier, verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner, and send the verification result to the electronic lock 1504.

[0258] like Fig.16 As shown, an embodiment of the present invention provides a lock control method based on blockchain, including:

[0259] Authorization terminal 1601 is used to send a contract creation transaction to blockchain 1602; send a transfer transaction to blockchain 1602;

[0260] Blockchain 1602 is used to deploy a smart contract according to a create contract transaction; wherein the smart contract includes a public key of an authorized user; according to a transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to an unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly;

[0261] The access terminal 1603 is used to send an unlocking transaction to the blockchain 1602; obtain an unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock 1604;

[0262] The electronic lock 1604 is used to obtain the unlocking transaction result and the public key of the authorized user from the blockchain 1602 according to the unlocking transaction identifier, verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, and determine whether to unlock the lock according to the verification result.

[0263] An embodiment of the present invention provides an electronic device, including:

[0264] one or more processors;

[0265] a storage device for storing one or more programs,

[0266] When one or more programs are executed by one or more processors, the one or more processors implement methods such as those applied to the authorization end, electronic lock, blockchain, access end, and service end.

[0267] An embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, a method applied to an authorization end, an electronic lock, a blockchain, an access end, and a service end is implemented.

[0268] Reference below Fig.17 , which shows a schematic diagram of the structure of a computer system 1700 of a terminal device suitable for implementing an embodiment of the present invention. Fig.17The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0269] like Fig.17 As shown, the computer system 1700 includes a central processing unit (CPU) 1701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1702 or a program loaded from a storage part 1708 into a random access memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the system 1700 are also stored. The CPU 1701, the ROM 1702, and the RAM 1703 are connected to each other via a bus 1704. An input / output (I / O) interface 1705 is also connected to the bus 1704.

[0270] The following components are connected to the I / O interface 1705: an input section 1706 including a keyboard, a mouse, etc.; an output section 1707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1708 including a hard disk, etc.; and a communication section 1709 including a network interface card such as a LAN card, a modem, etc. The communication section 1709 performs communication processing via a network such as the Internet. A drive 1710 is also connected to the I / O interface 1705 as needed. A removable medium 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as needed, so that a computer program read therefrom is installed into the storage section 1708 as needed.

[0271] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1709, and / or installed from the removable medium 1711. When the computer program is executed by the central processing unit (CPU) 1701, the above-mentioned functions defined in the system of the present invention are executed.

[0272] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0273] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0274] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."

[0275] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A lock control method based on blockchain, applied to electronic locks, characterized in that: include: Obtaining an unlocking transaction identifier generated by the blockchain; the unlocking transaction identifier includes a transaction hash; Send the unlocking transaction identifier, the stored public key of the lock owner and the identifier of the electronic lock to the server; so that the server can obtain the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; determine whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determine whether the public key of the authorized user is the same as the public key of the lock owner; if so, determine that the unlocking transaction verification is passed; Alternatively, if the public key of the authorized user is the same as the public key of the lock owner, determining whether the identification of the authorized lock is the same as the identification of the electronic lock, and if so, determining whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, executing the determination that the unlocking transaction verification is passed to obtain a verification result; Receiving the verification result sent by the server; The verification result is used to indicate whether the unlocking transaction is legal; Determine whether to unlock according to the verification result.

2. A lock control method based on blockchain, applied to the server, characterized in that: include: Receiving an unlocking transaction identifier sent by an electronic lock, a public key of a lock owner, and an identifier of the electronic lock; the unlocking transaction identifier includes a transaction hash; Obtaining the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; Verifying the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner; The verifying the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner includes: Determine whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determine whether the public key of the authorized user and the public key of the lock owner are the same, and if so, determine that the unlocking transaction verification is passed; The obtaining the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier includes: Acquire the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result, and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; If the public key of the authorized user is the same as the public key of the lock owner, the method further comprises: Determine whether the identification of the authorization lock and the identification of the electronic lock are the same, if yes, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, if yes, perform the determination that the unlocking transaction verification is passed; A verification result is sent to the electronic lock, where the verification result is used to indicate whether the unlocking transaction is legal.

3. A blockchain-based lock control method, applied to a blockchain-based lock control system, characterized in that: include: The authorization end sends a contract creation transaction to the blockchain; The blockchain deploys a smart contract according to the create contract transaction; wherein the smart contract includes a public key of an authorized user; The authorization end sends a transfer transaction to the blockchain; The blockchain transfers the resources in the contract account from the authorized user to the accessing user according to the transfer transaction; The access terminal sends an unlocking transaction to the blockchain; The blockchain calls the smart contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; wherein the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly; the unlocking transaction identifier includes a transaction hash; The access terminal obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock; The electronic lock sends the unlocking transaction identifier and the stored public key of the lock owner and the identifier of the electronic lock to the service end; The server obtains the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; determines whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determines whether the public key of the authorized user and the public key of the lock owner are the same; if so, determines that the unlocking transaction verification is passed; or, if the public key of the authorized user and the public key of the lock owner are the same, determines whether the identifier of the authorized lock and the identifier of the electronic lock are the same, and if so, determines whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, executes the determination that the unlocking transaction verification is passed, obtains the verification result, and sends the verification result to the electronic lock; The electronic lock determines whether to unlock according to the verification result; the verification result is used to indicate whether the unlocking transaction is legal.

4. A blockchain-based lock control method, applied to a blockchain-based lock control system, characterized in that: include: The authorization end sends a contract creation transaction to the blockchain; The blockchain deploys a smart contract according to the create contract transaction; wherein the smart contract includes a public key of an authorized user; The authorization end sends a transfer transaction to the blockchain; The blockchain transfers the resources in the contract account from the authorized user to the accessing user according to the transfer transaction; The access terminal sends an unlocking transaction to the blockchain; The blockchain calls the smart contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; wherein the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are stored correspondingly; the unlocking transaction identifier includes a transaction hash; The access terminal obtains the unlocking transaction identifier and provides the unlocking transaction identifier to the electronic lock; The electronic lock obtains the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier, verifies the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the stored public key of the lock owner, and determines whether to unlock according to the verification result, and the verification result is used to indicate whether the unlocking transaction is legal; wherein, The access end and the authorization end are blockchain wallets.

5. An electronic lock, characterized in that: include: An acquisition module is configured to acquire an unlocking transaction identifier generated by a blockchain; the unlocking transaction identifier includes a transaction hash; a sending module configured to send the unlocking transaction identifier and the stored public key of the lock owner to the service end; and a sending module configured to send the unlocking transaction identifier, the stored public key of the lock owner and the identifier of the electronic lock to the service end; The server obtains the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; determines whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determines whether the public key of the authorized user and the public key of the lock owner are the same; if so, determines that the unlocking transaction verification is passed; or, if the public key of the authorized user and the public key of the lock owner are the same, determines whether the identifier of the authorized lock and the identifier of the electronic lock are the same, and if so, determines whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, determines that the unlocking transaction verification is passed to obtain a verification result; A receiving module, configured to receive the verification result sent by the server; The unlocking module is configured to determine whether to unlock the lock according to the verification result; the verification result is used to indicate whether the unlocking transaction is legal.

6. A server, characterized in that: include: A receiving module configured to receive an unlocking transaction identifier and a public key of a lock owner and an identifier of the electronic lock sent by the electronic lock; an acquisition module, configured to acquire an unlocking transaction result and a public key of an authorized user from a blockchain according to the unlocking transaction identifier; the unlocking transaction identifier includes a transaction hash; a verification module configured to verify the unlocking transaction according to the unlocking transaction result, the public key of the authorized user and the public key of the lock owner; A sending module is configured to send a verification result to the electronic lock, wherein the verification result is used to indicate whether the unlocking transaction is legal; wherein: The verification module is configured to determine whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determine whether the public key of the authorized user and the public key of the lock owner are the same, and if so, determine that the unlocking transaction verification is passed; The acquisition module is configured to acquire the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result, and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; If the public key of the authorized user is the same as the public key of the lock owner, determine whether the identification of the authorized lock is the same as the identification of the electronic lock. If so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold. If so, execute the determination that the unlocking transaction verification has passed.

7. A lock control system based on blockchain, characterized in that: include: The authorization terminal is used to send a contract creation transaction to the blockchain; send a transfer transaction to the blockchain; The blockchain is used to deploy a smart contract according to the contract creation transaction; wherein the smart contract includes a public key of an authorized user; according to the transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to the unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly; The access terminal is used to send an unlocking transaction to the blockchain; obtain the unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock; the unlocking transaction identifier includes a transaction hash; The electronic lock is used to send the unlocking transaction identifier and the stored public key of the lock owner to the service end; determine whether to unlock the lock according to the verification result; The server is used to obtain the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain according to the unlocking transaction identifier; determine whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determine whether the public key of the authorized user and the public key of the lock owner are the same; if so, determine that the unlocking transaction verification is passed; or, if the public key of the authorized user and the public key of the lock owner are the same, determine whether the identifier of the authorized lock and the identifier of the electronic lock are the same, and if so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, execute the determination that the unlocking transaction verification is passed, obtain the verification result, and send the verification result to the electronic lock, and the verification result is used to characterize whether the unlocking transaction is legal; wherein, The access end and the authorization end are blockchain wallets.

8. A lock control system based on blockchain, characterized in that: include: The authorization terminal is used to send a contract creation transaction to the blockchain; send a transfer transaction to the blockchain; The blockchain is used to deploy a smart contract according to the create contract transaction; wherein the smart contract includes a public key of an authorized user; according to the transfer transaction, resources in the contract account are transferred from the authorized user to the access user; according to the unlock transaction, the smart contract is called to generate an unlock transaction identifier and an unlock transaction result; wherein the public key of the authorized user, the unlock transaction identifier and the unlock transaction result are stored correspondingly; the unlock transaction identifier includes a transaction hash; An access terminal is used to send an unlocking transaction to the blockchain; obtain the unlocking transaction identifier, and provide the unlocking transaction identifier to the electronic lock; The electronic lock is used to determine whether the unlocking transaction is successfully executed according to the unlocking transaction result, and if so, determine whether the public key of the authorized user and the public key of the lock owner are the same, and if so, determine that the unlocking transaction verification is passed; or, according to the unlocking transaction identifier, obtain the identifier of the authorized lock, the timestamp of the unlocking transaction, the unlocking transaction result and the public key of the authorized user from the blockchain; if the public key of the authorized user and the public key of the lock owner are the same, determine whether the identifier of the authorized lock and the identifier of the electronic lock are the same, and if so, determine whether the time interval between the timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, execute the determination that the unlocking transaction verification is passed to obtain a verification result; determine whether to unlock according to the verification result, and the verification result is used to characterize whether the unlocking transaction is legal; wherein, The access end and the authorization end are blockchain wallets.

9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as claimed in claim 1.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to claim 1 is implemented.

Citation Information

Patent Citations

  • Control method and device for intelligent lock and intelligent lock

    CN106875518A

  • Intelligent door unlocking method and system based on block chain technology

    CN110211263A

  • Configuration method and control method of intelligent lock, intelligent lock, equipment and storage medium

    CN111179476A