Wireless networking method and device, storage medium and computer program product

By dynamically searching and electing root nodes in wireless ad hoc networks, the problems of instability of network structure and low efficiency in determining node roles are solved, and better network performance and load balancing are achieved.

CN119497118APending Publication Date: 2025-02-21QINGDAO HAIER TECH +2

Patent Information

Application Number
CN202411594150.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

Routing technology in wireless ad hoc networks leads to unstable network structure, and existing node role determination technology cannot select appropriate root nodes for networking under the premise of ensuring load balancing, resulting in poor network performance.

Method used

When the first node is in the network search state, the root node is searched within its link line of sight; if the root node is not searched, the multiple second nodes and the first nodes within the link line of sight are elected among the multiple second nodes and the first nodes within the link line of sight are selected. Exit the root node; after the root node is elected, the third node is used as a child node to network with the root node.

Benefits of technology

Dynamically electing the optimal root node ensures the flexibility and network performance of node roles, and solves the problems of instability of network structure and low efficiency in node role judgment in wireless ad hoc networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119497118A_ABST
    Figure CN119497118A_ABST
Patent Text Reader

Abstract

The invention discloses a wireless networking method and device, a storage medium and a computer program product, and relates to the technical field of smart home, and the wireless networking method comprises the steps: searching a root node in a link sight distance range of a first node under the condition that the first node is determined to be in a network searching state, the network searching state is used for the first node to search the root node; under the condition that the root node is not searched, the root node is selected from a plurality of second nodes in the link visual range and the first node, and the plurality of second nodes are all in the network searching state; and under the condition that the root node is selected, a third node is used as a child node to carry out networking with the root node, and the third node is a node except the root node in the plurality of second nodes and the first node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and more specifically, to a wireless networking method and device, a storage medium, and a computer program product. Background Art

[0002] For a tree network topology, the nodes in the network will have two roles: root node and child node. The root node will be located in a relatively core position in the network, responsible for creating the network, determining the basic parameters of the network, controlling the network structure and providing an interface for the flow of data from the network to the outside (between MESH subnets and between MESH network and wide area network). The child nodes are generally in a subordinate position in the network. They are connected to each other and finally connected to the root node to complete data communication based on certain transmission and routing protocols. Here, the choice of its own role when the node joins the network is very important. However, considering that the wireless MESH network is a self-organizing network that changes at any time, the nodes in the network may join, exit and move at any time. How to dynamically select a role for a node becomes a difficult problem. The more severe environment is when a large number of nodes try to join the network at the same time. At this time, the nodes do not know each other, and there may even be many nodes that have never communicated before. How to make some nodes become root nodes and accept connections from other nodes, and some nodes become child nodes and connect to the root node by themselves is even more difficult.

[0003] In the existing technologies, the root node selection mechanism is usually as follows:

[0004] 1. Preset. Each node has its node role preset when it comes out. Once a node is started as a root node, it will become a root node and will not join other nodes. It can only accept child nodes to join. When starting, a node as a child node needs to find a suitable root node to join the network, otherwise it cannot complete communication.

[0005] 2. Time determination: In a networkless environment, the first node to join is the root node. Other nodes join the network as child nodes when they find a root node. If there is no root node, they create a network as the root node.

[0006] If a preset solution is used, the node roles can be clearly determined, but the flexibility is very poor. When assembling the network, it is necessary to ensure that the root node and child nodes exist within the line of sight of the link and have an appropriate load balancing state. If an area is full of root nodes, they can only form isolated wireless MESH networks. The root nodes cannot be interconnected when there are no other interconnected devices, and it is difficult to complete data communication beyond the line of sight. If an area is full of child nodes, it will cause more serious problems. Since there is no root node, the tree topology in the area cannot be established at all. Even if there are a large number of nodes, the networking and communication of the wireless MESH network cannot be completed.

[0007] If the time-based solution is used, although the networking work can be completed in most cases, it may cause the root node's resource capacity to be weaker than the child node. For a tree network, since the root node needs to undertake more work than the child node, if its resource capacity is weaker than the child node, it is likely to cause a large number of tasks to be blocked at the root node, and the child node, although the resource status is very good, can only wait for the root node to process. In addition, if a large number of nodes in an area start networking at the same time (very common in buildings and venues, such as when the power is turned on after a power outage), although there are multiple nodes, everyone is searching the network, and no node is in a time-priority position. In the end, it is likely that a large number of root nodes will be generated, causing the problem of network fragmentation.

