Unlocking method and generating method of door lock, door lock, equipment and program product

By embedding an encryption algorithm in a non-networked smart lock, and using a preset encryption algorithm and a random code to generate a verification password, the problem of non-networked locks being unable to grant temporary password authorization is solved, enabling offline temporary unlocking, reducing costs and improving security.

CN121725538APending Publication Date: 2026-03-24MIDEA INTELLIGENT LIGHTING & CONTROLS TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411329015.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Non-networked smart locks cannot authorize temporary passwords, resulting in higher costs.

Method used

The door lock incorporates a built-in encryption algorithm. It generates a verification password by receiving the input unlock code, and uses a preset encryption algorithm and a random code for verification to achieve temporary offline unlocking.

Benefits of technology

Temporary unlocking in offline mode reduces the cost of door locks and improves security and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121725538A_ABST
    Figure CN121725538A_ABST
Patent Text Reader

Abstract

The invention discloses a door lock unlocking method, a door lock generation method, a door lock, equipment and a program product. The method is applied to a door lock, the door lock is not networked, the method comprises the steps that an input unlocking code is received, the unlocking code comprises a random code and an initial password, and the initial password is generated based on a preset encryption algorithm and the random code; generating a verification password based on the random code and a built-in encryption algorithm; based on the verification password, the initial password is verified, and a verification result is obtained, and the verification result comprises verification passing and verification failure; and controlling the door lock to execute corresponding operation based on the verification result. Therefore, the door lock can be unlocked by using the temporary password in a non-networking state, and the cost of the door lock can be reduced on the premise of ensuring the unlocking safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of Internet of Things (IoT) technology, and in particular relates to a door lock unlocking method, an unlocking code generation method, a door lock, an electronic device, and a computer program product. Background Technology

[0002] Temporary door lock passwords are typically used for temporary door opening authorization. After use, the password becomes invalid, and most smart door locks support this function. Generally, temporary passwords are generated in the cloud and then sent to the door lock for local storage. Therefore, implementing this function usually requires the door lock to be connected to the internet. However, non-internet-connected locks cannot implement temporary password authorization, resulting in higher costs. Summary of the Invention

[0003] This application aims to at least solve one of the technical problems existing in the prior art. To this end, this application proposes a method for unlocking a door lock, a method for generating an unlock code, a door lock, an electronic device, a computer-readable storage medium, and a computer program product, which allows the door lock to be unlocked using a temporary password in a non-networked state.

[0004] Firstly, this application provides a method for unlocking a door lock, applied to a door lock that is not connected to the internet. The method includes receiving an input unlock code, the unlock code including a random code and an initial password, the initial password being generated based on a preset encryption algorithm and the random code; generating a verification password based on the random code and a built-in encryption algorithm; verifying the initial password based on the verification password and obtaining a verification result, the verification result including verification passed and verification failed; and controlling the door lock to perform corresponding operations based on the verification result.

[0005] Secondly, this application provides a method for generating an unlock code, which includes generating an unlock code based on a preset encryption algorithm and a random code, wherein the unlock code includes the random code and an initial password.

[0006] Thirdly, this application provides a door lock, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the door lock unlocking method described above.

[0007] Fourthly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method for generating an unlock code.

[0008] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-mentioned door lock unlocking method or unlock code generation method.

[0009] The door lock unlocking method, unlock code generation method, door lock, electronic device, computer-readable storage medium and computer program product provided in the embodiments of this application generate a temporary unlock code based on a preset encryption algorithm and a random code, and then the door lock processes the random code based on a built-in encryption algorithm to generate a verification password.

[0010] Because the built-in encryption algorithm matches the preset encryption algorithm, the verification password can be used to verify the initial password. For example, if the initial password for the unlock code is generated based on the preset encryption algorithm, the verification password generated based on the built-in encryption algorithm and the random code will definitely pass the verification when used to verify the initial password. However, if the initial password for the unlock code is not generated based on the preset encryption algorithm, the verification will fail.

[0011] Based on the verification results, the door lock can be unlocked or disabled accordingly. The door lock can be unlocked offline using a valid temporary unlock code. The door lock does not require a communication module (such as a WIFI module) for network connectivity, which reduces the cost of the door lock.

[0012] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description

[0013] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0014] Figure 1 This is an application scenario diagram of the door lock unlocking method and unlock code generation method provided in the embodiments of this application;

