Disclosure of Invention
The invention aims to solve the technical problems in the prior art, and provides a passive wireless intelligent lockset system for an electric cabinet door, which is convenient to maintain, flexible in key management, capable of completing all operations without the need of authorizing in advance, and capable of effectively saving manpower and material resources.
In order to solve the technical problems, the invention adopts the following technical scheme: the utility model provides a passive wireless intelligent tool to lock system for electric cabinet door, includes the passive lock core of installing on electric cabinet door and with passive lock core matched with key, the key is the intelligent wireless key that inside is provided with battery and intelligent unlocking circuit module, passive lock core with intelligent unlocking circuit module is all through battery powered, intelligent unlocking circuit module includes microprocessor module and meets and be used for the lock core communication module with passive lock core communication with microprocessor module to and meet and be used for the wireless communication module with wireless receiving device radio communication with microprocessor module, wireless receiving device is connected and communicates with the management main website that unblanks.
The passive wireless intelligent lockset system for the electric cabinet door and the unlocking method are characterized in that the battery is a button battery or a rechargeable battery.
The wireless communication module is a LoRa remote transmission module, a WIFI module or a Bluetooth module.
The invention also provides an unlocking method of the passive wireless intelligent lockset system for the electric cabinet door, which has high unlocking speed, excellent safety and operability, and the method comprises the following steps:
step one, a worker uses a key to insert a passive lock cylinder;
step two, the passive lock cylinder obtains power supplied by the key and is communicated with the key through the lock cylinder communication module, and the key, the passive lock cylinder and the unlocking management master station conduct unlocking authentication through a preset encryption authentication algorithm; when the unlocking authentication fails, adding the key into a blacklist; when the unlocking authentication is passed, the passive lock core sends an encrypted random number to the key, the key is communicated with the wireless receiving device through the wireless communication module, key data is sent to the wireless receiving device, the wireless receiving device immediately inquires about authorization information from the unlocking management master station, and when the unlocking is legal, an unlocking password is issued to normally unlock;
and thirdly, waiting for receiving unlocking result information by the key, and receiving and uploading the unlocking result information to the unlocking management master station through the wireless receiving device.
In the unlocking method of the passive wireless intelligent lockset system, in the second step, the key, the passive lock cylinder and the unlocking management master station conduct unlocking authentication through a preset encryption authentication algorithm; when the unlocking authentication fails, adding the key into a blacklist; when the unlocking authentication is passed, the passive lock core sends an encrypted random number to the key, the key is communicated with the wireless receiving device through the wireless communication module, key data is sent to the wireless receiving device, the wireless receiving device immediately inquires about authorization information from the unlocking management master station, and when the unlocking is legal, an unlocking password is issued to normally unlock; the specific process is as follows:
step S1, when passive lock cylinders are installed, each passive lock cylinder and an unlocking management master station maintain private information;
s2, using a network number of an area where the passive lock cylinder is located as a seed to generate N bytes of key pool initial information;
s3, when a key is inserted into a passive lock cylinder, the passive lock cylinder immediately generates two groups of random numbers after the key is powered, the first group of random numbers firstly perform modular operation on private information, then perform modular operation on N, and the result is used as an offset to obtain 1 character corresponding to initial information of a key pool; performing modular operation on the private information by using 8 bytes from the initial offset, performing modular operation on N, taking the result as the offset of the next key character to obtain a second key character, and repeating the steps until a dynamic key corresponding to the first group of random numbers is obtained;
s4, encrypting a second group of random numbers by adopting a dynamic key corresponding to the first group of random numbers, adding the ID of the first group of random numbers and the passive lock core after the ciphertext, and encrypting the second group of random numbers by using a public key of an unlocking management master station after the SHA-1 hash value of all the characters, so as to form the ciphertext and uploading the ciphertext to the key;
s5, after the key obtains the passive lock cylinder uploading ciphertext, the key does not need to be modified, the ID of the key is added behind the ciphertext, the SHA-1 hash value of all the characters in the front is encrypted by the key, and the ciphertext is formed and uploaded to the unlocking management master station through the wireless receiving device;
s6, after obtaining the ciphertext uploaded by the key, the unlocking management master station judges the ciphertext source, retrieves the key information, then according to the public key of the key, unlocks the key encryption information, and judges whether the ID of the key is effective; when the ID of the key is invalid, an error message is issued, and the request is not processed any more; when the ID of the key is valid, step S8 is executed;
s7, unlocking the ciphertext by the unlocking management master station through the private key of the unlocking management master station to obtain the ciphertext encrypted by the dynamic key and a first group of random numbers; then, the first group of random numbers firstly perform modular operation on the private information, then perform modular operation on N, the result is used as an offset to obtain 1 character corresponding to the initial information of the key pool, then perform modular operation on the private information by 8 bytes from the beginning of the offset, and then perform modular operation on N, the result is used as the offset of the next key character to obtain a second key character, and the steps are repeated until the ciphertext encrypted by the dynamic key and the second group of random numbers are obtained;
s8, judging whether the key has the authority to open the corresponding passive lock cylinder or not at the moment, when judging that the key has no unlocking authority, issuing unlocking refusing information by the unlocking management master station, when judging that the key has the unlocking authority, taking a mode of private information by a second group of random numbers by the unlocking management master station, encrypting the public key of the passive lock cylinder, sending the encrypted private information to the key, and directly sending the information to the passive lock cylinder by the key without any processing;
and S9, after receiving the reply information, the passive lock cylinder unwraps the ciphertext through the private key of the passive lock cylinder, compares the ciphertext with the result of the second group of random numbers modulo the private information, and executes unlocking action when the result is the same.
In the unlocking method of the passive wireless intelligent lockset system, in the step S1, the private information is a 4-byte unsigned integer;
in step S2, when the network number of the area where the passive lock core is located is used as a seed to generate key pool initial information, a 128 byte character string is generated as the key pool initial information;
the two sets of random numbers generated in the step S3 are all 8-byte random numbers, and the dynamic key corresponding to the first set of random numbers is a 16-byte dynamic key;
in the step S4, when the second group of random numbers are encrypted by adopting the dynamic key corresponding to the first group of random numbers, the second group of random numbers are symmetrically encrypted by adopting the dynamic key corresponding to the first group of random numbers, so that 128-bit ciphertext is obtained; in the step S4, the formed ciphertext is uploaded to the key, and 64 bytes of ciphertext is formed and uploaded to the key;
in the step S5, the formed ciphertext is uploaded to the unlocking management master station through the wireless receiving device, and the formed ciphertext is uploaded to the unlocking management master station through the wireless receiving device;
step S6, unlocking key encryption information to obtain 64 bytes of lock cylinder information, a key ID and a Hash character; in the step S6, if the ID of the key is valid, judging whether the ID of the broken key and the Hash character are correct;
in the step S7, the unlocking management master station adopts a private key of the master station to unlock the ciphertext, and processes 64 bytes of lock cylinder information; in step S7, the ciphertext encrypted by the dynamic key and the first set of random numbers, and the ciphertext encrypted by the dynamic key and the second set of random numbers are all 16-byte ciphertext.
In the above unlocking method of the passive wireless intelligent lockset system, the unlocking result information in the third step includes unlocking success/failure information, a key number, a lock core number and unlocking time.
Compared with the prior art, the invention has the following advantages:
1. the lock cylinder adopted by the invention is a passive lock cylinder, and after the passive lock cylinder is replaced on a lockset of an electric cabinet door, power supply is not needed, and maintenance is basically not needed; the wireless receiving device records the ID and the corresponding information of the actual position of each passive lock core, a key is allocated to a worker, all cabinet doors can be unlocked and opened through configuration, and manpower and material resources can be effectively saved.
2. According to the passive wireless intelligent lockset system, the wireless communication function is set for the key, so that wireless communication with the wireless receiving device and the unlocking management master station can be realized, real-time authorization and unlocking authority verification can be realized, the unlocking state can be uploaded in real time through a wireless communication mode, and a brand-new electric cabinet door unlocking mode is provided.
3. According to the passive wireless intelligent lockset system and the unlocking method thereof, the unlocking authority is authorized in real time, so that the condition that the authority cannot be changed after a key is distributed is avoided, and the use is more convenient.
4. According to the passive wireless intelligent lockset system and the unlocking method thereof, information such as unlocking success/failure information, key numbers, lock cylinder numbers, unlocking time and the like can be uploaded in real time, and the unlocking management master station can immediately obtain all information of unlocking events.
5. The unlocking method of the passive wireless intelligent lockset system is flexible in key management, and all operations can be completed by staff without the need of early authorization and with keys on site.
6. The unlocking method of the passive wireless intelligent lockset system innovatively designs a master station, a key and a lock cylinder encryption authentication algorithm, and stores private information between each lock cylinder and the master station in addition to public and private key information of the passive lock cylinder, the key and the master station; generating two groups of random numbers for each authentication, and obtaining a unique symmetric key for each unlocking through operations such as the random numbers and private information; the method effectively prevents the possibility of attacks such as interception, tampering, replay and the like, and has excellent security and operability.
7. The unlocking method of the passive wireless intelligent lockset system adopts the simplified encryption and decryption algorithm and flow, reduces the calculated amount as much as possible and has higher unlocking speed on the basis of ensuring the safety.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Detailed Description
Example 1
As shown in fig. 1 and 2, the passive wireless intelligent lock system for an electric cabinet door of the present embodiment includes a passive lock cylinder 1 mounted on an electric cabinet door 3 and a key 2 matched with the passive lock cylinder 1, the key 2 is an intelligent wireless key internally provided with a battery 7 and an intelligent unlocking circuit module, the passive lock cylinder 1 and the intelligent unlocking circuit module are powered by the battery 7, that is, when the battery 7 contacts the passive lock cylinder 1 except ensuring normal operation of the key 2, a lock cylinder processor and a motor in the passive lock cylinder 1 can be powered, so as to ensure normal operation of the lock cylinder processor and the motor, the intelligent unlocking circuit module includes a microprocessor module 4-1, a lock cylinder communication module 4-2 connected with the microprocessor module 4-1 and used for communicating with the passive lock cylinder 1, and a wireless communication module 4-3 connected with the microprocessor module 4-1 and used for wireless communication with a wireless receiving device 5, and the wireless receiving device 5 is connected with an unlocking management master station 6 and communicates with the unlocking management master station 6.
When the passive lock cylinder 1 is in specific implementation, the passive lock cylinder 1 comprises a connecting rod, a motor for driving the connecting rod to rotate and a lock cylinder processor for controlling the motor, when the electric cabinet door 3 is normally closed, the connecting rod arranged on the passive lock cylinder 1 is in a locking state and cannot rotate to unlock, and when the key 2 is inserted into the passive lock cylinder 1, a battery 7 in the key 2 automatically supplies power to the lock cylinder processor and the motor in the passive lock cylinder 1, so that the lock cylinder processor and the motor are ensured to normally operate.
In this embodiment, the battery 7 is a button battery or a rechargeable battery.
In this embodiment, the wireless communication module 4-3 is a LoRa remote transmission module, a WIFI module or a bluetooth module.
In the implementation, the wireless communication module 4-3 is selected to be a LoRa remote transmission module, a WIFI module or a bluetooth module according to the actual application scenario.
In this embodiment, the electrical cabinet door 3 is a cabinet door of a secondary fusion complete ring main unit, the wireless receiving device 5 is an operation interval module, and the operation interval module is in communication with the unlocking management master station 6 through DTU or 4G/5G wireless communication.
Example 2
The unlocking method of the passive wireless intelligent lockset system for the electric cabinet door comprises the following steps:
step one, a worker inserts a passive lock cylinder 1 by using a key 2;
step two, the passive lock cylinder 1 obtains power supplied by the key 2, the power is communicated with the key 2 through the lock cylinder communication module 4-2, and the key 2, the passive lock cylinder 1 and the unlocking management master station 6 perform unlocking authentication through a preset encryption authentication algorithm; when the unlocking authentication fails, adding the key 2 into a blacklist; when the unlocking authentication is passed, the passive lock cylinder 1 sends an encrypted random number to the key 2, the key 2 communicates with the wireless receiving device 5 through the wireless communication module 4-3, key data is sent to the wireless receiving device 5, the wireless receiving device 5 immediately inquires authorization information from the unlocking management master station 6, and when the unlocking is legal, an unlocking password is issued to normally unlock;
in specific implementation, the lock cylinder communication module 4-2 is a wired communication module, and the passive lock cylinder 1 performs power taking and wired communication through physical contact between the key 2 and the lock cylinder; for example, two metal grooves are formed in the passive lock cylinder 1, two raised metal contacts are formed in the key 2, the key 2 contacts the metal grooves through the two raised metal contacts, power is supplied to the passive lock cylinder 1, and a communication function is achieved through the two contact points.
And thirdly, the key 2 waits for receiving unlocking result information, and the unlocking result information is received by the wireless receiving device 5 and uploaded to the unlocking management master station 6.
In the second embodiment, the key 2, the passive lock cylinder 1 and the unlocking management master station 6 perform unlocking authentication through a preset encryption authentication algorithm; when the unlocking authentication fails, adding the key 2 into a blacklist; when the unlocking authentication is passed, the passive lock cylinder 1 sends an encrypted random number to the key 2, the key 2 communicates with the wireless receiving device 5 through the wireless communication module 4-3, key data is sent to the wireless receiving device 5, the wireless receiving device 5 immediately inquires authorization information from the unlocking management master station 6, and when the unlocking is legal, an unlocking password is issued to normally unlock; the specific process is as follows:
step S1, when the passive lock cylinders 1 are installed, each passive lock cylinder 1 and the unlocking management master station 6 maintain private information; the private information is not read after being written in, and the life cycle of the passive lock cylinder 1 is not changed;
in this embodiment, the private information in step S1 is a 4-byte unsigned integer;
in this embodiment, the private information maintained by the passive lock cylinder 1 and the unlocking management master station 6 is: 0XAABBCCDD; the wireless communication module 4-3 is a LoRa remote transmission module, and the LoRa network number of the area where the passive lock cylinder 1 is located is: 0XAB;
s2, using a network number of the area where the passive lock cylinder 1 is located as a seed to generate N bytes of key pool initial information;
in this embodiment, in step S2, when the network number of the area where the passive lock cylinder 1 is located is used as a seed to generate key pool initial information, a 128 byte character string is generated, that is, the value of N is 128, which is used as the key pool initial information;
in this embodiment, the network number 0XAB of the area where the passive lock core 1 is located is used as a seed to generate a 128 byte character string: 2D09 6398 86B8 3AB3 6CF9 839F 3DB7 A883 4BB9 3B87 8802 06EB 4B96 E8BF 7370 9D6D 2217 180E 7584 87DE 7B96 7F6B A376 CF91 20A9 2945 51A2 B394 1F26 4362 B82C 8493 2238 208D 5208 A98F 6BC8 BD2C 1695 C2F6 755B 3517 78BF 3723 5C80 E370 D788 83C8 7B75 D032 D3F6 3EA2 07E5 6011 58F7 93DB 237B 0FAC F338 14F2 1E3D 3E87 0D20 0EFE as key pool initial information;
step S3, when the key 2 is inserted into the passive lock cylinder 1, the passive lock cylinder 1 immediately generates two groups of random numbers after the key (2) is powered, the first group of random numbers firstly perform modular operation on private information, then perform modular operation on N, and the result is used as an offset to obtain 1 character corresponding to initial information of a key pool; performing modular operation on the private information by using 8 bytes from the initial offset, performing modular operation on N, taking the result as the offset of the next key character to obtain a second key character, and repeating the steps until a dynamic key corresponding to the first group of random numbers is obtained;
in this embodiment, the two sets of random numbers generated in step S3 are both 8-byte random numbers, and the dynamic key corresponding to the first set of random numbers is a 16-byte dynamic key;
in this embodiment, the two sets of 8-byte random numbers generated are respectively: 6B67 8537 6DB2 49E6 and F973 5678 55CD d924, the first set of random numbers modulo the secret information, are formulated as: ((0X 6B67 8537 6DB2 49E6) MOD (0 XAABBCCDD)) MOD (0X 80) = 0X13,0X13 is 19 in 10 scale, the 19 th number corresponding to the key pool initial information is 0X4B, and 8 bytes from 19 characters are: 4BB9 3B87 8802 06EB the number of the individual pieces of the plastic,
((0X 4BB9 3B87 8802 06EB) MOD (0 xabccdd)) MOD (0X 80) =0x2f, 0x2f is 10 th digit of 37 in the key pool initial information is 0X75, and 8 bytes from 37 characters are: 7584 87DE 7B96 7F6B,
repeating the above modulo operation process for 16 times, and finally obtaining a dynamic key of 16 bytes corresponding to the first group of random numbers as 0X4B75 33FA FD31 C21C 2617 3A46 2254 4F5F;
s4, encrypting a second group of random numbers by adopting a dynamic key corresponding to the first group of random numbers, adding the first group of random numbers and the ID of the passive lock cylinder 1 after the ciphertext, and encrypting the second group of random numbers by using a public key of the unlocking management master station 6 after the SHA-1 hash value of all the characters before, so as to form the ciphertext and uploading the ciphertext to the key 2;
in this embodiment, in step S4, when the second set of random numbers is encrypted by using the dynamic key corresponding to the first set of random numbers, the second set of random numbers is symmetrically encrypted by using the dynamic key corresponding to the first set of random numbers, so as to obtain 128-bit ciphertext; in step S4, the ciphertext is uploaded to the key 2, and 64 bytes of ciphertext is uploaded to the key 2;
in this embodiment, the ID of the passive lock cylinder 1 is 0XABCD;
s5, after the key 2 obtains the ciphertext uploaded by the passive lock cylinder 1, the key is not modified, the ID of the key is added behind the ciphertext, the hash value of the SHA-1 of all the characters in the front is encrypted by the private key of the key, and the ciphertext is formed and uploaded to the unlocking management master station 6 through the wireless receiving device 5;
in this embodiment, in step S5, the ciphertext is uploaded to the unlocking management master station 6 through the wireless receiving device 5, and the ciphertext is formed into 96 bytes and uploaded to the unlocking management master station 6 through the wireless receiving device 5;
step S6, after obtaining the ciphertext uploaded by the key 2, the unlocking management master station 6 judges the ciphertext source, searches the key information, then according to the public key of the key 2, unlocks the key encryption information, and judges whether the ID of the key 2 is valid or not; when the ID of the key 2 is invalid, an error message is issued, and the request is not processed any more; when the ID of the key 2 is valid, step S8 is performed;
in this embodiment, the step S6 of unlocking the key encryption information obtains 64 bytes of lock cylinder information plus the ID of the key 2, and Hash characters; in step S6, if the ID of the key 2 is valid, it is determined whether the ID and Hash character of the key 2 are correct;
s7, unlocking the ciphertext by the master station 6 by adopting the private key of the master station to obtain the ciphertext encrypted by the dynamic key and a first group of random numbers; then, the first group of random numbers firstly perform modular operation on the private information, then perform modular operation on N, the result is used as an offset to obtain 1 character corresponding to the initial information of the key pool, then perform modular operation on the private information by 8 bytes from the beginning of the offset, and then perform modular operation on N, the result is used as the offset of the next key character to obtain a second key character, and the steps are repeated until the ciphertext encrypted by the dynamic key and the second group of random numbers are obtained;
in this embodiment, in step S7, the unlocking management master station 6 uses its own private key to unlock the ciphertext, which is to process 64 bytes of lock cylinder information; in step S7, the ciphertext encrypted by the dynamic key and the first set of random numbers, and the ciphertext encrypted by the dynamic key and the second set of random numbers are all obtained by 16 bytes; when the ciphertext encrypted by the dynamic key and the second group of random numbers are obtained, the process of modulo operation is repeated 16 times;
in this embodiment, the first set of random numbers is: 6B67 8537 6DB2 49E6, the second set of random numbers is: f973 5678 55CD d924;
step S8, the unlocking management master station 6 judges whether the key 2 has the authority to unlock the corresponding passive lock cylinder 1 at the moment, when judging that the key has no unlocking authority, the unlocking management master station 6 issues unlocking refusing information, when judging that the key has the unlocking authority, the unlocking management master station 6 takes the mode of the second group of random numbers on private information, then encrypts the private information through the public key of the passive lock cylinder 1, sends the private information to the key 2, does not perform any processing on the key 2, and directly sends the information to the passive lock cylinder 1;
in specific implementation, an unlocking authority table is stored in the unlocking management master station 6, and the authority is updated in real time according to the requirements of staff, wherein the unlocking authority table comprises whether a lock cylinder and a key are valid or not, and which key can be used for starting which passive lock cylinder in a certain period of time; when the unlocking management master station 6 judges whether the key 2 has the right of opening the corresponding passive lock cylinder 1, the unlocking management master station judges by inquiring an unlocking right table;
in this embodiment, the unlocking management master station 6 models the secret information by a second set of random numbers, expressed as: (0XF973 5678 55CD D924) MOD (0 XAABB CCDD) =0x3df1 41AC; then encrypting 0X 3DF1 41AC by the public key of the passive lock cylinder 1 and sending to the key 2;
and S9, after receiving the reply information, the passive lock cylinder 1 unlocks the ciphertext through the private key of the passive lock cylinder, compares the ciphertext with the result of the second group of random numbers for taking the modulus of the private information, and when the result is the same, performs unlocking action, namely rotates the motor and opens the lock cylinder.
In this embodiment, the comparison with the second set of random numbers modulo the secret information is a comparison with the value obtained by MOD (0 XAABB CCDD) (0XF973 5678 55CD D924).
The foregoing description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and any simple modification, variation and equivalent structural changes made to the above embodiment according to the technical substance of the present invention still fall within the scope of the technical solution of the present invention.