Method, system, storage medium and electronic device for accessing door lock to gateway

Through the matching verification of the random password generated by the door lock and the terminal, the security of the gateway information connected by the door lock is ensured, the security risk problem of the door lock accessing the illegal gateway in the existing technology is solved, and the security of the door lock distribution network is improved.

CN113972996BActive Publication Date: 2024-09-17SHENZHEN TCL DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010735423.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-24
Publication Date
2024-09-17
Estimated Expiration
2040-07-24

AI Technical Summary

Technical Problem

During the existing door lock distribution network process, the door lock does not verify the legality of the connected terminals, which may lead to access to illegal gateways, which poses security risks and reduces distribution network security.

Method used

The door lock generates a random first password and verifies its legitimacy by matching it with the terminal's second password before connecting to the network and accessing the gateway to ensure the security of the received gateway information.

Benefits of technology

By verifying the legitimacy of the terminal, the security of the gateway information connected to the door lock is ensured, security risks are reduced, and the security of the door lock distribution network is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113972996B
    Figure CN113972996B
Patent Text Reader

Abstract

The present invention discloses a method, system, storage medium and electronic device for a door lock to access a gateway, the method comprising: the door lock generates a first password, and receives a second password determined by a terminal based on the first password; the door lock determines that the first password and the second password match, and then connects to the terminal through a network; when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information. By inputting the WiFi password in a terminal device in an unordered manner and the door lock confirming that the door lock securely accesses a legal gateway through a double encryption method of first password encryption verification and transmission encryption, not only the risk of information security leakage is greatly reduced, but also transmission security and information security are improved, thereby greatly facilitating users. In addition, the present invention also discloses a system and storage medium for a door lock to access a gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of door lock network distribution processing, and in particular to a method, system, storage medium and electronic equipment for accessing a door lock to a gateway. Background Art

[0002] With the development of technology, door lock products are becoming more and more popular and their types are becoming more and more diverse. The safety of door lock products has always been a concern of the public and an issue that manufacturers need to solve urgently.

[0003] At present, the door lock is connected to the network through the gateway information sent by the terminal, but the door lock does not verify whether the terminal connected to the door lock is legal. Therefore, when the door lock receives the gateway information sent by an illegal terminal, it will inevitably cause the door lock to access the illegal gateway, bringing security risks and greatly reducing the security of the door lock network configuration.

[0004] Therefore, the prior art still needs to be developed and improved. Summary of the invention

[0005] Based on this, the present invention provides a method, system, storage medium and electronic device for accessing a door lock to a gateway, so as to solve the technical problem of low security of the door lock access gateway in the prior art.

[0006] In a first aspect, an embodiment of the present invention provides a method for accessing a door lock to a gateway, comprising:

[0007] The door lock generates a first password, and receives a second password determined by the terminal based on the first password;

[0008] The door lock establishes a network connection with the terminal after determining that the first password and the second password match;

[0009] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information.

[0010] Optionally, a password order of the second password is different from a password order of the first password, wherein all characters in the second password are the same as all characters in the first password.

[0011] Optionally, the door lock generates the first password specifically including:

[0012] The door lock obtains a basic factor, and generates a ciphertext based on the basic factor;

[0013] The door lock determines the first password based on the ciphertext, wherein each character in the first password is a number.

[0014] Optionally, the basic factor includes one or more of system time, a random number, and a MAC address of the door lock.

[0015] Optionally, the door lock determines the first password based on the ciphertext specifically includes:

[0016] The door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext;

[0017] If the sum of the characters is an odd number, the door lock takes a number of odd-numbered characters in the ciphertext to form a first password;

[0018] If the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form the first password.

[0019] Optionally, the door lock determines that the first password and the second password match specifically includes:

[0020] The door lock determines a first characteristic value of the first password based on the number of times each character in the first password appears, and determines a second characteristic value of the second password based on the number of times each character in the second password appears;

[0021] When the first characteristic value is the same as the second characteristic value, the door lock determines that the first password matches the second password;

[0022] When the first characteristic value is different from the second characteristic value, the door lock determines that the first password does not match the second password.

[0023] Optionally, the gateway information is unencrypted gateway information, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information specifically includes:

[0024] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, wherein the gateway information includes a gateway identifier and a gateway password;

[0025] The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

[0026] Optionally, the gateway information is encrypted gateway information encrypted based on the second password, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information specifically includes:

[0027] The door lock successfully connects to the terminal network after replacing the first password of the door lock with the second password of the terminal;

[0028] The door lock receives gateway information, wherein the gateway information includes a gateway identifier and a gateway password;

[0029] The door lock decrypts the received gateway information according to the second password to obtain the gateway identifier and gateway password;

[0030] The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

[0031] In a second aspect, an embodiment of the present invention further provides a method for controlling a door lock to access a gateway, the method for controlling a door lock to access a gateway comprising the following steps:

[0032] The terminal obtains a second password based on the first password generated by the door lock;

[0033] The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock;

[0034] When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0035] Optionally, the terminal acquiring the second password based on the first password generated by the door lock specifically includes:

[0036] After receiving the door lock network configuration command, the terminal displays the door lock network configuration interface and obtains the device identification corresponding to the door lock;

[0037] The terminal connects to the door lock of the device identification based on the device identification, and displays a password input box;

[0038] The terminal obtains the second password through the password input box.

[0039] Optionally, the second password is determined based on the first password generated by the door lock, and a password sequence of the second password is different from a password sequence of the first password.

[0040] Optionally, when the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, specifically including:

[0041] When the terminal is successfully connected to the door lock, the terminal encrypts the gateway information based on the second password to obtain encrypted gateway information;

[0042] The terminal sends the encrypted gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, wherein the door lock is configured with the second password.

[0043] Optionally, when the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, and the method includes:

[0044] After the terminal is disconnected from the network, it connects to the gateway corresponding to the gateway information based on the gateway information.

[0045] In a third aspect, an embodiment of the present invention further provides a system for accessing a door lock to a gateway, which includes a door lock and a terminal:

