Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The networking method of the Mesh network, which is related to the embodiment of the application, is mainly applied to networking equipment of the Mesh network, and the networking equipment of the Mesh network can be equipment such as a PC (personal computer personal computer) with a wireless function, a portable computer, a mobile terminal, a server and the like.
Referring to fig. 1, fig. 1 is a schematic hardware structure of a networking device of a Mesh network according to an embodiment of the present application. In an embodiment of the present application, the networking device of the Mesh network may include a processor 1001 (e.g. a central processing unit Central Processing Unit, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communications between these components; the user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface); the memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may alternatively be a memory independent of the processor 1001. Those skilled in the art will appreciate that the hardware configuration shown in fig. 1 is not limiting of the application and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
With continued reference to fig. 1, the memory 1005, which is determined as a readable computer readable storage medium in fig. 1, may include an operating system, a network communication module, and a networking program of a Mesh network. In fig. 1, the network communication module is mainly used for connecting with a server and performing data communication with the server; the processor 1001 may call the networking program of the Mesh network stored in the memory 1005, and execute the steps of the networking method of the Mesh network provided by the embodiment of the present application.
The embodiment of the application provides a networking method of a Mesh network.
Referring to fig. 2, fig. 2 is a flow chart of an embodiment of a networking method of the Mesh network according to the present application. The networking method of the Mesh network is realized by networking equipment of the Mesh network, and the networking equipment of the Mesh network can be equipment such as a cloud server or a user terminal (smart phone, tablet personal computer or PC) of the Mesh network. Specifically, as shown in fig. 2, the networking method of the Mesh network includes the following steps:
step S101, when a network access request of a node device to be accessed to a network is received, authenticating the node device to be accessed to the network according to message information carried by the network access request to obtain an authentication result;
step S102, determining whether the node equipment to be accessed into a Mesh network or not according to the authentication result;
step S103, if the node equipment to be accessed into the Mesh network is determined to be accessed into the Mesh network, a network of the node equipment to be accessed into the Mesh network is built;
step S104, a root node device switching instruction is sent to all node devices in the Mesh network, so that all node devices in the Mesh network can push out new root node devices.
In order to better understand the embodiments of the present application, before describing the embodiments of the present application, an application scenario of the embodiments of the present application is described. The networking method of the Mesh network is suitable for closed Mesh networks, such as a family WiFi Mesh network, and is characterized in that users have uniqueness.
The embodiment of the application provides a networking method of a Mesh network, which is characterized in that node equipment which is required to be accessed to the Mesh network is authenticated, and only the node equipment which is successfully authenticated is accessed to the Mesh network, so that equipment which does not belong to a Mesh network user is prevented from accessing the network, and the safety of the Mesh network is further ensured.
In the embodiment of the present application, before step S101, a routing information table is first established, where the manner of establishing the routing information table includes:
a. the networking equipment of the Mesh network records the identification information of each node equipment of a Mesh network user, wherein the identification information of each node equipment comprises a manufacturer, a model number, a serial number, a user ID (identity) of the Mesh network and the like of each node equipment, and has uniqueness;
b. after the identification information of each node device of the Mesh network user is recorded, the identification information of each node device and the identification information of the Mesh network are stored in an associated mode;
c. and establishing a routing information table based on the stored identification information of the Mesh network and the identification information of each node device.
The method for establishing the routing information table is that the networking equipment of the Mesh network records the identification information of each node equipment of the Mesh network user in advance, wherein the identification information of each node equipment of the Mesh network user can be input by the Mesh network user; after recording the identification information of each node device of the Mesh network user, the networking device of the Mesh network stores the identification information of each node device in association with the identification information of the Mesh network, wherein the identification information of the Mesh network can be an identification number of the Mesh network and has uniqueness; finally, a routing information table can be established based on the stored identification information of the Mesh network and the identification information of each node device.
The following describes each step of gradually realizing Mesh network networking in the embodiment of the present application in detail:
step S101, when a network access request of a node device to be accessed to a network is received, authenticating the node device to be accessed to the network according to message information carried by the network access request to obtain an authentication result.
When the networking equipment of the Mesh network receives a network access request of the node equipment to be accessed to the network, the node equipment to be accessed to the network is authenticated according to the message information carried by the network access request, and an authentication result is obtained.
Exemplary, the authenticating the node device to be network-accessed according to the message information carried by the network access request to obtain an authentication result specifically includes:
a1, decoding message information carried by the network access request to extract Mesh network identification information and identification information of the node equipment to be accessed from the message information;
a2, matching the extracted Mesh network identification information and the identification information of the node equipment to be accessed to the network with a pre-stored routing information table to determine whether the node equipment to be accessed to the network is effective node equipment or not;
a3, if the node equipment to be accessed into the network is determined to be effective node equipment, an authentication result of successful authentication is obtained.
The method comprises the steps that network access request is sent to networking equipment of a Mesh network by node equipment to be accessed, and the network access request carries message information, wherein the message information comprises Mesh network identification information and identification information of the node equipment to be accessed. It should be noted that, in order to prevent the message information from being tampered maliciously, the message information is pre-packaged into a frame structure agreed with the networking device of the Mesh network, for example, the message information may be packaged in a network interconnection protocol security IPSec manner, and the frame structure may be a custom frame structure, for example:
| *** | MAC header | Addr information | Device information | payload | Frame verification | *** |
After receiving the network access request sent by the network access node equipment, the networking equipment of the Mesh network decodes the message information carried in the network access request according to a preset decoding mode corresponding to the packaging mode so as to extract the Mesh network identification information and the identification information of the network access node equipment from the message information. And then, matching the extracted Mesh network identification information and the identification information of the node equipment to be accessed to the network with a pre-stored routing information table to determine whether the node equipment to be accessed to the network is effective node equipment (the node equipment belonging to the Mesh network user is defined as effective node equipment), and if the extracted Mesh network identification information and the identification information of the node equipment to be accessed to the network are matched with the pre-stored routing information table, determining that the node equipment to be accessed to the network is effective node equipment, obtaining an authentication result of successful authentication.
The matching between the extracted Mesh network identification information and the identification information of the node device to be network-connected and a pre-stored routing information table is performed to determine whether the node device to be network-connected is an effective node device, specifically:
a20, comparing the extracted Mesh network identification information with pre-stored Mesh network identification information in a pre-stored routing information table to determine whether the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information;
a21, if the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information, comparing the extracted identification information of the node equipment to be accessed with the pre-stored equipment identification information in a pre-stored routing information table;
a22, if the prestored route information table contains prestored equipment identification information which is consistent with the extracted identification information of the node equipment to be accessed to the network, determining that the node equipment to be accessed to the network is effective node equipment.
The method comprises the steps of comparing the extracted Mesh network identification information with the pre-stored Mesh network identification information in a pre-stored route information table to judge whether the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information in the pre-stored route information table, if so, further comparing the extracted identification information of the node equipment to be accessed with the pre-stored equipment identification information in the pre-stored route information table, and if the pre-stored route information table has the pre-stored equipment identification information consistent with the extracted identification information of the node equipment to be accessed, determining that the node equipment to be accessed is effective node equipment, namely, determining that the node equipment to be accessed belongs to the node equipment of a Mesh network user, thereby obtaining an authentication result of successful authentication.
In addition, the extracted Mesh network identification information is compared with the pre-stored Mesh network identification information in the pre-stored routing information table to determine whether the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information, if the extracted Mesh network identification information is inconsistent with the pre-stored Mesh network identification information, the node equipment to be network-connected is determined to be invalid node equipment, and the node equipment to be network-connected is listed in a blacklist.
The method comprises the steps of comparing the extracted Mesh network identification information with pre-stored Mesh network identification information in a pre-stored routing information table to judge whether the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information in the pre-stored routing information table, if the extracted Mesh network identification information is inconsistent with the pre-stored Mesh network identification information in the pre-stored routing information table, indicating that the node equipment to be network-connected does not belong to the node equipment of a Mesh network user, judging that the node equipment to be network-connected is invalid, thereby obtaining an authentication result of authentication failure, listing the node equipment to be network-connected in a blacklist, and if the node equipment to be network-connected initiates a network-connected request again, directly authenticating according to the blacklist.
In addition, if the extracted Mesh network identification information is consistent with the pre-stored Mesh network identification information, comparing the extracted identification information of the node equipment to be network-connected with the pre-stored equipment identification information in a pre-stored route information table, and if the pre-stored route information table does not have the pre-stored equipment identification information consistent with the extracted identification information of the node equipment to be network-connected, determining that the node equipment to be network-connected is invalid, and listing the node equipment to be network-connected in a blacklist.
After comparing the extracted identification information of the node equipment to be network-accessed with the pre-stored equipment identification information in the pre-stored routing information table, if the pre-stored routing information table does not have the pre-stored equipment identification information consistent with the extracted identification information of the node equipment to be network-accessed, which also indicates that the node equipment to be network-accessed does not belong to the node equipment of the Mesh network user, judging that the node equipment to be network-accessed is invalid node equipment, thereby obtaining an authentication result of authentication failure, listing the node equipment to be network-accessed in a blacklist, and if the node equipment to be network-accessed initiates a network-accessed request again, directly carrying out authentication according to the blacklist.
In further implementations, it is also possible to: counting the network access request times of the same invalid node equipment within a preset time period, and if the counted times exceed a preset threshold value, generating alarm information to remind a Mesh network user.
That is, considering the situation that even if the network access request of the illegal device is refused, the network access request of the same invalid node device is still tried to access the Mesh network continuously, in the embodiment of the application, the network access request times of the same invalid node device in the preset time period are counted, if the network access request times of the same invalid node device in the preset time period exceed the preset threshold value, alarm information is generated to remind the user of the Mesh network, for example, the user of the Mesh network that the illegal device is frequently invaded, please pay attention to-! And the preset duration and the preset threshold value can be flexibly set according to actual conditions. Of course, different levels of alarm information may be generated according to the number of network access requests of the same invalid node device within a preset duration, for example, if the number of network access requests exceeding a preset threshold is within a lower limit value of a preset range, then low level alarm information is generated, for example, "there is unknown device intrusion, please note-! "; if the number of network access requests exceeding the preset threshold is within a preset range, generating medium-level alarm information, such as' frequent intrusion of unknown equipment, please note-! "; if the number of network access requests exceeds the preset threshold value and exceeds the upper limit value of a preset range, high-level alarm information such as 'frequent invasion of unknown equipment' is generated, please immediately check-! By the method, the attention and maintenance of the Mesh network user to the Mesh network are caused, so that the safety of the Mesh network is improved.
Step S102, determining whether the node equipment to be accessed into the Mesh network or not according to the authentication result.
If the networking equipment of the Mesh network authenticates the node equipment to be accessed to the Mesh network and then obtains an authentication result of successful authentication, the node equipment to be accessed to the Mesh network can be accessed.
Step S103, if the network to be accessed node equipment is determined to be accessed to the Mesh network, the network of the network to be accessed node equipment is built in the Mesh network.
If the network node equipment to be accessed is determined to be accessed into the Mesh network, a network of the network node equipment to be accessed is built in the Mesh network, and the network access operation of the network node equipment to be accessed is completed. Specifically, as shown in fig. 3, fig. 3 is a family WiFi Mesh network provided in this embodiment, where the WiFi Mesh network includes a router, a root node device, a routing node device and a leaf node device, for example, if the node device to be network-connected is a sweeper, the node device to be network-connected may be used as the leaf node device, to establish connection with the routing node device in the family WiFi Mesh network, and the node device to be network-connected is like the leaf node device 18 in fig. 3, that is, to establish connection with the routing node device 14.
Step S104, a root node device switching instruction is sent to all node devices in the Mesh network, so that all node devices in the Mesh network can push out new root node devices.
Because the device nodes are newly added in the Mesh network, the connection communication quality between the Mesh network networking device and the router is critical in consideration of the fact that the root node device is the only exit device communicated with the external Internet in the Mesh network, and at the moment, the Mesh network networking device can send a root node device switching instruction to all node devices in the Mesh network so that all node devices in the Mesh network can push out the new root node device.
Specifically, any one of the upper parent node devices in the Mesh network may acquire its own information (including wireless quality and load, where the load includes CPU occupancy rate, wireless traffic usage rate, and the like), and information of the lower child node device having a connection relationship with the Mesh network, then measure its own communication capability according to its own information, and measure the communication capability of the lower child node device having a connection relationship with the Mesh network according to the information of the lower child node device having a connection relationship with the Mesh network, and then broadcast its own communication capability and the communication capability of the lower child node device having a connection relationship with the Mesh network in the Mesh network, so that all node devices in the Mesh network may learn about its own communication capability and the communication capability of other node devices, thereby selecting the node device having the strongest communication capability as a new root node device.
According to the networking method of the Mesh network, when the networking request of the node equipment to be networked is received, the node equipment to be networked is authenticated according to the message information carried by the networking request, and an authentication result is obtained; determining whether the node equipment to be accessed into the Mesh network is accessed according to the obtained authentication result; if the node equipment to be accessed to the Mesh network is determined to be accessed to the Mesh network, a network of the node equipment to be accessed to the Mesh network is built in the Mesh network; and further sending a root node device switching instruction to all node devices in the Mesh network so that all node devices in the Mesh network can push out new root node devices to complete networking. Therefore, by authenticating the node equipment which wants to access the Mesh network, only the node equipment which is successfully authenticated is accessed to the Mesh network, so that the network access of equipment which does not belong to a user of the Mesh network is avoided, the safety of the Mesh network is ensured, and after a new node equipment is accessed to the network, the switching of the root node equipment is triggered, so that the communication quality of the Mesh network can be ensured.
Further, referring to fig. 4, based on the above embodiment, another embodiment of the networking method of the Mesh network of the present application is provided, and after step S103, the method includes:
step 105, a route switching instruction is sent to a route node device in the Mesh network, so that the route node device in the Mesh network triggers a route switching operation.
After the device to be accessed into the Mesh network is accessed into the Mesh network, because the device nodes are newly added into the Mesh network, the problem that a certain routing node device is overloaded is avoided by considering the load balance of the Mesh network, and the networking device of the Mesh network can send a routing switching instruction to the routing node device in the Mesh network so that the routing node device in the Mesh network triggers the routing switching operation.
Specifically, taking a routing node device in the Mesh network as an upper parent node device, any upper parent node device (such as the routing node device 14 in fig. 3, denoted by m) firstly acquires its own information (the information includes wireless quality and load, wherein the load includes CPU occupancy rate and wireless traffic usage rate), information of a lower child node device (leaf node device 18 in fig. 3) having a connection relationship therewith, and information of the remaining upper parent node devices (routing node devices 12, 13 in fig. 3) at the same level therewith; and then measuring the communication capacity of the self according to the information of the self and measuring the communication capacity of the rest of the upper parent node devices according to the information of the rest of the upper parent node devices which are in the same hierarchy.
Further, the superior parent node device compares the communication capacity with the communication capacity of each other superior parent node device, preliminarily judges whether the communication capacity is higher than the communication capacity of the superior parent node device, if so, the other superior parent node devices with the communication capacity higher than the communication capacity are used as alternative superior parent node devices, the communication capacities of the alternative superior parent node devices are ordered, the target superior parent node device is determined from the superior parent node devices according to the ordering result, and preferably, the alternative superior parent node device with the largest communication capacity is determined as the target superior parent node device.
And then, determining whether to trigger the route switching of the lower-level child node equipment according to the information of the lower-level child node equipment with the connection relation with the upper-level parent node equipment, disconnecting the connection relation with the lower-level child node equipment when determining to trigger the route switching of the lower-level child node equipment, and establishing the connection relation between the lower-level child node equipment and the target upper-level parent node equipment, thereby realizing the route switching of the lower-level child node equipment. In this way, all routing node devices in the Mesh network can control the routing switch in the above manner.
According to the networking method of the Mesh network, after the node equipment to be accessed into the Mesh network is accessed, the route switching is triggered by controlling the route nodes in the Mesh network, so that the problem that a certain route node equipment is overloaded can be avoided, the load balance of the Mesh network is ensured, the stability of the Mesh network is further improved, and the communication quality of the Mesh network is ensured.
Further, referring to fig. 5, based on the above embodiment, another embodiment of the networking method of the Mesh network of the present application is provided, and after step S103, the method includes:
and step S106, receiving the operation state information reported by all the node devices in the Mesh network in the current period, and monitoring the working states of all the node devices in the Mesh network according to the operation state information.
That is, after the device to be network-connected is accessed into the Mesh network, the networking device of the Mesh network may also periodically monitor the working states of all the node devices in the Mesh network. Specifically, the networking device of the Mesh network receives the operation state information reported by all node devices in the Mesh network in the current period, the operation state information of each node device comprises the operation time length, the power consumption and the like of each node device in the current period, then the operation state information of each node device can be analyzed, so that the working states of all node devices in the Mesh network are obtained, and then the working states are reported to the Mesh network user, so that the Mesh network user can conveniently control each node device according to the working states of each node device, convenience is brought to the Mesh network user, and the experience of the Mesh network user is improved.
In addition, the embodiment of the application also provides a computer readable storage medium.
The computer readable storage medium of the application stores the networking program of the Mesh network, wherein when the networking program of the Mesh network is executed by a processor, the steps of the networking method of the Mesh network are realized.
The method implemented when the networking program of the Mesh network is executed may refer to various embodiments of the networking method of the Mesh network of the present application, which are not described herein.
The computer readable storage medium may be an internal storage unit of the networking device of the Mesh network according to the foregoing embodiment, for example, a hard disk or a memory of the networking of the Mesh network. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a computer readable storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.