A method for binding and unbinding a parent-child lock

By combining RFID cards and Bluetooth communication, and utilizing partition encryption and dynamic encryption keys, the complexity and security issues in the binding and unbinding process of master locks and slave locks are resolved, enabling efficient and secure device binding and unbinding operations.

CN121075015BActive Publication Date: 2026-01-09TOPFLYTECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511599738.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-01-09
Estimated Expiration
2045-11-04

AI Technical Summary

Technical Problem

Existing technologies have technical defects in the interaction layer (high input error rate, cumbersome operation steps), communication layer (insufficient security mechanism), and data consistency and reliability (no transaction rollback mechanism) during the binding and unbinding of master and child locks, resulting in complex operations and vulnerability to attacks.

Method used

Information exchange is achieved using RFID cards, combined with Bluetooth communication. The system uses RFID card partition encryption protection and asymmetric encryption algorithm to verify master lock certificate information. Dynamically generated random numbers are used as symmetric encryption keys, and a transaction processing mechanism is combined to ensure the security and consistency of operations.

Benefits of technology

The process has been simplified, the efficiency and security of binding and unbinding have been improved, the rate of human error and the risk of information leakage have been reduced, and the accurate interaction between devices and the stability of data transmission have been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121075015B_ABST
    Figure CN121075015B_ABST
Patent Text Reader

Abstract

The application discloses a method for binding and unbinding of a master and slave lock. The application realizes a convenient and safe operation trigger mode by using the encryption information carried by an RFID card and the advanced read-write protection characteristics thereof. The scheme simplifies the complex process of traditional manual information filling of terminal equipment into two core operations of "swiping the master lock -> swiping the slave lock". The operator does not need to learn the complex terminal operation logic, nor does the operator need to remember or input long device ID, key and other information, and the binding process can be triggered only by holding the RFID card and touching the master and slave lock in sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data interaction technology, and in particular to a method for binding and unbinding a master lock. Background Technology

[0002] In the logistics and transportation industry, there is a need for rapid combination of master and slave locks in scenarios such as "one vehicle with multiple containers" and "multiple locks for cross-border transportation".

[0003] In the warehousing and supply chain management industry, there is a need for multi-level access control for scenarios such as warehouse doors, shelves, and cold storage, as well as hierarchical management of "area-shelf-item".

[0004] Traditionally, a master lock with multiple child locks is used in the following way:

[0005] Information input is done manually through the graphical interface of the terminal device: users manually fill in information such as the physical ID of the sub-lock and the master lock, device type, and binding rules through text boxes, drop-down menus, and other components on the mobile APP or computer management terminal.

[0006] The triggering mechanism is purely software-based: by clicking the bind or unbind button on the terminal APP, a wireless command is sent to the lock, without any physical interaction.

[0007] Status feedback is provided via terminal screen prompts: the user is informed of the operation result through APP pop-ups and list color changes (e.g., green indicates successful binding, red indicates failure).

[0008] Device information is transmitted directly via Bluetooth or WiFi, synchronizing the information input from the terminal to the lock.

[0009] Binding process: The terminal first establishes a Bluetooth connection with the master lock and sends a JSON format data packet containing a list of child lock IDs; the master lock then scans the Bluetooth signals of the child locks one by one and completes the binding based on the IDs.

[0010] Unbinding process: The terminal sends a sub-lock ID deletion command to the master lock, and the master lock notifies the corresponding sub-lock to clear the association record via Bluetooth or WiFi.

[0011] Security Mechanism: Identity verification verifies the legitimacy of the terminal through a static key preset by the lock (such as the factory default key or the customer-set key). The key is stored in the terminal APP or the lock firmware.

[0012] The above method has the following shortcomings:

[0013] The interaction layer technology has shortcomings; the input error rate is high: it relies on manual recognition of characters on lock tags, which is prone to input errors due to blurry handwriting and viewing angle deviation.

