CN115035637A - Lock control method and system based on block chain and electronic lock - Google Patents

Lock control method and system based on block chain and electronic lock Download PDF

Info

Publication number
CN115035637A
CN115035637A CN202210590455.8A CN202210590455A CN115035637A CN 115035637 A CN115035637 A CN 115035637A CN 202210590455 A CN202210590455 A CN 202210590455A CN 115035637 A CN115035637 A CN 115035637A
Authority
CN
China
Prior art keywords
unlocking transaction
public key
transaction
unlocking
lock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210590455.8A
Other languages
Chinese (zh)
Inventor
王晓亮
卢缃梅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xita Technology Co ltd
Original Assignee
Beijing Xita Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xita Technology Co ltd filed Critical Beijing Xita Technology Co ltd
Priority to CN202210590455.8A priority Critical patent/CN115035637A/en
Publication of CN115035637A publication Critical patent/CN115035637A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00571Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated by interacting with a central unit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • G07C2009/00412Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks the transmitted data signal being encrypted

Abstract

The invention discloses a lock control method and system based on a block chain and an electronic lock, and relates to the technical field of computers. One embodiment of the method comprises: acquiring an unlocking transaction identifier generated by a block chain; sending the unlocking transaction identification and the stored public key of the lock master to a server; receiving a check result sent by the server; and determining whether to unlock according to the verification result. This embodiment can improve the security of electronic lock.

Description