[0015] Figure 2 This is a schematic diagram of the first process of the door lock unlocking method provided in the embodiments of this application;

[0016] Figure 3 This is a schematic diagram of the second process of the door lock unlocking method provided in the embodiments of this application;

[0017] Figure 4 This is a flowchart illustrating the unlock code generation method provided in an embodiment of this application;

[0018] Figure 5 This is a schematic diagram of the module of the door lock unlocking device provided in the embodiments of this application;

[0019] Figure 6 This is a schematic diagram of the generation apparatus provided in the embodiments of this application;

[0020] Figure 7This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;

[0021] Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0022] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0023] To facilitate understanding, the technical background and application scenarios of this application will be introduced below:

[0024] With the development of IoT technology, the number of IoT devices in our lives has increased dramatically, and most of these devices require internet connectivity. For example, they may connect to a gateway (such as a router) in the home environment via Wi-Fi.

[0025] Taking smart door locks as an example, after a smart door lock is connected to a router via WIFI, it can remotely unlock and lock the door (prevent unlocking).

[0026] Currently, to address the low security of fixed password unlocking and improve the security of smart locks, many smart locks employ temporary unlock codes. These codes are temporary and can only be used once or within a preset timeframe. Once an unlock has been performed, or if the unlock code has exceeded its authorized time limit, the temporary unlock code becomes invalid. However, this function typically requires an internet connection, with the temporary unlock code being issued and verified in real-time via the cloud.

[0027] In practice, the user receives a temporary unlock code from the cloud and enters it into the smart lock. The smart lock verifies the code (or uploads the code to the cloud and receives the verification result), and then determines whether to unlock based on the verification result. Once the network connection is lost, the smart lock may be unable to unlock, resulting in poor stability. Furthermore, smart locks require a network module, which is costly.

[0028] The door lock unlocking method of this application can realize temporary unlock code verification offline. It only requires setting matching encryption algorithms on the device that generates the unlock code and the door lock. As long as the temporary unlock code is valid, temporary unlocking can be achieved, and the unlock code cannot be used again after it has been unlocked. While realizing temporary unlocking to ensure security, offline unlocking is achieved, saving the cost of setting up a network module.

[0029] Please see Figure 1 , Figure 1 This is an application scenario diagram of an unlocking method provided in an embodiment of this application. The application scenario provided in this application includes a door lock 103, a terminal device 101, and a server 102. The door lock unlocking method provided in this application can be implemented by the door lock 103, and the unlock code generation method can be executed by at least one of the terminal device 101 and the server 102.

[0030] Alternatively, the door lock can be a smart lock. A smart lock is a new type of door lock that combines traditional mechanical locks with modern information technology. Through network connectivity, electronic control, and intelligent identification technology, it realizes multiple functions such as remote control, access management, and alarm notification. Due to its convenience, security, and intelligent management features, smart locks have been widely used in various places such as homes, hotels, and offices in recent years.

[0031] Optionally, the smart lock can be equipped with a network module. When the smart lock is connected to the network, it can temporarily unlock itself by communicating with the server 102 (e.g., the server can send a temporary unlock code to the lock). When it is offline due to faults, network fluctuations, or other reasons, the unlocking method of this application can be executed.

[0032] Alternatively, the smart lock may not be equipped with a network module (such as a WIFI network module, cellular network module, etc.), and may only be unlocked according to the unlocking method of the lock described in this application.

[0033] The terminal devices may include, but are not limited to: smartphones (such as Android phones, iOS phones, etc.), tablets, laptops, desktop computers, smart speakers, smartwatches, portable personal computers, mobile internet devices (MIDs), smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable devices, etc., but this application does not limit them.

[0034] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This application does not limit this.

[0035] It should be noted that, Figure 1The number of terminal devices and servers is for illustrative purposes only; the number of terminal devices and servers can be more or less, and there is no limitation herein. Terminal devices and servers can be connected directly or indirectly via wired or wireless communication, and this application does not impose any limitations on this.

[0036] The unlocking method involved in this application can be implemented using cloud technology.

[0037] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.

[0038] Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.

[0039] The unlocking method in this application can be implemented based on cloud computing. Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, the resources in the "cloud" are infinitely scalable, readily available, on-demand, expandable, and pay-as-you-go.

[0040] As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices.

[0041] The unlock code generation method in this application embodiment can be executed by an electronic device, which can be at least one of a server and a terminal device. That is, the method can be executed by the server or the terminal device alone, or by both the server and the terminal device. Therefore, the executing entity of each step will not be described again below.

