Interactive processing method and device for internet of things lockset

By pre-storing a key packet locally on the mobile terminal and using public key encryption and private key verification, the unlocking problem of IoT locks in environments where wireless signals are easily interrupted is solved, achieving high security and high reliability unlocking in complex environments, which is suitable for applications in the field of power grid metering asset management.

CN121811527APending Publication Date: 2026-04-07BEIJING ZHONGCHEN MICROELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512055955.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing IoT locks have deficiencies in security and communication stability, making it difficult to meet the high security and high reliability requirements of the power grid metering asset management field. They are particularly ineffective in unlocking under conditions where wireless signals are easily interrupted or the environment is complex.

Method used

By pre-storing key packets locally on the mobile terminal, it interacts with IoT locks through a physical connection, using public key encryption and private key verification to unlock, and combining ambient temperature detection and timestamp verification to ensure the security and reliability of unlocking.

Benefits of technology

Unlocking can be completed even in environments without network or with strong interference, simplifying the operation process, reducing the training costs for maintenance personnel, and making it suitable for deployment needs in grassroots power maintenance scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121811527A_ABST
    Figure CN121811527A_ABST
Patent Text Reader

Abstract

The invention provides an interactive processing method and device for an Internet of Things lockset, and relates to the technical field of Internet of Things locksets. The method is applied to the mobile terminal and comprises the steps that a key packet of a locally pre-stored target area is obtained, and the key packet comprises unlocking key ciphertexts of a plurality of Internet of Things locks in the target area; after physical connection with a target Internet of Things lock in the target area, receiving a starting instruction sent by the target Internet of Things lock; and sending the unlocking key ciphertext of the target Internet of Things lockset to the target Internet of Things lockset, so that the target Internet of Things lockset verifies the unlocking key ciphertext by adopting a private key of the target Internet of Things lockset, and if the ciphertext verification is passed, driving a motor to execute an unlocking action. According to the invention, dependence on wireless signals can be eliminated, unlocking can be completed as long as physical connection is successful even in a network-free and strong-interference environment, and the deployment requirements of scattered places and complex environments of the power grid metering box are perfectly met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of IoT lock technology, and more specifically, to an interaction processing method and device for IoT locks. Background Technology

[0002] With the deep integration of IoT technology and the security field, IoT locks have gradually replaced traditional mechanical locks due to their convenience and intelligence. They are widely used in key scenarios such as power grid metering boxes, smart homes, and logistics warehousing. In particular, in the field of power grid metering asset management, they have become one of the core devices for achieving "remote, refined, and traceable" management.

[0003] Currently, mainstream IoT locks generally integrate IoT technology, wireless transmission technology (such as Bluetooth, WiFi, NFC, etc.) and cloud computing capabilities. They achieve near-field / remote communication between the lock and mobile terminals (phones, handheld devices) through wireless modules such as Bluetooth, WiFi, or NFC to unlock the lock. This solves to some extent the pain points of traditional mechanical locks, such as "easy key duplication, high management costs, and lack of operational auditing", and meets the basic needs of the power grid industry for the management of decentralized assets.

[0004] However, in practical applications, existing IoT locks still have multiple shortcomings, making it difficult to meet the demands for high security, high reliability, and large-scale deployment. Specific problems include: Firstly, some IoT locks rely on static passwords, which are easily spied on and leaked, and lack dynamic updates; fingerprint recognition is greatly affected by the environment, has weak anti-counterfeiting capabilities, and is difficult to resist attacks such as forged fingerprints and AI-synthesized fingerprints; secondly, wireless transmission issues are prominent, with Bluetooth and WiFi signals easily interrupted in environments with metal shielding and strong electromagnetic interference, resulting in poor connection stability; WiFi cannot be used in remote areas without network access, while Bluetooth requires additional components and encryption mechanisms, increasing design complexity and cost.

[0005] In summary, the shortcomings of existing IoT locks in terms of security and communication stability can no longer meet the core requirements of "high security and high reliability" in the field of power grid metering asset management. Summary of the Invention

[0006] This application addresses the shortcomings of the prior art by providing an interaction processing method and device for IoT locks, thereby resolving the problems existing in the prior art.

[0007] The technical solution adopted in the embodiments of this application is as follows: In a first aspect, embodiments of this application provide an interaction processing method for IoT locks, applied to a mobile terminal, the method comprising: Obtain a locally pre-stored key packet for the target area. The key packet includes: ciphertext of unlocking keys for multiple IoT locks within the target area; the ciphertext of unlocking key for each IoT lock is: ciphertext of unlocking key obtained by encrypting the authorization credential of each IoT lock in advance based on the public key of each IoT lock. After physically connecting with the target IoT lock within the target area, receive the start command sent by the target IoT lock; The ciphertext of the unlocking key of the target IoT lock is sent to the target IoT lock so that the target IoT lock uses its private key to verify the ciphertext of the unlocking key. If the ciphertext verification is successful, the drive motor is used to perform the unlocking action.

[0008] In one embodiment, the method further includes: Receive the unlocking result information sent by the target IoT lock; The unlocking result information is stored in a local log. When the mobile terminal establishes a communication connection with the cloud server, it synchronizes the unlocking result information stored in the local log to the cloud server.

[0009] In one embodiment, before sending the encrypted unlocking key of the target IoT lock to the target IoT lock, the method further includes: Receive the current ambient temperature sent by the target IoT lock; If the current ambient temperature is lower than a preset temperature threshold, a preheating command is sent to the target IoT lock so that the target IoT lock drives the motor to perform a trial unlocking action; Receive the preheated temperature sent by the target IoT lock; If the temperature reaches the preset temperature threshold after preheating, the preheating of the target IoT lock is determined to be complete.

[0010] In one embodiment, after sending the encrypted unlocking key of the target IoT lock to the target IoT lock, the method further includes: A secure timestamp is sent to the target IoT lock so that the target IoT lock can verify its local clock based on the secure timestamp. After the clock verification is successful, the lock's private key is used to verify the unlocking key ciphertext.

