Methods, apparatus, storage media, and electronic devices for determining verification results

CN116563976BActive Publication Date: 2026-03-10QINGDAO HAIER TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种验证结果的确定方法、装置、存储介质及电子装置,以至少解决相关技术中,当前开锁事件验证码安全性低的问题

Benefits of technology

[0021] In this embodiment, in response to a target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock; the temporary unlocking event is sent to a cloud platform, and a remote unlocking request sent by the cloud platform based on the temporary unlocking event is obtained, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; the device temporary verification code is verified using a device local verification code stored in the smart lock, and a verification result is determined; by adopting the above technical solution, the problem of low security of current unlocking event verification codes is solved, thereby greatly improving the security performance of the smart lock.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563976B_ABST
    Figure CN116563976B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for determining verification results, relating to the field of smart home technology. The method for determining verification results includes: in response to a target object's control operation on a smart door lock, generating a temporary unlocking event for the smart door lock, wherein the temporary unlocking event carries a device random string generated by the smart door lock; sending the temporary unlocking event to a cloud platform and obtaining a remote unlocking request sent by the cloud platform based on the temporary unlocking event, the remote unlocking request carrying a device temporary verification code generated by the cloud platform based on the device random string; verifying the device temporary verification code using a device local verification code stored within the smart door lock, and determining the verification result. This technical solution solves the problem of low security in current unlocking event verification codes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a method, apparatus, storage medium, and electronic device for determining verification results. Background Technology

[0002] Currently, the vast majority of smart door locks on the market do not support remote unlocking.

[0003] In related technologies, since the cloud sends unlocking commands directly to the device, security is difficult to guarantee, such as protocol security and channel security. It is easy for hackers to remotely open the user's door lock due to other security vulnerabilities in the cloud (such as obtaining device control permissions through certain cloud vulnerabilities, and being able to directly send control commands to the device through the developed device control interface, including remote unlocking commands).

[0004] There is currently no effective solution to the problem of low security of unlocking event verification codes in related technologies. Summary of the Invention

[0005] This application provides a method, apparatus, storage medium, and electronic device for determining verification results, in order to at least solve the problem of low security of current unlocking event verification codes in related technologies.

[0006] According to one embodiment of this application, a method for determining a verification result is provided, comprising: in response to a control operation of a target object on a smart lock, generating a temporary unlocking event of the smart lock, wherein the temporary unlocking event carries a device random string generated by the smart lock; sending the temporary unlocking event to a cloud platform and obtaining a remote unlocking request sent by the cloud platform based on the temporary unlocking event, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; verifying the device temporary verification code using a device local verification code stored in the smart lock, and determining a verification result.

[0007] In one exemplary embodiment, verifying the temporary device verification code using a device-local verification code stored in the smart lock includes: if the device random string is determined to be valid, verifying the temporary device verification code using the device-local verification code stored in the smart lock; if the device random string is determined to be invalid, determining whether another device random string stored in the smart lock is valid, wherein the generation time of the other device random string is earlier than the generation time of the device random string; if the other device random string is determined to be valid, obtaining another device-local verification code generated by the smart lock based on the other device random string, and verifying the temporary device verification code using the other device-local verification code and the device-local verification code.

[0008] In an exemplary embodiment, before verifying the temporary verification code of the device using the device local verification code stored in the smart lock, the method further includes: obtaining a first valid time period preset for the device random string, wherein the first valid time period includes a first effective time and a first invalid time, wherein the first effective time of the device random string is the generation time of the device random string; determining the unlocking time indicated by the remote unlocking request; if the unlocking time is determined to be later than the first invalid time, determining that the device random string is in an invalid state; if the unlocking time is determined to be no later than the first invalid time, determining that the device random string is in a valid state.

[0009] In an exemplary embodiment, before verifying the temporary verification code of the device using the device local verification code stored in the smart lock, the method further includes: obtaining a second valid time period preset for the random string of the other device, wherein the valid time period includes a second effective time and a second expiration time, wherein the second effective time of the random string of the other device is the generation time of the random string of the other device; determining the unlocking time indicated by the remote unlocking request; if the unlocking time is determined to be later than the second expiration time, determining that the random string of the other device is in an invalid state; if the unlocking time is determined to be no later than the second expiration time, determining that the random string of the other device is in a valid state.

[0010] In an exemplary embodiment, verifying the temporary device verification code using the local verification code of the other device and the local device verification code includes: determining whether there is an overlapping time period between a first valid time period preset for the random string of the device and a second valid time period preset for the random string of the other device; if it is determined that there is an overlapping time period between the first valid time period and the second valid time period, obtaining a first time period from the first valid time period and obtaining a second time period from the second valid time period; wherein the random string of the device cannot be generated repeatedly within the first time period, and the random string of the other device cannot be generated repeatedly within the first time period; if it is determined that the overlapping time period does not belong to the first time period but belongs to the second time period, verifying the temporary device verification code using the local verification code of the other device and the local device verification code.

[0011] In an exemplary embodiment, before verifying the temporary device verification code using the device local verification code stored in the smart lock, the method further includes: generating the device local verification code based on the device random string and storing it in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining the second-level timestamp corresponding to the acquisition time of the remote unlocking request, and converting the second-level timestamp into an unlocking time field with a preset time interval; performing hash encryption on the unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the device random string using a hash algorithm to obtain a hash encryption result; and determining the hash encryption result as the device local verification code.

[0012] In an exemplary embodiment, before verifying the temporary device verification code using the device local verification code stored in the smart lock, the method further includes: generating the device local verification code based on the device random string and storing it in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining the second-level timestamp corresponding to the time of obtaining the remote unlocking request, converting the second-level timestamp into an unlocking time field with a preset time interval, and obtaining the previous unlocking time corresponding to the second-level timestamp; using a hash algorithm to perform hash encryption on the previous unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the other device random string to obtain a hash encryption result; and determining the hash encryption result as the other device local verification code.

[0013] In an exemplary embodiment, after verifying the temporary verification code of the device using the other device local verification code and the device local verification code, and determining the verification result, the method further includes: if it is determined that the verification result is used to indicate that the other device local verification code and / or the device local verification code has been successfully verified, sending a first prompt message to the target object, wherein the first prompt message is used to indicate that the smart lock has been successfully verified; deleting the device random string and other device random strings from the smart lock.

[0014] In an exemplary embodiment, after verifying the temporary verification code of the device using the other device local verification code and the device local verification code, and determining the verification result, the method further includes: if the verification result indicates that both the other device local verification code and the device local verification code have failed to verify, sending a second prompt message to the target object; wherein the second prompt message is used to indicate that the smart lock verification has failed, and to prompt the target object to perform the control operation on the smart lock again.

[0015] In an exemplary embodiment, after converting the second-level timestamp into an unlocking time field with a preset time interval, the method further includes: if at least two network connection channels are established between the smart lock and the cloud platform, determining the first establishment time of the first network connection channel established between the smart lock and the cloud platform and the second establishment time of the last network connection channel established between the smart lock and the cloud platform; and obtaining the device local key of the smart lock from the cloud platform based on a comparison result of the time difference between the first establishment time and the second establishment time and a preset period time.

[0016] In one exemplary embodiment, obtaining the device local key of the smart lock from the cloud platform based on a comparison result of the time difference between the first establishment time and the second establishment time and a preset period time includes: determining a first device local key of the smart lock obtained from the cloud platform at the first establishment time if the time difference between the first establishment time and the second establishment time is less than or equal to the preset period time; or determining a second device local key of the smart lock obtained from the cloud platform at the second establishment time if the time difference between the first establishment time and the second establishment time is greater than the preset period time.

[0017] In one exemplary embodiment, verifying the temporary device verification code using a device-local verification code stored in the smart lock includes: verifying the temporary device verification code using the device-local verification code to determine a first verification result; if the first verification result is determined to be successful, sending a notification message to the target object indicating that the verification result is successful; if the first verification result is determined to be a verification failure, verifying the temporary device verification code using another device-local verification code to determine a second verification result.

[0018] According to another aspect of the embodiments of this application, a device for determining verification results is also provided, comprising: a cloud platform and a smart lock, wherein the smart lock is configured to generate a temporary unlocking event in response to a control operation of a target object, wherein the temporary unlocking event carries a device random string generated by the smart lock; send the temporary unlocking event to the cloud platform, and obtain a remote unlocking request sent by the cloud platform based on the temporary unlocking event, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; verify the device temporary verification code using a device local verification code stored in the smart lock, and determine the verification result.

[0019] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for determining the verification result when it is run.

[0020] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for determining the verification result through the computer program.

[0021] In this embodiment, in response to a target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock; the temporary unlocking event is sent to a cloud platform, and a remote unlocking request sent by the cloud platform based on the temporary unlocking event is obtained, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; the device temporary verification code is verified using a device local verification code stored in the smart lock, and a verification result is determined; by adopting the above technical solution, the problem of low security of current unlocking event verification codes is solved, thereby greatly improving the security performance of the smart lock. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0023] 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, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a schematic diagram of the hardware environment for a method of determining verification results according to an embodiment of this application;

[0025] Figure 2 This is a flowchart of a method for determining verification results according to an embodiment of this application;

[0026] Figure 3 This is a schematic diagram of a method for determining verification results according to an embodiment of this application;

[0027] Figure 4 This is a schematic diagram of a device temporary verification code verification method based on the verification results of an embodiment of this application;

[0028] Figure 5 This is a schematic diagram illustrating the generation and usage period of a temporary device verification code (challengeCode) according to an embodiment of this application.

[0029] Figure 6 This is a structural block diagram of a verification result determination system according to an embodiment of this application. Detailed Implementation

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

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] According to one aspect of the embodiments of this application, a method for determining verification results is provided. This method for determining verification results is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, smart home device ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for determining verification results can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0033] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0034] This embodiment provides a method for determining the verification result, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a method for determining verification results according to an embodiment of this application. The process includes the following steps:

[0035] Step S202: In response to the target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock;

[0036] It should be noted that the smart door lock includes at least: a WIFI-BLE module and a door lock body.

[0037] It should be noted that the target objects include at least: users and visitors.

[0038] Step S204: Send the temporary unlocking event to the cloud platform and obtain the remote unlocking request sent by the cloud platform based on the temporary unlocking event. The remote unlocking request carries a temporary device verification code generated by the cloud platform based on the device's random string.

[0039] Step S206: Use the device local verification code stored in the smart lock to verify the device temporary verification code and determine the verification result.

[0040] Through the above steps, in response to the target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock; the temporary unlocking event is sent to the cloud platform, and a remote unlocking request sent by the cloud platform based on the temporary unlocking event is obtained, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; the device temporary verification code is verified using the device local verification code stored in the smart lock, and the verification result is determined. This solves the problem of low security of current unlocking event verification codes in related technologies, thereby greatly improving the security performance of the smart lock.

[0041] Optionally, during the temporary verification of the device in step S206 above, if the temporary verification code passes the verification, the lock is opened, and the target object is notified that the smart lock has been opened; if the verification fails, the target object is notified that the lock has failed to open and that the control operation of the smart lock needs to be initiated again.

[0042] In one exemplary embodiment, a technical solution is proposed to verify a temporary device verification code using a device local verification code stored in the smart lock, comprising the following steps: if the device random string is determined to be valid, verifying the temporary device verification code using the device local verification code stored in the smart lock; if the device random string is determined to be invalid, determining whether other device random strings stored in the smart lock are valid, wherein the generation time of the other device random strings is earlier than the generation time of the device random string; if the other device random strings are determined to be valid, obtaining other device local verification codes generated by the smart lock based on the other device random strings, and verifying the temporary device verification code using the other device local verification codes and the device local verification codes.

[0043] In other words, determining the validity of the device's random string is a crucial factor in verifying a device verification code. For example, a valid random string provides the basis for valid verification. However, in practice, the device's random string may be either valid or invalid. If the random string is valid, the device's local verification code stored in the smart lock can directly verify the temporary verification code. If the random string is invalid, to avoid affecting the normal use of the target device, subsequent verification can be performed by checking if other device random strings are valid.

[0044] Optionally, the validity of the device random string can be determined by setting an expiration period for the device random string.

[0045] In other words, the device random string is determined by the time it is generated and the time it is used. If the difference between the time it is used and the time it is generated is less than or equal to a preset validity period, the device random string is determined to be valid. If the difference between the time it is used and the time it is generated is greater than the preset validity period, the device random string is determined to be invalid.

[0046] Optionally, if it is determined that the random string of the other device is invalid, the target object is prompted that the doorbell has failed to be unlocked and needs to be pressed again.

[0047] In an exemplary embodiment, before verifying the temporary verification code of the device using the device local verification code stored in the smart lock, a first valid time period preset for the device random string can be obtained, wherein the first valid time period includes a first effective time and a first invalid time, wherein the first effective time of the device random string is the time when the device random string is generated; the unlocking time indicated by the remote unlocking request is determined; if the unlocking time is determined to be later than the first invalid time, the device random string is determined to be in an invalid state; if the unlocking time is determined to be no later than the first invalid time, the device random string is determined to be in a valid state.

[0048] In other words, to ensure that the device's random string is valid, it can be determined by identifying the valid time period and the invalid time period of the device's random string.

[0049] In other words, once a random string is generated by a device, it corresponds to an effective time and an invalid time. The effective time is the time the string was generated. If the unlocking time indicated by the received unlocking request is later than the invalid time, it means that the random string of the device has become invalid.

[0050] It should be noted that the smart door lock body of this solution needs to synchronize its time with the cloud through the module periodically; otherwise, there may be deviations in the password time range.

[0051] Optionally, the same device will generate the same temporary verification code for the same device within a certain period of time (10 natural minutes). That is, if security is to be guaranteed, the application needs to design the timing and method of generating random strings and ensure the randomness of the generation of random strings.

[0052] Optionally, the above-mentioned random string for the device can be represented as the device challengeCode.

[0053] In an exemplary embodiment, before verifying the temporary verification code of the device using the device local verification code stored in the smart lock, a second valid time period preset for the random string of the other device can be obtained, wherein the valid time period includes a second effective time and a second invalid time, wherein the second effective time of the random string of the other device is the time when the random string of the other device is generated; the unlocking time indicated by the remote unlocking request is determined; if the unlocking time is determined to be later than the second invalid time, the random string of the other device is determined to be in an invalid state; if the unlocking time is determined to be no later than the second invalid time, the random string of the other device is determined to be in a valid state.

[0054] In other words, to ensure that normal use by users is not affected, other devices can also obtain random strings with preset valid time periods.

[0055] That is, when other devices generate random strings, they also have an effective time and an expiration time, with the effective time being the time the string was generated. If the unlocking time indicated by the received unlocking request is later than the expiration time, it means that the random string of that device has expired.

[0056] In an exemplary embodiment, the process of verifying the temporary device verification code using the local verification code of the other device and the local device verification code is described by the following steps: determining whether there is an overlapping time period between a first valid time period preset for the random string of the device and a second valid time period preset for the random string of the other device; if it is determined that there is an overlapping time period between the first valid time period and the second valid time period, obtaining a first time period from the first valid time period and obtaining a second time period from the second valid time period; wherein, the random string of the device cannot be generated repeatedly within the first time period, and the random string of the other device cannot be generated repeatedly within the first time period; if it is determined that the overlapping time period does not belong to the first time period but belongs to the second time period, verifying the temporary device verification code using the local verification code of the other device and the local device verification code.

[0057] In other words, because different devices generate random strings at different times, the valid random strings for different time periods are also different. It is necessary to clearly define the valid random strings for different time periods. This can be achieved by determining the time period during which a device generates its random string, thereby restricting other devices from generating random strings while the random string generated by that device is still valid.

[0058] For example: By default, no other challengeCode can be generated within 60 seconds of the previous challengeCode being generated. There exist challengeCode1, generated at 12:00:00; challengeCode2, generated at 12:01:00; and challengeCode3, generated at 12:02:00, each with a validity period of 90 seconds. Therefore, between 12:00:00 and 12:01:00, challengeCode1 can be used to unlock the lock.

[0059] Between 12:01:00 and 12:01:30, challengeCode1 or challengeCode2 can be used to unlock the lock. Between 12:01:30 and 12:02:00, challengeCode2 can be used to unlock the lock. Between 12:02:00 and 12:02:30, challengeCode2 or challengeCode3 can be used to unlock the lock. Between 12:03:00 and 12:03:30, challengeCode3 can be used to unlock the lock.

[0060] In an exemplary embodiment, before verifying the temporary device verification code using the device local verification code stored in the smart lock, the device local verification code can be generated based on the device random string and stored in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining the second-level timestamp corresponding to the time of obtaining the remote unlocking request, and converting the second-level timestamp into an unlocking time field with a preset time interval; using a hash algorithm to perform hash encryption on the unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the device random string to obtain a hash encryption result; and determining the hash encryption result as the device local verification code.

[0061] In other words, to achieve better verification results, the device's local verification code can be stored in the smart lock. Generating the local verification code requires using the second-level timestamp corresponding to the moment the unlock request is received. It should be noted that by converting the second-level timestamp into an unlock time field with a preset time interval, and then encrypting the unlock time field, the security of the verification code is improved.

[0062] Optionally, the above encryption method can also use salted encryption, that is, concatenating a random string with a preset number of characters with the hash encryption result to obtain a concatenated string; encrypting the string using the MD5 message digest algorithm; and determining the unlocking password generated for the target object based on the encrypted result.

[0063] Optionally, the verification code generation process can utilize SHA256, i.e., generate a 32-byte password sequence (same as the generation algorithm), and truncate the last 8 bytes to convert it into a lowercase Hex string (fixed length 16 characters, character set [0-9a-f]) as the device temporary verification code 1.

[0064] In an exemplary embodiment, before verifying the temporary device verification code using the device local verification code stored in the smart lock, the device local verification code can be generated based on the device random string and stored in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining the second-level timestamp corresponding to the time of obtaining the remote unlocking request, converting the second-level timestamp into an unlocking time field with a preset time interval, and obtaining the previous unlocking time corresponding to the second-level timestamp; using a hash algorithm to perform hash encryption on the previous unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the other device random string to obtain a hash encryption result; and determining the hash encryption result as the other device local verification code.

[0065] It should be noted that the above-mentioned second-level timestamp is a second-level Unix timestamp (4-byte integer, network byte order); the random string can be a challengeCode, a fixed length of 32 characters, with a character set [0-9a-f].

[0066] It should be noted that after generating a new challengeCode, the previous challengeCode and its expiration time should still be retained for supplementary verification, so as to ensure a smooth transition between the verification of the old and new codes.

[0067] In one exemplary embodiment, after verifying the temporary verification code of the device using the other device's local verification code and the device's local verification code, and determining the verification result, if the verification result is used to indicate that the other device's local verification code and / or the device's local verification code has been successfully verified, a first prompt message is sent to the target object, wherein the first prompt message is used to indicate that the smart lock has been successfully verified; and the device random string and other device random strings are deleted from the smart lock.

[0068] In other words, if the verification code on other devices and / or the verification code on the device are successfully verified, the target object is prompted with the verification result, so that the target object can know the verification result in a timely manner and take corresponding actions.

[0069] In one exemplary embodiment, after verifying the temporary verification code of the device using the other device's local verification code and the device's local verification code, and determining the verification result, a second prompt message may be sent to the target object if the verification result indicates that both the other device's local verification code and the device's local verification code have failed to verify. The second prompt message indicates that the smart lock verification has failed and prompts the target object to perform the control operation on the smart lock again.

[0070] In other words, if both the local verification code of other devices and the local verification code of the device fail to be verified, the target object will be prompted, thereby enabling the target object to perform control operations in a timely manner.

[0071] In an exemplary embodiment, after converting the second-level timestamp into an unlocking time field with a preset time interval, the system can determine the first establishment time of the first network connection between the smart lock and the cloud platform and the second establishment time of the last network connection between the smart lock and the cloud platform, provided that at least two network connection channels have been established between the smart lock and the cloud platform. The system then obtains the smart lock's local device key from the cloud platform based on a comparison between the time difference between the first and second establishment times and a preset period.

[0072] In an exemplary embodiment, the process of obtaining the device local key of the smart lock from the cloud platform based on a comparison result of the time difference between the first establishment time and the second establishment time and a preset period time may include the following steps: if it is determined that the time difference between the first establishment time and the second establishment time is less than or equal to the preset period time, determining the first device local key of the smart lock obtained from the cloud platform at the first establishment time; or, if it is determined that the time difference between the first establishment time and the second establishment time is greater than the preset period time, determining the second device local key of the smart lock obtained from the cloud platform at the second establishment time.

[0073] For example, the WIFI module obtains the device localkey from the cloud platform every time it connects to the cloud platform and every 2 hours. The cloud platform determines the time since the device last obtained the new value. If it is within 8 hours, it directly returns the previously obtained localkey. If it is more than 8 hours, it generates and returns a new localkey.

[0074] To prevent the previously obtained temporary verification code from becoming unusable due to the Wi-Fi module's localkey update (once every 8 hours), the module needs to save the most recent localkey for a period of time (20 minutes) for temporary verification code verification.

[0075] Optionally, the obtained temporary device verification code (DevTmpVerifyCode1) can be saved via flash to solve the problem of unusability after power failure and restart. In practice, only the most recent local verification code (localkey) needs to be retained. The local verification code can be a localkey. That is, every time the current localkey changes, the historical localkey is directly overwritten and updated to the current localkey. The historical localkey is valid for 20 minutes and is only used for temporary one-time password and device temporary verification code supplementary verification. It cannot be used for other services. After the module is reconfigured and bound, the current localkey needs to be forcibly updated and the saved historical localkey needs to be cleared (at the same time as clearing the configuration).

[0076] It should be noted that the device local key is either synchronized from the smart lock to the cloud platform, or generated by the cloud platform based on the smart lock's lock data.

[0077] In one exemplary embodiment, a technical solution is proposed to verify a temporary device verification code using a device-local verification code stored in the smart lock. The specific steps include: verifying the temporary device verification code using the device-local verification code to determine a first verification result; if the first verification result is determined to be successful, sending a notification message to the target object indicating successful verification; if the first verification result is determined to be unsuccessful, verifying the temporary device verification code using another device-local verification code to determine a second verification result.

[0078] In other words, during the verification of the temporary device verification code using the device's local verification code stored in the smart lock, if the verification is successful, the target object is notified. If the verification fails, the temporary device verification code is verified using another device's local verification code.

[0079] In an exemplary embodiment, the process of verifying the temporary verification code of the device using the local verification code of the other device includes: obtaining a preset valid time period of the local verification code of the other device; determining the acquisition time period between the acquisition time of the local verification code of the device and the acquisition time of the local verification code of the other device; and verifying the temporary verification code of the device using the local verification code of the other device when it is determined that the preset valid time period belongs to the acquisition time period.

[0080] In other words, when using the local verification code of another device to verify the temporary verification code of the device, in order to ensure the validity of the local verification code of the other device, a preset valid time period can be used as the basis for judging whether it is valid. If the preset valid time period of the local verification code of the other device is the time when the local verification code of the device is obtained, then the local verification code of the other device can be used for verification.

[0081] To better understand the process of determining the above verification results, the implementation flow of the above verification result determination method will be described below in conjunction with optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.

[0082] This embodiment provides a method for determining the verification result. Figure 3 This is a schematic diagram of a method for determining verification results according to an embodiment of this application, as shown below. Figure 3 As shown, the specific steps are as follows:

[0083] Step S301: When a visitor rings the doorbell, the mobile app alerts the homeowner;

[0084] Step S302: The door lock body (smart door lock) takes a photo of the user (visitor);

[0085] Step S303: Randomly generate a remote unlocking challengeCode and retain it for 90 seconds;

[0086] It should be noted that the challengeCode format is a fixed length of 32 characters, with a character set of [0-9a-f]. The smart lock is a low-power lock (does not support remote wake-up). After the user presses the doorbell, it needs to be automatically woken up and kept powered on for 90 seconds (it cannot go into sleep mode) so that the owner can unlock it remotely.

[0087] If a user repeatedly rings the doorbell within 60 seconds before the current challengeCode becomes valid, the door lock will ignore it. If the user rings the doorbell after 60 seconds, the door lock will need to generate a new challengeCode and restart the process. After generating a new challengeCode, the previous challengeCode and its expiration time will still be retained for supplementary verification, so as to ensure a smooth transition between the old and new codes.

[0088] Step S304: The smart door lock reports the doorbell ringing event to the main loop control path (cloud platform);

[0089] It should be noted that the event report includes: the challenge code and the user (visitor) photo collected in step S302;

[0090] Step S305: The large loop control path (cloud platform) forwards the doorbell event to the door lock owner's mobile APP;

[0091] Step S306: The large loop control path (cloud platform) pushes the doorbell ringing event to the door lock details page (mobile APP);

[0092] Step S307: The door lock details page (mobile APP) notifies the user of a visitor's arrival;

[0093] It should be noted that in step S307, a visitor's photo and a countdown can also be displayed so that the owner can decide whether to unlock the door for the visitor.

[0094] Step S308: The door lock details page (mobile APP) prompts the user that they have 60 seconds to remotely unlock the door;

[0095] Step S309: The owner clicks "remote unlock";

[0096] Step S310: Generate a temporary password on the door lock details page (mobile APP);

[0097] It should be noted that the temporary password parameters include: userToken, deviceld, and challengeCode, with a fixed length of 32 characters, a character set of [0-9a-f], and the format needs to be verified;

[0098] Step S311: The door lock details page (mobile APP) requests remote unlocking from the large loop control channel (cloud platform);

[0099] Step S312: The large loop control path (cloud platform) requests remote unlocking (control path) from the WIFI-BLE module (smart door lock);

[0100] It should be noted that the control command carries a temporary device verification code, which is 16 characters long and has a character set of [0-9a-f].

[0101] The parameters include: current timestamp, second-level Unix timestamp (4-byte integer, network byte order);

[0102] The challengeCode format is a fixed length of 32 characters, with a character set of [0-9a-f].

[0103] The device's temporary verification code is a fixed-length 16-character code with a character set of [0-9a-f].

[0104] The verification result is returned as either failure or success.

[0105] Step S313: The WIFI-BLE module (smart lock) requests remote unlocking (control path) from the lock body (smart lock);

[0106] Step S314: The door lock body (smart door lock) verifies whether the current challengeCode is within its validity period (90s);

[0107] If the previous challengeCode is within its validity period (90s), proceed to steps S315-S320;

[0108] Step S315: Verify the temporary verification code of the door lock body (smart door lock);

[0109] Step S316: Local computation verification of WIFI-BLE module (smart door lock);

[0110] Step S317: The WIFI-BLE module (smart lock) returns the verification result from step S316 to the lock body (smart lock);

[0111] If the verification is successful, proceed to steps S318-S319:

[0112] Step S318: The door lock body (smart door lock) unlocks and alerts the visitor;

[0113] Step S319: Delete both the old and new challengeCodes;

[0114] Step S320: The door lock body (smart door lock) returns a successful unlocking response (control response);

[0115] Step S321: The WIFI-BLE module (smart lock) returns a successful unlocking response (control response);

[0116] Step S322: The large loop control path (cloud platform) returns a successful unlock (control response);

[0117] Step S323: The door lock details page (mobile app) notifies users that the lock is open;

[0118] Step S324: The door lock body (smart door lock) verifies whether the previous challengeCode is within its validity period (90s);

[0119] If step S324 verifies that the previous challengeCode is not within its validity period (90s), proceed to steps S325-S328:

[0120] Step S325: The door lock body (smart door lock) returns an unlocking failure (control response);

[0121] Step S326: The WIFI-BLE module (smart lock) returns an unlocking failure message to the main loop control path (cloud platform);

[0122] Step S327: The large loop control path (cloud platform) returns an unlocking failure (control response) to the door lock details page (mobile app);

[0123] Step S328: The door lock details page (mobile app) prompts the user that the door lock failed and the visitor needs to ring the doorbell again;

[0124] If step S324 verifies that the previous challengeCode is within its validity period (90s), then proceed to steps S329-S339.

[0125] Step S329: Verify the temporary verification code of the device (same as steps S313 to S315);

[0126] Step S330: Local computation verification of WIFI-BLE module (smart door lock);

[0127] Step S331: The WIFI-BLE module (smart lock) returns the verification result from step S330 to the lock body (smart lock);

[0128] If the verification in step S331 is successful, proceed to steps S332-S334:

[0129] Step S332: Unlock the door lock body (smart door lock);

[0130] Step S333: Unlock the door lock body (smart door lock) and delete both the old and new challenge codes;

[0131] Step S334: The door lock body (smart door lock) prompts the user that the lock is open;

[0132] Step S335: The door lock body (smart door lock) returns a successful unlocking (control response) to the WIFI-BLE module (smart door lock);

[0133] Step S336: The WIFI-BLE module (smart door lock) returns a successful unlocking message to the main loop control path (cloud platform);

[0134] Step S337: The large-loop control path (cloud platform) returns a successful unlocking response to the door lock details page (mobile app);

[0135] Step S338: The door lock details page (mobile app) prompts the user that the door lock is open;

[0136] If the verification in step S331 fails, proceed to steps S339-S342:

[0137] Step S339: The door lock body (smart door lock) returns an unlocking failure (control response) to the WIFI-BLE module (smart door lock);

[0138] Step S340: The WIFI-BLE module (smart door lock) returns an unlocking failure message to the main loop control path (cloud platform);

[0139] Step S341: The large loop control path (cloud platform) returns to the door lock details page (mobile app) after the unlocking failure (control response);

[0140] Step S342: The door lock details page (mobile app) prompts the user that the door lock failed to open and the visitor needs to ring the doorbell again.

[0141] In one optional embodiment, when a visitor arrives at a time when the homeowner is not home, the visitor rings the doorbell. The homeowner's mobile app receives a notification that a visitor has arrived and displays a photo of the visitor taken by the door lock, along with a countdown timer. The homeowner confirms that they can open the door for the visitor and clicks the unlock button on the mobile app within the countdown. The door lock automatically opens, and the visitor enters. This is the "basic usage process".

[0142] Since the remote unlocking process is actually initiated by the door lock, even if a hacker exploits a cloud security vulnerability to directly issue a remote unlocking command to the user's door lock, the door lock will not open because there is no challengeCode temporarily generated by the device. The device dynamically generates a challengeCode to initiate the process, preventing hackers from simulating remote door opening.

[0143] Once a challengeCode lock is generated, it is only retained for 90 seconds and destroyed after one use. Therefore, even if a hacker obtains a previously generated and used temporary device verification code and carries it when simulating remote unlocking commands, the lock will not open. The challengeCode has an expiration time and is only used once to prevent hackers from simulating remote unlocking.

[0144] It should be noted that the vocabulary used in the above steps is explained as follows:

[0145] The owner, who owns the door lock, can receive visitor notifications via a mobile app;

[0146] Visitors, those who need to ring the doorbell to ask the homeowner to unlock the door (such as relatives, nannies, etc.);

[0147] The door lock details page and the door lock function page on the mobile app are both accessed by the homeowner to receive visitor notifications and remotely unlock the door.

[0148] The password service center provides a service on the cloud platform for applying for temporary verification codes for devices.

[0149] The large-loop control path, a service for data forwarding between devices and mobile apps on the cloud platform, mainly includes the following functions (relying on a binding relationship between the device and the owner in the cloud (e.g., the binding relationship between the user and the device can be directly entered in the cloud platform backend). The device-owner binding function is not included in this patent and will not be described in detail):

[0150] Event reporting and push: Devices can report events directly through a long connection to the cloud platform; mobile phones can also access the cloud platform through a long connection, and the cloud platform can send the device event reports directly to the mobile phone through the long connection.

[0151] Control and Response: As above, both mobile phones and devices connect to the platform via a long connection, allowing them to control and forward control and response commands through the long connection to the cloud.

[0152] The WIFI module is a module program on the smart door lock that communicates with the cloud platform via WIFI. The temporary verification code verification of the device is performed through the WIFI module.

[0153] The lock body is the device program on a smart lock (equipped with a camera and doorbell) that is responsible for the lock's own functions (such as doorbell, photo taking, and unlocking).

[0154] It should be noted that the temporary verification code generation and verification algorithm in the above steps are as follows:

[0155] The temporary device verification code is used for further security verification of a single end-to-end transaction; it is mainly used in scenarios where the device initiates the transaction and the application responds, requiring further security verification by the device (such as a doorbell call for remote unlocking).

[0156] The key elements for generating temporary device verification codes are as follows:

[0157] The four essential elements for generating a temporary device verification code:

[0158] Device ID, a publicly disclosed unique identifier for each device, is unique and is embedded in the device program (Factor A: Identification Factor);

[0159] Device localkey, a confidential and periodically updated device key. The process for obtaining and updating the device localkey will be described later (Factor B: Key Factor);

[0160] Time (10-minute level), a dynamic value that changes over time (factor C: dynamic factor);

[0161] challengeCode, a random string generated by the device (door lock) (factor D: dynamic factor);

[0162] Alternatively, salt can be used to make the password more random and harder to crack.

[0163] In addition, the algorithms for obtaining and generating temporary verification codes for devices include the following:

[0164] Algorithm for obtaining and generating temporary verification codes for devices:

[0165] The host receives a push notification via a mobile app (carrying the visitor's photo and challenge code), and the visitor's photo and countdown are displayed.

[0166] The owner decides to unlock the device and clicks the unlock button on the mobile app. At this time, the mobile app obtains a temporary verification code for the device from the cloud platform - password service center.

[0167] The cloud platform-cryptography service center calculates the 10-minute time based on the current second-level timestamp ts. The algorithm is: 10-minute time T10 = (ts / 600) * 600;

[0168] The cloud platform-password service center uses (device ID, device localkey, time (10-minute time T10), challengeCode, salt) to perform SHA256 to generate a 32-byte password sequence; and extracts the last 8 bytes from the 32-byte password sequence, converts them into a lowercase Hex string (fixed length 16 characters, character set [0-9a-f]) as a temporary device verification code and returns it to the mobile app.

[0169] If the mobile app successfully obtains the data, it will directly send a remote unlocking command to the device through the cloud platform - large loop control channel, which carries the device's temporary verification code.

[0170] In addition, the temporary verification code verification process for the device is as follows:

[0171] 1. Device temporary verification code verification process:

[0172] 2. After receiving the remote unlocking command forwarded by the WIFI module, the door lock body separately calls the "Device Temporary Verification Code Verification" interface of the WIFI module to verify the device temporary verification code (for other judgment logic of the door lock body, please refer to the flowchart; this section only focuses on describing the verification calculation part).

[0173] 3. The WIFI module calculates the current 10-minute time based on the current second-level timestamp ts. The algorithm is: 10-minute time T10 = (ts / 600) * 600.

[0174] 4. The WIFI module uses (device ID, device localkey, time (10-minute time T10), challengeCode, salt) to perform SHA256 to generate a 32-byte password sequence (same as the generation algorithm), and extracts the last 8 bytes to convert it into a lowercase Hex string (fixed length 16 characters, character set [0-9a-f]) as the device temporary check code 1;

[0175] 5. The WIFI module calculates the previous 10-minute time based on the current second-level timestamp ts. The algorithm is: 10-minute time T10' = ((ts / 600) - 1) * 600. The device temporary verification code 2 corresponding to the previous 10-minute time T10' is calculated according to step 3.

[0176] 6. The WIFI module compares the temporary device verification code carried in the remote unlocking command transmitted from the door lock body with the two temporary device verification codes generated above (temporary device verification code 1 calculated by T10 and temporary device verification code 2 calculated by T10'):

[0177] If the temporary verification codes of the two devices do not match, a verification failure is returned to the door lock body; if the temporary verification code of either device matches successfully, a verification success is returned to the door lock body.

[0178] 7. Once the door lock body receives the verification result returned by the WIFI module, it will complete the subsequent actions according to the flowchart above.

[0179] Figure 4 This is a schematic diagram of a device temporary verification code verification method based on the verification results of an embodiment of this application:

[0180] Step S401: The WIFI-BLE module (smart door lock) initiates a connection request to the IoT cloud platform;

[0181] Step S402: The WIFI-BLE module (smart door lock) obtains the localkey (LK1) from the IoT cloud platform.

[0182] Step S403: Save LK1 (Flash save) for WIFI-BLE module (smart door lock).

[0183] Step S404: Obtain the device temporary verification code Dev TmpVerifyCode1 (generated based on LK1) from the door lock details page (mobile APP);

[0184] Step S405: The WIFI-BLE module (smart door lock) obtains the localkey (8 hours after obtaining LK1, LK2 is obtained);

[0185] If the obtained localkey (LK2) changes from the current localkey (LK1), proceed with steps S406 and S407.

[0186] Step S406: Change the current effective localkey of the WIFI-BLE module (smart door lock) to LK2 (save in Flash);

[0187] Step S407: The WIFI-BLE module (smart door lock) LK1 continues to be saved separately as a historical localkey (flash storage);

[0188] Step S408: Remotely unlock the door lock via the door lock details page (mobile app) (with DevTmpVerifyCode1);

[0189] Step S409: Verify the temporary verification code of the door lock body (smart door lock);

[0190] Step S410: The WIFI-BLE module (smart lock) is verified using LK2 (current localkey);

[0191] Step S411: The door lock body (smart door lock) returns a successful verification result;

[0192] Step S412: The WIFI-BLE module (smart door lock) determines whether LK1 was acquired within 20 minutes of LK2;

[0193] Step S413: If the verification in step S412 is not completed within 20 minutes, the WIFI-BLE module (smart door lock) returns a verification failure and proceeds to step S414.

[0194] Step S414: Verify using LK1;

[0195] Step S415: If LK1 verification is successful, return a successful verification message to the door lock body (smart door lock); if LK1 verification fails, return a failed verification message to the door lock body (smart door lock).

[0196] It should be noted that the WIFI module obtains the device localkey from the cloud platform every time it connects to the cloud platform and every 2 hours. The cloud platform determines the time since the device last obtained the new value. If it is within 8 hours, it directly returns the previously obtained localkey. If it is more than 8 hours, it generates and returns a new localkey.

[0197] To prevent the previously obtained temporary verification code from becoming unusable due to the Wi-Fi module's localkey update (once every 8 hours), the module needs to save the most recent localkey for a period of time (20 minutes) for temporary verification code verification.

[0198] Optional, Figure 5 This is a schematic diagram illustrating the generation and usage period extrapolation of a temporary device verification code (challengeCode) according to an embodiment of this application; for example... Figure 5 As shown in the diagram, each challengeCode has a validity period of 90 seconds, and it cannot be generated again within 60 seconds. Then, within the remaining 30 seconds, if other challengeCodes exist, they can be used to unlock the smart lock.

[0199] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0200] Figure 6 This is a structural block diagram of a verification result determination device according to an embodiment of this application; as shown below. Figure 6 As shown, it includes: cloud platform 66 and smart door lock 68.

[0201] The smart lock is configured to generate a temporary unlocking event in response to a control operation by a target object. The temporary unlocking event carries a device random string generated by the smart lock. The lock then sends the temporary unlocking event to a cloud platform and receives a remote unlocking request from the cloud platform based on the temporary unlocking event. This remote unlocking request carries a temporary device verification code generated by the cloud platform based on the device random string. Finally, the lock verifies the temporary device verification code using a local device verification code stored within the smart lock to determine the verification result.

[0202] The system described above, in response to a target object's control operation on the smart lock, generates a temporary unlocking event for the smart lock. This temporary unlocking event carries a device-generated random string. The system then sends the temporary unlocking event to a cloud platform and obtains a remote unlocking request from the cloud platform based on the event. This remote unlocking request carries a temporary device verification code generated by the cloud platform based on the device-generated random string. The system then uses a local device verification code stored within the smart lock to verify the temporary device verification code, determining the verification result. This system addresses the low security of current unlocking event verification codes in related technologies, thereby significantly improving the security performance of the smart lock.

[0203] In one exemplary embodiment, the smart lock is further configured to: when it is determined that the device random string is valid, verify the device temporary verification code using a device local verification code stored in the smart lock; when it is determined that the device random string is invalid, determine whether other device random strings stored in the smart lock are valid, wherein the generation time of the other device random strings is earlier than the generation time of the device random string; when it is determined that the other device random string is valid, obtain other device local verification codes generated by the smart lock based on the other device random strings, and verify the device temporary verification code using the other device local verification codes and the device local verification codes.

[0204] In an exemplary embodiment, the smart lock is further configured to: obtain a first valid time period preset for the device random string before verifying the device temporary verification code using the device local verification code stored in the smart lock; wherein the first valid time period includes a first effective time and a first invalid time, wherein the first effective time of the device random string is the time when the device random string is generated; determine the unlocking time indicated by the remote unlocking request; if the unlocking time is later than the first invalid time, determine that the device random string is in an invalid state; if the unlocking time is not later than the first invalid time, determine that the device random string is in a valid state.

[0205] In an exemplary embodiment, the smart lock is further configured to, before verifying the temporary verification code of the device using the device local verification code stored in the smart lock, obtain a second valid time period preset for the random string of the other device, wherein the valid time period includes a second effective time and a second expiration time, wherein the second effective time of the random string of the other device is the generation time of the random string of the other device; determine the unlocking time indicated by the remote unlocking request; if the unlocking time is later than the second expiration time, determine that the random string of the other device is in an invalid state; if the unlocking time is not later than the second expiration time, determine that the random string of the other device is in a valid state.

[0206] In an exemplary embodiment, the smart lock is further configured to determine whether there is an overlapping time period between a first valid time period preset for the random string of the device and a second valid time period preset for the random string of the other device; if it is determined that there is an overlapping time period between the first valid time period and the second valid time period, a first time period is obtained from the first valid time period, and a second time period is obtained from the second valid time period; wherein the random string of the device cannot be generated repeatedly within the first time period, and the random string of the other device cannot be generated repeatedly within the first time period; if it is determined that the overlapping time period does not belong to the first time period but belongs to the second time period, the temporary verification code of the device is verified using the local verification code of the other device and the local verification code of the device.

[0207] In an exemplary embodiment, the smart lock is further configured to generate a device local verification code based on the device random string and store it in the smart lock before verifying the device temporary verification code using the device local verification code stored in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining a second-level timestamp corresponding to the time of obtaining the remote unlocking request, and converting the second-level timestamp into an unlocking time field with a time interval of a preset time magnitude; performing hash encryption on the unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the device random string using a hash algorithm to obtain a hash encryption result; and determining the hash encryption result as the device local verification code.

[0208] In an exemplary embodiment, the smart lock is further configured to generate a device local verification code based on the device random string and store it in the smart lock before verifying the device temporary verification code using the device local verification code stored in the smart lock; wherein, generating the device local verification code based on the device random string includes: determining the second-level timestamp corresponding to the time of obtaining the remote unlocking request, converting the second-level timestamp into an unlocking time field with a preset time interval, and obtaining the previous unlocking time corresponding to the second-level timestamp; performing hash encryption on the previous unlocking time field, the device local key of the smart lock, the device number of the smart lock, and the other device random string using a hash algorithm to obtain a hash encryption result; and determining the hash encryption result as the other device local verification code.

[0209] In an exemplary embodiment, the smart lock is further configured to verify the temporary verification code of the device using the local verification code of the other device and the local verification code of the device, and after determining the verification result, if it is determined that the verification result is used to indicate that the verification of the local verification code of the other device and / or the local verification code of the device is successful, send a first prompt message to the target object, wherein the first prompt message is used to indicate that the smart lock has been successfully verified; and delete the device random string and the other device random string in the smart lock.

[0210] In an exemplary embodiment, the smart lock is further configured to verify the temporary verification code of the device using the local verification code of the other device and the local verification code of the device, and after determining the verification result, if the verification result indicates that both the local verification code of the other device and the local verification code of the device have failed to verify, send a second prompt message to the target object; wherein the second prompt message is used to indicate that the smart lock has failed to verify and to prompt the target object to perform the control operation on the smart lock again.

[0211] In an exemplary embodiment, the smart lock is further configured to, after converting the second-level timestamp into an unlocking time field with a preset time interval, determine the first establishment time of the first network connection channel established between the smart lock and the cloud platform and the second establishment time of the last network connection channel established between the smart lock and the cloud platform, provided that at least two network connection channels have been established between the smart lock and the cloud platform; and obtain the device local key of the smart lock from the cloud platform based on a comparison result of the time difference between the first establishment time and the second establishment time and a preset period time.

[0212] In an exemplary embodiment, the smart lock is further configured to determine a first device local key of the smart lock obtained from the cloud platform at the first establishment time if the time difference between the first establishment time and the second establishment time is less than or equal to a preset period time; or, if the time difference between the first establishment time and the second establishment time is greater than a preset period time, determine a second device local key of the smart lock obtained from the cloud platform at the second establishment time.

[0213] In an exemplary embodiment, the smart lock is further configured to verify the temporary verification code using the local verification code to determine a first verification result; if the first verification result is determined to be successful, send a notification message to the target object indicating that the verification result is successful; if the first verification result is determined to be unsuccessful, verify the temporary verification code using the other local verification code to determine a second verification result.

[0214] In an exemplary embodiment, the smart lock is further configured to: acquire a preset valid time period of the local verification code of the other device; determine the acquisition time period between the acquisition time of the local verification code of the device and the acquisition time of the local verification code of the other device; and, if it is determined that the preset valid time period belongs to the acquisition time period, verify the temporary verification code of the device using the local verification code of the other device.

[0215] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0216] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0217] S1, in response to the target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock;

[0218] S2, send the temporary unlocking event to the cloud platform, and obtain the remote unlocking request sent by the cloud platform based on the temporary unlocking event. The remote unlocking request carries a temporary device verification code generated by the cloud platform based on the device's random string.

[0219] S3, use the device local verification code stored in the smart lock to verify the device temporary verification code, and determine the verification result.

[0220] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0221] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0222] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0223] S1, in response to the target object's control operation on the smart lock, a temporary unlocking event of the smart lock is generated, wherein the temporary unlocking event carries a device random string generated by the smart lock;

[0224] S2, send the temporary unlocking event to the cloud platform, and obtain the remote unlocking request sent by the cloud platform based on the temporary unlocking event. The remote unlocking request carries a temporary device verification code generated by the cloud platform based on the device's random string.

[0225] S3, use the device local verification code stored in the smart lock to verify the device temporary verification code, and determine the verification result.

[0226] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0227] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0228] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0229] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method of determining a result of a verification, characterized by, The method comprises: in response to a control operation of a target object on a smart door lock, generating a temporary unlocking event of the smart door lock, wherein the temporary unlocking event carries a device random string generated by the smart door lock; sending the temporary unlocking event to a cloud platform and obtaining a remote unlocking request sent by the cloud platform based on the temporary unlocking event, wherein the remote unlocking request carries a device temporary verification code generated by the cloud platform based on the device random string; verifying the device temporary verification code using a device local verification code stored in the smart door lock to determine a verification result; verifying the device temporary verification code using the device local verification code stored in the smart door lock, comprising: in a case where it is determined that the device random string is in a valid state, verifying the device temporary verification code using the device local verification code stored in the smart door lock; in a case where it is determined that the device random string is in an invalid state, determining whether another device random string stored in the smart door lock is in a valid state, wherein the generation time of the other device random string is earlier than the generation time of the device random string; in a case where it is determined that the other device random string is in a valid state, obtaining another device local verification code generated by the smart door lock based on the other device random string, and verifying the device temporary verification code using the other device local verification code and the device local verification code.

2. The method of claim 1, wherein Before verifying the device temporary verification code using the device local verification code stored in the smart door lock, the method further comprises: obtaining a first valid time period preset for the device random string, wherein the first valid time period comprises a first valid time and a first invalid time, and the first valid time of the device random string is the generation time of the device random string; determining an unlocking time indicated by the remote unlocking request; in a case where it is determined that the unlocking time is later than the first invalid time, determining that the device random string is in an invalid state; in a case where it is determined that the unlocking time is not later than the first invalid time, determining that the device random string is in a valid state.

3. The method of claim 1, wherein Before verifying the device temporary verification code using the device local verification code stored in the smart door lock, the method further comprises: obtaining a second valid time period preset for the other device random string, wherein the second valid time period comprises a second valid time and a second invalid time, and the second valid time of the other device random string is the generation time of the other device random string; determining an unlocking time indicated by the remote unlocking request; in a case where it is determined that the unlocking time is later than the second invalid time, determining that the other device random string is in an invalid state; in a case where it is determined that the unlocking time is not later than the second invalid time, determining that the other device random string is in a valid state.

4. The method of claim 2 or 3, wherein verifying the device temporary verification code using the other device local verification code and the device local verification code, comprising: determining whether there is an overlapping time period between a first valid time period preset for the device random string and a second valid time period preset for the other device random string; in a case where it is determined that there is an overlapping time period between the first valid time period and the second valid time period, obtaining a first time period from within the first valid time period and a second time period from within the second valid time period; wherein the device random string cannot be repeatedly generated within the first time period, and the other device random string cannot be repeatedly generated within the first time period; in a case where it is determined that the overlapping time period does not belong to the first time period and belongs to the second time period, using the other device local verification code and the device local verification code to verify the device temporary verification code.

5. The method of claim 1, wherein Before using the device local verification code stored in the smart door lock to verify the device temporary verification code, the method further comprises: generating the device local verification code based on the device random string and storing it to the smart door lock; wherein the generating the device local verification code based on the device random string comprises: determining a second-level time stamp corresponding to the acquisition time of the remote unlocking request, and converting the second-level time stamp into an unlocking time field with a preset time magnitude as a time interval; using a hash algorithm to hash encrypt the unlocking time field, the device local key of the smart door lock, the device number of the smart door lock and the device random string, to obtain a hash encryption result; determining the hash encryption result as the device local verification code.

6. The method of claim 1, wherein Before using the device local verification code stored in the smart door lock to verify the device temporary verification code, the method further comprises: generating the device local verification code based on the device random string and storing it to the smart door lock; wherein the generating the device local verification code based on the device random string comprises: determining a second-level time stamp corresponding to the acquisition time of the remote unlocking request, converting the second-level time stamp into an unlocking time field with a preset time magnitude as a time interval, and obtaining the last unlocking time corresponding to the second-level time stamp; using a hash algorithm to hash encrypt the last unlocking time field, the device local key of the smart door lock, the device number of the smart door lock and the other device random string, to obtain a hash encryption result; determining the hash encryption result as the other device local verification code.

7. The method of claim 1, wherein After using the other device local verification code and the device local verification code to verify the device temporary verification code and determining the verification result, the method further comprises: in a case where it is determined that the verification result indicates that the other device local verification code and / or the device local verification code verification is successful, sending a first prompt message to the target object, wherein the first prompt message is used to prompt that the smart door lock verification is successful; deleting the device random string and other device random string in the smart door lock.

8. The method of claim 1, wherein, After the other device local verification code and the device local verification code are used to verify the device temporary verification code, and the verification result is determined, the method further includes: In a case where it is determined that the verification result indicates that the other device local verification code and the device local verification code both fail to pass the verification, a second prompt message is sent to the target object; The second prompt message is used to prompt the smart door lock that the verification fails, and prompt the target object to perform the control operation on the smart door lock again.

9. The method of claim 5 or 6, wherein After the second-level timestamp is converted into an open door time field with a preset time scale as a time interval, the method further includes: In a case where it is detected that at least two network connection channels are established between the smart door lock and the cloud platform, a first establishment time when the first network connection channel is established between the smart door lock and the cloud platform and a second establishment time when the last network connection channel is established between the smart door lock and the cloud platform are determined; According to a comparison result of a time difference value of the first establishment time and the second establishment time and a preset period of time, a device local key of the smart door lock is obtained from the cloud platform.

10. The method of claim 9, wherein the determination of the result of the verification is based on the result of the verification. According to a comparison result of a time difference value of the first establishment time and the second establishment time and a preset period of time, a device local key of the smart door lock is obtained from the cloud platform, including: In a case where it is determined that the time difference value of the first establishment time and the second establishment time is less than or equal to the preset period of time, it is determined that the first device local key of the smart door lock obtained from the cloud platform at the first establishment time; Or, in a case where it is determined that the time difference value of the first establishment time and the second establishment time is greater than the preset period of time, it is determined that the second device local key of the smart door lock obtained from the cloud platform at the second establishment time.

11. The method of claim 10, wherein the determination of the verification result is based on a comparison of the first and second hash values. Using the device local verification code stored in the smart door lock to verify the device temporary verification code includes: Using the device local verification code to verify the device temporary verification code to determine a first verification result; In a case where it is determined that the first verification result is a verification success, a notification message that the verification result is a verification success is sent to the target object; In a case where it is determined that the first verification result is a verification failure, the other device local verification code is used to verify the device temporary verification code to determine a second verification result.

12. A system for determining a result of a verification, characterized by It includes: A cloud platform and a smart door lock, The smart door lock is used to generate a temporary open door event in response to a control operation of a target object, wherein the temporary open door event carries a device random string generated by the smart door lock; the temporary open door event is sent to a cloud platform, and a remote open door request sent by the cloud platform based on the temporary open door event is obtained, wherein the remote open door request carries a device temporary verification code generated by the cloud platform based on the device random string; the device local verification code stored in the smart door lock is used to verify the device temporary verification code to determine a verification result; The smart door lock is further configured to, in a case where the device random string is determined to be in a valid state, verify the device temporary verification code using a device local verification code stored in the smart door lock; in a case where the device random string is determined to be in an invalid state, determine whether another device random string stored in the smart door lock is in a valid state, wherein the another device random string is generated at a time earlier than the device random string; and in a case where the another device random string is determined to be in a valid state, acquire another device local verification code generated by the smart door lock based on the another device random string, and verify the device temporary verification code using the another device local verification code and the device local verification code.

13. A computer readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 11. 14.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 11 by using the computer program.

Citation Information

Patent Citations

  • Hard disk and server encryption locking method, server and hard disk

    CN111666598A

  • Temporary password offline verification method and system of intelligent lock and intelligent lock

    CN113593095A