A non-closed loop fast networking method for WiFi mobile ad hoc network

By using the ESP-NOW communication protocol and VSA data frames, combined with graph theory algorithms, a fast non-closed-loop network formation for WiFi mobile ad hoc networks was achieved, solving the problems of slow networking speed and ring topology, and improving network performance and user experience.

CN115696559BActive Publication Date: 2025-12-05GUANGXI PUBLIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211248672.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-12
Publication Date
2025-12-05
Estimated Expiration
2042-10-12

AI Technical Summary

Technical Problem

Existing mobile mesh networks suffer from slow networking speeds and network bandwidth consumption and resource waste due to the internal ring topology formed by many-to-many node networking, especially when broadcasting messages, which may cause node crashes.

Method used

A non-closed-loop fast networking method is adopted, and communication between devices is carried out through the ESP-NOW communication protocol. VSA data frames are used for device pairing and information transmission. The connection rules between parent and child nodes are based on MAC address comparison. Access information is saved to avoid ring topology. Graph theory algorithm is used to verify the ring-free structure. When a node rejoins the network after leaving the network, it selects a suitable access point based on the signal strength.

Benefits of technology

It improves network speed, avoids network bandwidth consumption and equipment resource waste, enhances user experience, and ensures network connection reliability and rapid recovery capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115696559B_ABST
    Figure CN115696559B_ABST
Patent Text Reader

Abstract

The application provides a non-closed loop fast networking method for a WiFi mobile self-organizing network, which comprises the following steps: firstly, converting the Mac addresses of the APs of two nodes into Long Long type numbers and then comparing the numbers, the node with the smaller number serving as a parent node and the other node serving as a child node; then, connecting the nodes by using an ESP-Now communication protocol, and transmitting application data in a VSA data frame between the devices; before accessing the parent node, the child node disconnected from the network firstly determines whether the child node can access the parent node according to the number of existing child nodes in the VSA frame body field of the parent node; if the number of child nodes of the parent node is full, the child node needs to search other parent nodes with an unfull number of child nodes for access. The method avoids the situation that the child node repeatedly accesses a parent node with a full number of child nodes, thereby improving the networking speed. The networking strategy designed by the application can effectively avoid the appearance of a local ring network topology, avoid the phenomenon of flooding messages, the consumption of network bandwidth and the waste of unnecessary device computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of communication technology, and specifically relates to a non-closed-loop rapid networking method for WiFi mobile ad hoc networks. Background Technology

[0002] In traditional wireless local area networks (WLANs), each client accesses the network through a wireless link connected to an access point (AP), forming a local basic service set (BSS). Users must first access a fixed access point (AP) to communicate with each other; this network structure is called a single-hop network. In a wireless ad hoc network (Mesh), any wireless device node can act as both an AP and a router. Each node in the network can send and receive signals, and each node can communicate directly with one or more peer nodes. The biggest advantage of this mesh structure is that if the nearest AP becomes congested due to excessive traffic, data can be automatically rerouted to a nearby node with lower traffic. This process continues, and data packets can be routed to the next nearest node based on network conditions until they reach their final destination. This access method is called multi-hop access.

[0003] The mobility of nodes in mobile mesh networks presents challenges for network deployment. Due to this mobility, network design must consider factors such as deployment speed, message routing success rate, and network resource utilization. With the rise of IoT technology, many small devices now possess WiFi capabilities, enabling them to connect to routers for internet access and form networks with other WiFi devices. These devices, especially in-vehicle devices, also exhibit mobility. As user demands and experience improve, achieving fast and efficient networking for these mobile devices to enable communication has become one of the main challenges that mobile mesh networks need to address.

[0004] Meanwhile, some existing many-to-many node mobile ad hoc networking strategies and algorithms suffer from the problem of several nodes forming an internal ring topology after networking. This causes a "flooding effect" when a message is broadcast in the network, meaning the message is repeatedly broadcast in local areas (usually among the nodes forming the ring structure) or even among most network nodes. This leads to increased bandwidth consumption and processor resource consumption on each node, preventing other normal messages from being processed in a timely manner. When a large number of broadcast messages are sent, it may even cause some nodes to crash and restart. Summary of the Invention