Lock control method and system based on block chain and electronic lock
Technical Field
The invention relates to the technical field of computers, in particular to a lock control method and system based on a block chain and an electronic lock.
Background
The electronic lock is widely used due to the convenience of opening the door. In some practical scenarios, the lock owner is often required to grant unlocking authority to other users, such as temporary visitors, cleaning and the like.
In the prior art, a lock owner sets a temporary password for an electronic lock through an application installed in a terminal, informs an authorized user of the temporary password, and the authorized user inputs the temporary password in the electronic lock to unlock the electronic lock.
However, this method requires transmission of a temporary password in the network, and is low in security.
Disclosure of Invention
In view of this, embodiments of the present invention provide a lock control method and system based on a block chain, and an electronic lock, which can improve the security of the electronic lock.
In a first aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
acquiring an unlocking transaction identifier generated by a block chain;
sending the unlocking transaction identification and the stored public key of the lock master to a server;
receiving a check result sent by the server;
and determining whether to unlock according to the verification result.
In a second aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
receiving an unlocking transaction identifier and a public key of a lock master sent by an electronic lock;
acquiring an unlocking transaction result and a public key of an authorized user from a block chain 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;
and sending a verification result to the electronic lock.
In a third aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
sending an unlock transaction to the blockchain;
acquiring an unlocking transaction identifier generated by the block chain according to the unlocking transaction;
and providing the unlocking transaction identification to the electronic lock.
In a fourth aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
sending a create contract transaction to a blockchain to cause the blockchain to deploy intelligent contracts in accordance with the create contract transaction;
and sending a transfer transaction to the blockchain so that the blockchain transfers the resources in the contract account to the access user by the authorized user according to the transfer transaction.
In a fifth aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
deploying an intelligent contract in a block chain according to a contract creating transaction sent by an authorization end;
transferring the resource in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorized terminal;
calling the intelligent contract according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result;
the intelligent contract comprises a public key of the authorized user, and the public key of the authorized user, the unlocking transaction identification and the unlocking transaction result are correspondingly stored.
In a sixth aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
acquiring an unlocking transaction identifier generated by a block chain;
acquiring an unlocking transaction result and a public key of an authorized user from the block chain 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 stored public key of the lock master;
and determining whether to unlock according to the verification result.
In a seventh aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
the authorization end sends a contract creating transaction to the blockchain;
the block chain deploys intelligent contracts according to the contract creating transactions; the intelligent contract comprises 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 access user according to the transfer transaction;
the access terminal sends unlocking transaction to the blockchain;
the block chain calls the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal acquires the unlocking transaction identification and provides the unlocking transaction identification for the electronic lock;
the electronic lock sends the unlocking transaction identification and the stored public key of the lock master to a server side;
the server acquires the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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 a verification result to the electronic lock;
and the electronic lock determines whether to unlock according to the verification result.
In an eighth aspect, an embodiment of the present invention provides a lock control method based on a block chain, including:
the authorization end sends a contract creating transaction to the blockchain;
the block chain deploys intelligent contracts according to the contract creating transactions; the intelligent contract comprises 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 access user according to the transfer transaction;
the access terminal sends unlocking transaction to the blockchain;
the block chain calls the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal acquires the unlocking transaction identification and provides the unlocking transaction identification for the electronic lock;
the electronic lock acquires the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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.
In a ninth aspect, an embodiment of the present invention provides an electronic lock, including:
the acquisition module is configured to acquire an unlocking transaction identifier generated by the block chain;
the sending module is configured to send the unlocking transaction identifier and a stored public key of the lock master to a server side;
the receiving module is configured to receive the verification result sent by the server;
and the unlocking module is configured to determine whether to unlock according to the verification result.
In a tenth aspect, an embodiment of the present invention provides a server, including:
the receiving module is configured to receive the unlocking transaction identifier and the public key of the lock master sent by the electronic lock;
the obtaining module is configured to obtain an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier;
the verification module 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 master;
and the sending module is configured to send the verification result to the electronic lock.
In an eleventh aspect, an embodiment of the present invention provides an access terminal, including:
a sending module configured to send an unlock transaction to the blockchain;
the acquisition module is configured to acquire an unlocking transaction identifier generated by the blockchain according to the unlocking transaction;
a sending module configured to provide the unlocking transaction identification to the electronic lock.
In a twelfth aspect, an embodiment of the present invention provides an authorization end, including:
a first sending module configured to send a create contract transaction to a blockchain to cause the blockchain to deploy intelligent contracts according to the create contract transaction;
and the second sending module is configured to send the transfer transaction to the blockchain so that the blockchain transfers the resource in the contract account from the authorized user to the access user according to the transfer transaction.
In a thirteenth aspect, an embodiment of the present invention provides a block chain, including:
the creating module is configured to deploy the intelligent contracts in the block chain according to the contract creating transaction sent by the authorization terminal;
the transfer module is configured to transfer resources in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorized terminal;
the calling module is configured to call the intelligent contract according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result;
the intelligent contract comprises a public key of the authorized user, and the public key of the authorized user, the unlocking transaction identification and the unlocking transaction result are correspondingly stored.
In a fourteenth aspect, an embodiment of the present invention provides an electronic lock, including:
the acquisition module is configured to acquire the unlocking transaction identifier generated by the block chain; acquiring an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier;
the verification module is 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 master;
and the unlocking module is configured to determine whether to unlock according to the verification result.
In a fifteenth aspect, an embodiment of the present invention provides a lock control system based on a block chain, including:
the authorization end is used for sending a contract creating transaction to the blockchain; sending a transfer transaction to the blockchain;
the block chain is used for deploying intelligent contracts according to the contract creating transaction; the intelligent contract comprises a public key of an authorized user; transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction; calling the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal is used for sending unlocking transaction to the blockchain; acquiring the unlocking transaction identification, and providing the unlocking transaction identification for the electronic lock;
the electronic lock is used for sending the unlocking transaction identifier and a stored public key of a lock master to a server; determining whether to unlock according to the verification result;
the server is used for acquiring the unlocking transaction result and the public key of the authorized user from the block chain 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, and sending the verification result to the electronic lock.
In a sixteenth aspect, an embodiment of the present invention provides a lock control system based on a block chain, including:
the authorization end is used for sending a contract creating transaction to the blockchain; sending a transfer transaction to the blockchain;
the block chain is used for deploying intelligent contracts according to the contract creating transaction; the intelligent contract comprises a public key of an authorized user; transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction; calling the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal is used for sending unlocking transaction to the blockchain; acquiring the unlocking transaction identification, and providing the unlocking transaction identification for the electronic lock;
the electronic lock is used for acquiring the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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, and determining whether to unlock according to the verification result.
In a seventeenth aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method as described in the embodiments of the first to sixth aspects above.
In an eighteenth aspect, the present invention provides a computer readable medium, on which a computer program is stored, where the program is executed by a processor to implement the method according to any one of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: for the unlocking transaction initiated by the current user, on one hand, the blockchain verifies whether the current user is an authorized user based on the intelligent contract, on the other hand, the server side or the electronic lock can determine whether the authorized user is the lock master by comparing the public key of the lock master with the public key of the authorized user, and the verification results of the two aspects are integrated to determine whether to unlock the electronic lock, so that the safety of remote control of the electronic lock can be improved. The embodiment of the invention saves the ownership of the electronic lock in the block chain in a resource form, prevents the ownership of the electronic lock from being acquired by an illegal user, and simultaneously does not transmit information such as a temporary password or a private key of an authorized user in a network, thereby further improving the safety of the electronic lock.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a flowchart of a lock control method based on a block chain applied to an electronic lock according to an embodiment of the present invention;
fig. 2 is a flowchart of a block chain-based lock control method applied to a server according to an embodiment of the present invention;
fig. 3 is a flowchart of a lock control method based on a block chain applied to an access terminal according to an embodiment of the present invention;
fig. 4 is a flowchart of a lock control method based on a block chain applied to an authorized terminal according to an embodiment of the present invention;
FIG. 5 is a flowchart of a blockchain-based lock control method applied to a blockchain according to an embodiment of the present invention;
fig. 6 is a flowchart of a lock control method based on a blockchain applied to an electronic lock according to another embodiment of the present invention;
FIG. 7 is a flowchart of a blockchain-based lock control method applied to a lock control system according to an embodiment of the present invention;
fig. 8 is a flowchart of a lock control method based on a zone chain applied to a lock control system according to another embodiment of the present invention;
FIG. 9 is a schematic view of an electronic lock provided in accordance with an embodiment of the invention;
fig. 10 is a schematic diagram of a server according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of an access terminal according to an embodiment of the present invention;
fig. 12 is a schematic diagram of an authorized end according to an embodiment of the present invention;
FIG. 13 is a block chain diagram provided by one embodiment of the present invention;
FIG. 14 is a schematic view of an electronic lock provided in accordance with another embodiment of the present invention;
FIG. 15 is a schematic view of a blockchain-based lock control system provided by one embodiment of the present invention;
FIG. 16 is a schematic view of a blockchain-based lock control system provided in accordance with another embodiment of the present invention;
fig. 17 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to an electronic lock, and the method includes:
step 101: and acquiring an unlocking transaction identifier generated by the block chain.
The blockchain distinguishes different unlocking transactions through the unlocking transaction identifier, for example, a current user can initiate different unlocking transactions to the blockchain at different time points, and the blockchain can distinguish different unlocking transactions through the unlocking transaction identifier. The unlocking transaction identifier can be transaction hash, and in some application scenes, the intelligent contract address can also be used as the unlocking transaction identifier.
Step 102: and sending the unlocking transaction identification and the stored public key of the lock master to the server.
The public key of the lock master may be pre-stored in the electronic lock by the lock master. The server can obtain the public key of the authorized user and the unlocking transaction result from the blockchain based on the unlocking transaction identifier. The public key of the lock master is used for verifying the identity of the authorized user, and if the public key of the authorized user is the same as the public key of the lock master, the authorized user is the lock master.
The unlocking transaction result comprises success or failure, the successful unlocking transaction is used for representing that the unlocking transaction passes the verification of the block chain, and the failure of the unlocking transaction is used for representing that the unlocking transaction does not pass the verification of the block chain.
Step 103: and receiving a verification result sent by the server.
Step 104: and determining whether to unlock according to the verification result.
And the verification result is used for representing whether the unlocking transaction is legal or not, if so, the electronic lock is unlocked, and otherwise, the electronic lock is kept closed.
In one embodiment of the invention, the method may further comprise: and sending unlocking result notification to the access terminal. For example, if the electronic lock is unlocked, the electronic lock sends an unlocking success notification to the access terminal, otherwise, an unlocking failure notification is sent.
In the embodiment of the invention, the electronic lock can provide the unlocking transaction identifier for the server, so that the server can conveniently acquire the unlocking transaction related information from the block chain according to the unlocking transaction identifier, and the unlocking transaction is verified. In the process, the electronic lock and other parties do not transmit information such as a private key or a temporary password, so that the information is prevented from being acquired by an illegal user, and the safety of the electronic lock is improved.
In one embodiment of the present invention, sending the unlocking transaction identifier and the stored public key of the lock master to the server comprises:
and sending the unlocking transaction identifier, the stored public key of the lock master and the identifier of the electronic lock to the server.
In order to distinguish authorized electronic locks, embodiments of the present invention also provide an identification of the current lock to the server, considering that a lock master may hold multiple electronic locks.
As shown in fig. 2, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to a server and includes:
step 201: and receiving the unlocking transaction identification and the public key of the lock master sent by the electronic lock.
Step 202: and acquiring an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier.
Step 203: and 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.
Step 204: and sending a verification result to the electronic lock.
The server side checks the legality of the unlocking transaction from multiple angles, and the safety of the electronic lock can be improved.
In one embodiment of the invention, verifying the unlock transaction according to the unlock transaction result, the public key of the authorized user and the public key of the lock owner comprises:
and determining whether the unlocking transaction is successfully executed according to the unlocking transaction result, if so, determining whether the public key of the authorized user is the same as the public key of the lock owner, and if so, determining that the unlocking transaction is verified to be passed.
The embodiment of the invention can conveniently verify the legality of the access user, the validity of the unlocking transaction and the like based on the unlocking transaction result, can determine whether the authorized user is the lock owner or not based on the comparison of the public key of the authorized user and the public key of the lock owner, can verify the unlocking transaction from the angles of the authorized user, the access user and the like, and improves the safety of the electronic lock. In an actual application scenario, it may also be determined whether the public key of the authorized user is the same as the public key of the lock owner, and if so, it is determined whether the unlocking transaction is successfully executed according to the unlocking transaction result. Of course, both verification processes may also be performed simultaneously.
In one embodiment of the present invention, receiving an unlocking transaction identifier and a public key of a lock owner sent by an electronic lock comprises:
receiving an unlocking transaction identifier, a public key of a lock master and an identifier of the electronic lock which are sent by the electronic lock;
acquiring an unlocking transaction result and a public key of an authorized user from a block chain according to the unlocking transaction identifier, wherein the unlocking transaction result and the public key of the authorized user are acquired from the block chain according to the unlocking transaction identifier, and the unlocking transaction result and the public key of the authorized user comprise:
acquiring an identification of an authorized lock, a timestamp of an unlocking transaction, an unlocking transaction result and a public key of an authorized user from a block chain according to the unlocking transaction identification;
if the public key of the authorized user and the public key of the lock master are the same, the method further comprises:
and determining whether the identification of the authorized lock and the identification of the electronic lock are the same, if so, determining whether the time interval between the time stamp of the unlocking transaction and the current time is within a preset time threshold, and if so, executing to determine that the unlocking transaction passes the verification.
The embodiment of the invention verifies the validity of the unlocking transaction through the timestamp of the unlocking transaction, and ensures the safety of the electronic lock after the time threshold value. Whether the electronic lock is the authorized lock is verified through the lock identification, the influence on the safety of other locks of the lock master is avoided, whether the authorized user is the lock master is verified through the public key of the lock master, and the illegal user is prevented from pretending to be the lock master to authorize other users.
As shown in fig. 3, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to an access point, and the method includes:
step 301: an unlock transaction is sent to the blockchain.
If the user wants to unlock the electronic lock, an unlocking transaction needs to be sent to the blockchain through the access terminal so as to trigger the blockchain to execute an unlocking method.
Step 302: and acquiring an unlocking transaction identifier generated by the blockchain according to the unlocking transaction.
Step 303: an unlocking transaction identification is provided to the electronic lock.
The access terminal triggers the verification process of the block chain and the server terminal by initiating unlocking transaction, and the verification process is realized based on the block chain, so that the rights and interests information of the electronic lock can be prevented from being tampered, and the safety of the whole control process is improved.
In one embodiment of the invention, providing the unlocking transaction identification to the electronic lock comprises:
generating a two-dimensional code according to the unlocking transaction identifier; and displaying the two-dimension code so that the electronic lock obtains the unlocking transaction identification by scanning the two-dimension code.
In the embodiment of the invention, the electronic lock can more conveniently acquire the unlocking transaction identifier in a mode of scanning the two-dimensional code. In an actual application scenario, the electronic lock can also acquire the unlocking transaction identifier in a bar code scanning mode. The current user can also check the unlocking transaction identification through the installed access terminal, and manually inputs the unlocking transaction identification into the electronic lock.
As shown in fig. 4, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to an authorization end, and the method further includes:
step 401: and sending the creation contract transaction to the blockchain so that the blockchain deploys the intelligent contract according to the creation contract transaction.
Step 402: the transfer transaction is sent to the blockchain such that the blockchain transfers resources in the contract account from the authorized user to the access user according to the transfer transaction.
An authorized user may publish resources to be authorized for the accessing user into the blockchain by creating a contract transaction, the resources in the contract account being used to characterize the keys of the electronic lock. The authorized user may transfer the resources in his contracted account to the accessing user by means of a transfer transaction, i.e. transfer the key of the electronic lock to the accessing user. The key of the electronic lock is stored in the block chain in a resource mode, and the authorized user can authorize other users to use the key of the electronic lock through the authorization end. Due to the fact that the block chains are not capable of being tampered, keys of the electronic lock can be transferred among users more safely, and safety of the electronic lock is guaranteed.
As shown in fig. 5, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to the block chain, and the method includes:
step 501: and deploying the intelligent contracts in the blockchain according to the contract creating transaction sent by the authorization terminal.
Step 502: and transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorized end.
Step 503: and calling an intelligent contract according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result.
And the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
The block chain stores the key of the electronic lock in a resource form, and the authorized user transfers the key of the electronic lock by transferring the resource, so that the owner of the resource has the right to unlock. The user may initiate an unlocking transaction for the resource in the account, for example, the resource in the account of the user a represents a key of the electronic lock a, and if the user a wants to unlock the electronic lock a, the user a initiates an unlocking transaction, which is used to invoke the smart contract corresponding to the resource. In one embodiment of the invention, the transfer transaction includes: accessing a public key of a user;
the intelligent contract also comprises: an effective time period;
according to the intelligent contract of the transaction transfer of unblanking that the access terminal sent, generate unblanking transaction sign and unblanking transaction result, include:
and verifying whether the current user is the access user or not according to the public key of the access user, if so, calling an unlocking method in the intelligent contract to determine whether the current time is within an effective time period, and if so, generating an unlocking transaction identifier and an unlocking transaction result used for representing successful execution of the unlocking transaction.
The authorized user and the accessing user may have a pre-agreed validity period, e.g., 14:00-18: 00.
In the embodiment of the invention, the unlocking transaction is signed by the private key of the access user, so that the embodiment of the invention determines whether the current user sending the unlocking transaction is the access user holding resources or not by the public key signature verification of the access user. The invention verifies the unlocking transaction from two aspects of verification effective time and access user, and improves the safety of the electronic lock. In an actual application scenario, whether the current time is within the valid time period or not may be verified, and then whether the current user is an access user or not may be verified, and the two verification processes may also be verified simultaneously.
In one embodiment of the invention, the intelligent contract is an NFT (Non-homogeneous Token) intelligent contract and the resource is NFT. In a practical application scenario, the NFT may be issued on the blockchain based on ERC-721, ERC-1155 protocols, etc., and the NFT serves as a key credential to facilitate the transfer of money. If an authorized user authorizes multiple electronic locks externally, multiple intelligent contracts can be deployed in the blockchain, with each intelligent contract corresponding to an NFT.
As shown in fig. 6, an embodiment of the present invention provides a lock control method based on a block chain, which is applied to an electronic lock, and the method includes:
step 601: and acquiring an unlocking transaction identifier generated by the block chain.
Step 602: and acquiring an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier.
Step 603: and 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 master.
Step 604: and determining whether to unlock according to the verification result.
The embodiment of the invention integrates the functions of the server in the embodiment into the electronic lock, shortens the control flow and improves the control efficiency. And the service end is separated from the electronic lock, so that the cost of the electronic lock can be reduced.
In one embodiment of the present invention, verifying the unlock transaction according to the unlock transaction result, the public key of the authorized user, and the stored public key of the lock master includes:
and determining whether the unlocking transaction is successfully executed according to the unlocking transaction result, if so, determining whether the public key of the authorized user is the same as the public key of the lock owner, and if so, determining that the unlocking transaction is verified to be passed.
In one embodiment of the present invention, obtaining an unlock transaction result and a public key of an authorized user from a blockchain according to an unlock transaction identifier includes:
acquiring an identification of an authorized lock, a timestamp of an unlocking transaction, an unlocking transaction result and a public key of an authorized user from a block chain according to the unlocking transaction identification;
if the public key of the authorized user is the same as the public key of the lock master, the method further comprises:
and determining whether the identification of the authorized lock and the identification of the electronic lock are the same, if so, determining whether the time interval between the time stamp of the unlocking transaction and the current time is within a preset time threshold, and if so, executing to determine that the unlocking transaction passes the verification.
As shown in fig. 7, an embodiment of the present invention provides a lock control method based on a zone chain, which is applied to a lock control system based on a zone chain, and the method includes:
step 701: the authorizing end sends a create contract transaction to the blockchain.
The access user and the authorized user communicate in advance for a determined effective time period, such as 8:00-9: 00.
Step 702: deploying an intelligent contract according to the contract creating transaction by the block chain; the intelligent contract comprises a public key of an authorized user.
The intelligent contract is an NFT intelligent contract, and the intelligent contract records the following information: identification of the authorized lock, effective time period, public key of the authorized user and unlocking method. And calling an unlocking method to execute: and determining whether the current time is within the effective time period, if so, judging that the unlocking transaction result is successful, and otherwise, judging that the unlocking transaction result is failed. Invoking this unlocking method must hold the signature of the NFT owner, i.e. 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, and the authorized user can modify the valid time period.
The block chain may verify whether the create contract transaction was initiated by the authorized user based on a public key of the authorized user included in the create contract transaction. And if the public key carried in the contract creating transaction is not matched with the private key used by the signature, the block chain does not respond to the contract creating transaction, so that the security of the electronic lock is prevented from being damaged by an illegal user.
After the intelligent contracts are deployed on the blockchain, an NFT is obtained from the contract accounts, and the NFT can be transferred to other users.
The authorization side and the access side can be a blockchain wallet, and can also be other applications capable of implementing the embodiment of the invention.
Step 703: the authorization end sends the transfer transaction to the blockchain.
Before step 703, the guest user provides his public key to the authorized user, either in the form of oral notification or via the access terminal. The transfer transaction may include information such as the address of the contract account, the public key of the authorized user, etc.
Step 704: the blockchain transfers resources in the contract account from the authorized user to the access user according to the transfer transaction.
After the smart contract is deployed on the blockchain, the authorized user can view the held NFT through the blockchain wallet and transfer the NFT to the access user through the blockchain wallet, and after the block chain transfers the NFT to the access user from the authorized user, the access user can receive the NFT from the authorized user in the blockchain wallet.
The transfer transaction is signed by the private key of the authorized user, and the blockchain can verify whether the transfer transaction is legal or not according to the public key of the authorized user.
In a practical application scenario, the transfer transaction may further include a transfer method, and whether the transfer transaction is signed by a private key of an authorized user is determined through the transfer method. Specifically, the blockchain calls a transfer method in the intelligent contract according to the transfer transaction to determine whether the transfer transaction is signed by a private key of an authorized user, and if so, resources in the contract account are transferred to the access user from the authorized user.
The intelligent contract can also comprise the following attributes: owner, which is used to record the holder of the key of the electronic lock, i.e. the holder of the resource.
Step 705: the access terminal sends an unlock transaction to the blockchain.
And the access terminal sends unlocking transaction to the blockchain aiming at the NFT held by the access user, and the unlocking transaction is used for accessing the private key signature of the user.
Step 706: calling an intelligent contract according to the unlocking transaction by the block chain to generate an unlocking transaction identifier and an unlocking transaction result; and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
And calling an unlocking method in the intelligent contract according to the unlocking transaction by the block chain to obtain an unlocking transaction result and transaction hash.
Step 707: and the access terminal acquires the unlocking transaction identifier and provides the unlocking transaction identifier for the electronic lock.
And the access terminal queries the block chain to obtain the transaction hash. The electronic lock obtains the transaction hash by scanning the two-dimensional code.
Step 708: and the electronic lock sends the unlocking transaction identification and the stored public key of the lock master to the server side.
And the electronic lock sends the pre-stored public key of the lock master and the transaction hash to the server side.
Step 709: and the server acquires the unlocking transaction result and the public key of the authorized user from the block chain 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 master, and sends a verification result to the electronic lock.
Step 710: and the electronic lock determines whether to unlock according to the verification result.
For the unlocking transaction initiated by the current user, on one hand, the blockchain verifies whether the current user is an authorized user based on the intelligent contract, on the other hand, the server side or the electronic lock can determine whether the authorized user is the lock master by comparing the public key of the lock master with the public key of the authorized user, and the verification results of the two aspects are integrated to determine whether to unlock the electronic lock, so that the safety of remote control of the electronic lock can be improved. The embodiment of the invention saves the ownership of the electronic lock in the block chain in a resource form, prevents the ownership of the electronic lock from being acquired by an illegal user, and simultaneously does not transmit information such as a temporary password or a private key of an authorized user in a network, thereby further improving the safety of the electronic lock.
As shown in fig. 8, an embodiment of the present invention provides a lock control method based on a block chain, including:
step 801: the authorizing end sends a create contract transaction to the blockchain.
Step 802: deploying an intelligent contract according to the contract creating transaction by the block chain; the intelligent contract comprises a public key of an authorized user.
Step 803: the authorizing end sends the transfer transaction to the blockchain.
Step 804: the blockchain transfers resources in the contract account from the authorized user to the access user according to the transfer transaction.
Step 805: the access terminal sends an unlock transaction to the blockchain.
Step 806: calling an intelligent contract according to the unlocking transaction by the block chain to generate an unlocking transaction identifier and an unlocking transaction result; and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
Step 807: and the access terminal acquires the unlocking transaction identifier and provides the unlocking transaction identifier for the electronic lock.
Step 808: the electronic lock acquires an unlocking transaction result and a public key of an authorized user from the block chain 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 master, and determines whether to unlock according to a verification result.
The embodiment of the invention integrates the functions of the server in the embodiment into the electronic lock, shortens the control flow and improves the control efficiency.
As shown in fig. 9, an embodiment of the present invention provides an electronic lock, including:
an obtaining module 901 configured to obtain an unlocking transaction identifier generated by a blockchain;
a sending module 902 configured to send the unlocking transaction identifier and the stored public key of the lock master to the server;
a receiving module 903, configured to receive a verification result sent by the server;
and the unlocking module 904 is configured to determine whether to unlock according to the verification result.
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 master, and the identifier of the electronic lock to the server.
As shown in fig. 10, an embodiment of the present invention provides a server, including:
a receiving module 1001 configured to receive an unlocking transaction identifier and a public key of a lock master sent by an electronic lock;
the obtaining module 1002 is configured to obtain an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier;
the 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 master;
the sending module 1004 is configured to send the verification result to the electronic lock.
In an embodiment of the present invention, the verification module 1003 is configured to determine whether the unlocking transaction is successfully executed according to 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, and if so, determine that the unlocking transaction is verified.
In an embodiment of the present invention, the receiving module 1001 is configured to receive an unlocking transaction identifier, a public key of a lock owner, and an identifier of an electronic lock sent by an electronic lock; the obtaining module 1002 is configured to obtain, from the blockchain, an identifier of the authorized lock, a timestamp of the unlocking transaction, an unlocking transaction result, and a public key of the authorized user 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 a time interval between a timestamp of the unlocking transaction and the current time is within a preset time threshold, and if so, execute the verification for determining that the unlocking transaction passes.
As shown in fig. 11, an embodiment of the present invention provides an access terminal, including:
a sending module 1101 configured to send an unlock transaction to the blockchain; an unlock transaction identification is provided to the electronic lock.
The obtaining module 1102 is configured to obtain an unlocking transaction identifier generated by the blockchain according to the unlocking transaction.
In an embodiment of the present invention, the sending module 1101 is configured to generate a two-dimensional code according to the unlocking transaction identifier; and displaying the two-dimension code so that the electronic lock obtains the unlocking transaction identification by scanning the two-dimension code.
As shown in fig. 12, an embodiment of the present invention provides an authorization end, including:
a creation module 1201 configured to send a create contract transaction to the blockchain to cause the blockchain to deploy the smart contract according to the create contract transaction;
the transfer module 1202 is configured to send a transfer transaction to the blockchain to cause the blockchain to transfer resources in the contract account from the authorized user to the access user according to the transfer transaction.
As shown in fig. 13, an embodiment of the present invention provides a block chain, including:
a creating module 1301 configured to deploy an intelligent contract in the blockchain according to a contract creating transaction sent by the authorization side;
the transfer module 1302 is 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 terminal;
the calling module 1303 is configured to call an intelligent contract according to the unlocking transaction sent by the access terminal, and generate an unlocking transaction identifier and an unlocking transaction result;
the intelligent contract comprises a public key of an authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
In one embodiment of the invention, the transfer transaction includes: accessing a public key of a user; the intelligent contract also comprises: an effective time period; and the calling module 1303 is configured to verify whether the current user is the access user according to the public key of the access user, if so, call an unlocking method in the intelligent 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 used for representing the successful execution of the unlocking transaction.
In one embodiment of the invention, the intelligent contract is an inhomogeneous token NFT intelligent contract and the resource is NFT.
As shown in fig. 14, an embodiment of the present invention provides an electronic lock, including:
an obtaining module 1401 configured to obtain an unlocking transaction identifier generated by a block chain; acquiring an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier;
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 master;
and an unlocking module 1403 configured to determine whether to unlock the lock according to the verification result.
In one embodiment of the present invention, the checking module 1402 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 is verified.
In an embodiment of the present invention, the obtaining module 1401 is configured to obtain, from the block chain, an identifier of the authorized lock, a timestamp of the unlocking transaction, an unlocking transaction result, and a public key of the authorized user according to the unlocking transaction identifier; the checking module 1402 is configured to determine whether the identifier of the authorized lock and the identifier of the electronic lock are the same, determine whether a time interval between a timestamp of the unlocking transaction and the current time is within a preset time threshold if the authorized lock and the electronic lock are the same, and if the authorized lock and the electronic lock are the same, perform checking to determine that the unlocking transaction passes.
As shown in fig. 15, an embodiment of the present invention provides a lock control system based on a block chain, including:
an authorizer 1501 for sending a create contract transaction to the blockchain 1502; send transfer transactions to blockchain 1502;
a blockchain 1502 for deploying smart contracts in accordance with a create contract transaction; the intelligent contract comprises a public key of an authorized user; transferring the resource in the contract account from the authorized user to the access user according to the transfer transaction; calling an intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key, the unlocking transaction identifier and the unlocking transaction result of the authorized user are correspondingly stored;
an access terminal 1503 for sending an unlocking transaction to the blockchain 1502; acquiring an unlocking transaction identifier, and providing the unlocking transaction identifier to the electronic lock 1504;
an electronic lock 1504 for sending the unlocking transaction identification and the stored public key of the lock master to the server 1505; determining whether to unlock according to the verification result;
the server 1505 is configured 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 a verification result to the electronic lock 1504.
As shown in fig. 16, an embodiment of the present invention provides a lock control method based on a block chain, including:
an authorization terminal 1601 for sending a create contract transaction to blockchain 1602; send the transfer transaction to blockchain 1602;
a blockchain 1602 for deploying smart contracts in accordance with a create contract transaction; the intelligent contract comprises a public key of an authorized user; transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction; calling an intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key, the unlocking transaction identifier and the unlocking transaction result of the authorized user are correspondingly stored;
an access terminal 1603 for sending an unlock transaction to the blockchain 1602; acquiring an unlocking transaction identifier, and providing the unlocking transaction identifier to the electronic lock 1604;
the electronic lock 1604 is configured to obtain an unlocking transaction result and a 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 according to a verification result.
An embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device to store one or more programs,
when executed by one or more processors, cause the one or more processors to implement the methods as applied to an authorization side, an electronic lock, a blockchain, an access side, and a service side.
An embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method applied to an authorization side, an electronic lock, a block chain, an access side, and a service side.
Referring now to FIG. 17, shown is a block diagram of a computer system 1700 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 17 is only an example, and should not bring any limitation to the functions and the range of use of the embodiment of the present invention.
As shown in fig. 17, the computer system 1700 includes a Central Processing Unit (CPU)1701 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)1702 or a program loaded from a storage portion 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, ROM 1702, and RAM 1703 are connected to each other through a bus 1704. An input/output (I/O) interface 1705 is also connected to the bus 1704.
The following components are connected to the I/O interface 1705: an input section 1706 including a keyboard, a mouse, and the like; an output portion 1707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 1708 including a hard disk and the like; and a communication section 1709 including a network interface card such as a LAN card, a modem, or the like. The communication section 1709 performs communication processing via a network such as the internet. A driver 1710 is also connected to the I/O interface 1705 as necessary. A removable medium 1711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1710 as necessary, so that a computer program read out therefrom is mounted into the storage portion 1708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication portion 1709, and/or installed from the removable media 1711. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 1701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module, an obtaining module, a determining module, and a first processing module. The names of these modules do not form a limitation on the modules themselves in some cases, and for example, the sending module may also be described as a "module sending a picture acquisition request to a connected server".
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (26)