[0046] The door lock is used to generate a first password and receive a second password determined by a terminal based on the first password; when it is determined that the first password and the second password match, the door lock is connected to the terminal through a network; when the door lock is successfully connected to the terminal, the door lock receives gateway information sent by the terminal and accesses a gateway corresponding to the gateway information based on the gateway information;

[0047] The terminal is used to obtain a second password based on a first password generated by a door lock; respond to connect to the door lock network after the door lock determines that the first password matches the second password; when the terminal is successfully connected to the door lock, gateway information is sent to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0048] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute a method for accessing a door lock to a gateway. The method for accessing a door lock to a gateway includes the following steps:

[0049] The door lock generates a first password, and receives a second password determined by the terminal based on the first password;

[0050] The door lock establishes a network connection with the terminal after determining that the first password and the second password match;

[0051] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information;

[0052] or

[0053] A method for controlling a door lock to access a gateway can be performed, the method comprising the following steps:

[0054] The terminal obtains a second password based on the first password generated by the door lock;

[0055] The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock;

[0056] When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0057] In a fifth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising a processor and a memory connected to the processor, the memory storing one or more programs, and the processor being configured to execute:

[0058] The door lock generates a first password, and receives a second password determined by the terminal based on the first password;

[0059] The door lock establishes a network connection with the terminal after determining that the first password and the second password match;

[0060] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information;

[0061] or the terminal obtains the second password based on the first password generated by the door lock;

[0062] The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock;

[0063] When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0064] Compared with the prior art, the embodiments of the present invention have the following advantages:

[0065] According to the method provided by the embodiment of the present invention, the method for accessing the door lock to the gateway includes the following steps: the door lock generates a first password, and receives a second password determined by the terminal based on the first password; the door lock determines that the first password and the second password match, and then connects to the terminal through the network; when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information. The method for controlling the door lock to access the gateway includes the following steps: the terminal obtains the second password based on the first password generated by the door lock; the terminal responds to the network connection with the door lock based on the door lock determining that the first password and the second password match; when the terminal is successfully connected to the door lock, the terminal sends the gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information. The present invention verifies whether the terminal is a legitimate device by matching the first password randomly generated by the door lock with the second password of the terminal, thereby ensuring the security of the gateway information received by the door lock, and then enabling the door lock to safely access the gateway, greatly reducing security risks and improving the security of the door lock network distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0067] Figure 1 and Figure 2 The figure is a schematic diagram of a framework of different exemplary application scenarios in the embodiments of the present invention.

[0068] Figure 3 The present invention is a flowchart of a method for connecting a door lock to a gateway according to an embodiment of the present invention.

[0069] Figure 4 This is a signaling diagram of a door lock accessing a gateway in an embodiment of the present invention.

[0070] Figure 5 The present invention is a flow chart of a door lock generating a first password in the method for connecting a door lock to a gateway according to an embodiment of the present invention.

[0071] Figure 6 The present invention is a schematic diagram of the structure of a system for accessing a door lock to a gateway according to an embodiment of the present invention.

[0072] Figure 7 The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0074] After research, the inventor found that the existing door lock network configuration uses the terminal to complete network access. The door lock network configuration process is usually that the user turns on the network configuration at the door lock end. At the same time, the terminal connected to the door lock selects the gateway to be accessed and enters the gateway password. Then the terminal will send the gateway identifier (Service Set IDentifier, SSID) (SSID is used to divide a wireless local area network into several sub-networks that require different identity authentications. Each sub-network requires independent identity authentication. Only users who pass the identity authentication can enter the corresponding sub-network to prevent unauthorized users from entering the network) and the gateway password to the door lock. The door lock receives the gateway identifier and gateway password to access the gateway and complete the door lock network configuration. However, during the door lock network configuration process, the door lock does not verify whether the terminal connected to the door lock is legally bound to the door lock. Therefore, once the door lock receives the gateway information sent by an illegal terminal, it will inevitably cause the door lock to access an illegal gateway, which will bring security risks and greatly reduce the security of the door lock network configuration.

[0075] In order to solve the above problems, the present invention randomly generates a first password through the door lock, and the terminal connected to the door lock obtains the second password based on the first password. Whether the terminal is legally connected to the door lock is determined by whether the first password matches the second password. Once the first password and the second password match, it means that the terminal is legal, and then the door lock receives the gateway information sent by the terminal, and the door lock accesses the gateway based on the gateway information. In this way, by verifying whether the terminal connected to the door lock is legal, the security of the gateway information received by the door lock is ensured, thereby improving the security of the door lock distribution network and reducing security risks.

[0076] For example, this embodiment can be applied to Figure 1 The scenario shown. In this scenario, the door lock 101 is connected to the terminal 102, and the door lock 101 and the terminal 102 are both connected to the gateway 103. The terminal 102 can be any device with an input function, such as a mobile phone, an iPad, a desktop computer, etc. The door lock 101 can be any door lock with an input function, such as a fingerprint door lock, a password door lock, an induction door lock, a magnetic card door lock, etc. The input function refers to an input component for inputting a password (for example: a virtual keyboard or a keypad).

[0077] Specifically, the terminal 102 is bound with a door lock control APP for controlling the door lock 101, and the gateway information is stored. Then the door lock 101 enters the network configuration interface through the input component, turns on the network connection, such as turning on the WiFi hotspot, and randomly generates a first password, and displays the first password on the display screen of the door lock 101. Then, the user enters the door lock network configuration through the door lock control APP on the terminal 102 and selects the device identification corresponding to the door lock 101, such as the door lock model. The user sequentially enters the first password in the password input box based on the first password on the terminal 102. The door lock 101 determines whether the second password is the same as the first password generated by itself. Once the door lock 101 determines that the first password is the same as the second password, the terminal 102 is a legitimate terminal device, and the door lock 101 is successfully connected to the terminal 102 to receive the gateway information sent by the terminal 102. The door lock 101 accesses the gateway according to the gateway identification and gateway password in the gateway information, and the door lock 101 network configuration is completed.

