A clustering method for wireless sensor networks based on improved particle swarm

By combining the improved particle swarm optimization algorithm and the sleep mechanism of neighboring node groups, the problems of uneven distribution of cluster head nodes and data redundancy in wireless sensor networks are solved, significantly improving the energy usage and node survival rate of the network, and prolonging the network life. service life.

CN114125759BActive Publication Date: 2024-09-13NANJING HOWSO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111432864.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-09-13
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

In traditional wireless sensor network clustering methods, cluster head nodes are unevenly distributed, resulting in uneven node load and energy hole problems, and data redundancy leads to energy waste and short life cycles.

Method used

A clustering method based on improved particle swarm is adopted, cluster head nodes are selected through an improved particle swarm optimization algorithm, and a dormancy mechanism of adjacent node groups is introduced to optimize cluster head node selection and data transmission to avoid data redundancy.

Benefits of technology

In the simulation analysis, the average energy usage and number of surviving nodes of the network are significantly improved, the service life of the network is extended, and the problems of uneven distribution of cluster head nodes and data redundancy are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114125759B
    Figure CN114125759B
Patent Text Reader

Abstract

The present invention relates to a wireless sensor network clustering method based on an improved particle swarm, comprising the steps of: S1: initializing and setting a wireless sensor network WSN, constructing a node group, and selecting energy; S2: selecting a cluster head node by using an improved PSO algorithm; S3: adding ordinary nodes to the nearest cluster structure by calculating the distance, entering the communication phase, and starting data transmission. First, the particle swarm method is improved, and then a dormant mechanism of a neighboring node group is introduced, so that some nodes do not participate in the work when the network is running, and then the optimal number of cluster heads of the network is re-analyzed when the neighboring node group is added, and the fitness function is used to determine whether the cluster head node is selected appropriately, and the cluster head node is selected. The problem of excessive randomness of cluster head nodes and data redundancy is effectively solved. In simulation analysis, compared with the classical clustering method, this method has obvious advantages in indicators such as average network energy and number of surviving nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of Internet of Things, and in particular to a wireless sensor network clustering method based on improved particle swarm. Background Art

[0002] In recent years, the Internet of Things (IoT) technology has developed rapidly, and has also driven the development of other industries. As the underlying technical support of IoT, wireless sensor networks (WSNs) have become a hot research field due to their low cost, easy deployment, and wide application scenarios. However, the nodes of WSNs have limited energy and cannot replenish battery energy, resulting in a limited life cycle of WSNs. Therefore, how to increase the use time of nodes and extend the service life of the network has become a technical problem in the field of WSNs. The random selection of cluster head nodes in traditional clustering methods will result in uneven distribution of cluster head nodes, resulting in uneven node loads, excessive energy consumption of some nodes, and the problem of "energy holes", which in turn leads to a too short life cycle of WSNs.

[0003] In addition, in clustering methods, how to form a reasonable cluster structure is one of the main problems currently faced. In the existing clustering methods, there are still many problems that have not been solved.

[0004] (1) The selection of cluster head nodes is too random:

[0005] In the past, many clustering methods added some weight factors to the selection formula when selecting cluster head nodes, but they were still random, which would lead to uneven distribution of cluster head nodes, waste of resources in densely populated areas, and excessive node energy consumption in sparse areas.

[0006] (2) Partial data redundancy:

[0007] Because the nodes are randomly deployed, it is inevitable that some nodes will be too close to each other. If every node participates in data collection and transmission, there will be duplication in the monitoring area, which will cause some data to have high repetitiveness and waste the node's energy doing useless work. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a wireless sensor network clustering method based on an improved particle swarm, that is, a clustering method based on an improved particle swarm is proposed, which effectively solves the problem of excessive randomness of cluster head nodes and data redundancy. In simulation analysis, compared with the classical clustering method, this method has obvious advantages in indicators such as network average energy and number of surviving nodes.

[0009] To solve the above problems, the technical solution adopted by the present invention is: a wireless sensor network clustering method based on an improved particle swarm, comprising the following steps:

[0010] S1: Initialize the wireless sensor network WSN, build node groups, and select energy;

[0011] S2: Use the improved PSO algorithm to select cluster head nodes;

[0012] S3: Add ordinary nodes to the nearest cluster structure by calculating the distance, enter the communication phase, and start data transmission.

