A networking method and system for monitoring devices, an electronic device and a storage medium
By determining the number of cluster heads and the time-division multiple access mechanism in wireless sensor networks, and rationally allocating time slots and data merging, the energy loss problem caused by node death is solved, and the lifespan of the sensor network is extended.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UHV CO OF STATE GRID NINGXIA ELECTRIC POWER CO LTD
- Filing Date
- 2022-12-13
- Publication Date
- 2026-07-07
AI Technical Summary
In harsh environments, node death in wireless sensor networks leads to increased energy consumption and a shortened lifespan, making the extension of WSN lifespan a hot research topic.
The number of cluster heads is determined by the number of surviving nodes and the total number of nodes. Clustering is performed, and cluster head nodes are determined by election thresholds and random values. Time slots are allocated using a time-division multiple access mechanism. Cluster head nodes merge and send monitoring data to the aggregation node, reducing the energy consumption of nodes directly sending data to the aggregation node.
It effectively saves energy consumption of sensor networks, extends the lifespan of sensor networks, and avoids energy loss caused by unreasonable node distribution.
Smart Images

Figure CN116634525B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of equipment monitoring technology, and in particular to a networking method, system, electronic device and storage medium for monitoring equipment. Background Technology
[0002] Ultra-high voltage direct current (UHVDC) transmission technology is a more economical and effective means of solving the problem of large-capacity, long-distance power transmission. It will play an increasingly important role in the large-scale development of renewable energy and the construction of the energy internet. How to promptly and effectively detect various potential equipment malfunctions (such as exceeding limits in temperature, pressure, torque, and minor leakage current of key components in converter valves, as well as abnormal operating conditions like leaks in valve tower cooling pipes) and provide reliable analytical judgment for converter valve operators to prevent accidents from occurring or escalating is a crucial issue that urgently needs serious research and resolution.
[0003] The emergence of Wireless Sensor Networks (WSNs) has driven the development of key parameters and fault diagnosis technologies for converter valves. WSNs are used for the acquisition, fusion, and transmission of converter valve data. Sensor nodes collect the sensed data and transmit it to a convergence node, which then sends it to a management node or user.
[0004] When nodes in a WSN begin to die, manual battery replacement is extremely difficult due to the unique and harsh characteristics of its environment. The chain reaction triggered by the death of a single node also exacerbates the energy consumption of the entire network, causing the WSN's lifespan to decline exponentially. Therefore, how to extend the WSN's lifespan by optimizing clustering algorithms and rationally distributing nodes has become a hot research topic. Optimizing routing algorithms is currently an effective energy-saving method to reduce the energy consumption of WSN nodes. Summary of the Invention
[0005] In view of this, the present invention provides a networking method, system, electronic device, and storage medium for monitoring equipment. The aim is to save energy consumption in sensor networks and extend their lifespan.
[0006] In a first aspect of the present invention, a method for networking monitoring devices is provided, the method comprising:
[0007] The number of cluster heads is determined based on the number of surviving nodes and the total number of nodes;
[0008] Based on the number of cluster heads, the nodes are clustered to obtain the clustering results;
[0009] Determine the election threshold for each node and generate a corresponding random value for each node;
[0010] The cluster head node is determined by comparing the random value corresponding to the node with the election threshold corresponding to the node.
[0011] The cluster head node allocates corresponding time slots to each node in the cluster to which it belongs through the time division multiple access mechanism, so as to control each node in the cluster to which it belongs to send monitoring data to the cluster head node in its respective time slot;
[0012] The cluster head node merges the monitoring data sent by each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node, which then sends it to the base station.
[0013] Optionally, the step of clustering the nodes according to the number of cluster heads to obtain clustering results includes:
[0014] The number of clusters is determined based on the number of cluster heads;
[0015] Each node obtains its own location coordinates and sends them to the aggregation node;
[0016] The aggregation node performs clustering on each node according to its own location coordinates and the number of clusters, and obtains the clustering results.
[0017] Optionally, the aggregation node performs clustering on each node according to its own location coordinates and the number of clusters, obtaining the clustering result, including:
[0018] Step 1: The wireless sensor network randomly selects one node from all nodes as the initial cluster center;
[0019] Step 2: Calculate the distance between each node and the nearest cluster center based on the location coordinates of each node;
[0020] Step 3: Determine the probability that each node will be identified as the next cluster center based on the distance;
[0021] Step 4: Select the next cluster center according to the probability and preset rules;
[0022] Step 5: Determine the number of cluster centers. If the number of cluster centers is less than the number of clusters, proceed to Step 2; if the number of cluster centers is equal to the number of clusters, proceed to Step 6.
[0023] Step 6: Based on the distance between each node and each cluster center, and using the first preset algorithm and preset constraints, assign each node to the cluster category to which the corresponding cluster center belongs;
[0024] Step 7: Determine the objective function of the current round of clustering results. When the objective function converges, obtain the target clustering result and end the clustering. When the objective function does not converge, update the cluster centers using the second preset algorithm and execute Step 2.
[0025] Optionally, step 2: calculating the distance between each node and the nearest cluster center based on the location coordinates of each node, including:
[0026] The corrected weights are determined based on the environmental transmission medium between each node and the nearest cluster center;
[0027] Based on the corrected weights and the node's position coordinates, calculate the distance between the node and the nearest cluster center.
[0028] Optionally, determine the election threshold for each node, including:
[0029] The correction function for the election threshold is determined based on the node's remaining energy, the node farthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node.
[0030] The election threshold for nodes is determined based on the correction function.
[0031] Optionally, step 6: Based on the distance between each node and each cluster center, and using a first preset algorithm and preset constraints, assign each node to the cluster category to which the corresponding cluster center belongs, including:
[0032] Based on the distances of each node to its respective cluster center, the weight matrix of each node is determined using a first preset algorithm, which is as follows:
[0033]
[0034] Among them, C i X represents the coordinates of the i-th cluster center; j Let C be the position coordinates of the j-th node; m W represents the coordinates of the cluster centers other than the i-th cluster center; ij Let be the weight matrix of node j under the i-th cluster center;
[0035] Based on the weight matrix of each node and preset constraints, each node is assigned to the cluster category to which its corresponding cluster center belongs. The preset constraints are as follows:
[0036] W ij =1j=1,2,...N
[0037] Where N is the total number of nodes sending monitoring data to the cluster head.
[0038] Optionally, step 7: determine the objective function of the current round of clustering results; when the objective function converges, obtain the target clustering result and end the clustering; when the objective function does not converge, update the cluster centers using a second preset algorithm and execute step 2, including:
[0039] The objective function for the clustering results is determined as follows:
[0040]
[0041] Among them, J i Let K be the objective function for clustering the i-th cluster center, K be the number of clusters, and C be the objective function for clustering the i-th cluster center. j The coordinates of the cluster center of the cluster category to which the j-th node belongs;
[0042] By comparing the objective function of the current round of clustering results with the objective function of the previous round of clustering results, it can be determined whether the objective function of the current round of clustering results has converged.
[0043] When the objective function of the current round of clustering converges, the current round of clustering result is determined as the target clustering result;
[0044] If the objective function of the current round of clustering results has not converged, the cluster centers are updated using a second preset algorithm, and step 2 is executed. The second preset algorithm is:
[0045]
[0046] Among them, C i Let be the coordinates of the i-th cluster center.
[0047] Optionally, the cluster head node merges the monitoring data received from each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node, which then sends it to the base station, including:
[0048] The target transmission method is determined based on the distance between the cluster head node and the sink node and the environmental transmission medium.
[0049] The cluster head node merges the monitoring data sent by each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node through a determined target transmission method, and then sends it to the base station through the aggregation node.
[0050] In a second aspect of the present invention, a networking system for monitoring devices is provided, such as... Figure 3 As shown, the system includes:
[0051] The cluster head number determination module is used to determine the number of cluster heads based on the number of surviving nodes and the total number of nodes;
[0052] The clustering module is used to cluster nodes according to the number of cluster heads and obtain clustering results;
[0053] The election threshold and random value determination module is used to determine the election threshold for each node and generate a corresponding random value for each node.
[0054] The cluster head node determination module is used to determine the cluster head node among the nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node.
[0055] The first monitoring data transmission module is used by the cluster head node to allocate corresponding time slots to each node in the cluster to which the cluster head node belongs through the time division multiple access mechanism, so as to control each node in the cluster to which the cluster head node belongs to send monitoring data to the cluster head node in its respective time slot;
[0056] The second monitoring data transmission module is used by the cluster head node to merge the monitoring data sent by each node in the cluster to which the cluster head node belongs, and send the merged monitoring data to the aggregation node, which then sends it to the base station.
[0057] In a third aspect of the present invention, the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0058] Memory, used to store computer programs;
[0059] When a processor executes a program stored in a memory, it implements the steps of a networking method for a monitoring device as described in the first aspect of the present invention.
[0060] In a fourth aspect of the present invention, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a networking method for a monitoring device as described in the first aspect of the present invention.
[0061] Compared with prior art, the present invention has the following advantages:
[0062] This invention provides a networking method for monitoring equipment, which involves determining the number of cluster heads based on the number of surviving nodes and the total number of nodes; clustering the nodes according to the number of cluster heads to obtain clustering results; determining the election threshold for each node and generating a corresponding random value for each node; determining the cluster head nodes among the nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node; allocating corresponding time slots to each node in the cluster to which the cluster head node belongs through a time division multiple access mechanism to control each node in the cluster to send monitoring data to the cluster head node within its respective time slot; merging the monitoring data received from each node in the cluster to which the cluster head node belongs and sending the merged monitoring data to a convergence node, which then sends it to the base station. This invention discloses a networking method for monitoring devices. Sensor nodes are clustered by determining a reasonable number of cluster heads. Cluster head nodes are selected from each cluster based on an election threshold for each node. Each node sends its collected monitoring data to the cluster head node in its respective cluster. The cluster head node then merges the received monitoring data and sends it to a convergence node, which in turn sends it to the final base station. Thus, by selecting cluster head nodes from the clusters and unifying the data before sending it to the convergence node, individual nodes do not need to send their collected data to the convergence node. This effectively saves energy consumption and extends the lifespan of the sensor network.
[0063] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0065] Figure 1 A flowchart illustrating a networking method for monitoring equipment provided in an embodiment of the present invention;
[0066] Figure 2 This is a node interaction diagram in a networking method for monitoring equipment provided in an embodiment of the present invention;
[0067] Figure 3 This is a schematic diagram of a network system for monitoring equipment provided in an embodiment of the present invention. Detailed Implementation
[0068] Exemplary embodiments of the present invention will now be described in more detail with reference to the accompanying drawings.
[0069] Before describing this invention, let's first discuss the background technology. When nodes in a WSN begin to die, manual battery replacement is extremely difficult due to the unique and harsh characteristics of its environment. The chain reaction triggered by the death of a single node also exacerbates the energy consumption of the entire network, and the WSN's lifespan decreases exponentially. Therefore, how to extend the lifespan of a WSN by optimizing clustering algorithms and rationally distributing nodes has become a hot research topic.
[0070] Unlike base stations, ordinary sensor nodes cannot be replenished in a timely manner and rely on dry cell batteries for power. Since WSNs typically operate at the edge of the smart grid, battery replacement is extremely difficult once the network is operational. Ordinary nodes consume energy during information collection, data fusion, communication, and sleep processes, with the most significant energy loss occurring during communication. Premature failure of WSN nodes poses a major challenge to monitoring converter valve status information. Ensuring the long-term stable operation of WSNs in the smart grid has become an urgent problem to be solved.
[0071] To further improve the lifespan of WSNs in smart grids, increasing network coverage and balancing node distribution are crucial. This is because an unreasonable node distribution can lead to monitoring gaps or overlaps, resulting in energy loss. Therefore, this invention proposes a networking method for monitoring devices to save sensor network energy consumption and extend sensor network lifespan.
[0072] Figure 1 A flowchart illustrating a networking method for monitoring equipment provided in an embodiment of the present invention is shown below. Figure 1 As shown, the method includes:
[0073] Step S101: Determine the number of cluster heads based on the number of surviving nodes and the total number of nodes;
[0074] Step S102: Based on the number of cluster heads, cluster the nodes to obtain the clustering results;
[0075] Step S103: Determine the election threshold for each node and generate a corresponding random value for each node;
[0076] Step S104: Determine the cluster head node among all nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node;
[0077] Step S105: The cluster head node allocates corresponding time slots to each node in the cluster to which it belongs through the time division multiple access mechanism, so as to control each node in the cluster to which it belongs to send monitoring data to the cluster head node in its respective time slot;
[0078] Step S106: The cluster head node merges the monitoring data sent by each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node, which then sends it to the base station.
[0079] In embodiments of this invention, the monitoring data collected by each sensor is sent to a cluster head node, which then merges the received monitoring data and sends it to a convergence node, which in turn sends it to the final base station. This saves energy consumption in the wireless sensor network and extends its lifespan. However, in practical operation, some sensor nodes in a wireless sensor network may fail. When some sensor nodes fail, the number of sensor nodes in the network decreases. If the data merging process continues with all the initial cluster head nodes, the number of cluster head nodes becomes excessive relative to the reduced number of sensor nodes, thus increasing energy consumption. Therefore, this invention determines the number of cluster head nodes by considering both the total number of nodes and the number of surviving nodes. The number of cluster head nodes is appropriately reduced when the percentage of surviving nodes decreases. In this invention, all nodes mentioned subsequently refer to sensor nodes, specifically surviving nodes in the wireless sensor network, and all cluster heads refer to cluster head nodes.
[0080] Specifically, the number of cluster heads in a wireless sensor network is determined based on the percentage between the number of surviving nodes and the initial total number of nodes in the network. The number of cluster heads is determined using the following formula:
[0081]
[0082] Where K represents the number of cluster heads, and q represents the percentage between the number of surviving nodes in the wireless sensor network and the initial total number of nodes in the wireless sensor network.
[0083] In embodiments of the present invention, after determining the number of cluster head nodes, the wireless sensor network is clustered based on this number to obtain clustering results. The number of clusters is the same as the number of cluster head nodes. For example, if the number of cluster head nodes in the wireless sensor network is determined to be 5, then all surviving nodes in the wireless sensor network are clustered into 5 categories.
[0084] After obtaining the clustering results, a cluster head node is determined for each cluster.
[0085] Specifically: An election threshold is determined for each node in the wireless sensor network, and a random value is generated for each node. After obtaining the random value and election threshold for each node, the node's own random value is compared with the election threshold. If a node's random value is less than its own election threshold, that node is selected as the cluster head in its respective cluster category. The random value is a number randomly generated between 0 and 1.
[0086] For example, clusters 1, 2, 3, 4, and 5 are obtained by clustering the wireless sensor network. An election threshold is calculated and a random value is determined for each node in the wireless sensor network. It is determined that the random value of node A is less than the election threshold for node A, and node A belongs to cluster 1. Therefore, node A is determined as the cluster head node in cluster 1, where only one cluster head node is elected in each cluster.
[0087] In embodiments of the present invention, such as Figure 2 As shown, after the cluster head nodes in each cluster are determined, each node sends the monitoring data it has collected to the cluster head node in its respective cluster. The cluster head node then merges the monitoring data sent by each node in its own cluster and sends it to the aggregation node, which then sends it to the final base station.
[0088] In embodiments of the present invention, to avoid conflicts arising from message transmission between nodes within and between clusters, each cluster head node in the present invention uses a Time Division Multiple Access (TDMA) mechanism to allocate corresponding time slots to each node in each cluster. Each node works within its own time slot, that is, each sensor node collects monitoring data and sends it to its corresponding cluster head node in its own time slot, and enters a sleep state at other times to reduce energy consumption. At the same time, it can also effectively avoid conflicts arising from message transmission between nodes within and between clusters.
[0089] This invention provides a networking method for monitoring equipment, which involves determining the number of cluster heads based on the number of surviving nodes and the total number of nodes; clustering the nodes according to the number of cluster heads to obtain clustering results; determining the election threshold for each node and generating a corresponding random value for each node; determining the cluster head nodes among the nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node; allocating corresponding time slots to each node in the cluster to which the cluster head node belongs through a time division multiple access mechanism to control each node in the cluster to send monitoring data to the cluster head node within its respective time slot; merging the monitoring data received from each node in the cluster to which the cluster head node belongs and sending the merged monitoring data to a convergence node, which then sends it to the base station. This invention discloses a networking method for monitoring devices. Sensor nodes are clustered by determining a reasonable number of cluster heads. Cluster head nodes are selected from each cluster based on an election threshold for each node. Each node sends its collected monitoring data to the cluster head node in its respective cluster. The cluster head node then merges the received monitoring data and sends it to a convergence node, which in turn sends it to the final base station. Thus, by selecting cluster head nodes from the clusters and unifying the data before sending it to the convergence node, individual nodes do not need to send their collected data to the convergence node. This effectively saves energy consumption and extends the lifespan of the sensor network.
[0090] In this invention, the step of clustering nodes according to the number of cluster heads to obtain clustering results includes: determining the number of clusters according to the number of cluster heads; each node obtaining its own location coordinates and sending them to the aggregation node; the aggregation node performing the required number of clusters on each node according to its own location coordinates and the number of clusters, and obtaining clustering results.
[0091] In embodiments of the present invention, the number of cluster categories is the same as the number of determined cluster head nodes; the number of cluster categories is determined simultaneously with the number of cluster head nodes. After the number of cluster categories is determined, the wireless sensor network is initialized. Each node in the initialized wireless sensor network acquires its own location coordinates and sends these coordinates to the sink node. The sink node assigns a unique network ID to each node, distinguishing each node based on its respective network ID. After obtaining the location coordinates of each node and the number of cluster categories, the sink node clusters each node based on these coordinates and the number of cluster categories to form the corresponding number of cluster categories.
[0092] In this invention, the aggregation node clusters each node according to its location coordinates and the number of clusters, obtaining clustering results. This includes: Step 1: The wireless sensor network randomly selects one node from all nodes as the initial cluster center; Step 2: Calculates the distance between each node and the nearest cluster center based on the location coordinates of each node; Step 3: Determines the probability that each node will be selected as the next cluster center based on the distance; Step 4: Selects the next cluster center according to the probability using a preset rule; Step 5: Determines the number of cluster centers. If the number of cluster centers is less than the number of clusters, proceed to Step 2; if the number of cluster centers equals the number of clusters, proceed to Step 6; Step 6: Based on the distance between each node and each cluster center, assigns each node to the corresponding cluster category using a first preset algorithm and preset constraints; Step 7: Determines the objective function for the current round of clustering results. When the objective function converges, the target clustering result is obtained, and clustering ends. If the objective function does not converge, the cluster centers are updated using a second preset algorithm, and Step 2 is executed.
[0093] In an embodiment of the present invention, the aggregation node performs clustering on each node according to its own location coordinates and the number of clusters, thereby obtaining the clustering result, specifically including:
[0094] Step 1: The wireless sensor network randomly selects one node from all nodes as the initial cluster center.
[0095] Step 2: Calculate the distance between each node and its nearest cluster center based on the node's coordinates. Initially, since there is only one initial cluster center, the distance between each node and that initial cluster center is calculated using the node's coordinates. However, as the clustering process continues, the number of cluster centers increases, and the initial cluster center is no longer the sole determining factor. At this point, the distance between each node and its nearest cluster center is calculated based on the node's coordinates.
[0096] Step 3: Based on the calculated distances from each node to its nearest cluster center, determine the probability that each node will be identified as the next cluster center. The specific calculation formula is as follows:
[0097]
[0098] Where P represents the probability that node x is determined as the next cluster center, and D(x) represents the distance between node x and its nearest cluster center.
[0099] Step 4: Based on the calculated probability that each node is determined as the next cluster center, select the next cluster center using preset rules. One preferred implementation of the preset rules is the roulette wheel method.
[0100] Step 5: Determine the number of cluster centers. If the number of cluster centers is less than the number of clusters, it is determined that the number of currently determined cluster centers is insufficient, and more cluster centers need to be determined. In this case, return to Step 2 to continue determining new cluster centers. When the number of cluster centers equals the number of clusters, it is determined that the number of currently determined cluster centers is just right, the determination of cluster centers ends, and proceed to Step 6.
[0101] Step 6: After obtaining the corresponding number of cluster centers, calculate the distance between each node and each cluster center. That is, for any node other than the cluster center nodes, calculate the distance between that node and each cluster center. After obtaining the distances between each node and each cluster center, based on these distances, use the first preset algorithm and preset constraints to assign each node to the cluster category belonging to the corresponding cluster center, thus completing the clustering process.
[0102] In this invention, step 6: assigning each node to the cluster category of its corresponding cluster center based on the distance between each node and each cluster center using a first preset algorithm and preset constraints, includes: determining the weight matrix of each node based on the distance between each node and each cluster center using a first preset algorithm, wherein the first preset algorithm is:
[0103]
[0104] Among them, C i X represents the coordinates of the i-th cluster center; j Let C be the position coordinates of the j-th node; m W represents the coordinates of the cluster centers other than the i-th cluster center; ij Let be the weight matrix of node j under the i-th cluster center;
[0105] Based on the weight matrix of each node and preset constraints, each node is assigned to the cluster category to which its corresponding cluster center belongs. The preset constraints are as follows:
[0106] W ij =1j=1,2,...N
[0107] Where N is the total number of nodes sending monitoring data to the cluster head.
[0108] In an embodiment of the present invention, step 6 specifically includes: determining the weight matrix of each node based on the calculated distances between each node and each cluster center using the first preset algorithm of the present invention. The first preset algorithm is as follows:
[0109]
[0110] Among them, C i X represents the coordinates of the i-th cluster center; j Let C be the position coordinates of the j-th node; m W represents the coordinates of the cluster centers other than the i-th cluster center; ij Let be the weight matrix of node j under the i-th cluster center.
[0111] The first preset algorithm calculates that the weight matrix of the j-th node is 1 only when its distance to the i-th cluster center is the closest. When the distance between the j-th node's position coordinates and the i-th cluster center's position coordinates is not the closest, its weight matrix is 0.
[0112] After calculating the weight matrix of each node using the first preset algorithm, each node is assigned to the cluster category to which its corresponding cluster center belongs, based on the weight matrix of each node and preset constraints. The preset constraints are as follows:
[0113] W ij =1j=1,2,...N
[0114] Where N is the total number of nodes sending monitoring data to the cluster head.
[0115] The weight matrix of the j-th node is evaluated using the preset constraints. When the weight matrix between the j-th node and the i-th cluster center is 1, the j-th node is determined to be closest to the i-th cluster center, and the j-th node is then assigned to the cluster corresponding to the i-th cluster center. In this way, the first preset algorithm and preset constraints determine the cluster center corresponding to each node, and each cluster center corresponds to a specific cluster category, thus completing the clustering of all nodes.
[0116] For example, the cluster centers include cluster center 1, cluster center 2, and cluster center 3; cluster center 1 corresponds to a cluster category 1, cluster center 2 corresponds to a cluster category 2, and cluster center 3 corresponds to a cluster category 3; in addition to cluster centers 1, 2, and 3, the nodes include nodes 1, 2, 3, 4, 5, 6, 7, and 8; the weight matrix W corresponding to node 1 and cluster center 2 is calculated using the aforementioned first preset algorithm and preset constraints. 21The value is set to 1, therefore node 1 is determined to belong to cluster category 2 corresponding to cluster center 2, and node 1 is assigned to cluster category 2; the weight matrix W corresponding to node 2 and cluster center 2 is calculated using the first preset algorithm and preset constraints. 22 The value is set to 1, therefore node 2 is determined to belong to cluster category 2 corresponding to cluster center 2, and node 2 is assigned to cluster category 2; the weight matrix W corresponding to node 3 and cluster center 1 is determined by calculating using the first preset algorithm and preset constraints. 13 The value is set to 1, therefore node 3 is determined to belong to cluster category 1 corresponding to cluster center 1, and node 3 is assigned to cluster category 1; the weight matrix W corresponding to node 4 and cluster center 1 is determined by calculating using the first preset algorithm and preset constraints. 14 The value is set to 1, therefore node 4 is determined to belong to cluster category 1 corresponding to cluster center 1, and node 1 is assigned to cluster category 1; the weight matrix W corresponding to node 5 and cluster center 3 is determined by calculating using the first preset algorithm and preset constraints. 35 The value is set to 1, therefore node 5 is determined to belong to cluster category 3 corresponding to cluster center 3, and node 5 is assigned to cluster category 3; the weight matrix W corresponding to node 6 and cluster center 1 is determined by calculating using the first preset algorithm and preset constraints. 16 The value is set to 1, therefore node 6 is determined to belong to cluster category 1 corresponding to cluster center 1, and node 6 is assigned to cluster category 1; the weight matrix W corresponding to node 7 and cluster center 3 is calculated using the first preset algorithm and preset constraints. 37 The value is set to 1, therefore node 7 is determined to belong to cluster category 3 corresponding to cluster center 3, and node 7 is assigned to cluster category 3; the weight matrix W corresponding to node 8 and cluster center 2 is determined by calculating using the first preset algorithm and preset constraints. 28 The value is 1, therefore node 8 is determined to belong to cluster category 2 corresponding to cluster center 2, and node 8 is assigned to cluster category 2.
[0117] Step 7: After obtaining the corresponding clustering results from Step 6, determine whether the objective function of the clustering results has converged. If it has converged, end the clustering process. If it has not converged, update the cluster centers using the second preset algorithm, and return to Step 2 to continue a new round of clustering.
[0118] In this invention, step 7: determining the objective function of the current round of clustering results; obtaining the target clustering result when the objective function converges and ending the clustering; updating the cluster centers using a second preset algorithm when the objective function does not converge, and executing step 2, including:
[0119] The objective function for the clustering results is determined as follows:
[0120]
[0121] Among them, J i Let K be the objective function for clustering the i-th cluster center, K be the number of clusters, and C be the objective function for clustering the i-th cluster center. j The coordinates of the cluster center of the cluster category to which the j-th node belongs;
[0122] By comparing the objective function of the current round of clustering results with the objective function of the previous round of clustering results, it can be determined whether the objective function of the current round of clustering results has converged.
[0123] When the objective function of the current round of clustering converges, the current round of clustering result is determined as the target clustering result;
[0124] If the objective function of the current round of clustering results has not converged, the cluster centers are updated using a second preset algorithm, and step 2 is executed. The second preset algorithm is:
[0125]
[0126] Among them, C i Let be the coordinates of the i-th cluster center.
[0127] In an embodiment of the present invention, after obtaining the clustering result of the current round, the objective function of the clustering result is determined, and the objective function is:
[0128]
[0129] Among them, J i Let K be the objective function for clustering the i-th cluster center, K be the number of clusters, and C be the objective function for clustering the i-th cluster center. j The coordinates are the location of the cluster center of the cluster category to which the j-th node belongs.
[0130] When the objective function corresponding to the current round of clustering results is obtained, the difference between the objective function corresponding to the current round of clustering results and the objective function corresponding to the previous round of clustering results is calculated. If the difference is less than or equal to a set threshold ε, the objective function corresponding to the current round of clustering results is considered to have converged. At this point, the current round of clustering results is considered to meet the requirements, and the current round of clustering results is taken as the final target clustering result. The set threshold ε is preferably 0.02. It should be understood that this set threshold ε is only a preferred value and is not a limitation of the invention. Depending on the actual usage requirements, the set threshold ε can also take other values. When the current round of clustering results is the first round of clustering, there is no previous round of clustering results for comparison. In this case, it can be determined that the first round of clustering results will not converge, and a second round of clustering is required. The calculation formula for determining whether the objective function has converged is as follows:
[0131] J n-1 -J n ≤ε
[0132] Among them, J n-1 J is the objective function corresponding to the clustering results of the current round. n Let be the objective function corresponding to the clustering result of the previous round in the current round. When the difference between the two is less than or equal to ε, the clustering result of the current round is considered to have converged.
[0133] When the difference exceeds the set threshold ε, it is determined that the objective function corresponding to the current round of clustering results has not converged. In this case, the clustering result does not meet the requirements, and a new round of clustering is needed. At this point, the cluster centers are updated using a second preset algorithm, resulting in multiple cluster centers equal to the number of cluster head nodes. After obtaining multiple cluster centers equal to the number of cluster head nodes, the process returns to step 2 for a new round of clustering. The second preset algorithm is as follows:
[0134]
[0135] Among them, C i Let be the coordinates of the i-th cluster center. The coordinates of i will range from 1 to K, meaning we will eventually obtain the updated K cluster centers.
[0136] In this invention, step 2, calculating the distance between each node and the nearest cluster center based on the position coordinates of each node, includes: determining a correction weight based on the environmental transmission medium between each node and the nearest cluster center; and calculating the distance between the node and the nearest cluster center based on the correction weight and the position coordinates of the node.
[0137] In embodiments of this invention, it is found that during the transmission of collected monitoring data by sensor nodes, factors affecting energy consumption are not only related to the data transmission distance, but also to the environmental transmission medium during transmission. Therefore, this invention introduces a correction weight based on the environmental transmission medium when calculating the distance between a node and the nearest cluster center. Different environmental transmission media correspond to different correction weights, and there is a one-to-one correspondence between the environmental transmission medium and the correction weight. At the start of network operation, all nodes have the same initial energy, and the selection of cluster heads is mainly controlled by the distance between the node and the base station. As the operating cycle increases, the imbalance in node energy consumption begins to appear. Therefore, it is necessary to increase the weight of the remaining energy in the threshold correction function to achieve better network energy efficiency.
[0138] Specifically, based on the actual physical distance, the cluster center closest to the node is selected from all cluster centers. For this cluster center, the environmental transmission medium between the node and the cluster center is determined. Based on this environmental transmission medium, a correction weight corresponding to the environmental transmission medium is determined, and then based on the following formula:
[0139] ′
[0140] D(X)=W*D(X)
[0141] The distance between a node and its cluster center is calculated; this distance is actually a corrected distance. Here, W represents the corrected weight corresponding to the environmental transmission medium, and D(X) is the physical distance between node X and its closest physical cluster center.
[0142] In this embodiment, another implementation of the present invention for determining the probability of each node being identified as the next cluster center is as follows: The probability of a node being identified as the next cluster center is calculated based on the corrected distance between the node and its closest physically located cluster center. Specifically, the probability of a node being identified as the next cluster center is calculated based on the following formula:
[0143]
[0144] In this invention, determining the election threshold for each node includes: determining a correction function for the election threshold based on the node's remaining energy, the node furthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node; and determining the election threshold for the node based on the correction function.
[0145] In embodiments of this invention, determining a node as a cluster head node is to select a node capable of receiving monitoring data from all nodes in the cluster to which the cluster head node belongs, merging the obtained monitoring data, and sending it to the aggregation node. Therefore, the suitability of determining a cluster head node directly affects the energy consumption and lifespan of the wireless sensor network. This invention finds that the cluster head node, as a summary node receiving monitoring data from various nodes, requires more energy than other nodes, and the data transmission distance between nodes also affects energy consumption. Therefore, to ensure the rationality of the elected cluster head node and improve the lifespan of the wireless sensor network, this invention proposes to elect the cluster head node based on both the node's remaining energy and the distance between nodes. Furthermore, when merging monitoring data, the cluster head node deletes duplicate monitoring data.
[0146] Specifically, a correction function for the election threshold is determined based on the node's remaining energy, the node furthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node. The correction function is as follows:
[0147]
[0148] Among them, E ini (n) represents the initial energy of node n; E res D(n) represents the remaining energy of node n; D(n) is the distance between node n and the sink node; D max (n) is the distance between the node farthest from the convergence node in the cluster to which node n belongs; D min (n) is the distance to the nearest node to the convergence node in the cluster to which node n belongs; λ(r) is the adjustment factor.
[0149] The formula for the adjustment factor is as follows:
[0150]
[0151] Where r is the number of election rounds for the cluster head node. Each complete process of transmitting, merging, and sending monitoring data to the base station in a wireless sensor network is called a round. Each round of monitoring data transmission requires the re-election of the cluster head node, and each re-election of the cluster head node is called a round of cluster head node election; e represents the Euler number.
[0152] After obtaining the correction function for the election threshold, the election threshold for each node is calculated using the election threshold calculation formula, which is as follows:
[0153]
[0154] Where p is the probability that sensor node n is elected as the cluster head node; G is the set of nodes that have not become cluster heads in the remaining rounds; r is the current round number; ω(n) is the correction function of the election threshold with the addition of the remaining energy factor and the distance factor.
[0155] In this invention, the cluster head node merges the monitoring data received from each node in its cluster and sends the merged monitoring data to the aggregation node, which then transmits it to the base station. This includes: determining a target transmission method based on the distance between the cluster head node and the aggregation node and the environmental transmission medium; the cluster head node merging the monitoring data received from each node in its cluster and sending the merged monitoring data to the aggregation node using the determined target transmission method, which then transmits it to the base station.
[0156] In an embodiment of this invention, in the LEACH protocol, cluster head nodes do not consider their distance from the sink node. Cluster head nodes in a cluster farther from the sink node will exhaust their energy earlier. If single-hop routing is used to directly send information to the sink node, cluster head nodes will consume more energy when they are far from the sink node, accelerating their demise. To reduce the energy consumption of single-hop routing and improve network performance, this algorithm establishes a multi-hop transmission path channel between the cluster head and the sink node for data forwarding, thereby reducing the energy consumption of distant cluster heads. After clustering, the protocol selects relay nodes for cluster head nodes far from the sink node by considering factors such as cluster head node identity, node distance, and remaining energy. These cluster head nodes far from the sink node send merged monitoring data to the relay nodes, which then send the received merged monitoring data from these cluster head nodes to the sink node. This reduces the energy consumption of cluster head nodes far from the sink node, slows their demise, and extends the lifespan of the wireless sensor network. The relay nodes include some cluster head nodes that are relatively close to the sink node.
[0157] Specifically, the predicted energy consumption for the cluster head node to send the merged monitoring data to the sink node is determined based on the distance between the cluster head node and the sink node and the environmental transmission medium. When the predicted energy consumption exceeds a set threshold, the target transmission mode for the cluster head node to send the merged monitoring data to the sink node is determined to be multi-hop transmission, that is, the monitoring data merged by the cluster head node is sent to the sink node through relay nodes. When the target transmission mode corresponding to a cluster head node is multi-hop transmission, at least one relay node is included. Simultaneously, to avoid collisions, each cluster head node uses a collision-avoiding carrier-aware multiple access mechanism to send the merged monitoring data to the sink node. When the predicted energy consumption does not exceed the set threshold, the target transmission mode for the cluster head node to send the merged monitoring data to the sink node is determined to be single-hop transmission, that is, the cluster head node directly sends its own merged monitoring data to the sink node.
[0158] In embodiments of the present invention, to improve the election efficiency of cluster head nodes, the present invention first detects the remaining energy of each node before each round of cluster head node election, calculates the average remaining energy of nodes in each cluster category as a unit, and then uses the average remaining energy of nodes in each cluster category as a criterion to filter out nodes in each cluster category that have an average remaining energy higher than that of their respective cluster categories. These nodes are then used as the cluster head node set for subsequent elections of cluster head nodes in their respective cluster categories. In other words, subsequent elections of cluster head nodes in each cluster category are conducted only within the cluster head node set of each cluster category, and the elected nodes are used as the cluster head nodes in their respective cluster categories.
[0159] For example, the clustering categories include clustering category 1, clustering category 2, and clustering category 3. Clustering category 1 includes nodes 11, 12, 13, and 14; clustering category 2 includes nodes 21, 22, 23, 24, and 25; and clustering category 3 includes nodes 31, 32, 33, 34, 35, and 36. By calculating the remaining energy of nodes 11, 12, 13, and 14, the average remaining energy A of the nodes is obtained. Then, the remaining energy of nodes 11, 12, 13, and 14 is compared with this average remaining energy A. It is determined that the remaining energy of nodes 11 and 12 exceeds the average remaining energy A. Therefore, nodes 11 and 12 are assigned to the cluster head node set of clustering category 1. When electing cluster head nodes in clustering category 1, the election will only be conducted from the cluster head node set that includes nodes 11 and 12. By calculating the remaining energy of nodes 21, 22, 23, 24, and 25, the average remaining energy B of the nodes is obtained. Then, the remaining energy of nodes 21, 22, 23, 24, and 25 is compared with the average remaining energy B. It is determined that the remaining energy of nodes 21, 22, and 23 exceeds the average remaining energy B. Therefore, nodes 21, 22, and 23 are assigned to the cluster head node set of cluster category 2. When electing cluster head nodes in cluster category 2, the election will only be conducted from the cluster head node set that includes nodes 21, 22, and 23. By calculating the remaining energy of nodes 31, 32, 33, 34, 35, and 36, the average remaining energy C of the nodes is obtained. Then, the remaining energy of nodes 31, 32, 33, 34, 35, and 36 is compared with the average remaining energy C. It is determined that the remaining energy of nodes 31, 32, 33, and 34 exceeds the average remaining energy C. Therefore, nodes 31, 32, 33, and 34 are assigned to the cluster head node set of cluster category 3. When electing cluster head nodes in cluster category 3, the election will only be conducted from the cluster head node set that includes nodes 31, 32, 33, and 34.
[0160] This invention provides a networking method for monitoring equipment. First, the optimal number of cluster heads is calculated based on the number of surviving nodes. Then, based on the optimal number of cluster heads, a clustering algorithm is used to uniformly cluster the entire network. The clustering algorithm defines the initial cluster centers by maximizing the distance between the initial cluster heads. When selecting cluster heads, the energy of remaining nodes and distance factors are considered to improve network balance. In the data transmission phase, this invention replaces single-hop routing with a communication method combining single-hop and multi-hop routing to extend the network's lifetime and ultimately achieve stable data transmission.
[0161] A second aspect of the present invention provides a networking system for monitoring equipment, such as... Figure 3 As shown, the system 300 includes:
[0162] The cluster head number determination module 301 is used to determine the number of cluster heads based on the number of surviving nodes and the total number of nodes;
[0163] Clustering module 302 is used to cluster nodes according to the number of cluster heads to obtain clustering results;
[0164] The election threshold and random value determination module 303 is used to determine the election threshold of each node and generate a corresponding random value for each node.
[0165] The cluster head node determination module 304 is used to determine the cluster head node among the nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node.
[0166] The first monitoring data transmission module 305 is used by the cluster head node to allocate corresponding time slots to each node in the cluster to which the cluster head node belongs through the time division multiple access mechanism, so as to control each node in the cluster to which the cluster head node belongs to send monitoring data to the cluster head node in its respective time slot;
[0167] The second monitoring data transmission module 306 is used for the cluster head node to merge the monitoring data sent by each node in the cluster to which the cluster head node belongs, and send the merged monitoring data to the aggregation node, which then sends it to the base station.
[0168] Optionally, the clustering module 302 includes:
[0169] The cluster number determination module is used to determine the number of clusters based on the number of cluster heads;
[0170] The location coordinate sending module is used by each node to obtain its own location coordinates and send them to the aggregation node;
[0171] The clustering submodule is used to aggregate nodes by performing clustering on each node according to its own location coordinates and the number of clusters, and obtain the clustering results.
[0172] Optionally, the clustering submodule is used to perform the following steps:
[0173] Step 1: The wireless sensor network randomly selects one node from all nodes as the initial cluster center;
[0174] Step 2: Calculate the distance between each node and the nearest cluster center based on the location coordinates of each node;
[0175] Step 3: Determine the probability that each node will be identified as the next cluster center based on the distance;
[0176] Step 4: Select the next cluster center according to the probability and preset rules;
[0177] Step 5: Determine the number of cluster centers. If the number of cluster centers is less than the number of clusters, proceed to Step 2; if the number of cluster centers is equal to the number of clusters, proceed to Step 6.
[0178] Step 6: Based on the distance between each node and each cluster center, and using the first preset algorithm and preset constraints, assign each node to the cluster category to which the corresponding cluster center belongs;
[0179] Step 7: Determine the objective function of the current round of clustering results. When the objective function converges, obtain the target clustering result and end the clustering. When the objective function does not converge, update the cluster centers using the second preset algorithm and execute Step 2.
[0180] Optionally, step 2 of the steps performed by the clustering submodule includes:
[0181] The corrected weights are determined based on the environmental transmission medium between each node and the nearest cluster center;
[0182] Based on the corrected weights and the node's position coordinates, calculate the distance between the node and the nearest cluster center.
[0183] Optionally, the election threshold and random value determination module 303 includes:
[0184] The correction function determination module is used to determine the correction function for the election threshold based on the node's remaining energy, the node farthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node.
[0185] The election threshold determination module is used to determine the election threshold of a node based on the correction function.
[0186] Optionally, step 6 of the steps performed by the clustering submodule includes:
[0187] Based on the distances of each node to its respective cluster center, the weight matrix of each node is determined using a first preset algorithm, which is as follows:
[0188]
[0189] Among them, C i X represents the coordinates of the i-th cluster center; j Let C be the position coordinates of the j-th node; m W represents the coordinates of the cluster centers other than the i-th cluster center; ij Let be the weight matrix of node j under the i-th cluster center;
[0190] Based on the weight matrix of each node and preset constraints, each node is assigned to the cluster category to which its corresponding cluster center belongs. The preset constraints are as follows:
[0191] W ij =1j=1,2,...N
[0192] Where N is the total number of nodes sending monitoring data to the cluster head.
[0193] Optionally, step 7 of the steps performed by the clustering submodule includes:
[0194] The objective function for the clustering results is determined as follows:
[0195]
[0196] Among them, J i Let K be the objective function for clustering the i-th cluster center, K be the number of clusters, and C be the objective function for clustering the i-th cluster center. j The coordinates of the cluster center of the cluster category to which the j-th node belongs;
[0197] By comparing the objective function of the current round of clustering results with the objective function of the previous round of clustering results, it can be determined whether the objective function of the current round of clustering results has converged.
[0198] When the objective function of the current round of clustering converges, the current round of clustering result is determined as the target clustering result;
[0199] If the objective function of the current round of clustering results has not converged, the cluster centers are updated using a second preset algorithm, and step 2 is executed. The second preset algorithm is:
[0200]
[0201] Among them, C i Let be the coordinates of the i-th cluster center.
[0202] Optionally, the second monitoring data transmission module 306 includes:
[0203] The target transmission mode determination module is used to determine the target transmission mode based on the distance between the cluster head node and the sink node and the environmental transmission medium.
[0204] The second monitoring data transmission submodule is used by the cluster head node to merge the monitoring data sent by each node in the cluster to which the cluster head node belongs, and then send the merged monitoring data to the aggregation node through a determined target transmission method, and then send it to the base station through the aggregation node.
[0205] In a third aspect of the present invention, the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0206] Memory, used to store computer programs;
[0207] When a processor executes a program stored in a memory, it implements the steps of a networking method for a monitoring device as described in the first aspect of the present invention.
[0208] In a fourth aspect of the present invention, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a networking method for a monitoring device as described in the first aspect of the present invention.
[0209] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0210] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0211] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0212] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for networking monitoring equipment, characterized in that, The method includes: The number of cluster heads is determined based on the number of surviving nodes and the total number of nodes; Based on the number of cluster heads, the nodes are clustered to obtain the clustering results; Determine the election threshold for each node and generate a corresponding random value for each node; The cluster head node is determined by comparing the random value corresponding to the node with the election threshold corresponding to the node. The cluster head node allocates corresponding time slots to each node in the cluster to which it belongs through the time division multiple access mechanism, so as to control each node in the cluster to which it belongs to send monitoring data to the cluster head node in its respective time slot; The cluster head node merges the monitoring data sent by each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node, which then sends it to the base station. Determining the election threshold for each node includes: The correction function for the election threshold is determined based on the node's remaining energy, the node farthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node. The election threshold for nodes is determined based on the correction function, wherein the correction function is: in, Let n be the initial energy of node n; Let be the remaining energy of node n; D(n) be the distance between node n and the sink node. It is the distance between the node that is furthest from the pool node in the cluster to which node n belongs; λ(r) is the distance to the nearest node in the cluster to which node n belongs; λ(r) is the adjustment factor; r is the number of election rounds for the cluster head node; e represents the Euler number.
2. The networking method for the monitoring equipment according to claim 1, characterized in that, The step of clustering nodes based on the number of cluster heads to obtain clustering results includes: The number of clusters is determined based on the number of cluster heads; Each node obtains its own location coordinates and sends them to the aggregation node; The aggregation node performs clustering on each node according to its own location coordinates and the number of clusters, and obtains the clustering results.
3. The networking method for the monitoring equipment according to claim 2, characterized in that, The aggregation node performs clustering on each node according to its own location coordinates and the number of clusters, obtaining the clustering results, including: Step 1: The wireless sensor network randomly selects one node from all nodes as the initial cluster center; Step 2: Calculate the distance between each node and the nearest cluster center based on the location coordinates of each node; Step 3: Determine the probability that each node will be identified as the next cluster center based on the distance; Step 4: Select the next cluster center according to the probability and preset rules; Step 5: Determine the number of cluster centers. If the number of cluster centers is less than the number of clusters, proceed to Step 2; if the number of cluster centers is equal to the number of clusters, proceed to Step 6. Step 6: Based on the distance between each node and each cluster center, and using the first preset algorithm and preset constraints, assign each node to the cluster category to which the corresponding cluster center belongs; Step 7: Determine the objective function of the current round of clustering results. When the objective function converges, obtain the target clustering result and end the clustering. When the objective function does not converge, update the cluster centers using the second preset algorithm and execute Step 2.
4. The networking method for the monitoring equipment according to claim 3, characterized in that, Step 2: Calculate the distance between each node and the nearest cluster center based on the location coordinates of each node, including: The corrected weights are determined based on the environmental transmission medium between each node and the nearest cluster center; Based on the corrected weights and the node's position coordinates, calculate the distance between the node and the nearest cluster center.
5. The networking method for the monitoring equipment according to claim 3, characterized in that, Step 6: Based on the distance between each node and each cluster center, and using a first preset algorithm and preset constraints, assign each node to the cluster category to which the corresponding cluster center belongs, including: Based on the distances of each node to its respective cluster center, the weight matrix of each node is determined using a first preset algorithm, which is as follows: in, Let the coordinates be the location coordinates of the i-th cluster center; Let J be the coordinates of the j-th node. Represents the position coordinates of all cluster centers except the i-th cluster center; Let be the weight matrix of node j under the i-th cluster center; Based on the weight matrix of each node and preset constraints, each node is assigned to the cluster category to which its corresponding cluster center belongs. The preset constraints are as follows: Where N is the total number of nodes sending monitoring data to the cluster head.
6. The networking method for the monitoring equipment according to claim 3, characterized in that, Step 7: Determine the objective function of the current round of clustering results. When the objective function converges, obtain the target clustering result and end the clustering. When the objective function does not converge, update the cluster centers using the second preset algorithm and execute step 2, including: The objective function for the clustering results is determined as follows: Where Ji is the objective function of the cluster corresponding to the i-th cluster center, K is the number of clusters, and Cj is the position coordinate of the cluster center of the cluster category to which the j-th node belongs; By comparing the objective function of the current round of clustering results with the objective function of the previous round of clustering results, it can be determined whether the objective function of the current round of clustering results has converged. When the objective function of the current round of clustering converges, the current round of clustering result is determined as the target clustering result; If the objective function of the current round of clustering results has not converged, the cluster centers are updated using a second preset algorithm, and step 2 is executed. The second preset algorithm is: in, Let be the coordinates of the i-th cluster center.
7. The networking method for the monitoring equipment according to claim 1, characterized in that, The cluster head node merges the monitoring data received from each node in its cluster, and sends the merged monitoring data to the aggregation node, which then transmits it to the base station. This includes: The target transmission method is determined based on the distance between the cluster head node and the sink node and the environmental transmission medium. The cluster head node merges the monitoring data sent by each node in the cluster to which it belongs, and sends the merged monitoring data to the aggregation node through a determined target transmission method, and then sends it to the base station through the aggregation node.
8. A networking system for monitoring equipment, characterized in that, The system includes: The cluster head number determination module is used to determine the number of cluster heads based on the number of surviving nodes and the total number of nodes; The clustering module is used to cluster nodes according to the number of cluster heads and obtain clustering results; The election threshold and random value determination module is used to determine the election threshold for each node and generate a corresponding random value for each node. The cluster head node determination module is used to determine the cluster head node among the nodes by comparing the random value corresponding to the node with the election threshold corresponding to the node. The first monitoring data transmission module is used by the cluster head node to allocate corresponding time slots to each node in the cluster to which the cluster head node belongs through the time division multiple access mechanism, so as to control each node in the cluster to which the cluster head node belongs to send monitoring data to the cluster head node in its respective time slot; The second monitoring data transmission module is used by the cluster head node to merge the monitoring data sent by each node in the cluster to which the cluster head node belongs, and send the merged monitoring data to the aggregation node, which then sends it to the base station. The correction function determination module is used to determine the correction function for the election threshold based on the node's remaining energy, the node farthest from the sink node in the cluster to which the node belongs, and the node closest to the sink node. The election threshold determination module is used to determine the election threshold of a node based on the correction function, wherein the correction function is: in, Let n be the initial energy of node n; Let be the remaining energy of node n; D(n) be the distance between node n and the sink node. It is the distance between the node that is furthest from the pool node in the cluster to which node n belongs; λ(r) is the distance to the nearest node in the cluster to which node n belongs; λ(r) is the adjustment factor; r is the number of election rounds for the cluster head node; e represents the Euler number.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When the processor executes the program stored in the memory, it implements the steps of the networking method for a monitoring device as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a networking method for monitoring devices as described in any one of claims 1-7.