[0014] The operation is cumbersome: it requires completing multiple steps in sequence, such as "selecting the master lock → searching the sub-lock list → selecting the target sub-lock → confirming binding / unbinding".

[0015] The communication layer technology has shortcomings; the security mechanism relies on static keys to verify terminal legitimacy, lacking dynamic verification methods and posing a risk of being reverse-engineered. The absence of a physical medium for identity verification makes it vulnerable to remote replay attacks or fake terminal deception.

[0016] Data consistency and reliability technical deficiencies; lack of transaction rollback mechanism: if the binding / unbinding operation is interrupted midway (e.g., Bluetooth disconnection, device crash), it may lead to inconsistencies between the master lock and the child lock. Reliance on terminal queries of lock status necessitates manual intervention to repair inconsistencies.

[0017] Therefore, existing technologies have shortcomings and need to be improved. Summary of the Invention

[0018] The technical problem to be solved by the present invention is to provide a method for binding and unbinding a master lock, so as to solve the problem mentioned in the background art.

[0019] The technical solution of the present invention is as follows: a method for binding and unbinding a master lock is provided, comprising the following steps:

[0020] S1: Use the bound / unbound RFID card to swipe the master lock; the master lock detects the RFID card and writes the master lock certificate information into the RFID card, the master lock certificate information containing the master lock ID; after the master lock certificate information is successfully written into the RFID card, the master lock starts Bluetooth scanning; there are two types of RFID cards, one is a bound RFID card and the other is an unbound RFID card. When using a bound RFID card, it is a binding operation between the sub-lock and the master lock. When using an unbound RFID card, it is a unbinding operation between the sub-lock and the master lock.

[0021] 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.

[0022] 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.

[0023] S4: The master lock adds the sub-lock's ID to the list of locks to be bound / unbound. The master lock connects to the sub-lock via Bluetooth, initiates a binding / unbinding request, and waits for the sub-lock's response. When performing a binding operation, the master lock adds the sub-lock's ID to the list of locks to be bound, connects to the sub-lock via Bluetooth, initiates a binding request, and waits for the sub-lock's response. When performing an unbinding operation, the master lock adds the sub-lock's ID to the list of locks to be unbound, connects to the sub-lock via Bluetooth, initiates an unbinding request, and waits for the sub-lock's response. In this invention, the " / " in binding / unbinding means "or," so binding / unbinding is either binding or unbinding. Similarly, the " / " in the list of locks to be bound / unbound also means "or," so the list of locks to be bound or unbound is either a list to be bound or a list to be unbound. When performing a binding operation, the operation is performed on the list to be bound; when performing an unbinding operation, the operation is performed on the list to be unbound.

[0024] S5: The child lock checks if the parent lock's ID is the same as before and obtains the parent lock's binding / unbinding request. When performing a binding operation, the child lock checks if the parent lock's ID is the same as before and obtains the parent lock's binding request; when performing an unbinding operation, the child lock checks if the parent lock's ID is the same as before and obtains the parent lock's unbinding request.

[0025] 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. When performing a binding operation, the child lock adds the parent lock ID to the list of locks to be bound, returns a success response to the parent lock, and waits for the parent lock's response; when performing an unbinding operation, the child lock adds the parent lock ID to the list of locks to be unbound, returns a success response to the parent lock, and waits for the parent lock's response. S7: The parent lock adds / removes the child lock ID from the bound list, organizes the list of locks to be bound / unbound, and sends a confirmation command to the child lock. When performing a binding operation, the parent lock adds the child lock ID to the bound list, organizes the list of locks to be bound, and sends a confirmation command to the child lock; when performing an unbinding operation, the parent lock removes the child lock ID from the bound list, organizes the list of locks to be unbound, and sends a confirmation command to the child lock.

[0026] S8: The child lock adds / removes the parent lock ID from the bound list and organizes the pending binding / unbinding lists. When a binding operation is performed, the child lock adds the parent lock ID to the bound list and organizes the pending binding list; when an unbinding operation is performed, the child lock removes the parent lock ID from the bound list and organizes the pending unbinding list.