[0008] Regarding the related technologies, for the routing technology in wireless self-organizing networks, its network structure is very unstable. The current node role determination technology cannot select a suitable root node for networking while ensuring load balancing, resulting in poor network performance and other problems. No effective solution has yet been proposed. Summary of the invention

[0009] The embodiments of the present application provide a wireless networking method and device, a storage medium and a computer program product to at least solve the problem in the related technology that, for the routing technology in the wireless self-organizing network, its network structure is very unstable, and the current node role determination technology cannot select a suitable root node for networking while ensuring load balancing, resulting in poor network performance.

[0010] According to an embodiment of the embodiments of the present application, a wireless networking method is provided, including: when it is determined that a first node is in a network searching state, searching for a root node within the link line of sight of the first node, wherein the network searching state is used for the first node to search for the root node; when the root node is not found, selecting the root node from a plurality of second nodes within the link line of sight and the first node, wherein the plurality of second nodes are all in the network searching state; when the root node is selected, networking a third node with the root node as a child node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0011] In an exemplary embodiment, after searching for a root node within the link line-of-sight range of the first node, the method further includes: when the root node is found, connecting the first node as a child node to a network corresponding to the root node.

[0012] In an exemplary embodiment, if the root node is not searched, the root node is selected from the multiple second nodes and the first node within the visual range of the link, including: if the root node is not searched, searching for the multiple second nodes within the visual range of the link; if the multiple second nodes are not searched, setting the first node as the root node; if the multiple second nodes are searched, selecting the root node from the multiple second nodes and the first node through an election algorithm.

[0013] In an exemplary embodiment, the root node is selected from the multiple second nodes and the first node through an election algorithm, including: receiving network search requests from the multiple second nodes, wherein the network search requests carry the first root node preference value of the second node; comparing the second root node preference value of the first node with the multiple first root node preference values; determining that the election of the first node has failed when it is determined that the second root node preference value is less than the third root node preference value among the multiple first root node preference values; determining that the first node is the root node when it is determined that the second root node preference value is greater than the multiple first root node preference values.

[0014] In an exemplary embodiment, after comparing the second root node preference value of the first node with multiple first root node preference values, the method further includes: upon determining that the second root node preference value is equal to a fourth root node preference value among the multiple first root node preference values, obtaining the first address information of the first node and the second address information of the fourth node, wherein the fourth root node preference value is the maximum value among the multiple first root node preference values, and the fourth node is the node corresponding to the fourth root node preference value; and selecting the root node from the first node and the fourth node according to the size of the first address information and the second address information.

[0015] In an exemplary embodiment, the root node is selected from the first node and the fourth node based on the size of the first address information and the second address information, including: when the first address information is larger than the second address information, determining that the first node is successfully elected and setting the first node as the root node; when the first address information is smaller than the second address information, determining that the first node is elected unsuccessfully.

[0016] In an exemplary embodiment, after determining that the election of the first node has failed, the method further includes: adjusting the first node to the network search state at a preset time interval to instruct the first node to search for the root node again within the link line of sight; when the root node is searched, connecting the first node as a child node to the network corresponding to the root node.

[0017] According to another embodiment of the embodiments of the present application, a wireless networking device is also provided, including: a search module, for searching for a root node within the link line of sight of the first node when it is determined that the first node is in a network searching state, wherein the network searching state is used for the first node to search for the root node; an election module, for selecting the root node from a plurality of second nodes and the first node within the link line of sight when the root node is not found, wherein the plurality of second nodes are all in the network searching state; a networking module, for selecting a third node as a child node to be networked with the root node when the root node is selected, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0018] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned wireless networking method when running.

[0019] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the wireless networking method through the computer program.