[0078] For another example: This embodiment can also be applied to Figure 2 The scenario shown. In this scenario, the door lock 101 is connected to the terminal 102, and the door lock 101 and the terminal 102 are both connected to the gateway 13, and the gateway 13 is connected to the server 14. The terminal 102 can be any device with input function, such as a mobile phone, an iPad, a desktop computer, etc. The door lock 101 can be any door lock with input function, such as a fingerprint door lock, a password door lock, an induction door lock, a magnetic card door lock, etc. The gateway 13 can be a network interconnection device such as a router, a switch, a hub, etc. for realizing interconnection between networks of different architectures. The server 14 can be a device that provides computing services, such as a file access server, a database server, an application server, a WEB server, etc.

[0079] Specifically, the terminal 102 is bound with a door lock control APP for controlling the door lock 101, and then the terminal 102 accesses the gateway 13 to obtain gateway information. Then the user enters the network configuration interface through the door lock, turns on the network connection, such as turning on the WiFi hotspot, and randomly generates a first password. The door lock 101 voice-repeats the first password in a loop. The user enters the door lock configuration through the door lock control APP on the terminal 102 and selects the device identification corresponding to the door lock 101, such as the door lock model, and then enters the second password in the password input box in a disorderly manner according to the first password. Once the door lock 101 determines that the first password matches the second password, the terminal device 11 is a legitimate terminal device, and then the terminal device 11 disconnects from the gateway 13 and sends an access connection request to the door lock 101. The door lock 101 responds to the access connection request of the terminal 102 and receives the unencrypted gateway information sent by the terminal 102. Then, the door lock 101 accesses the gateway according to the gateway identification and gateway password in the gateway information, completing the network configuration of the door lock 101. In this way, the door lock 101 is connected to the legal gateway through the dual method of random password input and legal verification of the terminal device based on the random password input, which greatly improves security.

[0080] Furthermore, in another implementation of the present embodiment, once the door lock 101 determines that the first password matches the second password, the terminal device 11 is a legitimate terminal device, and then the door lock 101 configures the second password input by the terminal 102 as the WiFi hotspot password (the first password is used as a decryption key to decrypt the encrypted gateway information), and then the door lock 101 receives the encrypted gateway information sent by the terminal 102, and decrypts the encrypted gateway information to obtain the gateway information, and then the door lock 101 accesses the gateway according to the gateway identifier and gateway password in the gateway information, completing the network configuration of the door lock 101. In this way, the door lock accesses the legitimate gateway through the triple method of disorderly input passwords, the legal verification of the terminal device based on the disorderly input passwords, and the encryption of the transmitted gateway information, which not only improves the gateway access security, but also greatly reduces the risk of information leakage, improves the information transmission security, and is convenient for users.

[0081] It should be noted that the above application scenarios are only shown to facilitate understanding of the present invention, and the embodiments of the present invention are not limited in this respect. On the contrary, the embodiments of the present invention can be applied to any applicable scenarios.

[0082] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0083] See also Figure 3 , shows a method for door lock access to gateway in this embodiment. Figure 4 The following is an example of a signaling diagram of a door lock accessing a gateway in this embodiment. Figure 3 and Figure 4As shown, in this embodiment, the method may include the following steps:

[0084] S10: The door lock generates a first password.

[0085] In this embodiment, the first password is generated by the door lock to verify whether the terminal device connected to the door lock is legal. The first password is randomly generated when the door lock detects that the user has triggered the door lock network configuration related operation. Specifically, the user enters the administrator password on the door lock, and the door lock displays the system setting menu interface after receiving the administrator password entered by the user. The user selects the door lock network configuration operation in the system setting menu interface, thereby generating a door lock network configuration signal. After the door lock detects the door lock network configuration signal, it starts the network connection, such as turning on the WiFi hotspot, and then generates a random number, and generates the first password according to one or more combinations of the random number, system time, and the MAC address of the door lock. The first password can be a combination of letters and numbers, or a password in which all characters are letters, or a password in which all characters are numbers, etc. In this embodiment, the first password is a password in which all characters are numbers.

[0086] For example, in one embodiment of the present invention, please refer to Figure 5 , the door lock generates the first password specifically including:

[0087] S11, the door lock obtains a basic factor, and generates a ciphertext based on the basic factor;

[0088] S12, the door lock determines the first password based on the ciphertext, wherein each character in the first password is a number.

[0089] Specifically, the basic factor refers to the basic factor that can be used as a random factor in the door lock to generate the first password, that is, the basic factor is used to randomly generate the first password and determine the effective matching verification time of the first password corresponding to the current door lock network configuration time based on different door lock network configuration times. The basic factor includes one or more of the system time, random number and the MAC address of the door lock.

[0090] The system time refers to the moment corresponding to when the door lock triggers the door lock network distribution requirement, and this moment is used to determine the effective verification time of the first password. For example, if the effective verification time is 1 minute, the first password display or voice broadcast starts timing, and the time when the first password successfully matches the second password is considered successful within the effective verification time. The second password refers to the password entered in the password input box obtained by the terminal device and is used to match the first password. It can be understood that when the first password matches the second password, if its duration exceeds the effective verification time, it is still considered that the verification failed. Once the verification fails, the door lock regenerates the first password and prompts the terminal device to re-enter the first password. Further, this moment can also be used to determine the display time or voice broadcast time of the first password. For example, if the effective verification time is 1 minute, the display time or voice broadcast time of the first password is 1 minute.

[0091] The random number refers to a string of characters, generated by a random number generator configured by the door lock. The random number is used to generate a dynamic password to ensure password security. The random number can be a random combination of one or more numbers, uppercase and lowercase letters. Once the random number generator detects that the door lock turns on the WiFi hotspot, the random number generator calls and generates a random number through a pseudo-random number generation function, such as random number A. The number of digits of the random number generated each time can be the same or different.

[0092] The MAC (Media Access Control Addresses, local area network address or Ethernet address) address is used to uniquely identify the location of the door lock, thereby corresponding to a unique IP address.

