Ad-hoc network method and device of WiFi Mesh
By using the WiFi Mesh self-organizing network method, and leveraging pre-configured authentication information and adaptive networking algorithms, WiFi devices can form a network without human intervention, thereby expanding coverage, improving communication speed, enhancing user experience, and strengthening network security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, WiFi device networking requires user intervention, the networking operation is complex, and the communication speed is low, which cannot meet the high traffic demand.
The self-organizing network method of WiFi Mesh is adopted. By pre-configuring routing authentication information and hotspot authentication information, it automatically scans the list of access points and soft hotspots, scores nodes based on signal strength and custom IE information, and realizes multi-level cascading connection without user intervention. It uses WiFi protocol and TCP/IP protocol to expand the coverage area.
It enables networking without user intervention, improves user experience, and ensures network flexibility and security through high data rates and security measures.
Smart Images

Figure CN121751403A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and specifically to a self-organizing network method and apparatus for WiFi Mesh. Background Technology
[0002] With the development of technology, wireless communication technology has become an indispensable part of our lives, enabling us to access the internet anytime, anywhere for information transmission and retrieval. Among these, WiFi technology, as a common wireless communication technology, is widely used in homes, offices, public places, and other environments, providing convenient wireless internet access. However, in a home environment, there is usually only one WiFi router, and WiFi's ability to penetrate walls is weak, so often a single router cannot provide WiFi coverage for the entire home.
[0003] In existing technologies, WiFi management frames are used to achieve data communication between WiFi devices. Data is broadcast through management frames to expand the router's access point (AP) coverage in a BLE mesh-like networking manner. However, this method uses WiFi management frames for communication, resulting in very low communication rates that cannot meet high bandwidth demands. Furthermore, network setup requires manual user intervention, making the process complex and negatively impacting user experience. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a self-organizing WiFi Mesh method and apparatus to achieve network formation without user intervention and improve user experience.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of this invention discloses a self-organizing WiFi Mesh network method applied to a WiFi device. The WiFi device is pre-configured with routing authentication information and hotspot authentication information. The routing authentication information is used for connection verification between the WiFi device and routers participating in the WiFi Mesh network, and the hotspot authentication information is used for connection verification between the WiFi device and any node in the WiFi Mesh network. The method includes:
[0007] Scan and update the access point list and soft hotspot list;
[0008] Determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold;
[0009] If it exists, then connect to the router access point in Station mode based on the routing authentication information;
[0010] If not, or if the connection with the router access point fails, then for each soft hotspot in the soft hotspot list, a node opening the soft hotspot is scored according to the signal strength of the soft hotspot, custom IE information broadcast by a node corresponding to the soft hotspot, and a preset scoring function, to obtain a node score;
[0011] The node with the highest node score is taken as a parent node, and the soft hotspot opened by the parent node is connected in the Station mode based on the hotspot authentication information;
[0012] When the connection with the router access point or the soft hotspot opened by the parent node is successful, the WiFi device opens a corresponding soft hotspot as a node, and the custom IE information corresponding to the WiFi device is added in the broadcast information of the WiFi device, so that other WiFi devices connect to the node corresponding to the WiFi device as a parent node.
[0013] Preferably, the scoring of the node opening the soft hotspot according to the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and the preset scoring function includes:
[0014] For each soft hotspot in the soft hotspot list, the signal strength of the soft hotspot and the custom IE information broadcast by the node opening the soft hotspot are obtained; the custom IE information includes a node level of the node opening the soft hotspot and a parent node signal strength;
[0015] The node level is multiplied by a preset level weight to obtain a level loss score;
[0016] The sum of the signal strength of the soft hotspot and the parent node signal strength is subtracted by the level loss score to obtain a node score.
[0017] Preferably, after the signal strength of the soft hotspot is obtained, the method further includes:
[0018] It is judged whether the signal strength of the soft hotspot is less than a preset lower limit of node signal strength;
[0019] If less, it is determined that the node corresponding to the soft hotspot cannot be a parent node, and the scoring of the node corresponding to the soft hotspot is stopped;
[0020] If greater, it is judged whether the signal strength of the soft hotspot is greater than a preset upper limit of node signal strength;
[0021] If it is greater than the preset correction range, the signal strength of the soft hotspot is corrected so that the signal strength of the soft hotspot is less than the upper limit of the node signal strength and greater than the lower limit of the signal strength.
[0022] Preferably, the method further includes:
[0023] When the connection to the soft hotspot corresponding to the router access point or the parent node is disconnected, the soft hotspot enabled by the WiFi device is turned off, and the broadcast information of the WiFi device is stopped, and the custom IE information corresponding to the WiFi device is added.
[0024] Return to the step of performing the scan and updating the access point list and soft hotspot list.
[0025] Preferably, after a successful connection to the soft hotspot established with the parent node, the method further includes:
[0026] Start a TCP server and send a port forwarding request to the parent node of the WiFi device, triggering the port forwarding establishment process to be executed by each level of nodes between the WiFi device and the router.
[0027] The port forwarding establishment process performed by any first-level node as the current node includes: receiving the port forwarding request sent by the next-level node of the current node, allocating a corresponding reallocation port for the port forwarding request, obtaining the forwarding service table corresponding to the current node, generating a new port forwarding request based on the reallocation port, and sending the new port forwarding request to the previous-level node of the current node.
[0028] The forwarding service table corresponding to the current node is used to instruct the current node to send the TCP connection request to the target node among its various child nodes when the current node receives a TCP connection request to be sent to the WiFi device, so that the TCP connection request is forwarded to the WiFi device level by level; the TCP connection request includes: TCP connection requests sent by other subnets in the WiFi Mesh network forwarded by the router.
[0029] Preferably, the method further includes:
[0030] Receive a query request sent by the parent node of the WiFi device based on the LAN discovery protocol;
[0031] The address information of the WiFi device is sent to the router via a cascading forwarding method. During the cascading forwarding process, when any level node receives the address information, it updates the address information based on the corresponding forwarding service table and forwards the updated address information to the next level node. The address information includes: port and IP address.
[0032] A second aspect of this invention discloses a self-organizing WiFi Mesh network device applied to a WiFi device. The WiFi device is pre-configured with routing authentication information and hotspot authentication information. The routing authentication information is used for connection verification between the WiFi device and routers participating in the WiFi Mesh network, and the hotspot authentication information is used for connection verification between the WiFi device and any node in the WiFi Mesh network. The device includes:
[0033] The scanning unit is used to scan and update the access point list and the soft hotspot list;
[0034] The judgment unit is used to determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold;
[0035] The first connection unit is used to connect to the router access point in Station mode based on the routing authentication information if there is a router access point with a signal strength greater than the access point signal strength threshold.
[0036] The second connection unit is configured to, if there is no router access point with a signal strength greater than the access point signal strength threshold, or if the connection to the router access point fails, score the node that enables the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain a node score; and designate the node with the highest node score as the parent node, and connect to the soft hotspot enabled by the parent node in the Station mode based on the hotspot authentication information.
[0037] The soft hotspot activation unit is used to activate the corresponding soft hotspot as a node when a successful connection is made with the soft hotspot activated by the router access point or the parent node, and to add the corresponding custom IE information of the WiFi device to the broadcast information of the WiFi device, so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node.
[0038] Preferably, the second connection unit, used to score the node that has enabled the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain the node score, is specifically used for:
[0039] For each soft hotspot in the soft hotspot list, obtain the signal strength of the soft hotspot and the custom IE information broadcast by the node that enabled the soft hotspot; the custom IE information includes: the node level of the node that enabled the soft hotspot and the signal strength of the parent node;
[0040] Calculate the node level and the preset level weight to obtain the level loss score;
[0041] The node score is obtained by subtracting the hierarchical loss score from the sum of the signal strength of the soft hotspot and the signal strength of the parent node.
[0042] Preferably, the device further includes:
[0043] The correction unit is used to determine whether the signal strength of the soft hotspot is less than a preset lower limit of node signal strength; if it is less, it determines that the node corresponding to the soft hotspot cannot be a parent node and stops scoring the node corresponding to the soft hotspot; if it is greater, it determines whether the signal strength of the soft hotspot is greater than a preset upper limit of node signal strength; if it is greater, it corrects the signal strength of the soft hotspot based on a preset correction range, so that the signal strength of the soft hotspot is less than the upper limit of node signal strength and greater than the lower limit of signal strength.
[0044] Preferably, the device further includes:
[0045] The disconnection unit is used to turn off the soft hotspot enabled by the WiFi device when the connection with the soft hotspot corresponding to the router access point or the parent node is disconnected, and to stop adding the custom IE information corresponding to the WiFi device to the broadcast information of the WiFi device; and return to the step of scanning and updating the access point list and soft hotspot list.
[0046] Based on the above embodiments of the present invention, a self-organizing WiFi Mesh method and apparatus are provided, which involves scanning and updating an access point list and a soft hotspot list; determining whether there is a router access point in the access point list with a signal strength greater than the access point signal strength threshold; if so, connecting to the router access point in Station mode based on the routing authentication information; if not, or if the connection to the router access point fails, for each soft hotspot in the soft hotspot list, scoring the node that enables the soft hotspot based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain a node score; taking the node with the highest node score as the parent node, and connecting to the soft hotspot enabled by the parent node in Station mode based on the hotspot authentication information; when a successful connection is made with the router access point or the soft hotspot enabled by the parent node, enabling the WiFi device as a node to enable the corresponding soft hotspot, and adding the custom IE information corresponding to the WiFi device to the broadcast information of the WiFi device, so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node. This solution utilizes a multi-level cascading approach based on WiFi and TCP / IP protocols to expand the router's coverage while maintaining communication speed. It also employs an adaptive networking algorithm to achieve network setup without user intervention, thereby enhancing the user experience. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0048] Figure 1 This is a WiFi Mesh network topology diagram disclosed in an embodiment of the present invention;
[0049] Figure 2 This is another WiFi Mesh network topology diagram according to an embodiment of the present invention;
[0050] Figure 3 This is a flowchart illustrating a self-organizing WiFi Mesh method disclosed in an embodiment of the present invention;
[0051] Figure 4 This is a flowchart of another self-organizing WiFi Mesh method disclosed in an embodiment of the present invention;
[0052] Figure 5This is a structural diagram of a WiFi Mesh self-organizing network device disclosed in an embodiment of the present invention. Detailed Implementation
[0053] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0054] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0055] As the background technology indicates, existing technologies use WiFi management frames to achieve data communication between WiFi devices. Data is broadcast through these management frames to expand the router's access point (AP) coverage, achieving a BLE mesh-like networking approach. However, this method relies on WiFi management frames, resulting in very low communication speeds that cannot meet high bandwidth demands. Furthermore, network setup requires manual user intervention, making the process complex and negatively impacting user experience.
[0056] Therefore, this invention discloses a self-organizing WiFi Mesh network method and apparatus. In this solution, a multi-level cascading method based on WiFi and TCP / IP protocols is used to expand the coverage of the router while ensuring the communication rate. An adaptive networking algorithm is also used to achieve networking without user intervention, thereby improving the user experience.
[0057] like Figure 1 The diagram shown is a WiFi Mesh network topology diagram disclosed in an embodiment of the present invention.
[0058] The router's coverage area is represented by the dashed circle, and this coverage is extended through cascading nodes. These nodes form a star topology centered on the router. Each node connects to the router via one or more hops to achieve internet access.
[0059] Specifically, each node represents a WiFi device, and each WiFi device uses a combination of SoftAP and Station to achieve multi-level cascading of WiFi devices: by connecting the Station of multiple WiFi devices to the SoftAP of the previous level node, a multi-level cascading structure is formed, thereby expanding the AP coverage range of the router.
[0060] Based on the WiFi Mesh network topology disclosed in the above embodiments of the present invention, such as Figure 2 The diagram shown is another WiFi Mesh network topology diagram according to an embodiment of the present invention.
[0061] For example, there are a total of 8 nodes, A through H, and a router.
[0062] Among them, nodes A to E are within the WiFi coverage area of the Router (e.g., Figure 1 (As shown by the dashed circle), nodes A through E connect directly to the Router via Station mode. Nodes A through E obtain IP addresses assigned by the Router in Station mode: 192.168.1.100 to 192.168.1.104. After nodes A through E successfully connect to the Router in Station mode, each node will activate SoftAP to extend the Router's WiFi coverage.
[0063] In this setup, the SoftAPs of nodes B and C both have the IP address 193.168.1.1. Nodes B and C will start a DHCP server to assign IP addresses to their child nodes. Once the SoftAPs of nodes B and C are started, they will be discovered by nodes F and G. Node F will then connect to node B, and node G will connect to node C.
[0064] Both nodes G and C obtain the IP address 193.168.1.100. Then, nodes G and C start SoftAP and simultaneously start a DHCP server with the IP address 194.168.1.1 to provide WiFi support for the next-level nodes.
[0065] Finally, node H connects to node F and obtains the IP address 194.168.1.100, so that all nodes can connect to the Router in one-hop or multi-hop manner and realize Internet access.
[0066] It should be noted that although nodes F and G use the same IP address, they are physically on different subnets because they are connected to SoftAPs enabled on different nodes. Nodes F and G will not see each other's IP address, so there will actually be no problem.
[0067] It should also be noted that when node H is forwarded through node F, its IP address will be translated by node F's NAT (Network Address Translation) to the IP address of node F in Station mode. When it passes through node B, node B's NAT will translate its IP address to the IP address of node B in Station mode. Finally, when it passes through the Router, the Router will translate its IP address to the Router's WAN port IP address.
[0068] The above embodiments of the present invention have the following beneficial effects:
[0069] 1. Effectively reduces the complexity of user configuration and management, and improves network flexibility and scalability.
[0070] 2. Optimized data processing capabilities: Each level of WiFi device cascading employs the standard WiFi protocol, transmitting data via standard TCP / IP instead of WiFi management frames. WiFi management frames typically use a transmission rate of 1Mbps, while WiFi TCP / IP data rates can be much higher. For example, 802.11N data communication, even in single-transmit / receive mode, can reach speeds of 72Mbps.
[0071] 3. Enhanced Network Security: Advanced network security measures, such as data encryption and access control, are employed in each level of WiFi device cascading to ensure data security. Simultaneously, effective management and monitoring of each level of WiFi devices allows for the timely detection and handling of potential security threats, further improving network security. Furthermore, because each node is not within the same local area network, an attack on any one WiFi device will not affect the security of the entire network, thus enhancing network security.
[0072] Based on the above embodiments of the present invention, such as Figure 3 The diagram shown is a flowchart of a self-organizing WiFi Mesh method disclosed in an embodiment of the present invention, which is applied to WiFi devices.
[0073] It should be noted that the WiFi device is pre-configured with routing authentication information and hotspot authentication information. The routing authentication information is used for connection verification between the WiFi device and the routers participating in the WiFi Mesh network, and the hotspot authentication information is used for connection verification between the WiFi device and any node in the WiFi Mesh network.
[0074] Both routing authentication information and hotspot authentication information include: hotspot name (SSID) and password. Typically, the SSID and password in the routing authentication information differ from those in the hotspot authentication information. This prevents devices not participating in the network but wanting to connect to the router from mistakenly connecting to the SoftAP. Additionally, for security reasons, nodes enabling SoftAPs must hide their hotspot name (SSID) to avoid detection. WiFi devices can actively scan using pre-configured SSIDs to discover these hidden SoftAPs.
[0075] The self-organizing network method of WiFi Mesh mainly includes the following steps:
[0076] Step S301: Scan and update the access point list and soft hotspot list.
[0077] In step S301, the scan function of the WiFi device is used to scan for surrounding hotspots and obtain a list of connectable access points (AP list) and a list of soft hotspots (SoftAP list).
[0078] Understandably, each WiFi device may connect to either an AP initiated by a Router or a SoftAP initiated by a node.
[0079] Step S302: Determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold; if yes, proceed to step S303; otherwise, proceed to step S304.
[0080] In step S302, if a router access point exists in the access point list and its signal strength is greater than the signal strength threshold of -60dBm, then step S303 is executed to directly connect to the router access point.
[0081] If there is no router access point with a signal strength greater than the access point signal strength threshold, it means that the distance to the router is far. In this case, step S304 connects to the SoftAP of the node.
[0082] Step S303: Connect to the router access point in Station mode based on the routing authentication information; if the connection fails, proceed to step S304; if the connection succeeds, proceed to step S306.
[0083] In step S303, the reason for the connection failure is: since a standard WiFi protocol is required for connection, the routing authentication information pre-configured in the WiFi device must match the SSID and password configured in the router. If they do not match, the connection will fail, further indicating that the router is not a router participating in the network with the current WiFi device.
[0084] Step S304: For each soft hotspot in the soft hotspot list, score the node that has enabled the soft hotspot based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and the preset scoring function, and obtain the node score.
[0085] In step S304, when a node enables SoftAP and allows other WiFi devices to connect for networking purposes, it adds custom IE information to the beacon / probe response data packet (i.e., broadcast information). The custom IE information is used to identify whether the node can serve as a parent node in the WiFi mesh network. At the same time, the custom IE information includes information such as the node's node level, the parent node's signal strength (up_rssi), and MAC address.
[0086] In the specific implementation of step S304, for each soft hotspot in the soft hotspot list, the signal strength of the soft hotspot and the custom IE information broadcast by the node that enabled the soft hotspot are obtained, the node level and the preset level weight are calculated to obtain the level loss score, and the level loss score is subtracted from the sum of the signal strength of the soft hotspot and the signal strength of the parent node to obtain the node score.
[0087] In this embodiment of the invention, the WiFi device connects to nodes with strong signals and few forwarding layers as parent nodes whenever possible. A node with a strong signal is one that is both close in distance (indicated by high signal strength) and has a parent node that is also close in distance (indicated by high signal strength in the parent node). Fewer forwarding layers mean a smaller node layer value; each additional layer is assigned a layer weight of 10 dBm. For example, if a node has 2 layers, the layer loss score is 20.
[0088] Preferably, after obtaining the signal strength of the soft hotspot, it is determined whether the signal strength of the soft hotspot is less than a preset lower limit of the node signal strength;
[0089] If the score is less than the threshold, the node corresponding to the soft hotspot is determined to be unsuitable as a parent node, and scoring of the node corresponding to the soft hotspot is stopped.
[0090] If it is greater than the preset upper limit of the node signal strength, determine whether the signal strength of the soft hotspot is greater than the preset upper limit of the node signal strength.
[0091] If the signal strength is greater than the preset correction range, the signal strength of the soft hotspot is adjusted so that the signal strength of the soft hotspot is less than the upper limit of the node signal strength and greater than the lower limit of the signal strength.
[0092] It should be noted that if the signal strength of a node is less than the lower limit of node signal strength -75dBm, it is a node with a very poor signal and cannot be selected as a parent node. In this case, there is no need to continue the scoring process.
[0093] Additionally, avoid using adjacent nodes (i.e., nodes very close to the WiFi device) as parent nodes. Therefore, for adjacent nodes, it is necessary to reduce their node score. Specifically, this is achieved by adjusting the signal strength of the soft hotspot enabled by the node.
[0094] For example, the signal strength of adjacent nodes is generally greater than the upper limit of signal strength -35dBm. Therefore, when the signal strength is greater than the upper limit of signal strength -35dBm, the signal strength of the current scoring node needs to be corrected to be less than the upper limit of the node's signal strength and greater than the lower limit of signal strength -60dBm.
[0095] It should be noted that when the current scoring node is greater than the signal strength limit, the WiFi device is very close to the current scoring node. In this case, the parent node of the current scoring node should be selected as the parent node of the WiFi device. This can reduce the number of layers in the WiFi Mesh network.
[0096] Based on the scoring process disclosed in the above embodiments of the present invention, the specific scoring function is as follows:
[0097] int get_score(int up_rssi,int rssi,int level) [
[0099] int score;
[0100] if((up_rssi<-75)||(rssi<-75))|
[0101] return-999;
[0102] if (up_rssi > -35)
[0103] up_rssi = --60;
[0104] if (rssi > -35)
[0105] up_rssi = -60;
[0106] score=up_rssi+rssi-level*10;
[0107] return score ]
[0109] Step S305: Select the node with the highest node score as the parent node, and connect to the soft hotspot opened by the parent node in Station mode based on the hotspot authentication information.
[0110] In step S305, a standard WiFi protocol is used for connection. Therefore, the hotspot authentication information pre-configured in the WiFi device must match the SSID and password configured in the parent node for the connection to succeed. Otherwise, the node with the highest score among the remaining nodes is selected as the parent node until the connection is successful.
[0111] Step S306: Enable the WiFi device as a node to create a corresponding soft hotspot, and add the WiFi device's custom IE information to the WiFi device's broadcast information so that other WiFi devices can connect to the WiFi device's node as the parent node.
[0112] In step S306, when a WiFi device enables SoftAP as a node and allows other WiFi devices to connect for networking purposes, it adds custom IE information to the beacon / probe response data packet (i.e., broadcast information) so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node. At the same time, the custom IE information includes information such as the node's level, the parent node's signal strength (up_rssi), and MAC address.
[0113] Preferably, while enabling SoftAP as a node, the WiFi device also enables NAT service, so that other WiFi devices can connect to the router and access the Internet after connecting to the node corresponding to the WiFi device as the parent node.
[0114] Preferably, when the WiFi device loses connection with the soft hotspot corresponding to the router access point or parent node, the soft hotspot enabled by the WiFi device is turned off, and the WiFi device's customIE information is added to the WiFi device's broadcast information. Then, the process returns to step S301.
[0115] It's important to note that you should stop adding the WiFi device's custom IE information to the WiFi device's broadcast information and disconnect all child nodes connected to the WiFi device. This is to ensure that the WiFi device's child nodes are aware that the WiFi device has lost network access and need to scan for other suitable nodes as parent nodes to re-establish network connections, thus enabling rapid network recovery.
[0116] Corresponding to the self-organizing WiFi Mesh method disclosed in the above embodiments of the present invention, such as Figure 4 The diagram shown is a flowchart of another self-organizing WiFi Mesh method disclosed in an embodiment of the present invention. Figure 4 The complete process of the above embodiments is summarized. For the specific connection process, please refer to the above embodiments of the present invention, which will not be repeated here.
[0117] The above networking method enables all nodes to access the network through a multi-level approach. With the help of NAT, each node can freely access the external network. However, because each level of nodes achieves network isolation through SoftAP, child nodes under different nodes cannot actually communicate with each other. This is a drawback of this architecture; it cannot achieve true mesh functionality, allowing each node to freely transmit data.
[0118] To solve the problem of free access between nodes, TCP & UDP data access between nodes is enabled based on discovery protocols and port forwarding. At the same time, other non-mesh devices in the local area network can also access the services provided by any child node through TCP & UDP.
[0119] In this embodiment of the invention, NAT portforward and port remapping techniques are used to achieve NAT traversal capability, and then mDNS proxy is used to discover TCP & UDP services through mDNS. Specifically:
[0120] Once a successful connection is established with the soft hotspot opened by the parent node, a TCP server is started and a port forwarding request is sent to the parent node of the WiFi device, triggering the port forwarding establishment process to be executed by each level of nodes between the WiFi device and the router.
[0121] The process of establishing a port forwarding service when any first-level node acts as the current node includes: receiving a port forwarding request sent by the next-level node of the current node, allocating a corresponding reallocation port for the port forwarding request, obtaining the forwarding service table corresponding to the current node, generating a new port forwarding request based on the reallocation port, and sending the new port forwarding request to the previous-level node of the current node.
[0122] The forwarding service table corresponding to the current node is used to instruct the current node to send the TCP connection request to the target node in each of its child nodes when the current node receives a TCP connection request to be sent to the WiFi device, so that the TCP connection request is forwarded to the WiFi device level by level; the TCP connection request includes: TCP connection requests sent by other subnets in the WiFi Mesh network forwarded by the router.
[0123] It should be noted that mDNS is a standard LAN discovery protocol. mDNS sends a request to the LAN via multicast to obtain a list of services from all devices. The receiving party returns information such as the service port and IP address it provides via a response.
[0124] In one embodiment, since mDNS can only communicate within the same local area network, if a device connected to the Router initiates an mDNS query, it can only discover services provided by nodes directly connected to the Router in the WiFi Mesh network, and cannot obtain services provided by lower-level nodes. To solve this problem, each node in the WiFi Mesh network provides an mDNS proxy service for its next-level nodes. Specifically:
[0125] The parent node of the WiFi device receives the query request sent by the local area network discovery protocol and sends the address information of the WiFi device to the router through a hierarchical forwarding method. During the hierarchical forwarding process, when any level node receives the address information, it updates the address information based on the corresponding forwarding service table and forwards the updated address information to the previous level node. The address information includes: port and IP address.
[0126] To clearly illustrate the above implementation process, the embodiments of the present invention are based on... Figure 2 The WiFi Mesh network topology shown is illustrated as an example.
[0127] For ease of explanation, the interface on which each node connects to the previous level node in Station mode is called the WAN port, similar to the WAN port of a router. The interface on which each node enables SoftAP to provide network services to the next level node is called the LAN port, similar to the internal LAN port of a router.
[0128] by Figure 2 Let's use nodes H, F, and B to illustrate the portforward process described above:
[0129] 1. After node H and node F successfully establish a SoftAP connection, node H starts a TCP server on port 80.
[0130] 2. Node H requests portforward functionality (i.e., sends a port forwarding request) from Node F, with IP address 194.168.1.100 and port 80. Node F assigns a remapping port 30080 to Node H, which is the reassigned port mentioned above. Therefore, Node F has a portforward table, which is a forwarding service table, with the following contents: Nport: 30080, SIP: 194.168.1.00, Sport: 80.
[0131] It should be noted that when node F's WAN port receives a TCP connection request to port 30080, it forwards it directly to node H based on the forwarding service table.
[0132] 3. After node F successfully creates a portforward request, it continues to send a port forwarding request to the next higher-level node, node B. The requested port is 30080, and the IP address is 193.168.1.100. Node B then allocates a new forwarding service table for node F's port forwarding request, with the following content: Nport: 30180, SIP: 193.168.1.00, Sport: 30080.
[0133] It should be noted that when any device that is directly or indirectly connected to the router initiates a TCP connection request to Node B (IP address: 192.168.1.101, port 30180), the TCP connection request will be forwarded to Node H based on the forwarding service table.
[0134] Taking a mobile phone as an example, if a mobile phone connected to a router initiates an mDNS query, it can only discover the services provided by nodes A through E, and cannot obtain services provided by nodes at the next lower level. To solve this problem, each node in a WiFi Mesh network provides an mDNS proxy service for the next lower level node:
[0135] For each node, when the WAN port receives an mDNS query request, it forwards it to all child nodes connected to the LAN port. The address information returned by the child nodes is then modified based on the mDNS proxy service and the forwarding service table corresponding to the current node, and the modified address information is forwarded to the WAN port of the current node.
[0136] For example, in the address information returned by node H, the IP address is 194.168.1.100 and the port is 80. Node F obtains the corresponding information by querying its corresponding forwarding service table, and thus modifies the IP address to 193.168.1.100 and the port to 30080. Then, node F forwards the modified address information to node B. Node B, based on the mDNSproxy service and its corresponding forwarding service table, modifies the IP address to 192.168.1.101 and the port to 30180, and forwards the modified address information to the mobile phone. In this way, the mobile phone discovers a device with the IP address 192.168.1.101 and the port 30180, and then initiates a TCP connection request, which can successfully reach node H.
[0137] Based on the self-organizing WiFi Mesh method disclosed in the above embodiments of the present invention, this solution expands the coverage of the router while ensuring the communication rate through a multi-level cascading method based on the WiFi protocol and the TCP / IP protocol, and uses an adaptive networking algorithm to achieve networking without user intervention, thereby improving the user experience.
[0138] Corresponding to the self-organizing WiFi Mesh method disclosed in the above embodiments of the present invention, such as Figure 5 The diagram shows a structure of a self-organizing WiFi Mesh network device disclosed in an embodiment of the present invention. The device is applied to a WiFi device, which is pre-configured with routing authentication information and hotspot authentication information. The routing authentication information is used for connection verification between the WiFi device and the router participating in the WiFi Mesh network, and the hotspot authentication information is used for connection verification between the WiFi device and any node in the WiFi Mesh network. The device includes: a scanning unit 501, a judging unit 502, a first connection unit 503, a second connection unit 504, and a soft hotspot activation unit 505.
[0139] Scanning unit 501 is used to scan and update the access point list and soft hotspot list;
[0140] The judgment unit 502 is used to determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold;
[0141] The first connection unit 503 is used to connect to the router access point in Station mode based on routing authentication information if there is a router access point with a signal strength greater than the access point signal strength threshold.
[0142] The second connection unit 504 is used to score the node that enables the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function if there is no router access point with a signal strength greater than the access point signal strength threshold, or if the connection with the router access point fails. The node with the highest node score is taken as the parent node, and the soft hotspot enabled by the parent node is connected in Station mode based on the hotspot authentication information.
[0143] The soft hotspot enabling unit 505 is used to enable the corresponding soft hotspot as a node when a connection to a soft hotspot enabled by a router access point or a parent node is successful. It also adds the corresponding custom IE information of the WiFi device to the broadcast information of the WiFi device so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node.
[0144] In one embodiment, a second connection unit 504, used to score the nodes that have enabled the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain the node score, is specifically used for:
[0145] For each soft hotspot in the soft hotspot list, obtain the signal strength of the soft hotspot and the custom IE information broadcast by the node that enabled the soft hotspot; the custom IE information includes: the node level of the node that enabled the soft hotspot and the signal strength of the parent node;
[0146] Calculate the node level and the preset level weight to obtain the level loss score;
[0147] The node score is obtained by subtracting the hierarchical loss score from the sum of the signal strength of the soft hotspot and the signal strength of the parent node.
[0148] In one embodiment, it further includes:
[0149] The correction unit is used to determine whether the signal strength of the soft hotspot is less than the preset lower limit of the node signal strength; if it is less, it determines that the node corresponding to the soft hotspot cannot be a parent node and stops scoring the node corresponding to the soft hotspot; if it is greater, it determines whether the signal strength of the soft hotspot is greater than the preset upper limit of the node signal strength; if it is greater, it corrects the signal strength of the soft hotspot based on the preset correction range, so that the signal strength of the soft hotspot is less than the upper limit of the node signal strength and greater than the lower limit of the signal strength.
[0150] In one embodiment, it further includes:
[0151] The disconnect unit is used to turn off the soft hotspot enabled by the WiFi device when the connection with the soft hotspot corresponding to the router access point or parent node is lost, and to stop adding the corresponding custom IE information of the WiFi device to the broadcast information of the WiFi device; then return to the step of performing a scan and updating the access point list and soft hotspot list.
[0152] In one embodiment, it further includes:
[0153] The port forwarding unit is used to start a TCP server and send a port forwarding request to the parent node of the WiFi device after a successful connection with the soft hotspot opened by the parent node, thereby triggering the port forwarding establishment process to be executed by each level of nodes between the WiFi device and the router.
[0154] The process of establishing a port forwarding service when any first-level node acts as the current node includes: receiving a port forwarding request sent by the next-level node of the current node, allocating a corresponding reallocation port for the port forwarding request, obtaining the forwarding service table corresponding to the current node, generating a new port forwarding request based on the reallocation port, and sending the new port forwarding request to the previous-level node of the current node.
[0155] The forwarding service table corresponding to the current node is used to instruct the current node to send the TCP connection request to the target node among its various child nodes when the current node receives a TCP connection request to be sent to a WiFi device, so that the TCP connection request is forwarded to the WiFi device level by level; the TCP connection request includes: TCP connection requests sent by other subnets in the WiFi Mesh network forwarded by the router.
[0156] In one embodiment, it further includes:
[0157] The discovery unit is used to receive query requests sent by the parent node of the WiFi device based on the local area network discovery protocol;
[0158] The address information of the WiFi device is sent to the router through a hierarchical forwarding process. During the hierarchical forwarding process, when any node receives the address information, it updates the address information based on the corresponding forwarding service table and forwards the updated address information to the next higher-level node. The address information includes: port and IP address.
[0159] Based on the self-organizing WiFi Mesh device disclosed in the above embodiments of the present invention, this solution expands the coverage of the router while ensuring the communication rate through a multi-level cascading method based on the WiFi protocol and the TCP / IP protocol, and uses an adaptive networking algorithm to achieve networking without user intervention, thereby improving the user experience.
[0160] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, for system or system embodiments, since they are fundamentally similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. Components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0161] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0162] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A self-organizing network method for WiFi Mesh, characterized in that, An application to WiFi devices, wherein the WiFi devices are pre-configured with routing authentication information and hotspot authentication information, the routing authentication information being used for connection verification between the WiFi device and routers participating in the WiFi Mesh network, and the hotspot authentication information being used for connection verification between the WiFi device and any node in the WiFi Mesh network, the method comprising: Scan and update the access point list and soft hotspot list; Determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold; If it exists, then connect to the router access point in Station mode based on the routing authentication information; If it does not exist, or the connection with the router access point fails, then for each soft hotspot in the soft hotspot list, the node that has enabled the soft hotspot is scored according to the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and the preset scoring function, so as to obtain the node score; The node with the highest node score is taken as the parent node, and the soft hotspot opened by the parent node is connected in the Station mode based on the hotspot authentication information; When a successful connection is made to the soft hotspot opened by the router access point or the parent node, the WiFi device is enabled as a node to open the corresponding soft hotspot, and the custom IE information corresponding to the WiFi device is added to the broadcast information of the WiFi device, so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node.
2. The method according to claim 1, characterized in that, For each soft hotspot in the soft hotspot list, a score is assigned to the node that has enabled the soft hotspot based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain a node score, including: For each soft hotspot in the soft hotspot list, obtain the signal strength of the soft hotspot and the custom IE information broadcast by the node that enabled the soft hotspot; the custom IE information includes: the node level of the node that enabled the soft hotspot and the signal strength of the parent node; Calculate the node level and the preset level weight to obtain the level loss score; The node score is obtained by subtracting the hierarchical loss score from the sum of the signal strength of the soft hotspot and the signal strength of the parent node.
3. The method according to claim 2, characterized in that, After obtaining the signal strength of the soft hotspot, the method further includes: Determine whether the signal strength of the soft hotspot is less than a preset lower limit for node signal strength; If the score is less than the value of the node corresponding to the soft hotspot, then the node corresponding to the soft hotspot cannot be used as a parent node, and the scoring of the node corresponding to the soft hotspot is stopped. If it is greater than, determine whether the signal strength of the soft hotspot is greater than the preset upper limit of the node signal strength; If it is greater than the preset correction range, the signal strength of the soft hotspot is corrected so that the signal strength of the soft hotspot is less than the upper limit of the node signal strength and greater than the lower limit of the signal strength.
4. The method according to claim 1, characterized in that, The method further includes: When the connection to the soft hotspot corresponding to the router access point or the parent node is disconnected, the soft hotspot enabled by the WiFi device is turned off, and the broadcast information of the WiFi device is stopped, and the custom IE information corresponding to the WiFi device is added. Return to the step of performing the scan and updating the access point list and soft hotspot list.
5. The method according to claim 1, characterized in that, After a successful connection to the soft hotspot established with the parent node, the method further includes: Start a TCP server and send a port forwarding request to the parent node of the WiFi device, triggering the port forwarding establishment process to be executed by each level of nodes between the WiFi device and the router. The port forwarding establishment process performed by any first-level node as the current node includes: receiving the port forwarding request sent by the next-level node of the current node, allocating a corresponding reallocation port for the port forwarding request, obtaining the forwarding service table corresponding to the current node, generating a new port forwarding request based on the reallocation port, and sending the new port forwarding request to the previous-level node of the current node. The forwarding service table corresponding to the current node is used to instruct the current node to send the TCP connection request to the target node among its various child nodes when the current node receives a TCP connection request to be sent to the WiFi device, so that the TCP connection request is forwarded to the WiFi device level by level; the TCP connection request includes: TCP connection requests sent by other subnets in the WiFi Mesh network forwarded by the router.
6. The method according to claim 5, characterized in that, The method further includes: Receive a query request sent by the parent node of the WiFi device based on the LAN discovery protocol; The address information of the WiFi device is sent to the router via a cascading forwarding method. During the cascading forwarding process, when any level node receives the address information, it updates the address information based on the corresponding forwarding service table and forwards the updated address information to the next level node. The address information includes: port and IP address.
7. A self-organizing WiFi Mesh network device, characterized in that, An apparatus for use with WiFi devices, wherein the WiFi devices are pre-configured with routing authentication information and hotspot authentication information, the routing authentication information being used for connection verification between the WiFi device and routers participating in the WiFi Mesh network, and the hotspot authentication information being used for connection verification between the WiFi device and any node in the WiFi Mesh network, the apparatus comprising: The scanning unit is used to scan and update the access point list and the soft hotspot list; The judgment unit is used to determine whether there is a router access point in the access point list whose signal strength is greater than the access point signal strength threshold; The first connection unit is used to connect to the router access point in Station mode based on the routing authentication information if there is a router access point with a signal strength greater than the access point signal strength threshold. The second connection unit is configured to, if there is no router access point with a signal strength greater than the access point signal strength threshold, or if the connection to the router access point fails, score the node that enables the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, to obtain a node score; and designate the node with the highest node score as the parent node, and connect to the soft hotspot enabled by the parent node in the Station mode based on the hotspot authentication information. The soft hotspot activation unit is used to activate the corresponding soft hotspot as a node when a successful connection is made with the soft hotspot activated by the router access point or the parent node, and to add the corresponding custom IE information of the WiFi device to the broadcast information of the WiFi device, so that other WiFi devices can connect to the node corresponding to the WiFi device as the parent node.
8. The apparatus according to claim 7, characterized in that, The second connection unit, used to score the nodes that have enabled the soft hotspot for each soft hotspot in the soft hotspot list based on the signal strength of the soft hotspot, the custom IE information broadcast by the node corresponding to the soft hotspot, and a preset scoring function, and to obtain the node score, is specifically used for: For each soft hotspot in the soft hotspot list, obtain the signal strength of the soft hotspot and the customIE information broadcast by the node that enabled the soft hotspot; the customIE information includes: the node level of the node that enabled the soft hotspot and the signal strength of the parent node; Calculate the node level and the preset level weight to obtain the level loss score; The node score is obtained by subtracting the hierarchical loss score from the sum of the signal strength of the soft hotspot and the signal strength of the parent node.
9. The apparatus according to claim 8, characterized in that, The device further includes: The correction unit is used to determine whether the signal strength of the soft hotspot is less than a preset lower limit of node signal strength; if it is less, it determines that the node corresponding to the soft hotspot cannot be a parent node and stops scoring the node corresponding to the soft hotspot; if it is greater, it determines whether the signal strength of the soft hotspot is greater than a preset upper limit of node signal strength; if it is greater, it corrects the signal strength of the soft hotspot based on a preset correction range, so that the signal strength of the soft hotspot is less than the upper limit of node signal strength and greater than the lower limit of signal strength.
10. The apparatus according to claim 7, characterized in that, The device further includes: The disconnection unit is used to turn off the soft hotspot enabled by the WiFi device when the connection with the soft hotspot corresponding to the router access point or the parent node is disconnected, and to stop adding the custom IE information corresponding to the WiFi device to the broadcast information of the WiFi device; and return to the step of scanning and updating the access point list and soft hotspot list.