Door lock temporary password generation method, system, equipment and storage medium

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

阅读说明:本技术 一种门锁临时密码生成方法、系统、设备及存储介质 (Door lock temporary password generation method, system, equipment and storage medium ) 是由 肖力 刘伯通 于 2021-07-22 设计创作,主要内容包括:本申请公开了一种门锁临时密码生成方法、系统、设备及存储介质,其中,所述方法包括:与待开锁的门锁绑定连接;获取生成临时密码的密码参数;基于临时密码的密码参数,通过加密算法生成临时密码数据组;获取临时密码数据组中预定位数的字节,生成相应预定位数的临时密码,本申请所述方案通过与门锁绑定,基于密码参数,生成临时密码数据组,并且基于临时密码数据组,生成预定位数的临时密码,降低密码泄露的风险,增加了密码安全性,保障用户的信息安全以及财产安全。(The application discloses a door lock temporary password generation method, a system, equipment and a storage medium, wherein the method comprises the following steps: the lock is bound and connected with a door lock to be unlocked; acquiring password parameters for generating a temporary password; generating a temporary password data set through an encryption algorithm based on the password parameters of the temporary password; the method comprises the steps of obtaining bytes of a preset digit in a temporary password data set, generating a temporary password of a corresponding preset digit, binding a door lock, generating the temporary password data set based on password parameters, generating the temporary password of the preset digit based on the temporary password data set, reducing the risk of password leakage, increasing password safety, and guaranteeing information safety and property safety of a user.)

1. A door lock temporary password generation method is characterized by comprising the following steps:

the lock is bound and connected with a door lock to be unlocked;

acquiring password parameters for generating a temporary password;

generating a temporary password data set through an encryption algorithm based on the password parameters of the temporary password;

and acquiring bytes with a predetermined number of bits in the temporary password data set, and generating a temporary password with a corresponding predetermined number of bits.

2. The door lock temporary password generation method according to claim 1, wherein the method of binding and connecting with the door lock to be unlocked includes:

binding a local area network gateway;

acquiring a plurality of pieces of door lock information of a local area network coverage range;

and selecting the door lock to be unlocked, and binding and connecting the door lock to be unlocked with the door lock to be unlocked.

3. The door lock temporary password generation method according to claim 1, wherein the method of acquiring the password parameter for generating the temporary password comprises:

acquiring a door lock secret key of a bound door lock;

acquiring Mac of the bound door lock;

and acquiring the network time.

4. The door lock temporary password generation method according to claim 3, wherein the method of generating the temporary password data set by the encryption algorithm based on the password parameter of the temporary password comprises:

performing data migration according to a first preset time based on the time stamp;

and obtaining an MD5 data group for generating the temporary password through an MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

5. The door lock temporary password generation method according to claim 1, further comprising:

and automatically updating the temporary password once every second preset time.

6. A door lock temporary password generation system, comprising:

the binding module is used for binding and connecting with a door lock to be unlocked;

the password parameter acquisition module is used for acquiring password parameters for generating the temporary password;

the temporary password data group generation module is used for generating a temporary password data group through an encryption algorithm based on the password parameters of the temporary password;

and the temporary password generating module is used for acquiring bytes with preset digits in the temporary password data set and generating a temporary password with corresponding preset digits.

7. The door lock temporary password generation system according to claim 6, wherein the parameters acquired by the password parameter acquisition module include: a door lock key of the bound door lock, Mac of the bound door lock, and network time.

8. The door lock temporary password generation system according to claim 7, wherein the temporary password data set generation module includes:

a time shift unit for shifting data by a first predetermined time based on the time stamp;

and the MD5 data group generating unit is used for obtaining an MD5 data group for generating the temporary password through the MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

9. A door lock temporary password generation apparatus comprising a memory and a processor, the memory storing a computer program that can be loaded by the processor and executes the door lock temporary password generation method according to any one of claims 1 to 5.

10. A storage medium storing a computer program that can be loaded by a processor and executes the door lock temporary password generation method according to any one of claims 1 to 5.

Technical Field

The present application relates to the field of key generation, and in particular, to a method, a system, a device, and a storage medium for generating a temporary password of a door lock.

