Automatic network access method and system for intelligent household equipmentTechnical Field
The invention belongs to the technical field of intelligent home, and particularly relates to an automatic network access method and system for intelligent home equipment.
Background
The intelligent home (English) uses a home as a platform, integrates facilities related to home life by utilizing a comprehensive wiring technology, a network communication technology, a safety precaution technology, an automatic control technology and an audio-video technology, builds a high-efficiency management system of home facilities and family schedule matters, improves home safety, convenience, comfort and artistry, and realizes an environment-friendly and energy-saving living environment. The core of an intelligent home is a control gateway, and when an intelligent home device joins an intelligent home system, the intelligent home device needs to join a corresponding network so as to interact with the corresponding gateway.
In the prior art, the network access mode of the equipment is mainly to operate and configure the network access at the end of the equipment, and for the equipment which does not need keys and screens, the equipment is also required to be provided with the keys and the screens for network access configuration, so that the equipment cost is increased. To solve this problem, it is proposed to access the network by using a mobile phone as an intermediate configuration device, for example, a method disclosed in chinese patent [ application number, CN201510092389.1], which includes the following steps: the control terminal for configuring parameters is connected to the gateway; the equipment to be configured sends a registration request to the gateway; the control terminal forms a configuration page and displays the configuration page for configuration; after the control terminal completes configuration, the configuration data is sent to the gateway, and the gateway forwards the configuration data to the equipment to be configured; the equipment to be configured is configured and the configuration result is returned to the gateway; the gateway forwards the configuration result to the control terminal and updates the configuration change number; the control terminal obtains the configuration result and decides whether to memorize the equipment by judging whether the configuration is successful or not, and after the configuration is successful, the terminal configuration number of the control terminal is consistent with the configuration change number of the gateway.
The scheme provides a mode of configuring the equipment to access the network through the mobile phone, so that the configuration of the equipment can be facilitated to a certain extent, and the intelligent of the intelligent home is further realized. However, the above solution has some drawbacks, for example, the above solution requires that the user connects the mobile phone terminal with the gateway and the device to be accessed to the network simultaneously, and then operates the network access parameter of the device to be accessed to the network at the mobile phone terminal, and still requires manual operation by the user, which has a lot of inconveniences.
Disclosure of Invention
The invention aims to solve the problems and provides an automatic network access method for intelligent household equipment;
the invention further aims to solve the problems, and provides an automatic network access system for intelligent household equipment.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
An automatic network access method for intelligent home equipment comprises the following steps:
S1, after the network access equipment is electrified, entering a searching state, carrying out gateway authentication on the searched gateway, and sending a network access request to the gateway after the authentication is passed;
s2, the gateway performs equipment verification on the network access request, and allows the equipment to be accessed to the network to access the network after the verification is passed.
In the above method for automatically accessing the smart home device to the network, in step S1, the device to be accessed searches the gateway through the broadcast communication packet, the gateway that receives the communication packet returns gateway information to the device to be accessed, and the device to be accessed performs gateway authentication on the gateway according to the gateway information.
In the above method for automatically accessing the intelligent home device, the gateway information includes a gateway name and a flag bit for indicating whether to allow the device to join;
In step S1, the device to be accessed to the network judges whether the corresponding gateway allows joining according to the zone bit, if so, the device passes the authentication of the corresponding gateway, and sends an access request to the corresponding gateway.
In the above method for automatically accessing the intelligent home device to the network, in step S1, the network access device enters a fast scanning search state after being powered on until the gateway is successfully added or the scanning time length reaches a preset time length.
In the above method for automatically accessing the intelligent home device, after the device to be accessed to the network is powered on, the fast scanning time length is changed into the slow scanning time length until the gateway is successfully accessed when the fast scanning time length reaches the preset time length and the gateway is not successfully accessed.
In the automatic network access method of the intelligent home equipment, a code list is preset in the gateway, each equipment to be accessed to the network has a unique code, and the network access request comprises verification content encrypted by the code;
in step S2, the gateway uses the codes in the built-in code list to sequentially decrypt the verification content until the codes successfully decrypt the verification content, which means that the verification of the corresponding network equipment to be accessed is passed, and the network equipment to be accessed is allowed to access the network, otherwise, the verification is not passed.
In the above method for automatically accessing the smart home device, step S2 further includes:
The gateway returns the reply information containing the decrypted verification content to the corresponding device to be accessed to the network, the device to be accessed to the network verifies the verification content to judge whether the gateway is successfully decrypted or not, and the gateway is added to the corresponding gateway according to the reply information after the verification is passed.
In the above method for automatically accessing the smart home device, the code in the code list preset in the gateway is obtained by:
A. the client scans the identification code on the equipment to be accessed to the network to obtain the code of the corresponding equipment to be accessed to the network;
B. The client sends the code of the equipment to be accessed to the network to the gateway connected with the code;
C. the gateway adds the codes sent by the client into a code list.
An automatic network access system of intelligent home equipment comprises a gateway and equipment to be accessed, wherein the gateway is provided with a code list, a decryption module and a first network access module, the equipment to be accessed is provided with a code, an encryption module, an authentication module and a second network access module,
An encryption module for encrypting the authentication content using the code as a key;
the authentication module is used for sending a communication packet to the gateway and judging whether the corresponding gateway allows the equipment to join according to the gateway information returned by the gateway;
The second network access module is used for sending a network access request containing the encrypted verification content to a gateway allowing the equipment to join;
a decryption module for decrypting the encrypted authentication content using the codes in the code list;
And the first network access module is used for allowing the network access equipment to be accessed to the network after the decryption module successfully decrypts the verification content.
In the above automatic network access system of intelligent home equipment, the first network access module is further configured to return reply information for allowing the network access of the network access equipment to the network access equipment after the decryption module successfully decrypts the verification content;
The second network access module is further used for verifying the decrypted verification content in the reply information to judge whether the gateway is successfully decrypted or not, and adding the gateway into the corresponding gateway according to the reply information after the verification is passed.
The network equipment to be accessed is provided with an identification code corresponding to the code of the corresponding network equipment to be accessed, and the system also comprises a client connected to the gateway, wherein the client is provided with a scanning module for scanning the identification code on the network equipment to be accessed to obtain the code of the network equipment to be accessed, and transmitting the code to the gateway connected with the code to enable the gateway to put the code into a code list.
The invention has the advantages that:
1. the closed network access is realized, and only the equipment passing verification can be added into the network, so that the safety is high;
2. the equipment also verifies the gateway, and only adds the gateway with the code of the equipment in advance, so that bidirectional verification is realized, and the bidirectional security is ensured;
3. The method has the advantages that the network is automatically accessed, a user does not need to manually input any parameter, a client is not required to be connected with the equipment to be accessed, the equipment can be started to automatically access the network only by scanning the code of the equipment, and the network access mode is quite simple;
4. Because the code scanning can start the automatic network access work of the corresponding equipment, a user only needs to finish the code scanning, a large number of network access equipment to be accessed can be operated in a short time, and the network access efficiency is effectively improved;
5. For the equipment which does not need a key screen after network access, the key screen is not specially equipped for network access operation, and the equipment cost can be reduced.
Drawings
Fig. 1 is a flowchart of a network access method of an automatic network access method of an intelligent home device according to a first embodiment of the present invention;
fig. 2 is a flowchart of a network access method of an automatic network access method of an intelligent home device in a second embodiment of the present invention;
fig. 3 is a system structural block diagram of an automatic network access system for intelligent home equipment in a third embodiment of the present invention.
Reference numerals: a gateway 1; a code list 11; a decryption module 12; a first network access module 13; the network equipment 2 to be accessed; code 21; an encryption module 22; an authentication module 23; a second networking module 24; a client 3.
Detailed Description
The invention will be described in further detail with reference to the drawings and the detailed description.
Example 1
As shown in fig. 1, this embodiment discloses an automatic network access method for intelligent home devices, which relates to a client 3, a gateway 1 and devices to be accessed 2, wherein each device 2 is preset with a unique code when leaving the factory, the shell of the device 2 is provided with a two-dimensional code, a bar code or other forms of identification codes, the information corresponding to the identification codes comprises the code, an external device can obtain the code of the device by scanning the identification codes, the gateway 1 is provided with a code list 11, the specific code in the code list 11 is input by a user, and the automatic network access of the devices to be accessed 2 is realized by using the code in the automatic network access process. The following provides a specific implementation method of the application scenario:
1. the client 3 is connected with the gateway 1 in a wireless manner, the client 3 can be installed in a mobile terminal such as a mobile phone, and can be connected with each other in a wireless manner supported by the gateway 1 and the client 3, such as wifi, and the client 3 can be connected with the zigbee gateway in a wireless manner by taking the zigbee gateway as an example;
2. the client 3 scans the identification code on the device 2 to be accessed to the network to obtain the code 21 of the corresponding device 2 to be accessed to the network;
3. the client 3 sends the code 21 of the network equipment 2 to be accessed to the gateway 1 connected with the client;
4. the gateway 1 adds the code 21 sent by the client 3 to the code list 11; the code of the equipment 2 to be accessed to the network is stored in the gateway 1 in a targeted manner;
5. The device 2 to be accessed to the network is powered on and then enters a searching state, the gateway 1 is searched through a broadcast communication packet, the gateway 1 receiving the communication packet returns gateway information to the device 2 to be accessed to the network, the device 2 to be accessed to the network authenticates the gateway 1 according to the gateway information, and an access request comprising verification content encrypted by a code 21 is sent to the gateway 1 after the authentication is passed;
6. The gateway 1 sequentially decrypts the verification content by using the codes 21 in the built-in code list 11 until the codes 21 successfully decrypt the verification content, which means that the verification of the corresponding device 2 to be network-connected is passed, the device 2 to be network-connected is allowed to complete the network-connected action, otherwise, the verification is not passed, and the device to be network-connected is not allowed to be network-connected.
Specifically, in step 5, the gateway information includes a gateway 1 name and a flag bit for indicating whether to allow the device to join, the flag bit is preset when the gateway leaves the factory, and the authentication process is as follows:
The device to be accessed 2 judges whether the corresponding gateway 1 allows to join the device according to the flag bit, if so, the corresponding gateway 1 is authenticated and passed, and an access request is sent to the corresponding gateway 1, otherwise, the authentication is not passed. Specifically, the device to be accessed to the network 2 recognizes that the flag bit exists, and if the recognized flag bit indicates that the device is allowed to join, the authentication passes, otherwise, the authentication does not pass.
Further, the network device 2 to be accessed enters a fast scanning searching state after being powered on until the gateway 1 is successfully added or the scanning time length reaches a preset time length. And when the fast scanning time reaches the preset time and the gateway 1 is not successfully added, switching to slow scanning until the gateway 1 is successfully added. The preset time period may be set to a time period of 30s, 1 minute, or the like. The automatic quick scanning is powered on to realize quick automatic network access, and the automatic scanning is changed into slow automatic scanning after the network access is unsuccessful within a certain time, so that the network access can be realized in time after the gateway 1 is scanned, and excessive electric energy consumption can be avoided when the gateway is unsuccessful.
In short, when the scheme is put into use, a user scans the device 2 to be accessed to the network through the mobile phone to acquire the code of the device 2 to be accessed to the network, then the mobile phone sends the code 21 to the gateway 1 connected with the device, and the gateway 1 adds the code into the code list 11. After that, the device 2 automatically and rapidly scans the gateways 1 after each power-on, sends a communication packet to the surrounding gateways 1, the gateway 1 receiving the communication packet returns a flag bit to the device, the device judges whether the gateway 1 allows the device to access the network according to the flag bit (checking protocol), the device 2 sends network access requests containing encrypted verification contents to all the gateways 1 allowing the device to access the network, each gateway 1 decrypts the verification contents by using the codes in the respective codes list 11, if all the codes in one gateway 1 cannot be decrypted, the gateway 1 refuses the device 1 to access the network, and if one gateway 1 has the codes to successfully decrypt the verification contents, the device 1 is allowed to access the network, and the device completes network access actions.
Example two
In the first embodiment, after allowing the device to be logged into the network 2, the gateway 1 directly joins the network of the gateway 1 and is not verified. As shown in fig. 2, the other places of the present embodiment are similar to the embodiments, in that the present embodiment returns the reply information containing the decrypted verification content to the corresponding device to be accessed 2 after the gateway allows the device to be accessed 2 to access the network, the device to be accessed 2 verifies the verification content to determine whether the gateway 1 is successfully decrypted, and the successful decryption indicates that the code of the device to be accessed 2 is preset in the gateway 1, so that the network access is completed by adding the reply information to the corresponding gateway 1 after the verification is passed. In the embodiment, the two-way check is performed between the device to be accessed to the network and the gateway, and the device is accessed to the network only after both sides verify the opposite side without errors, so that the two-way verification is realized, the device can be effectively prevented from being wrongly added into other gateways, the gateway is prevented from wrongly receiving other devices, and the network security and the network access effectiveness are improved.
Example III
As shown in fig. 3, this embodiment provides an automatic network access system for intelligent home devices, which includes a gateway 1, a device to be accessed 2 and a client 3 connected to the gateway 1, wherein the gateway 1 has a code list 11, a decryption module 12 and a first network access module 13, the device to be accessed 2 has a code 21, an encryption module 22, an authentication module 23 and a second network access module 24, and the device to be accessed 2 has an identification code corresponding to the code 21 of the corresponding device to be accessed 2; the client 3 has a scanning module for scanning the identification code on the network device 2 to obtain the code 21 of the network device 2 to be accessed, and sending the code 21 to the gateway 1 connected with the client for the gateway 1 to put the code 21 into the code list 11;
an encryption module 22 for encrypting the authentication content using the code 21 as a key; the verification content can be a network access request directly, or can be a network access request plus random content, or can be random content, wherein the random content is randomly generated and stored by each device when leaving the factory or is randomly generated by the device.
An authentication module 23, configured to send a communication packet to a gateway 1 within a communication range, and determine whether the corresponding gateway 1 allows the device to join according to gateway information returned by the gateway 1; judging whether the corresponding gateway 1 allows the equipment to join by judging whether the gateway information has a flag bit or not and whether the flag bit indicates that the equipment is allowed to join;
A second network access module 24, configured to send a network access request containing the encrypted authentication content to the gateway 1 that allows the device to join; the device is used for verifying the decrypted verification content in the reply information sent by the gateway 1 to judge whether the gateway 1 is successfully decrypted or not, and adding the corresponding gateway 1 according to the reply information after the verification is passed, so as to complete the network access of the device;
a decryption module 12 for decrypting the encrypted authentication content using the code 21 in the code list 11;
The first network access module 13 is configured to allow the network access device 2 to access the network after the decryption module 12 successfully decrypts the verification content, and return a reply message for allowing the network access device 2 to access the network to the network access device 2, so that the network access device 2 can perform reverse verification.
The specific embodiments described herein are offered by way of example only to illustrate the spirit of the invention. Those skilled in the art may make various modifications or additions to the described embodiments or substitutions thereof without departing from the spirit of the invention or exceeding the scope of the invention as defined in the accompanying claims.
Although gateway 1 is used more herein; a code list 11; a decryption module 12; a first network access module 13; the network equipment 2 to be accessed; code 21; an encryption module 22; an authentication module 23; a second networking module 24; client 3, etc., but does not exclude the possibility of using other terms. These terms are used merely for convenience in describing and explaining the nature of the invention; they are to be interpreted as any additional limitation that is not inconsistent with the spirit of the present invention.