[0005] To address the shortcomings of existing mobile mesh networks, which cannot quickly network multiple mobile WiFi devices for communication and form an internal ring topology in multi-to-multi node networking, this invention provides a non-closed-loop rapid networking method for WiFi mobile ad hoc networks. This method enables multiple devices to communicate without or without using WiFi access points, avoids connection-oriented methods, eliminates communication handshake processes, and saves access networking information related to their parent nodes, thereby improving networking speed and eliminating the internal ring topology.

[0006] This invention is achieved through the following technical solution:

[0007] A non-closed-loop rapid networking method for WiFi mobile ad hoc networks, the networking process includes the following steps:

[0008] S11. Connection rules between parent and child nodes: Convert the MAC addresses of the APs of the two nodes into Long Long numbers and compare them. The node with the smaller value becomes the parent node, and the other node becomes the child node.

[0009] S12, Parent Node Failure and Partial Reorganization: When a parent node and its subordinate child nodes are disconnected from the network, the disconnected child nodes find the node with the strongest signal based on the signal strength of the surrounding nodes, and determine whether it can be connected as a parent node according to the method in step S11; if it can, the connection is completed and the re-entry process is completed; otherwise, the node with the second strongest signal in the surrounding area is selected to determine whether it can be connected; this process is repeated until a suitable access point is found and all disconnected nodes are re-entered into the network.

[0010] S13. Node Recovery: After a node recovers and rejoins the network, it searches for a suitable parent node based on the signal strength and saves the access information; or the node's role changes to a leaf node, causing a change in the local network topology.

[0011] S14. Reconnecting the network: When the entire network is powered on and reconnected, each node directly connects to its historical parent node based on the information of the parent node that was originally saved, without the need for reconnection and pairing; if a node has a problem when powered on, proceed to step S12 to reconnect to the network.

[0012] As a further improvement of the present invention, in step S11, the connection is made using the ESP-NOW communication protocol, and the application data is encapsulated in VSA data frames and transmitted between devices.

[0013] This invention utilizes the ESP-NOW communication protocol to pair devices before communication, enabling multiple devices to communicate without or without a WiFi access point. This protocol is similar to the low-power 2.4GHz wireless connection commonly found in wireless mice. Devices pair before communication, and after pairing, the connection between devices is continuous, point-to-point, and does not require a handshake protocol. It is a fast communication technology with short data transmission and wireless connection, allowing low-power controllers to directly control all smart devices without connecting to a router. It is suitable for scenarios such as smart lights, remote control, and sensor data feedback. This one-to-many communication method... Figure 4 As shown.

[0014] The ESP-NOW communication protocol is a short data transmission, connectionless, high-speed communication technology that allows low-power controllers to directly control all smart devices without connecting to a router. Under this protocol, application data is encapsulated in "vendor-specific action" (VSA) frames, and transmission between devices is connectionless. The CCMP protocol is used to protect the security of VSA frames. The ESP-NOW communication protocol supports the following features: (1) encrypted or unencrypted unicast packet communication; (2) mixed use of encrypted and unencrypted paired devices; (3) can carry a maximum of 250 bytes of valid payload data; (4) supports setting a send callback function to notify the application layer of frame transmission failure or success.

