Method for binding and unbinding primary and secondary locks
By combining RFID cards and Bluetooth communication, the complexity and security issues in the binding and unbinding process of master locks and slave locks have been resolved, realizing a convenient, efficient, and secure binding and unbinding process, and improving the efficiency and reliability of fleet management.
Patent Information
- Application Number
- CN202511599738.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-04
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-11-04
AI Technical Summary
Existing technologies have technical defects in the interaction layer during the binding and unbinding of master and child locks, such as high input error rate, cumbersome operation steps, insufficient security of the communication layer, poor data consistency and reliability, and lack of transaction rollback mechanism, which makes the operation complex and vulnerable to attack.
Using RFID cards for binding and unbinding operations, combined with Bluetooth communication, the RFID cards carry encrypted information and advanced read/write protection mechanisms to achieve a convenient and secure binding and unbinding process for master and slave locks. Asymmetric and symmetric encryption technologies are introduced, and a transaction processing mechanism is combined to ensure the reliability and consistency of the operation.
It simplifies the operation process, improves the efficiency and security of binding and unbinding, reduces the error rate and the risk of illegal tampering, ensures the stability of information transmission and the accuracy of device interaction, and meets the safety requirements of dynamic fleet management.
Smart Images

Figure CN121075015A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data interaction, and in particular to a method for binding and unbinding of a master lock and a slave lock. BACKGROUND
[0002] In the logistics transportation industry, there is a demand for quick combination of a master lock and a slave lock in the management of locks for transport equipment such as trucks, containers, and refrigerated vehicles in scenarios such as “one truck with multiple containers” and “multi-section lock control for cross-border transportation”.
[0003] In the warehouse and supply chain management industry, there is a demand for hierarchical management of “region - shelf - single product” in the multi-level permission lock control of scenarios such as warehouse gates, shelves, and refrigerated warehouses.
[0004] The traditional method for one master lock and multiple slave locks is as follows: The information input method is manual input through the graphical interface of a terminal device: through the text box, drop-down menu, and other components of a mobile phone APP or computer management terminal, the physical ID, device type, and binding rules of the slave lock and the master lock are manually filled in by a person.
[0005] The triggering mechanism is pure software instruction triggering: the user clicks the binding or unbinding button on the terminal APP to send a wireless instruction to the lock, without a physical interaction link.
[0006] The state feedback is terminal screen prompt: the operation result is informed to the user through the APP pop-up window and list color change (such as green for successful binding and red for failed binding).
[0007] The device information is directly transmitted through Bluetooth or WiFi, and the information input by the terminal is synchronized to the lock.
[0008] The binding process: the terminal first establishes a Bluetooth connection with the master lock and sends a JSON format data packet containing the ID list of the slave lock; the master lock then scans the Bluetooth signal of the slave lock one by one and completes the binding according to the ID matching.
[0009] The unbinding process: the terminal sends an ID deletion instruction to the master lock, and the master lock notifies the corresponding slave lock to clear the association record through Bluetooth or WiFi.
[0010] The security mechanism: the identity verification verifies the legitimacy of the terminal through a pre-set static key (such as a default key at the factory or a customer-set key) of the lock, and the key is stored in the terminal APP or the lock firmware.
[0011] The above method has the following disadvantages: Defects in the interaction layer technology: high input error rate: relying on manual recognition of characters on the lock tag, input errors are easily caused by blurred characters and visual angle deviation.
[0012] The operation steps are complicated: the user needs to complete the following steps in sequence: "selecting the master lock, searching the child lock list, checking the target child lock, and confirming the binding / unbinding", and the like.
[0013] The communication layer technology has defects: the security mechanism verifies the legality of the terminal by using a static key, lacks dynamic verification means, and has the risk of being cracked by reverse engineering. No physical medium is introduced to participate in identity verification, and the system is vulnerable to remote replay attacks or fake terminal fraud.
[0014] The data consistency and reliability technology has defects: there is no transaction rollback mechanism, and if the binding / unbinding operation is interrupted (such as Bluetooth disconnection or device crash), the data of the master lock and the child lock may be inconsistent. The terminal needs to query the lock state, and manual intervention is required to repair the inconsistency when the inconsistency is found.
[0015] Therefore, the prior art has defects and needs to be improved. SUMMARY
[0016] The technical problem to be solved by the present application is to provide a method for binding and unbinding a master lock and a child lock to solve the problems mentioned in the background art.
[0017] The technical solution of the present application is as follows: a method for binding and unbinding a master lock and a child lock is provided, comprising the following steps: S1: using a binding / unbinding RFID card to swipe the master lock; the master lock detects the RFID card, writes the master lock certificate information into the RFID card, the master lock certificate information contains the ID of the master lock; after the master lock certificate information is successfully written into the RFID card, the master lock starts Bluetooth scanning; the RFID card is divided into two types, one is a binding RFID card, and the other is an unbinding RFID card; when the binding RFID card is used, it is a child lock and master lock binding operation, and when the unbinding RFID card is used, it is a child lock and master lock unbinding operation.
[0018] S2: using the RFID card to swipe the child lock, the child lock reads the master lock certificate information written by the master lock in the RFID card and verifies it; after the verification is successful, the child lock initiates Bluetooth broadcast and waits for the master lock to respond; the Bluetooth broadcast contains child lock certificate information, and the child lock certificate information contains the ID of the child lock.
[0019] S3: the master lock acquires the Bluetooth broadcast sent by the child lock, and verifies the child lock certificate information of the Bluetooth broadcast; if it is a legal child lock certificate information, step S4 is entered, and if it is an illegal child lock certificate information, the master lock stops verifying the child lock.
[0020] S4: The parent lock adds the ID of the child lock to the list of locks to be bound or unbound, connects to the child lock through Bluetooth, initiates a binding / unbinding request, and waits for a response from the child lock. When a binding operation is performed, the parent lock adds the ID of the child lock to the list of locks to be bound, connects to the child lock through Bluetooth, initiates a binding request, and waits for a response from the child lock; when an unbinding operation is performed, the parent lock adds the ID of the child lock to the list of locks to be unbound, connects to the child lock through Bluetooth, initiates an unbinding request, and waits for a response from the child lock. In the present application, the " / " in binding / unbinding means "or", and binding / unbinding means binding or unbinding; similarly, the " / " in the list of locks to be bound / unbound also means "or", and the list of locks to be bound / unbound means the list of locks to be bound or the list of locks to be unbound, and when a binding operation is performed, the list of locks to be bound is operated, and when an unbinding operation is performed, the list of locks to be unbound is operated.
[0021] S5: The child lock checks whether the ID of the parent lock is the same as before and obtains the binding / unbinding request of the parent lock. When a binding operation is performed, the child lock checks whether the ID of the parent lock is the same as before and obtains the binding request of the parent lock; when an unbinding operation is performed, the child lock checks whether the ID of the parent lock is the same as before and obtains the unbinding request of the parent lock.
[0022] S6: The child lock adds the ID of the parent lock to the list of locks to be bound / unbound, returns a successful response to the parent lock, and waits for a response from the parent lock. When a binding operation is performed, the child lock adds the ID of the parent lock to the list of locks to be bound, returns a successful response to the parent lock, and waits for a response from the parent lock; when an unbinding operation is performed, the child lock adds the ID of the parent lock to the list of locks to be unbound, returns a successful response to the parent lock, and waits for a response from the parent lock. S7: The parent lock adds / deletes the ID of the child lock in the list of bound locks, arranges the list of locks to be bound / unbound, and sends a confirmation instruction to the child lock. When a binding operation is performed, the parent lock adds the ID of the child lock in the list of bound locks, arranges the list of locks to be bound, and sends a confirmation instruction to the child lock; when an unbinding operation is performed, the parent lock deletes the ID of the child lock in the list of bound locks, arranges the list of locks to be unbound, and sends a confirmation instruction to the child lock.
[0023] S8: The child lock adds / deletes the ID of the parent lock in the list of bound locks and arranges the list of locks to be bound / unbound. When a binding operation is performed, the child lock adds the ID of the parent lock in the list of bound locks and arranges the list of locks to be bound; when an unbinding operation is performed, the child lock deletes the ID of the parent lock in the list of bound locks and arranges the list of locks to be unbound.
[0024] S9: Whether there are still child locks to be bound / unbound after the current child lock is successfully bound / unbound; if not, the process ends; if so, the process proceeds to step S2.
[0025] The RFID card of the present application has advanced read-write protection mechanism, its internal storage structure is usually divided into multiple areas, each area is provided with independent access control permission. Taking the common M1 card as an example, the EEPROM structure is divided into 16 areas, each area is divided into 4 segments, each segment has 16 bytes, the last segment (tail) of each area contains two keys and the access conditions of each segment of the area, these access conditions can be set by programming. For the key information storage area, such as the area storing the mother lock certificate information, strict access permission is set, only authorized read-write operation is allowed.
[0026] In application, the user first uses the RFID card to swipe the mother lock, the read-write module built-in the mother lock writes the mother lock certificate information into the corresponding protected area of the RFID card according to the above read-write protection rules. After completing the writing, the RFID card is used to swipe the child lock, the read module of the child lock reads the information of the mother lock in the RFID card after passing the read permission verification of the RFID card, and verifies the mother lock certificate through the built-in certificate verification module.
[0027] Further, when the mother lock writes the mother lock certificate information into the RFID card, the RFID card first verifies the access permission of the mother lock, the read-write module built-in the mother lock needs to use the correct key, and initiates the write request according to the pre-set access conditions of the RFID card, and only when the permission verification is passed, the write mother lock certificate information operation can be successfully executed; similarly, when the child lock reads the mother lock certificate information in the RFID card, the RFID card verifies the read permission of the child lock, the read-write module built-in the child lock needs to use the correct key, and initiates the read request according to the pre-set access conditions of the RFID card, only the child lock with matching permission can read the corresponding information, so as to ensure that the information stored in the RFID card is not illegally read or tampered.
[0028] Further, the mother lock pre-stores the mother lock public key, the mother lock private key and the manufacturer public key, and the mother lock certificate information further includes the mother lock public key and the certificate signature generated based on the digital signature algorithm; therefore, the mother lock certificate information contains the ID of the mother lock, the mother lock public key and the certificate signature generated based on the digital signature algorithm. The child lock pre-stores the manufacturer public key, and the child lock certificate information further includes the certificate signature generated based on the digital signature algorithm, therefore, the child lock certificate information contains the ID of the child lock and the certificate signature generated based on the digital signature algorithm.
[0029] Further, the parent lock certificate information and the child lock certificate information are signed by the manufacturer of the parent lock and the child lock; when manufacturing the parent lock, the manufacturer will organize the ID and the public key of the parent lock, and use the private key of the manufacturer to encrypt and sign the ID and the public key of the parent lock, to generate the parent lock certificate information; when manufacturing the child lock, the manufacturer will organize the ID of the child lock, and use the private key of the manufacturer to encrypt and sign the ID of the child lock, to generate the child lock certificate information.
[0030] Further, in step S2, the reading module of the child lock reads the parent lock certificate information in the RFID card after passing the reading permission verification of the RFID card, and verifies the parent lock certificate information through the built-in certificate verification module; when verifying the parent lock certificate information, the child lock first acquires the certificate signature of the manufacturer in the parent lock certificate information, the public key of the manufacturer is pre-stored in the certificate verification module of the child lock, and the certificate signature of the manufacturer is decrypted by using the public key of the manufacturer, to obtain the hash value of the parent lock certificate information; at the same time, the child lock calculates the ID and the public key of the parent lock by using the same hash algorithm, to obtain another hash value; the two hash values are compared, if consistent, it proves that the parent lock certificate information has not been tampered with and is signed by a legal manufacturer, and the identity of the parent lock is real and reliable; after confirming that the parent lock certificate information is correct, the child lock initiates a Bluetooth broadcast; the Bluetooth broadcast information is encrypted by using the public key of the parent lock, and the content includes the random number generated by the child lock and the child lock certificate information.
[0031] Further, in step S3, after receiving the Bluetooth broadcast information of the child lock, the parent lock decrypts the encrypted content by using the private key of the parent lock itself, to obtain the random number of the child lock and the child lock certificate information; the parent lock verifies the child lock certificate information obtained by decryption; the public key of the manufacturer is pre-stored in the certificate verification module of the parent lock, and when verifying the child lock certificate information, the signature of the manufacturer in the child lock certificate information is decrypted by using the public key of the manufacturer, to obtain the hash value of the child lock certificate information, and at the same time, the ID of the child lock is calculated by using the hash algorithm, and the two hash values are compared to confirm the authenticity and integrity of the child lock certificate information; after verification, the parent lock initiates a Bluetooth connection request to the child lock according to the device identifier in the Bluetooth broadcast information of the child lock, and in the Bluetooth communication process, in order to ensure the security of data transmission, the random number generated by the child lock in the Bluetooth broadcast content is used as a symmetric encryption key to encrypt the transmitted data, to realize the safe interaction of data.
[0032] Further, after verifying that the child lock certificate information is correct, the parent lock first adds the ID of the child lock to its own to-be-bound / to-be-unbound list, to record the target child lock of the current operation; then, the parent lock initiates a corresponding request instruction to the child lock according to the current operation type: binding / unbinding; after receiving the request of the parent lock, the child lock adds the ID of the parent lock to its own to-be-bound / to-be-unbound list, and returns the information of successful response to the parent lock after the operation is completed. Further, the process of binding / unbinding state updating and list sorting is as follows: after the parent lock receives the feedback of the successful response of the child lock, the parent lock adds or deletes the child lock ID in the bound list of the parent lock according to the operation type, and completes the updating of the binding state of the parent lock; then, the parent lock sorts the to-be-bound / to-be-unbound list and releases the list resource to avoid the influence of redundant data on subsequent operations; finally, the parent lock sends a confirmation instruction to the child lock, and the child lock adds or deletes the parent lock ID in the bound list of the child lock according to the confirmation instruction, updates the binding state of the child lock, sorts the to-be-bound / to-be-unbound list, and completes the whole binding or unbinding operation process. Further, in order to ensure the reliability and consistency of the binding and unbinding transaction, a transaction processing mechanism is introduced in the protocol design; in the binding or unbinding operation process, each step, such as information writing to the RFID card, certificate verification, Bluetooth connection establishment, list updating, etc., is regarded as a transaction node, and only when all transaction nodes are successfully executed, the whole binding or unbinding operation is regarded as successfully completed; if any abnormal situation occurs in the operation process, such as certificate verification failure, communication interruption, list updating error, etc., the child lock and the parent lock will be restored to the state before the operation; if the child lock and the parent lock cannot confirm the data consistency, the user will be notified by obvious sound and light signals to re-perform the binding and unbinding operation to synchronize the information, so as to avoid the situation of data inconsistency or device state abnormality; through mutual information sending between the child lock and the parent lock, it is confirmed that both can normally receive and send data, and then the operation of modifying the binding / unbinding state is performed, so as to ensure that only in a very small probability, the user needs to participate in the synchronization of the child lock and the parent lock information.
[0033] Further, in order to facilitate the user to intuitively understand the execution of the binding or unbinding process, sound and light feedback devices are arranged on the child lock and the parent lock; when the binding or unbinding operation starts, the child lock and the parent lock will emit a specific frequency sound and light flashing signal to prompt that the operation has started; when the operation is successfully completed, the child lock and the parent lock will emit another different sound and light signal to inform the user that the operation is successful; if an error occurs in the operation process, the child lock and the parent lock will emit a sharp sound and light signal to remind the user that the operation is wrong, so that the user can take corresponding measures in time.
[0034] By adopting the above scheme, the present application provides a child-parent lock binding and unbinding method, which has the following technical effects: Innovative application of RFID card: The application breaks through the traditional idea and applies the RFID card to the binding or unbinding device operation of the child-mother lock. By using the encrypted information carried by the RFID card and its advanced read-write protection characteristics, a convenient and safe operation triggering mode is realized. The scheme simplifies the complex process of traditional manual information filling of terminal devices into two core operations of "swiping the mother lock → swiping the child lock". The operator does not need to learn complex terminal operation logic, nor does he need to remember or input lengthy device ID, key and other information. By holding the RFID card and touching the child-mother lock in turn, the binding process can be triggered. Taking the vehicle fleet transportation scene as an example, when a mother lock needs to be bound with multiple child locks, the operator can use the same RFID card to complete the operation of "mother lock card swiping → child lock 1 card swiping → child lock 2 card swiping ……" in succession. The binding time of each child lock is controlled within 3 seconds, which is much faster than the traditional scheme with an average operation time of more than 10 seconds for each device, greatly improving the efficiency and reducing the workload of the vehicle fleet manager. Compared with the traditional manual information filling method, this innovation greatly simplifies the operation process, improves the operation efficiency, and significantly reduces the error rate caused by human operation and the risk of illegal tampering of information. The user only needs to place the RFID card close to the device to quickly complete the operation, eliminating the tedious manual input and confirmation steps. This not only saves the user's valuable time and effort, but also greatly improves the reliability and stability of the entire system. In addition, the encryption characteristics of the RFID card also effectively protect the safety of user information and effectively prevent the risk of information leakage and illegal access.
[0035] The advantages of multi-technology integration are as follows: By combining RFID card swiping operation with Bluetooth communication technology, the advantages of both technologies are fully utilized. RFID card swiping operation is simple and fast, which can facilitate users to quickly trigger binding or unbinding operation; Bluetooth communication technology ensures the stability and security of information transmission between devices. Combined with the carefully designed communication protocol, the safety and reliability of the operation process are guaranteed from multiple aspects, forming a new and flexible, convenient and safe and reliable technical solution, which has obvious advantages in the following scenarios: First, prevent illegal information theft and tampering. The partition encryption protection of the RFID card ensures that the mother lock certificate information can only be read by the authorized child lock, avoiding the theft of sensitive data in the card during transmission; the protection of certificate signature by asymmetric encryption and the symmetric encryption of Bluetooth communication can effectively prevent the tampering of child-mother lock interaction information, and ensure the authenticity of the binding / unbinding instruction.
[0036] Second, precise control of device interaction range. The child lock broadcasts information using the parent lock public key encryption, so only the parent lock with the corresponding private key can decrypt and respond, excluding other irrelevant devices, solving the information confusion problem in the multi-device coexistence scene, and ensuring that the binding / unbinding operation is precisely executed between the specified child and parent locks.
[0037] Third, adapt to the security needs of dynamic fleet management. Child and parent locks need to be frequently bound / unbound in fleet transportation, and the dynamic nature (random number key) and high efficiency (symmetric encryption for communication) of the encryption method can meet the balance between security and efficiency of high-frequency operations. At the same time, the combination of encryption mechanism, timeout processing, and transaction rollback can handle exceptions caused by unstable signals in the transportation environment, ensuring information security in extreme situations.
[0038] Unique aspects of the encryption scheme: First, this scheme innovatively applies multi-layer collaborative application of asymmetric encryption, symmetric encryption, and RFID card encryption technology. In the RFID card information interaction stage, the bottom layer is protected by the partition access control and key verification of the RFID card itself; the certificate issuance and verification link uses asymmetric encryption algorithm, and the identity authenticity is ensured through the manufacturer's private key signature and public key decryption verification; in the Bluetooth communication stage, the random number generated by the child lock is used as the symmetric encryption key, forming a full-link encryption system of "device identity encryption-information transmission encryption". This multi-layer collaborative mechanism is relatively rare in traditional child and parent lock management schemes.
[0039] Second, unlike fixed key encryption methods, the symmetric encryption key in this scheme is randomly generated by the child lock at each binding / unbinding operation and is only valid within a single operation period. This random number as a Bluetooth communication key not only avoids the risk of leakage caused by long-term use of fixed keys, but also automatically invalidates the key through timing control of the operation process, solving the problem of easy cracking and reuse of traditional static keys.
[0040] Third, the encryption process is not independent of business logic, but is deeply bound with the identity verification of child and parent locks. For example, the child lock broadcast information needs to be encrypted by the parent lock public key to ensure that only the target parent lock can decrypt it; when the parent lock verifies the child lock certificate, it decrypts the signature and compares the hash value through the asymmetric encryption algorithm, implementing an integrated process of "encryption as verification", avoiding security vulnerabilities caused by decoupling encryption and identity verification.
[0041] Innovative security interaction and transaction processing flow: A unique pending list and transaction node management mechanism is introduced to ensure the orderly execution and state consistency maintenance of binding / unbinding operations, further enhancing the reliability of the solution. During the binding process, the transaction node records the status indicators of key steps such as child lock public key submission, mother lock certificate verification, and key negotiation. If any step fails (such as verification failure or communication interruption), the system will automatically trigger a rollback mechanism to restore the state of the mother and child locks to the pre-operation security baseline, ensuring the atomicity and durability of the transaction. This design, which deeply integrates data structures and state machines, enables the secure interaction process to have both dynamic scheduling capabilities and maintain strict reliability constraints. Attached Figure Description
[0042] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation
[0043] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0044] Please see Figure 1 This invention provides a method for binding and unbinding a master lock, comprising the following steps: S1: Use the bound / unbound RFID card to swipe the main lock; the main lock detects the RFID card and writes the main lock certificate information into the RFID card, the main lock certificate information containing the main lock ID; after the main lock certificate information is successfully written into the RFID card, the main lock starts Bluetooth scanning.
[0045] S2: Use an RFID card to swipe the sub-lock. The sub-lock reads the master lock certificate information written in the master lock from the RFID card and verifies it. After successful verification, the sub-lock initiates a Bluetooth broadcast and waits for the master lock to respond. The Bluetooth broadcast contains the sub-lock certificate information, which contains the sub-lock's ID.
[0046] S3: The master lock receives the Bluetooth broadcast sent by the slave lock and verifies the slave lock certificate information in the Bluetooth broadcast; if the slave lock certificate information is valid, proceed to step S4; if the slave lock certificate information is invalid, the master lock stops verifying the slave lock.
[0047] S4: The master lock adds the ID of the child lock to the list of locks to be bound / unbound. The master lock connects to the child lock via Bluetooth, initiates a binding / unbinding request, and waits for the child lock to respond.
[0048] S5: The child lock checks whether the ID of the parent lock is the same as before, and obtains the binding / unbinding request of the parent lock.
[0049] S6: The child lock adds the parent lock ID to the list of locks to be bound / unbound, returns a success response to the parent lock, and waits for the parent lock's response.
[0050] S7: The parent lock adds / deletes the child lock ID in the bound list, arranges the to-be-bound / to-be-unbound list, and sends a confirmation instruction to the child lock. In the present scheme, the parent lock arranges the to-be-bound / to-be-unbound list to clean up the child lock ID that has been added / deleted in the bound list.
[0051] S8: The child lock adds / deletes the parent lock ID in the bound list, and arranges the to-be-bound / to-be-unbound list. In the present scheme, the child lock arranges the to-be-bound / to-be-unbound list to clean up the parent lock ID that has been added / deleted in the bound list.
[0052] S9: Whether there is still a child lock to be bound / unbound after the current child lock is bound / unbound successfully; if not, the process ends; if yes, the process proceeds to step S2.
[0053] The RFID card of the present application has an advanced read-write protection mechanism, and its internal storage structure is usually divided into multiple regions, each region being provided with independent access control authority. Taking a common M1 card as an example, the EEPROM structure is divided into 16 zones, each zone being divided into 4 segments, each segment having 16 bytes, and the last segment (tail) of each zone containing two keys and access conditions for each segment of the zone, which can be set by programming. For a key information storage region, such as a region storing parent lock certificate information, strict access authority is set to allow only authorized read-write operations.
[0054] In application, a user first uses the RFID card to swipe the parent lock, and the read-write module built in the parent lock writes the parent lock certificate information into the corresponding protected region in the RFID card in compliance with the read-write protection rules described above. After the writing is completed, the RFID card is used to swipe the child lock, and the read module of the child lock reads the information of the parent lock in the RFID card after passing the read permission verification of the RFID card, and verifies the parent lock certificate through the built-in certificate verification module.
[0055] When the parent lock writes the parent lock certificate information into the RFID card, the RFID card first verifies the access authority of the parent lock, and the read-write module built in the parent lock needs to use the correct key to initiate a write request according to the preset access conditions of the RFID card. After the permission verification is passed, the operation of writing the parent lock certificate information can be successfully executed; similarly, when the child lock reads the parent lock certificate information in the RFID card, the RFID card verifies the read permission of the child lock, and the read-write module built in the child lock needs to use the correct key to initiate a read request according to the preset access conditions of the RFID card. Only the child lock with matching permission can read the corresponding information, so that the information stored in the RFID card is ensured not to be illegally read or tampered with.
[0056] The mother lock pre-stores a mother lock public key, a mother lock private key, and a manufacturer public key. The mother lock certificate information further includes the mother lock public key and a certificate signature generated based on a digital signature algorithm. Therefore, the mother lock certificate information contains the ID of the mother lock, the mother lock public key, and the certificate signature generated based on the digital signature algorithm. The child lock pre-stores the manufacturer public key. The child lock certificate information further includes a certificate signature generated based on a digital signature algorithm. Therefore, the child lock certificate information contains the ID of the child lock and the certificate signature generated based on the digital signature algorithm.
[0057] The mother lock certificate information and the child lock certificate information are issued by the manufacturer of the mother lock and the child lock. When the mother lock is manufactured, the manufacturer arranges the ID of the mother lock and the mother lock public key, and uses the manufacturer private key to encrypt and sign the ID of the mother lock and the mother lock public key, to generate the mother lock certificate information. When the child lock is manufactured, the manufacturer arranges the ID of the child lock, and uses the manufacturer private key to encrypt and sign the ID of the child lock, to generate the child lock certificate information.
[0058] In step S2, the reading module of the child lock reads the mother lock certificate information in the RFID card after passing the reading permission verification of the RFID card, and verifies the mother lock certificate information by using the built-in certificate verification module. When the child lock verifies the mother lock certificate information, the child lock first acquires the certificate signature of the manufacturer in the mother lock certificate information. The manufacturer public key is pre-stored in the built-in certificate verification module of the child lock. The certificate signature of the manufacturer is decrypted by using the manufacturer public key, to obtain the hash value of the mother lock certificate information. At the same time, the child lock uses the same hash algorithm to calculate the ID of the mother lock and the mother lock public key, to obtain another hash value. The two hash values are compared. If they are consistent, it is proved that the mother lock certificate information is not tampered and is issued by a legal manufacturer, and the identity of the mother lock is real and reliable. After confirming that the mother lock certificate information is correct, the child lock initiates a Bluetooth broadcast. The Bluetooth broadcast information is encrypted by using the mother lock public key of the mother lock. The content of the Bluetooth broadcast information includes a random number generated by the child lock and the child lock certificate information.
[0059] In step S3, after receiving the Bluetooth broadcast information from the child lock, the master lock uses its own master lock private key to decrypt the encrypted content and obtain the child lock's random number and certificate information. The master lock then verifies the decrypted child lock certificate information. The master lock's built-in certificate verification module has a pre-stored manufacturer's public key. When verifying the child lock certificate information, the master lock uses the manufacturer's public key to decrypt the manufacturer's signature in the child lock certificate information to obtain the hash value of the child lock certificate information. At the same time, the master lock also performs a hash calculation on the child lock's ID and compares the two hash values to confirm the authenticity and integrity of the child lock certificate information. After successful verification, the master lock actively initiates a Bluetooth connection request to the child lock based on the device identifier in the child lock's Bluetooth broadcast information. During Bluetooth communication, to ensure the security of data transmission, the random number generated by the child lock in the Bluetooth broadcast content is used as a symmetric encryption key to encrypt the transmitted data, achieving secure data interaction.
[0060] After verifying that the child lock's certificate information is correct, the master lock first adds the child lock ID to its own list of pending bindings / unbindings to record the target child lock for the current operation. Then, the master lock sends the corresponding request instruction to the child lock according to the current operation type: binding / unbinding. After receiving the request from the master lock, the child lock adds the master lock ID to its own list of pending bindings / unbindings, and returns a success response to the master lock after the operation is completed. The process of updating the binding / unbinding status and organizing the list is as follows: After receiving a successful response from the child lock, the master lock adds or deletes the child lock ID in its own bound list according to the operation type, thus updating its own device binding status. Next, the master lock organizes the pending binding / unbinding list, releasing the list resources to avoid redundant data affecting subsequent operations. Finally, the master lock sends a confirmation command to the child lock. Upon receiving the confirmation command, the child lock adds or deletes the master lock ID in its own bound list, updates its own binding status, and organizes the pending binding / unbinding list, completing the entire binding or unbinding operation process. To ensure the reliability and consistency of binding and unbinding transactions, a transaction processing mechanism is introduced into the protocol design. During the binding or unbinding operation, each step, such as writing information to the RFID card, certificate verification, Bluetooth connection establishment, and list update, is considered a transaction node. Only when all transaction nodes are successfully executed is the entire binding or unbinding operation considered successfully completed. If any abnormal situation occurs during the operation, such as certificate verification failure, communication interruption, or list update error, the child lock and the mother lock will be restored to their pre-operation state. If the child lock and the mother lock cannot confirm data consistency, a clear audible and visual signal will notify the user to re-perform the binding and unbinding operation to synchronize information, avoiding data inconsistency or abnormal device status. By sending information to each other to confirm that both can send and receive data normally, the binding / unbinding status is modified, ensuring that the user's participation in synchronizing the child and mother lock information is only required in extremely rare cases.
[0061] To facilitate users' intuitive understanding of the binding or unbinding process, both the sub-lock and the main lock are equipped with audible and visual feedback devices. When the binding or unbinding operation begins, the sub-lock and the main lock will emit a specific frequency of sound and flashing light signals to indicate that the operation has started. When the operation is successfully completed, the sub-lock and the main lock will emit a different sound and light signal to inform the user that the operation was successful. If an error occurs during the operation, the sub-lock and the main lock will emit a rapid sound and light signal to remind the user of the error so that the user can take appropriate measures to deal with it in a timely manner.
[0062] Please see Figure 2 In a specific embodiment, the specific process is as follows: Users swipe the mother lock using the RFID card to bind / unbind; When the master lock detects the RFID card, it writes the master lock certificate information to the RFID card; this master lock certificate information contains the master lock public key. If the write is successful, the master lock will beep once and start Bluetooth scanning and the red light will flash rapidly for 30 seconds. Users use RFID card swipe locks; The child lock reads and verifies the certificate information of the parent lock. If the verification is successful, the child lock beeps once, starts flashing blue light quickly, and initiates a Bluetooth broadcast (the broadcast content contains the child lock certificate information and is encrypted with the parent lock's public key). It waits for the parent lock's response. If the wait for the parent lock's response times out, the broadcast stops, and the child lock beeps for 3 seconds, requiring the user to retry. If the child lock verification fails, the child lock beeps for 3 seconds, requiring the user to retry. The master lock receives the Bluetooth broadcast, decrypts it using the master lock's private key, and verifies the child lock's certificate information. If the child lock's certificate information is valid, proceed to the next step. The master lock adds the child lock ID to the list of locks to be bound / unbound, connects to the child lock via Bluetooth, initiates an encrypted binding / unbinding request, and waits for the child lock's response. The child lock checks if the parent lock ID is the same as before and decrypts the binding / unbinding request; if the ID is the same, proceed to the next step; if the ID is different or decryption fails, the child lock beeps for 3 seconds, requiring the user to retry. The child lock adds the parent lock ID to the list of pending binding / unbinding, returns a success response to the parent lock, and waits for the parent lock's response. If the wait times out, since the binding information between the child and parent locks may be inconsistent at this time, a higher-level alarm is used, with a long beep every 3 seconds for 3 seconds, lasting for one minute, indicating that the user must retry to synchronize the information. The master lock adds / deletes child lock IDs from the bound list, organizes the list of locks to be bound / unbound, and sends confirmation commands to the child locks. The child lock adds / deletes the parent lock ID from the bound list, organizes the list of locks to be bound / unbound, and two beeps indicate that the operation is successful. If the current sub-lock binding / unbinding is successful, are there any other sub-locks that need to be bound / unbound? If so, use an RFID card to swipe other sub-locks that need to be bound / unbound. If not, the process ends.
[0063] In summary, the present invention provides a method for binding and unbinding a master lock, which has the following technical effects: Innovative applications of RFID cards: This invention breaks with traditional thinking by applying RFID cards to the binding and unbinding of master and slave locks. By utilizing the encrypted information carried by the RFID card and its advanced read / write protection features, a convenient and secure operation triggering method is achieved. This solution simplifies the complex process of manually filling in information on the terminal device into a two-step core operation: "swipe master lock → swipe slave lock". Operators do not need to learn complex terminal operation logic, nor do they need to memorize or input lengthy device IDs, keys, etc.; they can trigger the binding process simply by touching the master and slave locks sequentially with the RFID card. Taking a fleet transportation scenario as an example, when multiple slave locks need to be bound to a master lock, the operator can continuously use the same RFID card to complete the operation of "swipe master lock → swipe slave lock 1 → swipe slave lock 2…", with the binding time for each slave lock controlled within 3 seconds. Compared to the traditional solution with an average operation time of more than 10 seconds per device, efficiency is greatly improved, and the workload of fleet management personnel is significantly reduced. Compared to traditional manual information entry, this innovation significantly simplifies the operation process, improves efficiency, and substantially reduces the error rate caused by human error and the risk of unauthorized information tampering. Users simply need to bring the RFID card close to the device to quickly complete the operation, eliminating tedious manual input and confirmation steps. This not only saves users valuable time and effort but also greatly improves the reliability and stability of the entire system. Furthermore, the encryption features of the RFID card effectively protect user information security and prevent the risk of information leakage and unauthorized access.
[0064] The advantages of multi-technology integration are manifested in: By combining RFID card swiping with Bluetooth communication technology, the advantages of both technologies are fully utilized. RFID card swiping is simple and fast, allowing users to quickly trigger binding or unbinding operations; Bluetooth communication technology ensures the stability and security of information transmission between devices. Combined with a carefully designed communication protocol, the security and reliability of the operation process are guaranteed from multiple levels, forming a flexible, convenient, and secure new technical solution with significant advantages in the following scenarios: Firstly, it prevents the illegal theft and tampering of information. The partition encryption protection of the RFID card ensures that the master lock certificate information can only be read by authorized child locks, preventing sensitive data in the card from being stolen during transmission; the asymmetric encryption for certificate signature protection, and the symmetric encryption for Bluetooth communication, can effectively prevent the interaction information between the master and child locks from being tampered with, ensuring the authenticity of binding / unbinding commands.
[0065] Secondly, it precisely controls the scope of device interaction. The broadcast information of the sub-lock is encrypted with the public key of the master lock, so that only the master lock holding the corresponding private key can decrypt and respond, eliminating interference from other irrelevant devices, solving the problem of information confusion in the scenario of multiple devices coexisting, and ensuring that the binding / unbinding operation is precisely executed between the specified master and sub-locks.
[0066] Third, it adapts to the security requirements of dynamic fleet management. During fleet transportation, master and slave locks need to be frequently bound / unbound. The dynamic nature (random number key) and high efficiency (symmetric encryption for communication) of the encryption method can meet the balance between security and efficiency in high-frequency operations. Simultaneously, the combination of encryption mechanisms with timeout handling and transaction rollback can cope with anomalies caused by unstable signals in the transportation environment, ensuring information security under extreme conditions.
[0067] The unique features of the encryption scheme: Firstly, this solution innovatively integrates asymmetric encryption, symmetric encryption, and RFID card encryption technologies in a multi-layered collaborative application. During the RFID card information exchange phase, the underlying encryption protection is achieved using the RFID card's own partition access control and key verification. The certificate issuance and verification process employs an asymmetric encryption algorithm, ensuring identity authenticity through manufacturer private key signing and public key decryption verification. In the Bluetooth communication phase, a dynamically generated random number from the sub-lock serves as the symmetric encryption key, forming a full-link encryption system of "device identity encryption - information transmission encryption." This multi-layered collaborative mechanism is relatively rare in traditional master-slave lock management solutions.
[0068] Secondly, unlike fixed-key encryption methods, the symmetric encryption key in this scheme is randomly generated by the sub-lock during each binding / unbinding operation and is only valid within a single operation cycle. This random number serves as the Bluetooth communication key, avoiding the risk of leakage caused by long-term use of fixed keys, and achieving automatic key expiration through timing control of the operation process, thus solving the problem of traditional static keys being easily cracked and reused.
[0069] Third, the encryption process is not independent of the business logic, but is deeply integrated with the identity verification of the master and slave locks. For example, the broadcast information of the slave lock needs to be encrypted by the public key of the master lock to ensure that only the target master lock can decrypt it; when the master lock verifies the slave lock certificate, it decrypts the signature through an asymmetric encryption algorithm and compares the hash value to achieve an integrated process of "encryption is verification", avoiding security vulnerabilities caused by the disconnect between encryption and identity verification.
[0070] Innovative secure interaction and transaction processing workflow: A unique pending list and transaction node management mechanism is introduced to ensure the orderly execution and state consistency maintenance of binding / unbinding operations, further enhancing the reliability of the solution. During the binding process, the transaction node records the status indicators of key steps such as child lock public key submission, mother lock certificate verification, and key negotiation. If any step fails (such as verification failure or communication interruption), the system will automatically trigger a rollback mechanism to restore the state of the mother and child locks to the pre-operation security baseline, ensuring the atomicity and durability of the transaction. This design, which deeply integrates data structures and state machines, enables the secure interaction process to have both dynamic scheduling capabilities and maintain strict reliability constraints.
[0071] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for binding and unbinding of a parent-child lock, characterized in that, The method comprises the following steps: S1: using a binding / unbinding RFID card to brush the mother lock; the mother lock detects the RFID card, writes the mother lock certificate information into the RFID card, and the mother lock certificate information contains the ID of the mother lock; after the mother lock certificate information is successfully written into the RFID card, the mother lock starts a Bluetooth scan; S2: using the RFID card to brush the child lock, the child lock reads the mother lock certificate information written by the mother lock in the RFID card, and verifies it; after the verification is successful, the child lock initiates a Bluetooth broadcast, and waits for the mother lock to respond; the Bluetooth broadcast contains child lock certificate information, and the child lock certificate information contains the ID of the child lock; S3: the mother lock acquires the Bluetooth broadcast initiated by the child lock, and verifies the child lock certificate information of the Bluetooth broadcast; if it is a legal child lock certificate information, step S4 is entered, and if it is an illegal child lock certificate information, the mother lock stops verifying the child lock; S4: the mother lock adds the ID of the child lock to the binding / unbinding list, connects the child lock through Bluetooth, initiates a binding / unbinding request, and waits for the child lock to respond; S5: the child lock checks whether the ID of the mother lock is the same as before, and acquires the binding / unbinding request of the mother lock; S6: the child lock adds the ID of the mother lock to the binding / unbinding list, returns the information of a successful response to the mother lock, and waits for the mother lock to respond; S7: the mother lock adds / deletes the ID of the child lock in the bound list, arranges the binding / unbinding list, and sends a confirmation instruction to the child lock; S8: the child lock adds / deletes the ID of the mother lock in the bound list, and arranges the binding / unbinding list; S9: whether there is a child lock to be bound / unbound after the current child lock is bound / unbound successfully; If not, the method ends, and if yes, step S2 is entered.
2. The method for binding and unbinding of a parent lock according to claim 1, wherein, When the mother lock writes the mother lock certificate information into the RFID card, the RFID card first verifies the access permission of the mother lock, the read-write module built in the mother lock needs to use a correct key, initiates a write request according to the preset access condition of the RFID card, and after the permission verification is passed, the write mother lock certificate information operation can be successfully executed; Similarly, when the child lock reads the mother lock certificate information in the RFID card, the RFID card verifies the reading permission of the child lock, the read-write module built in the child lock needs to use a correct key, initiates a reading request according to the preset access condition of the RFID card, and only the child lock with matched permission can read the corresponding information, so that the information stored in the RFID card is ensured not to be illegally read or tampered.
3. The method of claim 1, wherein, The mother lock pre-stores a mother lock public key, a mother lock private key and a manufacturer public key, and the mother lock certificate information further comprises the mother lock public key and a certificate signature generated based on a digital signature algorithm; the child lock pre-stores the manufacturer public key, and the child lock certificate information further comprises a certificate signature generated based on a digital signature algorithm.
4. The method of claim 3, wherein, The mother lock certificate information and the child lock certificate information are issued by the manufacturer of the mother lock and the child lock; when the mother lock is produced, the manufacturer arranges the ID of the mother lock and the mother lock public key, encrypts and signs the ID of the mother lock and the mother lock public key by using a manufacturer private key, and generates the mother lock certificate information; when the child lock is produced, the manufacturer arranges the ID of the child lock, encrypts and signs the ID of the child lock by using the manufacturer private key, and generates the child lock certificate information.
5. The method for binding and unbinding of a parent lock according to claim 4, wherein, In step S2, the reading module of the child lock reads the mother lock certificate information in the RFID card after verifying the reading authority of the RFID card, and verifies the mother lock certificate information through the built-in certificate verification module; when the child lock verifies the mother lock certificate information, first, the certificate signature of the manufacturer in the mother lock certificate information is obtained, the certificate signature of the manufacturer is decrypted using the public key of the manufacturer to obtain the hash value of the mother lock certificate information; at the same time, the ID and the public key of the mother lock are calculated using the same hash algorithm to obtain another hash value; The two hash values are compared, if they are consistent, it proves that the mother lock certificate information has not been tampered with and is issued by a legal manufacturer, and the mother lock identity is real and reliable; after confirming that the mother lock certificate information is correct, the child lock initiates a Bluetooth broadcast; the Bluetooth broadcast information is encrypted using the mother lock public key of the mother lock, and the content includes the random number generated by the child lock and the child lock certificate information.
6. The method for binding and unbinding of a parent lock according to claim 5, wherein, In step S3, after the mother lock receives the Bluetooth broadcast information of the child lock, the encrypted content is decrypted using the mother lock private key of the mother lock to obtain the random number of the child lock and the child lock certificate information; the mother lock verifies the decrypted child lock certificate information; when the mother lock verifies the child lock certificate information, the signature of the manufacturer in the child lock certificate information is decrypted using the public key of the manufacturer to obtain the hash value of the child lock certificate information, and the ID of the child lock is hashed to confirm the authenticity and integrity of the child lock certificate information; After verification, the mother lock initiates a Bluetooth connection request to the child lock according to the device identifier in the Bluetooth broadcast information of the child lock, and in the Bluetooth communication process, the random number generated by the child lock in the Bluetooth broadcast content is used as a symmetric encryption key to encrypt the transmitted data, realizing safe interaction of data.
7. The method of claim 1, wherein, After the mother lock verifies that the child lock certificate information is correct, the child lock ID is first added to the mother lock's to-be-bound / to-be-unbound list to record the target child lock of the current operation; Then, the mother lock initiates a corresponding request instruction to the child lock according to the current operation type: binding / unbinding; after the child lock receives the request of the mother lock, the mother lock ID is added to the child lock's to-be-bound / to-be-unbound list, and the child lock returns a success response information to the mother lock after the operation is completed.
8. The method of claim 1, wherein, The process of binding / unbinding state updating and list arrangement is as follows: after receiving the feedback of the child lock, the mother lock adds or deletes the child lock ID in the mother lock's bound list according to the operation type, and updates the binding state of the mother lock; then, the mother lock arranges the to-be-bound / to-be-unbound list, releases the list resource, and avoids the influence of redundant data on subsequent operations; finally, the mother lock sends a confirmation instruction to the child lock, and the child lock adds or deletes the mother lock ID in the bound list of the child lock according to the confirmation instruction, updates the binding state of the child lock, and arranges the to-be-bound / to-be-unbound list, completing the whole binding or unbinding operation process.
9. The method of claim 1, wherein, To ensure the reliability and consistency of the binding and unbinding transaction, a transaction processing mechanism is introduced in the protocol design; in the process of binding or unbinding operation, each step is regarded as a transaction node, and only when all transaction nodes are successfully executed, the whole binding or unbinding operation is regarded as successfully completed; If any abnormal situation occurs in the operation process, the child lock and the mother lock will be restored to the state before the operation; if the child lock and the mother lock cannot confirm the data consistency, the user will be notified by obvious sound and light signals to re-perform the binding and unbinding operation to synchronize the information, avoiding the situation of data inconsistency or device state abnormality; through the mutual transmission of information between the child lock and the mother lock, it is confirmed that both sides can normally receive and send data, and then the operation of modifying the binding / unbinding state is performed, ensuring that only in a very small probability the user will be involved in synchronizing the information of the child lock and the mother lock.
10. The method of claim 1, wherein, An audible and light feedback device is arranged on the child lock and the mother lock; when the binding or unbinding operation starts, the child lock and the mother lock will emit a specific frequency sound and light flicker signal to prompt that the operation has started; when the operation is successfully completed, the child lock and the mother lock will emit another different sound and light signal to inform the user that the operation is successful; if an error occurs in the operation process, the child lock and the mother lock will emit a sharp sound and light signal to remind the user that the operation is wrong.
Citation Information
Patent Citations
Electronic lock and unlocking and setting method thereof
CN104537735A
Method and system for automatically binding front lock and rear lock based on key exchange and intelligent door lock
CN114513758A
Method and system for safely binding intelligent door lock and intelligent door lock
CN114826620A
Information processing method and system of digital vehicle key and vehicle
CN119418429A
Smart door lock binding method and apparatus, storage medium and electronic device
WO2023109240A1