[0011] Secondly, embodiments of this application provide an interaction processing method for IoT locks, applied to a cloud server, the method comprising: Obtain authorization credentials for multiple IoT locks within the target area; Based on the public key of each IoT lock, the authorization certificate of each IoT lock is encrypted to obtain the unlocking key ciphertext of each IoT lock; Based on the ciphertext of the unlocking key of each IoT lock, a key packet for the target area is generated; The key packet of the target area is sent to the mobile terminal, so that the mobile terminal stores the key packet of the target area locally and executes the interaction processing method for IoT locks as described in any of the above embodiments based on the key packet.

[0012] In one embodiment, obtaining authorization credentials for multiple IoT locks within the target area includes: An unlocking token for each IoT lock is generated based on its serial number, the user identifier corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocks, and a random number. Based on the private key of the cloud server, the unlocking token of each IoT lock is digitally signed to obtain the digital signature of each IoT lock; An authorization credential for each IoT lock is generated based on the digital signature and unlocking token of each IoT lock.

[0013] Thirdly, embodiments of this application provide an interaction processing method for IoT locks, applied to a target IoT lock, the method comprising: After the target IoT lock is physically connected to the mobile terminal, a start command is sent to the mobile terminal; Obtain the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal; the ciphertext of the unlocking key is: the ciphertext of the unlocking key obtained by encrypting the authorization certificate of the target IoT lock in advance according to the public key of the target IoT lock; The unlocking key ciphertext is verified based on the private key of the target IoT lock; If the encrypted message is successfully verified, the drive motor will perform the unlocking action.

[0014] In one embodiment, before obtaining the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal, the method further includes: Send the current ambient temperature to the mobile terminal; According to the preheating command sent by the mobile terminal, the motor is driven to perform a trial unlocking action; The step of obtaining the unlocking key ciphertext of the target IoT lock sent by the mobile terminal includes: Send the preheated temperature to the mobile terminal; Obtain the encrypted unlocking key of the target IoT lock sent by the mobile terminal.

[0015] In one embodiment, before verifying the unlocking key ciphertext based on the private key of the target IoT lock, the method further includes: Obtain the secure timestamp sent by the mobile terminal; The local clock is verified based on the secure timestamp; The step of verifying the unlocking key ciphertext based on the private key of the target IoT lock includes: After the clock verification is successful, the unlocking key ciphertext is verified based on the private key of the target IoT lock.

[0016] Fourthly, embodiments of this application provide an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the interactive processing method for IoT locks described in any of the above embodiments.

[0017] The beneficial effects of this application are as follows: This embodiment provides an interactive processing method for IoT locks, applied to a mobile terminal. The method includes: obtaining a locally pre-stored key packet for a target area, the key packet including: ciphertext of unlocking keys for multiple IoT locks within the target area; the ciphertext of the unlocking key for each IoT lock is: ciphertext of the unlocking key obtained by encrypting the authorization certificate of each IoT lock in advance according to the public key of each IoT lock; after physically connecting with a target IoT lock within the target area, receiving a start command sent by the target IoT lock; sending the ciphertext of the unlocking key of the target IoT lock to the target IoT lock, so that the target IoT lock uses its private key to verify the ciphertext of the unlocking key; if the ciphertext verification is successful, driving the motor to perform the unlocking action.

[0018] Among them, the solution that pre-stores keys locally on the mobile terminal and physically connects with the IoT lock completely eliminates the dependence on wireless signals. Even in environments with no network or strong interference, as long as the physical connection is successful, the lock can be unlocked, perfectly adapting to the deployment requirements of power grid metering boxes that are "dispersed in location and complex in environment".

[0019] Furthermore, staff only need to insert the magnetic cable, and the APP can automatically match the key, receive the start command sent by the lock, send the key and complete the verification. The operation is simplified to "one-click opening", which greatly reduces the training cost of maintenance personnel and is especially suitable for grassroots power maintenance scenarios. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is one of the flowcharts illustrating the interaction processing method for IoT locks provided in an embodiment of this application; Figure 2 A second schematic flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment; Figure 3 The third flowchart illustrates the interaction processing method for IoT locks provided in this application embodiment; Figure 4 The fourth flowchart illustrates the interaction processing method for IoT locks provided in this application embodiment. Figure 5 Fifth flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment; Figure 6 A flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment is shown in Figure 6. Figure 7 The seventh flowchart illustrates the interaction processing method for IoT locks provided in this application embodiment; Figure 8 This is the eighth flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment; Figure 9 A timing diagram illustrating the interaction processing method for IoT locks provided in an embodiment of this application; Figure 10 One of the structural schematic diagrams of the interactive processing device for IoT locks provided in the embodiments of this application; Figure 11 A second schematic diagram of the structure of the interactive processing device for IoT locks provided in the embodiments of this application; Figure 12 A third schematic diagram of the structure of the interactive processing device for IoT locks provided in the embodiments of this application; Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.

[0023] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0024] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0026] The following examples, in conjunction with the accompanying drawings, provide specific illustrations of the interaction processing method for IoT locks provided in this application.

[0027] Figure 1 This is one of the flowcharts illustrating the interaction processing method for IoT locks provided in the embodiments of this application, such as... Figure 1 As shown, this method is applied to a mobile terminal, and the method includes: S101. Obtain the key packet of the target area stored locally.

[0028] After the mobile terminal (mobile app) is launched, staff members complete login authentication via account password or facial recognition. The app automatically invokes the location function to match the target area corresponding to the staff member's jurisdictional authority in the cloud server (main site). Based on the permissions, the cloud server assembles the encrypted unlocking keys of all IoT locks in the target area into a key packet and sends the key packet to the mobile terminal.

[0029] The encryption text for the unlocking key of each IoT lock in the key package follows these generation rules: The cloud server first constructs an unlocking token containing the lock serial number, user ID, effective timestamp, expiration timestamp, maximum unlocking count, and a random number. Using the ECDSA algorithm, the cloud server signs the unlocking token with its private key, and then encrypts it with the public key of the corresponding IoT lock, ultimately forming the encryption text for the unlocking key with time and usage limits. The mobile terminal stores the received key package in a local secure storage area (such as iOS Keychain or Android Keystore) and records the effective time, expiration time, and remaining usage count for each key.

