This patent application claims the benefit and priority of Chinese Patent Application No. 202110481436.7 filed on Apr. 30, 2021, the disclosure of which is incorporated by reference herein in its entirety as part of the present application.
The present disclosure relates to the field of wireless sensor networks, and in particular, to a clustering and routing method and system for wireless sensor networks.
With the development of the Internet of Things, wireless sensor networks, as one of the important communication technologies for data perception and acquisition, have been widely used because of its characteristics such as low-cost, self-organization, etc.
The wireless sensor network includes a large number of micro-size wireless sensors, and as a consequence, the micro-size results in constraints on the battery capacity of the sensors. In a variety of application scenarios, batteries cannot be replaced in time due to factors such as a wide distribution range of sensors and harsh environments. In view of this, energy becomes an important factor that limits the lifetime of wireless sensor networks.
Various energy routing strategies have been proposed to extend the lifetime of wireless sensor networks. For example, data fusion by cluster heads reduces the amount of transmitted data, but leads to early death of the cluster heads. In order to reduce the energy consumption of the cluster heads, a dual cluster heads scheme is proposed that allocates the energy consumption of data fusion and acquisition and data transmission to two nodes, but cluster heads responsible for data forwarding consumes energy too fast. A multi-hop communication between the cluster heads and a base station is adopted to reduce long-distance transmission in an attempt to reduce the energy consumption of data transmission, so as to save the energy consumption of the cluster heads and prolong the lifetime of the network. In this case, however, nodes close to the base station consume energy too fast, which causes the “energy hole”.
An object of the present disclosure is to provide a clustering and routing method and system for wireless sensor networks, to alleviate the problem of energy hole in existing wireless sensor networks.
To implement the above object, the present disclosure provides the following solutions:
A clustering and routing method for a wireless sensor network includes:
In an embodiment, the acquiring, by a base station, node information in a wireless sensor network, and constructing an initial MECPT based on the node information may specifically include:
In an embodiment, the calculating the first cluster head competition coefficients of nodes other than the base station in the initial MECPT, performing a first batch of cluster head selection and node clustering, constructing a first batch of cluster trees and updating the initial MECPT by a first iteration process, and getting a first-updated MECPT. Every iteration may specifically include:
In an embodiment, after the deleting nodes in the first batch of cluster trees and edges associated with the nodes from the initial MECPT, and determining the first-updated MECPT, the method may further include:
In an embodiment, the calculating second cluster head competition coefficients of nodes other than the base station in the first-updated MECPT, performing a second batch of cluster head selection and node clustering, constructing a second batch of cluster trees, and updating the first-updated MECPT by a second iteration process, and getting a second-updated MECPT. Every iteration may specifically include:
In an embodiment, after the updating the current second-updated MECPT and cluster trees to which the node in the second-updated MECPT is added, the method may further include:
In an embodiment, the calculating the minimum weight paths from the cluster heads to the base station based on weights about energy consumption of communication, using the minimum weight paths as communication paths between the cluster heads and the base station, and getting communication paths between the nodes and the base station based on the communication paths between the cluster heads and the base station may specifically include:
In an embodiment, after the determining that all nodes upload the node information to the base station following the communication paths between the nodes and the base station, the method may further include:
A clustering and routing system for a wireless sensor network includes:
In an embodiment, the initial MECPT construction module may specifically include:
The present disclosure discloses the following technical effects based on the specific embodiments provided in the present disclosure: The present disclosure provides the clustering and routing method and system for a wireless sensor network, to construct clusters in batches based on the MECPT. Cluster heads selection and cluster trees construction are performed during planning of communication paths between of nodes in the clusters and the cluster heads, and cluster heads selected in different cluster heads selection stages cluster the non-clustered nodes based on the clustering status. In this way, energy consumption of nodes near the base station is balanced, and the problem of “energy hole” is alleviated.
To describe the technical solutions in the embodiments of the present disclosure or in the prior art more clearly, the accompanying drawings required for the embodiments will be briefly described below. Apparently, the accompanying drawings described below are merely some embodiments of the present disclosure, and a common person skilled in the art may also obtain other accompanying drawings based on these accompanying drawings without creative efforts.
The technical solutions of the embodiments of the present disclosure are clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present disclosure. All other examples obtained by a person of ordinary skill in the art based on the examples of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
The object of the present disclosure is to provide a clustering and routing method and system for a wireless sensor network capable of balancing energy consumption of nodes near a base station and alleviating the problem of “energy hole”.
To make the above-mentioned objects, features, and advantages of the present disclosure clearer and more comprehensible, the present disclosure will be further described in detail below with reference to the accompanying drawings and the specific implementation.
In step 101, node information in a wireless sensor network is acquired by a base station, and an initial MECPT is constructed based on the node information, where the node information includes node positions, node energy, and node IDs.
The step 101 may specifically include: calculating weights of a connecting edges established by any two nodes based on the node information to generate a first weight matrix of the connecting edges; calculating a minimum weight communication paths from alive nodes to the base station based on the first weight matrix of the connecting edges; and using next-hop nodes of the alive nodes as parent nodes of the alive nodes based on the minimum weight communication paths from the alive nodes to the base station to construct the initial MECPT with the base station as a root node.
In step 102, first cluster head competition coefficients of nodes other than the base station in the initial MECPT are calculated, a first batch of cluster head selection and node clustering are performed, a first batch of cluster trees are constructed, the initial MECPT is updated by a first iteration process, and a first-updated MECPT is get.
The step 102 may specifically include: selecting, as a cluster head, a node corresponding to a maximum first cluster head competition coefficient within a cluster head competition coefficient threshold range; using, as a cluster tree, a subtree with the cluster head as a root node, and retaining communication paths in the cluster tree; and deleting nodes in the cluster tree and edges associated with the nodes from the current initial MECPT, and determining the first-updated MECPT.
After the deleting nodes in the first batch of cluster trees and edges associated with the nodes from the initial MECPT, and determining the first-updated MECPT, the method may further include the steps of:
Performing step 103 if the maximum first cluster head competition coefficient is less than a lower limit of the cluster head competition coefficient threshold range, a number of selected cluster heads does not reach a cluster head number threshold, and a non-clustered node still exists in the wireless sensor network;
Performing step 104 if a number of selected cluster heads exceeds the cluster head number threshold and a non-clustered node still exists in the wireless sensor network.
Performing step 106 if only the base station remains in the first-updated MECPT.
In step 103, second cluster head competition coefficients of nodes other than the base station in the first-updated MECPT are calculated, a second batch of cluster head selection and node clustering are performed, a second batch of cluster trees are constructed, the first-updated MECPT is updated by a second iteration process, and a second-updated MECPT is get.
Step 103 may specifically include: determining whether the second cluster head competition coefficients are all 0; if not, selecting, as the cluster head, a node corresponding to a maximum second cluster head competition coefficient in the second cluster head competition coefficients; using, as the cluster tree, a subtree with the cluster head as a root node, and retaining communication paths in the cluster tree; and deleting nodes in the cluster tree and edges associated with the nodes from the current first-updated MECPT, and determining the second-updated MECPT, and updating the second cluster head competition coefficients then back to the step “determining whether the second cluster head competition coefficients are all 0”; or is yes, performing step 104.
After the updating the second-updated MECPT and cluster trees to which the node in the second-updated MECPT is added, the method may further include: obtaining an updated current MECPT; and if only the base station remains in the current MECPT, performing “selecting the child nodes of the base station in the non-updated initial MECPT as relay nodes”.
In step 104, clustering competition coefficients of an existing cluster head relative to nodes other than the base station in the second-updated MECPT are calculated based on the first batch of cluster trees and the second batch of cluster trees.
In step 105, it is determined whether the clustering competition coefficients are all −∞; if yes, step 106 is performed; and if not, step 110 is performed.
In step 106, non-clustered nodes are enabled to communicate with the base station following paths in the non-updated initial MECPT, and child nodes of the base station in the non-updated initial MECPT may be selected as relay nodes.
In step 107, weights about energy consumption of communication between the cluster heads and the relay nodes are calculated.
In step 108, minimum weight paths from the cluster heads to the base station are calculated based on the weights about energy consumption of communication, the minimum weight paths are used as communication paths between the cluster heads and the base station, and the communication paths between the nodes and the base station are determined based on the communication paths between the cluster heads and the base station.
Step 108 may specifically include: obtaining estimated load values of the cluster heads or the relay nodes in a current routing state corresponding to the difference between the non-updated initial MECPT and current MECPT; calculating weights of connecting edges established by any two nodes in the current MECPT based on the estimated load values, to generate a second weight matrix of the connecting edges, where the nodes are cluster heads, relay nodes and base station in the current MECPT; and calculating the minimum weight communication paths from cluster heads to the base station based on the second weight matrix of the connecting edges.
In step 109, it is determined that all nodes upload the node information to the base station following the communication paths between the nodes and the base station.
After step 109, the method may further include: determining whether there is a cluster head and relay node whose energy is lower than an energy threshold, where the energy threshold is 50% of remaining energy of the nodes that uploads the node information to the base station in a previous round of node information transmission, the nodes include cluster heads and relay nodes; and if yes, performing step 101; or if not, performing communication following communication paths between the nodes and the base station in the previous round of node information transmission.
In step 110, the nodes in the second-updated MECPT are clustered based on the clustering competition coefficients, and each time a node in the second-updated MECPT is clustered, the second-updated MECPT and cluster tree to which the node in the second-updated MECPT is added are updated.
Based on the clustering and routing method for a wireless sensor network according to the present disclosure, another optional cluster-based routing method for a wireless sensor network according to the present disclosure may specifically include the following steps as shown in
In step S1: a base station acquires node information and the wireless sensor network is abstracted into a simple graph, where a wireless channel between any two nodes is abstracted as an edge with weight about energy consumption for unit data transmission, a path from each node to the base station is calculated through the Dijkstra algorithm, and an initial MECPT with the base station as a root node is constructed based on these paths.
In step S2, cluster head competition coefficients of the nodes are calculated based on the MECPT, a first batch of cluster head selection and node clustering are performed, a first batch of cluster trees are constructed and the current initial MECPT is updated by a first iteration process, where an updated initial MECPT is a first-updated MECPT. In the present disclosure, the MECPT and the cluster trees are always mutually exclusive, that is, the two do not contain a same vertex or edge.
In step S3: cluster head competition coefficients of nodes are calculated based on the current MECPT, a second batch of cluster head selection and node clustering are performed, a second batch of cluster trees are constructed and the current first-updated MECPT is updated by a second iteration process, where an updated first-updated MECPT is a second-updated MECPT, and each update of the MECPT is an update of the last MECPT.
In step S4, clustering competition coefficients of existing cluster heads relative to nodes other than the root node in the current MECPT are calculated based on the clustering trees constructed in step S2 and step S3; these nodes are clustered based on the clustering competition coefficients; each time a node is clustered, a current MECPT of the network and a cluster tree to which the node is added are updated; when the clustering competition coefficients of the nodes are all −∞, paths between the nodes and the base station in the non-updated initial MECPT are used as communication paths between the nodes and the base station in the wireless sensor network; or when only the base station exists in the MECPT, this step is ended, proceeding to step S5.
In step S5, child nodes of the base station in the non-updated initial MECPT are selected as relay nodes; weights about energy consumption of communication between the cluster heads and the relay nodes are calculated, the weights about energy consumption are used as weights of edges between the two nodes, minimum weight paths from the cluster heads to the base station are calculated through the Dijkstra algorithm, and the minimum weight paths are used as the communication paths between the cluster heads and the base station.
In step S6, the nodes upload data to the base station following the obtained paths; at the beginning of a next round, if there is a cluster head or relay node whose energy is lower than an energy threshold ET(i) (50% of remaining energy of the node at the beginning of a previous round), returning to step S1; otherwise, all of the alive nodes continue to communicate with the base station following the paths in the previous round.
Further, step S1 may specifically include the following steps.
In step S11, the base station broadcasts a node information acquisition request to the nodes distributed in a monitoring area of the wireless sensor network; after receiving the request, the nodes send information such as node positions, node energy, and node IDs to the base station by using a flooding method.
In step S12, the base station calculates weights of connecting edges established by any two nodes based on the acquired node information to generate a first weight matrix W, where a calculation formula for a weight of an associated edge between a node i and a node j is:
A calculation formula for a weight of an associated edge between the node i and the base station BS is:
The node i and the node j are both nodes whose remaining energy is greater than zero in the monitoring area of the current wireless sensor network, that is, alive nodes. When i=j, w(i,j)=+∞. Eelec is energy consumption for processing unit bit of data by a receiving circuit and a transmitting circuit. εmp is an attenuation coefficient of a multi-path channel transmission model, and εfs is an attenuation coefficient of a free channel transmission model. d(i,j) is a Euclidean distance between the node i and the node j, and d(i,BS) is a Euclidean distance between the node i and the base station BS. packet(i) is a predicted number of data packets that the node i needs to forward under a current routing result. d0 is a distance threshold, which is calculated as follows:
In step S13, minimum weight paths from the alive nodes to the base station are calculated by using the Dijkstra algorithm based on the weight matrix w of the connecting edges obtained in step S12.
In step S14, next-hop nodes of nodes are used as parent nodes of the nodes based on the minimum weight paths obtained in step S13, and the initial MECPT with the base station as a root node is constructed according to this rule.
In the present disclosure, as shown in
In step S21, cluster head competition coefficients of nodes other than the base station in the current MECPT is calculated, where a calculation formula for a cluster head competition coefficient of the node i in this step is:
K(i) is an aggregation betweenness of the node i, and is calculated as follows:
M(i) is the number of nodes in a subtree with the node i as a root node in the current MECPT. Nalive is the number of nodes with remaining energy greater than zero in the wireless sensor network, that is, the number of alive nodes in the network.
In step S22, a node corresponding to a maximum cluster head competition coefficient satisfying
is selected as a cluster head, and a subtree with this node as the root node in the current MECPT is taken as a cluster, which is called a cluster tree, and communication paths in the cluster tree are retained; if the maximum cluster head competition coefficient of the node in the current MECPT is less than
that is, there is no node satisfying the requirement, or the number of selected cluster heads reaches a specified cluster head number Nalive×P (P is the percentage of cluster heads), the first batch of cluster heads selection and nodes clustering are ended, and step S3 is performed; otherwise, step S23 is performed.
In step S23, nodes in the cluster trees obtained in step S22 and edges associated with the nodes deleted from the current MECPT, to obtain an updated MECPT, returning to step S21.
In the present disclosure, as shown in
In step S31, if the number of selected cluster heads is equal to or greater than Nalive×P and a non-clustered node still exists in the network, step S4 is performed; if only the base station remains in the current MECPT, step S5 is performed; otherwise, cluster head competition coefficients of nodes other than the base station in the current MECPT are calculated, where the calculation formula for the cluster head competition coefficient of the node i in step S3 is:
Where E(i) is current remaining energy of the node i; E0 is initial energy of the node; xm and ym are the width and length of a rectangular range of the wireless sensor network; d(i,BS) indicates a Euclidean distance between the node i and the base station.
In step S32, if the cluster head competition coefficients of the nodes in the current MECPT are all 0, the second batch of cluster heads selection is ended, proceeding to step S4; otherwise, a node corresponding to the maximum cluster head competition coefficient is selected as the cluster head, and a subtree with the node as the root node in the current MECPT is taken as a cluster tree, and communication paths in the cluster tree are retained, where nodes in the cluster tree form a cluster.
In step S33, the nodes in the cluster trees obtained in step S32 and edges associated with the nodes are removed from the current MECPT, to obtain an updated MECPT, returning to step S31.
In the present disclosure, as shown in
In step S41, clustering competition coefficients of nodes other than the base station in the current MECPT are calculated, where a calculation formula for a clustering competition coefficient of the cluster head CHj relative to the node i is:
Where E(CHj) is current remaining energy of the cluster head CHj; d(i,CHj) is a Euclidean distance from the node i to the cluster head CHj; and E0 is initial energy of the node.
In step S42, if the maximum clustering competition coefficient is −∞, non-clustered nodes communicate with the base station following the paths in the initial MECPT, proceeding to step S5; otherwise, a node i corresponding to the maximum clustering competition coefficient is added to a cluster of the corresponding cluster head j, a node h nearest to the node i in the cluster tree in which the cluster head j is located is found, a direct communication path between the node i and the node h is established, where the node i communicates with the cluster head through the node h; in this case, the node i is removed from the current MECPT, and the MECPT is updated.
In step S43, if only the base station remains in the current MECPT, step S5 is performed; otherwise, returning to step S41.
Further, step S5 may specifically include the following steps.
In step S51, child nodes of the base station in the initial MECPT are selected as relay nodes.
In step S52, weights of an edge between any two nodes are calculated to obtain a weight matrix W, where a calculation formula for a weight of an edge between a cluster head CHi and a cluster head CHj is:
A calculation formula for a weight of an edge between the cluster head CHi and the relay node REj is:
A calculation formula for a weight of an edge between the relay node REj and the cluster head CHi is:
A calculation formula for a weight of an edge between the relay node REi and a relay node REj is:
A calculation formula for a weight of an edge between the cluster head CHi and the base station BS is:
A calculation formula for a weight of an edge between the relay node REi and the base station BS is:
When i=j, w(i,j)=+∞. In the above formulas, load(CHi) and load(REi) are respectively loads that the cluster head CHi or the relay node REi may bear under a current routing situation.
In step S53, minimum weight communication paths from each cluster heads to the base station are obtained by using the Dijkstra algorithm based on the matrix W.
The technical solutions of the present disclosure will be further described below through specific embodiments.
As shown in Table 1, simulation parameters of the clustering and routing method for a wireless sensor network is given in Table 1. 100 nodes are randomly distributed in a monitoring area of the wireless sensor network, and the base station is located in the center of the monitoring area of the wireless sensor network.
A calculation method for the energy consumption for transmitting and receiving m bit data is as follows:
Energy consumption for transmitting m bit data is:
Energy consumption for receiving m bit data is:
ERx=Eelec×m
Energy consumption for fusing m bit data is:
Ea=EDA×m
Initialization of the network environment: 100 wireless sensor nodes are randomly and evenly distributed in a monitoring area of 500 m×500 m. Each wireless sensor node knows its own geographical position and has a unique ID; the base station is deployed in the middle of the monitoring area, with the coordinates (250, 250); the percentage P of cluster heads is 0.1.
MATLAB is used as a simulation tool, and system simulation environment parameters are set as follows:
The above parameters are not constant, and some parameters can be changed as needed for different simulation content.
In order to analyze the improvement in performance of the wireless sensor network in the present disclosure, the method proposed in the present disclosure, LEACH proposed by Wendi Rabiner et al., HGC proposed by Jocelyn Edinio Zacko Gbadouissa et al., and EC-PSO proposed by Wang J et al. are simulated under equivalent simulation conditions, and the results shown in
An initial MECPT construction module 1001 is configured to: acquire, by a base station, node information in a wireless sensor network, and construct an initial MECPT based on the node information, where the node information includes node positions, node energy, and node IDs.
The initial MECPT construction module 1001 may specifically include: a first weight matrix generation unit, configured to: calculate weights of a connecting edges established by any two nodes based on the node information to generate a first weight matrix of the connecting edges; minimum weight communication paths calculation unit, configured to calculate minimum weight communication paths from alive nodes to the base station based on the first weight matrix of the connecting edges; and an initial MECPT construction unit, configured to: use next-hop nodes of the alive nodes as parent nodes of the alive nodes based on the minimum weight communication paths from the alive nodes to the base station to construct the initial MECPT with the base station as a root node.
A first-updated MECPT determining module 1002 is configured to: calculate first cluster head competition coefficients of nodes other than the base station in the current initial MECPT, perform a first batch of cluster head selection and node clustering, construct a first batch of cluster trees and update the current initial MECPT by a first iteration process, and get a first-updated MECPT.
A second-updated MECPT determining module 1003 is configured to: calculate second cluster head competition coefficients of nodes other than the base station in the first-updated MECPT, perform a second batch of cluster head selection and node clustering, construct a second batch of cluster trees and update the first-updated MECPT by a second iteration process, and get a second-updated MECPT.
A clustering competition coefficient determining module 1004 is configured to calculate, based on the first batch of cluster trees and the second batch of cluster trees, clustering competition coefficients of an existing cluster heads relative to nodes other than the base station in the second-updated MECPT.
A first determining module 1005 is configured to determine whether the clustering competition coefficients are all −∞, to obtain a first determination result.
A relay node selection module 1006 is configured to: if the first determination result indicates that the clustering competition coefficients are all −∞, enable non-clustered nodes to communicate with the base station following paths in the initial MECPT, and select child nodes of the base station in the initial MECPT as relay nodes.
A weight about communication energy consumption calculation module 1007 is configured to calculate weights about energy consumption of communication between the cluster heads and the relay nodes.
A module 1008 for determining communication paths between nodes and the base station, configured to: calculate minimum weight paths from the cluster heads to the base station based on the weights about energy consumption of communication, use the minimum weight paths as communication paths between the cluster heads and the base station, and determine the communication paths between the nodes and the base station based on the communication paths between the cluster heads and the base station.
An upload module 1009 is configured to determine that all nodes upload the node information to the base station following the communication paths between the nodes and the base station.
An MECPT update module 1010 is configured to: if the first determination result indicates that the clustering competition coefficients are not all −∞, cluster the nodes in the second-updated MECPT based on the clustering competition coefficients, and each time a node in the second-updated MECPT is clustered, update the current second-updated MECPT and cluster tree to which the node in the second-updated MECPT is added.
The scale of wireless sensor networks is expanding, and the number and distribution range of wireless sensors in the network are also gradually expanding. The current clustering and routing methods are not suitable for large-scale wireless sensor networks. In view of the large-scale wireless sensor networks, the present disclosure proposes the clustering and routing method and system for a wireless sensor network, to alleviate the energy hole of the wireless sensor network, prolong the network lifetime, increase the network throughput, and reduce the network packet loss rate.
Each example of the present specification is described in a progressive manner, each example focuses on the difference from other examples, and the same and similar parts between the examples may refer to each other. Since the system disclosed in the embodiments corresponds to the method disclosed in the embodiments, the description is relatively simple, and reference can be made to the method descriptions.
In this specification, several specific embodiments are used for illustration of the principles and implementations of the present disclosure. The description of the foregoing embodiments is used to help illustrate the method of the present disclosure and the core ideas thereof. In addition, those of ordinary skill in the art can make various modifications in terms of specific implementations and the scope of application in accordance with the ideas of the present disclosure. In conclusion, the content of this specification shall not be construed as a limitation to the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
202110481436.7 | Apr 2021 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
20200367133 | Matsuura | Nov 2020 | A1 |
Entry |
---|
“Liu, WSN Clustering Method Routing on Bottle Sea Sheath Algorithm Optimization, Dec. 23, 2022, CN 112954763” (Year: 2021). |
“Huang, Method and System for Maximizing Wireless Charging Vehicle Utilization Rate Based on Multiple Threshold Values, May 14, 2021, CN 112803550” (Year: 2021). |
“Gao, A Synergism Campaign Based on Individual Wireless Self-organizing Network Communication Method, Apr. 26, 2019, CN 109688616” (Year: 2018). |
Number | Date | Country | |
---|---|---|---|
20220369200 A1 | Nov 2022 | US |