Energy consumption balancing method, medium and electronic device for WSN network
By constructing a node distribution plan and energy consumption estimation sequence, network nodes are screened to balance energy consumption, and the delay and computing resource consumption problems caused by the difference in node energy consumption in WSN network are solved, achieving uniform energy reduction of network nodes and improving control efficiency.
Patent Information
- Application Number
- CN202510147442.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-11
AI Technical Summary
In larger WSN networks, the energy consumption difference between nodes when they are cluster heads is large, resulting in parameter transmission delay and computing resource consumption, affecting the efficiency of network control.
By constructing a node distribution plan, the energy consumption estimate of each network node is obtained, and based on this construction sequence, some network nodes are screened to balance the energy consumption and make the energy consumption of the WSN network even.
The energy of network nodes in the WSN network is uniformly reduced, avoiding parameter transmission delay and computing resource consumption, and improving the efficiency of network control.
Smart Images

Figure CN119629714B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless communication networks, and in particular to an energy consumption balancing method, a medium and an electronic device for a WSN network. Background Art
[0002] Wireless Sensor Networks (WSN) is a wireless network transmission technology, consisting of wireless nodes and base station nodes, where the wireless nodes are powered by batteries and the base station nodes are powered by external power supplies. Since wireless nodes consume a lot of energy when sending and receiving information, and it is difficult to replace the batteries of wireless nodes, it is necessary to balance the energy consumption of wireless nodes in the WSN network, so as to avoid a single wireless node consuming energy faster than other nodes, and effectively improve the service life of the WSN network. Wireless nodes are network nodes.
[0003] The traditional LEACH algorithm transmits data in a clustered manner, giving each node an equal opportunity to become a cluster head. Because the energy consumption of a single network transmission is mainly concentrated on the cluster head node, the LEACH algorithm helps to evenly distribute energy consumption throughout the network by ensuring that all nodes have an equal opportunity to become cluster heads. Further on the basis of the LEACH algorithm, technicians improved the threshold calculation method of the LEACH algorithm through the residual energy parameters of the network nodes to eliminate the problem of uneven distribution of network energy consumption caused by power differences when nodes serve as cluster heads, such as the LEACH-IMP, LEACH-C and other algorithms.
[0004] However, this part of the improved algorithm needs to use the residual energy parameters of the network nodes to control node transmission. Therefore, when using the improved algorithm of the LEACH algorithm to control the WSN network, the main technical problem is that the nodes have different energy consumption when they are cluster heads, and when facing a larger WSN network, energy consumption needs to be collected from multiple nodes, which will cause a large delay in parameter transmission. If the network node is called the cluster head multiple times, the energy consumption difference between the nodes will be large, thereby consuming additional computing resources and causing a delay in the control of the WSN network. Summary of the invention
[0005] In order to solve the technical problem of uneven energy consumption of nodes, the present invention provides an energy consumption balancing method, medium and electronic device for WSN network, and the technical solution adopted is as follows:
[0006] In a first aspect, the present invention proposes an energy consumption balancing method for a WSN network, the method comprising the following steps:
[0007] Acquire node geographic distribution information through wireless sensor network to build a node distribution plan map, the node distribution plan map includes network nodes and base station nodes;
[0008] Different network nodes in the node distribution plane diagram are used as cluster head nodes to form a cluster head selection scheme. Any network node is recorded as a target node, and the first scheme is determined by the target node. In each cluster head selection scheme, a cluster of cluster head nodes is obtained. According to the distance between the cluster head node and the non-cluster head node in each cluster, the distance between the cluster head node and the base station node, and the number of non-cluster head nodes, the power consumption value of each cluster and the energy consumption weight of the first scheme are obtained. According to the energy consumption weight of the first scheme when each network node is the cluster head and the power consumption value of the cluster in which it is located, the energy consumption estimation value of each network node is obtained.
[0009] A sequence is constructed according to the estimated energy consumption values of all network nodes. Some network nodes are discarded before selecting the cluster head according to the size of the estimated energy consumption in the sequence. Based on this, the energy consumption of different network nodes is balanced to make the energy consumption of the WSN network uniform.
[0010] In the above scheme, the distance between nodes in the WSN network is used as the power consumption estimation of node data transmission. When the nth node is elected as the cluster head, the energy consumption of all cluster head schemes is calculated. According to the LEACH algorithm, the cluster head selection scheme with low energy consumption is adopted as the priority cluster head selection scheme. The energy consumption weight of the scheme is calculated to represent the probability of different schemes being selected.
[0011] Combine the energy consumption weight of the scheme with the energy consumption of the nth node in different cluster head selection schemes to calculate the energy consumption estimate when the nth node is elected as the cluster head;
[0012] According to the energy consumption estimation of the cluster head, an energy consumption estimation sequence is constructed, and the reference sequence of the candidate network nodes and the screening sequence of the candidate network nodes are further obtained; finally, the LEACH algorithm is improved according to the reference sequence of the candidate network nodes and the screening sequence of the candidate network nodes, so that the number of times the nth node is selected as the cluster head is inversely proportional to the estimated power consumption of the nth node, so as to achieve the effect of uniformly decreasing the energy of the network nodes in the WSN network and complete the energy consumption balance of the WSN network.
[0013] Since the present invention does not need to process the residual energy parameters of the nodes in real time, it avoids the system control delay caused by slow node parameter transmission when performing energy balancing on a larger WSN network, and solves the problem that the LEACH algorithm cannot perform energy balancing on a larger WSN network.
[0014] Furthermore, the method for determining the first solution by the target node is:
[0015] Among all cluster head selection schemes, the scheme in which the target node is the cluster head node is the first scheme, and there are several first schemes.
[0016] Furthermore, in the cluster head selection scheme, each cluster head node corresponds to a cluster, each cluster consists of a cluster head node and several non-cluster head nodes, the Euclidean distance between the non-cluster head node and all cluster head nodes is calculated, and the cluster head node and the non-cluster head node with the smallest distance are divided into one cluster.
[0017] Further, the method for obtaining the power consumption value of each cluster and the energy consumption weight of the first solution according to the distance between the cluster head node and the non-cluster head node in each cluster, the distance between the cluster head node and the base station node, and the number of non-cluster head nodes is:
[0018] The cluster corresponding to the target node is recorded as the target cluster;
[0019] The intra-cluster energy consumption of the target cluster is obtained according to the distance between the cluster head node and the non-cluster head nodes in the target cluster;
[0020] The transmission energy consumption of the target cluster is obtained according to the distance between the cluster head node and the base station node in the target cluster and the number of non-cluster head nodes;
[0021] The power consumption value of the target cluster is obtained according to the intra-cluster energy consumption of the target cluster and the transmission energy consumption of the target cluster. The power consumption value of the target cluster is positively correlated with the transmission energy consumption and the intra-cluster energy consumption of the target cluster respectively.
[0022] The energy consumption weight of the first solution is obtained according to the power consumption values of all target clusters, and the energy consumption weight of the first solution is negatively correlated with the power consumption values of all target clusters.
[0023] Furthermore, the method for obtaining the intra-cluster energy consumption of the target cluster according to the distance between the cluster head node and the non-cluster head node in the target cluster is:
[0024] The Euclidean distance from all non-cluster head nodes to the cluster head node is calculated as the distance from the non-cluster head node to the cluster head node. The expression of energy consumption within the cluster is:
[0025] , represents the distance from the i-th non-cluster head node to the cluster head node in the m-th target cluster, represents the number of non-cluster head nodes in the mth target cluster, represents the intra-cluster energy consumption of the m-th target cluster.
[0026] Furthermore, the method for obtaining the transmission energy consumption of the target cluster according to the distance between the cluster head node and the base station node in the target cluster and the number of non-cluster head nodes is:
[0027] The Euclidean distance from the cluster head node to the base station node in the target cluster is calculated as the distance from the cluster head node to the base station node. The number of all non-cluster head nodes in the target cluster is counted. The expression of transmission energy consumption is:
[0028] , represents the distance from the cluster head node to the base station node in the mth target cluster, represents the transmission energy consumption of the mth target cluster.
[0029] Furthermore, the method for obtaining the estimated energy consumption value of each network node according to the energy consumption weight of the first solution when each network node is a cluster head and the power consumption value of the cluster in which it is located is:
[0030] For all first schemes, the target node acts as the cluster head node in the first scheme, and corresponds to a power consumption value. The energy consumption estimation value of the target node is obtained according to the power consumption value when the target node is the cluster head in the first scheme and the energy consumption weight of the first scheme. The energy consumption estimation value is positively correlated with the power consumption value and energy consumption weight of the target node, respectively.
[0031] Furthermore, a sequence is constructed based on the estimated energy consumption values of all network nodes. The size of the estimated energy consumption values in the sequence is used to screen out some network nodes before selecting the cluster head. Based on this, the method for balancing the energy consumption of different network nodes is as follows:
[0032] The energy consumption estimation values of all network nodes are linearly normalized and recorded as the energy consumption parameters of the network nodes. All energy consumption parameters are arranged into a sequence and recorded as the energy consumption estimation value sequence. The sequence value upper limit of the energy consumption estimation value sequence is set to a constant 1, and the maximum sequence value in the energy consumption estimation value sequence is collected.
[0033] The ratio of the maximum sequence value in the energy consumption estimation value sequence to the sequence value upper limit is used as the value adjustment coefficient, and a new sequence is constructed by the ratio of all values in the energy consumption estimation value sequence to the value adjustment coefficient and recorded as the reference sequence of the network node to be selected;
[0034] Initially, a sequence with the same length as the energy consumption estimation sequence and all sequence values are constant 0 and recorded as the candidate network node screening sequence;
[0035] The LEACH algorithm randomly selects some network nodes as the cluster head candidate node range;
[0036] If there is a sequence value greater than the upper limit of the sequence value in the candidate network node screening sequence, and the network node corresponding to the sequence value is in the range of cluster head candidate nodes, the network node is deleted from the range of cluster head candidate nodes;
[0037] If there is no sequence value greater than the upper limit of the sequence value in the candidate network node screening sequence, the LEACH algorithm selects the cluster head normally, and records the sequence value of the network node called the cluster head in the candidate network node reference sequence plus the sequence value of the same network node in the candidate network node screening sequence as the first sequence value, and assigns the first sequence value of the network node to the sequence value of the network node in the candidate network node screening sequence;
[0038] When the sequence values in the candidate network node screening sequence are all greater than the upper limit value, the upper limit value is subtracted from the sequence values in the candidate network node screening sequence, and the cluster head is reselected.
[0039] In a second aspect, the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements an energy consumption balancing method for a WSN network as described in the first aspect.
[0040] In a third aspect, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, an energy consumption balancing method for a WSN network as described in the first aspect is implemented.
[0041] The energy consumption balancing method, medium and electronic device for WSN network of the present invention have the following beneficial effects:
[0042] The distance between nodes in the WSN network is used as the power consumption estimation of node data transmission. When the nth node is elected as the cluster head, the energy consumption of all cluster head schemes is calculated. According to the LEACH algorithm, the cluster head selection scheme with low energy consumption is adopted as the priority cluster head selection scheme. The energy consumption weight of the scheme is calculated to represent the probability of different schemes being selected.
[0043] Combine the energy consumption weight of the scheme with the energy consumption of the nth node in different cluster head selection schemes to calculate the energy consumption estimate when the nth node is elected as the cluster head;
[0044] According to the energy consumption estimation of the cluster head, an energy consumption estimation sequence is constructed, and the reference sequence of the candidate network nodes and the screening sequence of the candidate network nodes are further obtained; finally, the LEACH algorithm is improved according to the reference sequence of the candidate network nodes and the screening sequence of the candidate network nodes, so that the number of times the nth node is selected as the cluster head is inversely proportional to the estimated power consumption of the nth node, so as to achieve the effect of uniformly decreasing the energy of the network nodes in the WSN network and complete the energy consumption balance of the WSN network.
[0045] Since the present invention does not need to process the residual energy parameters of the nodes in real time, it avoids the system control delay caused by slow node parameter transmission when performing energy balancing on a larger WSN network, and solves the problem that the LEACH algorithm cannot perform energy balancing on a larger WSN network. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flow chart of an energy consumption balancing method for a WSN network provided by an embodiment of the present invention;
[0048] Figure 2 It is the node distribution plan of the present invention;
[0049] Figure 3 Schematic diagram of the improved LEACH algorithm of the present invention. DETAILED DESCRIPTION
[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the energy consumption balancing method, medium and electronic device for WSN network proposed by the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments, and their specific implementation methods, structures, features and effects are described as follows. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0051] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0052] An energy consumption balancing method, medium and electronic device embodiment for WSN network:
[0053] For the LEACH (Low Power Adaptive Clustering Hierarchical Protocol) algorithm, the algorithm will select nodes as cluster heads, and each process of selecting cluster heads is called a small round. All nodes in a small round have the possibility of becoming cluster heads, and a small round will have different numbers of nodes called cluster heads. When a full round of cluster head rotation is completed, that is, when each node in the network has been selected as a cluster head at least once, it is called a large round. After completing a small round, the node selected as the cluster head will be removed from the range of candidate cluster head nodes until the next large round starts, when all nodes will be included in the range of candidate cluster head nodes again.
[0054] When designing the traditional LEACH algorithm, all nodes are selected as cluster heads the same number of times after each round, which will lead to uneven distribution of network energy consumption due to the difference in energy consumption when the nodes serve as cluster heads, thereby shortening the overall life of the network.
[0055] Therefore, in this embodiment, before each small round starts, some nodes are removed from the range of cluster head candidate nodes to solve the problem of unbalanced energy consumption in the WSN network. Since there is no need to collect the node residual energy parameters in real time during this process, the control delay problem that occurs when controlling a larger WSN network can be avoided.
[0056] The following specifically describes a specific scheme of an energy consumption balancing method for a WSN network provided by the present invention in conjunction with the accompanying drawings.
[0057] See also Figure 1 , which shows a flow chart of an energy consumption balancing method for a WSN network provided by an embodiment of the present invention, the method comprising the following steps:
[0058] Step S001, obtaining node geographic distribution information through a wireless sensor network to construct a node distribution plan map, where the node distribution plan map includes network nodes and base station nodes.
[0059] Since this embodiment needs to extract energy consumption characteristics of different nodes when they serve as cluster heads, and the difference in energy consumption characteristics of different nodes is mainly related to the geographical distribution of the nodes, the geographical distribution information of the nodes in the WSN (wireless sensor) network is obtained.
[0060] First, obtain a map of the area where the WSN is located, mark the locations of the base station nodes and network nodes in the WSN network on the map, represent the base station nodes with five-pointed stars, and represent the network nodes with dots. Delete other background objects to obtain a node distribution plan. The node distribution plan is as follows: Figure 2 shown.
[0061] The node distribution plane diagram is a binary image. The pixel value of the nodes in the image is 1, that is, the pixel value of the point represented by the origin and the five-pointed star is 1, and the pixel value of the remaining blank part is 0.
[0062] At this point, the node distribution plan is obtained.
[0063] Step S002, different network nodes in the node distribution plan are used as cluster head nodes to form a cluster head selection scheme, and any network node is recorded as a target node, and the first scheme is determined by the target node; in each cluster head selection scheme, a cluster of cluster head nodes is obtained; according to the distance between the cluster head node and the non-cluster head nodes in each cluster, the distance between the cluster head node and the base station node, and the number of non-cluster head nodes, the power consumption value of each cluster and the energy consumption weight of the first scheme are obtained; according to the energy consumption weight of the first scheme when each network node is the cluster head and the power consumption value of the cluster in which it is located, the energy consumption estimation value of each network node is obtained.
[0064] Any network node in the node distribution plane is recorded as the nth network node, that is, the target node. When the nth network node is selected as the cluster head, other network nodes will continue to be selected as cluster heads, corresponding to multiple cluster head selection schemes. In each scheme, the nth network node belongs to a different cluster, and thus the energy consumption of the nth network node in different cluster head schemes is different. Therefore, in order to obtain the energy consumption characteristics when the nth network node is the cluster head, it is necessary to analyze all cluster head selection schemes with the nth network node as the cluster head.
[0065] It should be noted that any number of network nodes as cluster heads constitute a cluster head selection scheme. When the number is the same, different network nodes constitute different cluster head selection schemes.
[0066] For example, if the network nodes are {1, 2, 3}, then {1, 2} is a cluster head selection scheme, {1, 2, 3} is a cluster head selection scheme, and {1, 3} is also a cluster head selection scheme.
[0067] At present, when the LEACH algorithm is used for WSN networks, a cluster head selection scheme with low energy consumption is tended to be adopted as a preferred cluster head selection scheme; therefore, this embodiment obtains all cluster head selection schemes for the nth network node as the cluster head, calculates the communication energy consumption according to the cluster routing structure described in these schemes, and obtains the energy consumption weight of the scheme according to the energy consumption. The higher the energy consumption of the scheme, the lower the probability of the scheme being selected, and the lower the energy consumption weight of the scheme, the less likely this scheme will appear when the nth network node is used as the cluster head.
[0068] For the nth network node, all cluster head selection schemes including the nth network node are obtained, and the cluster head selection scheme including the nth network node is recorded as the first scheme.
[0069] For any of the first schemes, there are a number of network nodes as cluster heads. For non-cluster head nodes, they will be divided into a cluster where a cluster head node is located according to the distance between them and the cluster head node. Each cluster consists of a cluster head node and other non-cluster head nodes. In this embodiment, the number of cluster head nodes is 10. The distance can be calculated by converting the Euclidean distance into a vector and finding the modulus.
[0070] Since the energy consumption of transmitting data between network nodes is usually related to the distance between the two network nodes, this embodiment uses the distance between the non-cluster head node and the cluster head node, and the distance between the cluster head node and the base station node as alternative indicators of the energy consumption of transmitting data. The greater the distance, the greater the transmission energy consumption.
[0071] The energy consumption of each first solution is characterized according to the sum of the distances between the cluster head nodes and the non-cluster head nodes and the distances between the cluster head nodes and the base station nodes in all clusters in each first solution.
[0072] Any cluster in the first scheme is recorded as the target cluster. For the target cluster, the distances from all non-cluster head nodes to the cluster head node are calculated, and the intra-cluster energy consumption of the target cluster is obtained according to the distances between the non-cluster head nodes and the cluster head node. The transmission energy consumption of the target cluster is obtained according to the distance between the cluster head node and the base station node and the number of non-cluster head nodes. The power consumption value of the target cluster is obtained according to the transmission energy consumption and intra-cluster energy consumption of the target cluster.
[0073] The power consumption value of the target cluster is positively correlated with the transmission energy consumption and intra-cluster energy consumption of the target cluster, respectively.
[0074] It should be noted that positive correlation means that when one variable increases, the other variable also increases, and the two variables change in the same direction. When one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large. It is determined by actual application and the present invention does not impose any special limitation.
[0075] Preferably, in one embodiment of the present invention, for the target cluster, the Euclidean distances from all non-cluster head nodes to the cluster head node are calculated as the distances from the non-cluster head node to the cluster head node, and the sum of the distances from all non-cluster head nodes to the cluster head node is used as the intra-cluster energy consumption of each target cluster. , represents the distance from the i-th non-cluster head node to the cluster head node in the m-th target cluster, represents the number of non-cluster head nodes in the mth target cluster, represents the intra-cluster energy consumption of the m-th target cluster.
[0076] Calculate the Euclidean distance from the cluster head node to the base station node in the target cluster as the distance from the cluster head node to the base station node, count the number of all non-cluster head nodes in the target cluster, and take the product of the number of non-cluster head nodes in the target cluster and the distance from the cluster head node to the base station node as the transmission energy consumption of the target cluster , represents the distance from the cluster head node to the base station node in the m-th target cluster, represents the transmission energy consumption of the m-th target cluster.
[0077] Take the sum of the intra-cluster energy consumption and the transmission energy consumption of the target cluster as the power consumption value of the target cluster , represents the power consumption value of the m-th target cluster.
[0078] Preferably, in an embodiment of the present invention, for the target cluster, obtain the vector from the non-cluster head node to the cluster head node, calculate the modulus of the vector as the distance from the non-cluster head node to the cluster head node, count the number of all non-cluster head nodes in the target cluster, and take the average of the distances from all non-cluster head nodes to the cluster head node as the intra-cluster energy consumption of each target cluster , represents the distance from the i-th non-cluster head node to the cluster head node in the m-th target cluster, represents the number of non-cluster head nodes in the m-th target cluster, represents the intra-cluster energy consumption of the m-th target cluster.
[0079] Obtain the vector from the cluster head node to the base station node, calculate the modulus of the vector as the distance from the cluster head node to the base station node, and take the distance from the cluster head node to the base station node as the transmission energy consumption of the target cluster , represents the distance from the cluster head node to the base station node in the m-th target cluster, represents the transmission energy consumption of the m-th target cluster
[0080] Take the sum of the intra-cluster energy consumption and the transmission energy consumption of the target cluster as the power consumption value of the target cluster , represents the power consumption value of the m-th target cluster.
[0081] Obtain the energy consumption weight of the first scheme according to the power consumption values of all target clusters.
[0082] The energy consumption weight of the first scheme is negatively correlated with the power consumption values of all target clusters.
[0083] It should be noted that negative correlation means that when one variable increases, the other variable decreases, and the change directions of the two variables are opposite. When one variable changes from large to small or from small to large, the other variable also changes from small to large or from large to small; it is determined by actual applications, and the present invention does not make special restrictions.
[0084] Preferably, in one embodiment of the present invention, the power consumption values of all target clusters in the first scheme are added as the energy consumption value of the first scheme, the inverse of the energy consumption value of each first scheme is obtained, and the inverse of the energy consumption value of the first scheme is linearly normalized and used as the energy consumption weight of the first scheme.
[0085] Preferably, in one embodiment of the present invention, the power consumption values of all target clusters in the first scheme are averaged as the energy consumption value of the first scheme, the opposite number of the energy consumption value of each first scheme is obtained, and the opposite number of the energy consumption value of the first scheme is obtained by The function is calculated as the energy consumption weight of the first solution.
[0086] The larger the energy consumption weight is, the lower the energy consumption of the corresponding first solution is compared with other solutions, and the more inclined the nth network node is to choose the cluster head selection solution when it serves as the cluster head.
[0087] For all first schemes, the nth network node acts as the cluster head node in the first scheme, that is, the nth network node corresponds to a power consumption value. The energy consumption estimation value of the nth network node is obtained according to the power consumption value when the nth network node is the cluster head in the first scheme and the energy consumption weight of the first scheme.
[0088] The energy consumption estimation value is positively correlated with the power consumption value and energy consumption weight of the network nodes respectively.
[0089] Preferably, in one embodiment of the present invention, the energy consumption estimate of the nth network node is the cumulative value of the product of the power consumption value of the nth network node in all the first schemes and the energy consumption weight of the first scheme corresponding to the nth network node. , represents the power consumption value of the nth network node in the oth first solution, represents the energy consumption weight of the oth first solution, represents the estimated energy consumption of the nth network node, and R represents the number of the first solution.
[0090] Preferably, in one embodiment of the present invention, the average of the product of the power consumption value of the nth network node in all the first schemes and the energy consumption weight of the first scheme corresponding to it is taken as the energy consumption estimation value of the nth network node. , represents the power consumption value of the nth network node in the oth first solution, represents the energy consumption weight of the oth first solution, represents the estimated energy consumption of the nth network node, and R represents the number of the first solution.
[0091] Among them, the larger the estimated value of the energy consumption of the network node is, the less times the network node should serve as the cluster head node during cluster routing to ensure that the energy consumption of all network nodes decreases evenly and improve the network life.
[0092] At this point, the estimated energy consumption of each network node is obtained.
[0093] Step S003, construct a sequence according to the estimated energy consumption values of all network nodes, discard some network nodes before selecting the cluster head according to the size of the estimated energy consumption values in the sequence, and balance the energy consumption of different network nodes based on this to make the energy consumption of the WSN network uniform.
[0094] The energy consumption estimation values of all network nodes are linearly normalized and recorded as the energy consumption parameters of the network nodes. All energy consumption parameters are arranged into a sequence and recorded as the energy consumption estimation value sequence. Since the energy consumption parameters are normalized values, the upper limit of the sequence value of the energy consumption estimation value sequence is set to , collect the maximum sequence value in the energy consumption estimation sequence.
[0095] Further compare the maximum sequence value in the energy consumption estimation sequence with the upper sequence value , get the numerical adjustment coefficient, then compare all the values in the energy consumption estimation sequence with the numerical adjustment coefficient to get a new sequence recorded as the reference sequence of the candidate network nodes, where the nth sequence value is recorded as .
[0096] At the same time, a sequence with a length of N and all sequence values of zero is generated as the candidate network node screening sequence, which is represented by sequence B. When the WSN network is controlled by the LEACH algorithm, the LEACH algorithm is improved by obtaining the candidate network node reference sequence and the candidate network node screening sequence, as follows Figure 3 shown.
[0097] Step Q1: Before each round of the traditional LEACH algorithm starts, there is a cluster head candidate node range, which contains multiple network nodes. The traditional LEACH algorithm will select a node as the cluster head from it. Before each cluster head selection, observe the sequence B. If the nth sequence value Greater than , and the nth node is in the range of cluster head candidate nodes, then the nth node is deleted from the range of cluster head candidate nodes.
[0098] Among them, the network node with greater power consumption has a higher sequence value of the reference sequence of the candidate network node. The larger the value, the smaller the number of cluster heads it can reach after being selected as cluster heads for fewer times compared to other network nodes. Value greater than , which can make the nth network node as a whole less likely to be used as the cluster head, and make the number of times the nth network node is selected as the cluster head inversely proportional to the energy consumption parameter of the nth network node, so as to achieve the effect of uniformly decreasing the energy of network nodes in the WSN network.
[0099] Step Q2: Select a cluster head from the range of cluster head candidate nodes according to the traditional LEACH algorithm. This process is the original process in the LEACH algorithm. The LEACH algorithm is a well-known technology in the field of network transmission and will not be described in detail in the present invention.
[0100] Step Q3: After selecting the cluster head, the sequence B is maintained. The maintenance method is: if the nth network node is selected as the cluster head node, the nth sequence value in sequence B is Add the nth sequence value of the energy consumption estimate sequence , maintenance is completed.
[0101] Step Q4: After maintaining sequence B, determine whether all sequence values in sequence B are greater than , are greater than This means that all network nodes will be removed from the cluster head candidate node range at this time, so all sequence values in sequence B need to be subtracted , all network nodes are included in the range of candidate nodes for cluster head.
[0102] This completes the improvement of the traditional LEACH algorithm.
[0103] Because this embodiment excludes some network nodes from the range of candidate nodes for cluster head before each small round of the LEACH algorithm starts, the number of times a network node serves as a cluster head is inversely proportional to the power consumption of the node, thereby solving the problem of uneven energy consumption in the WSN network caused by differences in node power consumption.
[0104] Based on the same concept as the method embodiment of the present invention, a computer-readable storage medium is proposed, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, an energy consumption balancing method for a WSN network as described in the first aspect is implemented. Its specific functions and technical effects can be found in the method embodiment part, which will not be repeated here.
[0105] Based on the same inventive concept as the above method, an embodiment of the present invention also provides an electronic device for detecting the deformation degree of a building curtain wall, wherein the computer device includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned energy consumption balancing methods for a WSN network are implemented.
[0106] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
[0107] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for balancing energy consumption in a WSN network, characterized in that: The method comprises the following steps: Acquire node geographic distribution information through wireless sensor network to build a node distribution plan map, the node distribution plan map includes network nodes and base station nodes; Different network nodes in the node distribution plan are used as cluster head nodes to form a cluster head selection scheme. Any network node is recorded as a target node. Among all cluster head selection schemes, the cluster head selection scheme containing the target node is taken as the first scheme. In each cluster head selection scheme, a cluster with the number of cluster head nodes is obtained. The cluster corresponding to the target node is recorded as the target cluster. The intra-cluster energy consumption of the target cluster is obtained according to the distance between the cluster head node and the non-cluster head nodes in the target cluster. The transmission energy consumption of the target cluster is obtained according to the distance between the cluster head node and the base station node in the target cluster and the number of non-cluster head nodes. The power consumption value of the target cluster is obtained according to the intra-cluster energy consumption of the target cluster and the transmission energy consumption of the target cluster, and the power consumption value of the target cluster is positively correlated with the transmission energy consumption and intra-cluster energy consumption of the target cluster respectively. The energy consumption weight of the first scheme is obtained according to the power consumption values of all target clusters, and the energy consumption weight of the first scheme is negatively correlated with the power consumption values of all target clusters. The energy consumption estimation value of each network node is obtained according to the energy consumption weight of the first scheme when each network node is the cluster head and the power consumption value of the cluster in which it is located. A sequence is constructed according to the estimated energy consumption values of all network nodes. Before selecting the cluster head, some network nodes are screened out according to the size of the estimated energy consumption values in the sequence. Based on this, the energy consumption of different network nodes is balanced to make the energy consumption of the WSN network uniform.
2. The energy consumption balancing method for WSN network according to claim 1, characterized in that: In the cluster head selection scheme, the specific steps for obtaining the cluster with the number of cluster head nodes in each cluster head selection scheme are as follows: each cluster head node corresponds to a cluster, each cluster consists of a cluster head node and several non-cluster head nodes, the distance between the non-cluster head node and all cluster head nodes is calculated, and the cluster head node and the non-cluster head node with the smallest distance are divided into one cluster.
3. The energy consumption balancing method for WSN network according to claim 1, characterized in that: The method for obtaining the energy consumption within the target cluster according to the distance between the cluster head node and the non-cluster head node in the target cluster is: The Euclidean distance from all non-cluster head nodes to the cluster head node is calculated as the distance from the non-cluster head node to the cluster head node. The expression of energy consumption within the cluster is: , represents the distance from the ith non-cluster head node to the cluster head node in the mth target cluster, represents the number of non-cluster head nodes in the mth target cluster, represents the intra-cluster energy consumption of the m-th target cluster.
4. The energy consumption balancing method for WSN network according to claim 3 is characterized in that: The method for obtaining the transmission energy consumption of the target cluster according to the distance between the cluster head node and the base station node in the target cluster and the number of non-cluster head nodes is: The Euclidean distance from the cluster head node to the base station node in the target cluster is calculated as the distance from the cluster head node to the base station node. The number of all non-cluster head nodes in the target cluster is counted. The expression of transmission energy consumption is: , represents the distance from the cluster head node to the base station node in the mth target cluster, represents the transmission energy consumption of the mth target cluster.
5. The energy consumption balancing method for WSN network according to claim 1, characterized in that: The method for obtaining the estimated energy consumption value of each network node according to the energy consumption weight of the first solution when each network node is a cluster head and the power consumption value of the cluster in which it is located is: For all first schemes, the target node acts as the cluster head node in the first scheme, and corresponds to a power consumption value. The energy consumption estimation value of the target node is obtained according to the power consumption value when the target node is the cluster head in the first scheme and the energy consumption weight of the first scheme. The energy consumption estimation value is positively correlated with the power consumption value and energy consumption weight of the target node, respectively.
6. The energy consumption balancing method for WSN network according to claim 1, characterized in that: A sequence is constructed based on the estimated energy consumption values of all network nodes. The estimated energy consumption values in the sequence are used to filter out some network nodes before selecting the cluster head. Based on this, the method for balancing the energy consumption of different network nodes is as follows: The energy consumption estimation values of all network nodes are linearly normalized and recorded as the energy consumption parameters of the network nodes. All energy consumption parameters are arranged into a sequence and recorded as the energy consumption estimation value sequence. The sequence value upper limit of the energy consumption estimation value sequence is set to a constant 1, and the maximum sequence value in the energy consumption estimation value sequence is collected. The ratio of the maximum sequence value in the energy consumption estimation value sequence to the sequence value upper limit of the energy consumption estimation value sequence is used as the value adjustment coefficient, and a new sequence is constructed by the ratio of all values in the energy consumption estimation value sequence to the value adjustment coefficient and recorded as the reference sequence of the network node to be selected; Initially, a sequence with the same length as the energy consumption estimation sequence and all sequence values are constant 0 and recorded as the candidate network node screening sequence; The LEACH algorithm randomly selects some network nodes as the cluster head candidate node range; If there is a sequence value in the candidate network node screening sequence that is greater than the sequence value upper limit of the energy consumption estimation value sequence, and the network node corresponding to the sequence value is in the cluster head candidate node range, the network node is deleted from the cluster head candidate node range; If there is no sequence value greater than the upper limit of the sequence value of the energy consumption estimation value sequence in the candidate network node screening sequence, the LEACH algorithm selects the cluster head normally, and records the sequence value of the network node called the cluster head in the candidate network node reference sequence plus the sequence value of the same network node in the candidate network node screening sequence as the first sequence value, and assigns the first sequence value of the network node to the sequence value of the network node in the candidate network node screening sequence; When the sequence values in the candidate network node screening sequence are all greater than the sequence value upper limit of the energy consumption estimation value sequence, the sequence value upper limit of the energy consumption estimation value sequence is subtracted from the sequence values in the candidate network node screening sequence, and the cluster head is reselected.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement an energy consumption balancing method for a WSN network as described in any one of claims 1 to 6.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an energy consumption balancing method for a WSN network as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Improved LEACH method for balancing energy consumption of tree-based wireless sensor network
CN112312511A
LEACH clustering routing method based on energy consumption balance
CN114449609A