[0030] When the number of unlock attempts is ≤2, or the expiration time is ≤2 hours, a pop-up window will appear on the mobile app prompting "[Lock Name] key is about to expire / run out, do you want to update now?", and provide an update control. After the user clicks the update control, the app will automatically connect to the internet to obtain the new unlock key ciphertext (without needing to reselect the lock). If the user does not update immediately, the app will mark "Key is about to expire" next to the lock icon on the "My Locks" page to enhance the visual reminder.

[0031] S102. After physically connecting with the target IoT lock within the target area, receive the start command sent by the target IoT lock.

[0032] Staff establish a physical connection between the mobile terminal and the target IoT lock using a magnetic Type-C cable, allowing the mobile terminal to power the lock via a USB interface. Once powered on, the lock automatically starts and sends a start command to the mobile terminal via the USB serial port. This command includes basic information such as the lock's serial number and device identifier.

[0033] The mobile terminal detects a lock connection by listening to the USB_DEVICE_ATTACHED broadcast (Android system) or USBDevice connection notification (iOS system) and automatically responds with a start command. For the first connection, the app guides the user to enable accessibility services and complete a one-time permission configuration. Subsequent connections use the enabled accessibility services to automatically complete authorization, initialize USB serial communication parameters (baud rate, data bits, etc.) within one second, and display a floating notification at the top of the app: "Lock connected: [Lock serial number]" to prevent users from misjudging the connection status.

[0034] S103. Send the ciphertext of the unlocking key of the target IoT lock to the target IoT lock so that the target IoT lock uses its private key to verify the ciphertext of the unlocking key. If the ciphertext verification is successful, drive the motor to perform the unlocking action.

[0035] The mobile terminal matches the unlocking key ciphertext corresponding to the target IoT lock from the local key packet based on the lock serial number. After receiving the unlocking key ciphertext, the target IoT lock uses its private key to verify the unlocking key ciphertext. If the ciphertext verification is successful, the drive motor performs the unlocking action.

[0036] In another embodiment, the mobile terminal generates a current timestamp, signs it with its own APP private key to form a secure timestamp, and sends it along with the unlocking key ciphertext to the target IoT lock via a USB serial port. Upon receiving the secure timestamp, the target IoT lock first verifies its authenticity using a pre-set APP public key and then uses this timestamp to calibrate its local clock. If the local clock differs from the secure timestamp by more than 30 seconds, the lock refuses to perform the unlocking operation and records a "clock mismatch" log. If the clock verification passes, the lock decrypts the unlocking key ciphertext using its own private key to obtain a plaintext token and signature. Subsequently, it verifies the signature validity using the cloud server's public key, checks whether the current time is between the effective and expired timestamps, whether the unlocking count has exceeded the limit, and whether the lock serial number matches. After all verifications pass, the lock's drive motor performs the unlocking action.

[0037] In summary, this embodiment provides an interactive processing method for IoT locks. By pre-storing keys locally on the mobile terminal and establishing a physical connection with the IoT lock, it completely eliminates the dependence on wireless signals. Even in environments with no network or strong interference, as long as the physical connection is successful, unlocking can be completed, perfectly adapting to the deployment requirements of power grid metering boxes that are "dispersed in location and complex in environment".

[0038] Furthermore, staff only need to insert the magnetic cable, and the APP can automatically match the key, receive the start command sent by the lock, send the key and complete the verification. The operation is simplified to "one-click opening", which greatly reduces the training cost of maintenance personnel and is especially suitable for grassroots power maintenance scenarios.

[0039] Figure 2 This is a second flowchart illustrating the interaction processing method for IoT locks provided in the embodiments of this application, as shown below. Figure 2 As shown, the method of this application further includes: S201. Receive the unlocking result information sent by the target IoT lock.

[0040] After the target IoT lock's drive motor performs the unlocking action, it sends unlocking result information to the mobile terminal via USB serial port. The unlocking result information includes the lock serial number, operation time, unlocking status (success / failure), failure reason code (such as key expiration, clock mismatch, motor failure, etc.), and physical anti-tampering status (whether there was any damage to the casing or strong magnetic interference attempt).

[0041] The mobile terminal receives this information in real time via USB serial port to ensure the integrity of data transmission. If data packet loss occurs, an automatic retransmission mechanism is triggered until successful reception or the maximum number of retries is reached.

[0042] S202. Store the unlocking result information in the local log.

[0043] After receiving the unlocking result information, the mobile terminal generates a local log record according to a preset log format. In addition to the unlocking result information, the log also records the mobile terminal model, APP version, and GPS coordinates (to verify the geographical range of the staff).

[0044] Local logs are stored using a log hash chain (WORM mechanism). Each new log entry contains the SHA-256 encrypted hash value of the previous log entry. This ensures that any modification to historical log records will cause the hash verification of subsequent records to fail, thus exposing tampering and preventing log corruption. Simultaneously, the app displays a pop-up window locally indicating the unlocking result to the user. Success is accompanied by vibration and a notification sound (which can be turned off in settings), while failure displays the specific reason.

[0045] S203. When the mobile terminal establishes a communication connection with the cloud server, the unlocking result information stored in the local log is synchronized to the cloud server.

[0046] The mobile terminal monitors the network connection status in real time. When a 4G / 5G or Wi-Fi network connection is detected and an HTTPS / API communication connection is established with the cloud server, it automatically scans the locally cached unsynchronized logs.

[0047] A batch upload mechanism is used to synchronize logs to the cloud server. If a network interruption occurs during synchronization, the logs that have not been fully synchronized are added to a retry queue, and an exponential backoff retry strategy is adopted. After synchronization is complete, the cloud server returns a confirmation message, the mobile terminal marks the log as "synchronized", and a pop-up window prompts the user that "[X] unlock records have been synchronized". If synchronization still fails after reaching the maximum number of retries, the failed record is marked and an alarm is triggered, prompting the user to handle it manually.

[0048] Figure 3 This is the third flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment, as shown below. Figure 3 As shown, before executing step S103, which involves sending the encrypted unlocking key of the target IoT lock to the target IoT lock, the method of this application further includes: S301, Receive the current ambient temperature sent by the target IoT lock.

[0049] After establishing a physical connection and completing communication initialization with the target IoT lock, the mobile terminal sends an ambient temperature query command to the lock. The lock's built-in temperature sensor collects the current ambient temperature and sends the temperature data back to the mobile terminal via a USB serial port.