[0093] Then, a number of digits of characters can be directly intercepted from the basic factor as the first password. The number of digits is at least 4. For example, the number of digits intercepted is 6, 8, etc. In order to ensure the security of the first password and prevent the first password from being attacked and leaked, the basic factor can be pre-encrypted by an information digest algorithm to obtain a ciphertext, and then a number of digits of characters can be intercepted from the ciphertext to form the first password. In this way, the generated first password has dynamics, randomness and confidentiality, further improving information security. It can be understood that the information digest algorithm is a general encryption algorithm, and the information digest algorithm can be a general encryption algorithm such as RIPEMD, Haval, MD2, MD4, MD5, SHA, etc.

[0094] Furthermore, in one implementation of this embodiment, the message digest algorithm used is the MD5 (Message-Digest Algorithm 5) algorithm, which is used to ensure the integrity and consistency of information transmission and calculate the information data into another fixed length value. The MD5 algorithm has the following characteristics:

[0095] 1. Compression: For data of any length, the length of the MD5 value obtained is fixed.

[0096] 2. Easy to calculate: It is easy to calculate the MD5 value from the original data.

[0097] 3. Anti-modification: If any changes are made to the original data, even if only one byte is modified, the resulting MD5 value will be different.

[0098] 4. Strong anti-collision: The original data and its MD5 value are known. The MD5 value is used to uniquely identify the original data. It is impossible to find a forged data with the same MD5 value.

[0099] The function of MD5 is to "compress" large amounts of information into a confidential format before signing a private key with a digital signature software, that is, to convert a byte string of any length into a digital string of a certain length. MD5 usually converts the byte string into a hexadecimal digital string. Of course, the byte string can also be converted into a decimal digital string as required.

[0100] It is understandable that in this embodiment, the MD5 algorithm is used to calculate the basic factors composed of the system time, the random number A and the MAC address to obtain the ciphertext, which is also called the MD5 value and is represented by the character M1. Then, a number of digits of characters are selected from M1 to form the first password.

[0101] Specifically, the door lock determines the first password based on the ciphertext, including:

[0102] S121, the door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext;

[0103] S122, if the sum of the characters is an odd number, the door lock uses a number of odd-numbered characters in the ciphertext to form a first password;

[0104] S123, if the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form a first password.

[0105] Specifically, the door lock sums up each character in M1, and the process of summing up each character is specifically as follows: obtaining a character-to-digital conversion table of the corresponding conversion relationship between characters and numbers, such as an ASCII code value character table, and then obtaining the ASCII code value corresponding to each character in M1 according to the character-to-digital conversion table (ASCII code value character table). The number of bits of the ciphertext M1 is fixed, and the number of bits of the ciphertext can be 32 bits or 64 bits. For example, the number of bits of the ciphertext M1 in this embodiment is 32 bits. Then, each character is summed to obtain the sum S1. Then, the parity of the sum S1 is judged to determine the interception rule for the ciphertext M1, so as to obtain different first passwords according to different interception rules. Specifically, when the sum S1 is an even number, a number of even-numbered characters are selected from M1 to form the first password; when the sum S1 is an odd number, a number of odd-numbered characters are selected from M1 to form the first password. The number of even-numbered bits and the number of odd-numbered bits can be the same or different. Regardless of whether a number of odd or even digits are selected, the number of digits of the selected character can be 4, 6, 8, etc. In practical applications, the number of digits of the selected character is usually an even number, and the number of digits to be intercepted can be set according to user needs. For example, when S1 is an even number, 6 even-digit characters are selected, and when S1 is an odd number, 4 odd-digit characters are selected.

[0106] It should be noted that no matter whether an even-numbered character or an odd-numbered character is selected, the number of digits of the selected characters should be less than the total number of digits of the ciphertext M1. Furthermore, the number of digits of the selected characters should be less than the maximum number of digits displayed in the input box displayed by the terminal device.

[0107] The characters in the first password may be numbers, letters, or a combination of letters and numbers. Exemplarily, in one embodiment of the present invention, for the convenience of display or voice playback, all characters in the first password are numbers. If there are alphabetic characters in the first password, the alphabetic characters are converted into digital characters according to the character-digital correspondence table, and the converted digital characters replace the alphabetic characters. Specifically, the characters in the first password that are alphabetic are converted into digital characters according to the ASCII code value character table and the password formed by replacing the alphabetic characters is used as the first password.

[0108] For example: Character set M1: e10adc3949ba59abbe56e057f20f883e

[0109] The sum of all characters is S1, and it is determined that S1 is an even number. Then the characters in the character set M1 that belong to the even number are e0d34b5ab5e5f083. Select 4 even numbers to get e0d3, 0d34, d34b, e04b, 5ab5, etc. Select any one of them as the first password. If the selected first password is e0d3, since there are letters e and d in the characters, e and d need to be converted into numbers (if converted into hexadecimal numbers), and then replace the original characters respectively, and get 650643, then 650643 is the final first password.

[0110] Similarly, if the sum S1 of the characters in the character set M1 is an odd number, then the characters in the character set M1 that belong to odd digits are 1ac99a9be6072f8e. Select 6 odd digits to get 1ac99a, 99a9be, a9be60, etc., and select any one of them as the first password. If the selected first password is 199960, since all characters are numbers, 19960 is the final first password.

[0111] In this way, the door lock can display the randomly generated first password on the display screen of the door lock, and can also broadcast the randomly generated first password in a loop by voice, and can also display the randomly generated first password in a loop on the keyboard. In this way, the terminal is prompted to enter the password through multiple methods such as display screen display, voice broadcast or keyboard display.

[0112] S20. The terminal obtains a second password based on the first password generated by the door lock, and connects to the door lock based on the second password, wherein the second password is generated based on the first password.

[0113] In this embodiment, the second password is generated by the terminal based on the first password of the door lock, and the second password is used to determine whether the terminal is successfully connected to the door lock, and is also used to verify whether the terminal connected to the door lock is legal. Specifically, the terminal obtains the second password based on the first password generated by the door lock, which specifically includes:

[0114] S21, after receiving the door lock network configuration command, the terminal displays the door lock network configuration interface and obtains the device identification corresponding to the door lock;