Background

Along with the development of technology, more and more intelligent cabinets are widely used in life, for example, express delivery cabinets, self-service sales cabinets and the like, the intelligent cabinets generally send passwords to mobile phones of users, or the users check unlocking keys through APP and then unlock through the keys, but in the existing scheme, due to the problem of network transmission, equipment passwords can be easily leaked, so that a customer door lock is opened, and loss is caused to customers.

Therefore, the prior art has yet to be improved based on the above problems.

Disclosure of Invention

The purpose of this application is to improve the security of a door lock key.

The technical purpose of the application is realized by the following technical scheme:

in a first aspect of the present application, a method for generating a temporary password of a door lock is disclosed, wherein the method includes:

the lock is bound and connected with a door lock to be unlocked;

acquiring password parameters for generating a temporary password;

generating a temporary password data set through an encryption algorithm based on the password parameters of the temporary password;

and acquiring bytes with a predetermined number of bits in the temporary password data set, and generating a temporary password with a corresponding predetermined number of bits.

According to the scheme, after the temporary password is bound with the door lock to be unlocked, the password parameter for generating the temporary password is acquired firstly, the temporary password data set is generated based on the password parameter, the byte of the password number is acquired from the temporary password data set, the temporary password is generated, the safety of the temporary password is guaranteed, the leakage of the password is avoided, and the safety is guaranteed.

Optionally, the method for generating the temporary password for the door lock includes:

binding a local area network gateway;

acquiring a plurality of pieces of door lock information of a local area network coverage range;

and selecting the door lock to be unlocked, and binding and connecting the door lock to be unlocked with the door lock to be unlocked.

According to the technical scheme, the door lock information in the local area network is acquired by binding the local area network gateway, and the door lock information is bound with the door lock needing to be unlocked, so that the data security and the stability are ensured, the data transmission is stable after the binding, and the data security is improved.

Optionally, the door lock temporary password generating method includes the steps of:

acquiring a door lock secret key of a bound door lock;

acquiring Mac of the bound door lock;

and acquiring the network time.

According to the scheme, the temporary password is generated based on the password parameters, the password parameters specifically comprise the bound door lock secret key, the door lock Mac and the network time, and the door lock secret key, the door lock Mac and the network time are relatively stable.

Optionally, the door lock temporary password generating method, wherein the method for generating the temporary password data set through the encryption algorithm based on the password parameter of the temporary password includes:

performing data migration according to a first preset time based on the time stamp;

and obtaining an MD5 data group for generating the temporary password through an MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

According to the scheme, data migration is performed according to the first preset time based on the network time, the safety of the data is further improved, and the uniqueness of the data group of the temporary password can be further ensured through the MD5 algorithm, so that the safety of the data is further ensured.

Optionally, the door lock temporary password generating method further includes:

and automatically updating the temporary password once every second preset time.

According to the scheme, the temporary password is automatically updated once every second preset time, the password is refreshed periodically, the update of the temporary password can be guaranteed, and the password leakage risk is further reduced.

On the other hand, the application also discloses a door lock temporary password generation system, wherein, include:

the binding module is used for binding and connecting with a door lock to be unlocked;

the password parameter acquisition module is used for acquiring password parameters for generating the temporary password;

the temporary password data group generation module is used for generating a temporary password data group through an encryption algorithm based on the password parameters of the temporary password;

and the temporary password generating module is used for acquiring bytes with preset digits in the temporary password data set and generating a temporary password with corresponding preset digits.

According to the scheme, after the temporary password is bound with the door lock to be unlocked, the password parameter for generating the temporary password is acquired firstly, the temporary password data set is generated based on the password parameter, the byte of the password number is acquired from the temporary password data set, the temporary password is generated, the safety of the temporary password is guaranteed, the leakage of the password is avoided, and the safety is guaranteed.

Optionally, the door lock temporary password generating system, wherein the parameters acquired by the password parameter acquiring module include: a door lock key of the bound door lock, Mac of the bound door lock, and network time.