[0013] By adopting the above technical solution, the particle swarm method is first improved, and then the dormancy mechanism of the neighboring node group is introduced, so that some nodes do not participate in the work when the network is running. After that, the optimal number of cluster heads of the network is re-analyzed when the neighboring node group is added, and the fitness function is used to determine whether the cluster head node is selected appropriately, and finally the cluster head node is selected. The random selection of cluster head nodes in the traditional clustering method will result in uneven distribution of cluster head nodes, resulting in uneven node load, excessive energy consumption of some nodes, and "energy holes", which will lead to the problem that the life cycle of WSN is too short. This technical solution is based on the clustering method of the improved particle swarm, which effectively solves the problem of too random cluster head nodes and data redundancy. In the simulation analysis, compared with the classical clustering method, this method has obvious advantages in indicators such as average network energy and number of surviving nodes.

[0014] As a preferred technical solution of the present invention, step S1 specifically includes the following steps:

[0015] S11: Initialize the wireless sensor network WSN, including the location information and node energy of the node;

[0016] S12: Calculate the distance between nodes by using the distance calculation formula and compare it with the set distance threshold; and build a neighboring node group. In the first round, the nodes in the neighboring node group are randomly selected to participate in the cluster head election and perform data collection and forwarding tasks;

[0017] S13: Compare the node energy values ​​and perform screening.

[0018] As a preferred technical solution of the present invention, step S2 specifically includes the following steps:

[0019] S21: Initialize the particle swarm. There are N particles, where N is the number of cluster head nodes in the network. Each particle has a corresponding position vector x i , and the velocity vector v i ;

[0020] S22: Calculate the initial fitness value of each particle and the individual extreme value p of the particle id Expressed as the fitness value of the particle fi , the population extreme value p gd It is expressed as the maximum value among the individual extreme values ​​of all particles;

[0021] S23: Each particle updates its own position vector and velocity vector according to the following formula;

[0022]

[0023]

[0024] S24: After each particle updates its position vector and velocity vector, it recalculates its fitness value;

[0025] S25: Update the individual extreme value and the overall extreme value through the obtained fitness value. If the fitness value is greater than the individual extreme value, replace the individual extreme value with the fitness value.

[0026] S26: Repeat steps S21 to S25 until the number of iterations is reached or the termination condition is met, and the node corresponding to the obtained total extreme value is the required cluster head node.

[0027] As a preferred technical solution of the present invention, step S3 specifically includes the following steps: after the cluster head node is selected in step S2, the ordinary nodes are added to the nearest cluster structure by calculating the distance, entering the communication phase, and using the same data transmission mechanism as in the LEACH algorithm to transmit data.

[0028] As a preferred technical solution of the present invention, the mathematical model of the clustering method of selecting the cluster head node by merit in step S2 is:

[0029] Assume that there are N particles in a D-dimensional space, and there is a corresponding fitness function f(x) to determine whether the current position of the particle is optimal; the method includes the following parameter vectors:

[0030] The position vector of the i-th particle is: i =(x i1 , x i2 , …, x iD );

[0031] The velocity vector of the i-th particle is: v i =(v i1 , v i2 , …, v iD );

[0032] The fitness function value of particle i is: fitness i =f(x i ), i = 1, 2, 3, ... N;

[0033] The optimal position vector of particle i is: pbest i =(p i1 , p i2 ,…,p iD );

[0034] During the entire iteration process, the position of particle i and speed The update formula is:

[0035]

[0036]

[0037]

[0038]

[0039] Where i = 1, 2, 3, ..., N; d = 1, 2, 3, ..., D; c1 and c2 are learning factors, w is the inertia weight coefficient, r1 and r2 are random numbers in the range of (0, 1); is the particle's position and velocity range in d-dimensional space. During the method, if and If the variable exceeds the range of change, it will be restricted to the boundary value;

[0040] When using the particle swarm method to find the optimal solution, the inertia weight coefficient w will affect the search direction of the particle swarm. By adjusting the size of the inertia weight coefficient w, the particles can be controlled to approach the global optimal solution or the local optimal solution. As shown in formula (3), when the inertia weight coefficient w is large, the first term in the formula accounts for a larger proportion, that is, the particle velocity vector has a greater impact, and the particle movement is less restricted, which can improve the ease of finding the global optimal solution: when the inertia weight coefficient w is small, the last two terms in the formula account for a larger proportion, the particle velocity is small, and it is easy to find the local optimal solution;

[0041] Therefore, the inertia weight coefficient of the particle swarm method is improved nonlinearly, as shown in the following formula (7):

[0042]

[0043] w min 、w max is the range of inertia weight coefficient w, T max is the maximum number of iterations of the method.