1. A lock control method based on a block chain is characterized by comprising the following steps:
acquiring an unlocking transaction identifier generated by a block chain;
sending the unlocking transaction identification and the stored public key of the lock master to a server;
receiving a check result sent by the server;
and determining whether to unlock according to the verification result.
2. The method of claim 1,
the sending the unlocking transaction identifier and the stored public key of the lock master to the server side includes:
and sending the unlocking transaction identification, the stored public key of the lock owner and the identification of the electronic lock to the server.
3. A lock control method based on a block chain is characterized by comprising the following steps:
receiving an unlocking transaction identifier and a public key of a lock master sent by an electronic lock;
acquiring an unlocking transaction result and a public key of an authorized user from a block chain 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;
and sending a verification result to the electronic lock.
4. The method of claim 3,
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 master comprises the following steps:
and determining whether the unlocking transaction is successfully executed according to the unlocking transaction result, if so, determining whether the public key of the authorized user is the same as the public key of the lock owner, and if so, determining that the unlocking transaction is verified to be passed.
5. The method of claim 4,
the receiving of the unlocking transaction identifier and the public key of the lock master sent by the electronic lock comprises the following steps:
receiving the unlocking transaction identifier, the public key of the lock owner and the identifier of the electronic lock sent by the electronic lock;
the acquiring of the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identifier includes:
acquiring an identification of an authorized lock, a timestamp of the unlocking transaction, an unlocking transaction result and a public key of the authorized user from the block chain according to the unlocking transaction identification;
if the public key of the authorized user and the public key of the lock master are the same, the method further comprises:
and determining whether the identification of the authorized lock is the same as the identification of the electronic lock, 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 step of determining that the unlocking transaction passes verification.
6. A lock control method based on a block chain is characterized by comprising the following steps:
sending an unlock transaction to the blockchain;
acquiring an unlocking transaction identifier generated by the block chain according to the unlocking transaction;
and providing the unlocking transaction identification to the electronic lock.
7. The method of claim 6,
said providing said unlocked transaction identification to said electronic lock comprises:
generating a two-dimensional code according to the unlocking transaction identifier; and displaying the two-dimension code so that the electronic lock obtains the unlocking transaction identification by scanning the two-dimension code.
8. A lock control method based on a block chain is characterized by comprising the following steps:
sending a create contract transaction to a blockchain to cause the blockchain to deploy intelligent contracts in accordance with the create contract transaction;
and sending a transfer transaction to the blockchain so that the blockchain transfers the resources in the contract account to the access user by the authorized user according to the transfer transaction.
9. A lock control method based on a block chain is characterized by comprising the following steps:
deploying intelligent contracts in a block chain according to contract creating transactions sent by an authorization end;
transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction sent by the authorized end;
calling the intelligent contract according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result;
the intelligent contract comprises a public key of the authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
10. The method of claim 9,
the transfer transaction comprises the following steps: the public key of the access user;
the intelligent contract also comprises: an effective time period;
the intelligent contract is called according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result, and the intelligent contract comprises the following steps:
and verifying whether the current user sending the unlocking transaction is the access user or not according to the public key of the access user, if so, calling an unlocking method in the intelligent contract to determine whether the current time is within the effective time period, and if so, generating the unlocking transaction identification and the unlocking transaction result used for representing the successful execution of the unlocking transaction.
11. The method of claim 9,
the intelligent contract is an non-homogeneous token NFT intelligent contract and the resource is NFT.
12. A lock control method based on a block chain is characterized by comprising the following steps:
acquiring an unlocking transaction identifier generated by a block chain;
acquiring an unlocking transaction result and a public key of an authorized user from the block chain 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 stored public key of the lock master;
and determining whether to unlock according to the verification result.
13. The method of claim 12,
the 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 master comprises the following steps:
and determining whether the unlocking transaction is successfully executed according to the unlocking transaction result, if so, determining whether the public key of the authorized user is the same as the public key of the lock owner, and if so, determining that the unlocking transaction is verified to be passed.
14. The method of claim 13,
the acquiring of the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identifier includes:
acquiring an identification of an authorized lock, a timestamp of the unlocked transaction, the unlocked transaction result and a public key of the authorized user from the block chain according to the unlocked transaction identification;
if the public key of the authorized user and the public key of the lock master are the same, the method further comprises:
and determining whether the identification of the authorized lock is the same as the identification of the electronic lock, if so, determining whether the time interval between the time stamp of the unlocking transaction and the current time is within a preset time threshold, and if so, executing the step of determining that the unlocking transaction is verified to be passed.
15. A lock control method based on a block chain is characterized by comprising the following steps:
the authorization end sends a contract creating transaction to the blockchain;
the block chain deploys intelligent contracts according to the contract creating transactions; the intelligent contract comprises 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 access user according to the transfer transaction;
the access terminal sends unlocking transaction to the blockchain;
the block chain calls the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identification and the unlocking transaction result are correspondingly stored;
the access terminal acquires the unlocking transaction identification and provides the unlocking transaction identification for the electronic lock;
the electronic lock sends the unlocking transaction identification and the stored public key of the lock master to a server side;
the server acquires the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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 a verification result to the electronic lock;
and the electronic lock determines whether to unlock according to the verification result.
16. A lock control method based on a block chain is characterized by comprising the following steps:
the authorization end sends a contract creating transaction to the blockchain;
the block chain deploys intelligent contracts according to the contract creating transactions; the intelligent contract comprises 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 access user according to the transfer transaction;
the access terminal sends unlocking transaction to the blockchain;
the block chain calls the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal acquires the unlocking transaction identification and provides the unlocking transaction identification for the electronic lock;
the electronic lock acquires the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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.
17. An electronic lock, comprising:
the acquisition module is configured to acquire the unlocking transaction identifier generated by the block chain;
the sending module is configured to send the unlocking transaction identifier and a stored public key of the lock master to a server side;
the receiving module is configured to receive a check result sent by the server;
and the unlocking module is configured to determine whether to unlock according to the verification result.
18. A server, comprising:
the receiving module is configured to receive the unlocking transaction identifier and the public key of the lock master sent by the electronic lock;
the acquisition module is configured to acquire an unlocking transaction result and a public key of an authorized user from a block chain according to the unlocking transaction identifier;
the verification module 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;
and the sending module is configured to send the verification result to the electronic lock.
19. An access terminal, comprising:
a sending module configured to send an unlock transaction to the blockchain;
the acquisition module is configured to acquire an unlocking transaction identifier generated by the blockchain according to the unlocking transaction;
a sending module configured to provide the unlocking transaction identification to the electronic lock.
20. An authorization peer, comprising:
a first sending module configured to send a create contract transaction to a blockchain to cause the blockchain to deploy intelligent contracts according to the create contract transaction;
and the second sending module is configured to send the transfer transaction to the blockchain, so that the blockchain transfers the resource in the contract account from the authorized user to the access user according to the transfer transaction.
21. A blockchain, comprising:
the creating module is configured to deploy the intelligent contracts in the block chain according to the contract creating transaction sent by the authorization terminal;
the transfer module 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 authorized terminal;
the calling module is configured to call the intelligent contract according to the unlocking transaction sent by the access terminal to generate an unlocking transaction identifier and an unlocking transaction result;
the intelligent contract comprises a public key of the authorized user, and the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored.
22. An electronic lock, comprising:
the acquisition module is configured to acquire the unlocking transaction identifier generated by the block chain; acquiring an unlocking transaction result and a public key of an authorized user from the block chain according to the unlocking transaction identifier;
the verification module is 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;
and the unlocking module is configured to determine whether to unlock according to the verification result.
23. A block chain based lock control system, comprising:
the authorization end is used for sending a contract creating transaction to the blockchain; sending a transfer transaction to the blockchain;
the block chain is used for deploying intelligent contracts according to the contract creating transaction; the intelligent contract comprises a public key of an authorized user; transferring the resource in the contract account from the authorized user to the access user according to the transfer transaction; calling the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identifier and the unlocking transaction result are correspondingly stored;
the access terminal is used for sending unlocking transaction to the blockchain; acquiring the unlocking transaction identification, and providing the unlocking transaction identification for the electronic lock;
the electronic lock is used for sending the unlocking transaction identifier and the stored public key of the lock owner to the server; determining whether to unlock according to the verification result;
the server is used for acquiring the unlocking transaction result and the public key of the authorized user from the block chain 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, and sending the verification result to the electronic lock.
24. A lock control method based on a block chain is characterized by comprising the following steps:
the authorization end is used for sending a contract creating transaction to the blockchain; sending a transfer transaction to the blockchain;
the block chain is used for deploying intelligent contracts according to the contract creating transaction; the intelligent contract comprises a public key of an authorized user; transferring the resources in the contract account from the authorized user to the access user according to the transfer transaction; calling the intelligent contract according to the unlocking transaction to generate an unlocking transaction identifier and an unlocking transaction result; the public key of the authorized user, the unlocking transaction identification and the unlocking transaction result are correspondingly stored;
the access terminal is used for sending unlocking transaction to the blockchain; acquiring the unlocking transaction identification, and providing the unlocking transaction identification for the electronic lock;
the electronic lock is used for acquiring the unlocking transaction result and the public key of the authorized user from the block chain according to the unlocking transaction identification, 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, and determining whether to unlock according to the verification result.
25. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-14.
26. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-14.
CN202210590455.8A 2022-05-26 2022-05-26 Lock control method and system based on block chain and electronic lock Pending CN115035637A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210590455.8A CN115035637A (en) 2022-05-26 2022-05-26 Lock control method and system based on block chain and electronic lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210590455.8A CN115035637A (en) 2022-05-26 2022-05-26 Lock control method and system based on block chain and electronic lock

