A method for controlling a smart lock and a method for generating control information of a smart lock
By using the encryption algorithm in the smart lock to compare the strings in the control information, the self-check and unlocking actions of the smart lock are realized, which solves the problems of complex operations affecting efficiency and irreversible mode switching in the existing technology, and improves production and maintenance. efficiency.
Patent Information
- Application Number
- CN202011256667.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-11
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-11-11
AI Technical Summary
In the existing technology, smart locks require complex passwords or combination operations during the self-checking process, which affects production efficiency, and the self-checking mode and the user mode are irreversible, increasing the difficulty of maintenance.
By reading the pre-stored control information from the control device, an encryption algorithm is used to generate a third string and a second string for comparison. If they are consistent, the self-test mode is entered. If they are inconsistent, a fifth string is generated for unlocking. Achieve convenient switching between self-test and user mode.
There is no need to enter complex passwords or perform complicated operations to control the smart lock to enter self-check mode, which improves production efficiency and simplifies the maintenance and repair process of smart locks.
Smart Images

Figure CN114495325B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart locks, and in particular to a smart lock control method and a smart lock control information generating method. Background Art
[0002] After the assembly and production of the smart lock is completed, a production line test is required before shipment. During the production line test, the smart lock performs a self-inspection to determine whether each component and function meets the quality requirements. In the prior art, complex passwords or combination operations are often set to make the smart lock enter the self-inspection mode and start self-inspection, which affects production efficiency.
[0003] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The present invention provides a control method for a smart lock and a control information generation method for a smart lock, aiming to solve the problem in the prior art that complex combination operations are used to make the smart lock perform self-check, affecting production efficiency.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0006] A control method for a smart lock, wherein the method comprises:
[0007] Reading control information from a control device, the control information comprising a first character string and a second character string;
[0008] Generate a third character string based on the first character string using a first encryption algorithm;
[0009] If the second character string is consistent with the third character string, the smart lock self-check is performed.
[0010] The control method of the smart lock, wherein the step of generating a third character string according to the first character string by a first encryption algorithm comprises:
[0011] Get the preset fourth character string;
[0012] The third character string is obtained by performing the first encryption algorithm operation on the first character string and the fourth character string.
[0013] The control method of the smart lock, wherein after the third character string is generated according to the first character string by a first encryption algorithm, the method further comprises:
[0014] If the second character string is inconsistent with the third character string, generating a fifth character string according to the first character string by using a second encryption algorithm;
[0015] If the second character string is consistent with the fifth character string, an unlocking action is performed.
[0016] A method for generating control information of a smart lock, wherein the method comprises:
[0017] Reading a first character string from a preset device;
[0018] A second character string is generated according to the first character string through a first encryption algorithm.
[0019] The control information generation method of the smart lock, wherein the second character string is generated according to the first character string through a first encryption algorithm, comprises:
[0020] Get the preset fourth character string;
[0021] The second character string is generated by performing the first encryption algorithm operation on the fourth character string and the first character string.
[0022] The control information generating method for the smart lock, wherein, after generating the second character string according to the first character string, the method further comprises:
[0023] The second character string is written into the preset device.
[0024] A smart lock, wherein the smart lock includes: a processor, a storage medium communicatively connected to the processor, the storage medium is suitable for storing multiple instructions, and the processor is suitable for calling the instructions in the storage medium to execute the steps of implementing the control method of the above-mentioned smart lock.
[0025] A terminal, wherein the terminal includes: a processor, a storage medium communicatively connected to the processor, the storage medium is suitable for storing multiple instructions, and the processor is suitable for calling the instructions in the storage medium to execute the steps of the control information generation method for implementing the above-mentioned smart lock.
[0026] A computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned smart lock control method and / or the steps of the smart lock control information generation method.
[0027] Beneficial effect: Compared with the prior art, the present invention provides a method for controlling a smart lock and a method for generating control information for a smart lock. The present invention reads the control information pre-stored in the control device, generates a third character string through a first encryption algorithm from the first character string in the control information, and determines whether to enter the door lock self-check by verifying whether the third character string is consistent with the second character string in the control information. This can achieve the goal of controlling the smart lock to enter self-check by only placing the control device close to the smart lock, without having to enter a complex password or perform complex combination operations, thereby improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flow chart of an embodiment of a method for controlling a smart lock provided by the present invention;
[0029] Figure 2 It is a production and testing flow chart of smart locks in the prior art;
[0030] Figure 3 A logic block diagram of an embodiment of a control method for a smart lock provided by the present invention;
[0031] Figure 4 A flowchart of an embodiment of a method for generating control information for a smart lock provided by the present invention;
[0032] Figure 5 A logic block diagram of an embodiment of a method for generating control information for a smart lock provided by the present invention;
[0033] Figure 6 A schematic diagram of the structure of an embodiment of the smart lock provided by the present invention;
[0034] Figure 7 A structural principle diagram of an embodiment of a terminal provided by the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0036] Embodiment 1
[0037] Please refer to Figure 1 , Figure 1 This is a flow chart of an embodiment of the control method of the smart lock provided by the present invention. The control method of the smart lock provided in this embodiment can be executed by the smart lock.
[0038] like Figure 2As shown, in this field, taking the door lock as an example, after the assembly and production of the smart lock is completed, the production line personnel need to operate the door lock to enter the door lock production test mode, that is, to perform a self-test of the door lock. If the test fails, maintenance diagnosis is required to prevent defective products from leaving the factory. If the test passes, it will automatically switch to the user mode, thus ensuring that the user can use the door lock function normally after the door lock leaves the factory. In order to prevent the door lock from being accidentally triggered to enter the production test mode, entering the production test mode often requires entering a relatively complex password or performing a complex combination of operations. Obviously, this method of controlling the door lock to perform self-test may consume a lot of time and reduce production efficiency. Moreover, in the prior art, the door lock production test mode and the user mode are usually not switched at will, that is, after the test passes, it is irreversibly switched to the user mode. Then, during the user's use, if the door lock fails, the maintenance personnel cannot use the self-test mode to quickly diagnose the door lock hardware problem when troubleshooting the door lock, which increases the difficulty of later maintenance.
[0039] In view of the above problems, the smart lock control method provided in this embodiment can realize the self-check of the smart lock by controlling the smart lock through the control device without complicated passwords or combination operations. Specifically, the smart lock control method includes the steps of:
[0040] S110: Read control information from a control device, where the control information includes a first character string and a second character string.
[0041] The control device can be a contact or contactless short-range communication device, such as a magnetic card, an NFC tag, a device containing an NFC tag, etc. When the control device is close to or in contact with the smart lock, the smart lock can read control information from the control device. The control information includes a first string and a second string. The first string can be an identification character of the preset device, or it can be a serial number of the control device. For example, when the control device is a card, the first string can be the card number of the card, and the second string is a string pre-stored in the control device. When the control device is a device for controlling the smart lock to enter a self-test mode, the second string is generated according to the first string through a preset algorithm, which will be specifically described in Example 2.
[0042] After reading the control information, the control method of the smart lock provided in this embodiment further includes the steps of:
[0043] S120: Generate a third character string according to the first character string using a first encryption algorithm.
[0044] The first encryption algorithm is an algorithm pre-stored in the control device. The first encryption algorithm can be an existing encryption algorithm such as a DES algorithm, an RSA algorithm, etc., or an algorithm with a calculation formula defined by a developer, such as X=3*Y+A, where X is the encrypted data, Y is the data before encryption, and A is an encryption parameter. The third string is generated according to the first string through the first encryption algorithm, including:
[0045] S121, obtaining a preset fourth character string;
[0046] S122: Obtain the third character string by performing the first encryption algorithm operation on the first character string and the fourth character string.
[0047] The fourth character string is pre-stored in the smart lock. In actual production, different models of smart locks may be produced on different production lines. In order to prevent smart locks produced on different production lines from being tested on incorrect production lines, the fourth character string can correspond to the production line of the smart lock, that is, different fourth character strings are set for smart locks of different production lines.
[0048] Please refer again Figure 1 The control method of the smart lock provided in this embodiment also includes the steps of:
[0049] S130: If the second character string is consistent with the third character string, perform a smart lock self-check.
[0050] If the second character string is consistent with the third character string, it means that the control device is a device for controlling the smart lock to perform self-check, then the smart lock enters the self-check mode to perform self-check.
[0051] Since the smart lock may support unlocking methods other than fingerprint unlocking and face recognition unlocking, in a possible implementation, if the second character string is inconsistent with the third character string, determining whether the control device is an unlocking device is specifically implemented by determining whether the control information is unlocking information, including:
[0052] S141. If the second character string is inconsistent with the third character string, generate a fifth character string according to the first character string by using a second encryption algorithm;
[0053] S142: If the second character string is consistent with the fifth character string, an unlocking action is performed.
[0054] Specifically, the principle of the smart lock to realize unlocking by an unlocking device such as unlocking by swiping a card is as follows: pre-set an encryption algorithm for unlocking, and determine whether the string generated by the first string through the preset encryption algorithm is consistent with the second string by reading the first string and the second string in the unlocking device. In this embodiment, if the second string and the third string are inconsistent, it means that the control device is not a device for controlling the smart lock to perform self-test. At this time, it is determined whether the control device is an unlocking device, specifically, the encryption algorithm (second encryption algorithm) used for unlocking in the smart lock is used to calculate the first string to obtain a fifth string. If the fifth string is consistent with the second string, it means that the control device is an unlocking device. In this way, it is possible to achieve convenient switching between the self-test mode and the user's normal use mode without other operations. It is not difficult to see from the above description that in actual applications, the production test personnel can approach or contact the smart lock on the production line through the preset device, so that the smart lock performs self-test, which improves the operating efficiency of the production test personnel, or, further, directly set the preset device on the production line, and the smart lock passes through or contacts the preset device when moving on the production line for self-test, so as to realize automated production test and save labor. After the smart lock leaves the factory, if the smart lock malfunctions while the user is using the smart lock, the maintenance personnel only need to bring the control device used to control the smart lock to enter the self-test mode close to or touch the smart lock to make the smart lock enter the self-test mode, thereby diagnosing the smart lock hardware problems through the self-test mode, which facilitates the after-sales maintenance of the smart lock. Moreover, after the smart lock is repaired, the maintenance result can be conveniently confirmed through the unlocking device of the smart lock, avoiding the problem of irreversible entry into the user's normal use mode after the production test in the prior art, which increases the difficulty of subsequent maintenance.
[0055] The logic block diagram of the control method of the smart lock provided in this embodiment can be as follows: Figure 3 shown.
[0056] Embodiment 2
[0057] The present invention also provides a method for generating control information of a smart lock, please refer to Figure 4 , Figure 4 This is a flow chart of an embodiment of a method for generating control information for a smart lock provided by the present invention. The method for generating control information for a smart lock provided by this embodiment can be executed by a terminal, and the control method for the smart lock includes the following steps:
[0058] S210: Read a first character string from a preset device.
[0059] Specifically, the preset device may be a contact or contactless short-range communication device, such as a magnetic card, an NFC tag, a device including an NFC tag, etc. The first character string may be an identification character of the preset device, or may be a serial number of the preset device. For example, when the preset device is a card, the first character string may be a card number of the card. The first character string may be read by a reading device provided by the terminal, or may be read by a reading device connected by communication, or may be read by a reading device and stored in a storage medium readable by the terminal, and then read by the terminal.
[0060] In a possible implementation, the preset device may also store a sixth character string. When the first character string is read from the preset device, the sixth character string is also read from the preset device and it is determined whether the sixth character string is in a preset format. Specifically, the preset format is the format of the original password of the preset device corresponding to the first character string when the preset device is not written with the control information for controlling the self-check of the smart lock, such as "0XFFFFFFFF". When the sixth character string is in the preset format, it means that the preset device is in the original state and has not been set as a control device for controlling the self-check of the smart lock or a device for controlling other devices. The following steps can be performed. When the sixth character string is not in the preset format, it means that the preset device has been set as a control device for controlling the self-check of the smart lock or a device for controlling other devices. At this time, the next step is no longer executed and the process ends.
[0061] S220: Generate a second character string according to the first character string using a first encryption algorithm.
[0062] The first encryption algorithm is a pre-set algorithm, which may be an existing encryption algorithm such as the DES algorithm, the RSA algorithm, etc., or an algorithm with a calculation formula defined by the developer, for example, X=3*Y+A, where X is the encrypted data, Y is the data before encryption, and A is the encryption parameter. After obtaining the first character string, the terminal generates a second character string through the first encryption algorithm.
[0063] Specifically, generating a second character string according to the first character string through a first encryption algorithm includes:
[0064] S221, obtaining a preset fourth character string;
[0065] S222: Generate the second character string by performing a first encryption algorithm operation on the fourth character string and the first character string.
[0066] The fourth character string is a pre-set character string stored in the terminal. In actual production, different models of smart locks may be produced on different production lines. In order to prevent smart locks produced on different production lines from being tested on incorrect production lines, the fourth character string can correspond to the production line of the smart lock, that is, different fourth character strings are set for smart locks of different production lines to generate corresponding smart lock control information.
[0067] The first encryption algorithm and the fourth character string are both stored in the smart lock, so that after the smart lock reads the control information including the first character string and the second character string, it generates a new character string based on the first character string and the fourth character string through the first encryption algorithm operation, and compares the new character string with the second character string to determine whether the control information is used to control self-test. For details, please refer to the description in Example 1.
[0068] In order to facilitate the control of the smart lock to perform self-test, after generating the second character string, the control information generation method of the smart lock provided by this embodiment further includes the steps of:
[0069] S230: Write the second character string into the preset device.
[0070] After the second character string is written into the preset device, the smart lock can read the first character string and the second character string when reading the information in the preset device, thereby determining that the preset device is a device for controlling the self-check of the smart lock through the method provided in Example 1, and then performing the self-check to achieve the self-check control of the smart lock. When the second character string is written into the preset device, it can overwrite the sixth character string in the preset device, that is, the original password in the preset device is changed to the second character string. Then, when reading the preset device, the first character string and the second character string can be read.
[0071] After the second character string is written into the preset device, the preset device becomes a device capable of controlling the smart lock to perform self-test. Production test personnel can approach or touch the smart lock on the production line through the preset device to make the smart lock perform self-test, thereby improving the operating efficiency of production test personnel. Alternatively, further, the preset device can be directly set on the production line, and the smart lock can pass through or touch the preset device when moving on the production line to perform self-test, thereby saving labor. After the smart lock leaves the factory, if the smart lock fails during the user's use of the smart lock, the maintenance personnel only need to bring the control device used to control the smart lock to enter the self-test mode close to or touch the smart lock to make the smart lock enter the self-test mode, thereby diagnosing the hardware problem of the smart lock through the self-test mode, thereby facilitating after-sales maintenance of the smart lock.
[0072] The logic block diagram of the control information generation method of the smart lock provided in this embodiment can be as follows: Figure 5 shown.
[0073] To summarize, the present invention provides a control method for a smart lock and a method for generating control information for a smart lock. The control information pre-stored in the control device is read, and the first character string in the control information is used to generate a third character string through a first encryption algorithm. Whether to enter the door lock self-check is determined by verifying whether the third character string is consistent with the second character string in the control information. This can achieve the goal of controlling the smart lock to enter self-check by only moving the control device close to or in contact with the smart lock, without having to enter a complex password or perform complex combination operations. This shortens the production and testing time of the smart lock and improves production efficiency.
[0074] It should be understood that, although the various steps in the flowcharts given in the accompanying drawings of the present specification are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0075] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0076] Embodiment 3
[0077] Based on the above embodiments, the present invention also provides a smart lock, such as Figure 6 As shown, the smart lock includes a processor 10 and a memory 20. The memory 20 may be an internal storage unit of the smart lock in some embodiments, such as a hard disk or memory of the smart lock. The memory 20 may also be an external storage device of the smart lock in other embodiments, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the smart lock. Furthermore, the memory 20 may also include both an internal storage unit and an external storage device of the smart lock. The memory 20 is used to store application software and various types of data installed in the smart lock. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a smart lock control program 30 is stored on the memory 20, and the smart lock control program 30 can be executed by the processor 10, thereby realizing the control method of the smart lock in the present application.
[0078] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other chip, which is used to run the program code stored in the memory 20 or process data.
[0079] In one embodiment, the processor 10 may implement the following steps when executing the computer program:
[0080] Reading control information from a control device, the control information comprising a first character string and a second character string;
[0081] Generate a third character string based on the first character string using a first encryption algorithm;
[0082] If the second character string is consistent with the third character string, the smart lock self-check is performed.
[0083] The step of generating a third character string according to the first character string by using a first encryption algorithm includes:
[0084] Get the preset fourth character string;
[0085] The third character string is obtained by performing the first encryption algorithm operation on the first character string and the fourth character string.
[0086] After the third character string is generated according to the first character string by the first encryption algorithm, the method further includes:
[0087] If the second character string is inconsistent with the third character string, generating a fifth character string according to the first character string by using a second encryption algorithm;
[0088] If the second character string is consistent with the fifth character string, an unlocking action is performed.
[0089] Embodiment 3
[0090] Based on the above embodiments, the present invention also provides a terminal, such as Figure 7As shown, the terminal includes a processor 40 and a memory 50. The memory 50 may be an internal storage unit of the terminal in some embodiments, such as a hard disk or memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 50 may also include both an internal storage unit of the terminal and an external storage device. The memory 50 is used to store application software and various types of data installed on the terminal. The memory 50 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a control information generation program 60 for a smart lock is stored on the memory 50, and the control information generation program 60 for the smart lock can be executed by the processor 40, thereby realizing the control information generation method for the smart lock in the present application.
[0091] In some embodiments, the processor 40 may be a central processing unit (CPU), a microprocessor or other chip, which is used to run the program code stored in the memory 20 or process data.
[0092] In one embodiment, the processor 40 may implement the following steps when executing the computer program:
[0093] Reading a first character string from a preset device;
[0094] A second character string is generated according to the first character string through a first encryption algorithm.
[0095] The step of generating a second character string according to the first character string by using a first encryption algorithm includes:
[0096] Get the preset fourth character string;
[0097] The second character string is generated by performing the first encryption algorithm operation on the fourth character string and the first character string.
[0098] After generating the second character string according to the first character string, the method further includes:
[0099] The second character string is written into the preset device.
[0100] Embodiment 4
[0101] The present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the smart lock control method described in the above-mentioned embodiment 1 and / or the steps of the smart lock control information generation method described in embodiment 2.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A control method for a smart lock, characterized in that: The method comprises: Reading control information from a control device, the control information comprising a first character string and a second character string; Generate a third character string based on the first character string using a first encryption algorithm; If the second character string is consistent with the third character string, a smart lock self-check is performed; After the third character string is generated according to the first character string through the first encryption algorithm, the method further includes: If the second character string is inconsistent with the third character string, generating a fifth character string according to the first character string by using a second encryption algorithm; If the second character string is consistent with the fifth character string, an unlocking action is performed; The original password in the preset device is modified to the second character string. When the preset device is read, the first character string and the second character string are read. After the second character string is written into the preset device, the preset device controls the smart lock to perform self-check.
2. The control method of the smart lock according to claim 1, characterized in that: The step of generating a third character string according to the first character string by using a first encryption algorithm includes: Get the preset fourth character string; The third character string is obtained by performing the first encryption algorithm operation on the first character string and the fourth character string.
3. A method for generating control information of a smart lock, characterized in that: The control information includes a first character string and a second character string, and the method includes: Reading the first character string from a preset device; Generate the second character string according to the first character string through a first encryption algorithm; After the second character string is generated according to the first character string through a first encryption algorithm, the method further includes: Writing the second character string into the preset device; reading the control information from the control device; Generate a third character string based on the first character string using the first encryption algorithm; If the second character string is consistent with the third character string, a smart lock self-check is performed; If the second character string is inconsistent with the third character string, generating a fifth character string according to the first character string by using a second encryption algorithm; If the second character string is consistent with the fifth character string, an unlocking action is performed; The fourth character string is a pre-set character string stored in the terminal, and the fourth character string generates corresponding control information of the smart lock according to the corresponding production line.
4. The method for generating control information of a smart lock according to claim 3, characterized in that: The step of generating the second character string according to the first character string by using a first encryption algorithm includes: Get the preset fourth character string; The second character string is generated by performing the first encryption algorithm operation on the fourth character string and the first character string.
5. A smart lock, characterized in that: The smart lock includes: a processor, a storage medium communicatively connected to the processor, the storage medium being suitable for storing multiple instructions, and the processor being suitable for calling the instructions in the storage medium to execute the steps of the smart lock control method as described in any one of claims 1-2.
6. A terminal, characterized in that: The terminal includes: a processor, a storage medium communicatively connected to the processor, the storage medium being suitable for storing a plurality of instructions, and the processor being suitable for calling the instructions in the storage medium to execute the steps of the control information generation method for the smart lock as described in any one of claims 3-4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the smart lock control method as described in any one of claims 1-2 and / or the steps of the smart lock control information generation method as described in any one of claims 3-4.
