Intelligent lock and unlocking method and system thereof

By working together with the NFC and Bluetooth modules, the smart lock can be unlocked quickly, securely, and conveniently, solving the problems of slow unlocking speed, complex operation, and high power consumption in existing smart lock systems, thus improving user experience and security.

CN121600622APending Publication Date: 2026-03-03HANGZHOU TUYA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511861267.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-12-20
Filing Date
2025-12-10
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing smart lock systems have shortcomings in terms of unlocking speed, operational complexity, compatibility, and security. In particular, the high power consumption of BLE smart locks and the cumbersome operation of NFC smart locks affect the user experience.

Method used

The NFC module detects NFC tag scanning behavior to obtain initial device information, and the Bluetooth module performs Bluetooth scanning and decryption to achieve encrypted transmission and security verification of unlocking commands. Combined with a two-factor authentication system triggered by Bluetooth broadcasting and NFC, the standby power consumption of the BLE module is reduced.

Benefits of technology

It improves the unlocking speed and security of smart locks, reduces the power consumption of Bluetooth modules, simplifies the operation process, and enhances the system's resistance to attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600622A_ABST
    Figure CN121600622A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent lock and an unlocking method and system thereof, and relates to the technical field of Internet of Things. The method comprises the following steps: detecting an NFC label scanning behavior through an NFC module under the condition of identifying that the activation of the intelligent lock is completed, so that an NFC card reader of the mobile terminal reads the NFC label content of the intelligent lock, and determining an unlocking instruction ciphertext according to first equipment information of the NFC label content; the first equipment information comprises a target application identifier, an intelligent lock identifier and a first random number; bluetooth scanning is started through the Bluetooth module; scanning, receiving and decrypting the unlocking instruction ciphertext sent by the mobile terminal through the Bluetooth module to obtain an unlocking instruction plaintext; performing unlocking operation according to the unlocking instruction plaintext; and unlocking success information is sent to the mobile terminal through Bluetooth broadcast by the Bluetooth module, Bluetooth scanning is closed, and the first random number is regenerated for next unlocking. According to the technical scheme, the power consumption of the intelligent lock can be reduced, and the unlocking speed of the intelligent lock can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet of Things (IoT) technology, and in particular to a smart lock and its unlocking method and system. Background Technology

[0002] In recent years, smart lock technology has made significant progress in home security and convenience. Traditional mechanical locks are gradually being replaced by electronic and smart locks. These new locks typically incorporate wireless communication technologies such as Bluetooth Low Energy (BLE) and Near Field Communication (NFC) to improve user experience and security. Existing smart locks include NFC smart locks and BLE smart locks.

[0003] Existing NFC smart locks are typically based on active solutions, relying on an attached NFC card for unlocking. Users need to carry the NFC card with them, but these cards are easily lost or damaged, causing inconvenience.

[0004] Existing BLE smart lock systems require users to manually open an application on their mobile phone and then unlock the device via a control panel. However, this process is cumbersome, requiring users to spend time performing multiple steps on their phones, increasing the difficulty of use. Moreover, in situations of signal interference or unstable connections, unlocking may fail or be delayed, impacting the user experience.

[0005] There are also smart lock solutions that support writing NFC keys to mobile phones, enabling a more convenient unlocking method. However, current iOS devices do not support writing NFC keys, which limits the application of this solution among Apple users. Although Android devices support writing NFC keys, the entire process is cumbersome, requiring multiple steps from the user, resulting in a poor user experience and significant security risks.

[0006] It is evident that existing smart lock systems still have some problems in practical applications, such as slow unlocking speed, complex operation, and incompatibility. Summary of the Invention

[0007] This invention provides a smart lock and its unlocking method and system to improve the unlocking security of the smart lock and reduce its power consumption.

[0008] According to one aspect of the present invention, a method for unlocking a smart lock is provided, applied to a smart lock, the smart lock including an NFC module and a Bluetooth module, the method comprising:

[0009] Upon detecting that the smart lock has been activated, the NFC module detects the NFC tag scanning behavior, enabling the NFC module of the mobile terminal to read the NFC tag content of the smart lock and determine the unlock command ciphertext based on the first device information in the NFC tag content; wherein, the first device information includes the target application identifier, the smart lock identifier, and a first random number;

[0010] Bluetooth scanning is initiated via the Bluetooth module;

[0011] The Bluetooth module scans, receives, and decrypts the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command.

[0012] Perform the unlocking operation according to the plaintext of the unlocking command;

[0013] The Bluetooth module sends a successful unlock message to the mobile terminal via Bluetooth broadcast, disables Bluetooth scanning, and regenerates a first random number for the next unlock attempt.

[0014] According to another aspect of the present invention, a method for unlocking a smart lock is provided, applied to a mobile terminal, the mobile terminal being configured with an NFC card reader and an application, the method comprising:

[0015] In response to detecting the NFC tag of the smart lock, the NFC reader obtains the first device information of the smart lock; wherein, the first device information includes a target application identifier, a smart lock identifier, and a first random number;

[0016] In response to the target application identifier in the first device information of the smart lock, the application is launched;

[0017] The application performs a hash operation on the first random number and the smart lock identifier to obtain the first key seed;

[0018] The application determines the decrypted content based on the first device information;

[0019] The application encrypts the decrypted content according to the first key seed to obtain the unlock command ciphertext;

[0020] The application sends the encrypted unlock command to the smart lock via Bluetooth broadcast, so that the smart lock can scan, receive, and decrypt the encrypted unlock command sent by the mobile terminal to perform the unlocking operation.

[0021] According to another aspect of the present invention, a smart lock is provided, comprising:

[0022] The NFC module is used to receive a first random number or a second random number sent by the Bluetooth module, store the device information of the smart lock, and detect the NFC tag scanning behavior of the mobile terminal.

[0023] The Bluetooth module is used to scan, receive, and decrypt the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command, and send the unlock success information to the mobile terminal via Bluetooth broadcast, turn off Bluetooth scanning, and regenerate the first random number for the next unlock;

[0024] The main controller is used to receive the unlock command plaintext sent by the Bluetooth module and perform the unlock operation according to the unlock command plaintext.

[0025] According to another aspect of the present invention, an unlocking device for a smart lock is provided, applied to a mobile terminal, the mobile terminal being configured with an NFC card reader and an application, the device comprising:

[0026] The device information acquisition module is used to acquire first device information of the smart lock in response to the detection of the NFC tag of the smart lock by the NFC card reader; wherein, the first device information includes a target application identifier, a smart lock identifier, and a first random number;

[0027] An application launch module is used to launch the application in response to the target application identifier in the first device information of the smart lock;

[0028] The key seed determination module is used to perform a hash operation on the first random number and the smart lock identifier through the application to obtain the first key seed;

[0029] The decryption content determination module is used to determine the decryption content based on the first device information through the application.

[0030] The unlock command ciphertext determination module is used to encrypt the decryption content according to the first key seed through the application to obtain the unlock command ciphertext;

[0031] The unlock command ciphertext sending module is used to send the unlock command ciphertext to the smart lock via Bluetooth broadcast through the application, so that the smart lock can scan, receive and decrypt the unlock command ciphertext sent by the mobile terminal to perform the unlocking operation.

[0032] According to another aspect of the present invention, an unlocking system for a smart lock is provided, comprising:

[0033] A smart lock for performing the unlocking method of the smart lock described in any embodiment of the present invention;

[0034] A mobile terminal is used to execute the unlocking method of the smart lock described in any embodiment of the present invention.

[0035] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0036] At least one processor; and

[0037] A memory communicatively connected to the at least one processor; wherein,

[0038] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the unlocking method of the smart lock according to any embodiment of the present invention.

[0039] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the unlocking method of the smart lock according to any embodiment of the present invention.

[0040] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the unlocking method of a smart lock according to any embodiment of the present invention.

[0041] The technical solution of this invention involves detecting NFC tag scanning behavior via the NFC module when the smart lock activation is detected, enabling the mobile terminal's NFC module to read the NFC tag content of the smart lock and determine the ciphertext of the unlock command based on the first device information in the NFC tag content. The first device information includes a target application identifier, a smart lock identifier, and a first random number. Bluetooth scanning is then enabled via the Bluetooth module. The ciphertext of the unlock command sent by the mobile terminal is received and decrypted via the Bluetooth module to obtain the plaintext unlock command. The unlock operation is performed according to the plaintext unlock command. Finally, a successful unlock message is broadcast to the mobile terminal via Bluetooth, Bluetooth scanning is disabled, and a new first random number is generated for the next unlock attempt. The above technical solution, upon sensing the energy field of an external card reader at the NFC front end, wakes the BLE module from sleep mode via a hardware interrupt, putting it into a brief, task-oriented active state to execute a designated broadcast scanning task. This completely avoids the huge standby power consumption of traditional Bluetooth BLE locks in maintaining connection availability. Furthermore, unlocking the smart lock via Bluetooth broadcast improves the unlocking speed. Simultaneously, encrypting the unlocking command to obtain the ciphertext ensures the security of unlocking.

[0042] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart of a smart lock unlocking method according to an embodiment of the present invention;

[0045] Figure 2 This is a flowchart of a smart lock unlocking method according to an embodiment of the present invention;

[0046] Figure 3 This is a schematic diagram of the structure of a smart lock according to an embodiment of the present invention;

[0047] Figure 4 This is a schematic diagram of the structure of an unlocking device for a smart lock according to an embodiment of the present invention;

[0048] Figure 5 This is an architecture diagram of an unlocking system for a smart lock according to an embodiment of the present invention;

[0049] Figure 6 This is an unlocking interaction diagram of a smart lock provided according to an embodiment of the present invention;

[0050] Figure 7 This is an activation interaction diagram of a smart lock according to an embodiment of the present invention;

[0051] Figure 8 This is an unlocking interaction diagram of a smart lock provided according to an embodiment of the present invention;

[0052] Figure 9 This is an interaction diagram of unlocking and connecting a smart lock according to an embodiment of the present invention;

[0053] Figure 10 This is a schematic diagram of the structure of an electronic device that implements the unlocking method of the smart lock according to an embodiment of the present invention. Detailed Implementation

[0054] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention 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 the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover 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.

[0056] Furthermore, it should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of relevant data, such as user identity information, involved in the activation and unlocking phases of the smart lock in the present invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0057] Current unlocking solutions, while achieving some degree of intelligence in smart locks based on technologies like BLE connectivity, still have significant shortcomings in balancing the pursuit of an optimal user experience, high security, and long battery life: 1) The contradiction between unlocking speed and power consumption: With BLE solutions, to achieve fast response, traditional BLE smart locks' Bluetooth modules need to continuously broadcast or frequently scan, significantly increasing standby power consumption and requiring frequent battery replacements, reducing product reliability and convenience. If the broadcast frequency is reduced to save power, users will have to wait at the door for a connection, resulting in unlocking delays (typically 3-5 seconds) and a poor experience. With NFC solutions, although NFC itself has low power consumption, its "must-have-physical-contact" characteristic limits its use cases. Users need to take out their phones, turn on the screen, and precisely align them with the sensing area, making the process cumbersome and not "seamless." Many mobile phones do not support NFC card emulation, while NFC read / write functionality is generally included in most devices. 2) Conflict between security and convenience: Traditional BLE pairing and connection processes (such as PIN code input) are complex, and if a passwordless broadcast scheme (HID scheme) is used, it is highly vulnerable to man-in-the-middle attacks and replay attacks, posing a high security risk. Attackers can easily sniff out and forge unlocking commands. While NFC card keys (physical cards or mobile phone emulation cards) are secure, physical cards are easily lost or copied, and are inconvenient to carry. Furthermore, many mainstream mobile phone models do not support NFC card emulation, limiting their universality. 3) Network dependence and reliability issues: Some smart locks that rely on cloud-based key verification (such as Wi-Fi smart locks) may experience slow unlocking or even complete failure when there is network latency or interruption, especially in scenarios such as underground parking garages and stairwells with poor signal, where reliability cannot be guaranteed. 4) Cumbersome interaction process: Whether it is NFC or BLE, users usually need to manually turn on their mobile phone screen, find and open the designated APP, and then perform the unlocking operation. The entire interaction chain is too long, and compared with the intuitive and quick traditional mechanical keys, it does not represent a qualitative leap. In addition, smart locks using WiFi technology suffer from network latency, resulting in slow unlocking and low reliability, while NFC+BLE solutions can avoid the impact of network problems.

[0058] Figure 1 This is a flowchart of a smart lock unlocking method according to an embodiment of the present invention. This embodiment is applicable to unlocking smart locks on various electronic devices, such as vehicles, access control devices, and cardless identity authentication systems like those in hotels, apartments, and other access control systems. The method can be executed by a smart lock unlocking device, which can be implemented in hardware and / or software. This device can be configured in the electronic device that performs the smart lock unlocking function. Optionally, the smart lock includes an NFC module and a Bluetooth module; the NFC module is used to trigger smart lock activation or unlocking; the Bluetooth module is used for Bluetooth broadcast unlocking. Figure 1As shown, the method includes:

[0059] S110. Upon detecting that the smart lock has been activated, the NFC module detects the NFC tag scanning behavior, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock, and determine the unlock command ciphertext based on the first device information in the NFC tag content.

[0060] It should be noted that in this embodiment, the NFC module supports NFC card reading but not NFC card writing. This is to prevent external parties from tampering with the smart lock's NFC card information. The NFC module refers to the smart lock's NFC module, which operates in NFC tag mode (becoming a physical card).

[0061] In this embodiment, the first device information refers to the smart lock information stored in the NFC during the smart lock unlocking phase. Optionally, the first device information includes a target application identifier, a smart lock identifier, and a first random number. The target application identifier refers to the identifier information of the target application corresponding to the smart lock, which may be the application's package name. The smart lock identifier is used to uniquely identify the smart lock and may be a unique device key. The first random number is used to encrypt unlocking information during smart lock unlocking. Further, the first device information also includes the smart lock's unique device identifier (UUID) and MAC address, where the MAC address refers to the MAC address of the Bluetooth module in the smart lock.

[0062] Specifically, after the smart lock is activated, when a user touches the smart lock's NFC module via a mobile terminal, the smart lock detects the NFC tag scanning behavior through the NFC module and sends the smart lock's first device information to the mobile terminal. Correspondingly, the target application in the mobile terminal can read the first device information and determine the unlock command ciphertext based on the first device information. Here, the unlock command ciphertext refers to the data after the unlock command is encrypted.

[0063] S120, enable Bluetooth scanning via Bluetooth module.

[0064] Specifically, when the NFC module detects NFC tag scanning, the smart lock's Bluetooth module immediately starts Bluetooth scanning to obtain unlocking commands and unlock the smart lock.

[0065] S130: Scan and decrypt the ciphertext of the unlock command sent by the mobile terminal through the Bluetooth module to obtain the plaintext of the unlock command.

[0066] In this embodiment, the plaintext of the unlock command refers to the data after the ciphertext of the unlock command has been decrypted; optionally, it includes user permissions, user identity information, and serial number, etc.

[0067] An alternative approach involves scanning and decrypting the ciphertext of the unlock command sent by the mobile terminal via a Bluetooth module to obtain the plaintext of the unlock command. This includes: performing a hash operation on a first random number, the activated digital certificate, and the smart lock identifier via the Bluetooth module to obtain a first key seed; and using the first key seed to decrypt the ciphertext of the unlock command to obtain the plaintext of the unlock command.

[0068] The first key seed is used to decrypt the ciphertext of the unlock command and can be a hash value.

[0069] Specifically, the Bluetooth module uses a hash algorithm to perform a hash operation on the first random number, the activated digital certificate, and the smart lock identifier to obtain the first key seed. The hash algorithm includes, but is not limited to, MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit), and SHA-512 (512-bit), and possesses characteristics such as uniqueness, irreversibility, and the avalanche effect (a slight change in input data will significantly alter the hash value). Then, based on the decryption method, the first key seed is used to decrypt the ciphertext of the unlock command to obtain the plaintext unlock command. The decryption method corresponds to the encryption method used to obtain the ciphertext unlock command.

[0070] S140. Perform the unlocking operation according to the plaintext unlocking command.

[0071] An optional method involves performing an unlocking operation based on the plaintext of the unlocking instruction, including: performing a security verification based on the sequence number in the plaintext of the unlocking instruction to obtain a security verification result; performing an authorization verification based on the user permissions or user identity information in the plaintext of the unlocking instruction to obtain an authorization verification result; and performing the unlocking operation if both the security verification result and the authorization verification result are successful.

[0072] The sequence number (SN) is one of the methods to prevent replay attacks. The SN is a unique code added to the communication data packet. As each data packet is sent, the SN is incremented. The receiver verifies the freshness of the data packet by checking the SN. If a data packet with a duplicate SN is received, it can be identified as a replay attack and discarded. This effectively prevents attackers from using intercepted old data packets for malicious operations, ensuring the security and integrity of communication and ensuring that only the latest and valid data packets are processed. The security verification result refers to the replay security verification result, including successful and unsuccessful verification. The permission verification result refers to the verification result of whether unlocking permission exists, including successful and unsuccessful verification. User permissions refer to whether the user has the permission to unlock. User identity information refers to user login information, such as the user's unique identifier, i.e., the unique identifier of the user who owns the smart lock.

[0073] Specifically, the main controller can perform a duplicate check on the sequence number in the plaintext of the unlock command to obtain a security verification result. It can also perform permission verification on the user's permissions or identity information in the plaintext of the unlock command, for example, by checking user permissions or identity information to obtain a permission verification result. If both the security verification result and the permission verification result are successful, the unlocking operation is executed, completing the unlocking process. The user can then enter smoothly; the entire unlocking process is fast, secure, and convenient.

[0074] Understandably, performing both security and permission checks during unlocking can improve the security of the unlocking process.

[0075] S150: Send a successful unlock message to the mobile terminal via Bluetooth broadcast through the Bluetooth module, turn off Bluetooth scanning, and regenerate the first random number for the next unlock.

[0076] Specifically, after successful unlocking, the smart lock's Bluetooth module sends an unlock success message to the mobile terminal via Bluetooth broadcast; it also turns off Bluetooth scanning, clears the first random number in the NFC module, and regenerates the first random number, sending it to the NFC module for the next unlock.

[0077] It should be noted that the Bluetooth module generates a new random number every time the NFC tag is read, ensuring that the random number is different each time it is read.

[0078] The technical solution of this invention involves detecting NFC tag scanning behavior via the NFC module when the smart lock activation is detected, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock, and determining the ciphertext of the unlock command based on the first device information in the NFC tag content; wherein the first device information includes a target application identifier, a smart lock identifier, and a first random number; enabling Bluetooth scanning via the Bluetooth module; receiving and decrypting the ciphertext of the unlock command sent by the mobile terminal via the Bluetooth module to obtain the plaintext of the unlock command; performing the unlock operation according to the plaintext of the unlock command; broadcasting the unlock success information to the mobile terminal via Bluetooth via the Bluetooth module; disabling Bluetooth scanning; and regenerating the first random number for the next unlock. The above technical solution, upon sensing the energy field of an external card reader at the NFC front end, wakes the BLE module from sleep mode via a hardware interrupt, putting it into a brief, task-oriented active state to execute a designated broadcast scanning task. This completely avoids the huge standby power consumption of traditional Bluetooth BLE locks in maintaining connection availability. Furthermore, unlocking the smart lock via Bluetooth broadcast improves the unlocking speed. Simultaneously, encrypting the unlocking command to obtain the ciphertext ensures the security of unlocking.

[0079] Based on the above embodiments, as an optional aspect of the present invention, after detecting NFC tag scanning behavior through the NFC module, the method further includes: after recognizing the establishment of a Bluetooth channel between the smart lock and the mobile terminal, obtaining the unlock command ciphertext from the mobile terminal through the Bluetooth channel, and sending and unlocking success information to the mobile terminal.

[0080] Specifically, upon NFC contact, the mobile terminal system launches the corresponding target application, which initiates scanning. Based on the MAC address in the initial device information, it establishes a Bluetooth connection with the smart lock, creating a Bluetooth channel. Then, during the exchange and transmission of the unlock command ciphertext and unlock success information, this interaction can occur via the Bluetooth channel. At this point, broadcasting and broadcast scanning cease.

[0081] Understandably, sending commands via Bluetooth in this way saves time and makes the Bluetooth module of the smart lock consume less power.

[0082] An alternative approach further includes: automatically locking the smart lock for a set duration after a set number of consecutive unlocking failures; clearing the first device information in the NFC module during the locking period; and automatically restoring the first device information after the set locking duration has elapsed.

[0083] Specifically, if the smart lock fails to unlock after a set number of consecutive attempts, it will automatically lock for a set duration and clear the first device information in the NFC module. Once locked, it will be unable to unlock. At this time, the mobile terminal will continue to read the card and intelligently read the smart lock's locking information. After the set locking duration is reached, the first device information will be automatically restored.

[0084] Based on the above embodiments, as an optional aspect of the present invention, identifying the completion of smart lock activation includes: detecting NFC tag scanning behavior via the NFC module, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock; wherein, the NFC tag content includes second device information of the smart lock; enabling Bluetooth scanning via the Bluetooth module; performing a hash operation on a second random number and the smart lock identifier via the Bluetooth module to obtain a second key seed; scanning the encrypted activation information sent by the mobile terminal via the Bluetooth module, and decrypting the encrypted activation information using the second key seed to obtain plaintext activation information; the plaintext activation information includes a smart lock virtual identifier and a digital certificate; registering the smart lock as a device via the Bluetooth module using the plaintext activation information, and replying to the mobile terminal with activation success information via Bluetooth broadcast to complete the smart lock activation; and disabling Bluetooth scanning.

[0085] The second device information includes the target application identifier, the smart lock identifier, and a second random number. The second random number is used to encrypt activation information during smart lock activation. Furthermore, the second device information also includes the smart lock's unique device identifier (UUID) and MAC address, where the MAC address refers to the MAC address of the Bluetooth module in the smart lock. The second key seed is used to decrypt the ciphertext activation information and can be a hash value. The ciphertext activation information refers to the data after decrypting the plaintext activation information. The plaintext activation information includes the smart lock's virtual identifier, smart lock information, smart lock's digital certificate, and information about the target application associated with the smart lock, as well as user account information.

[0086] Specifically, when a user touches the smart lock's NFC module via a mobile terminal, the smart lock detects the NFC tag scanning behavior through the NFC module. The NFC tag content, including the smart lock's secondary device information, is then read by the mobile terminal's NFC reader. Simultaneously, Bluetooth scanning is initiated via the Bluetooth module. The Bluetooth module performs a hash operation on the secondary random number, digital certificate, and smart lock identifier using a hash algorithm to obtain the secondary key seed. Hash algorithms include, but are not limited to, MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit), and SHA-512 (512-bit). The Bluetooth module scans and receives the ciphertext activation information sent by the mobile terminal, and decrypts it using the secondary key seed based on a decryption algorithm to obtain the plaintext activation information. The Bluetooth module then registers the smart lock using the plaintext activation information and broadcasts a successful activation message back to the mobile terminal via Bluetooth, thus completing the smart lock activation. Bluetooth scanning is then disabled.

[0087] In one alternative approach, after detecting NFC tag scanning behavior via the NFC module, the method further includes: after recognizing the establishment of a Bluetooth channel between the smart lock and the mobile terminal, sending ciphertext of activation information and activation success information to the mobile terminal via the Bluetooth channel.

[0088] Specifically, upon NFC contact, the mobile terminal system launches the corresponding target application, which initiates scanning. Based on the MAC address in the second device information, it establishes a Bluetooth connection with the smart lock, creating a Bluetooth channel. Then, the activation information (encrypted text) and activation success message are sent via the Bluetooth channel. At this point, broadcasting and broadcast scanning cease.

[0089] Understandably, sending commands via Bluetooth in this way saves time and makes the Bluetooth module of the smart lock consume less power.

[0090] An alternative approach further includes: automatically locking the smart lock for a set duration after a set number of consecutive activation failures; clearing the second device information in the NFC module during the locking period; and automatically restoring the second device information after the set locking duration has elapsed.

[0091] Specifically, if the smart lock fails to unlock after a set number of consecutive attempts, it will automatically lock for a set duration and clear the second device information from the NFC module. Once locked, the device cannot be activated via NFC broadcast. At this time, the mobile terminal continues to read the card and intelligently reads the smart lock's locking information. After the set locking duration is reached, the second device information will be automatically restored.

[0092] Figure 2 This is a flowchart of a smart lock unlocking method according to an embodiment of the present invention. This embodiment is applicable to unlocking smart locks on various electronic devices, such as vehicles, access control devices, and cardless identity authentication systems like those in hotels, apartments, and other access control systems. The method can be executed by a smart lock unlocking device, which can be implemented in hardware and / or software. This device can be configured in the electronic device providing the smart lock unlocking function, such as a mobile terminal, specifically a mobile phone; optionally, the mobile terminal is equipped with an NFC card reader and an application. It should be noted that the meanings of the same terms appearing in this embodiment have been explained in the above embodiments and will not be repeated here. Figure 2 As shown, the method includes:

[0093] S210: Read the NFC tag of the smart lock using an NFC reader to obtain the first device information of the smart lock.

[0094] The first device information includes the target application identifier, the smart lock identifier, and the first random number.

[0095] Specifically, when a mobile device touches the NFC tag on the smart lock, the NFC reader reads the smart lock's initial device information.

[0096] S220: In response to the target application identifier in the first device information of the smart lock, launch the application.

[0097] S230. The application performs a hash operation on the first random number and the smart lock identifier to obtain the first key seed.

[0098] Specifically, a hash algorithm is used to perform a hash operation on the first random number, the smart lock identifier, and the digital certificate obtained from activation to obtain the first key seed. The hash algorithm includes, but is not limited to, MD5 (128-bit), SHA-1 (160-bit), SHA-256 (256-bit), SHA-512 (512-bit), etc.

[0099] S240: The application determines the decrypted content based on the first device information.

[0100] The decrypted content refers to the content used for unlocking; optionally, the decrypted content includes, but is not limited to, smart lock identifiers, user identity information, user permissions, etc.

[0101] Specifically, the application obtains the smart lock identifier from the first device information, and obtains the user identity information and / or user permissions based on the target application identifier, and assembles this information to obtain the decrypted content.

[0102] S250: The application encrypts the decrypted content according to the first key seed to obtain the unlock command ciphertext.

[0103] Specifically, the application can encrypt the decrypted content using the first key seed based on the encryption algorithm to obtain the ciphertext of the unlocking instruction; the encryption algorithm is not specifically limited in this implementation, and the encryption algorithm corresponds to the decryption algorithm.

[0104] S260: The application sends an unlock command ciphertext to the smart lock via Bluetooth broadcast, so that the smart lock can scan, receive and decrypt the unlock command ciphertext sent by the mobile terminal to perform the unlocking operation.

[0105] Specifically, the application in the mobile terminal sends an encrypted unlock command to the smart lock via Bluetooth broadcast. In turn, the smart lock scans, receives, and decrypts the encrypted unlock command sent by the mobile terminal via the Bluetooth module to perform the unlocking operation.

[0106] The technical solution provided by this invention reads the NFC tag of a smart lock using an NFC reader to obtain the first device information of the smart lock; responding to the target application identifier in the first device information of the smart lock, an application is launched; the application performs a hash operation on a first random number and the smart lock identifier to obtain a first key seed; the application determines the decryption content based on the first device information; the decryption content is encrypted according to the first key seed to obtain an unlock command ciphertext; the application sends the unlock command ciphertext to the smart lock via Bluetooth broadcast, so that the smart lock scans, receives, and decrypts the unlock command ciphertext sent by the mobile terminal to perform the unlocking operation. The above technical solution, by using NFC triggering and Bluetooth broadcasting to unlock the smart lock, can achieve unlocking without requiring user biometric information (such as fingerprints, facial recognition, etc.) or cards, relying solely on the user's mobile terminal; at the same time, encrypting the unlocking content ensures the security of the unlocking process.

[0107] Based on the above embodiments, as an optional aspect of the present invention, in response to detecting the NFC tag of the smart lock and obtaining the first device information of the smart lock, the method further includes: establishing a Bluetooth channel by connecting with the smart lock through Bluetooth based on the MAC information in the first device information; and sending an unlock command ciphertext to the smart lock through the Bluetooth channel.

[0108] Specifically, upon NFC contact, the mobile terminal system launches the corresponding target application, which initiates scanning. Based on the MAC address in the initial device information, it establishes a Bluetooth connection with the smart lock, creating a Bluetooth channel. Then, when sending the encrypted unlock command, it can transmit it through the Bluetooth channel. At this point, broadcasting and broadcast scanning are stopped.

[0109] Understandably, sending commands via Bluetooth in this way saves time and makes the Bluetooth module of the smart lock consume less power.

[0110] Based on the above embodiments, as an optional aspect of the present invention, it further includes: in response to detecting the NFC tag of the smart lock, obtaining second device information of the smart lock; wherein the second device information includes a target application identifier, a smart lock identifier, and a second random number; sending a device activation request to the cloud, so that the cloud binds the smart lock to the target account according to the device activation request and generates activation information; wherein the activation information includes a smart lock virtual identifier and a digital certificate; performing a hash operation on the second random number and the smart lock identifier to obtain a second key seed; encrypting the activation information using the second key seed to obtain ciphertext of the activation information; sending the ciphertext of the activation information to the smart lock via Bluetooth broadcast, so that the smart lock activates according to the ciphertext of the activation information; and completing the smart lock activation after receiving the activation success information sent by the smart lock.

[0111] Specifically, the user touches the smart lock's NFC module with their mobile terminal to read the smart lock's secondary device information and sends a device activation request to the cloud. The cloud then binds the smart lock to the target account based on the activation request, generates activation information, and sends this information to the mobile terminal. Correspondingly, the mobile terminal performs a hash operation on a second random number and the smart lock identifier using a hash algorithm to obtain a second key seed. This second key seed is then used to encrypt the activation information, resulting in ciphertext. This ciphertext is broadcast to the smart lock via Bluetooth. The smart lock then scans for the ciphertext via Bluetooth, activates itself, and upon successful activation, broadcasts an activation success message to the mobile terminal via Bluetooth. Upon receiving the activation success message from the smart lock, the mobile terminal completes the smart lock activation process.

[0112] Based on the above embodiments, as an optional aspect of the present invention, it further includes: establishing a Bluetooth channel by connecting the smart lock with the MAC information in the second device information; and sending ciphertext activation information to the smart lock through the Bluetooth channel.

[0113] Specifically, upon NFC contact, the mobile terminal system launches the corresponding target application, which initiates scanning. Based on the MAC address in the second device information, it establishes a Bluetooth connection with the smart lock, creating a Bluetooth channel. Then, the activation information (encrypted text) and activation success message are sent via the Bluetooth channel. At this point, broadcasting and broadcast scanning cease.

[0114] Understandably, sending commands via Bluetooth in this way saves time and makes the Bluetooth module of the smart lock consume less power.

[0115] This invention enables quick activation of the smart lock's BLE broadcast via NFC touch, eliminating the need for users to manually turn on Bluetooth or scan devices, thus improving operational convenience. It also dynamically configures NFC to launch the corresponding app, further reducing the need for users to manually turn on Bluetooth or scan devices, enhancing ease of use.