[0020] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0021] In an embodiment of the present application, after determining that the first node is in a network searching state, the root node is first searched within the link visual range of the first node, wherein the network searching state is used for the first node to search for the root node; if the first node fails to search for the root node, a root node election is performed among multiple second nodes within the link visual range and the first node to elect a root node, wherein the multiple second nodes are all in the network searching state; after the root node is elected, a third node other than the root node is used as a child node to be networked with the root node; through the above scheme, the currently available multiple node resources are combined to dynamically select the optimal root node to complete the networking, thereby ensuring the flexibility of the node role and the network performance; thereby solving the problem in the related technology that for the routing technology in the wireless self-organizing network, its network structure is very unstable, and the current node role determination technology cannot select a suitable root node for networking under the premise of ensuring load balancing, resulting in poor network performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0024] Figure 1 It is a hardware environment diagram of an optional wireless networking method according to an embodiment of the present application;

[0025] Figure 2 is a flow chart of an optional wireless networking method according to an embodiment of the present application;

[0026] Figure 3 is a flow chart of an optional node networking process according to an embodiment of the present application;

[0027] Figure 4is a flowchart of an optional root node election method according to an embodiment of the present application;

[0028] Figure 5 is a flow chart of an optional wireless networking method according to an embodiment of the present application;

[0029] Figure 6 It is a structural block diagram of an optional wireless networking device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] According to one aspect of an embodiment of the present application, a wireless networking method is provided. The wireless networking method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above wireless networking method can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0033] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0034] It should be noted that the wireless self-organizing network is a self-organizing network without a center. It does not require a physical base station. The hosts are interconnected and can act as servers. It was first proposed to be used in individual communication scenarios, and countries around the world have since begun to vigorously research this technology. This network has the characteristics of high mobility, high convenience, and easy construction. It has great development prospects in scenarios such as the Internet of Things, fifth-tier cities, smart homes, robot communications, and rapid construction of communication networks during emergency rescue.

[0035] Wireless ad hoc network is a technology different from traditional wireless communication. Traditional wireless communication network requires a fixed network base station to execute user access and forward user data, such as the mobile Internet we use now. This traditional wireless communication network has a large number of base stations to provide us with communication in relatively densely populated areas. However, in remote areas or when conducting large-scale emergency rescue, the lack of base station coverage will lead to communication difficulties, which will limit the spread of information in space. In order to cope with this situation, wireless ad hoc network came into being.

[0036] According to different device types and application scenarios, wireless self-organizing networks can be divided into many types, including mobile Ad Hoc networks, wireless sensor networks, wireless MESH networks and opportunistic networks. Among them, wireless MESH networks are a new type of broadband wireless network with self-organization, self-repair, multi-hop, and node self-management. Wireless MESH networks are usually composed of MESH root nodes and MESH sub-nodes. MESH root nodes generally refer to nodes with very small mobility or basically no mobility. They create wireless MESH networks and combine together to form the backbone network of wireless MESH networks, providing connectivity between sub-nodes in the wireless MESH network and data connection and relay capabilities between sub-nodes and wide area networks. MESH sub-nodes constitute the basis of wireless MESH networks for data communication. In particular, although MESH sub-nodes do not provide access to MESH backbone networks and wide area networks, as a basic element in a self-organizing, multi-hop network, they still need to provide data relay and forwarding capabilities for messages to surrounding nodes.

[0037] Wireless MESH networks are more suitable for applications where the node locations are relatively stable and the movement is not frequent, but the nodes may join or leave the network at any time. At the same time, the distance between nodes is uncontrollable, and there will be a large number of communication needs between nodes beyond the line of sight of the link, such as home smart appliance networks, building monitoring networks, and other scenarios.

[0038] Wireless self-organizing networks are self-organizing, self-repairing, and multi-hop variable. The traditional single-hop routing protocols in the Internet protocol are no longer applicable. On the one hand, wireless self-organizing networks usually accommodate a large number of nodes (possibly tens of thousands), and the traditional mechanism for administrators to configure routing is completely unable to cope with such a large network capacity. On the other hand, since the nodes in wireless self-organizing networks can change and move at any time, and may even join or leave the network at any time, the traditional network segment division and address configuration are completely ineffective. For such a complex and changeable network, its routing protocol is crucial. And an important prerequisite for designing a routing protocol is to determine the network topology.