[0115] S22, the terminal connects to the door lock of the device identification based on the device identification, and displays a password input box;

[0116] S23, the terminal obtains a second password through the password input box.

[0117] The terminal is configured with a door lock control APP for controlling the door lock. The user enters the door lock network configuration interface through the door lock control APP on the terminal, and then selects the device identification of the door lock, such as the door lock model, to ensure that the terminal is connected to the door lock, for example, the terminal and the door lock are connected to the same WiFi hotspot. It should be noted that the WiFi hotspot name of the same model of door lock is unique and fixed, and it is fixed when the door lock leaves the factory.

[0118] After selecting the door lock model corresponding to the door lock, the door lock control APP on the terminal automatically pops up a password input box, which is used to enter the first password sent by the door lock in any of the three ways. Then, the user enters the second password in the password input box according to the first password generated by the door lock. The second password entered by the user can be entered into the password input box in order according to the first password generated by the door lock, or it can be entered into the password input box in an unordered manner according to the first password generated by the door lock.

[0119] In this embodiment, in order to improve input convenience, the second password is input into the password input box in a disordered input mode. The disordered input mode means that the second password sequence of the terminal is different from the first password sequence of the door lock, and the user can input the second password in any order, as long as all the characters in the second password of the terminal are the same as all the characters in the first password of the door lock. In this way, it is avoided that too many wrong inputs in a fixed order will cause the lock, the probability of wrong input is reduced, and the input convenience is improved.

[0120] For example: the first password of the door lock is 123456

[0121] The user does not need to enter the password in any order in the password input box. Entering 123465, 234561, 451236, etc. is considered a successful entry.

[0122] In order to improve input accuracy and facilitate users, when the door lock control APP on the terminal pops up a password input box, the characters appearing in the first password generated by the door lock will be highlighted on the displayed keyboard, that is, the numbers in the first password will be highlighted, for example, the six numbers 123456 will be highlighted. At this time, the user only needs to input the highlighted number keys into the password input box.

[0123] Another example: The first password of the door lock is 445612

[0124] The terminal keyboard will highlight the five numbers 12456. At this time, as long as the user enters the number 4 twice, any input of other numbers once will be successful.

[0125] When the terminal obtains the second password, the second password is sent to the door lock to establish a network connection.

[0126] S30: The door lock receives the second password, and after determining that the first password and the second password match, establishes a network connection with the terminal, and sends feedback information to the terminal.

[0127] In this embodiment, the door lock receives the second password sent by the terminal and compares whether the second password matches the first password generated by the door lock itself. The feedback information refers to the message that the door lock feeds back to the terminal whether the second password matches the first password and whether the terminal and the door lock are successfully connected.

[0128] In one mode of this embodiment, the matching process of the first password and the second password may be to compare whether all characters and the number of occurrences of each character in the first password are the same as all characters in the second password and the number of occurrences of the same character in the first password. Specifically, when all characters in the first password are the same as all characters in the second password and the number of occurrences of the same character is also the same, the first password and the second password are considered to match. When there are characters in the first password that are different from the characters in the second password or all characters in the first password are the same as all characters in the second password but the number of occurrences of the same character is different, the first password and the second password are considered to not match.

[0129] In another embodiment of the present invention, the matching process of the first password and the second password may also be to verify whether the first password matches the second password by comparing whether the first characteristic value of the first password is the same as the second characteristic value of the second password.

[0130] Specifically, the matching process of the first password and the second password includes:

[0131] S31, the door lock determines a first characteristic value of the first password based on the number of times each character in the first password appears, and determines a second characteristic value of the second password based on the number of times each character in the second password appears;

[0132] The first characteristic value is used to characterize the first password, and the second characteristic value is used to characterize the second password. In this embodiment, the characteristic value extraction method is to generate the number of times each character in the password is in the range of 0 to 9, and then arrange the number of times the corresponding digital password appears in the order of 0 to 9 to form a characteristic value.

[0133] For example: Password A: 123456

[0134] The number 1 appears once in password A;

[0135] The number 2 appears once in password A;

[0136] The number 3 appears once in password A;

[0137] The number 4 appears once in password A;

[0138] The number 5 appears once in password A;

[0139] The number 6 appears once in password A;

[0140] The other numbers 0, 7, 8, and 9 appear 0 times in password A.

[0141] Therefore, the characteristic value of password A is: 0111111000, as shown in the following table:

[0142]

[0143] Therefore, through the above-mentioned feature value extraction method, the first feature value of the first password and the second feature value of the second password are extracted respectively, and then the first feature value is compared with the second feature value to see whether they are the same.

[0144] For example, if the first password of the door lock is 538990, then the first characteristic value of the first password is: 1001000012;

[0145] The second password of the terminal is 599083, so the second characteristic value of the second password is 1001000012.

[0146] S32: When the first characteristic value is the same as the second characteristic value, the first password matches the second password.

[0147] In this embodiment, when the first characteristic value is the same as the second characteristic value, it means that the second password obtained by the terminal matches the first password of the door lock, further indicating that the terminal connected to the door lock is a legitimate device. At this time, when the door lock determines that the first password matches the second password, the door lock replaces the first password with the second password of the terminal, uses the second password as the hotspot password of the door lock, establishes a hotspot connection with the terminal, and sends a feedback message of successful connection to the terminal connected to the door lock.

[0148] S33: When the first characteristic value is different from the second characteristic value, the first password does not match the second password.

[0149] In this embodiment, when the first characteristic value is different from the second characteristic value, the door lock determines that the first password and the second password fail to match, indicating that the user entered the wrong password or the password input has timed out, etc. At this time, the door lock will send a prompt to the terminal to re-enter the password.

[0150] For example, if the first password of the door lock is 538990, then the first characteristic value of the first password is: 1001000012;

[0151] The second password of the terminal device is 5990083, then the second characteristic value of the second password is: 2001000012;

[0152] If the second characteristic value is different from the first characteristic value, the first password and the second password fail to match.