[0027] S9: The current sublock binding / unbinding is successful. Are there any other sublocks that need to be bound / unbound? If not, end. If so, proceed to step S2.

[0028] The RFID card of this invention possesses an advanced read / write protection mechanism. Its internal storage structure is typically divided into multiple areas, each with independent access control permissions. Taking the common M1 card as an example, the EEPROM structure is divided into 16 areas, each area further divided into 4 segments, each segment containing 16 bytes. The last segment (tail) of each area contains two keys and access conditions for each segment within that area. These access conditions can be set through programming. For critical information storage areas, such as those storing master lock certificate information, strict access permissions are set to allow only authorized read / write operations.

[0029] In application, the user first swipes the RFID card on the main lock. The main lock's built-in read / write module follows the aforementioned read / write protection rules, writing the main lock certificate information into the corresponding protected area of ​​the RFID card. After writing is complete, the user then swipes the RFID card on the sub-lock. The sub-lock's reading module, after verifying the RFID card's read permissions, reads the main lock information from the RFID card and verifies the main lock certificate through its built-in certificate verification module.

[0030] Furthermore, when the master lock writes its certificate information to the RFID card, the RFID card first verifies the master lock's access permissions. The master lock's built-in read / write module must use the correct key and initiate a write request based on the RFID card's preset access conditions. Only after the permission verification is successful can the write operation of the master lock certificate information be executed successfully. Similarly, when the slave lock reads the master lock certificate information from the RFID card, the RFID card verifies the slave lock's read permissions. The slave lock's built-in read / write module must use the correct key and initiate a read request based on the RFID card's preset access conditions. Only slave locks with matching permissions can read the corresponding information, thereby ensuring that the information stored in the RFID card is not illegally read or tampered with.

[0031] Furthermore, the master lock pre-stores a master lock public key, a master lock private key, and a manufacturer's public key. The master lock certificate information also includes: the master lock public key and a certificate signature generated based on a digital signature algorithm; therefore, the master lock certificate information includes the master lock ID, the master lock public key, and a certificate signature generated based on a digital signature algorithm. The child lock pre-stores a manufacturer's public key, and the child lock certificate information also includes: a certificate signature generated based on a digital signature algorithm; therefore, the child lock certificate information includes the child lock ID and a certificate signature generated based on a digital signature algorithm.

[0032] Furthermore, the master lock certificate information and the child lock certificate information are issued by the manufacturers of the master lock and the child lock, respectively. When producing the master lock, the manufacturer will organize the master lock ID and the master lock public key, and use the manufacturer's private key to encrypt and sign the master lock ID and the master lock public key to generate the master lock certificate information. When producing the child lock, the manufacturer will organize the child lock ID, and use the manufacturer's private key to encrypt and sign the child lock ID to generate the child lock certificate information.

[0033] Further, in step S2, after the sub-lock's reading module verifies the RFID card's reading permission, it reads the master lock certificate information from the RFID card and verifies the master lock certificate information through its built-in certificate verification module. When verifying the master lock certificate information, the sub-lock first obtains the manufacturer's certificate signature from the master lock certificate information. The sub-lock's built-in certificate verification module pre-stores the manufacturer's public key and uses this public key to decrypt the manufacturer's certificate signature, obtaining the hash value of the master lock certificate information. At the same time, the sub-lock calculates the master lock's ID and the master lock's public key using the same hash algorithm to obtain another hash value. The two hash values ​​are compared. If they match, it proves that the master lock certificate information has not been tampered with and has been issued by a legitimate manufacturer, and the master lock's identity is authentic and reliable. After confirming that the master lock certificate information is correct, the sub-lock initiates a Bluetooth broadcast. The Bluetooth broadcast information is encrypted using the master lock's public key, and its content includes a random number generated by the sub-lock and the sub-lock certificate information.