[0039] There are two common network topologies for wireless ad hoc networks:

[0040] Mesh topology: In this topology, the nodes in the network play equal roles. Each node can communicate with other nodes around it without distinction. If it encounters a communication message that is not sent to itself, it can also provide unlimited relay and forwarding capabilities. This topology is suitable for environments where a large number of communication devices are scattered in a certain area, such as combat networks or disaster reduction emergency networks. Its advantage is that the network is easy to lay and the nodes have no special roles. The disadvantage is that the network stability is very poor, and the usual message routing needs to be carried out on demand, with poor reliability and high latency.

[0041] Tree topology: In this topology, each network is a directed graph. When a node joins the network, it needs to confirm its parent node and child node. The transmission of communication messages has a direction. Messages sent to its own subnet are transmitted downward, and messages sent to unknown destinations are transmitted upward. Eventually, each node forms a tree network. This topology is suitable for networks with relatively stable node positions and roles, but require self-organization, multi-hop, and no single point of failure. Its advantage is that the node is located in the network, the role is determined, and the message to be transmitted can be routed through the prior routing table entries, with high reliability and low latency. However, in order to maintain stable node roles and positions, it is necessary to regularly maintain the network topology, detect network failures, and optimize prior routes, which consumes a lot of node resources and bandwidth resources. At the same time, it is necessary to constantly find a balance between maintenance costs and network detection.

[0042] Since the above two topologies have their own advantages and disadvantages, most common wireless self-organizing networks now use hybrid topology, that is, when routing messages, different topologies are selected according to actual conditions and needs to arrange routing strategies. However, for different application scenarios, various wireless self-organizing networks still have their own preferred topological structures. Among them, wireless MESH networks usually prefer to use tree topology to maintain their own network structure.

[0043] For complex wireless MESH network networking, the network topology is a prerequisite for completing the networking work, and the role of each node in the network is a very important condition in the network topology.

[0044] In order to allow each node to play an appropriate role in the network, a wireless networking method is provided in this embodiment. Figure 2 1 is a flow chart of an optional wireless networking method according to an embodiment of the present application, the flow chart comprising the following steps:

[0045] Step S202, when it is determined that the first node is in a network searching state, searching for a root node within a link line of sight range of the first node, wherein the network searching state is used for the first node to search for the root node;

[0046] Step S204, when the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network searching state;

[0047] Step S206: When the root node is elected, a third node is networked with the root node as a child node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0048] In an embodiment of the present application, after determining that the first node is in a network searching state, the root node is first searched within the link visual range of the first node, wherein the network searching state is used for the first node to search for the root node; if the first node fails to search for the root node, a root node election is performed among multiple second nodes within the link visual range and the first node to elect a root node, wherein the multiple second nodes are all in the network searching state; after the root node is elected, a third node other than the root node is used as a child node to be networked with the root node; through the above scheme, the currently available multiple node resources are combined to dynamically elect the optimal root node to complete the networking, thereby ensuring the flexibility of the node role and the network performance; thereby solving the problem in the related technology that for the routing technology in the wireless self-organizing network, its network structure is very unstable, and the current node role determination technology cannot select a suitable root node for networking under the premise of ensuring load balancing, resulting in poor network performance.

[0049] Optionally, after searching for a root node within the link line-of-sight range of the first node, the method further includes: when the root node is found, connecting the first node as a child node to a network corresponding to the root node.

[0050] After the node is started, it will search for the root node within the link line of sight, which is called the network search process. If a root node that meets the requirements is found, the first node will be connected to the network corresponding to the root node as a child node to complete the networking process. Figure 3 As shown, the following steps are included:

[0051] Step 3.1, the first node sends a network search message to search for the root node;

[0052] Step 3.2: If a root node receives the network search message, it sends a response message to the first node;

[0053] Step 3.3, the first node initiates an application for networking;

[0054] Step 3.4: The root node performs networking confirmation, so that the first node is successfully connected to the root node's network as a child node.

[0055] Optionally, if the root node is not searched, the root node is selected from the multiple second nodes and the first node within the visual range of the link, including: if the root node is not searched, searching for the multiple second nodes within the visual range of the link; if the multiple second nodes are not searched, setting the first node as the root node; if the multiple second nodes are searched, selecting the root node from the multiple second nodes and the first node through an election algorithm.

[0056] During the network search process, the node listens to the network search messages of other nodes to determine whether there are other nodes that are searching within the link line of sight, that is, the multiple second nodes mentioned above; if it is found that there is no second node within the link line of sight, the first node itself becomes the root node, waiting for other child nodes to connect to complete the network; and if the second node is searched, a root node is elected from these nodes according to the pre-configured election algorithm to complete the network.

[0057] Optionally, the root node is elected from the multiple second nodes and the first node through an election algorithm, including: receiving network search requests from the multiple second nodes, wherein the network search requests carry the first root node preference value of the second node; comparing the second root node preference value of the first node with the multiple first root node preference values; determining that the election of the first node has failed when it is determined that the second root node preference value is less than the third root node preference value among the multiple first root node preference values; determining that the first node is the root node when it is determined that the second root node preference value is greater than the multiple first root node preference values.

[0058] Optionally, each node is preset with a root node preference value, called a prf value, when it leaves the factory. This value indicates the degree to which the node wants to become a root node. Generally speaking, nodes with higher resource levels (large memory, high CPU frequency, high bandwidth), nodes with higher controllability (with input and output devices such as keyboard, mouse, touch screen, etc.), or nodes that are ready to be used as root nodes right after production (central control devices in smart homes, central control devices for building monitoring, etc.) should be preset with higher root node preference values, while those nodes that only need to realize data communication should be preset with lower root node preference values.

[0059] Based on the setting of the node preference value, the election process includes the following process: the first node receives the network search message sent by other second nodes, that is, the above-mentioned network search request; according to the first root node preference value of the second node carried in the network search message, the first node then compares the multiple first root node preference values ​​with the second root node preference value of the first node itself. If there is any first root node preference value greater than the second root node preference value, the first node determines that its election has failed, and the first node will not be set as the root node among these nodes; if the second root node preference value is greater than all first root node preference values, the first node is determined to be elected as the root node. Similarly, other second nodes will carry out the same election process as the first node, that is, each node will carry out the election process separately.

[0060] Optionally, after comparing the second root node preference value of the first node with multiple first root node preference values, the method further includes: when it is determined that the second root node preference value is equal to a fourth root node preference value among the multiple first root node preference values, obtaining the first address information of the first node and the second address information of the fourth node, wherein the fourth root node preference value is the maximum value among the multiple first root node preference values, and the fourth node is the node corresponding to the fourth root node preference value; and selecting the root node from the first node and the fourth node according to the size of the first address information and the second address information.

[0061] Furthermore, during the election process, the root node preference values ​​of two nodes may be the same, but we need to select a unique candidate root node from any number of nodes. Therefore, the embodiment of the present application designs an election algorithm with the node's root node preference value + node MAC address (i.e., the node's address information) as parameters. If the root node preference value of the first node is the same as that of one or more fourth nodes, and the root node preference values ​​of these nodes are all maximum values, it is necessary to further compare the address information of these nodes and elect the root node based on the size of the address information.

[0062] Optionally, the root node is selected from the first node and the fourth node according to the size of the first address information and the second address information, including: when the first address information is larger than the second address information, determining that the election of the first node is successful and setting the first node as the root node; when the first address information is smaller than the second address information, determining that the election of the first node has failed.

[0063] Optionally, if the first address information of the first node is greater than the second address information, the first node believes that there is no root node better than itself, so the first node sets itself as the root node; if the first address information is less than the second address information, the first node believes that there is a better root node and determines that the first node’s own election has failed.

[0064] Optionally, after determining that the election of the first node has failed, the method further includes: adjusting the first node to the network search state at a preset time interval to instruct the first node to search for the root node again within the link line of sight; when the root node is searched, connecting the first node as a child node to the network corresponding to the root node.

[0065] If the first node determines that its own election has failed, it will search the network again, and then find the root node elected in this election process during the next network search, and connect to the root node as a child node to complete the networking process.

[0066] In an optional embodiment, the operation logic of the above election algorithm is as follows: Figure 4 As shown, it includes the following processes:

[0067] Step 4.1, the first node receives a network search message (DIS) from other second nodes;

[0068] Step 4.2, the first node compares the prf (i.e., the first root node preference value) carried by the network search message of other second nodes with the prf (i.e., the second root node preference value) of the local node (the first node); if the second root node preference value is greater than the first root node preference value, the first node considers itself to be the better root node between the two, and the first node can continue to elect with other second nodes; if the second root node preference value is less than the first root node preference value, the first node considers that there is a better root node and determines that its election has failed;

[0069] Step 4.3: If the two are equal, further compare the MAC carried by the network search message (i.e., the second address information) with the local MAC (i.e., the first address information); if the second address information is greater than the first address information, the first node believes that there is a better root node and determines that its own election has failed; if the second address information is less than the first address information, the first node believes that it is the better root node between the two, and the first node can continue the same election process with other second nodes until the election is over.

[0070] Based on the above embodiment, the final node (including the first node and the second node) can determine the role of the node after the network search is completed. This process can take into account the node's own preset capabilities and the distribution of nodes within the link line of sight, and dynamically and intelligently select the optimal root node. The specific selection process is as follows Figure 5 As shown:

[0071] Step 5.1, the first node starts;

[0072] Step 5.2, the first node starts searching the network;

[0073] Step 5.3, determine whether the first node finds the root node; if found, execute step 5.4; if not found, execute step 5.5;

[0074] Step 5.4: The first node initiates a joining application as a child node and joins the network corresponding to the root node;

[0075] Step 5.5: Determine whether there are other undetermined nodes (i.e., the plurality of second nodes mentioned above); if yes, execute step 5.6; if no, execute step 5.7;

[0076] Step 5.6: The first node performs a root node election to determine whether the first node is selected as a candidate root node; if so, execute step 5.7; if not, return to execute step 5.2;

[0077] Step 5.7: Set the first node as the root node for networking and wait for other child nodes to connect.

[0078] Through the above embodiment, when a large number of nodes enter the role determination phase at the same time, they can elect a certain candidate root node without communicating with each other, thereby completing the role determination of a large number of nodes at the same time when there is no known root node.

[0079] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0080] In the present embodiment, a wireless networking device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0081] Figure 6 is a structural block diagram of an optional wireless networking device according to an embodiment of the present application; Figure 6 As shown, including:

[0082] A search module 62, configured to search for a root node within the link line of sight of the first node when it is determined that the first node is in a network search state, wherein the network search state is used for the first node to search for the root node;

[0083] An election module 64 is used to elect the root node from a plurality of second nodes and the first node within the visual range of the link when the root node is not found, wherein the plurality of second nodes are all in the network search state;

[0084] The networking module 66 is used to, when the root node is elected, network a third node as a child node with the root node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0085] Through the above-mentioned device, after determining that the first node is in the network searching state, the root node is first searched within the link visual range of the first node, wherein the network searching state is used for the first node to search for the root node; when the first node fails to search for the root node, a root node election is performed among multiple second nodes within the link visual range and the first node, and a root node is elected, wherein the multiple second nodes are all in the network searching state; after the root node is elected, a third node other than the root node is used as a child node to be networked with the root node; through the above-mentioned scheme, the currently available multiple node resources are combined to dynamically elect the optimal root node to complete the networking, thereby ensuring the flexibility of the node role and the network performance; thereby solving the problem in the related technology that for the routing technology in the wireless self-organizing network, its network structure is very unstable, and the current node role determination technology cannot select a suitable root node for networking under the premise of ensuring load balancing, resulting in poor network performance.

[0086] Optionally, the search module 62 is further configured to connect the first node as a child node to a network corresponding to the root node when the root node is found.

[0087] After the node is started, it will search for the root node within the line of sight, which is called the network search process. If a root node that meets the requirements is found, the first node will be connected to the network corresponding to the root node as a child node to complete the networking process.

[0088] Optionally, the above-mentioned election module 64 is also used to search for the multiple second nodes within the visual range of the link when the root node is not found; set the first node as the root node when the multiple second nodes are not found; and select the root node from the multiple second nodes and the first node through an election algorithm when the multiple second nodes are found.

[0089] During the network search process, the node listens to the network search messages of other nodes to determine whether there are other nodes that are searching within the link line of sight, that is, the multiple second nodes mentioned above; if it is found that there is no second node within the link line of sight, the first node itself becomes the root node, waiting for other child nodes to connect to complete the network; and if the second node is searched, a root node is elected from these nodes according to the pre-configured election algorithm to complete the network.

[0090] Optionally, the election module 64 is also used to receive network search requests of the multiple second nodes, wherein the network search requests carry the first root node preference value of the second node; compare the second root node preference value of the first node with the multiple first root node preference values; when it is determined that the second root node preference value is less than the third root node preference value among the multiple first root node preference values, determine that the election of the first node has failed; when it is determined that the second root node preference value is greater than the multiple first root node preference values, determine that the first node is the root node.

[0091] Optionally, each node is preset with a root node preference value when it leaves the factory, which is called the prf value. This value indicates the degree to which the node wants to become a root node. Generally speaking, nodes with higher resource levels (large memory, high CPU frequency, high bandwidth), nodes with higher controllability (with input and output devices such as keyboard, mouse, touch screen, etc.), or nodes that are ready to be used as root nodes (central control devices in smart homes, central control devices for building monitoring, etc.) should be preset with higher root node preference values, while those nodes that only need to realize data communication should be preset with lower root node preference values.

[0092] Based on the setting of the node preference value, the election process includes the following process: the first node receives the network search message sent by other second nodes, that is, the above-mentioned network search request; according to the first root node preference value of the second node carried in the network search message, the first node then compares the multiple first root node preference values ​​with the second root node preference value of the first node itself. If there is any first root node preference value greater than the second root node preference value, the first node determines that its election has failed, and the first node will not be set as the root node among these nodes; if the second root node preference value is greater than all first root node preference values, the first node is determined to be elected as the root node. Similarly, other second nodes will carry out the same election process as the first node, that is, each node will carry out the election process separately.

[0093] Optionally, the above-mentioned election module 64 is also used to obtain the first address information of the first node and the second address information of the fourth node when it is determined that the second root node preference value is equal to the fourth root node preference value among the multiple first root node preference values, wherein the fourth root node preference value is the maximum value among the multiple first root node preference values, and the fourth node is the node corresponding to the fourth root node preference value; and select the root node from the first node and the fourth node according to the size of the first address information and the second address information.

[0094] Furthermore, during the election process, the root node preference values ​​of two nodes may be the same, but we need to select a unique candidate root node from any number of nodes. Therefore, the embodiment of the present application designs an election algorithm with the node's root node preference value + node MAC address (i.e., the node's address information) as parameters. If the root node preference value of the first node is the same as that of one or more fourth nodes, and the root node preference values ​​of these nodes are all maximum values, it is necessary to further compare the address information of these nodes and elect the root node based on the size of the address information.

[0095] Optionally, the election module 64 is also used to determine that the election of the first node is successful and set the first node as the root node when the first address information is greater than the second address information; and to determine that the election of the first node fails when the first address information is less than the second address information.

[0096] Optionally, if the first address information of the first node is greater than the second address information, the first node believes that there is no root node better than itself, so the first node sets itself as the root node; if the first address information is less than the second address information, the first node believes that there is a better root node and determines that the first node’s own election has failed.

[0097] Optionally, the above-mentioned election module 64 is also used to adjust the first node to the network search state at a preset time interval to instruct the first node to search for the root node again within the link line of sight; when the root node is searched, the first node is connected as a child node to the network corresponding to the root node.

[0098] If the first node determines that its own election has failed, it will search the network again, and then find the root node elected in this election process during the next network search, and connect to the root node as a child node to complete the networking process.

[0099] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.

[0100] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:

[0101] S1, when it is determined that the first node is in a network searching state, searching for a root node within a link line of sight range of the first node, wherein the network searching state is used by the first node to search for the root node;

[0102] S2, when the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network searching state;

[0103] S3: When the root node is elected, a third node is networked with the root node as a child node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0104] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0105] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0106] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0107] S1, when it is determined that the first node is in a network searching state, searching for a root node within a link line of sight range of the first node, wherein the network searching state is used by the first node to search for the root node;