[0153] S40, the terminal responds to the door lock network connection, and when the connection with the door lock is successful, sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0154] In this embodiment, the terminal receives feedback information from the door lock, and determines that the terminal is successfully connected to the door lock according to the feedback information. Then the terminal sends gateway information to the door lock, so that the door lock configures the gateway information. The gateway information includes a gateway identifier and a gateway password. The gateway information can be unencrypted gateway information, so the terminal sends the unencrypted gateway information to the door lock, and the door lock directly parses the unencrypted gateway information and accesses the gateway according to the gateway identifier and the gateway password.

[0155] In another embodiment of the present invention, the gateway information may be encrypted gateway information encrypted based on the second password, and it is understandable that the transmission between the door lock and the terminal is encrypted transmission. The encryption method may be WPA or WPA2.

[0156] In this embodiment, the door lock and the terminal communicate using WPA2 symmetric encryption. The WPA2 (Wi-Fi Protected Access 2) symmetric encryption is an authentication form of the IEEE 802.11i standard verified by the Wi-Fi Alliance. WPA2 implements the mandatory elements of 802.11i, especially the Michael algorithm is replaced by the CCMP message authentication code, which is recognized to be completely secure, and RC4 is also replaced by AES. WPA2 symmetric encryption uses a pre-shared key mode. Each user must enter the same pre-configured key to access the network. The key can be 8 to 63 ASCII characters or 64 hexadecimal numbers (256 bits). The key is pre-configured in the Wi-Fi router. Its security is enhanced by using the PBKDF2 key derivation function. Therefore, at least 5 Diceware words or 14 completely random letters are used as keys to defeat password cracking attacks. Therefore, based on the WPA2 symmetric encryption method, the door lock and the terminal are encrypted and decrypted using the same key to obtain gateway information. This key is the second password of the terminal. It is understandable that the encryption key transmitted by the terminal and the decryption key of the door lock are the same and are both the second password. Based on the second password inputted in an unordered manner on the terminal as a shared key, security is further improved and it is not easy to be cracked.

[0157] Exemplarily, when the connection is successful, the terminal sends gateway information to the door lock, so that the door lock configures the gateway information specifically including:

[0158] When the connection is successful, the terminal encrypts the gateway information based on the second password to obtain encrypted gateway information;

[0159] The terminal sends the encrypted gateway information to the door lock so that the door lock is configured with the encrypted gateway information, wherein the door lock includes the second password.

[0160] Specifically, the door lock configures the WiFi hotspot password as the second password, so that the door lock establishes a WiFi connection with the terminal. After the connection is successful, the terminal sends encrypted gateway information to the door lock, so that the door lock accesses the gateway according to the encrypted gateway information.

[0161] After the terminal sends the gateway information to the door lock, the terminal connects to the gateway corresponding to the gateway information based on the gateway information. It is understandable that after the terminal sends the gateway information to the door lock, it disconnects from the door lock and reconnects to the gateway corresponding to the gateway information based on the gateway information.

[0162] Furthermore, the gateway information can be obtained by the terminal accessing the gateway, or it can be sent directly to the door lock by the gateway information stored by the terminal itself. In this embodiment, the gateway information is used by the terminal to access the gateway to obtain the gateway information. Therefore, before step S10, the terminal pre-accesses the gateway, obtains the gateway identification and gateway password of the gateway and stores the gateway information. Before the terminal sends the gateway information to the door lock, the terminal disconnects from the gateway so that it can connect to the door lock WiFi, so that after the terminal successfully connects to the door lock, it can send the gateway information to the door lock, and after the door lock receives the gateway information, it disconnects from the door lock and reconnects to the gateway corresponding to the gateway information to perform subsequent related control operations. Therefore, the terminal pre-accesses the gateway to obtain the gateway information, then disconnects the gateway from the door lock hotspot, and then disconnects from the door lock after sending the gateway information to the door lock, and reconnects to the gateway, so that the process is simplified, the operation steps are reduced, and the efficiency is improved, and the risk of information leakage is further reduced.

[0163] S50: The door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information.

[0164] In this embodiment, when the transmission between the door lock and the terminal is unencrypted, after the door lock receives the gateway information, it directly accesses the corresponding gateway according to the gateway identifier and gateway password in the gateway information.

[0165] Exemplarily, the gateway information is unencrypted gateway information. When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information. Specifically, the gateway information includes:

[0166] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, wherein the gateway information includes a gateway identifier and a gateway password;

[0167] The door lock accesses the gateway corresponding to the grid identifier according to the gateway identifier and the gateway password.

[0168] In another mode of this embodiment, if the transmission between the door lock and the terminal is encrypted, the door lock needs to configure a second password after receiving the encrypted gateway information to decrypt the gateway information through the second password, and then access the corresponding gateway according to the gateway identifier and gateway password.

[0169] Exemplarily, the gateway information is encrypted gateway information encrypted based on the first password, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information, further comprising:

[0170] The door lock successfully connects to the terminal network after replacing the first password of the door lock with the second password of the terminal;

[0171] The door lock receives gateway information, wherein the gateway information includes a gateway identifier and a gateway password;

[0172] The door lock decrypts the received gateway information according to the second password to obtain the gateway identifier and gateway password;

[0173] The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

[0174] In summary, a method for implementing a door lock access gateway at a door lock end includes the following steps:

[0175] The door lock generates a first password, and receives a second password determined by the terminal based on the first password;

[0176] The door lock establishes a network connection with the terminal after determining that the first password and the second password match;

[0177] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information.

[0178] Exemplarily, the password order of the second password is different from the password order of the first password, wherein all characters in the second password are the same as all characters in the first password.

[0179] The method of generating the first password by the door lock specifically includes:

[0180] The door lock obtains a basic factor, and generates a ciphertext based on the basic factor;

[0181] The door lock determines the first password based on the ciphertext, wherein each character in the first password is a number.

[0182] The basic factors include one or more of system time, random number and MAC address of the door lock.

[0183] The door lock determines the first password based on the ciphertext, specifically comprising:

[0184] The door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext;

[0185] If the sum of the characters is an odd number, the door lock takes a number of odd-numbered characters in the ciphertext to form a first password;

[0186] If the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form the first password.

[0187] Wherein, before the first password and the second password match each other, the step includes:

[0188] The door lock determines a first characteristic value of the first password based on the number of times each character in the first password appears, and determines a second characteristic value of the second password based on the number of times each character in the second password appears;

[0189] When the first characteristic value is the same as the second characteristic value, the door lock determines that the first password matches the second password;

[0190] When the first characteristic value is different from the second characteristic value, the door lock determines that the first password does not match the second password.

[0191] The gateway information is unencrypted gateway information, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information, specifically including:

[0192] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, wherein the gateway information includes a gateway identifier and a gateway password;

[0193] The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

[0194] Wherein, the gateway information is encrypted gateway information encrypted based on the second password, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information, further comprising:

[0195] The door lock successfully connects to the terminal network after replacing the first password of the door lock with the second password of the terminal;

[0196] The door lock receives gateway information, wherein the gateway information includes a gateway identifier and a gateway password;

[0197] The door lock decrypts the received gateway information according to the second password to obtain the gateway identifier and gateway password;

[0198] The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

[0199] A method for controlling a door lock to access a gateway is implemented at a terminal, and the method for controlling a door lock to access a gateway comprises the following steps:

[0200] The terminal obtains a second password based on the first password generated by the door lock;

[0201] The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock;

[0202] When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

[0203] The terminal obtaining the second password based on the first password generated by the door lock specifically includes:

[0204] After receiving the door lock network configuration command, the terminal displays the door lock network configuration interface and obtains the device identification corresponding to the door lock;

[0205] The terminal connects to the door lock of the device identification based on the device identification, and displays a password input box;

[0206] The terminal obtains the second password through the password input box.

[0207] The second password is determined based on the first password generated by the door lock, and the password sequence of the second password is different from the password sequence of the first password.

[0208] Wherein, when the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, specifically including:

[0209] When the terminal is successfully connected to the door lock, the terminal encrypts the gateway information based on the second password to obtain encrypted gateway information;

[0210] The terminal sends the encrypted gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, wherein the door lock is configured with the second password.

[0211] Wherein, when the connection is successful, the terminal sends gateway information to the door lock so that the door lock configures the gateway information, and the method includes:

[0212] After the terminal is disconnected from the network, it connects to the gateway corresponding to the gateway information based on the gateway information.

[0213] In summary, the present invention provides a method for controlling a door lock or a door lock accessing a gateway, wherein the method for the door lock accessing a gateway comprises the following steps: the door lock generates a first password, and receives a second password determined by a terminal based on the first password; the door lock determines that the first password matches the second password and then connects to the terminal through a network; when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information. The method for controlling the door lock accessing a gateway comprises the following steps: the terminal obtains the second password based on the first password generated by the door lock; the terminal responds to the network connection with the door lock based on the door lock determining that the first password matches the second password; when the terminal is successfully connected to the door lock, the terminal sends the gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information. The present invention verifies whether the terminal is a legitimate device by matching the first password randomly generated by the door lock with the second password of the terminal, thereby ensuring the security of the gateway information received by the door lock, and then enabling the door lock to safely access the gateway, greatly reducing security risks and improving the security of the door lock network distribution.

[0214] Please refer to Figure 6 , Figure 6 The schematic diagram of the structure of a system for accessing a door lock to a gateway in the present application is illustrated. The system 100 may include a door lock 101 and a terminal 102. Figure 6Only some of the components of the system 100 are shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0215] The door lock 101 is used to generate a first password and receive a second password determined by a terminal based on the first password; after determining that the first password and the second password match, the door lock 101 is connected to the network with the terminal; when the connection with the terminal 102 is successful, the door lock 101 receives the gateway information sent by the terminal 102, and accesses the gateway corresponding to the gateway information based on the gateway information; specifically, the steps in the method for door lock accessing the gateway described above.

[0216] The terminal 102 is used to obtain a second password based on a first password generated by the door lock 101; respond to a network connection with the door lock 101 after the door lock 101 determines that the first password matches the second password; when the connection with the door lock 101 is successful, gateway information is sent to the door lock 101, so that the door lock 101 accesses the gateway corresponding to the gateway information according to the gateway information; specifically, the steps in the method for controlling the door lock to access the gateway as described above.

[0217] The present application also provides an electronic device, such as Figure 7 As shown, the electronic device 1 includes a processor 11 and a memory 22 connected to the processor 11. Figure 7 Only some components of the electronic device 1 are shown, but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.

[0218] In some embodiments, the memory 22 may be an internal storage unit of the electronic device 1, such as the memory of the system 100. In other embodiments, the memory 22 may also be an external storage device of the system 100, such as a plug-in USB flash drive, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 22 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 22 is used to store application software and various types of data installed on the electronic device 1, such as the program code of the door lock access gateway. The memory 22 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a door lock access gateway program is stored on the memory 22, and the door lock access gateway program can be executed by the processor 11, thereby implementing the door lock access gateway method in the present application, as described in the above method.

[0219] The processor 11 may be a central processing unit (CPU), a microprocessor, a mobile phone baseband processor or other data processing chip in some embodiments, and is used to run the program code or process data stored in the memory 22, for example, to execute the method for accessing the door lock to the gateway, specifically including:

[0220] The door lock generates a first password, and receives a second password determined by the terminal based on the first password;

[0221] The door lock establishes a network connection with the terminal after determining that the first password and the second password match;

[0222] When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information; the details are as described above.

[0223] Or executing the method of controlling the door lock to access the gateway, specifically comprising:

[0224] The terminal obtains a second password based on the first password generated by the door lock;

[0225] The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock;

[0226] When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information; the details are as described above.

[0227] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

[0228] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