[0044] As a preferred technical solution of the present invention, the clustering method of selecting the cluster head node by merit is adopted in step S12, and a neighboring node group is introduced. The specific steps are as follows:

[0045] S121: After the WSN network is initialized, the distance formula is used to obtain the distance d between nodes. i-1 , preset a distance threshold R g =3; if the distance between nodes is less than this value, that is, d i-1 ≤R g , it is considered that the monitoring areas of the two nodes are repeated, and the data information collected by the two nodes is the same; if both nodes are working at this time, data redundancy will occur;

[0046] S122: Condition d will be satisfied i-1 ≤R g The nodes are grouped into a set P, P = {n1, n2...}, where n1, n2, ... in the set P represent the nodes in the WSN. During the operation of the WSN network, only some nodes in each set P participate in the data collection and forwarding tasks. When the number of nodes in the set P is small, even only one node participates in the work; that is, in each round, there will be nodes in a dormant state.

[0047] S123: Determine whether each node in the set P participates in this round of work based on the size of the energy. If the node has energy greater than the set energy threshold, it is in an active state and performs information collection and data forwarding operations; if the node has energy less than the set energy threshold, it is in a dormant state. After a round ends, the energy is compared again and the next round of work begins.

[0048] Compared with the prior art, the technical solution of the present invention has the beneficial effect that the wireless sensor network clustering method based on the improved particle swarm effectively solves the problem of excessive randomness of cluster head nodes and data redundancy. In simulation analysis, compared with the classical clustering method, this method has obvious advantages in indicators such as network average energy and number of surviving nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The technical solution of the present invention is further described below in conjunction with the accompanying drawings:

[0050] Figure 1 It is a flow chart of the wireless sensor network clustering method based on improved particle swarm of the present invention;

[0051] Figure 2 The invention discloses a network structure of a wireless sensor network WSN in a wireless sensor network clustering method based on an improved particle swarm. DETAILED DESCRIPTION

[0052] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Example: Figure 1 As shown, the wireless sensor network clustering method based on improved particle swarm includes the following steps:

[0054] S1: Initialize the wireless sensor network WSN, build node groups, and select energy;

[0055] The step S1 specifically includes the following steps:

[0056] S11: Initialize the wireless sensor network WSN, including the location information and node energy of the node;

[0057] S12: Calculate the distance between nodes by using the distance calculation formula and compare it with the set distance threshold; and build a neighboring node group. In the first round, the nodes in the neighboring node group are randomly selected to participate in the cluster head election and perform data collection and forwarding tasks;

[0058] In step S12, a clustering method of selecting cluster head nodes by merit is adopted, and a neighboring node group is introduced. The specific steps are as follows:

[0059] S121: After the WSN network is initialized, the distance formula is used to obtain the distance d between nodes. i-1 , preset a distance threshold R g =3; if the distance between nodes is less than this value, that is, d i-1 ≤R g , it is considered that the monitoring areas of the two nodes are repeated, and the data information collected by the two nodes is the same; if both nodes are working at this time, data redundancy will occur;

[0060] S122: Condition d will be satisfied i-1 ≤R g The nodes are grouped into a set P, P = {n1, n2...}, where n1, n2, ... in the set P represent the nodes in the WSN. During the operation of the WSN network, only some nodes in each set P participate in the data collection and forwarding tasks. When the number of nodes in the set P is small, even only one node participates in the work; that is, in each round, there will be nodes in a dormant state.

[0061] S123: Determine whether the nodes in each set P participate in this round of work according to the size of the energy. If the node has an energy greater than the set energy threshold, it is in an active state and performs information collection and data forwarding operations; if the node has an energy less than the set energy threshold, it is in a dormant state. When a round ends, the energy is re-compared and selected, and then the next round of work begins; after the introduction of the neighboring node group, the network structure of the wireless sensor network WSN will also undergo some changes, such as Figure 2 As shown, it can be seen that in a neighboring node group, only some nodes participate in the work of the entire network, while other nodes are in a dormant state;

[0062] S13: Compare the node energy values ​​and perform screening;

[0063] S2: Use the improved PSO algorithm to select cluster head nodes;

[0064] The step S2 specifically includes the following steps:

[0065] S21: Initialize the particle swarm. There are N particles, where N is the number of cluster head nodes in the network. Each particle has a corresponding position vector x i , and the velocity vector v i ;

[0066] S22: Calculate the initial fitness value of each particle and the individual extreme value p of the particle id Expressed as the fitness value of the particle f i , the population extreme value p gd It is expressed as the maximum value among the individual extreme values ​​of all particles;

