Intelligent lock and off-line verification method and system for temporary password of intelligent lock

文档序号:192878 发布日期:2021-11-02 浏览:43次 中文

阅读说明:本技术 一种智能锁的临时密码离线验证方法、系统及智能锁 (Intelligent lock and off-line verification method and system for temporary password of intelligent lock ) 是由 王妙玉 周亮 蔡民浩 吴宁泉 于 2021-08-19 设计创作,主要内容包括:本发明公开了一种临时密码离线验证方法及系统,应用于智能锁,其离线验证方法包括锁端响应于唤醒指令获取锁端密钥和唤醒时间,结合锁端密钥和唤醒时间生成锁端有效期限内所对应的若干组目标密码;锁端接收云端根据云端有效时间所生成的临时密码后,将临时密码和若干组目标密码进行比对以获得验证结果。本发明在锁端唤醒时生成若干个目标密码,将目标密码和用户输入的临时密码进行比对从而完成密码验证操作。本发明的锁端可在离线状态下主动生成目标密码,可完成正常的临时密码验证步骤外,还可减少对网络的依赖,减少锁端能耗,确保锁端的安全性。(The invention discloses a temporary password offline verification method and a temporary password offline verification system, which are applied to an intelligent lock, wherein the offline verification method comprises the steps that a lock end responds to a wake-up command to obtain a lock end secret key and wake-up time, and a plurality of groups of target passwords corresponding to the lock end within the validity period are generated by combining the lock end secret key and the wake-up time; after the lock end receives the temporary password generated by the cloud end according to the cloud end effective time, the temporary password is compared with a plurality of groups of target passwords to obtain a verification result. The invention generates a plurality of target passwords when the lock end is awakened, and compares the target passwords with temporary passwords input by a user so as to finish password verification operation. The lock end of the invention can actively generate the target password in an off-line state, can complete the normal temporary password verification step, and can reduce the dependence on the network, reduce the energy consumption of the lock end and ensure the safety of the lock end.)

1. A temporary password offline verification method is applied to an intelligent lock and is characterized by comprising the following steps:

responding to a wake-up instruction, acquiring a lock end secret key and wake-up time, and generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the wake-up time;

and after receiving a temporary password generated by the cloud according to the cloud valid time, comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

2. The off-line verification method for temporary passwords according to claim 1, wherein the method for generating the plurality of sets of target passwords is:

marking the wake-up time when a wake-up instruction is received;

overlapping the awakening time with a preset first delay time to determine the validity period of the lock end;

and combining the lock end key and a preset time increasing rule within the validity period of the lock end to generate a plurality of groups of target passwords.

3. The off-line verification method for the temporary password as claimed in claim 1, wherein the generation method for the temporary password is:

utilizing a cloud to obtain a prestored cloud secret key and a request time corresponding to a temporary password generation request, wherein the cloud secret key is the same as the lock secret key;

and overlapping the request time with a preset second delay time to obtain a cloud valid time, and encrypting the cloud key and the cloud valid time to generate a temporary password.

4. The off-line verification method for the temporary password according to claim 3, wherein the request time is a current time of a cloud clock or a preset designated time when the request for generating the temporary password is received.

5. The off-line verification method for the temporary password according to claim 3, wherein the encryption processing method is as follows:

combining the cloud key and the cloud valid time into a character string;

the hash value of the string is computed via the MD5 algorithm to generate a digital password.

6. The off-line verification method for the temporary password according to claim 1, wherein the method for obtaining the verification result comprises:

judging whether the temporary password is the same as any one target password or not, and if so, successfully verifying; if the temporary password is different from the plurality of groups of target passwords, the verification fails.

7. The off-line verification method for temporary passwords according to claim 1, further comprising:

and judging whether the continuously input temporary passwords fail to be verified, if so, locking the input panel of the lock end within the preset time to disable the password verification function.

8. A temporary password offline verification method according to claim 1, wherein the cloud and the clock of the smart lock are always kept synchronous.

9. An off-line verification system for temporary passwords, comprising:

the cloud is used for acquiring the effective time of the cloud to generate a temporary password;

the user terminal is used for receiving and displaying the temporary password issued by the cloud end;

the intelligent lock is used for inputting the temporary password, acquiring a lock end secret key and awakening time when the intelligent lock is awakened, and generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the awakening time; and after receiving the temporary password displayed by the user terminal, comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

10. An intelligent lock, comprising a processor, a memory and a computer program stored in the memory and operable on the processor, wherein the processor implements the off-line verification method for the temporary password according to any one of claims 1 to 8 when executing the computer program.

Technical Field

The invention relates to the field of intelligent lock security verification, in particular to a temporary password offline verification method and system for an intelligent lock and the intelligent lock.

Background

At present, an intelligent lock system can generate a one-time temporary password under the condition of permission of a user, the generation method of the temporary password generally comprises the steps of generating the one-time temporary password at a cloud end, issuing the temporary password to a lock end and an APP end through a network, storing the issued password and the cloud end valid time at the lock end, then sending the one-time temporary password to a user at the APP end, inputting the password at the lock end after the user obtains the password, comparing the locally stored password with the password input by the user by the lock end, checking whether the password is correct or not, and if the password is correct, continuing to check the timeliness of the password; if the two checks pass, the lock end opens the door, and the password is invalid; if any one of the checks fails, the door is not opened.

However, the conventional temporary password generation method has the following defects: the scheme of issuing the one-time temporary password is realized on the premise that a locking end is required to be connected with a cloud end in a network and the network is smooth; this will consume a large amount of electricity at the lock end, and at the same time, the situation that the one-time temporary password is unavailable due to failure of receiving the password at the lock end caused by unstable network or delay occurs.

Disclosure of Invention

In order to overcome the defects of the prior art, one of the objectives of the present invention is to provide an offline verification method for a temporary password of an intelligent lock, so that a lock end can successfully verify whether a one-time temporary password input by a user is available under an offline condition, and meanwhile, the security of the lock end is ensured.

The invention also aims to provide an off-line verification system for the temporary password of the intelligent lock.

The invention also aims to provide an intelligent lock.

One of the purposes of the invention is realized by adopting the following technical scheme:

a temporary password offline verification method is applied to an intelligent lock and comprises the following steps:

responding to a wake-up instruction, acquiring a lock end secret key and wake-up time, and generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the wake-up time;

and after receiving a temporary password generated by the cloud according to the cloud valid time, comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

Further, the method for generating a plurality of groups of target passwords comprises the following steps:

marking the wake-up time when a wake-up instruction is received;

overlapping the awakening time with a preset first delay time to determine the validity period of the lock end;

and combining the lock end key and a preset time increasing rule within the validity period of the lock end to generate a plurality of groups of target passwords.

Further, the method for generating the temporary password comprises the following steps:

utilizing a cloud to obtain a prestored cloud secret key and a request time corresponding to a temporary password generation request, wherein the cloud secret key is the same as the lock secret key;

and overlapping the request time with a preset second delay time to obtain a cloud valid time, and encrypting the cloud key and the cloud valid time to generate a temporary password.

Further, the request time is the current time of the cloud clock when the temporary password generation request is received or preset designated time.

Further, the encryption processing method comprises the following steps:

combining the cloud key and the cloud valid time into a character string;

the hash value of the string is computed via the MD5 algorithm to generate a digital password.

Further, the method for obtaining the verification result comprises the following steps:

judging whether the temporary password is the same as any one target password or not, and if so, successfully verifying; if the temporary password is different from the plurality of groups of target passwords, the verification fails.

Further, still include:

and judging whether the continuously input temporary passwords fail to be verified, if so, locking the input panel of the lock end within the preset time to disable the password verification function.

Further, clocks of the cloud and the intelligent lock are always kept synchronous.

The second purpose of the invention is realized by adopting the following technical scheme:

a temporary password offline verification system of an intelligent lock comprises:

the cloud is used for acquiring the effective time of the cloud to generate a temporary password;

the user terminal is used for receiving and displaying the temporary password issued by the cloud end;

the intelligent lock is used for inputting the temporary password, acquiring a lock end secret key and awakening time when the intelligent lock is awakened, and generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the awakening time; and after receiving the temporary password displayed by the user terminal, comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

The third purpose of the invention is realized by adopting the following technical scheme:

an intelligent lock comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the temporary password offline authentication method of the intelligent lock.

Compared with the prior art, the invention has the beneficial effects that:

when the lock end is awakened, a plurality of target passwords are generated according to the awakening time and the secret key of the lock end, the target passwords are compared with the temporary passwords input by the user, if the temporary passwords are the same as any one of the plurality of target passwords, the fact that the time for the user to awaken the lock end and unlock the lock end is identical with the valid time corresponding to the temporary passwords means that the door opening operation can be executed after the verification is successful. The lock end of the invention can actively generate the target password in an off-line state, can complete the normal temporary password verification step, and can reduce the dependence on the network, reduce the energy consumption of the lock end and ensure the safety of the lock end.

Drawings

FIG. 1 is a schematic flow chart of a temporary password offline verification method according to the present invention;

FIG. 2 is a schematic diagram of a multi-terminal interaction of the off-line verification system for temporary passwords according to the present invention;

FIG. 3 is a block diagram of the intelligent lock of the present invention.

Detailed Description

The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.

Example one

The embodiment provides an offline verification method for a temporary password of an intelligent lock, which can complete password verification operation when a lock end is in a network-free offline state, improve verification accuracy and ensure the security of the lock end at the same time.

The verification method of the embodiment is mainly completed by the mutual cooperation of the lock end, the cloud end and the client end, wherein the cloud end needs to generate a unique key for each intelligent lock, and stores the key corresponding to each intelligent lock in the cloud end; meanwhile, the lock end also needs to store a lock end key in advance, and the lock end key records the unique key generated by the cloud end into the intelligent lock when the intelligent lock leaves the factory; therefore, the key of the intelligent lock is stored at the lock end and the cloud end.

In addition, the lock end and the cloud end in this embodiment also need to have the same clock, that is, the time of the lock end and the cloud end is synchronous, so that no deviation exists; the clock of the lock end and the clock of the cloud end can be corrected by the existing clock synchronization method, and the clock synchronization method is not the invention point of the embodiment, so the clock synchronization method is not described in detail herein.

The cloud password generation method in the embodiment comprises the following steps:

the method comprises the steps that when the cloud receives a temporary password generation request, a prestored cloud secret key is obtained, wherein the cloud secret key is the same as a lock secret key;

the cloud acquires request time when receiving a temporary password generation request, superposes preset second delay time on the request time to acquire cloud effective time, and encrypts a secret key and the cloud effective time to generate a temporary password.

In this embodiment, the cloud is connected with the client, when a user initiates a temporary password generation request at the client, the client forwards the temporary password generation request to the cloud, and the cloud receives the request and then retrieves a key of a corresponding smart lock pre-stored in the cloud; the cloud terminal receives the intelligent lock information in the request and then calls out a secret key of the intelligent lock to be used for generating a temporary password.

Meanwhile, the cloud terminal needs to acquire the current time of the cloud terminal clock as the request time after receiving the request, and generates the cloud terminal effective time by overlapping a preset second delay time on the basis of the request time, wherein the second delay time is used for providing enough time for the generation and the forwarding of the temporary password. In this embodiment, after receiving the cloud valid time, the cloud valid time is converted into milliseconds, the cloud valid time and a cloud key are combined into a character string, and the character string is subjected to hash calculation by using an MD5 algorithm to generate a 16-ary 32-bit character string; the temporary password which is formed by taking the 1 st, 3 rd, 5 th, 7 th, 9 th, 11 th and 13 th bit characters of the 32-bit character string, converting the characters larger than 9 into numbers to form 7-bit numbers is sent to the client. After receiving the temporary password through the client, the user can forward the temporary password to the user, so that the user can input the temporary password into the intelligent lock.

Before the user inputs the temporary password, the user needs to wake up the intelligent lock, and the user can wake up the intelligent lock by touching the password input panel or pushing open the shell of the intelligent lock, as shown in fig. 1, after the intelligent lock receives the wake-up command, the password verification method of the intelligent lock is as follows:

the lock end responds to the awakening instruction to obtain a lock end secret key and awakening time, and a plurality of groups of target passwords corresponding to the lock end within the validity period are generated by combining the lock end secret key and the awakening time;

after the lock end receives a temporary password generated by the cloud end according to the cloud end effective time, the temporary password is compared with the plurality of groups of target passwords to obtain a verification result.

After the intelligent lock is awakened, actively acquiring a lock end secret key pre-stored in the intelligent lock, and acquiring the current time of a lock end clock as awakening time when the intelligent lock is awakened; it should be emphasized that the lock end key and the cloud end key of the same smart lock are the same, and the lock end clock and the cloud end clock are also synchronous. After the wakeup time is obtained, the preset first delay time is further superimposed on the basis of the wakeup time to form lock end time, wherein the superimposed first delay time when the lock end generates the target password and the superimposed second delay time when the cloud end generates the temporary password may be the same or different. In this embodiment, the period of time from the wake-up time to the lock end time is the lock end validity period for generating a plurality of target passwords, and a plurality of sets of target passwords are generated within the lock end validity period according to a time increment rule, that is, a set of target passwords are generated at preset time intervals, so that a plurality of sets of target passwords are generated within the lock end validity period. And the plurality of groups of target passwords can be generated simultaneously after the awakening instruction is received, so that the plurality of groups of target passwords can be compared immediately after the user inputs the temporary password, and the password verification speed is ensured. The method for generating the target password at the lock end is the same as the method for generating the temporary password at the cloud end, and therefore, the method is not described in detail here.