Publications (1)

Publication Number Publication Date
CN115035637A true CN115035637A (en) 2022-09-09

Family

ID=83120808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210590455.8A Pending CN115035637A (en) 2022-05-26 2022-05-26 Lock control method and system based on block chain and electronic lock

Country Status (1)

Country Link
CN (1) CN115035637A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875518A (en) * 2016-06-21 2017-06-20 阿里巴巴集团控股有限公司 The control method of smart lock, device and smart lock
CN110211263A (en) * 2019-05-23 2019-09-06 烽火通信科技股份有限公司 A kind of intelligent door method for unlocking and system based on block chain technology
CN111027035A (en) * 2019-11-06 2020-04-17 香农数据有限公司 Multi-identity authentication method and system based on block chain
CN111163034A (en) * 2018-10-22 2020-05-15 北京京东尚科信息技术有限公司 Block chain network, electronic lock control method thereof, terminal device and storage medium
CN111179476A (en) * 2020-01-12 2020-05-19 杭州复杂美科技有限公司 Configuration method and control method of intelligent lock, equipment and storage medium
CN112446988A (en) * 2020-04-08 2021-03-05 杭州左链科技有限公司 Access control application method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106875518A (en) * 2016-06-21 2017-06-20 阿里巴巴集团控股有限公司 The control method of smart lock, device and smart lock
CN111163034A (en) * 2018-10-22 2020-05-15 北京京东尚科信息技术有限公司 Block chain network, electronic lock control method thereof, terminal device and storage medium
CN110211263A (en) * 2019-05-23 2019-09-06 烽火通信科技股份有限公司 A kind of intelligent door method for unlocking and system based on block chain technology
CN111027035A (en) * 2019-11-06 2020-04-17 香农数据有限公司 Multi-identity authentication method and system based on block chain
CN111179476A (en) * 2020-01-12 2020-05-19 杭州复杂美科技有限公司 Configuration method and control method of intelligent lock, equipment and storage medium
CN112446988A (en) * 2020-04-08 2021-03-05 杭州左链科技有限公司 Access control application method, device and storage medium