According to the scheme, the temporary password is generated based on the password parameters, the password parameters specifically comprise the bound door lock secret key, the door lock Mac and the network time, and the door lock secret key, the door lock Mac and the network time are relatively stable.

Optionally, the door lock temporary password generating system, wherein the temporary password data set generating module includes:

a time shift unit for shifting data by a first predetermined time based on the time stamp;

and the MD5 data group generating unit is used for obtaining an MD5 data group for generating the temporary password through the MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

According to the scheme, data migration is performed according to the first preset time based on the network time, the safety of the data is further improved, and the uniqueness of the data group of the temporary password can be further ensured through the MD5 algorithm, so that the safety of the data is further ensured.

In another aspect of the present application, a door lock temporary password generating device is also disclosed, wherein the door lock temporary password generating device includes a memory and a processor, and the memory stores a computer program which can be loaded by the processor and executes the door lock temporary password generating method.

According to the scheme, the device is disclosed, and the memory stores the computer program which can be loaded by the processor and executes the method, so that interaction between the device and the door lock can be realized, and the safety of unlocking the door lock by a user is improved.

In another aspect of the present application, a storage medium is also disclosed, in which a computer program capable of being loaded by a processor and executing the door lock temporary password generation method as described above is stored.

According to the scheme, the storage medium stores the computer program of the method, and the computer program can be loaded and run after the mobile terminal is installed, so that interaction between the mobile terminal and the door lock is realized, a user can conveniently open the door lock, and the safety of opening the door lock is improved.

In summary, the present application discloses a door lock temporary password generation method, system, device and storage medium, wherein the method includes: the lock is bound and connected with a door lock to be unlocked; acquiring password parameters for generating a temporary password; generating a temporary password data set through an encryption algorithm based on the password parameters of the temporary password; the method comprises the steps of obtaining bytes of a preset digit in a temporary password data set, generating a temporary password of a corresponding preset digit, binding a door lock, generating the temporary password data set based on password parameters, generating the temporary password of the preset digit based on the temporary password data set, reducing the risk of password leakage, increasing password safety, and guaranteeing information safety and property safety of a user.

Drawings

Fig. 1 is a flowchart illustrating steps of a door lock temporary password generation method according to the present application.

Fig. 2 is a flowchart of S1 of the door lock temporary password generation method according to the present application.

Fig. 3 is a flowchart of step S3 of the door lock temporary password generation method according to the present application.

Fig. 4 is a block diagram of a door lock temporary password generation system according to the present application.

Fig. 5 is a block diagram of a temporary password data set generation module of the door lock temporary password generation system according to the present application.

Detailed Description

The present application is described in further detail below with reference to figures 1-5.

This application is based on among the prior art, the lock is opened the in-process, sends key to user terminal through the lock server, and user terminal directly opens the lock according to the key, but in network transmission process, receives the influence of network easily, is cracked by other people to cause the user loss, based on above-mentioned problem, this application discloses a door lock temporary password generation method, can be when the user needs to open the lock, generates the temporary password of lock, and the user can use the door lock is opened to temporary password, perhaps through sharing, shares for other people with the lock temporary password, is replaced by other people and opens the lock, has guaranteed data security. Specifically, in the embodiment of the present application, referring to fig. 1, which is a flowchart of steps of the method, the method for generating a temporary password for a door lock includes:

s1, binding and connecting with a door lock to be unlocked;

s2, acquiring password parameters for generating a temporary password;

s3, generating a temporary password data set through an encryption algorithm based on password parameters of the temporary password;

and S4, acquiring bytes with preset digits in the temporary password data set, and generating a temporary password with corresponding preset digits.

In the embodiment of the application, when a user needs to unlock a door lock, the user firstly binds with the door lock to be unlocked, at the same time, the door lock to be unlocked can only be bound with one user end, uniqueness is ensured, data security is improved, a temporary password needs to be generated after the door lock is bound with the door lock, in the embodiment of the application, data sources are needed for generating the temporary password, the data sources are password parameters, password parameters for generating the temporary password are obtained, data are extracted from the password parameters based on the password parameters, and a temporary password data group is generated, because the data length of the temporary password data group is greater than that of the temporary password, bytes with a preset number of bits are obtained from the data of the temporary password data group to form the temporary password, in the preferred embodiment of the application, the temporary password of the door lock is preferably an 8-bit password, in the embodiment of the application, the door lock is based on the same method, the temporary password is generated, the temporary password at the door lock end is consistent with the temporary password generated by the user side, so that after the temporary password is generated, a user can directly open the door lock through the temporary password, or the user shares the temporary password with other equipment or a mobile terminal, and the door lock can be opened as well.