[0108] S2, when the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network searching state;

[0109] S3: When the root node is elected, a third node is networked with the root node as a child node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0110] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0111] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0112] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:

[0113] S1, when it is determined that the first node is in a network searching state, searching for a root node within a link line of sight range of the first node, wherein the network searching state is used by the first node to search for the root node;

[0114] S2, when the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network searching state;

[0115] S3: When the root node is elected, a third node is networked with the root node as a child node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

[0116] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0117] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0118] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A wireless networking method, characterized in that: include: When it is determined that the first node is in a network searching state, searching for a root node within a link line of sight range of the first node, wherein the network searching state is used by the first node to search for the root node; In the case where the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network searching state; When the root node is elected, a third node is used as a child node to form a network with the root node, wherein the third node is a node other than the root node among the plurality of second nodes and the first node.

2. The wireless networking method according to claim 1, characterized in that: After searching for a root node within the link line-of-sight range of the first node, the method further includes: When the root node is found, the first node is used as a child node and connected to the network corresponding to the root node.

3. The wireless networking method according to claim 1, characterized in that: In the case that the root node is not found, selecting the root node from a plurality of second nodes and the first node within the visual range of the link comprises: If the root node is not found, searching for the plurality of second nodes within the link visual range; If the plurality of second nodes are not found, setting the first node as the root node; In the case where the plurality of second nodes are searched, the root node is selected from the plurality of second nodes and the first node through an election algorithm.

4. The wireless networking method according to claim 3, characterized in that: Selecting the root node from the plurality of second nodes and the first node by using an election algorithm includes: Receiving network search requests of the plurality of second nodes, wherein the network search requests carry first root node preference values ​​of the second nodes; comparing a second root node preference value of the first node with a plurality of first root node preference values; In the case where it is determined that the second root node preference value is less than a third root node preference value among the plurality of first root node preference values, determining that the first node election fails; In a case where it is determined that the second root node preference value is greater than a plurality of the first root node preference values, the first node is determined to be the root node.

5. The wireless networking method according to claim 4, characterized in that: After comparing the second root node preference value of the first node with a plurality of the first root node preference values, the method further includes: in a case where it is determined that the second root node preference value is equal to a fourth root node preference value among the plurality of the first root node preference values, acquiring first address information of the first node and second address information of a fourth node, wherein the fourth root node preference value is a maximum value among the plurality of the first root node preference values, and the fourth node is a node corresponding to the fourth root node preference value; The root node is selected from the first node and the fourth node according to the size of the first address information and the second address information.

6. The wireless networking method according to claim 5, characterized in that: Selecting the root node from the first node and the fourth node according to the size of the first address information and the second address information includes: In a case where the first address information is greater than the second address information, determining that the first node election is successful, and setting the first node as the root node; When the first address information is smaller than the second address information, it is determined that the first node election has failed.

7. The wireless networking method according to claim 4 or 6, characterized in that: After determining that the first node election fails, the method further includes: Adjusting the first node to the network search state at a preset time interval to instruct the first node to search for the root node again within the link line of sight; When the root node is found, the first node is used as a child node and connected to the network corresponding to the root node.

8. A wireless networking device, characterized in that: include: A search module, configured to search for a root node within a link line of sight range of the first node when it is determined that the first node is in a network search state, wherein the network search state is used for the first node to search for the root node; an election module, configured to, if the root node is not found, elect the root node from a plurality of second nodes and the first node within the visual range of the link, wherein the plurality of second nodes are all in the network search state; A networking module is used to, when the root node is elected, network a third node as a child node with the root node, wherein the third node is a node other than the root node among the multiple second nodes and the first node.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Networking method of wireless electricity consumption information acquisition ad hoc network

    CN103906044A

  • Method for selecting root node in Mesh network

    CN108347701A

  • Networking method of self-organizing network

    CN112261665A

  • Networking method and device of wireless equipment, storage medium and electronic device

    CN115767587A

  • Method and device for determining target wireless network, storage medium and electronic device

    CN115767682A

Cited By

  • Network node management method and system based on digital networking

    CN120090962A