After the intelligent lock obtains the temporary password and generates a plurality of groups of target passwords, judging whether the temporary password is the same as any one of the target passwords, if so, successfully verifying, and at the moment, unlocking the door lock, wherein the temporary password is invalid after successfully verifying; if the temporary password is different from the plurality of groups of target passwords, the verification fails.

For example, as shown in fig. 2, the time when the user initiates the temporary password generation request in the client is 8 am, and the cloud receives the request and then superimposes the second delay time for 20 minutes on the basis of 8 am, so that the effective time is 8 am and 20 minutes. And after the cloud generates the temporary password according to the effective time and the cloud key, the user forwards the temporary password to the user. When a user wakes up the intelligent lock, the intelligent lock immediately acquires the current time of the lock end, if the current time of the lock end is 8 o ' clock 10 minutes earlier, after a preset 20-minute first delay time is superposed on the current time of the lock end, the validity period of the coded lock end corresponding to the intelligent lock is from 8 o ' clock 10 minutes earlier to 8 o ' clock 30 minutes earlier, at the moment, the intelligent lock simultaneously generates 20 groups of target passwords according to the rule of combining the key of the lock end (the current time of the lock end + n x 1 minute), wherein n is a natural number gradually increasing from 1, and 1 minute is a preset time interval; at this time, after the lock end receives the temporary password with the cloud valid time of 20 minutes at 8 am, the temporary password is matched with a target password in the interval from 8 am, 10 minutes to 8 am and 30 minutes, the temporary password passes the verification, and the door lock is opened. If the time for the user to wake up the intelligent lock is 8 o ' clock and 30 minutes, the time interval corresponding to the 20 groups of target passwords is 8 o ' clock and 30 minutes to 8 o ' clock and 50 minutes, and at the moment, if none of the temporary passwords is matched with the 20 groups of target passwords, the verification is not passed, and the door lock cannot be unlocked.

In addition, the user can preset appointed time for generating the temporary password according to actual requirements, and after the user appoints the appointed time for generating the temporary password through the client, when the cloud terminal recognizes that the current time reaches the appointed time, the current time of the cloud terminal is obtained, and then the current time of the cloud terminal is superposed with second delay time and then is combined with the cloud terminal secret key to generate the temporary password; after the lock end generates a plurality of groups of target passwords according to the same method, whether the temporary password is consistent with any one of the target passwords in the groups of target passwords is judged, and if so, the verification is passed; if the temporary password is not consistent with the target passwords, the verification is not passed.

If the lock end fails to verify the continuously input temporary passwords, the input panel of the lock end is locked within the preset time to disable the password verification function. For example, if the temporary password input by the user three times in succession cannot match the target password generated by the lock terminal, the lock panel disables the password input function for 30 minutes.

Example two

The embodiment provides an offline verification system for a temporary password of an intelligent lock, which executes the offline verification method for the temporary password of the intelligent lock in the embodiment, as shown in fig. 2, the system mainly realizes interaction by a cloud, a user terminal and three ends of the intelligent lock. The cloud is used for generating a temporary password according to the cloud valid time; the user terminal is used for receiving and displaying the temporary password issued by the cloud end; the intelligent lock is used for acquiring a lock end secret key and awakening time during awakening, and generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the awakening time; and after receiving the temporary password displayed by the user terminal, comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

As shown in fig. 3, in order to implement the above functions, the intelligent lock of the present embodiment specifically includes the following modules:

the key acquisition module is used for acquiring a key pre-stored in the lock end and awakening time when an awakening instruction is received;

the password generation module is used for generating a plurality of groups of target passwords corresponding to the lock end within the validity period by combining the lock end secret key and the awakening time;

the receiving module is used for receiving the temporary password generated by the cloud end;

and the verification module is used for comparing the temporary password with the plurality of groups of target passwords to obtain a verification result.

EXAMPLE III

The embodiment provides an intelligent lock device, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein the processor executes the computer program to realize the temporary password offline authentication method of the intelligent lock in the first embodiment; in addition, the present embodiment also provides a storage medium, on which a computer program is stored, and when the computer program is executed, the method for offline verifying the temporary password of the smart lock is implemented.

The apparatus and the storage medium in this embodiment are based on two aspects of the same inventive concept, and the method implementation process has been described in detail in the foregoing, so that those skilled in the art can clearly understand the structure and implementation process of the system in this embodiment according to the foregoing description, and for the sake of brevity of the description, details are not repeated here.

The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种异构智能锁的控制方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!