Intelligent door lock and network configuration method and network configuration device thereofTechnical Field
The invention relates to the technical field of intelligent door locks, in particular to an intelligent door lock, a network configuration method and a network configuration device thereof.
Background
Along with the development of the Internet of things, smart homes slowly enter the lives of people. The intelligent door lock becomes an indispensable part in the intelligent home. As an intelligent home, the intelligent home can exert the 'intelligence' to the maximum extent only by accessing the Internet. And the access to the network through wifi is a mode with highest cost performance and widest application range. But this is accompanied by a problem: when an intelligent door lock without an input device such as a touch display screen is connected to wifi in a user's home, a method for configuring a wifi network is needed to achieve the purpose.
At present, the methods for configuring the wifi network of the intelligent door lock in the market comprise the following steps:
1) the two-dimensional code generated by the mobile phone APP is scanned through the camera on the intelligent door lock, the WIFI SSID and the password which need to be connected are obtained, and then network configuration is carried out. SSID: service Set Identifier, Service Set Identifier. The wireless network card can be used for distinguishing different networks, at most 32 characters can be provided, the wireless network card can enter different networks by setting different SSIDs,
2) the intelligent door lock is connected with the mobile phone through the Bluetooth module on the intelligent door lock, the WIFI SSID and the password which need to be connected are sent to the intelligent door lock in the mobile phone APP, and then network configuration is carried out.
The two networking methods mainly have the following problems:
additional hardware costs, such as bluetooth modules, cameras, etc., are required. The increase in hardware may result in an increase in power consumption of the smart door lock. Bluetooth and camera function application development need to be carried out, the product development cycle is prolonged, and the labor cost is increased. The user hardly grasps the camera focus, leads to two-dimensional code formation of image fuzzy to cause the discernment difficulty, join in marriage net inefficiency.
Disclosure of Invention
The invention aims to provide an intelligent door lock, a network configuration method and a network configuration device thereof, which can solve a series of problems caused by the fact that hardware is added to configure a wireless network in the prior art.
The purpose of the invention is realized by the following technical scheme:
in a first aspect, the present invention provides a network configuration method for an intelligent door lock, including the following steps:
step 1, obtaining a set of default SSID and password after the unique equipment number of the intelligent door lock is subjected to an encryption algorithm, and storing the default SSID and password;
step 2, obtaining the equipment ID of the intelligent door lock by using the mobile terminal, and obtaining the default SSID and password of the intelligent door lock after the encryption algorithm which is the same as that in the step 1 is calculated;
step 3, the mobile terminal starts a hotspot and modifies the name and the password of the hotspot to be consistent with the default SSID and the default password;
step 4, the mobile terminal sends the SSID and the password of the wireless network to be configured to a wifi module of the intelligent door lock;
step 5, receiving the SSID and the password of the wireless network in the wifi module, and networking by using the SSID and the password of the wireless network; and the storage module stores the SSID and the password of the wireless network and is used for connecting the network after the next restart of the intelligent door lock.
Further, the encryption algorithm is an MD5 algorithm, and the encryption process is as follows: and (3) carrying out encryption calculation on the device ID by using an MD5 algorithm to obtain a string of characters, taking the first n characters as a default SSID and taking the last n characters as a default password.
Further, the method for obtaining the device ID of the intelligent door lock by using the mobile terminal includes: and scanning the two-dimensional code of the intelligent door lock by using a mobile terminal to obtain the equipment ID of the intelligent door lock.
Further, the two-dimensional code is printed on the outer surface of the intelligent door lock.
In a second aspect, the invention provides a network configuration device of an intelligent door lock, which comprises a wifi module, an encryption module and a storage module; the encryption module calculates the equipment ID of the intelligent door lock according to an encryption algorithm to obtain a default SSID and a default password; the default SSID and the password are stored by the storage module; the wifi module is used for establishing network connection with the mobile terminal, receiving the SSID and the password of the wireless network sent by the mobile terminal, and networking according to the received SSID and password of the wireless network; the storage module is also used for storing the SSID and the password of the wireless network received by the wifi module, and replacing the default SSID and the default password with the SSID and the password of the wireless network.
In a second aspect, the present invention provides an intelligent door lock, comprising a two-dimensional code and the network configuration device of claim 5; the two-dimensional code is printed on the outer surface of the intelligent door lock.
Furthermore, the intelligent door lock further comprises a door lock mechanical structure, a circuit control board, a peripheral sensor and a peripheral control module; the circuit control board senses the current state of the intelligent door lock through the peripheral sensor and the peripheral control module, and then controls the mechanical structure of the door lock to open or close.
According to the intelligent door lock, the network configuration method and the network configuration device, hardware modules are not required to be added, and the product cost is saved. The method is wide in application range, does not depend on other devices, and can be applied to distribution networks of all wifi networking devices. Simple operation is convenient, need not the user and carries out complicated password input operation, only needs to select correct wifi, can accomplish automatically through APP scanning smart machine's two-dimensional code and join in marriage the net.
Drawings
FIG. 1 is a flow chart of a network configuration method of the intelligent door lock of the present invention;
fig. 2 is a schematic structural diagram of a network configuration device of the intelligent door lock of the present invention.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The invention discloses a network configuration method of an intelligent door lock, which comprises the following steps:
step 1, obtaining a set of default SSID and password by carrying out encryption algorithm on the unique equipment number (hereinafter also referred to as equipment ID) of the intelligent door lock.
Each intelligent door lock uniquely corresponds to a device ID, and the device ID is burned in a software system of the intelligent door lock when being produced by a factory. And (3) subjecting the device ID to an encryption algorithm (such as an MD5 algorithm) to obtain a 32-bit MD5 value, setting the first 16 bits as the SSID and the last 16 bits as a default password, and obtaining a set of default SSID and password. The program in the device will always periodically search for the default SSID and attempt to connect using the password. For example, the following steps are carried out: for example, the device ID is: 123456, the device ID is encrypted using the MD5 algorithm, the result of the encryption being: e10adc3949ba59abbe56e057f20f883e, the first 16 bits e10adc3949ba59ab are used as default SSID of the intelligent door lock, and the last 16 bits be56e057f20f883e are used as default password of the intelligent door lock.
And 2, obtaining the equipment ID of the intelligent door lock by using the mobile terminal, and obtaining the default SSID and password of the intelligent door lock after the same encryption algorithm in the step 1 is calculated.
In order to obtain the device ID, a two-dimensional code is printed on the intelligent door lock during factory production, the two-dimensional code comprises device ID information, and the device ID can be obtained by scanning the two-dimensional code through a mobile terminal such as a mobile phone, a tablet personal computer and the like. After the device ID is acquired, the default SSID and password of the device are calculated by the same algorithm as that in the device program.
And 3, the mobile terminal starts the hotspot and modifies the hotspot name and the password to be consistent with the default SSID and the default password.
After the setting of the step is successful, the wifi module of the intelligent door lock can establish network connection with the mobile terminal of the mobile phone through the IEEE 802 existing standard protocol.
And 4, the mobile terminal sends the SSID and the password of the wireless network to be configured to the wifi module of the intelligent door lock.
The SSID and the password of the wireless network to be configured are sent to the wifi module in a UDP or TCP communication mode.
And 5, receiving the SSID and the password of the wireless network in the wifi module, and networking by using the SSID and the password of the wireless network. The storage module stores the SSID and the password of the wireless network and is used for connecting the network after the intelligent door lock is restarted next time.
The distribution network is completed, the equipment is restarted next time, and in a normal working mode, the WIFI module can automatically read the SSID and the password stored in the storage module and automatically connect.
The network configuration device of the intelligent door lock comprises a wifi module, an encryption module and a storage module. And the encryption module calculates the default SSID and password according to the equipment ID of the intelligent door lock and an encryption algorithm. And the default SSID and the password are stored by the storage module. The wifi module is used for establishing network connection with the mobile terminal, receiving the SSID and the password of the wireless network sent by the mobile terminal, and networking according to the received SSID and password of the wireless network. The storage module is also used for storing the SSID and the password of the wireless network received by the wifi module, and the default SSID and the default password are covered by the SSID and the password of the wireless network.
The intelligent door lock at least comprises the network configuration device and the two-dimensional code. The two-dimensional code is arranged on the surface of the intelligent door lock, and the effect of the two-dimensional code is that the mobile terminal can obtain the equipment ID of the intelligent door lock by scanning the two-dimensional code.
The intelligent door lock also comprises a door lock mechanical structure, a circuit control board, a peripheral sensor, a peripheral control module and the like. The circuit control board senses the current state such as the door opening and closing state, the face recognition result, the password keyboard input and the like through a peripheral sensor and a peripheral control module. Thereby controlling the opening and closing of the door lock mechanical structure.
The circuit control board mainly comprises a main controller circuit module, the main controller circuit module is connected with a wifi module in the network configuration device through an SDIO interface and a serial port, the SDIO interface is used for the wifi module to provide internet surfing capability for a main control chip, and the serial port is used for the wifi module to establish service logic communication with a main control.
The distribution network method is mainly based on the wifi module. A program is arranged in the wifi module, and the program can control searching, connection and disconnection of the wifi module and sending and receiving of wifi data.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; may be mechanically coupled, may be electrically coupled or may be in communication with each other; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
The above description is for the purpose of illustrating embodiments of the invention and is not intended to limit the invention, and it will be apparent to those skilled in the art that any modification, equivalent replacement, or improvement made without departing from the spirit and principle of the invention shall fall within the protection scope of the invention.