CN109779411B - Block chain-based coded lock unlocking method, device and equipment - Google Patents

Block chain-based coded lock unlocking method, device and equipment Download PDF

Info

Publication number
CN109779411B
CN109779411B CN201910152813.5A CN201910152813A CN109779411B CN 109779411 B CN109779411 B CN 109779411B CN 201910152813 A CN201910152813 A CN 201910152813A CN 109779411 B CN109779411 B CN 109779411B
Authority
CN
China
Prior art keywords
unlocking
password
lock
coded
block chain
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.)
Active
Application number
CN201910152813.5A
Other languages
Chinese (zh)
Other versions
CN109779411A (en
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 Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information 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 Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN201910152813.5A priority Critical patent/CN109779411B/en
Publication of CN109779411A publication Critical patent/CN109779411A/en
Application granted granted Critical
Publication of CN109779411B publication Critical patent/CN109779411B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Lock And Its Accessories (AREA)

Abstract

The embodiment of the invention provides a method, a device and equipment for unlocking a coded lock based on a block chain, which are applied to a block chain system, wherein the block chain system comprises a plurality of coded locks, and the method comprises the following steps: a first coded lock in the block chain system acquires an unlocking code; the first coded lock sends a verification request to coded locks in the blockchain system, wherein the verification request comprises an unlocking password, and the verification request is used for requesting the coded locks in the blockchain system to verify the unlocking password; and when the number of the coded locks for verifying the correct unlocking code in the block chain system is greater than or equal to a first threshold value, the first coded lock executes unlocking operation. The unlocking safety of the coded lock is improved.

Description

Block chain-based coded lock unlocking method, device and equipment
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device and equipment for unlocking a coded lock based on a block chain.
Background
At present, with the improvement of security awareness of people, coded locks (such as digital coded locks, fingerprint locks, etc.) are more and more widely applied.
In the prior art, after the user sets the password for the combination lock, the password set for the combination lock is usually stored in the remote server, and the remote server can store the passwords of a plurality of combination locks. When a user unlocks, the user inputs an unlocking password into the coded lock, the coded lock sends the unlocking password to the remote server, the remote server verifies the unlocking password, and when the remote server verifies that the unlocking password is the same as the password set by the user, the remote server sends an unlocking instruction to the coded lock so as to unlock the coded lock. However, in the above process, when the remote server is attacked by a hacker, the hacker can control the remote server to arbitrarily open and close the coded lock, so that the unlocking security of the coded lock is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device and equipment for unlocking a coded lock based on a block chain, which improve the unlocking safety of the coded lock.
In a first aspect, an embodiment of the present invention provides a method for unlocking a coded lock based on a blockchain, where the method is applied to a blockchain system, where the blockchain system includes a plurality of coded locks, and the method includes:
a first coded lock in the block chain system acquires an unlocking code;
the first coded lock sends a verification request to a coded lock in the blockchain system, wherein the verification request comprises the unlocking password, and the verification request is used for requesting the coded lock in the blockchain system to verify the unlocking password;
and when the number of the coded locks for verifying the unlocking password to be correct in the block chain system is larger than or equal to a first threshold value, the first coded lock executes unlocking operation.
In one possible embodiment, when the number of the coded locks verifying that the unlocking code is correct in the blockchain system is greater than a first threshold, the first coded lock performs an unlocking operation, including:
the first coded lock acquires a consensus result, wherein the consensus result is used for indicating that the coded lock in the block chain system successfully verifies the unlocking code or fails to verify the unlocking code;
and when the consensus result indicates that the password lock in the block chain system successfully verifies the unlocking password, the first password lock executes the unlocking operation according to the consensus result.
In a possible implementation manner, the consensus result is generated by a consensus node in the blockchain system according to a verification result of a coded lock in the blockchain system on the unlocking password, and the verification result of one coded lock on the unlocking password is that the coded lock verifies that the unlocking password is correct or that the unlocking password is wrong.
In a possible implementation manner, when the number of the coded locks in the blockchain system for verifying that the unlocking password is correct is greater than or equal to a first threshold value, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password;
and when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking password.
In a possible embodiment, the first combination lock performs the unlocking operation according to the consensus result, and the unlocking operation includes:
the first coded lock judges whether the consensus result comprises the identification of the first coded lock;
if so, the first coded lock executes the unlocking operation.
In a possible implementation manner, before the obtaining of the consensus result by the first combination lock, the method further includes:
the first password obtains a first hash value of a real password of the first password lock;
the first coded lock acquires a second hash value of the unlocking password;
the first coded lock judges whether the first hash value and the second hash value are the same;
if so, the verification result of the first coded lock on the unlocking password is to verify that the unlocking password is correct;
if not, the result of the first coded lock verifying the unlocking password is that the unlocking password is wrong.
In a possible implementation, the unlocking password included in the authentication request is encrypted information.
In a possible implementation manner, before the first combination lock obtains the unlocking code, the method further includes:
the first coded lock acquires a true password of the first coded lock;
the first combination lock sends the real code of the first combination lock to the combination lock in the block chain system.
In one possible embodiment, the sending, by the first trick lock, the true password of the first trick lock to a trick lock in the blockchain system includes:
the first coded lock acquires a hash value of the real password;
the first trick lock sends the hash value to a trick lock in the blockchain system.
In a second aspect, an embodiment of the present invention provides a device for unlocking a coded lock based on a blockchain, which is applied to a first coded lock in a blockchain system, where the blockchain system includes a plurality of coded locks, the device includes a first obtaining module, a sending module, and an executing module, where,
the first obtaining module is used for obtaining an unlocking password;
the sending module is configured to send a verification request to a password lock in the blockchain system, where the verification request includes the unlocking password, and the verification request is used to request the password lock in the blockchain system to verify the unlocking password;
the execution module is used for executing unlocking operation when the number of the coded locks for verifying the unlocking password to be correct in the block chain system is larger than or equal to a first threshold value.
In a possible implementation manner, the execution module is specifically configured to:
the first coded lock acquires a consensus result, wherein the consensus result is used for indicating that the coded lock in the block chain system successfully verifies the unlocking code or fails to verify the unlocking code;
and when the consensus result indicates that the password lock in the block chain system successfully verifies the unlocking password, the first password lock executes the unlocking operation according to the consensus result.
In a possible implementation manner, the consensus result is generated by a consensus node in the blockchain system according to a verification result of a coded lock in the blockchain system on the unlocking password, and the verification result of one coded lock on the unlocking password is that the coded lock verifies that the unlocking password is correct or that the unlocking password is wrong.
In a possible implementation manner, when the number of the coded locks in the blockchain system for verifying that the unlocking password is correct is greater than or equal to a first threshold value, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password;
and when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking password.
In a possible implementation manner, the execution module is specifically configured to:
judging whether the consensus result comprises the identification of the first coded lock;
and if so, executing the unlocking operation.
In a possible implementation manner, the apparatus further includes a verification module, wherein before the execution module obtains the consensus result, the verification module is configured to:
acquiring a first hash value of a real password of the first password lock;
acquiring a second hash value of the unlocking password;
judging whether the first hash value and the second hash value are the same;
if so, verifying the unlocking password to be correct;
if not, the unlocking password is verified to be wrong according to the verification result of the unlocking password.
In a possible implementation, the unlocking password included in the authentication request is encrypted information.
In a possible embodiment, the apparatus further comprises a second obtaining module, wherein,
the second obtaining module is used for obtaining the real password of the first coded lock before the first obtaining module obtains the unlocking password;
the sending module is further configured to send the true password of the first password lock to a password lock in the blockchain system.
In a possible embodiment, the apparatus further comprises a third obtaining module, wherein,
the third obtaining module is configured to obtain a hash value of the real password;
the sending module is specifically configured to send the hash value to a trick lock in the blockchain system.
In a third aspect, an embodiment of the present invention provides a block chain-based coded lock unlocking apparatus, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of unlocking a blockchain-based cryptographic lock according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a coded lock, including a mechanical structure and the coded lock unlocking device based on a block chain in the third aspect, where the coded lock unlocking device based on a block chain is used to control the mechanical structure to unlock.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the method for unlocking a cipher lock based on a blockchain according to any one of the first aspects is implemented.
According to the method, the device and the equipment for unlocking the coded lock based on the block chain, provided by the embodiment of the invention, when a user needs to unlock the first coded lock, the user can input the unlocking password into the first coded lock, the first coded lock sends an authentication request to other coded locks in the block chain system so as to authenticate the unlocking password by the coded lock in the block chain system, and when the number of the coded locks for authenticating the unlocking password in the block chain system is larger than or equal to a first threshold value, the first coded lock can execute unlocking operation. In the process, the coded lock in the block chain system is controlled to be opened according to the unlocking code, and only when a plurality of coded locks in the block chain system are controlled by a hacker, the hacker can control the coded lock to be opened, so that the situation that the centralized remote server controls the coded lock to be opened is avoided, and the unlocking safety of the coded lock is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a block chain system architecture diagram according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for unlocking a combination lock based on a block chain according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of another method for unlocking a combination lock based on a block chain according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a combination lock unlocking device based on a block chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another cipher lock unlocking device based on a block chain according to an embodiment of the present invention;
fig. 6 is a schematic hardware structure diagram of a cipher lock unlocking device based on a block chain according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is an architecture diagram of a block chain system according to an embodiment of the present invention. Referring to fig. 1, the blockchain system includes a plurality of locks, each of which is a node in the blockchain system. The coded lock can be a digital coded lock, a fingerprint lock and the like. The combination locks in the blockchain may include combination locks in a regional area, for example, the combination locks in the blockchain may include all of the combination locks in a building, or the combination locks in the blockchain may include all of the combination locks of a predetermined brand in a predetermined geographic region.
In the application, when a user needs to unlock a coded lock, the user can input an unlocking password into the coded lock, the coded lock can request the coded lock in the block chain system to verify the unlocking password, and after the coded lock in the block chain system passes the verification of the unlocking password, the coded lock can execute unlocking operation. In the process, the coded lock in the block chain system is controlled to be opened according to the unlocking code, and only when a plurality of coded locks in the block chain system are controlled by a hacker, the hacker can control the coded lock to be opened, so that the situation that the centralized remote server controls the coded lock to be opened is avoided, and the unlocking safety of the coded lock is further improved.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the description of the same or similar contents in different embodiments is not repeated.
Fig. 2 is a schematic flowchart of a method for unlocking a combination lock based on a block chain according to an embodiment of the present invention. Referring to fig. 2, the method may include:
s201, a first coded lock in the block chain system acquires an unlocking code.
Optionally, the first combination lock is any combination lock in the blockchain system.
Optionally, the coded lock shown in the embodiment of the present invention may be a digital coded lock (a coded lock unlocked by using a combination of numbers between 0 and 9), a fingerprint lock (a coded lock unlocked by using a fingerprint), a face recognition lock (a coded lock unlocked by using a face image), or the like.
When the types of the coded locks are different, the types of the unlocking codes are also different. For example, when the combination lock is a digital combination lock, the unlocking combination is a string of numbers. When the coded lock is a fingerprint lock, the unlocking code is a fingerprint. When the coded lock is a face recognition lock, the unlocking code is a face image.
Optionally, a password acquisition device is arranged in the first password lock, and a user can input a password in the first password lock through the password acquisition device. For example, when the first combination lock is a digital combination lock, the combination acquiring device may be a numeric keypad between 0 and 9, and the user may input the digital combination through the numeric keypad. When first trick lock is the fingerprint lock, password collection system can be fingerprint sampler, and the user can pass through fingerprint sampler input fingerprint password. When first trick lock is face identification lock, password collection system can be the camera, and the camera can gather the face image.
S202, the first coded lock sends a verification request to the coded locks in the blockchain system, the verification request comprises unlocking passwords, and the verification request is used for requesting the coded locks in the blockchain system to verify the unlocking passwords.
Optionally, the first combination lock may encapsulate the authentication request into a transaction message, and send the transaction message to the combination lock in the blockchain system.
Optionally, the authentication request may further include an identifier of the first combination lock.
In order to ensure the security of data transmission, before the first coded lock sends the verification request, the unlocking password included in the verification request may be encrypted. For example, the unlocking password may be digitally signed, and the signature information after the data signature may be carried in the verification request. For example, the unlocking password included in the authentication request may be a hash value of the unlocking password.
Optionally, the first trick lock may broadcast an authentication request to the trick locks in the blockchain system. For example, a first trick lock may broadcast an authentication request to other than the first trick lock in the blockchain system.
S203, when the number of the coded locks with correct unlocking passwords is verified to be larger than or equal to a first threshold value in the block chain system, the first coded lock executes unlocking operation.
Initially, the user may set the true password of the first password lock through the client, for example, the client may be a mobile phone, a computer, or other devices.
After the user sets the true password of the first combination lock, the true password of the first combination lock may be stored in the first combination lock. Optionally, in order to ensure the security of storing the true password, the encryption information of the true password may be stored in the first combination lock. For example, a hash value of the true password may be stored in the first combination lock.
Optionally, when the true password is a fingerprint password or a face image password, feature extraction may be performed on the fingerprint password or the face image password to obtain a feature value, and the hash value of the feature value is stored in the first combination lock.
After the user sets the true password of the first combination lock, the first combination lock also sends the true password of the first combination lock to other combination locks in the blockchain system. Optionally, in order to ensure the security of the real password, the first combination lock may encrypt the real password and send encryption information of the real password to the other combination locks. For example, a first trick lock may send a hash value of the true password to other trick locks in the blockchain system.
Optionally, when the true password is a fingerprint password or a face image password, the first combination lock may perform feature extraction on the fingerprint password or the face image password to obtain a feature value, obtain a hash value of the feature value, and send the hash value of the feature value to other combination locks in the block chain.
After the password lock in the blockchain system receives the verification request sent by the first password lock, the password lock in the blockchain system verifies the unlocking password in the verification request. The first combination lock can also verify the unlocking password after receiving the unlocking password input by the user. After the unlocking password verification of each password lock in the blockchain system is completed, verification results can be generated, that is, each password lock generates one verification result, and assuming that the blockchain system comprises N password locks in total, the password locks in the blockchain system can generate N verification results in total. The verification result of the unlocking password of one coded lock is that the coded lock verifies that the unlocking password is correct or that the unlocking password is wrong.
Optionally, a consensus node may be set in the blockchain system, and the consensus node may be any one of the coded locks in the blockchain system. After the verification result is generated by the coded locks in the blockchain system, the verification result is sent to the consensus node, so that the consensus node can generate a consensus result according to the received verification result, and the consensus result is used for indicating that the unlocking code verification of the coded locks in the blockchain system on the first coded lock is successful or the verification fails. The identification of the first combination lock may be included in the consensus result. The consensus node may send the consensus result to all the coded locks in the block chain, and after the first coded lock receives the consensus result, if the consensus result indicates that the unlocking code verification is successful, and the first coded lock determines that the consensus result includes the identifier of the first coded lock, the first coded lock performs the unlocking operation.
For the first coded lock, the unlocking code can be verified through the following feasible implementation modes: the method comprises the steps that a first Hash value of a true password of a first password lock is stored in the first password lock, after the first password lock receives an unlocking password, the first password lock obtains a second Hash value of the unlocking password, the first password lock judges whether the first Hash value and the second Hash value are the same or not, if yes, the verification result is that the unlocking password is correct, and if not, the verification result is that the unlocking password is wrong.
For any one other coded lock except the first coded lock in the blockchain system, the unlocking code can be verified through the following feasible implementation modes: and judging whether a first hash value of the real password of the first password lock is stored locally, and if not, acquiring the first hash value of the real password of the first password lock from other password locks in the block chain system. And acquiring the unlocking password in the verification request, acquiring a second hash value of the unlocking password, judging whether the first hash value and the second hash value are the same, if so, determining that the verification result is that the unlocking password is correct, and if not, determining that the verification result is that the unlocking password is wrong.
Optionally, when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is greater than or equal to the first threshold, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password; when the number of the coded locks for verifying that the unlocking code is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking code.
For example, assuming that the blockchain system includes N cipherlocks, the consensus node can obtain N verification results. If K verification results in the N verification results are correct for verifying the unlocking password, when K is larger than or equal to a first threshold value, the consensus result indicates that the unlocking password is successfully verified, and when K is smaller than the first threshold value, the consensus result indicates that the unlocking password is failed to be verified.
Optionally, the first combination lock includes a mechanical component, and when the number of combination locks for verifying that the unlocking password is correct in the blockchain system is greater than or equal to the first threshold, the first combination lock controls the mechanical component to perform the unlocking operation.
According to the method for unlocking the coded lock based on the block chain, provided by the embodiment of the invention, when a user needs to unlock the first coded lock, the user can input the unlocking password into the first coded lock, the first coded lock sends an authentication request to other coded locks in the block chain system so as to authenticate the unlocking password of the coded lock in the block chain system, and when the number of the coded locks for authenticating the unlocking password in the block chain system is larger than or equal to a first threshold value, the first coded lock can execute unlocking operation. In the process, the coded lock in the block chain system is controlled to be opened according to the unlocking code, and only when a plurality of coded locks in the block chain system are controlled by a hacker, the hacker can control the coded lock to be opened, so that the situation that the centralized remote server controls the coded lock to be opened is avoided, and the unlocking safety of the coded lock is further improved.
On the basis of any one of the above embodiments, the following provides a detailed description of the unlocking method of the fingerprint lock with the embodiment shown in fig. 3.
Fig. 3 is a schematic flowchart of another method for unlocking a combination lock based on a blockchain according to an embodiment of the present invention. Referring to fig. 3, the method may include:
s301, the first password lock receives a first hash value of the real password sent by the client.
Optionally, after the user sets the true password of the first password lock through the client, the client may obtain the first hash value of the true password and send the first hash value to the first password lock. After the first cryptographic lock receives the first hash value, the first cryptographic lock may store the first hash value. For example, the first combination lock may store the first hash value and the identification of the first combination lock in correspondence.
Optionally, when the true password is a fingerprint password or a face image password, the client may extract a feature value from the fingerprint password or the face image password, and obtain a first hash value of the feature value.
S302, the first coded lock sends coded information to other coded locks in the block chain, wherein the coded information comprises the identification of the first coded lock and the first hash value.
Alternatively, the first trick lock may broadcast the cryptographic information to other trick locks in the blockchain.
After the other locks in the block chain receive the password information, the first hash value in the password information and the identifier of the first lock may be stored correspondingly.
For example, assuming that the blockchain system includes a second trick lock, the first blockchain sends the cryptographic information to the second trick lock.
It should be noted that by performing S301-S302, other locks (except the first lock) in the block chain can obtain the hash value of the true password of the first lock.
S303, the first coded lock receives an unlocking code input by a user.
It should be noted that the execution process of S303 may refer to the execution of S201, and is not described herein again.
S304, the first coded lock sends an authentication request to the coded locks in the blockchain system, and the authentication request comprises an unlocking password.
It should be noted that the execution process of S304 may refer to the execution of S202, and is not described herein again.
S305, the first coded lock acquires a first hash value corresponding to the first coded lock.
The first hash value corresponding to the first coded lock is the hash value of the real password of the first coded lock.
Optionally, the first combination lock may obtain the first hash value locally according to an identifier of the first combination lock.
S306, the first coded lock obtains a second hash value of the unlocking password.
The first coded lock can perform hash operation on the unlocking password to obtain a second hash value of the unlocking password.
Optionally, when the unlocking password is a fingerprint password or a face image password, the first coded lock may extract a characteristic value of the unlocking password first, and obtain a hash value of the characteristic value.
S307, the first coded lock generates a verification result of the unlocking code according to the first hash value and the second hash value.
For example, when the first hash value and the second hash value are the same, the verification result is determined to be that the unlocking password is correct, and when the first hash value and the second hash value are different, the verification result is determined to be that the unlocking password is wrong.
S308, the first coded lock sends the generated verification result to other coded locks in the blockchain system.
For example, a first trick lock may broadcast its generated authentication results in a blockchain system.
By performing S305-S307, the first combination lock may obtain an authentication result for authenticating the unlocking password, and send the authentication result generated by the first combination lock to other combination locks except the first combination lock in the blockchain system.
S309, the second coded lock acquires a first hash value corresponding to the first coded lock.
Optionally, if the second coded lock joins the blockchain system before the first coded lock sends the password information, the second coded lock locally stores the first hash value corresponding to the first coded lock. If the second coded lock is added into the block chain system after the first coded lock sends the coded information, the second coded lock does not locally store the first hash value corresponding to the first coded lock.
Optionally, if the second coded lock locally stores the first hash value corresponding to the first coded lock, the second coded lock locally obtains the first hash value, and if the second coded lock does not locally store the first hash value corresponding to the first coded lock, the second coded lock obtains the first hash value from other coded locks in the block chain system.
And S310, the second password lock acquires a second hash value of the unlocking password.
It should be noted that the execution process of S310 may refer to the execution process of S306, and is not described herein again.
S311, the second coded lock generates a verification result of the unlocking password according to the first hash value and the second hash value.
It should be noted that the execution process of S311 may refer to the execution process of S307, and details are not described here.
S312, the second coded lock sends the generated verification result to other coded locks in the blockchain system.
For example, the second trick lock may broadcast its generated authentication results in the blockchain system.
By executing S309-S312, the second combination lock may obtain an authentication result of authenticating the unlocking password, and send the generated authentication result to other combination locks except for the second combination lock in the blockchain system.
It should be noted that, the other combination locks except the first combination lock in the blockchain system execute the steps shown in S309-S312 to obtain the verification result corresponding to the unlocking password.
And S313, the consensus node generates a consensus result according to the received verification result.
Optionally, the common node may be any node in the blockchain system.
Optionally, the consensus result comprises an identification of the first combination lock and a final result of the verification (success or failure).
Optionally, if the verification result is greater than or equal to the first threshold and the unlocking password is correct, the consensus result indicates that the verification of the starting password is successful, otherwise, the consensus result indicates that the verification of the unlocking password is failed.
It should be noted that the execution process of S313 may refer to the execution process of S203, and is not described herein again.
S314, the consensus node sends the consensus result to other nodes in the blockchain system.
And S315, the first coded lock determines that the consensus result comprises the identification of the first coded lock, and when the consensus result indicates that the unlocking code is successfully verified, the first coded lock performs unlocking operation.
If the consensus result indicates that the unlocking password authentication fails, the first password lock may not perform any operation.
It should be noted that, after receiving the consensus result, the other coded locks except the first coded lock in the blockchain system determine that the consensus result does not include the identification thereof, and then do not process the consensus result.
After S314, the trick lock in the blockchain system also generates blocks and adds the blocks to the blockchain.
In the embodiment shown in fig. 3, after the first coded lock receives the unlocking password input by the user, the first coded lock sends a verification request to other coded locks in the blockchain system, so that the coded locks in the blockchain system verify the unlocking password, and when the number of the coded locks in the blockchain system for verifying the unlocking password is correct is greater than or equal to the first threshold, the first coded lock can perform the unlocking operation. In the process, the coded lock in the block chain system is controlled to be opened according to the unlocking code, and only when a plurality of coded locks in the block chain system are controlled by a hacker, the hacker can control the coded lock to be opened, so that the situation that the centralized remote server controls the coded lock to be opened is avoided, and the unlocking safety of the coded lock is further improved.
Fig. 4 is a schematic structural diagram of a combination lock unlocking device based on a block chain according to an embodiment of the present invention. The device 10 for unlocking a block chain-based coded lock is applied to a first coded lock in a block chain system, wherein the block chain system comprises a plurality of coded locks, please refer to fig. 4, the device 10 for unlocking a block chain-based coded lock comprises a first obtaining module 11, a sending module 12 and an executing module 13, wherein,
the first obtaining module 11 is configured to obtain an unlocking password;
the sending module 12 is configured to send a verification request to a coded lock in the blockchain system, where the verification request includes the unlocking password, and the verification request is used to request the coded lock in the blockchain system to verify the unlocking password;
the execution module 13 is configured to execute an unlocking operation when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is greater than or equal to a first threshold.
It should be noted that, the first combination lock includes a mechanical structure, and the execution module can control the mechanical structure, so that the mechanical structure executes the unlocking operation.
It should be noted that the block chain-based coded lock unlocking device according to the embodiment of the present invention may implement the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effects thereof are similar, and are not described herein again.
In a possible implementation manner, the execution module 13 is specifically configured to:
the first coded lock acquires a consensus result, wherein the consensus result is used for indicating that the coded lock in the block chain system successfully verifies the unlocking code or fails to verify the unlocking code;
and when the consensus result indicates that the password lock in the block chain system successfully verifies the unlocking password, the first password lock executes the unlocking operation according to the consensus result.
In a possible implementation manner, the consensus result is generated by a consensus node in the blockchain system according to a verification result of a coded lock in the blockchain system on the unlocking password, and the verification result of one coded lock on the unlocking password is that the coded lock verifies that the unlocking password is correct or that the unlocking password is wrong.
In a possible implementation manner, when the number of the coded locks in the blockchain system for verifying that the unlocking password is correct is greater than or equal to a first threshold value, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password;
and when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking password.
In a possible implementation manner, the execution module is specifically configured to:
judging whether the consensus result comprises the identification of the first coded lock;
and if so, executing the unlocking operation.
Fig. 5 is a schematic structural diagram of another lock opening device of a combination lock based on a block chain according to an embodiment of the present invention. On the basis of the embodiment shown in fig. 4, please refer to fig. 5, the device 10 for unlocking a combination lock based on a blockchain may further include an authentication module 14, wherein before the execution module 13 obtains the consensus result, the authentication module 14 is configured to:
acquiring a first hash value of a real password of the first password lock;
acquiring a second hash value of the unlocking password;
judging whether the first hash value and the second hash value are the same;
if so, verifying the unlocking password to be correct;
if not, the unlocking password is verified to be wrong according to the verification result of the unlocking password.
In a possible implementation, the unlocking password included in the authentication request is encrypted information.
In a possible embodiment, the apparatus further comprises a second acquisition module 15, wherein,
the second obtaining module 15 is configured to obtain the true password of the first combination lock before the first obtaining module obtains the unlocking password;
the sending module 12 is further configured to send the true password of the first password lock to the password lock in the blockchain system.
In a possible embodiment, the apparatus further comprises a third acquisition module 16, wherein,
the third obtaining module 16 is configured to obtain a hash value of the real password;
the sending module 12 is specifically configured to send the hash value to a password lock in the blockchain system.
It should be noted that the block chain-based coded lock unlocking device according to the embodiment of the present invention may implement the technical solution shown in the above method embodiment, and the implementation principle and the beneficial effects thereof are similar, and are not described herein again.
Fig. 6 is a schematic diagram of a hardware structure of a block chain-based coded lock unlocking device according to an embodiment of the present invention, and as shown in fig. 6, the block chain-based coded lock unlocking device 20 includes: at least one processor 21, a memory 22 and a transmitter 23. Wherein the processor 21, the memory 22 and the transmitter 23 are connected by a bus 24.
In a specific implementation, the at least one processor 21 executes computer-executable instructions stored in the memory 22, so that the at least one processor 21 performs the above method for unlocking a block chain-based password lock.
For a specific implementation process of the processor 21, reference may be made to the above method embodiments, which implement similar principles and technical effects, and this embodiment is not described herein again.
In the embodiment shown in fig. 6, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the method for unlocking a coded lock based on a block chain as described above is implemented.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
The division of the units is only a logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention. Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (21)

1. A method for unlocking a coded lock based on a block chain is applied to a block chain system, the block chain system comprises a plurality of coded locks, and the method comprises the following steps:
a first coded lock in the block chain system acquires an unlocking code;
the first coded lock sends a verification request to a coded lock in the blockchain system, wherein the verification request comprises the unlocking password, and the verification request is used for requesting the coded lock in the blockchain system to verify the unlocking password;
and when the number of the coded locks for verifying the unlocking password to be correct in the block chain system is larger than or equal to a first threshold value, the first coded lock executes unlocking operation.
2. The method of claim 1, wherein the first combination lock performs an unlocking operation when the number of combination locks that verify the unlocking code is correct in the blockchain system is greater than a first threshold, comprising:
the first coded lock acquires a consensus result, wherein the consensus result is used for indicating that the coded lock in the block chain system successfully verifies the unlocking code or fails to verify the unlocking code;
and when the consensus result indicates that the password lock in the block chain system successfully verifies the unlocking password, the first password lock executes the unlocking operation according to the consensus result.
3. The method as claimed in claim 2, wherein the consensus result is generated by the consensus nodes in the blockchain system according to the verification result of the coded locks in the blockchain system on the unlocking password, and the verification result of one coded lock on the unlocking password is that the coded lock verifies that the unlocking password is correct or that the unlocking password is wrong.
4. The method according to claim 2 or 3,
when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is greater than or equal to a first threshold value, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password;
and when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking password.
5. The method of claim 2 or 3, wherein the first combination lock performs the unlocking operation according to the consensus result, comprising:
the first coded lock judges whether the consensus result comprises the identification of the first coded lock;
if so, the first coded lock executes the unlocking operation.
6. The method according to claim 2 or 3, wherein before the first combination lock obtains the consensus result, the method further comprises:
the first password obtains a first hash value of a real password of the first password lock;
the first coded lock acquires a second hash value of the unlocking password;
the first coded lock judges whether the first hash value and the second hash value are the same;
if so, the verification result of the first coded lock on the unlocking password is to verify that the unlocking password is correct;
if not, the result of the first coded lock verifying the unlocking password is that the unlocking password is wrong.
7. The method according to any one of claims 1 to 3, wherein the unlocking password included in the authentication request is encrypted information.
8. The method of any one of claims 1-3, wherein prior to the first combination lock obtaining the unlocking code, further comprising:
the first coded lock acquires a true password of the first coded lock;
the first combination lock sends the real code of the first combination lock to the combination lock in the block chain system.
9. The method of claim 8, wherein sending, by the first trick lock, the true password for the first trick lock to a trick lock in the blockchain system comprises:
the first coded lock acquires a hash value of the real password;
the first trick lock sends the hash value to a trick lock in the blockchain system.
10. A coded lock unlocking device based on a block chain is characterized in that the device is applied to a first coded lock in a block chain system, the block chain system comprises a plurality of coded locks, the device comprises a first acquisition module, a sending module and an execution module, wherein,
the first obtaining module is used for obtaining an unlocking password;
the sending module is configured to send a verification request to a password lock in the blockchain system, where the verification request includes the unlocking password, and the verification request is used to request the password lock in the blockchain system to verify the unlocking password;
the execution module is used for executing unlocking operation when the number of the coded locks for verifying the unlocking password to be correct in the block chain system is larger than or equal to a first threshold value.
11. The apparatus of claim 10, wherein the execution module is specifically configured to:
the first coded lock acquires a consensus result, wherein the consensus result is used for indicating that the coded lock in the block chain system successfully verifies the unlocking code or fails to verify the unlocking code;
and when the consensus result indicates that the password lock in the block chain system successfully verifies the unlocking password, the first password lock executes the unlocking operation according to the consensus result.
12. The apparatus of claim 11, wherein the consensus result is generated by a consensus node in the blockchain system according to a result of the verification of the unlocking password by the coded locks in the blockchain system, and a result of the verification of the unlocking password by one coded lock verifies that the unlocking password is correct or that the unlocking password is incorrect.
13. The apparatus of claim 11 or 12,
when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is greater than or equal to a first threshold value, the consensus result indicates that the coded locks in the blockchain system successfully verify the unlocking password;
and when the number of the coded locks for verifying that the unlocking password is correct in the blockchain system is smaller than a first threshold value, the consensus result indicates that the coded locks in the blockchain system fail to verify the unlocking password.
14. The apparatus according to claim 11 or 12, wherein the execution module is specifically configured to:
judging whether the consensus result comprises the identification of the first coded lock;
and if so, executing the unlocking operation.
15. The apparatus according to claim 11 or 12, further comprising a verification module, wherein before the execution module obtains the consensus result, the verification module is configured to:
acquiring a first hash value of a real password of the first password lock;
acquiring a second hash value of the unlocking password;
judging whether the first hash value and the second hash value are the same;
if so, verifying the unlocking password to be correct;
if not, the unlocking password is verified to be wrong according to the verification result of the unlocking password.
16. The apparatus according to any one of claims 10-12, wherein the unlocking password included in the authentication request is encrypted information.
17. The apparatus of any one of claims 10-12, further comprising a second acquisition module, wherein,
the second obtaining module is used for obtaining the real password of the first coded lock before the first obtaining module obtains the unlocking password;
the sending module is further configured to send the true password of the first password lock to a password lock in the blockchain system.
18. The apparatus of claim 17, further comprising a third acquisition module, wherein,
the third obtaining module is configured to obtain a hash value of the real password;
the sending module is specifically configured to send the hash value to a trick lock in the blockchain system.
19. The utility model provides a trick lock unlocking means based on block chain which characterized in that includes: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of unlocking a blockchain-based cryptographic lock of any one of claims 1 to 9.
20. A combination lock comprising a mechanical structure and the block chain based combination lock unlocking means of claim 19, wherein the block chain based combination lock unlocking means is used to control the mechanical structure to unlock, and the mechanical structure is used to perform an unlocking operation.
21. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, implement the method for unlocking a blockchain-based combination lock according to any one of claims 1 to 9.
CN201910152813.5A 2019-02-28 2019-02-28 Block chain-based coded lock unlocking method, device and equipment Active CN109779411B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910152813.5A CN109779411B (en) 2019-02-28 2019-02-28 Block chain-based coded lock unlocking method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910152813.5A CN109779411B (en) 2019-02-28 2019-02-28 Block chain-based coded lock unlocking method, device and equipment

Publications (2)

Publication Number Publication Date
CN109779411A CN109779411A (en) 2019-05-21
CN109779411B true CN109779411B (en) 2020-06-30

Family

ID=66486028

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910152813.5A Active CN109779411B (en) 2019-02-28 2019-02-28 Block chain-based coded lock unlocking method, device and equipment

Country Status (1)

Country Link
CN (1) CN109779411B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3864300B2 (en) * 2000-09-26 2006-12-27 株式会社ケンウッド Unlocking method
CN202108334U (en) * 2011-03-22 2012-01-11 兰州华维科技有限公司 Intelligent lock control management system of transformer station
CN208267584U (en) * 2018-06-04 2018-12-21 深圳市宇强实业有限公司 A kind of one-to-many intelligent door lock

Also Published As

Publication number Publication date
CN109779411A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
AU2019201720B2 (en) Method of using one device to unlock another device
EP3343831B1 (en) Identity authentication method and apparatus
US9525549B2 (en) Method and apparatus for securing a mobile application
WO2017197974A1 (en) Biometric characteristic-based security authentication method, device and electronic equipment
CN106612180B (en) Method and device for realizing session identification synchronization
CN110990827A (en) Identity information verification method, server and storage medium
CN110177124B (en) Identity authentication method based on block chain and related equipment
CN112989426B (en) Authorization authentication method and device, and resource access token acquisition method
CN106295290B (en) Method, device and system for generating authentication information based on fingerprint information
CN107977568B (en) MCU safety protection identity authentication device and method
CN115618399A (en) Identity authentication method and device based on block chain, electronic equipment and readable medium
CN108768941B (en) Method and device for remotely unlocking safety equipment
CN111565179A (en) Identity verification method and device, electronic equipment and storage medium
CN111125665A (en) Authentication method and device
CN109302442B (en) Data storage proving method and related equipment
CN115935318B (en) Information processing method, device, server, client and storage medium
CN115550002B (en) TEE-based intelligent home remote control method and related device
CN109779411B (en) Block chain-based coded lock unlocking method, device and equipment
CN111078649A (en) Block chain-based on-cloud file storage method and device and electronic equipment
CN113794571A (en) Authentication method, device and medium based on dynamic password
CN114070571A (en) Method, device, terminal and storage medium for establishing connection
CN116798153B (en) Access control authorization opening method and device
CN116866093B (en) Identity authentication method, identity authentication device, and readable storage medium
CN112449143B (en) Implementation method and implementation system of secure video
CN115277240A (en) Authentication method and device for Internet of things equipment

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
TA01 Transfer of patent application right

Effective date of registration: 20200207

Address after: Room A402, floor 4, building 2, No. 18, Kechuang 11th Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing 100076

Applicant after: Beijing Wodong Tianjun Information Technology Co., Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100195

Applicant before: Jingdong Digital Technology Holding Co., Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant