Intelligent door lock control method and device, intelligent door lock and readable storage medium

CN117975608BActive Publication Date: 2026-10-16TP-LINK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410199532.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-22
Publication Date
2026-10-16
Estimated Expiration
2044-02-22

AI Technical Summary

Technical Problem

如果智能门锁在长期离线状态下的本地系统时间误差较大,将导致一次性密码失效,降低开锁成功率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117975608B_ABST
    Figure CN117975608B_ABST
Patent Text Reader

Abstract

The application provides a smart door lock control method and device, a smart door lock and a readable storage medium; and relates to the technical field of smart locks. The method comprises the following steps: acquiring a one-time password input by a user, the one-time password comprising a time synchronization field and a first password field; updating a local system time according to the time synchronization field and generating a second password field based on the updated local system time; verifying the second password field and the first password field, and controlling the smart door lock according to a verification result; wherein the first password field is generated by a cloud based on an actual system time. According to the embodiment, the smart door lock updates the local system time based on the time synchronization field in the one-time password input by the user, which can reduce the problem that the one-time password is invalid in a long-time offline state of the smart door lock, and thus improves the lock opening success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart lock technology, and in particular to a smart door lock control method, device, smart door lock, and readable storage medium. Background Technology

[0002] Currently, smart locks can be unlocked offline using a one-time password. This one-time password is generated by the cloud based on the actual system time and sent to the user via wireless communication. After receiving the password, the user enters it into the smart lock. The smart lock then generates a corresponding one-time password based on its local system time and compares it with the entered password to unlock the door. If the local system time of the smart lock is significantly off for an extended period, the one-time password will become invalid, reducing the success rate of unlocking. Summary of the Invention

[0003] According to various embodiments of this application, a smart door lock control method, device, smart door lock, and readable storage medium are provided, which can improve the success rate of unlocking.

[0004] In a first aspect, this application provides a control method for a smart door lock, the method comprising: obtaining a one-time password input by a user, the one-time password including a time synchronization field and a first password field; updating the local system time according to the time synchronization field and generating a second password field based on the updated local system time; verifying the second password field with the first password field, and controlling the smart door lock according to the verification result; wherein, the first password field is generated by the cloud based on the actual system time.

[0005] Using the above method, the smart lock updates its local system time based on the time synchronization field in the one-time password entered by the user. A second password field is then generated based on the updated local system time. This second password field is then compared with the first password field in the entered one-time password to unlock the door. This reduces the probability of the one-time password becoming invalid due to large time errors in the local system caused by prolonged offline operation. For scenarios where the smart lock is offline for extended periods or unable to connect to the internet, this method improves the success rate of unlocking the smart lock. It also offers strong ease of use and practicality.

[0006] In one possible implementation of the first aspect, the one-time password further includes a start determination field; after obtaining the one-time password input by the user, the method further includes:

[0007] It is determined whether the starting judgment field conforms to the preset starting judgment code setting, the setting of the starting judgment code is used to determine whether to start the process of controlling the smart door lock based on the one-time password.

[0008] In one possible implementation of the first aspect, before generating the second password field based on the updated local system time, the method further includes:

[0009] Compare the current updated local system time with the adjacent last updated local system time to determine whether the current updated local system time is a time point after the last updated local system time.

[0010] In one possible implementation of the first aspect, before generating the second password field based on the updated local system time, the method further includes:

[0011] Calculate the time difference between the updated local system time and the local system time before the update, and determine whether the time difference is within a preset first time difference threshold.

[0012] In one possible implementation of the first aspect, after generating the second password field based on the updated local system time, the method further includes:

[0013] Determine whether the second password field is a previously used password;

[0014] If the second password field is not a previously used password, then the second password field is verified against the first password field;

[0015] If the second password field is a previously used password, then the verification of the first password field in this round ends.

[0016] In one possible implementation of the first aspect, generating the second password field based on the updated local system time includes:

[0017] Based on a preset key and encryption algorithm, the updated local system time is encrypted to obtain the second password field.

[0018] In one possible implementation of the first aspect, updating the local system time according to the time synchronization field includes:

[0019] Based on the preset time interval and the encoding rules corresponding to each time unit, the time synchronization field is updated to the local system time.

[0020] In one possible implementation of the first aspect, after obtaining the one-time password entered by the user, the method further includes:

[0021] If the initial judgment field meets the preset initial judgment code setting, then it continues to determine whether the local system time is synchronized with the actual system time provided by the network time server within a preset time period from the current time; if time synchronization has been performed within the preset time period, then a second password field is generated based on the synchronized local system time, and the second password field is used to verify the first password field; if time synchronization has not been performed within the preset time period, then the process of controlling the smart door lock based on the one-time password is started.

[0022] Secondly, this application provides an intelligent door lock control device, comprising:

[0023] The acquisition unit is used to acquire a one-time password input by the user, the one-time password including a time synchronization field and a first password field;

[0024] The processing unit is configured to update the local system time according to the time synchronization field and generate a second password field based on the updated local system time;

[0025] The verification unit is used to verify the second password field with the first password field and control the smart door lock according to the verification result; wherein, the first password field is generated by the cloud based on the actual system time.

[0026] Thirdly, this application provides a smart lock, the smart lock including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program 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 method described in any one of the first aspects.

[0027] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any one of the first aspects.

[0028] Fifthly, this application provides a computer program product that, when run on a server, causes the server to perform the method described in any one of the first aspects above.

[0029] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

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

[0031] Figure 1 This is a schematic diagram of the application scenario architecture of the smart door lock control method provided in the embodiments of this application;

[0032] Figure 2 A flowchart illustrating the smart door lock control method provided in an embodiment of this application;

[0033] Figure 3 A schematic diagram of a one-time password field provided in an embodiment of this application;

[0034] Figure 4 A schematic diagram illustrating the overall flow of the smart door lock control method provided in the embodiments of this application;

[0035] Figure 5 This is a schematic diagram of the structure of the intelligent door lock control device provided in the embodiments of this application;

[0036] Figure 6 A schematic diagram of the structure of a smart door lock is provided for an embodiment of this application. Detailed Implementation

[0037] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0039] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0040] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0041] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0042] A One-Time Password (OTP) is a password on a smart lock that can only be used once and has a validity period of only one time. OTP is a system that uses time synchronization technology, employing a one-time password generated based on three variables: time, event, and key, instead of a traditional static password. Each smart lock has a unique key, which is also stored on the server. During each authentication, the smart lock and the server calculate a dynamic authentication password using the same key, the same time parameters, and the same algorithm, thus ensuring password consistency and achieving user authentication.

[0043] Currently, one-time password unlocking on smart locks generally requires an internet connection and cannot be used offline; furthermore, authentication fails when the lock's timestamp is inaccurate. However, when the lock is completely offline (router / gateway powered off, or the lock's wireless connection is damaged / disabled), the one-time password unlocking process can proceed as follows: the cloud generates a one-time password based on the accurate system time, key, and encryption algorithm; the lock owner forwards the generated one-time password to the user via wireless communication (WeChat, SMS, etc.); the user enters the cloud-generated one-time password on the lock; then, the smart lock calculates its local one-time password based on the lock's local system time, the same key, and the same encryption algorithm, and cross-verifies this with the user-entered cloud-based one-time password. Successful verification in offline mode unlocks the lock.

[0044] However, when a smart lock is offline for extended periods, the local system time on the lock device will drift due to component errors in the Real-Time Clock (RTC) module (such as crystal frequency offset and load capacitor accuracy). Furthermore, the inability to connect to the network for extended periods to synchronize and correct the local system time using the Network Time Protocol (NTP) causes the local system time deviation to accumulate and the error to become increasingly larger. For example, a 5-second shift per day could result in a 10-minute shift over four months. Also, if the minimum granularity of a smart lock's one-time password time interval is 15 minutes, meaning the password changes four times per hour, the gradual accumulation of time deviation will cause the one-time password to become invalid, thus reducing the success rate of unlocking with the one-time password and impacting the user experience.

[0045] This application addresses the aforementioned problems by proposing a smart lock control method. This method can convert and correct the system time based on the input one-time password when the smart lock is offline for extended periods or unable to connect to the internet. Then, it generates a password to be verified based on the converted system time for unlocking authentication, thereby improving the unlocking success rate and optimizing the user experience of the smart lock.

[0046] The following section will first introduce the application scenario architecture corresponding to this smart door lock control method.

[0047] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the application scenario architecture of the smart door lock control method provided in the embodiments of this application. For example... Figure 1 As shown, the cloud stores the same preset key and the same encryption algorithm. The first password field is generated based on the accurate system time and the same key and the same encryption algorithm. Combined with the start judgment field and the time synchronization field, the final one-time password is generated and sent to the door lock owner. The door lock owner sends the one-time password to the user through wireless or other communication methods, or the cloud directly sends the generated one-time password to the user. There are no specific restrictions on the specific method by which the user obtains the one-time password.

[0048] Accordingly, the smart lock obtains the start judgment field, time synchronization field, and first password field of the one-time password entered by the user in sequence; by judging the start judgment field, it determines the interaction process of the one-time password, and calculates the system time according to the time synchronization field; and uses the same key and encryption algorithm to encrypt and calculate the system time to generate the second password field local to the smart lock; the smart lock cross-validates the first password field and the second password field, and authenticates and unlocks the door based on the entered first password field.

[0049] This application embodiment can reduce the probability of a one-time password becoming invalid due to the accumulation of local system time deviation caused by the smart lock being completely offline. At the same time, by adding a start judgment field and a time synchronization field, it can improve the security of use and reduce the probability of accidental operation.

[0050] Please see Figure 2 , Figure 2 This is a flowchart illustrating the smart door lock control method provided in an embodiment of this application. Figure 2 As shown, the execution entity of this method can be Figure 1 The smart lock described herein supports unlocking functionality based on one-time password authentication in offline mode. For example... Figure 2 As shown, the method may include the following steps:

[0051] S201, Obtain the one-time password entered by the user. The one-time password includes a time synchronization field and a first password field.

[0052] In this embodiment of the application, after the smart door lock is woken up, it receives a one-time password input by the user. The one-time password can be generated and distributed by the cloud. The cloud calculates based on the actual system time, generates a first password field, and adds the actual system time to the one-time password.

[0053] For example, the cloud generates a first password field based on the actual system time, using a preset key and encryption algorithm identical to that of the smart lock. The encryption algorithm can be a time-based one-time password algorithm, which calculates the hash value of the system time to obtain the first password field, such as using the HMAC-SHA1 algorithm.

[0054] For example, the time synchronization field is a field converted from the actual system time in the cloud, obtained by encoding each time unit according to rules. For instance, the month and day are encoded based on the number of days in a year, while the hour and minute are encoded based on the order of the day. In practical applications, there may be some discrepancy between the password entered by the user and the actual time obtained by the smart lock. Therefore, when encoding based on the hour and minute, a certain time interval can be set, such as 20 minutes as a unit, and the hour and minute are sorted and encoded, that is, every 20 minutes is considered a interval for sorting.

[0055] The time synchronization field is a string of codes containing real time information, calculated by the cloud based on accurate actual system time. The preset encoding rules for the time synchronization field are as follows: extract the last two digits of the year as the first two digits of the time synchronization field; sort the month and day information according to the number of days in a year, and write numbers ranging from 001 to 366 as the middle three digits of the time synchronization field; sort the hour and minute information according to the time of day in 20-minute units (the time of password input may deviate from the actual system time generating the one-time password, so a 20-minute unit is set, meaning the password generated within a 20-minute unit can be the same or from other time periods), and write numbers ranging from 01 to 72 as the last two digits of the time synchronization field. For example, 12:13 PM on January 4, 2024, is equivalent to generating 2400437. When the smart lock receives user input, if the time synchronization field exceeds the specified numerical range, it automatically exits the one-time password verification process and prompts the user to re-enter the password. The above encoding rules can simultaneously perform encryption operations such as addition, subtraction, multiplication, and division on the three parts of the time synchronization field to increase complexity; the specific encoding rules are not specifically limited. For example, the final one-time password generated by the cloud can be 000 (starting judgment field) 2400437 (time synchronization field) 147258 (first password field).

[0056] In some embodiments, the one-time password further includes a start determination field, and after obtaining the one-time password entered by the user, the method further includes:

[0057] It determines whether the starting judgment field meets the preset starting judgment code setting. The starting judgment code setting is used to determine whether to start the process of controlling the smart door lock based on a one-time password.

[0058] like Figure 3 As shown, the one-time password may include a first password field generated by the cloud based on the system time, as well as an added start judgment field and a time synchronization field; the time synchronization field is calculated by the cloud based on the accurate actual system time.

[0059] For example, the smart lock can locally store a preset start-up check code, or set a format requirement for the start-up check code. When the start-up check field in the one-time password entered by the user is the same as the preset start-up check code, or meets the format requirement of the start-up check code, the one-time password interaction process is initiated. This includes, for example, converting the system time based on the time synchronization field, and updating the local system time of the smart lock based on the converted system time. For instance, the start-up check code can be set to 000. When the received start-up check field is 000, which is the same as the start-up check code, the time synchronization field is then identified.

[0060] For example, the initial judgment field is used to judge the interaction process of the one-time password, the time synchronization field is used to update the local system time of the smart lock, and the first password field is the password content actually used for unlocking authentication. For example, if the initial judgment code of the one-time password interaction process is set to 000, then when the user enters the one-time password, the content of the first three fields is judged to see if it conforms to the preset initial judgment code 000. If it does, the one-time password interaction process is entered; the subsequent fields are then recognized. If the time synchronization field is set to be a 7-digit field, then after recognizing the first three initial judgment fields, the content of the subsequent 7 digits of the time synchronization field is judged to see if it conforms to the conversion rules between the system time and the time synchronization field.

[0061] Accordingly, when the starting judgment field does not conform to the preset starting judgment code setting, the normal password interaction process is entered; when the starting judgment field conforms to the preset starting judgment code setting, the one-time password interaction process is entered to identify and judge the time synchronization field; when the time synchronization field does not conform to the preset time synchronization field encoding rules, the normal password interaction process is entered.

[0062] In some embodiments, the smart lock can identify a user's one-time password during the input process. For example, after receiving the first few initial judgment fields, if they match a preset initial judgment code, the subsequent fields can be determined to be time synchronization fields. After receiving and identifying the subsequent few time synchronization fields, if they match a preset encoding rule for time synchronization fields, the last few fields can be determined to be the first password field calculated based on the system time. Alternatively, the smart lock can identify all fields sequentially after receiving the user's complete input. The smart lock does not specify the exact identification process for the one-time password.

[0063] It should be noted that the aforementioned starting judgment code can be a set of numbers preset in the smart lock, used to compare the content of the starting judgment field entered by the user; the number of digits in the starting judgment code, time synchronization field, and first password field are only illustrative examples, and can be set to other digits or formats based on the needs of actual application scenarios; for example, it can also be English characters of other lengths. Since the smart lock can recognize and judge during the user's input process or after the input is completed, if an input error occurs during the user's input of the one-time password or if there are incorrect characters after the received complete one-time password, an input error prompt will be issued, requiring the user to re-enter everything.

[0064] S202, based on the time synchronization field, update the local system time and generate the second password field based on the updated local system time.

[0065] In this embodiment, the smart lock identifies the interaction process of a one-time password by recognizing the initial judgment field; by recognizing the time synchronization field, it calculates the actual system time when the first password field is generated based on the encoding rules of the time synchronization field, and updates the local system time of the smart lock based on the calculated system time; based on the updated local system time, it generates the local second password field using the same key and encryption algorithm.

[0066] For example, the smart lock locally stores the same key and encryption algorithm as the cloud. By converting the time synchronization field, the actual system time at which the one-time password was generated by the cloud is obtained. Based on the actual system time, the same key and encryption algorithm as the cloud are used to generate a second password field locally on the smart lock. This second password field corresponds to the first password field and is used to authenticate and verify the first password field.

[0067] For example, after the smart lock calculates the actual system time when the first password field is generated in the cloud based on the time synchronization field, it can update the local system time, modify the local system time to the calculated actual system time, reduce the deviation of the smart lock's local system time, and reduce the probability of one-time password failure.

[0068] In some embodiments, to ensure the irreversibility of the local system time, the method further includes the following steps before generating the second password field based on the updated local system time:

[0069] Compare the current updated local system time with the adjacent last updated local system time to determine whether the current updated local system time is a time point after the last updated local system time.

[0070] For example, for security reasons, to prevent one-time passwords from remaining unused for too long, the updated local system time corresponding to the time synchronization field cannot be reversed. For instance, if a smart lock has already synchronized its local system time to 10:00 AM today using a one-time password based on the time synchronization field, then a one-time password generated at 9:00 AM will automatically become invalid and cannot be used. Only one-time passwords generated based on a later actual system time will be verified, and once the local system time is updated, any unused one-time passwords generated based on an earlier actual system time will automatically become invalid. In other words, if the current updated local system time is before the last updated local system time, the current one-time password is invalid; only if the current updated local system time is after the last updated local system time can the current one-time password proceed to the next verification process.

[0071] In some embodiments, to prevent a one-time password from remaining unused for an extended period, the method further includes the following before generating a second password field based on the updated local system time:

[0072] Calculate the time difference between the updated local system time and the local system time before the update, and determine whether the time difference is within the preset first time difference threshold.

[0073] For example, since there may be a certain deviation between the time when a user uses a one-time password and the actual system time when the one-time password was generated, such as when a user uses a one-time password before or after the actual system time, a time deviation limit is set between the actual system time and the user's actual usage time. For example, if the one-time password is used one day before or after the actual system time when it was generated, or half a day before or after, the one-time password is valid. If the time deviation limit is exceeded, the one-time password is invalid. The time deviation limit can be set based on actual application requirements.

[0074] For example, the actual system time corresponding to the time synchronization field in the one-time password received by the smart lock should not differ too much from the original local system time of the smart lock. For example, the upper limit of the deviation (first time difference threshold) can be set to 1 day, half a day, or several hours. If the actual system time after the conversion of the newly received time synchronization field deviates from the local system time by several months or even several years, then the one-time password is invalid. This can prevent one-time passwords that have not been used for a long time from still retaining unlocking privileges and improve the security of password use.

[0075] For example, since an upper limit for the time deviation, namely the first time difference threshold, is set for the validity of the one-time password, updating the local system time of the smart lock based on the converted actual system time can increase the probability that the calculated time deviation falls within the first time difference threshold, reduce the probability that the one-time password will become invalid due to the accumulation of local system time errors, and increase the success rate of unlocking the door with the one-time password in the future.

[0076] In some embodiments, a second password field is generated based on the updated local system time, including:

[0077] Based on a preset key and encryption algorithm, the updated local system time is encrypted to obtain the second password field.

[0078] For example, the smart door lock uses the same key and encryption algorithm on the local machine and in the cloud to perform encrypted calculations on the updated local system time to obtain a second password field on the local machine. Based on the second password field, it performs authentication and verification on the first password field in the received one-time password.

[0079] In some embodiments, updating the local system time based on a time synchronization field includes:

[0080] Based on the preset time interval and the encoding rules corresponding to each time unit, the time synchronization field is converted into the actual system time when the one-time password is generated; the local system time of the smart lock is updated according to the actual system time.

[0081] For example, based on the encoding rules of the preset time synchronization field, reverse processing is performed to calculate the actual system time when the one-time password is generated in the cloud. The local system time of the smart door lock is then updated based on the actual system time, thereby reducing the time deviation caused by the long-term accumulation of errors in the local system time.

[0082] In some embodiments, to ensure the one-time validity of the one-time password, after generating the second password field based on the updated local system time, the method further includes:

[0083] Determine if the second password field is a previously used password; if the second password field is not a previously used password, then verify the second password field against the first password field; if the second password field is a previously used password, then end the current round of verification of the first password field.

[0084] For example, after calculating the second password field based on the updated local system time, the smart lock compares it with the passwords used in the history. If the second password field has been used in the history, the current one-time password interaction process ends, and the verification process of the first password field ends; that is, after the one-time password has been verified once, it becomes permanently invalid and cannot be reused.

[0085] In some embodiments, for online scenarios of smart locks, time synchronization with a network time server (NTP server) is performed periodically. That is, the smart lock obtains the actual system time from the NTP time server and synchronizes and corrects the local system time according to the actual system time.

[0086] Accordingly, after obtaining the one-time password entered by the user, the method also includes:

[0087] If the initial judgment field matches the preset initial judgment code, then it continues to determine whether the local system time is synchronized with the actual system time provided by the network time server within a preset time period from the current time. If the time synchronization has been performed within the preset time period, a second password field is generated based on the synchronized local system time. The second password field is used to verify the first password field. If the time synchronization has not been performed within the preset time period, the process of controlling the smart door lock based on a one-time password is initiated.

[0088] For example, during each verification of a one-time password, after receiving the initial judgment code of the one-time password, the smart lock can further confirm whether it has been synchronized with NTP time (the actual system time provided by the NTP server) within a recent preset time period. For example, if the preset time period is 30 days, and NTP time has been synchronized within 30 days, the time synchronization field in the received one-time password will no longer be effective, and the local system time after NTP time synchronization will be used, thereby reducing the probability of the local system time being frequently changed. If NTP time has not been synchronized for more than 30 days, the process of controlling the smart lock based on the one-time password will continue, and the time synchronization field in the one-time password will be effective.

[0089] The above method ensures the validity of one-time passwords in both online and offline states of the smart lock. Furthermore, based on a time synchronization mechanism within a preset time period, synchronization can minimize the error between a clearly erroneous local system time and the actual system time (e.g., the absolute values ​​of minutes and hours may be inaccurate, but the date can still be adjusted to the current accurate value), thus improving the accuracy of the local system time.

[0090] For example, after generating the second password field based on the local system time after time synchronization, it is still necessary to determine whether the second password field is a previously used password. Initiating the process of controlling the smart lock based on a one-time password involves continuing to update the local system time based on the time synchronization field in the one-time password, and then generating the second password field based on the updated local system time.

[0091] For example, the above-mentioned preset time period setting is only illustrative, and the specific setting method or basis is not limited. It can be set according to the system configuration of the smart lock or the actual application scenario, such as setting it based on the deviation of the RTC module. For example, the value of the preset time period can also be set based on the average deviation of multiple types of system configurations. Assuming that in offline state, all types of system configurations correspond to an average deviation of 10 seconds per day, then after 120 days the deviation will be more than 20 minutes, and the original one-time password will become invalid. Therefore, the value of the preset time period can be set to 120 days.

[0092] S203, verify the second password field with the first password field, and control the smart door lock according to the verification result.

[0093] In this embodiment, the second password field is compared horizontally with the first password field generated in the cloud to authenticate and confirm whether to unlock. For example, if the horizontal comparison is consistent, the verification is successful and the smart lock is opened; if the horizontal comparison is inconsistent, the verification fails, the smart lock fails to unlock, and an unlocking failure message, an invalid password message, or an incorrect password message is issued.

[0094] like Figure 4 As shown in the schematic diagram of the overall process of the smart door lock control method provided in this application embodiment, based on the same implementation principle as the above embodiment, it will not be repeated here. The overall process of the method may include the following steps:

[0095] S41, the smart lock is activated and receives a one-time password entered by the user.

[0096] S42, check if the first n starting fields meet the preset starting judgment code; if yes, execute S43; if no, execute S44.

[0097] S43, whether NTP time synchronization has been performed within the preset time period; if yes, then execute S45; if no, then execute S46.

[0098] S44, proceed to the normal password interaction process.

[0099] S45 generates a second password field based on the local system time after time synchronization.

[0100] S46, enter the one-time password interaction process.

[0101] S47. Does the time synchronization field of the first n bits followed by the last m bits conform to the preset time synchronization field format? If yes, then execute S48; if no, then execute S44.

[0102] S48. Is the time of the current time synchronization field after the time of the last time the time synchronization field was entered? If yes, then execute S49; if no, then execute S413.

[0103] S49. Is the deviation between the current time synchronization field and the local system time within the first time difference threshold? If yes, then execute S410; otherwise, then execute S413.

[0104] S410, calculate the corresponding x-bit second password field based on the time synchronization field.

[0105] S411, Is the second password field a previously used password? If yes, then execute S413; otherwise, then execute S412.

[0106] S412, authentication unlocking.

[0107] S413, Abandon this password verification.

[0108] Through the embodiments of this application, the smart lock updates its local system time based on the time synchronization field in the one-time password entered by the user, generates a second password field based on the updated local system time, and verifies the second password field with the first password field in the entered one-time password to unlock. The local system time of the smart lock can be corrected according to the converted actual system time, reducing the probability of one-time password failure due to local system time deviation. For scenarios where the smart lock is offline for extended periods or unable to connect to the network, the updated local system time can improve the success rate of unlocking the smart lock even in a completely offline state. By adding a start judgment field and a time synchronization field, the security of one-time password usage is improved, reducing the probability of accidental operation. By limiting the usable time range (upper limit of time deviation), the one-time use limitation of the password, and the limitation of the irreversibility of the local system time, the security risks of long-unused one-time passwords still retaining permissions are reduced. Based on the above rules and limitations set in the one-time password interaction process, vulnerabilities in some usage scenarios are resolved.

[0109] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0110] Corresponding to the smart door lock control method provided in the above embodiments, Figure 5 A schematic diagram of the structure of the smart door lock control device provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0111] Reference Figure 5 The device includes:

[0112] The acquisition unit 51 is used to acquire a one-time password input by the user, the one-time password including a time synchronization field and a first password field;

[0113] Processing unit 52 is used to update the local system time according to the time synchronization field and generate a second password field based on the updated local system time;

[0114] The verification unit 53 is used to verify the second password field with the first password field and control the smart door lock according to the verification result; wherein, the first password field is generated by the cloud based on the actual system time.

[0115] In one possible implementation, the acquisition unit 51 is further configured to determine whether the starting judgment field conforms to the preset starting judgment code setting, wherein the starting judgment code setting is used to determine whether to start the process of controlling the smart door lock based on the one-time password.

[0116] In one possible implementation, the processing unit 52 is further configured to compare the current updated local system time with the adjacent previous updated local system time, and determine whether the current updated local system time is a time point after the previous updated local system time.

[0117] In one possible implementation, the processing unit 52 is further configured to calculate the time deviation between the current updated local system time and the local system time before the update, and determine whether the time deviation is within a preset first time difference threshold.

[0118] In one possible implementation, the processing unit 52 is further configured to determine whether the second password field is a previously used password; if the second password field is not a previously used password, then the second password field is verified against the first password field; if the second password field is a previously used password, then the verification of the first password field in this round ends.

[0119] In one possible implementation, the processing unit 52 is further configured to encrypt the updated local system time based on a preset key and an encryption algorithm to obtain the second password field.

[0120] In one possible implementation, the processing unit 52 is further configured to update the time synchronization field to the local system time based on a preset time interval and the encoding rules corresponding to each time unit.

[0121] In one possible implementation, the processing unit 52 is further configured to, if the initial judgment field conforms to the preset initial judgment code setting, continue to determine whether the local system time is synchronized with the actual system time provided by the network time server within a preset time period from the current time; if the time synchronization has been performed within the preset time period, generate a second password field based on the synchronized local system time, and use the second password field to verify the first password field; if the time synchronization has not been performed within the preset time period, initiate the process of controlling the smart door lock based on a one-time password.

[0122] Through the embodiments of this application, the smart lock updates its local system time based on the time synchronization field in the one-time password entered by the user, generates a second password field based on the updated local system time, and verifies the second password field with the first password field in the entered one-time password to unlock. The local system time of the smart lock can be corrected according to the converted actual system time, reducing the probability of one-time password failure due to local system time deviation. For scenarios where the smart lock is offline for extended periods or unable to connect to the network, the updated local system time can improve the success rate of unlocking the smart lock even in a completely offline state. By adding a start judgment field and a time synchronization field, the security of one-time password usage is improved, reducing the probability of accidental operation. By limiting the usable time range (upper limit of time deviation), the one-time use limitation of the password, and the limitation of the irreversibility of the local system time, the security risks of one-time passwords that have not been used for too long retaining permissions are reduced.

[0123] Figure 6 A schematic diagram of the hardware structure of the smart door lock 6 is shown.

[0124] like Figure 6 As shown, the smart door lock 6 of this embodiment includes: at least one processor 60 ( Figure 6 (Only one is shown in the image), a memory 61, which stores a computer program 62 that can run on the processor 60. When the processor 60 executes the computer program 62, it implements the steps in the above method embodiments, for example... Figure 2 S201 to S203 are shown. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of each module / unit in the above-described device embodiments.

[0125] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the smart lock 6. In other embodiments of this application, the smart lock 6 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0126] The smart lock 6 may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will understand that... Figure 6 This is merely an example of smart lock 6 and does not constitute a limitation on smart lock 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, the server may also include input sending devices, network access devices, buses, etc.

[0127] The processor 60 mentioned above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0128] The processor 60 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 60 is a cache memory. This memory can store instructions or data that the processor 60 has just used or that are used repeatedly. If the processor 60 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 60, and thus improves the efficiency of the system.

[0129] In some embodiments, the aforementioned memory 61 can be an internal storage unit of the smart lock 6, such as a hard drive or memory of the smart lock 6. The memory 61 can also be an external storage device of the smart lock 6, such as a plug-in hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the smart lock 6. Furthermore, the memory 61 can include both internal storage units and external storage devices of the smart lock 6. The memory 61 is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. The memory 61 can also be used to temporarily store data that has been sent or will be sent.

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

[0131] It should be noted that the above server structure is only illustrative. Depending on the application scenario, other entity structures may also be included. No limitation is made on the entity structure of the server here.

[0132] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0133] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0134] This application provides a computer program product that, when run on a server, enables the server to execute the steps described in the various method embodiments above.