[0050] After receiving temperature data, the mobile terminal verifies the data. If the data exceeds a reasonable range (such as below -40℃ or above 85℃), it is determined to be a sensor malfunction, the malfunction log is recorded, and the user is prompted to check the lock status.

[0051] S302. If the current ambient temperature is lower than the preset temperature threshold, send a preheating command to the target IoT lock so that the target IoT lock drive motor can perform a trial unlocking action.

[0052] The mobile terminal presets a temperature threshold (default -10℃, which can be flexibly configured according to the scenario). It compares the current ambient temperature of the lock with the preset temperature threshold. If the current ambient temperature is lower than the preset temperature threshold, the APP generates a preheating command and sends it to the target IoT lock via USB serial port.

[0053] After receiving the preheating command, the lock's motor control unit drives the motor to perform a low-power attempted unlocking action (not actual unlocking, but only utilizing the motor's heat generation). The frequency and duration of this action are controlled by preset parameters in the app to avoid excessive power consumption. Simultaneously, the lock collects temperature data in real time and dynamically adjusts the intensity of the attempted unlocking action.

[0054] S303, Receive the preheated temperature sent by the target IoT lock.

[0055] During the preheating process, the target IoT lock collects temperature data every preset time interval (default 5 seconds) and feeds it back to the mobile terminal in real time via USB serial port. The mobile terminal displays a preheating progress bar on the interface, indicating the current temperature and target temperature, allowing users to intuitively understand the preheating status.

[0056] If a motor malfunction or communication interruption occurs during the preheating process, the lock will send an abnormal message, the mobile terminal will pause the preheating process, display a fault message and provide a solution (such as checking the lock connection or restarting the preheating).

[0057] S304. If the temperature reaches the preset temperature threshold after preheating, the target IoT lock is confirmed to have completed preheating.

[0058] The mobile terminal continuously compares the received preheated temperature with the preset temperature threshold. When the temperature reaches or exceeds the threshold, it determines that preheating is complete, sends a preheating stop command to the lock, and the lock stops the motor's tentative operation and enters the unlocking state.

[0059] If the preheating time reaches the maximum limit (default 3 minutes) and the temperature still does not reach the threshold, the mobile terminal determines that preheating has failed, records a fault log, and prompts the user "Preheating failed in low temperature environment, unable to unlock," while suggesting checking the lock status or changing the operating environment. After preheating is complete, the mobile terminal executes step S103 to send the unlocking key ciphertext to the lock.

[0060] The following explains the methods used on the cloud server. Figure 4 This is the fourth flowchart illustrating the interaction processing method for IoT locks provided in the embodiments of this application. Figure 4 As shown, this method is applied to a cloud server, and the method includes: S401. Obtain authorization credentials for multiple IoT locks within the target area.

[0061] The cloud server (main site) pre-stores the permission mapping relationship of "user-area-lock". After the staff completes the login authentication (such as account password / facial recognition) on the mobile terminal, the cloud server receives the "target area request" sent by the mobile terminal. This request includes the user identifier (ID) and location information (to help confirm the jurisdiction area).

[0062] The cloud server queries the target area authorized by the user's identifier, retrieves the basic information of all IoT locks within that target area (including lock serial numbers and lock public keys), and generates an authorization credential for each lock. The authorization credential contains the serial number of each IoT lock, the user identifier corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocks, and a random number. The authorization credential generation logic follows the "one person, one lock, one credential" principle to ensure a strong binding between the authorization credential, the lock, and the staff.

[0063] S402. Based on the public key of each IoT lock, encrypt the authorization certificate of each IoT lock to obtain the unlocking key ciphertext of each IoT lock.

[0064] The cloud server encrypts the authorization credentials of each IoT lock using an asymmetric encryption algorithm (such as RSA-OAEP or ECC) based on the pre-set public key of each IoT lock (the public key of the lock is written into the firmware during the production of the lock and is synchronously registered to the cloud server).

[0065] During the encryption process, the cloud server needs to verify the integrity and security of the IoT lock's public key: if the IoT lock's public key shows signs of tampering (such as hash verification mismatch), the authorization credential will be refused to be encrypted, and the lock will be marked as an "abnormal device," triggering an alarm to notify the administrator; if the public key verification is successful, the authorization credential of each IoT lock will be encrypted using the public key of each IoT lock to obtain the unlocking key ciphertext of each IoT lock. Furthermore, the generated unlocking key ciphertext has the characteristic that it can only be decrypted by the corresponding lock's private key, preventing the credential from being illegally stolen and parsed during transmission or storage.

[0066] S403. Generate a key packet for the target area based on the unlocking key ciphertext of each IoT lock.

[0067] The cloud server packages the encrypted unlocking keys of all IoT locks in the target area into a preset format to generate a target area key package, which is used for subsequent key matching and validity verification by the mobile terminal.

[0068] Meanwhile, the cloud server performs SHA-256 hash calculation on the entire key packet, generates a check value, and stores it together with the key packet. After the mobile terminal receives the key packet, it can verify the integrity through the check value to prevent data tampering or packet loss during transmission.

[0069] S404. Send the key packet of the target area to the mobile terminal, so that the mobile terminal stores the key packet of the target area locally, and executes the corresponding interaction processing method for IoT locks based on the key packet.

[0070] The cloud server encrypts and transmits the key packet to the mobile terminal via the HTTPS / API protocol, and uses the TLS 1.3 protocol to ensure communication security and prevent data eavesdropping during transmission. If the transmission is interrupted (such as due to network fluctuations), the cloud server supports "resume interrupted transmission," eliminating the need for the mobile terminal to re-initiate the complete request.

[0071] After receiving the key packet, the mobile terminal verifies its hash check value and stores it in a local secure area (iOS Keychain / Android Keystore) after confirming its integrity. The cloud server synchronously records information such as "key packet issuance time, user identifier of the receiving terminal, target area, and key packet validity period" to form a traceable record of key flow. Subsequently, the mobile terminal can execute the unlocking process S101~S103 based on this key packet.

[0072] In summary, this embodiment provides an interaction processing method for IoT locks executed by a cloud server. Through the end-to-end management of "centralized generation of credentials - encrypted packaging - secure distribution", it provides compliant authorization basis, secure key support and offline operation foundation for the entire IoT lock interaction, solving the pain points of "dispersed authorization, insecure keys and low management efficiency" in the prior art.