[0015] This invention includes the number of child nodes already connected under a parent node in the body field of the VSA data frame. When a child node finds a parent node that meets the rules in step S11, it first determines whether it can connect based on the number of child nodes already present in the parent node's VSA data frame body field before connecting. If the parent node's number of connected child nodes is full, the child node needs to search for other parent nodes with remaining child nodes to connect, thus achieving a ring-free network topology. When a parent node and its subordinate child nodes are disconnected from the network due to mobility exceeding the wireless communication distance, power outage and restart, or other abnormal reasons, its child nodes will search for the strongest signal node based on the signal strength of surrounding nodes and determine whether it can connect as a parent node according to the rules in step S11. If it can connect, it will complete the reconnection process; if it cannot connect, the child node will select the device with the second strongest signal and determine whether it can connect. This process is repeated until a suitable access point is found, completing the reconnection of all disconnected nodes. This method ensures that child nodes connect to the strongest signal neighboring node, guaranteeing the reliability of the network connection. When the entire network is powered on and reconnected, each node retains its parent node's information and directly connects to its historical parent node after power-on, eliminating the need for re-networking and pairing. Therefore, the network recovery speed is very fast after power-on. If some nodes malfunction during power-on, step S12 is executed to determine which parent nodes are connected.

[0016] The purpose of this invention is to obtain, through networking, such as Figure 1 The network topology shown is a ringless structure, while Figure 2 The structure shown is a network topology with rings (nodes 3, 4, 5, and 2 form a ring, and nodes 2, 5, and 1 also form a ring). Step S11 in this invention is one of the most important rules in the networking scheme. The method of step S12 can avoid the situation of repeatedly accessing a parent node whose access point is full, thereby improving the networking speed.

[0017] This invention also provides a loop existence verification method for the aforementioned fast networking method. If a loop exists in the network, then there must exist a subgraph that is a loop, and the degree of all vertices in the loop is ≥2. The specific algorithm is as follows:

[0018] S21. Delete all vertices with degree ≤ 1 and their associated edges, and reduce the degree of other vertices associated with these edges by one.

[0019] S22. Add the vertices whose degree becomes 1 to the queue, and take out a vertex from the queue and repeat step S21.

[0020] S23. If there are still vertices that have not been deleted, then there is a cycle; otherwise, there is no cycle.

[0021] As a further improvement of the present invention, the VSA data frame belongs to the management frame in the 802.11 protocol physical layer frame; the physical layer frame includes management frame, data frame and control frame;

[0022] The VSA data frame contains the following content:

[0023] Category code: Set to 127 to identify this frame as a VSA frame;

[0024] Organization Indentifier: An organization authentication code defined by the WiFi chip manufacturer;

[0025] Vendor Specific Content: Frame data area. Its format can be customized by the equipment vendor. The message communication to be sent fills the content in this data area according to the customized communication protocol, and then sends it out through an air broadcast packet. It also contains the ID of the message recipient.

[0026] The fields of the custom communication protocol and their meanings are shown in Table 1.

[0027] Table 1: VSA Data Frame Format

[0028]

[0029]

[0030] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0031] 1. The networking strategy designed in this invention can effectively avoid the occurrence of local ring network topologies, thereby avoiding the phenomenon of flooded messages, avoiding the consumption of network bandwidth and unnecessary waste of device computing resources.

[0032] 2. This invention uses VSA data frames to broadcast data, enabling device communication and eliminating the need for a network connection handshake process. The pairing process does not even require WiFi access, which greatly improves the networking speed and thus greatly enhances the user experience. Attached Figure Description

[0033] Figure 1 This is a schematic diagram of a network topology without loops.

[0034] Figure 2 This is a schematic diagram of a network topology with a ring structure.

[0035] Figure 3 This is a line graph comparing the speeds of different network configurations in the example.

[0036] Figure 4This is a schematic diagram of a one-to-many communication topology.

[0037] Figure 5 This is a schematic diagram of the many-to-many communication topology of the ESP32 module.

[0038] Figure 6 This is a schematic diagram of the hardware structure of a cloud speaker in an application example. Detailed Implementation

[0039] The invention will now be further described with reference to the accompanying drawings.

[0040] I. Implementation Examples

[0041] A non-closed-loop rapid networking method for WiFi mobile ad hoc networks, the specific networking process is as follows:

[0042] S11. Connection rules between parent and child nodes: Convert the MAC addresses of the APs of the two nodes into Long Long numbers and compare them. The node with the smaller value becomes the parent node and the other node becomes the child node. The connection is made using the ESP-NOW communication protocol. Application data is encapsulated in VSA data frames and transmitted between devices.

[0043] The body field of the VSA data frame contains the number of child nodes that have already been connected to the parent node. When a child node finds a parent node that matches the rule in step S11, it first determines whether it can connect based on the number of child nodes already present in the parent node's VSA data frame body field before connecting. If the parent node has reached its maximum number of connected child nodes, the child node that needs to connect must search for other parent nodes that do not have a maximum number of child nodes to connect to, thus achieving a ring-free network topology.

[0044] The VSA data frame is a management frame in the 802.11 protocol physical layer frame; the physical layer frame includes management frames, data frames, and control frames.

[0045] The VSA data frame contains the following content:

[0046] Category code: Set to 127 to identify this frame as a VSA frame;

[0047] Organization Indentifier: An organization authentication code defined by the WiFi chip manufacturer;

[0048] Vendor Specific Content: Frame data area. Its format can be customized by the equipment vendor. The message communication to be sent fills the content in this data area according to the customized communication protocol, and then sends it out through an air broadcast packet. It also contains the ID of the message recipient.

[0049] The fields of the custom communication protocol and their meanings are shown in the table below:

[0050]

[0051]

[0052] S12, Parent Node Failure and Partial Reorganization: When a parent node and its subordinate child nodes are disconnected from the network due to mobility exceeding the wireless communication distance, power failure and restart, or other abnormal reasons, its child nodes will find the node with the strongest signal based on the signal strength of the surrounding nodes, and determine whether it can be connected as a parent node according to the method process in step S11.

[0053] If access is possible, proceed with the re-entry process to complete the reconnection.

[0054] If access is not possible, the child node selects the device with the second strongest signal in the vicinity and determines whether access is possible.

[0055] This process continues until a suitable access point is found, and all offline nodes are reconnected to the network.

[0056] S13. Node Recovery: After a node recovers and rejoins the network, it searches for a suitable parent node based on the signal strength and saves the access information; or the node's role changes to a leaf node, causing a change in the local network topology.

[0057] S14. Reconnecting the network: When the entire network is powered on and reconnected, each node directly connects to its historical parent node based on the information of the parent node that was originally saved, without the need for reconnection and pairing; if a node has a problem when powered on, proceed to step S12 to reconnect to the network.

[0058] II. Verification of whether loops exist in the embodiments:

[0059] If a cycle exists, then there must exist a subgraph that is a loop. The degree of all vertices in the loop is greater than or equal to 2. The specific algorithm includes the following steps:

[0060] S21. Delete all vertices with degree ≤ 1 and their associated edges, and reduce the degree of other vertices associated with these edges by one.

[0061] S22. Add the vertices whose degree becomes 1 to the queue, and take out a vertex from the queue and repeat step S21.

[0062] S23. If there are still vertices that have not been deleted, then there is a cycle; otherwise, there is no cycle.

[0063] Since there are m edges and n vertices, if m ≥ n, then according to graph theory knowledge, it can be directly judged that there is a loop. (Proof: If there is no loop, then the graph must be k trees where k ≥ 1. According to the properties of trees, the number of edges m = n - k, k ≥ 1, so m < n).

[0064] If m < n, then according to the above algorithm, each time a vertex with degree 0 is deleted, an operation is performed (at most n times), or each time a vertex with degree 1 is deleted (while deleting an edge), an operation is performed (at most m times). The total number of these two operations does not exceed m + n. Since m < n, the algorithm complexity is O(n).

[0065] There is a theorem in graph theory that if the number of edges m ≥ the number of vertices n, then there must be a circuit; otherwise, when m < n, a program needs to be written for judgment. The pseudo-code of the program algorithm is as follows:

[0066]

[0067]

[0068] In specific implementation, V can be a queue. The complexity of this algorithm is O(n + m), where n is the number of vertices and m is the number of edges. Since m < n, the complexity is O(n).

[0069] III. Verification of the Ring-Free Network Topology Structure in the Embodiment

[0070] To prove that the networking strategy of the embodiment can avoid the occurrence of a ring structure in the network topology, the proof by contradiction can be used, and the proof process is as follows:

[0071] Assume that there is a loop in the network, and its constituent nodes are:<00​​​​​​​​​​​​​​​​​​​The number of paths, or edges, between nodes N1, N2, ..., and Ni is known because they are sequentially connected and have the number of edges i. Therefore, the total number of edges in the loop formed by N1, N2, ..., and Ni, denoted by S, is S = i + M. From the above, M ≥ 1, we know that:

[0078] s=i+M≥i+1

[0079] In other words, the number of edges S is greater than or equal to the number of nodes i+1. According to an important theorem in graph theory mentioned in the section on verifying the existence of cycles: if the number of edges is greater than or equal to the number of vertices, then a cycle must exist.

[0080] According to the connection rules, the Tag value must satisfy Ti > T1. Since the nodes are cascaded sequentially, T1 is the last-order parent node, so T1's Tag value is the smallest among the loop nodes. However, if a loop exists, creating one or more paths that connect T1 and Ti, then T1 > Ti, which contradicts the initial condition Ti > T1. Therefore, it proves that loops are impossible under the network rules of this embodiment.

[0081] IV. Comparative Example

[0082] The PainlessMesh and EasyMesh networking strategies were compared. The specific networking methods are known and can be found at https: / / gitlab.com / painlessMesh / painlessMesh and https: / / github.com / Coopdis / easyMesh. The hardware platform used was an ESP32 core development board. Network setup time was used as a reference indicator; the shorter the setup time, the better the networking strategy.

[0083] PainlessMesh (https: / / gitlab.com / painlessMesh / painlessMesh) is a popular open-source project on GitLab, a networking solution for wireless mobile ad hoc networks. It's an improved version of EasyMesh, using a WiFi cascading method to dynamically network nodes. Its advantages include a simple design and fast networking speed with fewer nodes. Compared to EasyMesh, it improves the networking rules: each node records the number of its child nodes. This allows other nodes to know if a node's access point is full, preventing repeated access to the same parent node with a full child node, thus improving networking speed. However, like EasyMesh, it also suffers from ring structure issues and uses TTL (Time-To-Live) message lifecycle markers, potentially leading to message flooding and bandwidth consumption problems.

[0084] EasyMesh (https: / / github.com / Coopdis / easyMesh) is a popular open-source project on GitHub. It allows nodes in a network to operate in AP+Sta mode, enabling random access and dynamic networking. Its advantages include simple networking rules and fast connection with a small number of nodes. However, its disadvantage is that when networking with a large number of nodes, neither node knows if the other is already fully connected to its child nodes or can act as a parent node. This can lead to some child nodes repeatedly trying to connect to the same parent node that is already full, resulting in repeated connection failures and reconnections, thus slowing down the overall networking speed. EasyMesh uses TTL (Time to Live) to mark the lifespan of message packets to prevent message flooding. The TTL is decremented by 1 each time a message is forwarded, until it reaches 0 and is discarded. This approach has the problem that a large TTL setting may lead to message flooding; however, a small TTL setting may result in a low success rate of message delivery to the target node, with messages being discarded before reaching their destination. Determining the optimal TTL value is difficult, making this method of using TTL not a good way to manage bandwidth consumption. In addition, when there are many nodes, a ring topology is prone to occur, which can lead to a flooding effect when broadcasting messages. This results in a large number of redundant message forwardings throughout the network, consuming bandwidth and occupying the resources of the processors on each node.

[0085] The test results are shown in the figure below. Figure 3 As shown in the figure, the two network topology methods compared are labeled painlessMesh and EasyMesh, respectively. The method of this invention is marked as "Solution of this Invention" in the figure. It can be seen that the network topology time of this solution is more stable and less time-consuming than the other two solutions; as the number of nodes increases, the network topology time of the other two solutions increases significantly, which undoubtedly reduces the user experience.