[0042] It should be noted that the examples below use the door lock to perform the door lock unlocking method and the server to perform the unlock code generation method as examples. Based on the understanding of the following, those skilled in the art can apply the unlock code generation method provided in the embodiments of this application to other types of scenarios (such as the terminal device performing the unlock code generation method, or the terminal device cooperating with the server to jointly perform the unlock code generation method).

[0043] Based on the above description of the relevant scenarios, this application provides an unlocking method, which will be described in detail below:

[0044] Please see Figure 2 This application provides a door lock unlocking method, which is applied to a door lock that is not connected to the network. The method is implemented by steps 011 to 014, and is described in detail below.

[0045] Step 011: Receive the input unlock code, which includes a random code and an initial password. The initial password is generated based on a preset encryption algorithm and the random code.

[0046] In this context, "door lock not connected to the network" means that the door lock is not connected to the cloud server through a gateway or other device. In other words, the door lock is offline and cannot communicate with the server.

[0047] The unlock code is a string of characters used to unlock the door lock. For example, the unlock code can be a purely numeric code, a purely alphanumeric code, or a mixture of numbers and letters. The following example uses a purely numeric code; the principles for other types of unlock codes are basically similar and will not be elaborated upon here.

[0048] Optionally, the unlock code includes a random code and an initial password.

[0049] The random code refers to a randomly generated character code, which can be randomly selected from a set of character codes. For example, for a 3-digit decimal code, the random code can be randomly selected from 000 to 999.

[0050] The initial password is generated by the server based on a preset encryption algorithm and a random number. This initial password, combined with the random code, serves as the unlock code, which is then entered into the door lock to unlock it.

[0051] The preset encryption algorithm is used to generate a password based on the input value. In other words, the preset encryption algorithm can be a mapping function between the input value and the output password. After processing the random code using the preset encryption algorithm, the initial password can be generated.

[0052] Optionally, the preset encryption algorithm can be a symmetric encryption algorithm or an asymmetric encryption algorithm.

[0053] Symmetric encryption algorithms use the same key to encrypt and decrypt information. This means that both the sender and receiver must possess the same key. The advantage of this type of algorithm is its speed, making it suitable for encrypting large amounts of data. Common symmetric encryption algorithms include:

[0054] DES (Data Encryption Standard): An older algorithm that is no longer considered secure and is no longer recommended for use.

[0055] 3DES (Triple DES): An improvement on DES, it enhances security by reusing DES three times.

[0056] AES (Advanced Encryption Standard): The most widely used symmetric encryption standard currently available, with key lengths of 128 bits, 192 bits, and 256 bits.

[0057] RC4 / RC5 / RC6: A series of stream cipher algorithms developed by RSA Labs. RC4 was once widely used, but is now considered to have security vulnerabilities.

[0058] Blowfish / Salsa20: Other symmetric encryption algorithms with good performance and security.

[0059] Asymmetric encryption algorithms use a pair of keys: a public key and a private key. The public key can be publicly released, while the private key must be kept secret. Information can be encrypted with the public key and decrypted only with the corresponding private key; conversely, the same applies. Asymmetric encryption is primarily used for key exchange, digital signatures, and authentication. Common asymmetric encryption algorithms include:

[0060] RSA (Rivest-Shamir-Adleman): The first practical asymmetric encryption algorithm, widely used in various security protocols.

[0061] DSA (Digital Signature Algorithm): Primarily used for digital signatures rather than encryption.

[0062] Diffie-Hellman (DH): A key exchange protocol that enables two parties to securely generate a shared key over an insecure channel.

[0063] EllipticCurve Cryptography (ECC): A highly efficient asymmetric encryption algorithm based on elliptic curve mathematics, particularly suitable for resource-constrained devices.

[0064] Specifically, after the server generates the unlock code, it can send the unlock code to the terminal device of the user who needs it. The user can view the unlock code on their terminal device or share it with friends. The user or a friend authorized to use the unlock code can then enter the unlock code into the door lock. The door lock obtains the entered unlock code based on the input operation received on the input panel.

[0065] Step 012: Generate a verification password based on the random code and the built-in encryption algorithm, and match the built-in encryption algorithm with the preset encryption algorithm.

[0066] The built-in encryption algorithm is an encryption algorithm that matches the preset encryption algorithm. For example, the built-in encryption algorithm can be exactly the same as the preset encryption algorithm. Alternatively, the built-in encryption algorithm and the preset encryption algorithm can be different, but the passwords generated by both based on the same input satisfy the preset conditions. For example, the preset conditions could be that the two passwords generated by the built-in encryption algorithm and the preset encryption algorithm based on the same random code satisfy a preset mapping relationship (such as the difference being a preset value, or the two passwords being two independent variables of a preset function).

[0067] Specifically, the door lock's built-in encryption algorithm can process random codes to generate a verification password for subsequent password verification. Furthermore, because the built-in encryption algorithm matches the preset encryption algorithm, the initial password in the unlock code generated based on the preset encryption algorithm will inevitably pass the verification password check, ensuring the validity of the temporary unlock code.

[0068] Step 013: Based on the verification password, verify the initial password and obtain the verification result, which includes verification passed and verification failed.

[0069] Specifically, since the preset encryption algorithm and the built-in encryption algorithm are matched, the verification password and the initial password are also matched. Therefore, the verification password can be used to verify the initial password to obtain the verification result, which includes verification passed or verification failed.

[0070] For example, if the built-in encryption algorithm is exactly the same as the preset encryption algorithm, the verification result is successful if the verification password is the same as the initial password; otherwise, the verification result is unsuccessful.

[0071] For example, if the built-in encryption algorithm is different from the preset encryption algorithm, but the passwords generated by both meet the preset conditions, then if the verification password and the initial password meet the preset conditions (i.e., the verification password and the initial password match), the verification result is "verification passed"; if the verification password and the initial password do not meet the preset conditions, the verification result is "verification failed".

[0072] In addition, for random codes that pass verification, since the random code has already been used, in order to achieve temporary unlocking and avoid the same unlocking code being used for multiple or permanent unlocking, the random code that passes verification can be set as an invalid random code and stored in the door lock. In this way, the invalid random code cannot generate a verification password again to unlock the door.

[0073] Optionally, determining a valid random code as an invalid random code can also involve determining a random code that has passed verification a preset number of times as an invalid random code. That is to say, after each random code passes verification, the door lock records the number of times that unlocking code has passed verification. Thus, the unlocking code corresponding to the random code can be used to unlock the door a preset number of times (such as once or more) before being determined as an invalid random code. This achieves more flexible temporary unlocking, making the random code not necessarily a one-time use.

[0074] Optionally, before generating a verification password based on the random code and the built-in encryption algorithm, the door lock stores the invalid random code. This allows for the recording of invalid random codes, facilitating subsequent validity checks on the random code in the currently entered unlock code based on the stored invalid random codes, thus ensuring that only the unlock code corresponding to a valid random code can unlock the door.

[0075] For example, a door lock can perform a fault detection on a stored random code to determine whether the random code is invalid. If the random code is invalid, unlocking the door is prohibited; if the random code is valid, the lock proceeds to generate a verification password based on the random code and a built-in encryption algorithm. In other words, the door lock will only generate a verification password based on the random code and the built-in encryption algorithm if the random code in the currently entered unlock code is valid; otherwise, it will directly prohibit unlocking, thus enabling temporary unlocking.

[0076] Optionally, in order to synchronize the server and the door lock and prevent the server from generating unlock codes that cannot be unlocked, after the server generates an unlock code, the server will also store the corresponding random code as an invalid random code. Thus, when generating an unlock code later, a random code other than the stored invalid random code will be generated to generate the unlock code, ensuring the unlocking validity of the unlock code.

[0077] Step 014: Based on the verification result, control the door lock to perform the corresponding operation.

[0078] Specifically, after obtaining the verification result, the door lock can be controlled to perform corresponding operations based on the verification result. For example, if the verification result is successful, the door lock can be unlocked; if the verification result is unsuccessful, unlocking the door lock can be prohibited.

[0079] The door lock unlocking method of this application generates a temporary unlocking code based on a preset encryption algorithm and a random code, and then the door lock processes the random code based on a built-in encryption algorithm to generate a verification password.

[0080] Because the built-in encryption algorithm matches the preset encryption algorithm, the verification password can be used to verify the initial password. For example, if the initial password for the unlock code is generated based on the preset encryption algorithm, the verification password generated based on the built-in encryption algorithm and the random code will definitely pass the verification when used to verify the initial password. However, if the initial password for the unlock code is not generated based on the preset encryption algorithm, the verification will fail.

[0081] Furthermore, the verified random code will be identified as an invalid random code, thereby enabling temporary unlocking and improving the security of unlocking the door lock.

[0082] Based on the verification results, the door lock can be unlocked or disabled accordingly. The door lock can be unlocked offline using a valid temporary unlock code. The door lock does not require a communication module (such as a WIFI module) for network connectivity, which reduces the cost of the door lock.

[0083] Please see Figure 3 In some embodiments, the unlocking method further includes steps 015 and 016, which are described in detail below.

[0084] Step 015: When the number of invalid random codes stored in the door lock reaches the preset limit, a prompt message is issued to prompt the user to change the encryption parameters. The encryption parameters are the values ​​used by the built-in encryption algorithm when encrypting. The same random code will generate different verification passwords after being processed by the built-in encryption algorithm with different encryption parameters.

[0085] Step 016: Upon receiving the input encryption parameters, update the built-in encryption algorithm based on the input encryption parameters and clear the invalid random code.

[0086] Specifically, due to size or cost limitations of door locks, the storage capacity of the set memory or the storage capacity used to store failure random codes is generally small. Therefore, in order to avoid the problem that the door lock cannot store new failure random codes when the random codes are not exhausted, and the subsequent unlocking codes cannot be determined as invalid, thus no longer meeting the requirements for temporary unlocking.

[0087] It is understandable that if the invalid random code is cleared directly, the unlock code corresponding to the invalid random code will be able to unlock again. If the invalid random code is not cleared, the unlock codes corresponding to random codes other than the stored invalid random codes will be able to unlock permanently.

[0088] Therefore, the unlocking method of this application issues a prompt message when the number of invalid random codes stored in the door lock reaches a preset upper limit, prompting the user to change the encryption parameters.

[0089] The encryption parameters can be character codes used as input to the encryption algorithm along with the random code, either from a built-in encryption algorithm or a preset encryption algorithm. By modifying the encryption parameters, even the same random code will generate different passwords after being processed by the encryption algorithm. Changing the encryption parameters can also be understood as a change in the mapping relationship corresponding to the encryption algorithm.

[0090] Therefore, by sending a prompt message to the user (e.g., the door lock can connect to the user's terminal device via Bluetooth to send a prompt message, or the door lock includes a speaker or indicator light to emit a prompt message), the user can then randomly input a new encryption parameter to be changed, allowing the door lock to update its built-in encryption algorithm based on the randomly input encryption parameter.

[0091] After the built-in encryption algorithm is updated, even if the invalid random code is cleared, if the unlock code corresponding to the previous invalid random code is entered again, it will fail the verification because the verification password and the initial password no longer match. Thus, while ensuring that there is always storage space to store invalid random codes, unlock codes that have already been verified cannot be used to unlock the device, achieving a balance between storage space cost and unlock security.

[0092] Similarly, after the door lock's built-in encryption algorithm is updated, the server's preset encryption algorithm also needs to be updated synchronously to ensure the effectiveness of unlocking. Therefore, the terminal device can act as an intermediary device, receiving the changed encryption parameters sent by the door lock or the encryption parameters manually entered by the user through the terminal device, and then uploading them to the server. The server then updates the preset encryption algorithm based on the changed encryption parameters and clears the stored invalid random codes, saving unnecessary storage overhead.

[0093] In this way, the server's updated preset encryption algorithm still matches the built-in encryption algorithm, ensuring the validity of the unlock code generated by the server.

[0094] In some embodiments, when the number of invalid random codes stored in the door lock reaches a preset upper limit, the number of bits of the received random code is increased or decreased, and the invalid random codes are cleared.

[0095] Specifically, by increasing or decreasing the number of bits in the random code, new unlock codes are generated based on random codes of different lengths, allowing for continued unlocking and resolving expired unlock codes to reduce storage usage. This expands the number of available unlock codes and minimizes the security issues arising from using duplicate unlock codes after all codes have been exhausted.

[0096] Similarly, when the number of stored invalid random codes reaches a preset limit, the electronic device will increase or decrease the number of bits in the received random code and clear the invalid random codes. Furthermore, the door lock and the electronic device use the same strategy to adjust the number of bits in the random code: both decrease by 1 bit and both increase by 1 bit, to ensure that the unlocking codes between the door lock and the electronic device are synchronized and that unlocking is effective.

[0097] Please see Figure 4 The unlock code generation method provided in this application embodiment is applied to electronic devices, and the generation method includes:

[0098] Step 021: Generate an unlock code based on a preset encryption algorithm and a random code. The unlock code includes a random code and an initial password. The unlock code is used to unlock the door lock. When the door lock receives the input unlock code, it generates a verification password based on the random code and the built-in encryption algorithm. The built-in encryption algorithm is matched with the preset encryption algorithm. Based on the verification password, the initial password is verified, and a verification result is obtained. The verification result includes verification passed and verification failed. Based on the verification result, the door lock is controlled to perform the corresponding operation.

[0099] The specific explanation of step 021 and the description of the unlock code generation method have been described in detail in the door lock unlocking method, and will not be repeated here.

[0100] Based on the method described in the above embodiments, this application also provides a door lock unlocking device 300 for performing the steps in the above door lock unlocking method. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of the door lock unlocking device 300 provided in an embodiment of this application. The door lock unlocking device 300 includes:

[0101] The receiving module 301 is used to receive the input unlock code, which includes a random code and an initial password. The initial password is generated based on a preset encryption algorithm and the random code.

[0102] The first generation module 302 is used to generate a verification password based on a random code and a built-in encryption algorithm, and to match the built-in encryption algorithm with a preset encryption algorithm.

[0103] The verification module 303 is used to verify the initial password based on the verification password and obtain the verification result, which includes verification passed and verification failed.

[0104] The control module 304 is used to control the door lock to perform corresponding operations based on the verification results.

[0105] It should be noted that the specific details of each module unit in the unlocking device 300 of the door lock have been described in detail in the embodiments of the unlocking method described above, and will not be repeated here.

[0106] Based on the method described in the above embodiments, this application also provides a generation apparatus 400 for performing the steps in the above-described unlock code generation method. Please refer to... Figure 6 , Figure 6 This is a schematic diagram of the structure of the generating apparatus 400 provided in an embodiment of this application. The generating apparatus 400 includes:

[0107] The second generation module 401 is used to generate an unlock code based on a preset encryption algorithm and a random code. The unlock code includes the random code and the initial password.

[0108] It should be noted that the specific details of each module unit in the above-mentioned generation device 400 have been described in detail in the embodiments of the above-mentioned unlock code generation method, and will not be repeated here.

[0109] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0110] In some embodiments, please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 500 includes a processor 501 and a memory 502. The memory 502 stores a computer program 503 that can run on the processor 501. When the program 503 is executed by the processor 501, it implements the various processes of the embodiments of the above-described functional limitation method and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0111] Please see Figure 8 , Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device can be a terminal or a server. Exemplarily, the electronic device 700 includes a central processing unit (CPU) 701, a system memory 704 including random access memory (RAM) 702 and read-only memory (ROM) 703, and a system bus 705 connecting the system memory 704 and the central processing unit 701.

[0112] In some embodiments, the electronic device 700 may also include a basic input / output system 706 that helps transmit information between various devices within the computer, and a mass storage device 707 for storing the operating system 713, the client 714, and other program modules 715.

[0113] In some embodiments, the basic input / output system 706 includes a display 708 for displaying information and an input device 709 for user input, such as a touch panel and other input devices. A touch panel is also called a touchscreen. A touch panel may include two parts: a touch function limiting device and a touch controller. Other input devices may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described further here.

[0114] Both the display 708 and the input device 709 are connected to the central processing unit 701 via an input / output controller 710 connected to the system bus 705. The basic input / output system 706 may also include the input / output controller 710 for receiving and processing input from touch panels, other input devices, etc. Similarly, the input / output system 706 also includes output devices such as displays, printers, or other types of output devices.

[0115] Mass storage device 707 is connected to central processing unit 701 via a mass storage controller (not shown) connected to system bus 705. Mass storage device 707 and its associated computer-readable media provide non-volatile storage for electronic device 700. That is, mass storage device 707 may include computer-readable media (not shown) such as hard disk or compact disc read-only memory (CD-ROM) drive.

[0116] According to various embodiments of this application, the electronic device 700 can also be connected to a remote computer on a network, such as the Internet. That is, the electronic device 700 can be connected to a network 717 via a network interface unit 716 connected to the system bus 705, or the network interface unit 716 can be used to connect to other types of networks or remote computer systems (not shown).

[0117] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described embodiments of the functional limitation method and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0118] The processor can be the processor in the electronic device described in the above embodiments. The computer-readable storage medium can be a computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0119] Computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types.