[0073] Figure 5 This is the fifth flowchart illustrating the interaction processing method for IoT locks provided in the embodiments of this application. Figure 5 As shown, step S401, obtaining authorization credentials for multiple IoT locks within the target area, may specifically include: S501. Generate an unlocking token for each IoT lock based on its serial number, the user identifier corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocking attempts, and a random number.

[0074] The cloud server constructs an unlocking token, Plaintext_Token. The unlocking token is a structured data packet containing the serial number of the IoT lock, the user identifier (ID) corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocks, and a random number. That is, Plaintext_Token = {User ID, Lock serial number, Effective timestamp, Expiration timestamp, Maximum number of unlocks (N), Random number}.

[0075] Among them, the lock serial number uniquely identifies the target lock, ensuring that the token corresponds one-to-one with the lock and preventing "cross-lock use"; the user identifier is used to associate the mobile terminal user and record the person responsible for the unlocking operation, which is convenient for subsequent auditing and traceability; the effective timestamp / expiration timestamp is used to limit the validity period of the token (the default effective time is when the unlocking token is generated, and the expiration time is 24 hours later), avoiding the security risks caused by the long-term validity of the token; the maximum number of unlocking attempts is used to limit the frequency of token use (default 5 times), so that even if the token is leaked, the harm is controlled within a limited number of attempts; a 32-bit string is randomly generated each time a token is generated to avoid duplicate tokens for the same lock and user, preventing replay attacks.

[0076] S502. Based on the private key of the cloud server, digitally sign the unlocking token of each IoT lock to obtain the digital signature of each IoT lock.

[0077] The cloud server uses its private key (a private key in an asymmetric encryption system, held only by the cloud server and rotated periodically) to sign the unlocking token using the ECDSA elliptic curve digital signature algorithm, generating a digital signature for each IoT lock, denoted as Signature=Sign(master private key, Plaintext_Token).

[0078] S503. Generate an authorization credential for each IoT lock based on the digital signature and unlocking token of each IoT lock.

[0079] The digital signature and unlocking token are assembled to generate an authorization credential for each IoT lock, denoted as Auth_Credential = Plaintext_Token + Signature.

[0080] S402 describes encrypting the authorization credentials of each IoT lock based on the public key of each IoT lock to obtain the unlocking key ciphertext of each IoT lock, including: encrypting Auth_Credential using an asymmetric encryption algorithm (such as RSA-OAEP or ECC) based on the public key of each IoT lock to generate the unlocking key ciphertext of each IoT lock, denoted as Ciphertext = Encrypt(lock public key, Auth_Credential).

[0081] The following describes the method used by the target IoT lock. Figure 6 This is the sixth flowchart illustrating the interaction processing method for IoT locks provided in the embodiments of this application. Figure 6 As shown, this method is applied to a target IoT lock, including: S601. After the target IoT lock is physically connected to the mobile terminal, a start command is sent to the mobile terminal.

[0082] The target IoT lock's USB interface supports magnetic connection. When a mobile terminal is inserted into the lock's USB interface via a Type-C magnetic cable, the lock receives power (5V / 1A) from the mobile terminal through the interface and wakes up from sleep mode.

[0083] After the lock is activated, its core control module (Microcontroller Unit, MCU) initializes the USB serial communication parameters and automatically generates a start command containing the "lock serial number (e.g., EL202405001), device model, and firmware version," which is then sent to the mobile terminal via the USB serial port. If the mobile terminal does not receive the command within one second, the lock resends the start command (up to three times). If the number of attempts is exceeded, a "connection error" is detected, and the fault indicator light illuminates.

[0084] S602. Obtain the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal.

[0085] After receiving the start command and verifying the legality of the lock, the mobile terminal sends the unlocking key ciphertext of the target IoT lock to the lock via the USB serial port. The unlocking key ciphertext is obtained by encrypting the authorization certificate of the target IoT lock in advance based on the public key of the target IoT lock.

[0086] After receiving data via the USB serial port, the lock first performs a CRC check (cyclic redundancy check). If the check fails (indicating data loss or tampering), a data retransmission request is sent to the mobile terminal. If the check passes, the unlocking key ciphertext is temporarily stored in the lock's temporary storage area (RAM) for subsequent verification.

[0087] S603. Verify the unlocking key ciphertext based on the private key of the target IoT lock.

[0088] The lock uses its own private key pre-installed in the firmware (a private key in an asymmetric encryption system, written to the one-time burning area during production and cannot be modified or read). Follow these steps to complete the verification: 1. Use your own private key to decrypt the unlocking key ciphertext Ciphertext to obtain the authorization credential Auth_Credential.

[0089] 2. Extract the digital signature (Signature) and unlocking token (Plaintext_Token) from the authorization credential (Auth_Credential), and verify the digital signature using the pre-set main site public key—calculate the token hash value z, and calculate u1=z. s - ¹modn、u2=r s - ¹mod n, calculate point (x1, y1) = u1 G+u2 QA (QA is the point corresponding to the main site's public key). If r≡x1modn, then the digital signature is considered to have passed verification.

[0090] 3. Parse the unlocking token Plaintext_Token and verify whether "the lock serial number is consistent with itself", "the current time is between the effective timestamp and the expiration timestamp", and "the historical unlocking count is less than the maximum unlocking count N".

[0091] If any verification step fails, the lock records the reason for the failure (such as "invalid signature", "expired token", "exceeded limit") and sends a "verification failed" command to the mobile terminal.

[0092] S604. If the encrypted message verification passes, the drive motor will perform the unlocking action.

[0093] After all verifications are passed, the lock outputs a drive voltage to control the motor to rotate forward (e.g., rotate 180°), which drives the mechanical structure to unlock.

[0094] During the unlocking process, the motor control unit monitors the motor current in real time: if the current exceeds the threshold (e.g., stall), the power supply is immediately stopped and "motor fault" is recorded; if the current is normal, the motor automatically resets after unlocking is completed, the lock sends an "unlock successful" command to the mobile terminal, and writes information such as "unlocking time, user ID, unlocking count +1" into the local NVM log (using WORM mechanism to prevent tampering).

[0095] Figure 7 This is the seventh flowchart illustrating the interaction processing method for IoT locks provided in the embodiments of this application. Figure 7 As shown, before executing step S602, which involves obtaining the ciphertext of the unlocking key for the target IoT lock sent by the mobile terminal, the method of this application further includes: S701: Send the current ambient temperature to the mobile terminal.

[0096] After the target IoT lock is woken up, its built-in temperature sensor (accuracy ±1℃, operating temperature range -40℃~85℃) collects the current ambient temperature, converts the temperature data (e.g. -25℃) into binary format, and sends it to the mobile terminal via USB serial port.

[0097] If the temperature sensor malfunctions (the collected data exceeds a reasonable range), the lock sends a "temperature detection failed" command to the mobile terminal, prompting the user to check the lock's hardware status and temporarily suspending the subsequent preheating and unlocking processes.

[0098] S702. Based on the preheating command sent by the mobile terminal, drive the motor to perform a trial unlocking action.

[0099] After the mobile terminal determines that the current temperature is lower than the preset threshold (default -10℃), it sends a preheating command to the lock. The command includes "preheating duration (default 30 seconds) and action interval (default 5 seconds / time)".

[0100] After receiving the preheating command, the lock's motor control unit drives the motor to perform a "low-power trial action," rotating only 10° each time (not the actual unlocking angle), followed by a 5-second pause. The Joule heat generated by the motor's operation raises the internal temperature of the lock. During the preheating process, the lock collects temperature data in real time. If the temperature reaches the threshold before the preheating time is reached, preheating can be terminated early, and a "preheating completed ahead of schedule" command can be sent to the mobile terminal.

[0101] Based on this, S602, obtaining the unlocking key ciphertext of the target IoT lock sent by the mobile terminal, may include: S703, Send the preheated temperature to the mobile terminal.

[0102] After preheating is complete (reaching the preset time or temperature), the lock's temperature sensor collects the preheated temperature and sends it to the mobile terminal via USB serial port, allowing the mobile terminal to determine whether the unlocking conditions are met.

[0103] For example, if the temperature before preheating is -30℃, and the temperature rises to -8℃ after 30 seconds of preheating (above the -10℃ threshold), the lock sends "Temperature after preheating: -8℃" to the mobile terminal; if the temperature after preheating is still below the threshold (e.g., only rises to -12℃), a "Preheating not met" command is sent, and the mobile terminal prompts the user "Ambient temperature is too low, cannot unlock".

[0104] S704. Obtain the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal.

[0105] After confirming that the temperature has reached the threshold after preheating, the mobile terminal sends the target IoT lock's unlocking key encrypted text (including a secure timestamp) to the lock via the USB serial port. The lock receives and verifies the data according to the S602 process, and then executes the verification and unlocking steps S603~S604 to ensure that the motor can start normally in low-temperature environments.

[0106] Figure 8 This is the eighth flowchart illustrating the interaction processing method for IoT locks provided in this application embodiment. Figure 8 As shown, before executing step S603, which verifies the unlocking key ciphertext based on the private key of the target IoT lock, the method of this application further includes: S801, Obtain the secure timestamp sent by the mobile terminal.

[0107] When the mobile terminal sends the ciphertext of the unlocking key to the lock, it simultaneously sends a secure timestamp. This timestamp is the current time of the mobile terminal (accurate to the second), and is binary data signed by the mobile terminal's private key, containing "timestamp value, signature information, and the user identifier of the mobile terminal".

[0108] After receiving the secure timestamp, the lock first verifies the signature validity using the pre-set mobile terminal public key (to prevent the timestamp from being tampered with). If the signature is invalid, subsequent operations are rejected and a "timestamp forgery" log is recorded. If the signature is valid, the timestamp value is extracted (e.g., 1714580000, corresponding to 10:00:00 on May 1, 2024).

[0109] S802. Verify the local clock based on the secure timestamp.

[0110] The lock's real-time clock (RTC) stops operating after a power outage because it is not battery-powered, and clock drift may occur upon power restoration. Alternatively, the lock may be susceptible to being tricked by an attacker who can physically rewind or fast-forward the internal clock.

[0111] To avoid the above two situations, in the method provided in this embodiment, the lock extracts the current time of the local RTC and compares it with the secure timestamp value to calculate the time difference: if the time difference is ≤30 seconds (preset tolerance threshold), the clock verification is determined to be successful, and the local RTC is calibrated with the secure timestamp to ensure the accuracy of subsequent token time verification; if the time difference is >30 seconds, the clock verification is determined to be unsuccessful, the lock sends a "clock mismatch" command to the mobile terminal, records the log "local time: [X], secure timestamp: [Y], time difference: [Z] seconds", and temporarily does not perform key ciphertext verification.

[0112] Based on this, the verification of the unlocking key ciphertext according to the private key of the target IoT lock described in S603 may include: S803. After the clock verification is successful, the unlocking key ciphertext is verified based on the private key of the target IoT lock.

[0113] After clock verification is successful, the lock's "key verification engine" follows the S603 process, calling its own private key to decrypt the unlocking key ciphertext, verify the signature, and verify the token's validity. If all verification steps pass, the unlocking action in S604 is executed; if verification fails, the reason for the failure is recorded and fed back to the mobile terminal, ensuring that the lock can only be opened when the clock is accurate and the credentials are valid, thus preventing security vulnerabilities caused by clock tampering.

[0114] In summary, such as Figure 9 As shown, this application provides an interaction processing method for IoT locks, which has the following advantages: 1. By pre-storing keys locally on the mobile terminal and physically connecting with IoT locks, the solution completely eliminates the dependence on wireless signals. Even in environments with no network or strong interference, as long as the physical connection is successful, the lock can be unlocked, perfectly meeting the deployment requirements of power grid metering boxes that are "dispersed in location and complex in environment".

[0115] 2. Staff only need to insert the magnetic cable, and the APP can automatically match the key, receive the start command sent by the lock, send the key and complete the verification. The operation is simplified to "one-click opening", which greatly reduces the training cost of maintenance personnel and is especially suitable for grassroots power maintenance scenarios.

[0116] 3. The "key package" design with time limits and a maximum number of unlocking attempts (e.g., valid for 24 hours and usable a maximum of 5 times) replaces the vulnerabilities of traditional mechanical locks ("one key opens multiple locks") and electronic locks ("fixed password / long-term key"). Even if the key is leaked due to extreme circumstances, the harm is strictly limited to a short time and a limited number of times, and the cloud server can trace the key usage records in real time, which meets the power industry's security standards of "auditable operation and traceable responsibility".

[0117] 4. Move complex functions such as key generation / storage, timestamp verification, and user interaction to the mobile terminal (mobile APP) and cloud server. The Internet of Things lock only needs to retain the basic modules of "private key storage, motor drive, and USB communication", without integrating high-cost wireless modules such as Bluetooth / Wi-Fi / NFC, nor carrying high-cost eSAM encryption chips. The cost of the lock is greatly reduced, providing economic feasibility for the "mass deployment" of low-voltage metering boxes in the power grid.

[0118] Optionally, the Elliptic Curve Digital Signature Algorithm (ECDSA) used in this application is an imitation of the Digital Signature Algorithm (DSA) using Elliptic Curve Cryptography (ECC). Its security is based on the Elliptic Curve Discrete Logarithm Problem. The Elliptic Curve Discrete Logarithm Problem is much more difficult than the Discrete Logarithm Problem. Therefore, the unit bit strength of the Elliptic Curve Cryptosystem is much higher than that of the traditional Discrete Logarithm System. With a shorter key, ECC can achieve the same security level as the DL system, with advantages such as small calculation parameters, short keys, and fast operation speed.

[0119] Among them, the public and private key generation algorithm (KeyGen) includes: Select an elliptic curve Ep(a, b) and a base point G; select a private key dA (dA < n, n is the order of G), and calculate the public key QA = dA G.

[0120] The signature generation algorithm (Sign) includes: Select a random integer k (k < n), and calculate the point P = k G = (x1, y1); Let r = x1; Calculate z = hash(m), and the hash function can choose SHA-2; Calculate s = k 1(z + rdA)(mod n); Obtain the signature (r, s). If either r or s is 0, reselect the random number k and calculate again.

[0121] The signature verification algorithm (Verify) includes: Calculate z = hash(m); Calculate u1 = z mod n, ; Calculate the point ( ) = ; Verify the equation: r ; If the equation holds, output 1, otherwise output 0.

[0122] The following will continue to explain the apparatus, device and storage medium for performing the interaction processing method for IoT locks provided in any of the above embodiments of this application. The specific implementation process and the resulting technical effects are the same as those in the corresponding method embodiments. For the sake of brevity, the parts not mentioned in the following embodiments can be referred to the corresponding content in the method embodiments.

[0123] Figure 10 This is one of the structural schematic diagrams of the interactive processing device for IoT locks provided in the embodiments of this application, such as... Figure 10 As shown, this application provides an interactive processing device for IoT locks, applied to a mobile terminal, the device comprising: The first acquisition module 1 is used to acquire a key package of a target area that is pre-stored locally. The key package includes: the unlocking key ciphertext of multiple IoT locks in the target area; the unlocking key ciphertext of each IoT lock is: the unlocking key ciphertext obtained by encrypting the authorization certificate of each IoT lock in advance according to the public key of each IoT lock.

[0124] The receiving module 2 is used to receive the start command sent by the target IoT lock after it is physically connected to the target IoT lock in the target area.

[0125] The first sending module 3 is used to send the ciphertext of the unlocking key of the target IoT lock to the target IoT lock, so that the target IoT lock uses its private key to verify the ciphertext of the unlocking key. If the ciphertext verification is successful, the drive motor is used to perform the unlocking action.

[0126] Optionally, the receiving module 2 is further configured to receive unlocking result information sent by the target IoT lock and store the unlocking result information in a local log.

[0127] The device also includes a synchronization module, used to synchronize the unlocking result information stored in the local log to the cloud server when the mobile terminal establishes a communication connection with the cloud server.

[0128] Optionally, the receiving module 2 is further configured to receive the current ambient temperature sent by the target IoT lock. The first sending module 3 is further configured to send a preheating command to the target IoT lock if the current ambient temperature is lower than a preset temperature threshold, so that the target IoT lock drives the motor to perform a trial unlocking action.

[0129] The receiving module 2 is also used to receive the preheated temperature sent by the target IoT lock; if the preheated temperature reaches the preset temperature threshold, it is determined that the preheating of the target IoT lock is complete.

[0130] Optionally, the first sending module 3 is further configured to send a secure timestamp to the target IoT lock so that the target IoT lock verifies its local clock based on the secure timestamp, and after the clock verification is successful, uses the private key of the target IoT lock to verify the unlocking key ciphertext.

[0131] Figure 11 This is a second schematic diagram of the structure of the interactive processing device for IoT locks provided in the embodiments of this application, as shown below. Figure 11 As shown, this application provides an interactive processing device for IoT locks, applied to a cloud server, the device comprising: The second acquisition module 4 is used to acquire authorization credentials for multiple IoT locks within the target area.

[0132] The encryption module 5 is used to encrypt the authorization certificate of each IoT lock according to the public key of each IoT lock to obtain the unlocking key ciphertext of each IoT lock.

[0133] The generation module 6 is used to generate a key packet for the target area based on the unlocking key ciphertext of each IoT lock.

[0134] The second sending module 7 is used to send the key packet of the target area to the mobile terminal, so that the mobile terminal stores the key packet of the target area locally and executes the interaction processing method for IoT locks corresponding to the mobile terminal according to the key packet.

[0135] Optionally, the second acquisition module 4 is further configured to generate an unlocking token for each IoT lock based on the serial number of each IoT lock, the user identifier corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocking attempts, and a random number; digitally sign the unlocking token of each IoT lock based on the private key of the cloud server to obtain a digital signature of each IoT lock; and generate an authorization credential for each IoT lock based on the digital signature and the unlocking token of each IoT lock.

[0136] Figure 12 This is the third schematic diagram of the structure of the interactive processing device for IoT locks provided in the embodiments of this application, as shown below. Figure 12 As shown, this application provides an interactive processing device for IoT locks, applied to a target IoT lock, the device comprising: The third sending module 8 is used to send a start command to the mobile terminal after the target IoT lock is physically connected to the mobile terminal.

[0137] The third acquisition module 9 is used to acquire the unlocking key ciphertext of the target IoT lock sent by the mobile terminal; the unlocking key ciphertext is: the unlocking key ciphertext obtained by encrypting the authorization certificate of the target IoT lock in advance according to the public key of the target IoT lock.

[0138] The verification module 10 is used to verify the unlocking key ciphertext based on the private key of the target IoT lock.

[0139] The unlocking module 11 is used to drive the motor to perform the unlocking action if the encrypted message verification is successful.

[0140] Optionally, the third sending module 8 is also used to send the current ambient temperature to the mobile terminal; and drive the motor to perform a trial unlocking action according to the preheating command sent by the mobile terminal.

[0141] The third acquisition module 9 is also used to send the preheated temperature to the mobile terminal and acquire the unlocking key ciphertext of the target IoT lock sent by the mobile terminal.

[0142] Optionally, the third acquisition module 9 is also used to acquire the security timestamp sent by the mobile terminal.

[0143] The verification module 10 is also used to verify the local clock according to the secure timestamp; after the clock verification is successful, the unlocking key ciphertext is verified according to the private key of the target IoT lock.

[0144] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0145] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0146] Figure 13 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 13 As shown, this application also provides an electronic device, including a processor 100, a storage medium 200, and a bus 300. The storage medium stores program instructions executable by the processor. When the electronic device is a mobile terminal, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the interactive processing method for IoT locks executed by the mobile terminal; when the electronic device is a cloud server, it implements the interactive processing method for IoT locks executed by the cloud server; when the electronic device is the core control module (MCU) in the target IoT lock, it implements the interactive processing method for IoT locks executed by the target IoT lock.

[0147] This application also provides a readable storage medium storing program instructions, which, when executed by a processor, implement the interactive processing method for IoT locks described in any of the above embodiments.

[0148] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0149] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0150] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0151] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0152] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An interaction processing method for IoT locks, characterized in that, Applied to a mobile terminal, the method includes: Obtain a locally pre-stored key packet for the target area. The key packet includes: ciphertext of unlocking keys for multiple IoT locks within the target area; the ciphertext of unlocking key for each IoT lock is: ciphertext of unlocking key obtained by encrypting the authorization credential of each IoT lock in advance based on the public key of each IoT lock. After physically connecting with the target IoT lock within the target area, receive the start command sent by the target IoT lock; The ciphertext of the unlocking key of the target IoT lock is sent to the target IoT lock so that the target IoT lock uses its private key to verify the ciphertext of the unlocking key. If the ciphertext verification is successful, the drive motor is used to perform the unlocking action.

2. The method according to claim 1, characterized in that, The method further includes: Receive the unlocking result information sent by the target IoT lock; The unlocking result information is stored in a local log. When the mobile terminal establishes a communication connection with the cloud server, it synchronizes the unlocking result information stored in the local log to the cloud server.

3. The method according to claim 1, characterized in that, Before sending the encrypted unlocking key of the target IoT lock to the target IoT lock, the method further includes: Receive the current ambient temperature sent by the target IoT lock; If the current ambient temperature is lower than a preset temperature threshold, a preheating command is sent to the target IoT lock so that the target IoT lock drives the motor to perform a trial unlocking action; Receive the preheated temperature sent by the target IoT lock; If the temperature reaches the preset temperature threshold after preheating, the preheating of the target IoT lock is determined to be complete.