[0034] Further, 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 verifies the decrypted child lock certificate information. The certificate verification module built into the master lock pre-stores the 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, thereby achieving secure data interaction.

[0035] Furthermore, 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, based on the current operation type: binding / unbinding, the master lock sends the corresponding request instruction to the child lock. 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.

[0036] Furthermore, the process of updating the binding / unbinding status and organizing the list is as follows: After receiving the 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, completing the update of its own device binding status; then, 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. After 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.

[0037] Furthermore, 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, they will notify the user to re-bind and unbind the information with a clear audible and visual signal to synchronize the information and avoid data inconsistency or abnormal device status. By sending information to each other and confirming 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.

[0038] Furthermore, to facilitate users' intuitive understanding of the binding or unbinding process, both the sub-lock and the main lock are equipped with audio-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 light flashing 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.

[0039] By adopting the above scheme, the present invention provides a method for binding and unbinding a master lock, which has the following technical effects:

[0040] Innovative applications of RFID cards:

[0041] 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 the master lock → swipe the 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 the master lock → swipe the slave lock 1 → swipe the slave lock 2..." in sequence. The binding time for each slave lock is controlled within 3 seconds, which is significantly more efficient than the traditional solution with an average operation time of more than 10 seconds per device, greatly reducing the workload of fleet management personnel. 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.

[0042] The advantages of multi-technology integration are manifested in:

[0043] 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:

[0044] 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.

[0045] 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.

[0046] 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.

[0047] The unique features of the encryption scheme:

[0048] 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.

[0049] 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.

[0050] 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.

[0051] Innovative secure interaction and transaction processing workflow:

[0052] 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

[0053] Figure 1 This is a flowchart of the method of the present invention;

[0054] Figure 2 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation

[0055] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0056] Please see Figure 1 This invention provides a method for binding and unbinding a master lock, comprising the following steps:

[0057] 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.

[0058] 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.

[0059] 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] S7: The master lock adds / deletes child lock IDs in the bound list, organizes the pending / unbound list, and sends a confirmation command to the child locks. In this solution, organizing the pending / unbound list by the master lock means clearing out the child lock IDs that have already been added / deleted from the bound list.

[0064] S8: Sub-locks add / remove parent lock IDs from the bound list and organize the pending / unbound lists. In this solution, organizing the pending / unbound lists for sub-locks involves clearing out any parent lock IDs that have already been added / removed from the bound list.

[0065] S9: The current sublock binding / unbinding is successful. Are there any other sublocks that need to be bound / unbound? If not, end. If so, proceed to step S2.

[0066] The RFID card of this invention possesses an advanced read / write protection mechanism. Its internal storage structure is typically divided into multiple areas, each with independent access control permissions. Taking the common M1 card as an example, the EEPROM structure is divided into 16 areas, each area further divided into 4 segments, each segment containing 16 bytes. The last segment (tail) of each area contains two keys and access conditions for each segment within that area. These access conditions can be set through programming. For critical information storage areas, such as those storing master lock certificate information, strict access permissions are set to allow only authorized read / write operations.

[0067] In application, the user first uses an RFID card to swipe the main lock. The main lock's built-in read / write module follows the aforementioned read / write protection rules, writing the main lock certificate information into the corresponding protected area within the RFID card. After writing is complete, the user then uses the same RFID card to swipe the sub-lock. The sub-lock's reading module, after verifying the RFID card's read permissions, reads the main lock information from the RFID card and verifies the main lock certificate through its built-in certificate verification module.

[0068] When the master lock writes its certificate information to the RFID card, the RFID card first verifies the master lock's access permissions. The master lock's built-in read / write module needs to use the correct key and initiate a write request based on the RFID card's preset access conditions. Only after the permission verification is successful can the write operation of the master lock certificate information be executed successfully. Similarly, when the slave lock reads the master lock certificate information from the RFID card, the RFID card verifies the slave lock's read permissions. The slave lock's built-in read / write module needs to use the correct key and initiate a read request based on the RFID card's preset access conditions. Only slave locks with matching permissions can read the corresponding information, thereby ensuring that the information stored in the RFID card is not illegally read or tampered with.

