Sensor node load balancing method, device and medium based on clustering tree
By constructing multi-layer clustering trees in wireless sensor networks and performing multiple rounds of load balancing, the hot issues caused by clustering trees are solved, network load balancing and communication efficiency are improved, and network life is extended .
Patent Information
- Application Number
- CN202311781046.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-12-22
AI Technical Summary
The prior art failed to effectively solve the hot issues caused by tree imbalance when building clustered trees, resulting in the neighbor nodes of the aggregation nodes dying too quickly due to excessive communication load, and the dynamic balancing protocol requires a large number of control messages to be added. Network communication overhead.
By constructing a cluster tree in a wireless sensor network, dividing nodes into multi-layer structures, and using a balance algorithm to perform multiple load balancing on the cluster tree, reducing the height of the cluster tree, achieving network load balancing, and extending the network life.
It effectively reduces the height of the clustering tree, reduces communication overhead, extends the stability period and life cycle of the network, and improves the throughput of the network.
Smart Images

Figure CN117915282B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a sensor node load balancing method, device, equipment and medium based on a clustering tree, and relates to the technical field of wireless sensor networks. Background Art
[0002] Wireless sensor networks (WSNs) are widely used in military, medical, transportation, environmental monitoring and other fields due to their self-organizing and self-sensing features. Since the node energy is limited and the battery is difficult to replace, when the node energy is exhausted, it may cause the failure of the entire network. Therefore, it is necessary to find an energy-saving and fault-tolerant solution that can extend the life cycle of the network.
[0003] LEACH (Low-Energy Adaptive Clustering Hierarchy) is a typical low-power adaptive clustering routing protocol that can reduce network energy consumption, but its cluster head selection and cluster size are highly random. Choudharyd et al. proposed an optimization method for the classic LEACH, using an unsupervised vector quantization k-means algorithm to cluster randomly distributed sensors, and iteratively calculate to optimize the centroid and select CHs near the centroid of each cluster to reduce energy consumption. Guleria et al. proposed an enhanced energy-savvy clustering algorithm that uses fixed nodes as relays for CHs and base station communications to reduce the energy consumption of CHs. Some scholars have also used evolutionary algorithm-related technologies to cluster clusters and elect the optimal cluster head, which can shorten the distance between clusters and increase the compactness of nodes within the cluster, prevent the emergence of huge clusters or single-node clusters, and is compatible with homogeneous or heterogeneous nodes, which can reduce the energy consumption of WSNs. In the above schemes, forming effective clusters and selecting appropriate cluster heads is a main purpose, which can reduce the load of cluster head nodes, but the communication cost between cluster heads and base stations is high, and when cluster heads die, re-clustering also requires additional energy. Chanak and Moridi both proposed three-path routing schemes, and Tien proposed a dual separate path (DSP) algorithm based on path redundancy mechanism. The multi-path algorithm selects a backup path when the main path fails, which can solve the overhead problem caused by re-clustering. But the redundant path itself will also cause additional overhead. Rajab proposed a tree-based multi-hop clustering method, which builds a binary tree in a multi-hop cluster to improve the fault tolerance of the network. Menaria et al. used swarm intelligence algorithm to construct a spanning tree in WSN. Begum et al. constructed a BFS tree in the network and used dynamic transmission range adjustment to improve the fault tolerance of the network. Most tree-based methods solve the problem of fault recovery during network failures, but do not take into account the hot spot problem (HSP) caused by the imbalance of the tree in the clustering tree construction stage, that is, the problem that the neighbor nodes of the aggregation node die too quickly due to excessive communication load. Shan and Han proposed a clustering tree construction mechanism, which attempts to minimize the energy consumption of the tree based on information such as node load and residual energy. Aljawawdeh et al. proposed a dynamic load balancing protocol, which dynamically changes the transmission path during data transmission to balance the load. However, these protocols require information such as the load and number of hops of neighboring nodes during operation, and require a large number of control messages to implement, which increases the communication overhead of the network. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, in view of the above problems, the purpose of the present invention is to provide a sensor node load balancing method, device, equipment and medium based on a clustering tree, which can reduce the height of the clustering tree and achieve network load balance, thereby extending the network life.
[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is:
[0006] In a first aspect, the present invention provides a sensor node load balancing method based on a clustering tree, comprising:
[0007] Based on the clustering tree, the sensor nodes in the network are divided into a multi-layer structure;
[0008] Construct a cluster tree in the network, where each node added to the cluster tree will immediately find its child nodes;
[0009] The constructed clustering tree is subjected to multiple rounds of load balancing using a balancing algorithm. The load balancing algorithm is run multiple times on each node, ultimately balancing the load of nodes in the network.
[0010] Furthermore, the sensor nodes in the network are evenly distributed in the two-dimensional plane of the detection area and their positions do not change with time. Each node has a unique ID number, and the performance of all sensor nodes is exactly the same. Each sensor node can obtain its own position and remaining energy information, and automatically exit the network when the energy is exhausted. The aggregation node is located at the center of the network.
[0011] Furthermore, the sensor nodes in the network are divided into a multi-layer structure based on the clustering tree, including:
[0012] Based on the clustering tree, the multi-layer structure is divided according to the information of the construction message received by the node. The construction message contains the level information, and all nodes that receive the construction message with the level information L are regarded as the same layer.
[0013] Furthermore, a clustering tree is constructed in the network, including:
[0014] Before the cluster tree construction stage, all nodes are not added to the network, the initial level is set to empty, the number of child nodes is set to 0, and the neighbor node table is set to empty;
[0015] At the beginning of the cluster tree construction phase, the sink node sets its initial level to 0, indicating that the sink node is the root node of the cluster tree. Then the sink node broadcasts a construction message. When a node that has not joined the cluster tree receives a construction message, it will join the network through the information in the construction message, set the sender of the message as the parent node and update the neighbor table information. After that, the node will update and broadcast the construction message to notify neighbor nodes to join the network and / or update the neighbor table.
[0016] Furthermore, a clustering tree is constructed in the network by the sink node, including:
[0017] 1) The aggregation node initializes parameters and broadcasts a construction message containing the node level information L;
[0018] 2) All non-aggregation nodes wait for the construction message, and update the neighbor table when receiving the construction message;
[0019] 3) If the node has not yet joined the network, add the node to the network and set the node level to L+1, otherwise jump to step 2);
[0020] 4) Each node joining the network immediately broadcasts a construction message containing the node's level information L;
[0021] 5) The node joining the network sends an ACK message to the parent node. The parent node updates the neighbor table and determines the number of child nodes based on the ACK information.
[0022] Furthermore, a balancing algorithm is used to perform multiple rounds of load balancing on the constructed clustering tree, including:
[0023] At the beginning of each balancing round, the sink node broadcasts a balancing message containing the node's level information and the number of child nodes;
[0024] After receiving a balance message from a node at a higher level than itself, each node will update its neighbor table and broadcast a balance message with its own node information;
[0025] Every time a node receives a balance message from a higher level, it needs to update the neighbor table according to the level information and number of child nodes in the balance message, and then search for nodes in the updated neighbor table that are eligible to become new parent nodes, which are called candidate parent nodes;
[0026] When the node confirms all candidate parent nodes, the candidate parent node with the least number of child nodes is selected as the optimal candidate parent node and used as the new parent node;
[0027] The parameter balance transition probability p is introduced. The optimal candidate parent node is used as the new parent node only when the set conditions are met, otherwise the parent node is not changed.
[0028] The parameter balancing round number BR is introduced. The clustering tree can reach the final equilibrium state only when the set parameter balancing round number BR is met.
[0029] Furthermore, the balanced clustering tree algorithm for the sink node and the non-sink node includes:
[0030] The process of the balanced clustering tree algorithm for the aggregation node is:
[0031] (1) Initialize parameters and set the initial balancing round number \(i = 1\).
[0032] (2) If the set balancing round number is reached, i.e., \(i>BR\), jump to step (5).
[0033] (3) Broadcast a balance message containing the hierarchical information of the sink node and the number of child nodes.
[0034] (4) Wait until the network topology no longer changes, then start the next round of balancing, \(i = i + 1\), and jump to step (2).
[0035] (5) End the algorithm.
[0036] The process of the balancing clustering tree algorithm for non - sink nodes is as follows:
[0037] A) Wait for the balance messages of other nodes and update the neighbor table according to the balance information.
[0038] B) If the balance message comes from a higher - level node, go to step C), otherwise jump to step G).
[0039] C) Traverse the un - searched nodes in the neighbor table to search for nodes at the same level or higher level as the original parent node. If not found, jump to step G).
[0040] D) Determine whether the node meets the load transfer condition. If not, jump to step C).
[0041] E) Generate a random number \(k\) between 0 and 1. If \(k < p\), set this node as the new parent node and update the level of this node.
[0042] F) Broadcast a balance message containing the hierarchical information of this node and the number of child nodes.
[0043] G) If it is not the last round of balancing, jump to step A), otherwise end the algorithm.
[0044] In a second aspect, the present invention also provides a sensor node load balancing device based on a clustering tree. The device includes:
[0045] A hierarchical division unit configured to divide the wireless sensor nodes in the network into a multi - layer structure based on the clustering tree;
[0046] A clustering tree construction unit configured to construct a clustering tree in the network, where each node joining the clustering tree will immediately search for its child nodes;
[0047] A node load balancing unit configured to use a balancing algorithm to perform multi - round load balancing on the constructed clustering tree. By running the load balancing algorithm multiple times for each node, the node load in the network is finally balanced.
[0048] In a third aspect, the present invention also provides an electronic device, comprising: one or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the methods.
[0049] In a fourth aspect, the present invention further provides a computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any of the methods.
[0050] The present invention adopts the above technical scheme, and has the following characteristics: the load balancing method based on clustering tree provided by the present invention first constructs a spanning tree in the network by the convergence node, and each node added to the spanning tree will immediately find its child node, and reduce the height of the spanning tree by immediately forwarding the message; then the balancing algorithm is run in the spanning tree, and the number of running rounds of the balancing algorithm is controlled by the convergence node, so that too much communication overhead is not increased, the height of the clustering tree is further reduced, and the balance of the network load is achieved, thereby extending the life of the network. In summary, the present invention can be widely used in wireless sensor networks. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Throughout the accompanying drawings, the same reference numerals are used to represent the same components. In the accompanying drawings:
[0052] Figure 1 is a schematic diagram of a first-order radio model according to an embodiment of the present invention;
[0053] Figure 2 This is a flow chart of the operation of the aggregation node in the algorithm of the embodiment of the present invention;
[0054] Figure 3 This is a flow chart of the operation of non-aggregation nodes in the algorithm of an embodiment of the present invention;
[0055] Figure 4 The relationship between the number of surviving nodes and the number of rounds under different equilibrium transition probabilities in the embodiment of the present invention;
[0056] Figure 5 The relationship between the number of surviving nodes and the number of rounds under different balancing round numbers in the embodiment of the present invention;
[0057] Figure 6 The relationship between the number of surviving nodes and the number of rounds in different protocols of the embodiments of the present invention;
[0058] Figure 7 The relationship between the total remaining energy of the network and the number of rounds in the embodiment of the present invention;
[0059] Figure 8 The relationship between the average remaining energy of nodes and the number of rounds in the embodiment of the present invention;
[0060] Fig. 9 Statistics of network throughput according to the embodiment of the present invention;
[0061] Fig.10 FIG. 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0063] For ease of description, spatially relative terms may be used herein to describe the relationship of one element or feature relative to another element or feature as shown in the figures, such as "inside", "outside", "inner side", "outer side", "below", "above", etc. Such spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation depicted in the figures.
[0064] Since wireless sensor networks have problems in practical applications, such as easy failure of sensor nodes, uneven energy consumption in the network, and short network life cycle. The present invention provides a sensor node load balancing method based on cluster tree (LoadBalancing Algorithm based on Cluster Tree, LBACT), including: dividing the wireless sensor nodes in the network into a multi-layer structure based on the cluster tree; constructing a cluster tree in the network, wherein each node added to the cluster tree will immediately search for its child nodes; using a balancing algorithm to perform multiple rounds of load balancing on the constructed cluster tree, and running the load balancing algorithm multiple times on each node, ultimately balancing the node load in the network. Simulation results show that compared with LEACH and CBSHA (Component Based Self-Healing Approach), the present invention can effectively balance node energy consumption, extend the stability period and life cycle of the network, and improve the throughput of the network.
[0065] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art. This embodiment is exemplified by WSN, which is taken as an example and is not limited thereto.
[0066] Embodiment 1: The sensor node load balancing method based on clustering tree provided in this embodiment includes:
[0067] S1. Divide the sensor nodes in the network into a multi-layer structure based on the clustering tree.
[0068] In this embodiment, all wireless sensor nodes in the WSN network model are evenly distributed in the two-dimensional plane of the detection area, and the position does not change with time. Each node has a unique ID number corresponding to its own location information. The node can obtain its own location and remaining energy and other information to perform simple information processing, and can automatically adjust the transmission power according to the transmission distance. The initial capacity, computing power, data transmission capacity and other performance of all wireless sensor nodes are exactly the same, and they automatically exit the network when the energy is exhausted. The aggregation node is located at the center of the network, with unlimited energy supply and sufficient data processing capabilities.
[0069] In this embodiment, a multi-layer structure is divided based on the clustering tree according to the information of the construction message received by the node. The construction message contains level information. All nodes that receive the construction message with level information L are regarded as the same layer. For example, if the level information in the construction message sent by the root node (0-layer node) is 0, then all nodes that receive the construction message and have not joined the network will join the network as the first-layer nodes, and the first-layer nodes also only include this type of nodes. Among them, the construction information includes the id of the node, the level of the node in the network, and the number of child nodes of the node.
[0070] In this embodiment, the energy consumption model adopts the same first-order radio energy consumption model as the LEACH protocol. Figure 1 As shown, the transmission is divided into a transmitting end and a receiving end. The k-bit data is processed by the transmitting circuit and amplified by the signal amplifier and then sent to the receiving end, where it is received and processed by the receiving circuit.
[0071] The energy consumption calculation formula of the sending end is:
[0072]
[0073]
[0074] Where k represents the number of bits transmitted, E elec represents the energy required to send 1 bit of information, ε fs and ε amp They represent the energy loss factors under the free space model and the multipath fading model respectively, d represents the Euclidean distance between nodes, and d0 is the distance threshold, which is used to determine the energy consumption strategy of the transmission process. When the distance between nodes is less than the threshold, the self-use space model formula is used to calculate the energy consumption, and when it exceeds the threshold, the multipath fading model formula is used. The energy consumption of the node receiving data only considers the relationship with the size of the received data packet. The energy consumption calculation formula at the receiving end is:
[0075] E Rx (k,d)=k×E elec (3)
[0076] Considering the high similarity and redundancy of the detection data in the network, the upper node performs necessary data fusion after receiving the data from the lower node. Assuming that the length of the fused data remains unchanged, the energy consumption of fusing 1 bit of data is E DA The data fusion process is to remove redundant information in the data packet, such as the timestamp in the same acquisition cycle. Only one copy of this redundant information is required. The data collected by sensors in adjacent areas are generally similar. Under the premise of meeting the acquisition accuracy requirements, highly similar data can be merged and only one copy of the data is retained. The retained data corresponds to multiple sensor nodes (actually corresponding to the ID of the sensor node).
[0077] S2. A clustering tree is constructed in the network by the sink node. Each node added to the clustering tree will immediately search for its child nodes and reduce the height of the clustering tree by immediately forwarding messages.
[0078] In this embodiment, the purpose of constructing a cluster tree is to construct a cluster tree in the network to connect all nodes. Before the cluster tree construction stage, all nodes have not joined the network, the initial level is set to empty, the number of child nodes is set to 0, and the neighbor node table is set to empty. At the beginning of the cluster tree construction stage, the convergence node sets its initial level to 0, indicating that the convergence node is the root node of the cluster tree, and then the convergence node broadcasts a construction message. When a node that has not joined the cluster tree receives a construction message, it will join the network through the information in the construction message, set the sender of the message as the parent node and update the neighbor table information. Thereafter, the node will update and broadcast the construction message to notify neighbor nodes to join the network or update the neighbor table.
[0079] Furthermore, the input of the clustering tree construction method is all wireless sensor nodes, and the output is a clustering tree. The construction process includes:
[0080] S21. The aggregation node initializes parameters and broadcasts a construction message containing the node level information L.
[0081] In this embodiment, the initialization parameters include the initial level of the aggregation node, the communication range of the node (affecting the degree of the clustering tree and the energy consumption of the node. The larger the communication range, the larger the degree of the tree, the smaller the level of the tree, but the greater the energy consumption of the node. The communication range cannot exceed the maximum communication range of the device), an empty neighbor table, the number of existing nodes in the network (initial 1 represents the aggregation node itself, and 1 is added for each ACK message received), the total number of nodes in the network (the number of nodes that need to join the network, that is, the total number of deployed devices, used to confirm whether the network converges), and the network construction waiting time (the maximum time that the aggregation node waits for the network construction to be completed. If the number of existing nodes is less than the total number of network nodes after this time, it means that the network construction has failed, and there are nodes that exceed the communication range of all other nodes, and such nodes need to be redeployed. The waiting time should meet the following requirements:
[0082]
[0083] In the formula, They represent the average processing delay, average transmission delay, and average propagation delay of messages, respectively, which are determined by the device hardware and deployment location; N represents the total number of nodes, and r>0 represents time redundancy, which is used to provide a certain degree of fault tolerance for network construction. The right side of this formula indicates that in extreme cases, the clustering tree is a single-branch tree. At this time, the communication distance from the root node to the leaf node is the farthest and the communication time is the longest. In other cases, the longest communication time of the clustering tree will not exceed the communication time of a single-branch tree, so this is the upper bound of the actual network construction time and the lower bound of the network construction waiting time.
[0084] S22, all non-aggregation nodes wait for the construction message, and update the neighbor table when receiving the construction message;
[0085] S23, if the node has not yet joined the network, add the node to the network and set the node level to L+1, otherwise jump to step S22;
[0086] S24, each node joining the network immediately broadcasts a construction message containing the node level information L, and the node broadcasts once it joins the network and only broadcasts once;
[0087] S25, the node joining the network sends an ACK message to the parent node, and the parent node updates the neighbor table and determines the number of child nodes according to the ACK information, that is, the node that has just received the construction message and has not joined the network sends an ACK to the source node of the construction message and joins itself to the network;
[0088] S26: After waiting for the network topology to stabilize, enter the load balancing stage.
[0089] In this embodiment, if the network construction waiting time T is exceeded wait At this time, the network topology is in a stable state. The aggregation node determines whether the network is complete based on the number of existing nodes and the total number of nodes in the network. If it is complete, it enters the load balancing stage. Otherwise, it issues a warning to the administrator, indicating that some devices are faulty or the deployment location is beyond the network communication range and needs to be redeployed.
[0090] Furthermore, in order to make the height of the constructed clustering tree as small as possible and the construction speed of the clustering tree as fast as possible, when the construction algorithm is running, the node needs to broadcast the new construction message immediately. After that, the node needs to send an ACK message to the parent node to notify the parent node that it has become its child node. The parent node will update the neighbor table and determine the number of child nodes based on the ACK information. When a node broadcasts a construction message, if it does not receive an ACK message sent to itself within a certain period of time, it indicates that the node has no child nodes and is a leaf node in the clustering tree. If no message is perceived for more than the set time, it is judged that the network topology is stable at this time.
[0091] S3. Use a balancing algorithm to perform multiple rounds of load balancing on the constructed clustering tree. Run the load balancing algorithm multiple times on each node to eventually balance the load of nodes in the network.
[0092] In this embodiment, the LBACT algorithm is a load balancing energy-saving algorithm based on a clustering tree, and the algorithm operates according to the idea of a round. Each node has its own level information, which is used to determine its level in the clustering tree. At the same time, each node will also maintain a neighbor table, which contains the id of the neighbor node, level information, the number of child nodes of the node, and the parent-child relationship information between the neighbor and the node. The number of child nodes of the node can be calculated through the neighbor table node. The LBACT algorithm optimizes the network topology structure by introducing a load balancing method in the construction stage of the network topology to achieve energy-saving effects.
[0093] In this embodiment, the main purpose of the balanced clustering tree algorithm is to adjust the clustering tree so that the sub-nodes of different nodes of the clustering tree are load balanced, increase the load of low-load nodes and reduce the load of high-load nodes, including:
[0094] S31, balancing phase At the beginning of each balancing round, the sink node broadcasts a balancing message containing the level information of the node and the number of child nodes.
[0095] In this embodiment, the balance message mainly includes the id of node i, the level l of this node i , the number of child nodes of this node c i For example, the balance message sent by node i can be partially expressed as (id, l i ,c i ), the balance message is sent in a broadcast manner and can be received by all nodes within the communication range.
[0096] S32. After receiving a balance message from a node at a higher level than itself, each node will update its neighbor table and broadcast a balance message containing the node's information.
[0097] S33. Every time a node receives a balance message from a higher level (the level of node i is k, a higher level refers to a node at level k-1, and the highest aggregation node level is 0), it needs to update the neighbor table according to the level information and the number of child nodes in the balance message, and then search for nodes in the updated neighbor table that are eligible to become new parent nodes, which are called candidate parent nodes.
[0098] Furthermore, the candidate parent node must meet two conditions:
[0099] (1) The level of the candidate parent node cannot be lower than that of the original parent node. This is because in the clustering tree structure, the actual load of a node must be greater than the actual load of its child nodes. If there is no level restriction, the node may choose the child node of the candidate parent node as the parent node, which will increase the number of hops for data packets to be transmitted in the network, resulting in meaningless energy consumption.
[0100] (2) After the node takes the candidate parent node as the new parent node, the actual load of the original parent node is not less than the actual load of the new parent node, that is:
[0101] NL(OP)≥NL(NP) (4)
[0102] Among them, NL represents the actual load of the node; OP and NP represent the original parent node and the new parent node respectively. This is to prevent the original parent node from becoming a new candidate parent node, causing nodes in the network to frequently change parent nodes, thereby causing network instability.
[0103] Furthermore, it is difficult for nodes in the network to determine the actual load information, especially in a dynamically changing network topology, which requires a large amount of information exchange between nodes to determine the load information of each node. In order to reduce communication overhead and save node energy, the number of child nodes of the node is used instead of the actual load information, and formula (4) is modified as follows:
[0104] CN(OP)-1≥CN(NP)+1 (5)
[0105] Among them, CN refers to the current number of child nodes of the node. This information is determined and known after the clustering tree construction stage and after each round of balancing. Each node can inform the other nodes of this information through the balancing message, which is used by the other nodes to find new parent nodes. In this formula, node i only considers the current number of child nodes of the node. As long as the number of child nodes after the original parent node removes the child node is not less than the number of child nodes after a certain node j determines the node as a child node, then node j can be used as a candidate parent node of node i.
[0106] S34. After the node confirms all candidate parent nodes, the candidate parent node with the least number of child nodes is used as the optimal candidate parent node and is used as the new parent node. In this way, the load of high-load nodes can be reduced and the load of low-load nodes can be increased.
[0107] S35. Introduce the parameter balance transfer probability p. The optimal candidate parent node is used as the new parent node only when the set conditions are met. Otherwise, the parent node is not changed.
[0108] In this embodiment, if all nodes use the optimal candidate parent node as the new parent node, it may cause the children of the node with a large number of children to all become the children of another node with a small load, resulting in the number of children of some nodes becoming extremely small or even zero, which will also lead to network instability. To solve this problem, conditional restrictions need to be added to the change of the parent node. Introduce the parameter balance transfer probability p(0 < p < 1). When a node changes its parent node, it also needs to satisfy:
[0109] rand(0,1) < p (6)
[0110] That is, when a node attempts to use the optimal candidate parent node as the new parent node, it also needs to generate a random number rand between 0 and 1. Only when the random number is less than the preset balance transfer probability will the optimal candidate parent node be used as the new parent node; otherwise, the parent node will not be changed.
[0111] S36. Introduce the parameter balance round number BR, which represents the number of balance rounds required in the balance stage. Only when the set parameter balance round number BR is satisfied can the clustering tree reach the final balanced state.
[0112] Since this balancing method does not use the actual load information of nodes but uses the number of children of nodes for load balancing, it is difficult to achieve a good balancing effect by running the balancing algorithm only once in the clustering tree balancing stage. This is because running the balancing algorithm will cause changes in the network topology. The change in the topology during the first run of the balancing algorithm is the largest, and the network is also unstable at this time. To make the network relatively stable, the parameter balance round number BR is introduced, which represents the number of balance rounds required in the balance stage. Due to the limitations of formulas (5) and (6), as the number of runs of the balancing algorithm increases, the network topology will tend to be stable until it no longer changes, and at this time, the clustering tree has reached the final balanced state.
[0113] In this embodiment, the balanced clustering tree algorithm is divided into two parts according to the node type. The aggregator node is responsible for the start, end, and control of the number of runs of the algorithm. The non-aggregator nodes dynamically adjust the network load under the control of the aggregator node. The processes of the balanced clustering tree algorithms for the aggregator node and the non-aggregator nodes will be described in detail below.
[0114] Furthermore, as Figure 2The operation flow chart of the sink node shown in the figure, the balanced clustering tree algorithm of the sink node, the input is the number of balancing rounds, the balanced transition probability and the unbalanced clustering tree (the clustering tree generated by the first stage is likely to be unbalanced. For example, there are two adjacent nodes i and j at the same level in the clustering tree. It is possible that node i has dozens of child nodes, while node j has none. At this time, nodes i and j are unbalanced, and the tree is also unbalanced. In the best case, the balancing algorithm can distribute half of the child nodes of node i to node j, so that the number of child nodes of nodes at the same level tends to be uniform and the clustering tree tends to be balanced). The output is a balanced clustering tree. The process includes:
[0115] 1) Initialize parameters and set the initial balancing round i = 1;
[0116] 2) If the set number of balancing rounds is reached, that is, i>BR, jump to step 5);
[0117] 3) Broadcast a balance message containing the level information of the sink node and the number of child nodes;
[0118] 4) Wait until the network topology stops changing and start the next round of balancing, i=i+1, jump to step 2);
[0119] In this embodiment, the state of the network topology is determined: Since the balance message is only transmitted from the top layer of the clustering tree to the bottom layer by layer, there is an upper bound on the network topology change time, that is, N, in the worst case, the clustering tree is initially a single tree, L max =N, so set the timeout For redundancy, a certain buffer time is provided between different balancing rounds. When this time is exceeded, the network is stable.
[0120] 5) End the algorithm.
[0121] Furthermore, if Figure 3 The operation flow chart of the non-aggregation nodes shown in the figure, the balanced clustering tree algorithm of all non-aggregation nodes, includes:
[0122] 1) Wait for balance messages from other nodes and update the neighbor table based on the balance information;
[0123] 2) If the balance message comes from a high-level node, go to step 3), otherwise jump to step 7);
[0124] 3) Traverse the nodes that have not been searched in the neighbor table, and search for nodes at the same level or higher level as the original parent node. If not found, jump to step 7);
[0125] 4) Determine whether the node meets the load transfer condition, i.e., formula (5). If not, jump to step 3);
[0126] 5) Generate a random number k between 0 and 1. If k < p, which satisfies formula (6), set this node as the new parent node and update the level of this node.
[0127] 6) Broadcast a balance message containing the level information and the number of child nodes of this node.
[0128] 7) If it is not the last round of balancing, jump to step 1); otherwise, end the algorithm.
[0129] The experimental results and discussions of the load balancing method based on the clustering tree in this embodiment are described in detail through specific embodiments below.
[0130] The selection of the parameter balance transfer probability and the number of balancing rounds will be discussed and analyzed in the experimental part. The experiment is divided into two parts. The first part is used to find the optimal balance transfer probability and the optimal number of load balancing rounds to optimize the performance of the proposed algorithm. The second part compares three protocols, namely LEACH, CBSHA, and LBACT, and evaluates and analyzes the performance of the protocols in terms of indicators such as the network stable period, network lifetime, network throughput, and total network energy consumption. This embodiment uses the OMNET++ 6.0 simulation platform to simulate the present invention. The simulation environment is a 200m × 200m planar area, in which 100 sensor nodes with the same initial energy and performance are evenly distributed. The base station is located at the center (100, 100) of the area. Each node will collect a data packet and send it to the next node in each round. The simulation parameter settings are shown in Table 1.
[0131] Table 1 Simulation parameters
[0132]
[0133] This embodiment will evaluate the present invention from four aspects: the network stable period, network lifetime, remaining energy of the network, and network throughput.
[0134] (1) Network stable period: It is defined as the time when the first node in the network dies. When all nodes in the wireless sensor network can collect data normally, the network is in a stable period. Once a node's energy is exhausted, the network topology changes, and the collected data information is missing, and the network is no longer stable.
[0135] (2) Network lifetime: As the network operates over time, nodes in the network die continuously. According to the existing literature, the network lifetime is defined as the time when 75% of the nodes in the network die. At this time, the wireless sensor network has lost its basic function.
[0136] (3) Network residual energy: includes the total network residual energy and the average node residual energy. The more the total network residual energy, the longer the network can work normally and the greater the benefits of deploying wireless sensor networks. The more the average node residual energy, the lower the node energy consumption, the slower the node death rate, and the longer the network survival period.
[0137] (4) Network throughput: It is defined as the total number of data packets received by the aggregation node during the network lifetime. It indicates the amount of valid data received during the normal operation of the network.
[0138] 1. Analysis of Balance Transfer Probability and Load Balancing Rounds
[0139] In order to determine the optimal parameters for the algorithm, simulation experiments need to be conducted on different parameters. Considering that extending the stability and survival period of the network is the most important balance purpose, the stability and survival period of the network are used as performance indicators to determine the algorithm parameters.
[0140] 1) Balanced transition probability analysis and selection
[0141] First, we analyze the impact of the balance transfer probability p on the network life cycle. The number of load balancing rounds is set to 3. The number of node survival changes with the network running time. Figure 4 shown.
[0142] Depend on Figure 4 It can be seen that when no load balancing is performed (p = 0), the network stability period is 127, and the network lifetime is 514. When p is 0.25, the network lifetime is 328, and the network stability period is 554. When p is 0.5 and 0.75, the network stability period is 222, and the network lifetime is 545. From the data, it can be seen that the clustering tree after balance performs better, and its network stability period and network lifetime are extended. When p is 0.25, the network stability period is extended by 106 rounds, and the network lifetime is extended by 9 rounds compared with p 0.5 and 0.75. This shows that when p is 0.25, the energy consumption of the clustering tree after load balancing is more uniform, so the final value of p is determined to be 0.25.
[0143] 2) Analysis and selection of load balancing rounds
[0144] Under the condition that p is 0.25, the optimal round number of load balancing is analyzed. The relationship between the number of surviving nodes and the number of rounds under different balancing round numbers is as follows: Figure 5As shown in the figure. When BR is 1, the network stability period and network lifetime are 187 and 541 respectively, which are lower than 328 and 558 when BR is 2, indicating that there are still many unbalanced subtrees in the clustering tree at this time. However, the network stability period and network lifetime (328 and 554) when BR is 2 and 3 are the same, indicating that after two rounds of balancing algorithms, the clustering tree has reached a stable state. At this time, running the balancing algorithm again will not make the network load more balanced. At the same time, running the balancing algorithm requires additional energy consumption, and extra balancing rounds will result in meaningless energy consumption, so the final number of balancing rounds is finally selected as 2.
[0145] In summary, the equilibrium transition probability p = 0.25 and the number of equilibrium rounds BR = 2 are used as parameters for subsequent comparative analysis experiments.
[0146] 2. LBACT Performance Analysis
[0147] This embodiment compares the LBACT algorithm with the LEACH and CBSHA algorithms, and analyzes and compares the effectiveness of the algorithm from four aspects: network stability period, network lifetime, network residual energy, and network throughput.
[0148] 1) Network stability period assessment
[0149] Network stability period comparison Figure 6 As shown in the figure, the network stability period of LEACH is 143 rounds, the network stability period of CBSHA is 128 rounds, and the network stability period of LBACT is 328 rounds, which is 230% higher than LEACH and 260% higher than CBSHA, which is significantly better than LEACH and CBSHA. The overall node death rate in the CBSHA algorithm is lower than that of LEACH, but the first dead node appears 15 rounds earlier than LEACH. This is because the load of nodes in the clustering tree constructed by CBSHA is very unbalanced, and some nodes have extremely large loads, especially in the central area of the network. Since these nodes need to receive a large amount of data in each round, their energy consumption is greater than that of the other nodes with lower loads, which leads to the premature death of nodes. The reason why the death time of the first node in the LBACT algorithm is 185 rounds later than that of LEACH is that the load of the nodes is relatively balanced, which solves the problem of excessive load on some nodes at the same level in the clustering tree. The load of adjacent nodes will not differ too much, which prolongs the death time of nodes, especially the death time of some nodes in the central area of the network, thereby prolonging the stability period of the network.
[0150] 2) Network lifecycle assessment
[0151] Network lifetime Figure 6As shown in the figure, the network lifetime of LEACH is 455 rounds, the network lifetime of CBSHA is 521 rounds, and the network lifetime of LBACT is 558 rounds, which is 22.6% higher than LEACH and 7.1% higher than CBSHA. This is due to the relatively balanced clustering tree topology. The clustering tree structure avoids the high energy consumption problem caused by the cluster head node directly communicating with the aggregation node, which prolongs the network lifetime. At the same time, the balanced clustering tree makes the energy consumption of nodes at the same level in the tree more uniform, delaying the death time of the nodes. In addition, the clustering tree structure makes the data processing volume of each node close to the aggregation node more uniform, reducing the energy consumption required for the node to perform data fusion, thereby prolonging the network lifetime.
[0152] 3) Network residual energy analysis
[0153] Total network residual energy: The total network residual energy is as follows: Figure 7 As shown in the figure, the residual energy of the LBACT algorithm is always higher than that of the LEACH protocol. This is because the cluster head in the LEACH protocol tries to communicate directly with the sink node. The energy consumption of nodes at the edge of the network is higher than that of nodes near the center. In a multi-hop network based on a clustering tree, the problem of high energy consumption caused by the long distance between two hops can be solved. As a result, the overall energy consumption of the LBACT algorithm is lower. In addition, the overall residual energy of the LBACT algorithm before network data collection is slightly lower than that of LEACH and CBSHA. This is because running the balancing algorithm in the clustering tree construction stage leads to additional communication overhead, resulting in low initial energy at the beginning of the data transmission stage, but its downward trend is slower than that of CBSHA, indicating that its overall energy consumption rate is slower. After running 120 rounds, the overall energy decline rate of LBACT is significantly slower than that of CHSHA. This is because in LEACH and CHSHA, dead nodes have appeared in the central area of the network, increasing the communication overhead of nodes far away from the sink node. However, due to the relatively uniform load of its nodes, the overall energy decline rate of LBACT is slower, which prolongs the survival time of the nodes. When the network runs for more than 300 rounds, the overall energy of the three protocols gradually converges. However, since all LBACT nodes are still alive in the 300th round, the total energy consumption of the network is higher. In this case, the LBACT algorithm can still ensure that the remaining total energy of the network is higher than that of the other two protocols, indicating that the overall energy consumption of the LBACT algorithm is lower.
[0154] Node average remaining energy analysis: The average remaining energy of the node is as follows: Figure 8As shown. In general, the average residual energy of nodes in the LBACT algorithm is higher than that of the LEACH and CBSHA algorithms. This is because the balancing algorithm balances the subtrees with larger loads in the clustering tree to the subtrees with lower loads, thereby reducing the height of the clustering tree, which reduces the number of hops for data transmission, thereby reducing the energy consumption in the data transmission process and the energy consumption in the data fusion process, and reducing the average energy consumption of the nodes. After the network runs for 560 rounds, the number of surviving nodes in the LBACT algorithm is lower than that in CBSHA. This is because there are very few nodes in CBSHA that are close to the center of the network and have very little load. These nodes have relatively lower energy consumption due to their low load and close to the aggregation node, so they survive longer. However, since the network has exceeded its survival period at this time, the data collected by them is no longer valid, and the act of collecting data is also meaningless. The LBACT algorithm balances the clustering tree so that there are no nodes in the network that are located in the center of the network but have very little load, thereby effectively shortening the time for the sensor network to collect invalid data.
[0155] 4) Network throughput analysis
[0156] The network throughput results are as follows: Fig. 9 As shown in the figure, the throughput of LEACH is 35604, the throughput of CBSHA is 41251, and the throughput of the LBACT algorithm is 43596, which is 15.9% higher than that of LEACH and 5.7% higher than that of CBSHA. This is because the LBACT algorithm can better balance the node load of the clustering tree, and the network stability period and survival period are longer. At the same time, during the survival period of the network, especially during the network stability period, there are more nodes that work normally, and the aggregation node can receive more data packets, which makes the network throughput larger. Therefore, the LBACT algorithm has better performance in data collection.
[0157] In summary, in order to balance the network energy consumption in WSN, extend the life cycle of the network, and improve the throughput of the network, the present invention proposes a load balancing algorithm based on a clustering tree, in which the node autonomously searches for the optimal parent node based on the neighbor information, so that the load in the node's neighborhood is more balanced. By running the balancing algorithm multiple times in the network, the load balancing of the entire clustering tree is achieved, thereby achieving energy consumption balance. The experiment discussed the optimal parameter selection problem of the designed protocol, and then compared and analyzed the proposed algorithm with the LEACH protocol and the CBSHA algorithm. The results show that the method proposed by the present invention can effectively extend the stability period and survival period of the network, and improve the throughput of the network. At the same time, the overall energy consumption of the network and the average energy consumption of the nodes are reduced.
[0158] Embodiment 2: Embodiment 1 above provides a sensor node load balancing method based on a clustering tree. Correspondingly, this embodiment provides a sensor node load balancing device based on a clustering tree. The device provided in this embodiment can implement the sensor node load balancing method based on a clustering tree of Embodiment 1, and the device can be implemented by software, hardware, or a combination of software and hardware. For the convenience of description, this embodiment is described in various units according to their functions. Of course, the functions of each unit can be implemented in the same or multiple software and / or hardware during implementation. For example, the device may include integrated or separate functional modules or functional units to execute the corresponding steps in each method of Embodiment 1. Since the device of this embodiment is basically similar to the method embodiment, the description process of this embodiment is relatively simple. For relevant parts, please refer to the partial description of Embodiment 1. The embodiment of the sensor node load balancing device based on a clustering tree provided by the present invention is only schematic.
[0159] Specifically, this embodiment provides a sensor node load balancing device based on a clustering tree, and the device includes:
[0160] A hierarchical division unit is configured to divide the wireless sensor nodes in the network into a multi-layer structure;
[0161] A cluster tree construction unit is configured to construct a cluster tree in the network, wherein each node added to the cluster tree will immediately search for its child nodes;
[0162] The node load balancing unit is configured to use a balancing algorithm to perform multiple rounds of load balancing on the constructed clustering tree, and finally balance the node loads in the network by running the load balancing algorithm multiple times on each node.
[0163] Embodiment 3: This embodiment provides an electronic device corresponding to the sensor node load balancing method based on clustering tree provided in Embodiment 1. The electronic device may be an electronic device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the method of Embodiment 1.
[0164] like Fig.10As shown, the electronic device includes a processor, a memory, a communication interface and a bus, and the processor, the memory and the communication interface are connected through the bus to complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Component (EISA) bus, etc. The memory stores a computer program that can be run on the processor, and the processor executes the method of embodiment 1 when running the computer program. The implementation principle and technical effect are similar to those of embodiment 1, and will not be repeated here. Those skilled in the art can understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computing device to which the scheme of the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0165] In a preferred embodiment, the logic instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), optical disk and other media that can store program codes.
[0166] In a preferred embodiment, the processor may be a central processing unit (CPU), a digital signal processor (DSP) or other general-purpose processors of various types, which are not limited here.
[0167] Embodiment 4: This embodiment provides a computer program product. The computer program product may include a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the method provided in the above-mentioned embodiment 1. Its implementation principle and technical effects are similar to those of embodiment 1 and will not be repeated here.
[0168] In a preferred embodiment, the computer-readable storage medium may be a tangible device that holds and stores instructions used by the instruction execution device, such as but not limited to an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. The computer-readable storage medium stores computer program instructions that cause the computer to execute the method provided in the first embodiment.
[0169] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In the description of this specification, the description of reference terms "a preferred embodiment", "further", "specifically", "in the present embodiment", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradiction.
[0170] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0171] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A sensor node load balancing method based on clustering tree, characterized in that: The method includes: Based on the clustering tree, the sensor nodes in the network are divided into a multi-layer structure; A cluster tree is constructed in the network, wherein each node added to the cluster tree immediately searches for its child nodes. The cluster tree is constructed in the network, including: Before the cluster tree construction stage, all nodes are not added to the network, the initial level is set to empty, the number of child nodes is set to 0, and the neighbor table is set to empty; At the beginning of the cluster tree construction phase, the sink node sets its initial level to 0, indicating that the sink node is the root node of the cluster tree. Then the sink node broadcasts a construction message. When a node that has not joined the cluster tree receives a construction message, it will join the network through the information in the construction message, set the sender of the message as the parent node and update the neighbor table information. After that, the node will update and broadcast the construction message to notify neighbor nodes to join the network and / or update the neighbor table; Use the balancing algorithm to perform multiple rounds of load balancing on the constructed clustering tree. Run the load balancing algorithm multiple times on each node to eventually balance the load of nodes in the network. Use the balancing algorithm to perform multiple rounds of load balancing on the constructed clustering tree, including: At the beginning of each balancing round, the sink node broadcasts a balance message containing the node's level information and the number of child nodes; After receiving a balance message from a node at a higher level than itself, each node will update its neighbor table and broadcast a balance message containing its own node information; Every time a node receives a balance message from a higher level, it needs to update its neighbor table based on the level information and number of child nodes in the balance message. It then searches for nodes in the updated neighbor table that are eligible to become new parent nodes, called candidate parent nodes. Candidate parent nodes must meet two conditions: The level of the candidate parent node cannot be lower than the original parent node; After a node uses a candidate parent node as its new parent node, the actual load of the original parent node must not be less than the actual load of the new parent node. The actual load information is represented by the number of child nodes of the node. When the node confirms all candidate parent nodes, it selects the candidate parent node with the least number of child nodes as the optimal candidate parent node and uses it as the new parent node; Introducing parameter balance transition probability , the optimal candidate parent node is used as the new parent node only when the set conditions are met, otherwise the parent node is not changed. The set conditions are: , ; That is, when a node attempts to use the best candidate parent node as a new parent node, it also needs to generate a random number between 0 and 1. , only when the random number is less than the preset equilibrium transition probability When , the optimal candidate parent node is used as the new parent node, otherwise the parent node is not changed; Introducing parameter balancing rounds , when the set number of balance wheels is met The clustering tree can reach the final equilibrium state.
2. The sensor node load balancing method based on clustering tree according to claim 1, characterized in that: The sensor nodes in the network are evenly distributed in the two-dimensional plane of the detection area and their positions do not change with time. Each node has a unique ID number. The performance of all sensor nodes is exactly the same. Each sensor node can obtain its own position and remaining energy information, and automatically exit the network when the energy is exhausted. The aggregation node is located at the center of the network.
3. The sensor node load balancing method based on clustering tree according to claim 1, characterized in that: Based on the clustering tree, the sensor nodes in the network are divided into a multi-layer structure, including: The multi-layer structure is divided according to the information of the construction message received by the node. The construction message contains hierarchical information. All nodes that receive the message have hierarchical information. The nodes that construct the message are considered to be in the same layer.
4. The sensor node load balancing method based on clustering tree according to claim 2, characterized in that: A clustering tree is constructed in the network by the sink node, including: 1) Initialize the parameters of the aggregation node and broadcast the node level information The construction message; 2) All non-sink nodes wait for the construction message and update the neighbor table when receiving the construction message; 3) If the node has not yet joined the network, add the node to the network and set the node level to +1, otherwise jump to step 2); 4) Each node that joins the network immediately broadcasts information about its own node level. The construction message; 5) The node joining the network sends an ACK message to the parent node. The parent node updates the neighbor table based on the ACK message and determines the number of child nodes.
5. The sensor node load balancing method based on clustering tree according to claim 1, characterized in that: Balanced clustering tree algorithm for sink nodes and non-sink nodes, including: The process of the balanced clustering tree algorithm for the convergence node is: (1) Initialize parameters and set the initial balancing round i=1; (2) If the set number of balance rounds is reached, i> BR , jump to step (5); (3) Broadcast a balance message containing the hierarchy information of the sink node and the number of child nodes; (4) Wait until the network topology no longer changes and start the next round of balancing, i=i+1, jump to step (2); (5) The algorithm ends; The process of the balanced clustering tree algorithm for non-aggregate nodes is: A) Wait for balance messages from other nodes and update the neighbor table based on the balance messages; B) If the balance message comes from a higher-level node, go to step C), otherwise jump to step G); C) Traverse the nodes that have not been searched in the neighbor table, searching for nodes at the same level or higher than the original parent node. If no nodes are found, jump to step G); D) Determine whether the node meets the load transfer conditions, that is, whether the node is the optimal candidate parent node. If not, jump to step C); E) Generate a random number between 0 and 1 ,if , set the node as the new parent node and update the node level; F) Broadcast a balance message containing the node's level information and the number of child nodes; G) If it is not the last round of balancing, jump to step A), otherwise end the algorithm.
6. A sensor node load balancing device based on clustering tree, characterized in that: The device includes: The hierarchical division unit is configured to divide the wireless sensor nodes in the network into a multi-layer structure based on a clustering tree; The cluster tree construction unit is configured to construct a cluster tree in the network, wherein each node added to the cluster tree will immediately search for its child nodes, and the construction of the cluster tree in the network includes: Before the cluster tree construction stage, all nodes are not added to the network, the initial level is set to empty, the number of child nodes is set to 0, and the neighbor table is set to empty; At the beginning of the cluster tree construction phase, the sink node sets its initial level to 0, indicating that the sink node is the root node of the cluster tree. Then the sink node broadcasts a construction message. When a node that has not joined the cluster tree receives a construction message, it will join the network through the information in the construction message, set the sender of the message as the parent node and update the neighbor table information. After that, the node will update and broadcast the construction message to notify neighbor nodes to join the network and / or update the neighbor table; The node load balancing unit is configured to perform multiple rounds of load balancing on the constructed clustering tree using a balancing algorithm, and finally balance the node loads in the network by running the load balancing algorithm multiple times on each node; wherein: Use the balancing algorithm to perform multiple rounds of load balancing on the constructed clustering tree, including: At the beginning of each balancing round, the sink node broadcasts a balance message containing the node's level information and the number of child nodes; After receiving a balance message from a node at a higher level than itself, each node will update its neighbor table and broadcast a balance message containing its own node information; Every time a node receives a balance message from a higher level, it needs to update its neighbor table based on the level information and number of child nodes in the balance message. It then searches for nodes in the updated neighbor table that are eligible to become new parent nodes, called candidate parent nodes. Candidate parent nodes must meet two conditions: The level of the candidate parent node cannot be lower than the original parent node; After a node uses a candidate parent node as its new parent node, the actual load of the original parent node must not be less than the actual load of the new parent node. The actual load information is represented by the number of child nodes of the node. When the node confirms all candidate parent nodes, it selects the candidate parent node with the least number of child nodes as the optimal candidate parent node and uses it as the new parent node; Introducing parameter balance transition probability , the optimal candidate parent node is used as the new parent node only when the set conditions are met, otherwise the parent node is not changed. The set conditions are: , That is, when a node attempts to use the best candidate parent node as a new parent node, it also needs to generate a random number between 0 and 1. , only when the random number is less than the preset equilibrium transition probability When , the optimal candidate parent node is used as the new parent node, otherwise the parent node is not changed; Introducing parameter balancing rounds , when the set number of balance wheels is met The clustering tree can reach the final equilibrium state.
7. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any one of the methods according to claims 1 to 5.
8. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any one of the methods of claims 1 to 5 .