In the foregoing solution, a user may be bound and connected with a door lock through a mobile terminal, and after the bound and connected, the door lock and the mobile terminal are in one-to-one correspondence, so as to ensure data uniqueness, specifically, in this embodiment of the application, the method for generating a temporary password for a door lock is a flowchart of step S1, referring to fig. 2, where the method for bound and connected with a door lock to be unlocked includes:

s101, binding a local area network gateway;

s102, acquiring a plurality of pieces of door lock information of a local area network coverage range;

s103, selecting the door lock to be unlocked and binding and connecting the door lock to be unlocked.

In the embodiment of the application, when the user side needs to open the door lock, the gateway of the local area network where the door lock is located is firstly bound, all door lock information in the coverage range of the local area network is obtained, the user can select the door lock to be opened, the door lock to be opened is bound and connected with the door lock to be unlocked, when the door lock is bound and connected, verification is needed, the door lock to be bound is ensured to be matched with the user, the user bound with the door lock is also ensured to be matched, the mistaken binding is avoided, the door lock is staggered, after the verification is passed, the user side is also bound with the door lock of the user, data interaction can be realized, and the data security is ensured.

In the foregoing solution, after the user establishes the binding connection with the door lock, the generation of the temporary password is based on the password parameter, and the password parameter is encrypted to generate the temporary password data set.

Acquiring a door lock secret key of a bound door lock;

acquiring Mac of the bound door lock;

and acquiring the network time.

In the embodiment of the application, in order to ensure the security of data, after a user terminal is bound with a door lock to be unlocked, password parameters for generating a temporary password are obtained, wherein the password parameters comprise a door lock secret key of the door lock bound with the user terminal, a Mac of the door lock bound with the user terminal and network time, the door lock secret key of the bound door lock is fixed and unique, the Mac of the bound door lock is fixed and unique, the network time is standard time when the user needs to generate the temporary password, and the standard time is different at different time points, so that the data in a generated temporary password data set is relatively stable and is not easy to be cracked by other people based on the parameters, thereby ensuring the security of the data and ensuring the uniqueness of the temporary password,

in the foregoing solution, based on the bound door lock key of the door lock, the Mac of the door lock, and the network time, the temporary password data set may be generated by encryption, and in order to further ensure the security of the data, the data is encrypted by an encryption algorithm, in this embodiment of the present application, further, the door lock temporary password generation method refers to fig. 3, which is a flowchart of step S3, where the method for generating the temporary password data set by the encryption algorithm based on the password parameter of the temporary password includes:

s301, data migration is carried out according to first preset time based on the time stamp;

s302, obtaining an MD5 data set for generating a temporary password through an MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

In the embodiment of the present application, it is mentioned in the foregoing solution that the door lock key and the door lock Mac of the bound door lock are fixed and unique, and the network time may be that other users request to unlock at the same time, so in the present application, in order to further prevent the data from being decrypted, a data offset manner is adopted, and based on the acquired network time, the timestamp is subjected to data offset according to the first predetermined time based on the acquired network time, in the embodiment of the present application, for example, the timestamp is offset backwards by 30 minutes, for example, the current network time 08:30 is acquired, and the current network time is offset backwards by 30 minutes, that is, the timestamp becomes 09:00, in the embodiment of the present application, optionally, the number of bits of the temporary password may be set, and in order to expand the data amount of the temporary password data group, the byte length of the network time may be increased, for example, the timestamp 08:30 may be selected, the date 05/10/08:30, namely 8:30 of 5 month 30, further, the year 21/05/30/08:30, for example, can be selected, the byte length of the temporary password data group is further increased, of course, the specific temporary password adopts a 10-system mode, and the door lock key and the door lock Mac can be converted into decimal data according to needs.