[0067] S23: Each particle updates its own position vector and velocity vector according to the following formula;

[0068]

[0069]

[0070] S24: After each particle updates its position vector and velocity vector, it recalculates its fitness value;

[0071] S25: Update the individual extreme value and the overall extreme value through the obtained fitness value. If the fitness value is greater than the individual extreme value, replace the individual extreme value with the fitness value.

[0072] S26: Repeat steps S21 to S25 until the number of iterations is reached or the termination condition is met, and the node corresponding to the total extreme value obtained is the required cluster head node; the node corresponding to the total extreme value obtained in the above steps is the required cluster head node, but the particle position vector does not exactly correspond to the node position, so it needs to be corrected, and the node closest to the particle position vector becomes the cluster head;

[0073] The mathematical model of the clustering method of selecting the cluster head node by merit in step S2 is:

[0074] Assume that there are N particles in a D-dimensional space, and there is a corresponding fitness function f(x) to determine whether the current position of the particle is optimal; the method includes the following parameter vectors:

[0075] The position vector of the i-th particle is: i =(x i1 , x i2 , …, x iD );

[0076] The velocity vector of the i-th particle is: v i =(v i1 , v i2 , …, v iD );

[0077] The fitness function value of particle i is: fitness i =f(x i ), i = 1, 2, 3, ... N;

[0078] The optimal position vector of particle i is: pbest i =(p i1 , p i2 ,…,p iD );

[0079] During the entire iteration process, the position of particle i and speed The update formula is:

[0080]

[0081]

[0082]

[0083]

[0084] Where i = 1, 2, 3, ..., N; d = 1, 2, 3, ..., D; c1 and c2 are learning factors, w is the inertia weight coefficient, r1 and r2 are random numbers in the range of (0, 1); is the particle's position and velocity range in d-dimensional space. During the method, if and If the variable exceeds the range of change, it will be restricted to the boundary value;

[0085] When using the particle swarm method to find the optimal solution, the inertia weight coefficient w will affect the search direction of the particle swarm. By adjusting the size of the inertia weight coefficient w, the particles can be controlled to approach the global optimal solution or the local optimal solution. As shown in formula (3), when the inertia weight coefficient w is large, the first term in the formula accounts for a larger proportion, that is, the particle velocity vector has a greater impact, and the particle movement is less restricted, which can improve the ease of finding the global optimal solution: when the inertia weight coefficient w is small, the last two terms in the formula account for a larger proportion, the particle velocity is small, and it is easy to find the local optimal solution;

[0086] Therefore, the inertia weight coefficient of the particle swarm method is improved nonlinearly, as shown in the following formula (7):

[0087]

[0088] w min 、w max is the range of inertia weight coefficient w, T max is the maximum number of iterations of the method; the improvement of the inertia weight coefficient proposed by the present invention makes w' change slowly in the early stage, which is convenient for finding the global optimal solution, while in the later stage, w changes faster, which can make the particles approach the local optimal solution faster;

[0089] S3: adding common nodes to the nearest cluster structure by calculating the distance, entering the communication phase, and starting data transmission; the step S3 specifically includes the following steps: after the cluster head node is selected in step S2, adding common nodes to the nearest cluster structure by calculating the distance, entering the communication phase, and using the same data transmission mechanism as in the LEACH algorithm to transmit data.

[0090] For ordinary technicians in this field, the specific embodiments are only illustrative descriptions of the present invention. It is obvious that the specific implementation of the present invention is not limited to the above-mentioned methods. As long as various non-substantial improvements are made using the method concepts and technical solutions of the present invention, or the concepts and technical solutions of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A clustering method for wireless sensor networks based on improved particle swarm. It is characterized in that The following steps are involved: S1: Initialize the wireless sensor network WSN, build node groups, and select energy; S2: Use the improved PSO algorithm to select cluster head nodes; S3: Add common nodes to the nearest cluster structure by calculating the distance, enter the communication phase, and start data transmission; The step S1 specifically includes the following steps: S11: Initialize the wireless sensor network WSN, including the location information and node energy of the node; S12: Calculate the distance between nodes by using the distance calculation formula and compare it with the set distance threshold; and build a neighboring node group. In the first round, the nodes in the neighboring node group are randomly selected to participate in the cluster head election and perform data collection and forwarding tasks; S13: Compare the node energy values ​​and perform screening; In step S12, a clustering method of selecting cluster head nodes by merit is adopted, and a neighboring node group is introduced. The specific steps are as follows: S121: After the WSN network is initialized, the distance formula is used to obtain the distance d between nodes. i-1 , preset a distance threshold R g =3; if the distance between nodes is less than this value, that is, d i-1 ≤R g , it is considered that the monitoring areas of the two nodes are repeated, and the data information collected by the two nodes is the same; if both nodes are working at this time, data redundancy will occur; S122: Condition d will be satisfied i-1 ≤R g The nodes are grouped into a set P, P = {n 1 , n 2 …}, n in the set P 1 , n 2 , ... represents the nodes in WSN; in the operation of WSN network, only some nodes in each set P participate in data collection and forwarding tasks. When the number of nodes in set P is small, even only one node participates in the work; that is, in each round, there will be nodes in dormant state; S123: Determine whether each node in the set P participates in this round of work based on the size of the energy. If the node has energy greater than the set energy threshold, it is in an active state and performs information collection and data forwarding operations; if the node has energy less than the set energy threshold, it is in a dormant state. After a round ends, the energy is compared again and the next round of work begins.

2. The wireless sensor network clustering method based on improved particle swarm according to claim 1, It is characterized in that The step S2 specifically includes the following steps: S21: Initialize the particle swarm. There are N particles, where N is the number of cluster head nodes in the network. Each particle has a corresponding position vector x i , and the velocity vector v i ; S22: Calculate the initial fitness value of each particle and the individual extreme value p of the particle id Expressed as the fitness value of the particle f i , the population extreme value p gd It is expressed as the maximum value among the individual extreme values ​​of all particles; S23: Each particle updates its own position vector and velocity vector according to the following formula; Wherein, i = 1, 2, 3, ..., N; d = 1, 2, 3, ..., D; c 1 and c 2 is the learning factor, W is the inertia weight coefficient, r 1 and r 2 is a random number in the range (0, 1); t is the current iteration number; S24: After each particle updates its position vector and velocity vector, it recalculates its fitness value; S25: Update the individual extreme value and the overall extreme value through the obtained fitness value. If the fitness value is greater than the individual extreme value, replace the individual extreme value with the fitness value. S26: Repeat steps S21 to S25 until the number of iterations is reached or the termination condition is met, and the node corresponding to the obtained total extreme value is the required cluster head node.

3. The wireless sensor network clustering method based on improved particle swarm according to claim 1, It is characterized in that The step S3 specifically includes the following steps: after the cluster head node is selected in the step S2, ordinary nodes are added to the nearest cluster structure by calculating the distance, entering the communication phase, and using the same data transmission mechanism as in the LEACH algorithm to transmit data.

4. The wireless sensor network clustering method based on improved particle swarm according to claim 2, It is characterized in that The mathematical model of the clustering method of selecting the cluster head node by merit in step S2 is: Assume that there are N particles in a D-dimensional space, and there is a corresponding fitness function f(x) to determine whether the current position of the particle is optimal; the method includes the following parameter vectors: The position vector of the i-th particle is: i =(x i1 , x i2 , …, x iD ); The velocity vector of the i-th particle is: v i =(v i1 , v i2 , …, v iD ); The fitness function value of particle i is: fitness i =f(x i ), i = 1, 2, 3, ... N; The optimal position vector of particle i is: pbest i =(p i1 , p i2 ,…,p iD ); During the entire iteration process, the position of particle i and speed The update formula is: Where, l = 1, 2, 3, ..., N; d = 1, 2, 3, ..., D; c 1 and c 2 is the learning factor, W is the inertia weight coefficient, t is the current number of iterations; r 1 and r 2 is a random number in the range (0, 1); is the particle's position and velocity range in d-dimensional space. During the method, if and If the variable exceeds the range of change, it will be restricted to the boundary value; When using the particle swarm method to find the optimal solution, the inertia weight coefficient w will affect the search direction of the particle swarm. By adjusting the size of the inertia weight coefficient w, the particles can be controlled to approach the global optimal solution or the local optimal solution. In formula (3), when the inertia weight coefficient w is large, the first term in the formula accounts for a large proportion, that is, the velocity vector of the particle has a greater impact, and the movement of the particle is less restricted, which can improve the ease of finding the global optimal solution: when the inertia weight coefficient w is small, the last two terms in formula (3) account for a large proportion, the particle speed is small, and it is easy to find the local optimal solution; Therefore, the inertia weight coefficient w of the particle swarm method is improved nonlinearly, as shown in the following formula (6): w min 、w max is the range of inertia weight coefficient, T max is the maximum number of iterations of the method.