[0086] V. Application Examples

[0087] In a smart office project, hardware devices such as the "MIIT Cloud Speaker" (hereinafter referred to as the cloud speaker) are equipped with ESP32 dual-diaphragm modules to achieve... Figure 5 The multi-to-multi device communication network topology shown implements the fast networking strategy proposed in Example 1. The hardware structure of the cloud speaker is as follows: Figure 6 As shown, it mainly includes the following modules:

[0088] 1. MCU: ESP32 WiFi + Bluetooth dual-mode module;

[0089] 2. Digital-to-analog signal conversion chip: MAX98357;

[0090] 3. TPA3116 audio signal power amplifier module;

[0091] 4. DC-DC low-voltage power conversion module;

[0092] 5. 0.96-inch OLED display;

[0093] 6. NBIoT remote switch module;

[0094] 7. Dual-channel speakers.

[0095] In addition to enabling networking and rapid connection and communication with other hardware devices, cloud speakers also offer the following main functions:

[0096] 1. Store audio files locally and play online audio.

[0097] 2. Remotely synchronize specified audio content to the cloud;

[0098] 3. Set up a timed audio playback task;

[0099] 4. Remotely control power on / off or remotely control audio playback;

[0100] 5. Bluetooth mode for playing mobile phone audio at close range.

[0101] The main advantages of the cloud speaker equipped with the ESP32 dual-diaphragm module are: remote control of audio playback; offline audio storage; high-power dual-channel speaker configuration, providing loud playback volume that can cover an office space of about 500 square meters, making it very suitable as a broadcasting and announcement device for public office spaces; 12V adapter power supply, which can be powered by a high-capacity lithium battery or power bank, facilitating the mobile deployment of the device; support for Bluetooth speaker mode, enabling short-range voice playback through traditional Bluetooth pairing; and low hardware cost, with the initial version costing around 100 yuan.

[0102] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its spirit and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.

Claims

1. A non-closed loop fast networking method for WiFi mobile ad hoc networks, characterized in that, The method comprises the following steps: S11, connection rule of parent node and child node: converting the Mac addresses of the APs of the two nodes into Long Long type numbers and comparing them, the node with the smaller number being the parent node and the other node being the child node; S12, connecting using ESP-NOW communication protocol, and encapsulating application data in VSA data frames for transmission between devices, the Body field of the VSA data frame containing the number of child nodes accessed by the node; S13, before accessing the parent node, the child node judges whether it can access according to the number of child nodes in the VSA data frame of the parent node, and if it is full, it searches other parent nodes again; S14, when the parent node is invalid or off the network, or when a certain parent node and its subordinate child nodes are off the network, the off-network child nodes find the node with the strongest signal according to the size of the signal strength of the surrounding nodes, and judge whether it can be accessed as a parent node according to the method process in steps S11-S13; if it can, the access is completed and the re-networking process is completed; Otherwise, select the second strongest node in the surrounding signal to judge whether it can be accessed; so on and so forth until a suitable access point is found, and all off-network nodes complete the re-networking process; S15, when the node recovers the network or is powered on again, it directly connects to the historical parent node according to the saved parent node information, and if it fails, it enters step S14; S16, using a loop detection algorithm to verify whether the network topology has a loop, the algorithm comprising: S21, deleting all vertices with a degree ≤1 and related edges, and reducing the degree of other vertices related to these edges by one; S22, putting the vertices with a degree of one into a queue, and taking a vertex from the queue to repeat step S21; S23, if there are still vertices that have not been deleted, there is a loop, otherwise there is no loop.

Citation Information

Patent Citations

  • Method for selecting parent node in mesh network

    CN108156644A

  • Internet of Vehicles routing protocol based on link connection time prediction and edge assistance

    CN112738707A