[0116] This invention achieves one key per device. Each smart lock has a fixed key after activation. Combined with a serial number (SN) and a password derivation algorithm, a dynamic key is required each time the device is unlocked. By combining NFC's physical proximity authentication (first channel) and BLE's encrypted data transmission (second channel), a two-factor, out-of-band authentication system of "physical trigger + wireless encryption" is formed, greatly improving the resistance to attacks.

[0117] Unlike existing BLE modules that require continuous advertising or periodic scanning to maintain an "online" state, the BLE module of this invention is in a completely dormant static mode most of the time, generating no effective power consumption. Only when the NFC front end senses the energy field of an external card reader is the BLE module awakened from dormancy via a hardware interrupt, putting it into a brief, task-oriented active state to perform the designated broadcast scanning task. This completely avoids the huge standby power consumption of traditional BLE locks that arises from maintaining connection availability.

[0118] For scenarios requiring GATT connections, this invention designs an intelligent broadcast scheduling strategy. Upon NFC triggering, the device can immediately switch to accelerated broadcast mode (e.g., reducing the broadcast interval from the usual 2 seconds to 20 milliseconds), ensuring that the app can complete device discovery and connection in the shortest possible time, optimizing the user experience. After a connection is lost, the device automatically reverts to energy-efficient broadcast mode, maintaining basic connectivity with extremely long broadcast intervals and low transmission power, resulting in power consumption reductions of several orders of magnitude compared to the standard connection mode.

[0119] By combining NFC's physical contact authentication with BLE's encrypted communication, a two-factor authentication system of "contact triggering + wireless encryption" is formed to resist man-in-the-middle attacks and replay attacks.

[0120] Figure 3 This is a structural schematic diagram of a smart lock according to an embodiment of the present invention; as shown. Figure 3 As shown, the smart lock includes:

[0121] The NFC module 310 is used to receive a first random number or a second random number sent by the Bluetooth module, store the device information of the smart lock, and detect the NFC tag scanning behavior of the mobile terminal.

[0122] The Bluetooth module 320 is used to scan, receive, and decrypt the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command, and send the unlock success information to the mobile terminal via Bluetooth broadcast, turn off Bluetooth scanning, and regenerate the first random number for the next unlock;

[0123] The main controller 330 is used to receive the unlock command plaintext sent by the Bluetooth module and perform the unlock operation according to the unlock command plaintext.

[0124] It should be noted that in this embodiment, the NFC module, Bluetooth module, and main controller can be integrated on the same module or on different modules. For example, the Bluetooth module and the main controller can be integrated together.

[0125] The smart lock of this invention wakes up the BLE module from sleep mode via a hardware interrupt the moment the NFC front end senses the energy field of the external card reader, and puts it into a brief, task-oriented active state to perform the specified broadcast scanning task. This completely avoids the huge standby power consumption of traditional Bluetooth BLE locks that are caused by maintaining connection availability. At the same time, the unlocking command is encrypted to obtain the unlocking command ciphertext, which can ensure the security of unlocking.

[0126] The motor drive module, in response to the unlocking operation, issues an unlocking drive operation command;

[0127] A locking / unlocking mechanism is used to perform an unlocking action under the control of the unlocking drive operation command.

[0128] The motor drive module is responsible for driving the mechanical parts of the smart lock to perform locking or unlocking operations. In response to the unlocking command from the main controller, the motor drive module issues an unlocking drive command to control the locking / unlocking mechanism. The locking / unlocking mechanism is the mechanical part of the smart lock, responsible for the actual locking and unlocking operations. In response to the unlocking drive command from the motor drive module, the locking / unlocking mechanism performs the corresponding mechanical action to unlock or lock the smart lock.

[0129] The technical solution of this invention involves detecting NFC tag scanning behavior via the NFC module when the smart lock activation is detected, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock, and determining the ciphertext of the unlock command based on the first device information in the NFC tag content; wherein the first device information includes a target application identifier, a smart lock identifier, and a first random number; enabling Bluetooth scanning via the Bluetooth module; receiving and decrypting the ciphertext of the unlock command sent by the mobile terminal via the Bluetooth module to obtain the plaintext of the unlock command; performing the unlock operation according to the plaintext of the unlock command; broadcasting the unlock success information to the mobile terminal via Bluetooth via the Bluetooth module; disabling Bluetooth scanning; and regenerating the first random number for the next unlock. The above technical solution, upon sensing the energy field of an external card reader at the NFC front end, wakes the BLE module from sleep mode via a hardware interrupt, putting it into a brief, task-oriented active state to execute a designated broadcast scanning task. This completely avoids the huge standby power consumption of traditional Bluetooth BLE locks in maintaining connection availability. Furthermore, unlocking the smart lock via Bluetooth broadcast improves the unlocking speed. Simultaneously, encrypting the unlocking command to obtain the ciphertext ensures the security of unlocking.

[0130] Figure 4 This is a schematic diagram of a smart lock unlocking device according to an embodiment of the present invention. This embodiment is applicable to unlocking smart locks on various electronic devices, such as vehicles, access control devices, and cardless identity authentication systems like those in hotels, apartments, and other access control systems. The smart lock unlocking device can be implemented in hardware and / or software. This device can be configured in the electronic device performing the smart lock unlocking function, such as a mobile terminal, specifically a mobile phone. Optionally, the mobile terminal may be equipped with an NFC card reader and an application. Figure 4 As shown, the device includes:

[0131] The device information acquisition module 410 is used to read the NFC tag of the smart lock through an NFC card reader to obtain the first device information of the smart lock; wherein, the first device information includes a target application identifier, a smart lock identifier, and a first random number;

[0132] The application launch module 420 is used to launch the application in response to the target application identifier in the first device information of the smart lock;

[0133] The key seed determination module 430 is used to perform a hash operation on the first random number, the activated digital certificate and the smart lock identifier through the application to obtain the first key seed;

[0134] The decryption content determination module 440 is used to determine the decryption content based on the first device information through the application program;

[0135] The unlock instruction ciphertext determination module 450 is used to encrypt the decrypted content according to the first key seed through the application to obtain the unlock instruction ciphertext;

[0136] The unlock command ciphertext sending module 460 is used to send unlock command ciphertext to the smart lock via Bluetooth broadcast through an application, so that the smart lock can scan, receive and decrypt the unlock command ciphertext sent by the mobile terminal to perform the unlocking operation.