[0120] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described unlocking method. The processor may be a processor in the electronic device described above. When executed by a processor, the computer program implements various processes of the embodiments of the unlocking or generation method described above, and achieves the same technical effects; therefore, to avoid repetition, further details are omitted here.

[0121] It is understood that in the specific implementation of this application, data related to user identity or characteristics is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0122] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for unlocking a door lock, characterized in that, Applied to a door lock that is not connected to the network, the method includes: The system receives an input unlock code, which includes a random code and an initial password, wherein the initial password is generated based on a preset encryption algorithm and the random code. Based on the random code and the built-in encryption algorithm, a verification password is generated, wherein the built-in encryption algorithm is matched with the preset encryption algorithm. Based on the verification password, the initial password is verified, and a verification result is obtained, which includes verification passed and verification failed. Based on the verification result, the door lock is controlled to perform the corresponding operation.

2. The unlocking method according to claim 1, characterized in that, The step of verifying the initial password based on the verification password and obtaining the verification result includes: If the verification password and the initial password match, the verification result is determined to be successful. If the verification password and the initial password do not match, the verification result is determined to be a verification failure. Based on the verification result, controlling the door lock to perform corresponding operations includes: If the verification result is successful, the door lock is unlocked; If the verification result is that the verification fails, the door lock shall not be unlocked.

3. The unlocking method according to claim 1, characterized in that, Also includes: The random code that passes the verification is identified as an invalid random code and stored in the door lock.

4. The unlocking method according to claim 3, characterized in that, Before generating the verification password based on the random code and the built-in encryption algorithm, the method further includes: Based on the stored random code, a failure detection is performed on the random code to determine the failure detection result, which includes whether the random code is invalid. If the random code fails, the door lock cannot be unlocked; If the random code is not invalid, proceed to the step of generating a verification password based on the random code and the built-in encryption algorithm.

5. The unlocking method according to claim 3, characterized in that, Also includes: When the number of invalid random codes stored in the door lock reaches a preset limit, a prompt message is issued to prompt the replacement of encryption parameters. The encryption parameters are the values ​​used by the built-in encryption algorithm when encrypting. The same random code will generate different verification passwords after being processed by the built-in encryption algorithm with different encryption parameters. Upon receiving the input encryption parameters, the built-in encryption algorithm is updated based on the input encryption parameters, and the invalid random code is cleared.

6. The unlocking method according to claim 5, characterized in that, Also includes: The input encryption parameters are sent to the electronic device to update the preset encryption algorithm of the electronic device, which generates the unlock code based on the preset encryption algorithm and the random code.

7. The unlocking method according to claim 3, characterized in that, Also includes: If the number of invalid random codes stored in the door lock reaches a preset upper limit, the number of bits in the received random code is increased or decreased, and the invalid random codes are cleared.

8. A method for generating an unlock code, characterized in that, Applied to electronic devices, the method includes: An unlock code is generated based on a preset encryption algorithm and a random code. The unlock code includes the random code and an initial password. The unlock code is used to unlock the door lock. When the door lock receives the input unlock code, it generates a verification password based on the random code and a built-in encryption algorithm. The built-in encryption algorithm is matched with the preset encryption algorithm, and the initial password is verified based on the verification password to obtain a verification result. The verification result includes verification passed and verification failed. Based on the verification result, the door lock is controlled to perform the corresponding operation.

9. The generation method according to claim 8, characterized in that, Also includes: The random code in the generated unlock code is stored as an invalidation random code in the electronic device.

10. The generation method according to claim 9, characterized in that, The process of generating an unlock code based on a preset encryption algorithm and a random code includes: The unlock code is generated based on the preset encryption algorithm and a random code other than the stored invalid random code.

11. The generation method according to claim 9, characterized in that, The electronic device includes at least one of a terminal device and a server; Wherein, the terminal device is used to update the preset encryption algorithm based on the received encryption parameters and clear the invalid random code; and / or, the terminal device is used to upload the received encryption parameters to the server, so that the server updates the preset encryption algorithm based on the encryption parameters and clears the invalid random code.

12. A door lock, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the unlocking method of the door lock as described in any one of claims 1-7.

13. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the unlock code generation method as described in any one of claims 8-11.

14. A computer program product, characterized in that, It includes a computer program, which, when executed by a processor, implements the unlocking method of the door lock as described in any one of claims 1-7 or the unlocking code generation method as described in any one of claims 8-11.