In this embodiment of the application, further, in order to implement timeliness of the temporary password, the method for generating the temporary password for the door lock further includes:

and automatically updating the temporary password once every second preset time.

In this embodiment of the application, the temporary password is automatically updated once every second predetermined time, so as to further ensure the security of the data, where the second predetermined time is preferably 5 minutes, and in a specific implementation, the method further includes, for the timestamp, obtaining the remainder according to the second predetermined time, for example, in an embodiment, the second predetermined time is 5 minutes, obtaining the remainder according to 5 minutes, and displaying the remainder at the user end, after the temporary password is generated, the user end displays the password expiration time, and when the network time reaches the password expiration time, the temporary password is automatically updated, the method for generating the temporary password at the user end is consistent with the method for generating the temporary password at the device, that is, the door lock key, the device Mac, and the timestamp, and the offset are consistent, that is, the temporary password at the door lock end is consistent with and synchronous with the temporary password at the user end, so as to achieve the unlocking of the temporary password, and updating the temporary passwords of the door lock end and the user end every 5 minutes until the next 5 minutes, and sharing the temporary passwords by the user after obtaining the temporary passwords.

In the embodiment of the application, the user side can set the verification mode, when the user quits the temporary password interface and then enters the temporary password display interface again, the user needs to pass the verification, such as fingerprint verification and/or password verification, and after the verification passes, the user enters the temporary password display interface, so that the data security is further ensured.

In another aspect of the present application, a door lock temporary password generating system is further disclosed, referring to fig. 4, which is a block diagram of the structure of the system, where the system includes:

the binding module 100 is used for binding and connecting with a door lock to be unlocked;

a password parameter obtaining module 200, configured to obtain a password parameter for generating a temporary password;

a temporary password data group generating module 300, configured to generate a temporary password data group through an encryption algorithm based on a password parameter of the temporary password;

the temporary password generating module 400 is configured to obtain bytes with a predetermined number of bits in the temporary password data set, and generate a temporary password with a corresponding predetermined number of bits.

In the embodiment of the application, after the door lock to be unlocked is bound, the password parameter for generating the temporary password is acquired firstly, then the temporary password data set is generated based on the password parameter, the byte of the password number is acquired from the temporary password data set, the temporary password is generated, the safety of the temporary password is ensured, the leakage of the password is avoided, and the safety is ensured. The specific implementation of each module is described in the method steps, and therefore, is not described herein.

Further, the door lock temporary password generating system, wherein the parameters acquired by the password parameter acquiring module 200 include: a door lock key of the bound door lock, Mac of the bound door lock, and network time.

According to the scheme, the temporary password is generated based on the password parameters, the password parameters specifically comprise the bound door lock secret key, the door lock Mac and the network time, and the door lock secret key, the door lock Mac and the network time are relatively stable.

Further, the door lock temporary password generating system, referring to fig. 5, is a block diagram of a structure of the temporary password data set generating module 300, and specifically includes:

a time shift unit 301 configured to shift data according to a first predetermined time based on the timestamp;

and the MD5 data group generating unit 302 is used for obtaining an MD5 data group for generating the temporary password through the MD5 algorithm based on the door lock key of the bound door lock, the Mac of the bound door lock and the time offset.

In the above scheme of the present application, data shifting is performed according to the first predetermined time based on the network time, so as to further improve the security of the data, and the uniqueness of the data group of the temporary password can be further ensured through the MD5 algorithm, so as to further ensure the security of the data.

In another aspect of the present application, a door lock temporary password generating device is also disclosed, wherein the door lock temporary password generating device includes a memory and a processor, and the memory stores a computer program which can be loaded by the processor and executes the door lock temporary password generating method.

In another aspect of the present application, a storage medium is also disclosed, in which a computer program capable of being loaded by a processor and executing the door lock temporary password generation method as described above is stored.

The embodiments of the present invention are preferred embodiments of the present application, and the scope of protection of the present application is not limited by the embodiments, so: all equivalent changes made according to the structure, shape and principle of the present application shall be covered by the protection scope of the present application.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种智能门锁安防系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!