[0137] The technical solution provided by this invention reads the NFC tag of a smart lock using an NFC reader to obtain the first device information of the smart lock; responding to the target application identifier in the first device information of the smart lock, the application is launched; the application performs a hash operation on a first random number, the activated digital certificate, and the smart lock identifier to obtain a first key seed; the application determines the decryption content based on the first device information; the application encrypts the decryption content based on the first key seed to obtain an unlock command ciphertext; the application broadcasts the unlock command ciphertext to the smart lock via Bluetooth, so that the smart lock scans, receives, and decrypts the unlock command ciphertext sent by the mobile terminal to perform the unlocking operation. This technical solution, by using NFC triggering and Bluetooth broadcasting to unlock the smart lock, can achieve unlocking without requiring user biometric information (such as fingerprints, facial recognition, etc.) or cards, relying solely on the user's mobile terminal; simultaneously, encrypting the unlocking content ensures the security of the unlocking process.

[0138] Optionally, an activation module is also included for:

[0139] In response to the detection of the NFC tag of the smart lock, the second device information of the smart lock is obtained; wherein, the second device information includes the target application identifier, the smart lock identifier, and a second random number;

[0140] Send a device activation request to the cloud so that the cloud can bind the smart lock to the target account and generate activation information; the activation information includes the smart lock's virtual identifier and digital certificate.

[0141] Perform a hash operation on the second random number and the smart lock identifier to obtain the second key seed;

[0142] The activation information is encrypted using a second key seed to obtain the ciphertext of the activation information;

[0143] The activation information is transmitted in encrypted form via Bluetooth broadcast to the smart lock so that the smart lock can be activated based on the encrypted activation information.

[0144] After receiving the activation success message from the smart lock, the smart lock activation is complete.

[0145] Optionally, the device includes a Bluetooth channel establishment module for:

[0146] In response to the detection of the NFC tag of the smart lock, after obtaining the first device information of the smart lock, the device establishes a Bluetooth connection with the smart lock based on the MAC information in the first device information and establishes a Bluetooth channel.

[0147] Send encrypted unlocking commands to the smart lock via Bluetooth.

[0148] The unlocking device for the smart lock provided in this embodiment of the invention can execute the unlocking method for the smart lock provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.

[0149] Figure 5 An architecture diagram of a smart lock unlocking system provided according to an embodiment of the present invention is shown. Figure 5 As shown, the system includes:

[0150] The smart lock 510 is used to execute the unlocking method of the smart lock provided in any embodiment of the present invention;

[0151] Mobile terminal 520 is used to execute the unlocking method of the smart lock provided in any embodiment of the present invention.

[0152] Specifically, such as Figure 6The diagram illustrates an unlocking interaction for a smart lock, where the mobile terminal is a mobile app. The smart lock's BLE module generates a random number and sends it to the smart lock's NFC module. The mobile app reads a card via NFC, requesting the app package name, device ID (smart lock identifier), and the random number. Upon detecting the card reading, the smart lock's NFC module notifies the BLE module of the NFC card reading event, and the BLE module initiates Bluetooth Beacon scanning. The mobile app performs a hash operation on the random number and the smart lock identifier (login_key) to generate a key seed beacon key. Simultaneously, the smart lock's BLE module performs a hash operation on the random number and the smart lock identifier (login_key) to generate the key seed beacon key. Next, the plaintext unlock command is encrypted using the key seed to obtain the ciphertext unlock command (beacon ciphertext), which is then broadcast via BLE beacon. The smart lock's BLE module obtains the ciphertext unlock command via Bluetooth scanning, decrypts it using the beacon key, and restores the plaintext unlock command. The application layer determines whether the plaintext unlock command has unlocking permissions; if so, the lock is unlocked. The smart lock's BLE module returns unlock information to the mobile app via beacon commands, stops beacon broadcasting and scanning, invalidates the current random number, generates a new random number, and waits for the next card reading.

[0153] like Figure 7 The diagram illustrates an activation interaction for a smart lock. Smart lock activation (referred to as device activation) is also known as network configuration. Network configuration is achieved through interaction between the device, a mobile terminal (such as a client), and the cloud. Specifically, the client touches the device's NFC module to obtain device information (secondary device information), and the device initiates beacon scanning. The client determines the decryption content based on the device information and sends a device activation request to the cloud. Correspondingly, the cloud returns activation information to the client. The client assembles and encrypts the activation information to obtain ciphertext, and sends a beacon containing the ciphertext to the device. The device decrypts the information and updates its device information; that is, it decrypts the ciphertext to obtain plaintext activation information. The device registers the smart lock using the plaintext activation information and then replies to the client that activation is successful. The client then stops sending activation beacons.

[0154] like Figure 8The diagram illustrates an unlocking interaction for a smart lock. The smart lock (referred to as the device) and the mobile terminal (e.g., a client) are shown. Specifically, the client touches the device's NFC module to obtain device information (first device information), and the device initiates beacon scanning. The client determines the decryption content based on the first device information, assembles the unlock command, encrypts it, and sends it as ciphertext (i.e., encrypts the decryption content using a first key seed) to obtain the ciphertext unlock command. The client then sends a beacon containing the ciphertext unlock command to the device. The device decrypts its information and updates its serial number (SN), i.e., decrypts the ciphertext unlock command to obtain the plaintext unlock command, and then replies to the client that unlocking was successful. The client then stops sending unlock Bluetooth broadcasts.

[0155] like Figure 9 The diagram illustrates an interaction between unlocking and connecting a smart lock. The smart lock (referred to as the device) and the mobile terminal (e.g., a client) are shown. Specifically, the client touches the device's NFC module to obtain device information (first device information). Based on the MAC address in the device information, it begins scanning for a specified MAC address. If the device is found, a GATT connection can be established. The device initiates beacon scanning. The client determines the decryption content based on the first device information; assembles the unlock command, encrypts it, and sends it, i.e., encrypts the decryption content according to the first key seed to obtain the ciphertext unlock command. Based on the connection, the client sends the ciphertext unlock command and the beacon. The device decrypts the information, updates the serial number (SN), i.e., decrypts the ciphertext unlock command to obtain the plaintext unlock command, and then replies with a success message (or successful unlock) based on the connection, unlocking successfully via Bluetooth broadcast. The client stops sending, i.e., it stops sending Bluetooth beacons.

[0156] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.

[0157] Figure 10 This is a schematic diagram of the structure of an electronic device that implements the unlocking method of the smart lock according to an embodiment of the present invention. Figure 10 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0158] like Figure 10As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0159] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0160] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the unlocking method of a smart lock.