Similar Documents

Publication Publication Date Title
CN109274652B (en) Identity information verification system, method and device and computer storage medium
US9892404B2 (en) Secure identity authentication in an electronic transaction
US6834795B1 (en) Secure user authentication to computing resource via smart card
CN112330855B (en) Electronic lock safety management method, equipment and system
US9900157B2 (en) Object signing within a cloud-based architecture
US10212151B2 (en) Method for operating a designated service, service unlocking method, and terminal
US9055061B2 (en) Process of authentication for an access to a web site
CN110011957B (en) Security authentication method and device for enterprise account, electronic equipment and storage medium
CN111600906B (en) Data processing method, device, system, medium, and program
CN114531277B (en) User identity authentication method based on blockchain technology
US11721148B2 (en) Authorization system, management server and authorization method
US20230412399A1 (en) Database Multi-Authentication Method and System, Terminal, and Storage Medium
CN111669351B (en) Authentication method, service server, client and computer readable storage medium
CN111431840A (en) Security processing method and device
CN116192483A (en) Authentication method, device, equipment and medium
WO2020034907A1 (en) Authentication information transmission method, key management client and computer device
CN114584381A (en) Security authentication method and device based on gateway, electronic equipment and storage medium
CN113205342A (en) User identity authentication method and device based on multi-terminal payment
US8910260B2 (en) System and method for real time secure image based key generation using partial polygons assembled into a master composite image
CN114584324B (en) Identity authorization method and system based on block chain
CN115035637A (en) Lock control method and system based on block chain and electronic lock
EP3343494A1 (en) Electronic signature of transactions between users and remote providers by use of two-dimensional codes
CN114499975A (en) Method for verifying login server, server and storage medium
CN113536365A (en) File access method, device, equipment and medium
KR101936941B1 (en) Electronic approval system, method, and program using biometric authentication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination