Method and device for verifying and generating temporary password, and smart lock system
By analyzing the temporary password in the smart lock system and determining the unique target password for verification at the current time, the problem of low efficiency of temporary password verification in the prior art is solved, and temporary password verification with lower power consumption and higher security is achieved.
Patent Information
- Application Number
- CN202211071251.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-09-02
AI Technical Summary
The existing smart lock system is inefficient during the temporary password verification process, and multiple sets of target passwords are needed to be generated for comparison, resulting in high power consumption and poor security.
By analyzing the temporary password, obtaining the current count value, determining the unique target password based on the current time, and verifying it. There is no need to always connect to the server, reduce power consumption, and generate only one target password for comparison during one verification process.
It improves the efficiency of temporary password verification in the smart lock system, reduces power consumption, and avoids the reuse of temporary passwords, enhancing security.
Smart Images

Figure CN115497200B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home appliance technology, for example, to a method and device for verifying and generating temporary passwords, and a smart lock system. Background Art
[0002] At present, smart locks are widely used in hotels, apartments and homes due to their high security and convenience. As one of the ways to open a smart lock, a temporary password needs to be obtained by the smart lock through a real-time network connection server, resulting in high power consumption and poor security of the smart lock. In addition, when the smart lock is offline, the temporary password cannot be obtained through the network connection server, resulting in the user being unable to open the smart lock.
[0003] In the related technology, a method for offline verification of a temporary password includes: responding to a wake-up command, obtaining a lock key and a wake-up time, and generating several groups of target passwords corresponding to the lock validity period in combination with the lock key and the wake-up time; after receiving a temporary password generated by the cloud according to the cloud validity time, the temporary password is compared with several groups of target passwords to obtain a verification result.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:
[0005] This method can verify and generate temporary passwords by separating the cloud and the lock end, reducing the power consumption of the lock end. However, this method generates several sets of target passwords based on the wake-up time, the lock end key and the validity period, and verifies the temporary passwords. In one verification process, multiple sets of target passwords need to be generated and compared one by one for verification, resulting in low efficiency in temporary password verification. Summary of the invention
[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0007] The embodiments of the present disclosure provide a method and device for verifying and generating a temporary password, and a smart lock system to improve the efficiency of temporary password verification of the smart lock system.
[0008] In some embodiments, the method includes: when a temporary password is received, parsing the temporary password to obtain a current count value; obtaining the current time; determining a target password based on the current count value and the current time; and determining that the temporary password is successfully verified if the temporary password is the same as the target password.
[0009] Optionally, determining the target password based on the current count value and the current time includes: determining the current verification time period based on the current time; determining whether the temporary password has been used based on the current verification time period and the current count value; if the temporary password has not been used, determining the target password based on the random factor, the current count value and the current verification time period.
[0010] Optionally, determining the current verification time period according to the current time includes: determining the minimum verification time according to the current time; obtaining the previous verification time period; and determining the maximum value of the minimum verification time and the previous verification time period as the current verification time period.
[0011] Optionally, determining whether the temporary password has been used based on the current verification time period and the current count value includes: obtaining the previous count value; determining that the temporary password has not been used when the current verification time period is not equal to the previous verification time period, or when the current verification time period is equal to the previous verification time period and the current count value is not equal to the previous count value; determining that the temporary password has been used when the current verification time period is equal to the previous verification time period and the current count value is equal to the previous count value.
[0012] Optionally, determining the target password based on the current count value and the current time also includes: determining the maximum verification time based on the current time; after determining the target password based on the current count value and the current time, it also includes: when the temporary password is different from the target password, incrementing the current verification time period; determining whether the current verification time period is greater than the maximum verification time; when the current verification time period is less than or equal to the maximum verification time, determining the target password again based on the random factor, the current count value and the current verification time period.
[0013] In some embodiments, the method includes: upon receiving a request for a temporary password, obtaining the current time; obtaining the current count value; upon the current time or the current count value meeting the temporary password generation condition, generating a temporary password based on the current time and the current count value; upon successful generation of the temporary password, sending the temporary password.
[0014] Optionally, obtaining the current count value includes: determining the current generation time period based on the current time; obtaining the previous generation time period; when the current generation time period is different from the previous generation time period, determining the current count value to be zero; when the current generation time period is the same as the previous generation time period, determining the stored count value as the current count value.
[0015] In some embodiments, the device includes a processor and a memory storing program instructions, and the processor is configured to execute the above method for verifying a temporary password when running the program instructions.
[0016] In some embodiments, the device includes a processor and a memory storing program instructions, and the processor is configured to execute the above method for generating a temporary password when running the program instructions.
[0017] In some embodiments, the smart lock system includes the above-mentioned device for verifying a temporary password or the above-mentioned device for generating a temporary password.
[0018] The method and device for verifying and generating a temporary password, and the smart lock system provided by the embodiments of the present disclosure can achieve the following technical effects:
[0019] When receiving the temporary password input by the user, the temporary password is parsed to obtain the current count value to determine whether the temporary password has been used. The current time is obtained as the time parameter for generating the target password. According to the current count value and the current time, the unique corresponding target password is determined to be used to verify the temporary password. When the temporary password is the same as the target password, it is determined that the temporary password verification is successful and the smart lock is turned on. Since the smart lock does not need to be always connected to the server that generates the temporary password during the temporary password verification process, the power consumption of the smart lock is reduced. In a verification process, only one target password is generated according to the current count value and the current time to compare with the temporary password, and the efficiency of the temporary password verification of the smart lock system is improved by reducing the time for password generation and comparison. At the same time, since the current count value is used to determine the target password and verify the temporary password, the repeated use of the temporary password is avoided and the security of the use of the temporary password is improved.
[0020] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0022] Figure 1 is a schematic diagram of multi-terminal interaction of a smart lock system provided by an embodiment of the present disclosure;
[0023] Figure 2 is a schematic diagram of a method for verifying a temporary password provided by an embodiment of the present disclosure;
[0024] Figure 3 is a schematic diagram of another method for verifying a temporary password provided by an embodiment of the present disclosure;
[0025] Figure 4is a schematic diagram of another method for verifying a temporary password provided by an embodiment of the present disclosure;
[0026] Figure 5 is a schematic diagram of a method for generating a temporary password provided by an embodiment of the present disclosure;
[0027] Figure 6 is a schematic diagram of another method for generating a temporary password provided by an embodiment of the present disclosure;
[0028] Figure 7 It is a schematic diagram of a device for verifying a temporary password provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0030] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0031] Unless otherwise stated, the term "plurality" means two or more.
[0032] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0033] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0034] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0035] In the disclosed embodiments, the terminal device refers to an electronic device with a wireless connection function. The terminal device can communicate with the smart lock system by connecting to the Internet, or directly communicate with the smart lock system through Bluetooth, WiFi (Wireless Fidelity), etc. In some embodiments, the terminal device is, for example, a mobile device, a computer, or a vehicle-mounted device built into a hover car, or any combination thereof. Mobile devices may include, for example, mobile phones, smart home devices, wearable devices, smart mobile devices, virtual reality devices, etc., or any combination thereof, wherein wearable devices include, for example, smart watches, smart bracelets, pedometers, etc.
[0036] Combination Figure 1 As shown, the embodiment of the present disclosure provides a smart lock system, including a smart lock and a server, data communication can be performed between the smart lock and the server (for example, when a firmware upgrade is required), and data communication can be performed between the server and its corresponding application. When a user needs to use a temporary password to open the smart lock, the temporary password is requested from the server through the application on the terminal device. After generating the temporary password, the server sends the temporary password to the application for display. After the user obtains the temporary password through the application, the user enters the temporary password into the smart lock. If the user of the temporary password is not the user, the user can send the temporary password to the user through SMS, WeChat, etc., and the user enters the temporary password into the smart lock. The smart lock verifies the temporary password. In the case of successful verification, the smart lock prompts the user that the verification is successful and automatically opens. In the case of failed verification, the smart lock prompts the user that the verification failed and needs to reapply and enter the temporary password. It can be seen that when the temporary password is used to open the smart lock, there is no need for data communication between the smart lock and the server, which reduces the power consumption of the smart lock and improves the security of the temporary password.
[0037] Combination Figure 2 As shown, the embodiment of the present disclosure provides a method for verifying a temporary password, which is applied to a smart lock and includes:
[0038] S210, when receiving the temporary password, the smart lock parses the temporary password to obtain the current count value.
[0039] S220, the smart lock obtains the current time.
[0040] S230, the smart lock determines the target password based on the current count value and the current time.
[0041] S240, when the temporary password is the same as the target password, the smart lock determines that the temporary password verification is successful.
[0042] According to the method for verifying a temporary password provided by the embodiment of the present disclosure, when a temporary password input by a user is received, the temporary password is parsed to obtain the current count value to determine whether the temporary password has been used. The current time is obtained as a time parameter for generating a target password. According to the current count value and the current time, a unique corresponding target password is determined to verify the temporary password. When the temporary password is the same as the target password, it is determined that the temporary password verification is successful and the smart lock is turned on. Since the smart lock does not need to be always connected to the server that generates the temporary password during the temporary password verification process, the power consumption of the smart lock is reduced. In a verification process, only one target password is generated according to the current count value and the current time to compare with the temporary password, and the efficiency of the temporary password verification of the smart lock system is improved by reducing the time for password generation and comparison. At the same time, since the current count value is used to determine the target password and verify the temporary password, the repeated use of the temporary password is avoided and the security of the use of the temporary password is improved.
[0043] For the smart lock to parse the temporary password to obtain the current count value in step S210, it means that the smart lock knows the encryption method of the temporary password by the server, so it can adopt the corresponding decryption method to parse the temporary password to obtain the current count value.
[0044] For the smart lock to obtain the current time in step S220, when the smart lock is online, the current time can be obtained through the network. When the smart lock is offline, the current time can be obtained by parsing the temporary password.
[0045] Optionally, the smart lock in step S230 determines the target password according to the current count value and the current time, including: the smart lock determines the current verification time period according to the current time. The smart lock determines whether the temporary password has been used according to the current verification time period and the current count value. When the temporary password is not used, the smart lock determines the target password according to the random factor, the current count value and the current verification time period. In this way, since the same temporary password is only allowed to be used once, there may be a problem of repeated use of the temporary password in the same time period. The current verification time period is first determined according to the current time. According to the current verification time period and the current count value, it is determined whether the temporary password has been used to perform different operations. When the temporary password is not used, the smart lock determines the target password according to the unique random factor, the current count value and the current verification time period of the smart lock. By determining the target password according to the random factor, the current count value and the current verification time period, combined with the characteristics of the smart lock itself, the number of times the generation is limited and the time change characteristics, the unique target password is determined in a dynamic and static manner, thereby improving the security of the smart lock temporary password verification.
[0046] Combination Figure 3As shown, the embodiment of the present disclosure provides another method for verifying a temporary password, including:
[0047] S210, when receiving the temporary password, the smart lock parses the temporary password to obtain the current count value.
[0048] S220, the smart lock obtains the current time.
[0049] S231, the smart lock determines the minimum verification time based on the current time.
[0050] S232, the smart lock obtains the last verification time period.
[0051] S233, the smart lock determines the maximum value of the minimum verification time and the previous verification time period as the current verification time period.
[0052] S234, the smart lock obtains the previous count value.
[0053] S235, when the current verification time period is not equal to the previous verification time period, or when the current verification time period is equal to the previous verification time period and the current count value is not equal to the previous count value, the smart lock determines that the temporary password has not been used.
[0054] S236, when the temporary password is not used, the smart lock determines the target password based on the random factor, the current count value and the current verification time period.
[0055] S240, when the temporary password is the same as the target password, the smart lock determines that the temporary password verification is successful.
[0056] S241, the smart lock opens automatically.
[0057] S242, the smart lock determines the current verification time period as the previous verification time period, and determines the current count value as the previous count value, and returns to step S210.
[0058] S237, when the current verification time period is equal to the previous verification time period and the current count value is equal to the previous count value, the smart lock determines that the temporary password has been used.
[0059] S238: If the temporary password has been used, the smart lock prompts the user that the verification has failed and returns to step S210.
[0060] The method for verifying a temporary password provided by the embodiment of the present disclosure is adopted. By determining the maximum value of the verification minimum time and the previous verification time period as the current verification time period, it is determined whether the current verification time period is a new time period, thereby judging whether the temporary password has been used. In the case where the current verification time period is not equal to the previous verification time period, it is a new time period at this time, and the temporary password must not have been used (because the generation of the temporary password is related to the time period). After the temporary password is successfully verified, the smart lock is automatically opened, and the previous verification time period and the previous count value are updated so that the temporary password can be verified and used the next time it is received. In the case where the current verification time period is equal to the previous verification time period and the current count value is not equal to the previous count value, the temporary password has changed when it was generated (caused by the change of the current count value), and the temporary password has not been used. In the case where the current verification time period is equal to the previous verification time period and the current count value is equal to the previous count value, the temporary password has not been updated and the temporary password has been used. In the case where the temporary password has been used, the user is prompted that the verification failed, and the user can know that the old temporary password is used and thus apply for a new temporary password to open the smart lock. By prohibiting the reuse of the temporary password, the potential risks caused by the leakage of the temporary password are avoided, and the security of the temporary password verification is improved.
[0061] Combination Figure 4 As shown, the embodiment of the present disclosure provides another method for verifying a temporary password, including:
[0062] S210, when receiving the temporary password, the smart lock parses the temporary password to obtain the current count value.
[0063] S220, the smart lock obtains the current time.
[0064] S231, the smart lock determines the minimum verification time based on the current time.
[0065] S251, the smart lock determines the maximum verification time based on the current time.
[0066] S232, the smart lock obtains the last verification time period.
[0067] S233, the smart lock determines the maximum value of the minimum verification time and the previous verification time period as the current verification time period.
[0068] S234, the smart lock obtains the previous count value.
[0069] S235, when the current verification time period is not equal to the previous verification time period, or when the current verification time period is equal to the previous verification time period and the current count value is not equal to the previous count value, the smart lock determines that the temporary password has not been used.
[0070] S236, when the temporary password is not used, the smart lock determines the target password based on the random factor, the current count value and the current verification time period.
[0071] S240, when the temporary password is the same as the target password, the smart lock determines that the temporary password verification is successful and returns to step S210.
[0072] S252: When the temporary password is different from the target password, the smart lock will automatically increment the current verification time period.
[0073] S253, the smart lock determines whether the current verification time period is greater than the maximum verification time. If so, execute step S254. If not, return to step S236.
[0074] S254, the smart lock prompts the user that the verification failed and returns to step S210.
[0075] Using the method for verifying a temporary password provided by the embodiment of the present disclosure, since the temporary password has a certain validity period, and the time of generating the temporary password is within the validity period, there is a situation where the temporary password is valid but the verification fails. Therefore, when the temporary password is different from the target password, the current verification time period is gradually increased and adjusted (the self-increment value is determined according to other parameters, generally increased by 1). When the current verification time period is less than or equal to the maximum verification time, the target password is determined again for verification based on the random factor, the current count value and the current verification time period. By increasing the current verification time period and repeatedly attempting to verify when the temporary password verification fails, the problem of the temporary password being unable to be verified within the validity period is avoided, thereby improving the reliability of the temporary password verification. When the current verification time period is greater than the maximum verification time, the user is prompted that the verification has failed, and the user is informed that the temporary password has expired so that the user can apply for a new temporary password to open the smart lock.
[0076] Optionally, the smart lock in step S231 determines the minimum verification time according to the current time, including: the smart lock determines the current time period according to the current time. The smart lock obtains the number of time period attempts and the time step. The smart lock determines the difference between the current time period and the product of the number of time period attempts and the time step as the verification backoff time. The smart lock determines the sum of the verification backoff time and the time step as the minimum verification time. The smart lock in step S251 determines the maximum verification time according to the current time, including: the smart lock determines the sum of the current time period and the product of the number of time period attempts and the time step as the maximum verification time. For example, when the time step is 1 minute, the maximum allowed count value is 10, which means that a maximum of 10 temporary passwords are allowed to be generated within 1 minute. When the time step is 1 minute and the number of time period attempts is 10, the validity period of the temporary password is 10 minutes. Among them, the current time period refers to which time period the current time belongs to, or the start time of the corresponding time period. For example, taking 0:00 on January 1, 1970 as the starting point and 60s as a time period, 0:02:30 on January 1, 1970 is the third time period (the second time period when counting starts from 0 in the algorithm). Or, the starting time of the time period corresponding to 0:02:30 on January 1, 1970 is 0:02:00 on January 1, 1970. The calculation method for the current time period is to convert the current time into seconds, then divide the converted current time by 60 and round it up (the nth time period) as the current time period, or multiply it by 60 as the current time period (the starting time of the corresponding time period). In this way, according to the time step, the maximum number of temporary passwords allowed to be generated within the time step is determined. According to the product of the number of time period attempts and the time step, the validity period of the temporary password can be determined. Through the current time period, the validity period of the temporary password and the time step, the starting value of the current time period can be determined, which is also the starting value of the validity period of the temporary password. The end value of the temporary password's validity period can also be determined by the current time period, the validity period of the temporary password, and the time step. By determining the start value and end value of the temporary password's validity period, the temporary password can remain valid within the validity period, avoiding the problem that the temporary password cannot be verified within the validity period, thereby improving the reliability of temporary password verification.
[0077] Optionally, the smart lock in step S236 determines the target password according to the random factor, the current count value and the current verification time period, including: the smart lock converts the random factor, the current count value and the current verification time period into a string format to form three preliminary strings. The smart lock respectively sorts the three preliminary strings in ascending order and connects them to form a target string. The smart lock inputs the target string into the secure hash algorithm 1 (SHA1) to obtain the target number. The smart lock extracts N-1 numbers from the target number as the first N-1 digits of the target password. The smart lock determines the Nth password according to the current count value and the extracted number. The smart lock adds the Nth password to the target password to generate a complete target password. Wherein, N is the number of digits in the password. The smart lock determines the Nth password according to the current count value and the extracted number by adding the current count value to the extracted number and taking the remainder of 10. In this way, the selected static value and dynamic value are first converted into a string format so as to input the corresponding algorithm to generate the target number. First, the three converted preliminary strings are sorted in ascending order and connected to form a unique corresponding target string to form a certain structure. By taking N-1 digits of the target number output by the secure hash algorithm 1 as the first N-1 digits of the target password, the complexity of the target password calculation is reduced. The current count value and the extracted digit are used to determine the last digit by taking the remainder, which increases the complexity of the target password determination, thereby improving the security and reliability of the temporary password verification.
[0078] Combination Figure 5 As shown, the embodiment of the present disclosure provides a method for generating a temporary password, which is applied to a server, including:
[0079] S310, when receiving a request for a temporary password, the server obtains the current time.
[0080] S320, the server obtains the current count value.
[0081] S330: When the current time or the current count value meets the temporary password generation condition, the server generates a temporary password according to the current time and the current count value.
[0082] S340, when the temporary password is generated successfully, the server sends the temporary password.
[0083] Using the method for generating a temporary password provided by the embodiment of the present disclosure, when a user requests a temporary password, the current time is obtained as a time parameter for generating the temporary password. The current count value is obtained, and a temporary password is generated when the current time or the current count value meets the temporary password generation condition, so as to avoid exceeding the limit on the number of temporary passwords generated within a certain time period, thereby improving the security of the use of temporary passwords. When the temporary password is successfully generated, the temporary password is sent to the user, and the user can open the smart lock according to the temporary password. By using the current time and the current count value to generate a temporary password, the generation of the temporary password has a certain degree of dynamism, which improves the security of the generation of the temporary password.
[0084] Optionally, the server in step S320 obtains the current count value, including: the server determines the current generation time period according to the current time. The server obtains the previous generation time period. When the current generation time period is different from the previous generation time period, the server determines that the current count value is zero. When the current generation time period is the same as the previous generation time period, the server determines the stored count value as the current count value. Among them, the calculation method of the current generation time period is the same as the calculation method of the current time period, which is not repeated here. In this way, when the current generation time period is different from the previous generation time period, the current generation time period is a new time period, and the limit on the number of temporary passwords generated in the time period is lifted by clearing the current count value. When the current generation time period is the same as the previous generation time period, the current generation time period is an old time period, and the count value stored after the previous generation of the temporary password is determined as the current count value (the self-increment value is determined according to other parameters, generally self-incremented by 1). By determining the current count value in different ways at different current times, it is avoided that the limit on the number of temporary passwords generated in a certain time period is exceeded, thereby improving the security of temporary password generation.
[0085] Optionally, the current time or current count value in step S330 satisfies the temporary password generation condition, including: when the current generation time period is different from the previous generation time period, the server determines that the current time satisfies the temporary password generation condition. Or, when the current generation time period is the same as the previous generation time period and the current count value is less than or equal to the maximum count value, the server determines that the current count value satisfies the temporary password generation condition. In this way, when the current generation time period is different from the previous generation time period, the current generation time period is a new time period, and there is no problem of limiting the number of temporary passwords generated, thereby determining that the current time satisfies the temporary password generation condition. When the current generation time period is the same as the previous generation time period and the current count value is less than or equal to the maximum count value, the number of temporary passwords generated in the current generation time period does not exceed the limit, and the generation of the temporary password can continue. By determining whether the temporary password generation condition is met at different current times or current count values, it is avoided that the limit on the number of temporary passwords generated within a certain time period is exceeded, thereby improving the security of temporary password generation.
[0086] For the server in step S330 to generate a temporary password based on the current time and the current count value, it means that the temporary password is generated based on the current generation time period, the current count value and the random factor. The specific method is the same as the smart lock in the above-mentioned step S236 to determine the target password based on the random factor, the current count value and the current verification time period (that is, the current generation time period is used as the current verification time period), which will not be repeated here.
[0087] Combination Figure 6 As shown, the embodiment of the present disclosure provides another method for generating a temporary password, including:
[0088] S310, when receiving a request for a temporary password, the server obtains the current time.
[0089] S320, the server obtains the current count value.
[0090] S330: When the current time or the current count value meets the temporary password generation condition, the server generates a temporary password according to the current time and the current count value.
[0091] S340, when the temporary password is generated successfully, the server sends the temporary password.
[0092] S341, the server increases the current count value, determines the current generation time period as the previous generation time period, and returns to step S310.
[0093] S342: When the temporary password generation fails, the server prompts the user that the temporary password generation fails and returns to step S310.
[0094] S350, when the current time and the current count value do not meet the temporary password generation condition, the server prompts the user that the temporary password has been used up and returns to step S310.
[0095] Using the method for generating a temporary password provided by an embodiment of the present disclosure, when the temporary password is successfully generated, the current count value is incremented and the current generation time period is determined as the previous generation time period, which serves as the basis for generating the temporary password next time. In the case where the temporary password generation fails, the server prompts the user that the temporary password generation failed, so that the user can reapply for a temporary password to open the smart lock. In the case where the current time and the current count value do not meet the temporary password generation conditions, the server prompts the user that the temporary password has been used up, so that the user can know that too many temporary passwords have been generated and need to wait for a while before applying again. By prompting the user in different ways in the case of different temporary password generation failures and allowing the user to perform corresponding operations, the reliability of temporary password generation is improved.
[0096] Combination Figure 7 As shown, the embodiment of the present disclosure provides a device for verifying a temporary password, including a processor (processor) 41 and a memory (memory) 42. Optionally, the device may also include a communication interface (CommunicationInterface) 43 and a bus 44. Among them, the processor 41, the communication interface 43, and the memory 42 can communicate with each other through the bus 44. The communication interface 43 can be used for information transmission. The processor 41 can call the logic instructions in the memory 42 to execute the method for verifying a temporary password in the above embodiment.
[0097] In addition, the logic instructions in the memory 42 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0098] The memory 42 is a storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 41 executes the function application and data processing by running the program instructions / modules stored in the memory 42, that is, the method for verifying the temporary password in the above embodiment is implemented.
[0099] The memory 42 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 42 may include a high-speed random access memory and may also include a non-volatile memory.
[0100] The disclosed embodiment also provides a device for generating a temporary password, the structure of which is the same as that of the device for verifying a temporary password, and will not be described in detail herein. The processor 41 may call the logic instructions in the memory 42 to execute the method for generating a temporary password in the above embodiment.
[0101] The embodiment of the present disclosure provides a smart lock system, including a smart lock and a server. The smart lock includes the above-mentioned device for verifying a temporary password. The server includes the above-mentioned device for generating a temporary password.
[0102] An embodiment of the present disclosure provides a storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the above method for verifying and generating a temporary password.
[0103] The above-mentioned storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0104] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0105] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0106] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0107] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0108] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for verifying a temporary password, characterized in that: include: When receiving the temporary password, parsing the temporary password to obtain the current count value; Get the current time; Determine the target password according to the current count value and the current time; In the case where the temporary password is identical to the target password, it is determined that the temporary password verification is successful; Wherein, determining the target password according to the current count value and the current time includes: determining the current verification time period according to the current time; determining whether the temporary password has been used according to the current verification time period and the current count value; and determining the target password according to the random factor, the current count value and the current verification time period when the temporary password has not been used; Determining whether the temporary password has been used based on the current verification time period and the current count value includes: obtaining the previous verification time period; obtaining the previous count value; and determining that the temporary password has not been used when the current verification time period is not equal to the previous verification time period, or when the current verification time period is equal to the previous verification time period and the current count value is not equal to the previous count value.
2. The method according to claim 1, characterized in that According to the current time, determine the current verification time period, including: Determine the minimum verification time based on the current time; Get the last verification time period; The maximum value of the minimum verification time and the previous verification time period is determined as the current verification time period.
3. The method according to claim 1, characterized in that: Determine whether the temporary password has been used based on the current verification time period and the current count value, and also include: In the case where the current authentication time period is equal to the previous authentication time period and the current count value is equal to the previous count value, it is determined that the temporary password has been used.
4. The method according to any one of claims 2 or 3, characterized in that: According to the current count value and the current time, the target password is determined, which also includes: According to the current time, determine the maximum verification time; After determining the target password according to the current count value and the current time, it also includes: If the temporary password is different from the target password, the current verification time period will be incremented; Determine whether the current verification time period is greater than the maximum verification time; When the current verification time period is less than or equal to the maximum verification time, the target password is determined again based on the random factor, the current count value and the current verification time period.
5. A method for generating a temporary password, characterized in that: include: Upon receiving a request for a temporary password, obtaining the current time; Get the current count value; When the current time or the current count value meets the temporary password generation condition, a temporary password is generated according to the current time and the current count value; If the temporary password is generated successfully, send the temporary password; The current time or the current count value satisfies the temporary password generation condition, including: obtaining the previous generation time period; when the current generation time period is different from the previous generation time period, determining that the current time satisfies the temporary password generation condition; or, when the current generation time period is the same as the previous generation time period and the current count value is less than or equal to the maximum count value, determining that the current count value satisfies the temporary password generation condition; Generate a temporary password, including: generate a temporary password according to a current generation time period, a current count value and a random factor; specifically generate the temporary password in the following manner: convert the random factor, the current count value and the current generation time period into a string format to form three preliminary strings; sort the three preliminary strings in ascending order and connect them to form a target string; input the target string into a secure hash algorithm to obtain a target number; extract N-1 numbers from the target number as the first N-1 digits of the target password; determine the Nth password according to the current count value and the extracted number; and add the Nth password to the target password to generate a complete temporary password.
6. The method according to claim 5, characterized in that Get the current count value, including: According to the current time, determine the current generation time period; Get the previous generation time period; In the case where the current generation time period is different from the previous generation time period, determining that the current count value is zero; In the case where the current generation time period is the same as the previous generation time period, the stored count value is determined as the current count value.
7. A device for verifying a temporary password, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for verifying a temporary password according to any one of claims 1 to 4 when running the program instructions.
8. A device for generating a temporary password, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for generating a temporary password according to claim 5 or 6 when running the program instructions.
9. A smart lock system, characterized in that: The method comprises the device for verifying a temporary password as claimed in claim 7 or the device for generating a temporary password as claimed in claim 8.
Citation Information
Patent Citations
Communication-free hopping code generation method of access control system
CN103136830A
Unlocking method, intelligent lock and unlocking system
CN113034745A