[0161] In some embodiments, the unlocking method of the smart lock may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the unlocking method of the smart lock described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the unlocking method of the smart lock by any other suitable means (e.g., by means of firmware).

[0162] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0163] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0164] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0165] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0166] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0167] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0168] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0169] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for unlocking a smart lock, characterized in that, Applied to a smart lock, the smart lock including an NFC module and a Bluetooth module, the method includes: Upon detecting that the smart lock has been activated, the NFC module detects the NFC tag scanning behavior, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock and determine the unlock command ciphertext based on the first device information in the NFC tag content; wherein, the first device information includes the target application identifier, the smart lock identifier, and a first random number; Bluetooth scanning is initiated via the Bluetooth module; The Bluetooth module scans, receives, and decrypts the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command. Perform the unlocking operation according to the plaintext of the unlocking command; The Bluetooth module sends a successful unlock message to the mobile terminal via Bluetooth broadcast, disables Bluetooth scanning, and regenerates a first random number for the next unlock attempt.

2. The method according to claim 1, characterized in that, The Bluetooth module scans, receives, and decrypts the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command, including: The first key seed is obtained by performing a hash operation on the first random number, the activated digital certificate, and the smart lock identifier using the Bluetooth module. The ciphertext of the unlocking instruction is decrypted using the first key seed to obtain the plaintext of the unlocking instruction.

3. The method according to claim 1, characterized in that, Perform the unlocking operation according to the plaintext of the unlocking command, including: A security verification is performed based on the sequence number in the plaintext of the unlock command to obtain the security verification result. Based on the user permissions or user identity information in the plaintext of the unlock command, the permission verification result is obtained. If both the security verification result and the permission verification result are successful, the unlocking operation is performed.

4. The method according to claim 1, characterized in that, The smart lock activation has been detected, including: The NFC module detects NFC tag scanning behavior, enabling the NFC reader of the mobile terminal to read the NFC tag content of the smart lock; wherein, the NFC tag content includes second device information of the smart lock; the second device information includes a target application identifier, a smart lock identifier, and a second random number; Enable Bluetooth scanning via the Bluetooth module; The second key seed is obtained by performing a hash operation on the second random number and the smart lock identifier using the Bluetooth module. The system scans and receives ciphertext activation information sent by a mobile terminal via Bluetooth module, and decrypts the ciphertext activation information using the second key seed to obtain plaintext activation information; the plaintext activation information includes the smart lock virtual identifier and digital certificate. The smart lock is registered using the activation information in plaintext via Bluetooth module, and activation success information is sent back to the mobile terminal via Bluetooth broadcast to complete the smart lock activation. Turn off Bluetooth scanning.

5. The method according to claim 1, characterized in that, The NFC module supports NFC card reading but not NFC card writing.

6. The method according to claim 1, characterized in that, Also includes: After a set number of consecutive failed unlock attempts, the smart lock is automatically locked for a set duration. During the lock period, the first device information in the NFC module is cleared; After the set lock duration is reached, the information of the first device will be automatically restored.

7. The method according to claim 1, characterized in that, After the NFC module detects the NFC tag scanning behavior, it also includes: After recognizing the establishment of a Bluetooth channel between the smart lock and the mobile terminal, the system obtains the ciphertext of the unlock command from the mobile terminal through the Bluetooth channel and sends the ciphertext of the unlock command and the unlock success information to the mobile terminal.

8. A method for unlocking a smart lock, characterized in that, Applied to a mobile terminal equipped with an NFC card reader and an application, the method includes: The NFC reader reads the NFC tag of the smart lock to obtain the first device information of the smart lock; wherein, the first device information includes a target application identifier, a smart lock identifier, and a first random number; In response to the target application identifier in the first device information of the smart lock, the application is launched; The application performs a hash operation on the first random number and the smart lock identifier to obtain the first key seed; The application determines the decrypted content based on the first device information; The application encrypts the decrypted content according to the first key seed to obtain the unlock command ciphertext; The application sends the encrypted unlock command to the smart lock via Bluetooth broadcast, so that the smart lock can scan, receive, and decrypt the encrypted unlock command sent by the mobile terminal to perform the unlocking operation.

9. The method according to claim 8, characterized in that, Also includes: In response to the detection of the NFC tag of the smart lock, the second device information of the smart lock is obtained; wherein, the second device information includes the target application identifier, the smart lock identifier, and a second random number; A device activation request is sent to the cloud so that the cloud binds the smart lock to the target account based on the device activation request and generates activation information; wherein, the activation information includes a smart lock virtual identifier and a digital certificate; A hash operation is performed on the second random number and the smart lock identifier to obtain the second key seed; The activation information is encrypted using the second key seed to obtain the ciphertext of the activation information; The activation information ciphertext is sent to the smart lock via Bluetooth broadcast, so that the smart lock is activated according to the activation information ciphertext; After receiving the activation success message from the smart lock, the activation of the smart lock is completed.

10. The method according to claim 8, characterized in that, In response to detecting the NFC tag of the smart lock and obtaining the first device information of the smart lock, the system also includes: Based on the MAC information in the first device information, a Bluetooth connection is established with the smart lock to create a Bluetooth channel; The encrypted unlocking command is sent to the smart lock via the Bluetooth channel.

11. A smart lock, characterized in that, include: The NFC module is used to receive a first random number or a second random number sent by the Bluetooth module, store the device information of the smart lock, and detect the NFC tag scanning behavior of the mobile terminal. The Bluetooth module is used to scan, receive, and decrypt the ciphertext of the unlock command sent by the mobile terminal to obtain the plaintext of the unlock command, and send the unlock success information to the mobile terminal via Bluetooth broadcast, turn off Bluetooth scanning, and regenerate the first random number for the next unlock; The main controller is used to receive the unlock command plaintext sent by the Bluetooth module and perform the unlock operation according to the unlock command plaintext.

12. The smart lock according to claim 11, characterized in that, Also includes: The motor drive module, in response to the unlocking operation, issues an unlocking drive operation command; A locking / unlocking mechanism is used to perform an unlocking action under the control of the unlocking drive operation command.

13. An unlocking system for a smart lock, characterized in that, include: A smart lock for performing the method as described in any one of claims 1-7; A mobile terminal for performing the method as described in any one of claims 8-10.

14. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the unlocking method of the smart lock according to any one of claims 1-10.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the unlocking method of the smart lock according to any one of claims 1-10.

16. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the unlocking method of the smart lock according to any one of claims 1-10.