[0229] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for accessing a door lock to a gateway, characterized in that: The method for accessing a door lock to a gateway comprises the following steps: The door lock generates a first password, and receives a second password determined by the terminal based on the first password; The door lock generates a first password specifically including: The door lock obtains a basic factor, and generates a ciphertext based on the basic factor; The door lock determines the first password based on the ciphertext, wherein each character in the first password is a number; The basic factor includes one or more of the system time, a random number, and the MAC address of the door lock; Determine the effective matching verification time of the first password corresponding to the door lock network configuration time according to the system time, and the time when the first password and the second password are successfully matched within the effective matching verification time is verification success; The door lock determines the first password based on the ciphertext, specifically comprising: The door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext; If the sum of the characters is an odd number, the door lock takes a number of odd-numbered characters in the ciphertext to form a first password; If the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form a first password; The door lock establishes a network connection with the terminal after determining that the first password and the second password match; When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information.

2. The method for accessing a door lock to a gateway according to claim 1, characterized in that: The password sequence of the second password is different from the password sequence of the first password, wherein all characters in the second password are the same as all characters in the first password.

3. The method for accessing a door lock to a gateway according to claim 1, characterized in that: The door lock determines that the first password and the second password match specifically includes: The door lock determines a first characteristic value of the first password based on the number of times each character in the first password appears, and determines a second characteristic value of the second password based on the number of times each character in the second password appears; When the first characteristic value is the same as the second characteristic value, the door lock determines that the first password matches the second password; When the first characteristic value is different from the second characteristic value, the door lock determines that the first password does not match the second password.

4. The method for accessing a door lock to a gateway according to claim 1, characterized in that: The gateway information is unencrypted gateway information. When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information, specifically including: When the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, wherein the gateway information includes a gateway identifier and a gateway password; The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

5. The method for accessing a door lock to a gateway according to claim 1, characterized in that: The gateway information is encrypted gateway information encrypted based on the second password, and when the door lock is successfully connected to the terminal, the door lock receives the gateway information sent by the terminal, and accesses the gateway corresponding to the gateway information based on the gateway information, specifically including: The door lock successfully connects to the terminal network after replacing the first password of the door lock with the second password of the terminal; The door lock receives gateway information, wherein the gateway information includes a gateway identifier and a gateway password; The door lock decrypts the received gateway information according to the second password to obtain the gateway identifier and gateway password; The door lock accesses the gateway corresponding to the gateway identifier according to the gateway identifier and the gateway password.

6. A method for controlling a door lock to access a gateway, characterized in that: The method for controlling a door lock to access a gateway comprises the following steps: The terminal obtains a second password based on the first password generated by the door lock; The door lock generates a first password specifically including: The door lock obtains a basic factor, and generates a ciphertext based on the basic factor; The door lock determines the first password based on the ciphertext, wherein each character in the first password is a number; The basic factor includes one or more of the system time, a random number, and the MAC address of the door lock; Determine the effective matching verification time of the first password corresponding to the door lock network configuration time according to the system time, and the time when the first password and the second password are successfully matched within the effective matching verification time is verification success; The door lock determines the first password based on the ciphertext, specifically comprising: The door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext; If the sum of the characters is an odd number, the door lock takes a number of odd-numbered characters in the ciphertext to form a first password; If the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form a first password; The terminal responds by connecting to the door lock network after determining that the first password matches the second password based on the door lock; When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

7. The method for controlling a door lock to access a gateway according to claim 6, characterized in that: The terminal obtaining the second password based on the first password generated by the door lock specifically includes: After receiving the door lock network configuration command, the terminal displays the door lock network configuration interface and obtains the device identification corresponding to the door lock; The terminal connects to the door lock of the device identification based on the device identification, and displays a password input box; The terminal obtains the second password through the password input box.

8. The method for controlling door lock access to a gateway according to claim 6, characterized in that: The second password is determined based on the first password generated by the door lock, and a password sequence of the second password is different from a password sequence of the first password.

9. The method for controlling a door lock to access a gateway according to claim 6, characterized in that: When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information. Specifically, the method includes: When the terminal is successfully connected to the door lock, the terminal encrypts the gateway information based on the second password to obtain encrypted gateway information; The terminal sends the encrypted gateway information to the door lock, so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, wherein the door lock is configured with the second password.

10. The method for controlling door lock access to a gateway according to claim 6, characterized in that: When the terminal is successfully connected to the door lock, the terminal sends gateway information to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information, and the method includes: After the terminal is disconnected from the network, it connects to the gateway corresponding to the gateway information based on the gateway information.

11. A door lock access gateway system, characterized in that: The door lock access gateway system includes a door lock and a terminal connected to the door lock: The door lock is used to generate a first password and receive a second password determined by a terminal based on the first password; and establish a network connection with the terminal after determining that the first password and the second password match; When the door lock is successfully connected to the terminal, receiving the gateway information sent by the terminal, and accessing the gateway corresponding to the gateway information based on the gateway information; The generating of the first password specifically includes: The door lock obtains a basic factor, and generates a ciphertext based on the basic factor; The door lock determines the first password based on the ciphertext, wherein each character in the first password is a number; The basic factor includes one or more of the system time, a random number, and the MAC address of the door lock; Determine the effective matching verification time of the first password corresponding to the door lock network configuration time according to the system time, and the time when the first password and the second password are successfully matched within the effective matching verification time is verification success; The door lock determines the first password based on the ciphertext, specifically comprising: The door lock sums up each character in the ciphertext to obtain a character sum value of the ciphertext; If the sum of the characters is an odd number, the door lock takes a number of odd-numbered characters in the ciphertext to form a first password; If the sum of the characters is an even number, the door lock takes a number of even-numbered characters in the ciphertext to form a first password; The terminal is used to obtain a second password based on a first password generated by a door lock; respond to connect to the door lock network after the door lock determines that the first password matches the second password; when the terminal is successfully connected to the door lock, gateway information is sent to the door lock so that the door lock accesses the gateway corresponding to the gateway information according to the gateway information.

12. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is enabled to execute the steps in the door lock access gateway method as described in any one of claims 1-5 or execute the steps in the door lock access gateway control method as described in any one of claims 6-10.

13. An electronic device, characterized in that: The electronic device includes a processor and a memory connected to the processor, the memory stores one or more programs, and the processor is used to execute the steps in the method for door lock access gateway as described in any one of claims 1-5, and / or the steps in the method for controlling door lock access gateway as described in any one of claims 6-10.