[0135] If the integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0136] The device, smart lock, computer storage medium, and computer program product provided in the embodiments of this application are all used to execute the methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects corresponding to the methods provided above, and will not be repeated here.

[0137] It should be understood that the above description is merely to help those skilled in the art better understand the embodiments of this application, and is not intended to limit the scope of the embodiments of this application. Based on the examples given above, those skilled in the art can obviously make various equivalent modifications or changes. For example, some steps in the various embodiments of the above detection method may be unnecessary, or new steps may be added. Alternatively, any combination of two or more of the above embodiments may be used. Such modifications, changes, or combinations also fall within the scope of the embodiments of this application.

[0138] It should also be understood that the methods, situations, categories, and classifications of embodiments in this application are for the convenience of description only and should not constitute a special limitation. Various methods, categories, situations, and features in embodiments can be combined without contradiction.

[0139] It should also be understood that, in the various embodiments of this application, unless otherwise specified or in case of logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced by each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships.

[0140] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

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

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

[0143] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

[0144] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A control method for an intelligent door lock, characterized in that, The method includes: Obtain the one-time password input by the user. The one-time password includes a time synchronization field and a first password field. The time synchronization field is a field converted by the cloud based on the actual system time used to generate the first password field, and is obtained by encoding each time unit according to rules. Based on the time synchronization field, update the local system time and generate a second password field based on the updated local system time; The second password field is verified against the first password field, and the smart lock is controlled based on the verification result; The first password field is generated by the cloud based on the actual system time.

2. The method according to claim 1, characterized in that, The one-time password also includes a start-up judgment field; after obtaining the one-time password entered by the user, the method further includes: It is determined whether the starting judgment field conforms to the preset starting judgment code setting, the setting of the starting judgment code is used to determine whether to start the process of controlling the smart door lock based on the one-time password.

3. The method according to claim 1, characterized in that, Before generating the second password field based on the updated local system time, the method further includes: Compare the current updated local system time with the adjacent last updated local system time to determine whether the current updated local system time is a time point after the last updated local system time.

4. The method according to any one of claims 1 to 3, characterized in that, Before generating the second password field based on the updated local system time, the method further includes: Calculate the time difference between the updated local system time and the local system time before the update, and determine whether the time difference is within a preset first time difference threshold.

5. The method according to claim 1, characterized in that, After generating the second password field based on the updated local system time, the method further includes: Determine whether the second password field is a previously used password; If the second password field is not a previously used password, then the second password field is verified against the first password field; If the second password field is a previously used password, then the verification of the first password field in this round ends.

6. The method according to any one of claims 1 to 3 and 5, characterized in that, The generation of the second password field based on the updated local system time includes: Based on a preset key and encryption algorithm, the updated local system time is encrypted to obtain the second password field.

7. The method according to claim 1, characterized in that, The step of updating the local system time according to the time synchronization field includes: Based on the preset time interval and the encoding rules corresponding to each time unit, the time synchronization field is converted into the actual system time when the one-time password is generated; Update the local system time of the smart lock according to the actual system time.

8. The method according to claim 2, characterized in that, After obtaining the one-time password entered by the user, the method further includes: If the starting judgment field meets the preset starting judgment code setting, then continue to judge whether the local system time is synchronized based on the actual system time provided by the network time server within a preset time period from the current time. If time synchronization occurs within the preset time period, the second password field is generated based on the local system time after time synchronization, and the second password field is used to verify the first password field. If time synchronization is not achieved within the preset time period, the process of controlling the smart lock based on the one-time password will be initiated.

9. A control device for an intelligent door lock, characterized in that, include: The acquisition unit is used to acquire a one-time password input by the user. The one-time password includes a time synchronization field and a first password field. The time synchronization field is a field converted by the cloud based on the actual system time that generated the first password field, and is obtained by encoding each time unit according to rules. The processing unit is configured to update the local system time according to the time synchronization field and generate a second password field based on the updated local system time; The verification unit is used to verify the second password field with the first password field and control the smart door lock according to the verification result; wherein, the first password field is generated by the cloud based on the actual system time.

10. A smart door lock, characterized in that, The smart lock includes at least one processor and a memory communicatively connected to the at least one processor; The memory stores a computer program that is executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for generating dynamic password of intelligent lock and intelligent lock system

    CN111612945A

  • Verification method and generation method of offline password and intelligent door lock

    CN115714675A