[0069] The master lock pre-stores a master lock public key, a master lock private key, and a manufacturer's public key. The master lock certificate information also includes: the master lock public key and a certificate signature generated based on a digital signature algorithm; therefore, the master lock certificate information contains the master lock ID, the master lock public key, and a certificate signature generated based on a digital signature algorithm. The child lock pre-stores a manufacturer's public key. The child lock certificate information also includes: a certificate signature generated based on a digital signature algorithm; therefore, the child lock certificate information contains the child lock ID and a certificate signature generated based on a digital signature algorithm.

[0070] The master lock certificate information and the child lock certificate information are issued by the manufacturers of the master lock and the child lock, respectively. When the manufacturer produces the master lock, it will organize the master lock ID and the master lock public key, and use the manufacturer's private key to encrypt and sign the master lock ID and the master lock public key to generate the master lock certificate information. When the manufacturer produces the child lock, it will organize the child lock ID, and use the manufacturer's private key to encrypt and sign the child lock ID to generate the child lock certificate information.

[0071] In step S2, after the sub-lock's reading module verifies the RFID card's reading permission, it reads the master lock certificate information from the RFID card and verifies the master lock certificate information through its built-in certificate verification module. When verifying the master lock certificate information, the sub-lock first obtains the manufacturer's certificate signature from the master lock certificate information. The sub-lock's built-in certificate verification module has a pre-stored manufacturer's public key. It uses this manufacturer's public key to decrypt the manufacturer's certificate signature, obtaining the hash value of the master lock certificate information. At the same time, the sub-lock calculates the master lock's ID and master lock's public key using the same hash algorithm, obtaining another hash value. The two hash values ​​are compared. If they match, it proves that the master lock certificate information has not been tampered with and was issued by a legitimate manufacturer, and the master lock's identity is authentic and reliable. After confirming that the master lock certificate information is correct, the sub-lock initiates a Bluetooth broadcast. The Bluetooth broadcast information is encrypted using the master lock's public key, and its content includes a random number generated by the sub-lock and the sub-lock certificate information.

[0072] 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.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] Please see Figure 2 In one specific embodiment, the specific process is as follows:

[0078] Users swipe the mother lock using the RFID card to bind / unbind;

[0079] 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.

[0080] 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.

[0081] Users use RFID card swipe locks;

[0082] 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] 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.

[0090] In summary, the present invention provides a method for binding and unbinding a master lock, which has the following technical effects:

[0091] Innovative applications of RFID cards:

[0092] 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.

[0093] The advantages of multi-technology integration are manifested in:

[0094] 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:

[0095] 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.

[0096] 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.

[0097] 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.

[0098] The unique features of the encryption scheme:

[0099] 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.

[0100] 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.

[0101] 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.

[0102] Innovative secure interaction and transaction processing workflow:

[0103] 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.

[0104] 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 a mother lock; the mother lock detects the RFID card, writes mother lock certificate information into the RFID card, 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 a child lock, the child lock reads the mother lock certificate information written by the mother lock in the RFID card and verifies; after the verification is successful, the child lock initiates a Bluetooth broadcast and waits for the response of the mother lock; 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, 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 a to-be-bound / to-be-unbound list, connects the child lock through Bluetooth, initiates a binding / unbinding request and waits for the response of the child lock; 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 to-be-bound / to-be-unbound list and returns the information of a successful response to the mother lock and waits for the response of the mother lock; S7: the mother lock adds / deletes the ID of the child lock in a bound list, arranges the to-be-bound / to-be-unbound 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 to-be-bound / to-be-unbound 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, 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 and 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 and 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 the 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 to generate 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 to generate 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; during the binding or unbinding operation process, 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 during 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 sending 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, prompting 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 during 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 has errors.

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