4. The method according to claim 1, characterized in that, After sending the encrypted unlocking key of the target IoT lock to the target IoT lock, the method further includes: A secure timestamp is sent to the target IoT lock so that the target IoT lock can verify its local clock based on the secure timestamp. After the clock verification is successful, the lock's private key is used to verify the unlocking key ciphertext.

5. An interaction processing method for IoT locks, characterized in that, Applied to cloud servers, the method includes: Obtain authorization credentials for multiple IoT locks within the target area; Based on the public key of each IoT lock, the authorization certificate of each IoT lock is encrypted to obtain the unlocking key ciphertext of each IoT lock; Based on the ciphertext of the unlocking key of each IoT lock, a key packet for the target area is generated; The key packet of the target area is sent to the mobile terminal, so that the mobile terminal stores the key packet of the target area locally and executes the interaction processing method for IoT locks according to any one of claims 1 to 4 based on the key packet.

6. The method according to claim 5, characterized in that, The acquisition of authorization credentials for multiple IoT locks within the target area includes: An unlocking token for each IoT lock is generated based on its serial number, the user identifier corresponding to the mobile terminal, the effective timestamp, the expiration timestamp, the maximum number of unlocks, and a random number. Based on the private key of the cloud server, the unlocking token of each IoT lock is digitally signed to obtain the digital signature of each IoT lock; An authorization credential for each IoT lock is generated based on the digital signature and unlocking token of each IoT lock.

7. An interaction processing method for IoT locks, characterized in that, Applied to a target IoT lock, the method includes: After the target IoT lock is physically connected to the mobile terminal, a start command is sent to the mobile terminal; Obtain the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal; the ciphertext of the unlocking key is: the ciphertext of the unlocking key obtained by encrypting the authorization certificate of the target IoT lock in advance according to the public key of the target IoT lock; The unlocking key ciphertext is verified based on the private key of the target IoT lock; If the encrypted message is successfully verified, the drive motor will perform the unlocking action.

8. The method according to claim 7, characterized in that, Before obtaining the ciphertext of the unlocking key of the target IoT lock sent by the mobile terminal, the method further includes: Send the current ambient temperature to the mobile terminal; According to the preheating command sent by the mobile terminal, the motor is driven to perform a trial unlocking action; The step of obtaining the unlocking key ciphertext of the target IoT lock sent by the mobile terminal includes: Send the preheated temperature to the mobile terminal; Obtain the encrypted unlocking key of the target IoT lock sent by the mobile terminal.

9. The method according to claim 7, characterized in that, Before verifying the unlocking key ciphertext based on the private key of the target IoT lock, the method further includes: Obtain the secure timestamp sent by the mobile terminal; The local clock is verified based on the secure timestamp; The step of verifying the unlocking key ciphertext based on the private key of the target IoT lock includes: After the clock verification is successful, the unlocking key ciphertext is verified based on the private key of the target IoT lock.

10. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to implement the interactive processing method for IoT locks as described in any one of claims 1 to 9.