Wireless sensor network clustering method and device and electronic equipment
Patent Information
- Application Number
- CN202410982338.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the wireless sensor network clustering routing scheme is determined through human experience, which results in low energy utilization of some sensor nodes and affects the long-term stable operation of the network.
The cheetah optimization algorithm is used to determine the location and fitness value of individual cheetahs and iteratively determine the target clustering scheme to optimize the clustering of wireless sensor networks and improve the energy utilization of sensor nodes.
It improves the energy utilization of sensor nodes in wireless sensor networks, extends the life of wireless sensor networks, and obtains better clustering solutions in fewer iterations, avoiding local optimal solutions.
Smart Images

Figure CN118741640A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wireless sensors, and in particular to a wireless sensor network clustering method, device and electronic equipment. Background Art
[0002] A wireless sensor network is a network system composed of many small, widely distributed sensor nodes. The sensor nodes in a wireless sensor network can collect environmental data and send this data to one or more central nodes via wireless signals, which then process or aggregate the information. The practical applications of wireless sensor networks are very wide, covering many fields from environmental monitoring, agriculture, health care systems to industrial automation and intelligent transportation systems.
[0003] Although wireless sensor networks bring many conveniences and advantages, their deployment and operation also face multiple challenges. Most sensor nodes in wireless sensor networks operate independently of the power grid and rely on limited battery power. Therefore, energy management of wireless sensor networks has become a major challenge to maintain long-term stable operation of the network.
[0004] The existing technology mainly determines the wireless sensor network clustering scheme through artificial experience to extend the life cycle of the wireless sensor network. However, the wireless sensor network clustering based on artificial experience has the problem of low energy utilization rate of some sensor nodes. Summary of the invention
[0005] The present invention provides a wireless sensor network clustering method, device and electronic equipment, which are used to solve the problem that the solution of determining the wireless sensor network clustering routing through artificial experience in the prior art has a low energy utilization rate of some sensor nodes. The technical solution of the present invention can improve the energy utilization rate of sensor nodes in the wireless sensor network, thereby extending the life of the wireless sensor network.
[0006] The present invention provides a wireless sensor network clustering method, comprising the following steps.
[0007] Determining the location of each individual cheetah in a cheetah population of a cheetah optimization algorithm, wherein the location represents a clustering scheme of a wireless sensor network; For each of the cheetah individuals, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; Iteratively determining a target clustering scheme based on the fitness value of each of the cheetah individuals; The wireless sensor network is clustered based on the target clustering scheme.
[0008] According to a wireless sensor network clustering method provided by the present invention, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual, including: Determine a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme based on the clustering scheme corresponding to the cheetah individual; For each of the non-cluster head sensor nodes, determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node; For each of the cluster head sensor nodes, determining the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network; The sum of all the intra-cluster transmission energies and all the cluster head transmission energies is determined as the fitness value of the cheetah individual.
[0009] According to a wireless sensor network clustering method provided by the present invention, the determining of the intra-cluster transmission energy corresponding to the non-cluster head sensor node comprises: Determine first transmission energies from the non-cluster head sensor nodes to each of the cluster head sensor nodes; The smallest first transmission energy among all the first transmission energies is determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node.
[0010] According to a wireless sensor network clustering method provided by the present invention, the iterative determination of a target clustering scheme based on the fitness value of each cheetah individual includes: When the iteration termination condition is reached, determining the target clustering scheme based on the fitness value of each cheetah individual in each iteration round; In the case where the iteration termination condition is not met, the position of each cheetah individual is updated based on the cheetah sit-and-wait strategy, or the fitness value of each cheetah individual; the fitness value of each cheetah individual is recalculated based on the updated position; the steps of updating the position and calculating the fitness value are continuously repeated until the iteration termination condition is met, and the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round.
[0011] According to a wireless sensor network clustering method provided by the present invention, the cheetah-wait strategy is based on, or the fitness value of each cheetah individual is used to update the position of each cheetah individual, including: For each of the cheetah individuals, obtain a first random number, a second random number, a third random number, and a fourth random number corresponding to the cheetah individual; When the first random number is greater than or equal to the second random number, adopting the cheetah sit-and-wait strategy to update the position of the cheetah individual; When the first random number is less than the second random number, the target random value is determined based on the current number of iteration rounds and the third random number; when the target random value is less than or equal to the fourth random number, the position of the cheetah individual is updated based on the cheetah search strategy and the fitness value of the cheetah individual; when the target random value is greater than the fourth random number, the position of the cheetah individual is updated based on the cheetah attack strategy and the fitness value of each of the cheetah individuals.
[0012] According to a wireless sensor network clustering method provided by the present invention, the updating of the position of the cheetah individual based on the cheetah search strategy and the fitness value of the cheetah individual includes: In the current iteration round, the position of the cheetah individual is adjusted based on the randomization parameter and the search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual; When the fitness value corresponding to the first position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the first position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the first position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0013] According to a wireless sensor network clustering method provided by the present invention, the updating of the position of the cheetah individuals based on the cheetah attack strategy and the fitness value of each cheetah individual includes: In the current iteration round, the position of the cheetah individual with the lowest fitness value among all the cheetah individuals is determined as the position of the prey; Adjusting the position of the cheetah individual based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain a second position of the cheetah individual; When the fitness value corresponding to the second position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the second position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the second position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0014] According to a wireless sensor network clustering method provided by the present invention, the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round, including: Determine the cheetah individual with the lowest fitness value in each iteration round as the global optimal cheetah individual; The clustering scheme corresponding to the position representation of the global optimal cheetah individual is determined as the target clustering scheme.
[0015] The present invention also provides a wireless sensor network clustering device, comprising the following modules: A determination module, used to determine the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, wherein the position represents a clustering scheme of the wireless sensor network; A calculation module, for calculating the fitness value of each cheetah individual based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; An iterative module, used for iteratively determining a target clustering scheme based on the fitness value of each cheetah individual; The clustering module is used to cluster the wireless sensor network based on the target clustering scheme.
[0016] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the wireless sensor network clustering methods described above is implemented.
[0017] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the wireless sensor network clustering method described in any one of the above is implemented.
[0018] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the wireless sensor network clustering method described above is implemented.
[0019] The wireless sensor network clustering method, device and electronic device provided by the present invention determine the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, and the position represents the clustering scheme of the wireless sensor network. Then, for each cheetah individual, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual, and further based on the fitness value of each cheetah individual, the target clustering scheme is iteratively determined, and finally the wireless sensor network is clustered based on the target clustering scheme. The fitness value of the cheetah individual in the technical solution of the present invention is determined based on the cluster head transmission energy and the intra-cluster transmission energy in the corresponding clustering scheme, and then the target clustering scheme with less energy consumption can be determined by the cheetah optimization algorithm. The target clustering scheme is more reasonable than the clustering scheme determined artificially through experience, and then the wireless sensor network is clustered by the target clustering scheme, which can improve the energy utilization rate of the sensor nodes in the wireless sensor network, thereby extending the life of the wireless sensor network. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a flow chart of the wireless sensor network clustering method provided by the present invention.
[0022] Figure 2 It is a schematic diagram comparing the energy consumption of clustering schemes determined in the iteration process by the particle swarm algorithm, the cheetah algorithm and the genetic algorithm provided by the present invention.
[0023] Figure 3 It is a structural schematic diagram of the wireless sensor network clustering device provided by the present invention.
[0024] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0026] In view of the above problems in the prior art, the present invention provides a wireless sensor network clustering method. Figure 1 FIG. 1 is a flow chart of the wireless sensor network clustering method provided by the present invention, such as Figure 1 As shown, the wireless sensor network clustering method includes the following steps 110, 120, 130 and 140.
[0027] Step 110: Determine the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, wherein the position represents a clustering scheme of the wireless sensor network.
[0028] Specifically, the parameters of the cheetah optimization algorithm can be pre-set, for example, the number of cheetah individuals in the cheetah population in the cheetah optimization algorithm, the length of the cheetah individual, and the encoding method of the cheetah individual can be set. Further, the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm can be determined, and the position is the initial position of the cheetah individual. The initial position can be randomly determined, and the position of the cheetah individual represents the clustering scheme of the wireless sensor network. The scale of the wireless sensor network can also be pre-set as needed, the coverage of the wireless sensor network can be pre-set, and the number of sensor nodes in the wireless sensor network can also be pre-set, for example, the wireless sensor network can be set to include 200 sensor nodes.
[0029] Step 120: For each cheetah individual, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual.
[0030] In one embodiment, the step of calculating the fitness value of the cheetah individual based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual includes: Determine a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme based on the clustering scheme corresponding to the cheetah individual; For each of the non-cluster head sensor nodes, determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node; For each of the cluster head sensor nodes, determining the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network; The sum of all the intra-cluster transmission energies and all the cluster head transmission energies is determined as the fitness value of the cheetah individual.
[0031] Specifically, a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme can be determined based on the clustering scheme corresponding to the cheetah individual. It is easy to understand that the clustering scheme is a scheme that determines which sensor nodes in the wireless sensor network serve as cluster head sensor nodes and the remaining sensor nodes serve as non-cluster head sensor nodes. Furthermore, for each non-cluster head sensor node, the intra-cluster transmission energy corresponding to the non-cluster head sensor node can be determined. The intra-cluster transmission energy is the energy to be consumed by the non-cluster head sensor node to transmit a preset amount of data to the cluster head sensor node. Furthermore, for each cluster head sensor node, the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network can be determined. Exemplarily, the cluster head transmission energy can be determined by the following formula:
[0032] in, Represents the cluster head sensor node The corresponding cluster head transmission energy, represents the electron energy parameter, Indicates the preset data volume (unit: bit), Indicates the power amplification parameters, Represents the cluster head sensor node Transmission distance to the center of the wireless sensor network, Indicates preset communication parameters, such as The value of can be 2, 3 or 4. The better the communication quality, The value can be lower.
[0033] It is easy to understand that in order to solve the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network, the position of the center of the wireless sensor network can be determined first, and then the transmission distance from the cluster head sensor node to the center of the wireless sensor network can be determined, wherein the position of the center of the wireless sensor network can be determined according to the coverage range of the wireless sensor network.
[0034] Furthermore, the sum of all intra-cluster transmission energies and all cluster head transmission energies can be determined as the fitness value of the cheetah individual. For example, there are five sensor nodes in the wireless sensor network. In the clustering scheme corresponding to the position of a cheetah individual, sensor nodes 1 and 4 are cluster head sensor nodes, sensor nodes 2, 3 and 5 are non-cluster head sensor nodes, the intra-cluster transmission energy corresponding to sensor node 1 is 0.1125, the cluster head transmission energy corresponding to sensor node 4 is 0.1008, and the intra-cluster transmission energies corresponding to sensor nodes 2, 3 and 5 are 0.1001, 0.1027 and 0.1008, respectively. Then, the fitness value corresponding to the cheetah individual can be determined to be 0.1125+0.1008+0.1001+0.1027+0.1008=0.5169.
[0035] Exemplarily, the transmission energy within each cluster and the transmission energy of each cluster head may also be determined by a matrix method, thereby solving the fitness value of the individual cheetah.
[0036] For example, a wireless sensor network includes five sensor nodes, and the transmission distance matrix DIST1 from each sensor node to each sensor node in the wireless sensor network can be determined. The transmission distance matrix DIST1 is as follows:
[0037] Each value represents a different transmission distance. For example, the first row and the first column represent the transmission distance from sensor node 1 to sensor node 1, so the transmission distance is 0. For another example, the third row and the second column represent the transmission distance from sensor node 3 to sensor node 2, and the transmission distance is 7.21. It is easy to understand that the transmission distance from sensor node A to sensor node B is the same as the transmission distance from sensor node B to sensor node A. For example, the values of the first row and the second column are the same as the values of the second row and the first column, both of which are the transmission distances between sensor node 1 and sensor node 2.
[0038] The transmission distance matrix DIST2 from each sensor node to the center of the wireless sensor network can also be determined. The transmission distance matrix DIST2 is as follows:
[0039] Among them, the first value represents the transmission distance from sensor node No. 1 to the center of the wireless sensor network, which is 5, and the second value represents the transmission distance from sensor node No. 2 to the center of the wireless sensor network, which is 2.82.
[0040] Furthermore, according to the transmission distance matrix DIST1 and the transmission distance matrix DIST2, the intra-cluster transmission energy corresponding to each non-cluster head sensor node and the cluster head transmission energy from each cluster head sensor node to the center of the wireless sensor network can be determined, and finally the sum of all intra-cluster transmission energies and all cluster head transmission energies is determined as the fitness value of the cheetah individual.
[0041] In the above embodiment, firstly, a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme are determined based on the clustering scheme corresponding to the cheetah individual, and then the intra-cluster transmission energy corresponding to each non-cluster head sensor node is determined, and the cluster head transmission energy from each cluster head sensor node to the center of the wireless sensor network is determined. Finally, the fitness value of the cheetah individual is determined based on the sum of all intra-cluster transmission energies and all cluster head transmission energies. The fitness value of the cheetah individual accurately reflects the energy consumption in the wireless sensor network, thereby ensuring that the clustering scheme corresponding to the optimal cheetah individual obtained by subsequent optimization is more reasonable.
[0042] In one embodiment, determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node includes: Determine first transmission energies from the non-cluster head sensor nodes to each of the cluster head sensor nodes; The smallest first transmission energy among all the first transmission energies is determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node.
[0043] Specifically, the first transmission energy from the non-cluster head sensor node to each cluster head sensor node can be determined. To cluster head sensor node The first transmission energy can be determined by the following formula:
[0044] in, Represents non-cluster head sensor nodes To cluster head sensor node transmission distance.
[0045] Then, the smallest first transmission energy among all the first transmission energies can be determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node. For example, the first transmission energy from the non-cluster head sensor node No. 2 to the cluster head sensor node No. 1 is 0.1001, and the first transmission energy from the non-cluster head sensor node No. 2 to the cluster head sensor node No. 4 is 0.1343, then the intra-cluster transmission energy corresponding to the non-cluster head sensor node No. 2 is determined to be 0.1001.
[0046] In the above embodiment, the first transmission energies from the non-cluster head sensor nodes to each cluster head sensor node are determined, and then the smallest first transmission energy among all the first transmission energies is determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node, which can ensure that the energy consumption of the corresponding clustering scheme is smaller.
[0047] Step 130: Iteratively determine a target clustering scheme based on the fitness value of each of the cheetah individuals.
[0048] In one embodiment, the iterative determination of the target clustering scheme based on the fitness value of each cheetah individual includes: When the iteration termination condition is reached, determining the target clustering scheme based on the fitness value of each cheetah individual in each iteration round; In the case where the iteration termination condition is not met, the position of each cheetah individual is updated based on the cheetah sit-and-wait strategy, or the fitness value of each cheetah individual; the fitness value of each cheetah individual is recalculated based on the updated position; the steps of updating the position and calculating the fitness value are continuously repeated until the iteration termination condition is met, and the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round.
[0049] Specifically, when the iteration termination condition is reached, the target clustering scheme can be determined based on the fitness value of each cheetah individual in each iteration round. For example, when the total number of iteration rounds of the cheetah optimization algorithm reaches a preset iteration round, it is determined that the iteration termination condition of the cheetah optimization algorithm is reached. The preset iteration round can be set as needed, and the embodiment of the present invention is not specifically limited here. The preset iteration round can be, for example, 300.
[0050] If the iteration termination condition is not met, the position of each cheetah individual can be updated based on the cheetah sit-and-wait strategy, or the position of each cheetah individual can be updated based on the fitness value of each cheetah individual. Further, the fitness value of each cheetah individual can be recalculated based on the updated position. In order to obtain the target cluster routing solution, it is necessary to repeat the steps of updating the position and calculating the fitness value until the iteration termination condition is met. If the iteration termination condition is met, the target cluster solution can be determined based on the fitness value of each cheetah individual in each iteration round.
[0051] In the above embodiment, when the iteration termination condition is not reached, the steps of updating the position and calculating the fitness value are continuously repeated, and then the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round, to ensure that the final target clustering scheme is as globally optimal as possible.
[0052] In one embodiment, the determining the target clustering scheme based on the fitness value of each cheetah individual in each iteration round includes: Determine the cheetah individual with the lowest fitness value in each iteration round as the global optimal cheetah individual; The clustering scheme corresponding to the position representation of the global optimal cheetah individual is determined as the target clustering scheme.
[0053] Specifically, in each iteration round, the position of the cheetah individual with the lowest fitness value can be recorded. Then, the cheetah individual with the lowest fitness value in each iteration round can be determined as the global optimal cheetah individual, and the clustering scheme represented by the position corresponding to the global optimal cheetah individual can be determined as the target clustering scheme.
[0054] In the above embodiment, the cheetah individual with the lowest fitness value in each iteration round is determined as the global optimal cheetah individual, and the clustering scheme represented by the position corresponding to the global optimal cheetah individual is determined as the target clustering scheme, so that the fitness value corresponding to the target clustering scheme is the lowest, that is, the optimal solution for wireless sensor network clustering is obtained while considering the transmission energy consumption.
[0055] In one embodiment, the updating of the position of each cheetah individual based on the cheetah sit-and-wait strategy or the fitness value of each cheetah individual includes: For each of the cheetah individuals, obtain a first random number, a second random number, a third random number, and a fourth random number corresponding to the cheetah individual; When the first random number is greater than or equal to the second random number, adopting the cheetah sit-and-wait strategy to update the position of the cheetah individual; When the first random number is less than the second random number, the target random value is determined based on the current number of iteration rounds and the third random number; when the target random value is less than or equal to the fourth random number, the position of the cheetah individual is updated based on the cheetah search strategy and the fitness value of the cheetah individual; when the target random value is greater than the fourth random number, the position of the cheetah individual is updated based on the cheetah attack strategy and the fitness value of each of the cheetah individuals.
[0056] Specifically, for each cheetah individual, the first random number r1, the second random number r2, the third random number r3 and the fourth random number r4 corresponding to the cheetah individual can be obtained. It is easy to understand that for any cheetah individual, in each iteration round, the random number corresponding to the cheetah individual is different. For example, in the first iteration round, the first random number r1 corresponding to cheetah individual No. 1 is 1.2. In the second iteration round, the first random number r1 corresponding to cheetah individual No. 1 is 1.5.
[0057] When the first random number is greater than or equal to the second random number, that is, when r1≥r2, the cheetah sit-and-wait strategy can be used to update the position of the cheetah individual. The purpose of using this strategy is to prevent premature convergence. In this case, the updated position of the cheetah individual It can be determined by the following formula:
[0058] in, Indicates the number of the cheetah individual, Indicates the current iteration number. Indicates the position of the cheetah individual before updating.
[0059] When the first random number is less than the second random number, that is, when r1<r2, the target random value H can be determined based on the current iteration round number and the third random number. The target random value H can be determined by the following formula:
[0060] in, represents a natural constant, Indicates the current iteration number. Indicates the preset number of iterations.
[0061] Further, the target random value H and the fourth random number r4 can be compared, and when H≤r4, the position of the cheetah individual can be updated based on the cheetah search strategy and the fitness value of the cheetah individual. When H>r4, the position of the cheetah individual can be updated based on the cheetah attack strategy and the fitness value of each cheetah individual.
[0062] In the above embodiment, for each cheetah individual, the random number of the cheetah individual in the current iteration round is determined, and then the position of the cheetah individual is updated in different ways according to the comparison of the random numbers. Using different update methods to update the positions of different cheetahs in the same iteration round can enhance the optimization ability and prevent falling into the local optimal solution.
[0063] In one embodiment, the updating of the position of the individual cheetah based on the cheetah search strategy and the fitness value of the individual cheetah includes: In the current iteration round, the position of the cheetah individual is adjusted based on the randomization parameter and the search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual; When the fitness value corresponding to the first position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the first position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the first position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0064] Specifically, when H≤r4, the position of the cheetah individual can be adjusted based on the randomization parameter and search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual. It can be determined by the following formula:
[0065] in, Represents individual cheetahs The corresponding randomization parameters are easy to understand, and the randomization parameters may be different in each iteration round. Represents individual cheetahs The corresponding search step length may be preset as required.
[0066] Further, in the case where the fitness value corresponding to the first position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the first position of the cheetah individual can be determined as the updated position of the cheetah individual. In the case where the fitness value corresponding to the first position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment can be determined as the updated position of the cheetah individual.
[0067] In the above embodiment, the position of the cheetah individual is adjusted based on the randomization parameters and search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual, and the position with a lower fitness value is retained as the updated position of the cheetah individual, which can ensure that the cheetah individual is optimized in the direction of a lower fitness value, that is, the transmission energy consumed in the clustering scheme corresponding to the cheetah individual is gradually reduced.
[0068] In one embodiment, the updating of the position of the cheetah individual based on the cheetah attack strategy and the fitness value of each cheetah individual includes: In the current iteration round, the position of the cheetah individual with the lowest fitness value among all the cheetah individuals is determined as the position of the prey; Adjusting the position of the cheetah individual based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain a second position of the cheetah individual; When the fitness value corresponding to the second position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the second position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the second position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0069] Specifically, in the current iteration round, the position of the cheetah individual with the lowest fitness value among all cheetah individuals can be determined as the position of the prey, and then the position of the cheetah individual can be adjusted based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain the second position of the cheetah individual. It can be determined by the following formula:
[0070] in, Indicates the location of the prey in the current iteration round, Represents individual cheetahs The corresponding steering factor, Represents individual cheetahs The corresponding interaction factors.
[0071] Cheetah individual The corresponding steering factor It can be determined by the following formula:
[0072] in, represents random numbers that conform to the standard normal distribution, represents the natural exponential function.
[0073] Further, in the case where the fitness value corresponding to the second position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the second position of the cheetah individual can be determined as the updated position of the cheetah individual. In the case where the fitness value corresponding to the second position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment can be determined as the updated position of the cheetah individual.
[0074] In the above embodiment, in the current iteration round, the position of the cheetah individual with the lowest fitness value among all cheetah individuals is determined as the position of the prey, and then the position of the cheetah individual is adjusted based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain the second position of the cheetah individual. This adjustment strategy represents that the cheetah individual moves toward the cheetah individual with the lowest fitness value, which can speed up the optimization process, and retain the position with a lower fitness value as the updated position of the cheetah individual, which can ensure that the cheetah individual is optimized in the direction of a lower fitness value, that is, the transmission energy consumed in the clustering scheme corresponding to the cheetah individual gradually decreases.
[0075] Step 140: Clustering the wireless sensor network based on the target clustering scheme.
[0076] Specifically, after the target clustering scheme is determined, the wireless sensor network may be clustered based on the target clustering scheme.
[0077] The wireless sensor network clustering method provided by the present invention determines the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, and the position represents the clustering scheme of the wireless sensor network. Then, for each cheetah individual, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual, and further based on the fitness value of each cheetah individual, the target clustering scheme is iteratively determined, and finally the wireless sensor network is clustered based on the target clustering scheme. The fitness value of the cheetah individual in the technical solution of the present invention is determined based on the cluster head transmission energy and the intra-cluster transmission energy in the corresponding clustering scheme, and then the target clustering scheme with less energy consumption can be determined by the cheetah optimization algorithm. The target clustering scheme is more reasonable than the clustering scheme determined artificially through experience, and then the wireless sensor network is clustered by the target clustering scheme, which can improve the energy utilization rate of the sensor nodes in the wireless sensor network, thereby extending the life of the wireless sensor network.
[0078] The technical solution of the present invention adopts the cheetah optimization algorithm, which has relatively few parameters and fast optimization speed, effectively improves the efficiency of wireless sensor network clustering and reduces transmission energy consumption. Compared with the existing genetic algorithm and particle swarm algorithm, the technical solution of the present invention can obtain a better clustering solution in fewer iterations, and has strong global search capabilities, and will not fall into local optimality and cause evolutionary stagnation.
[0079] For example, the number of cheetah individuals in the cheetah population of the cheetah optimization algorithm is set to 50, the preset number of iterations is set to 300, the minimum value of the position change of the cheetah individual is set to -6, and the maximum value is set to 6. In the genetic algorithm for comparison, the population size is set to 50, the preset number of iterations is set to 300, the crossover probability is set to 0.75, and the mutation probability is set to 0.06. In the particle swarm algorithm for comparison, the population size is set to 50, the preset number of iterations is set to 300, the lower limit of the particle speed is set to 0, and the upper limit of the particle speed is set to 2. With the above settings, the following can be obtained: Figure 2 The experimental results shown, Figure 2 : is a schematic diagram comparing the energy consumption of clustering schemes determined by the particle swarm algorithm, cheetah algorithm and genetic algorithm in the iterative process provided by the present invention, such as Figure 2 As shown, the horizontal axis represents the iteration round, the vertical axis represents the energy consumption value (i.e., fitness value) of the corresponding clustering scheme, the black solid line represents the fitness value of the optimal individual in the genetic algorithm, the blue solid line represents the fitness value of the optimal individual in the particle swarm algorithm, and the dotted line represents the fitness value of the optimal individual in the cheetah optimization algorithm used in the present invention. Figure 2It can be seen that after the algorithm runs 300 times, the energy consumption value of the clustering solution obtained by the method of the present invention is 2.8632 lower than that of the clustering solution obtained by the particle swarm algorithm, and 3.2532 lower than that of the clustering solution obtained by the genetic algorithm. The performance of the method of the present invention is improved by 2.29% compared with the particle swarm algorithm and 2.6% compared with the genetic algorithm. In addition, Figure 2 It can also be seen that the performance of the method of the present invention in solving the problem is more stable than that of the particle swarm algorithm and the genetic algorithm. After 120 iterations, the curve gradually converges steadily and basically reaches a better solution. During the 140 iterations, the particle swarm algorithm and the genetic algorithm have no obvious upward trend in the entire curve.
[0080] The wireless sensor network clustering device provided by the present invention is described below. The wireless sensor network clustering device described below and the wireless sensor network clustering method described above can be referred to each other.
[0081] Figure 3 Schematic diagram of the structure of the wireless sensor network clustering device provided by the present invention. Figure 3 As shown, the wireless sensor network clustering device 300 includes the following modules: A determination module 310 is used to determine the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, wherein the position represents a clustering scheme of the wireless sensor network; A calculation module 320 is used to calculate the fitness value of each cheetah individual based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; An iteration module 330, configured to iteratively determine a target clustering scheme based on the fitness value of each of the cheetah individuals; The clustering module 340 is configured to cluster the wireless sensor network based on the target clustering scheme.
[0082] In one embodiment, the calculation module 320 is specifically used for: Determine a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme based on the clustering scheme corresponding to the cheetah individual; For each of the non-cluster head sensor nodes, determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node; For each of the cluster head sensor nodes, determining the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network; The sum of all the intra-cluster transmission energies and all the cluster head transmission energies is determined as the fitness value of the cheetah individual.
[0083] In one embodiment, the calculation module 320 is further configured to: Determine first transmission energies from the non-cluster head sensor nodes to each of the cluster head sensor nodes; The smallest first transmission energy among all the first transmission energies is determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node.
[0084] In one embodiment, the iteration module 330 is specifically configured to: When the iteration termination condition is reached, determining the target clustering scheme based on the fitness value of each cheetah individual in each iteration round; In the case where the iteration termination condition is not met, the position of each cheetah individual is updated based on the cheetah sit-and-wait strategy, or the fitness value of each cheetah individual; the fitness value of each cheetah individual is recalculated based on the updated position; the steps of updating the position and calculating the fitness value are continuously repeated until the iteration termination condition is met, and the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round.
[0085] In one embodiment, the iteration module 330 is further configured to: For each of the cheetah individuals, obtain a first random number, a second random number, a third random number, and a fourth random number corresponding to the cheetah individual; When the first random number is greater than or equal to the second random number, adopting the cheetah sit-and-wait strategy to update the position of the cheetah individual; When the first random number is less than the second random number, the target random value is determined based on the current number of iteration rounds and the third random number; when the target random value is less than or equal to the fourth random number, the position of the cheetah individual is updated based on the cheetah search strategy and the fitness value of the cheetah individual; when the target random value is greater than the fourth random number, the position of the cheetah individual is updated based on the cheetah attack strategy and the fitness value of each of the cheetah individuals.
[0086] In one embodiment, the iteration module 330 is further configured to: In the current iteration round, the position of the cheetah individual is adjusted based on the randomization parameter and the search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual; When the fitness value corresponding to the first position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the first position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the first position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0087] In one embodiment, the iteration module 330 is further configured to: In the current iteration round, the position of the cheetah individual with the lowest fitness value among all the cheetah individuals is determined as the position of the prey; Adjusting the position of the cheetah individual based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain a second position of the cheetah individual; When the fitness value corresponding to the second position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the second position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the second position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
[0088] In one embodiment, the iteration module 330 is further configured to: Determine the cheetah individual with the lowest fitness value in each iteration round as the global optimal cheetah individual; The clustering scheme corresponding to the position representation of the global optimal cheetah individual is determined as the target clustering scheme.
[0089] The wireless sensor network clustering device provided by the present invention determines the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, and the position represents the clustering scheme of the wireless sensor network. Then, for each cheetah individual, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual, and further based on the fitness value of each cheetah individual, the target clustering scheme is iteratively determined, and finally the wireless sensor network is clustered based on the target clustering scheme. The fitness value of the cheetah individual in the technical solution of the present invention is determined based on the cluster head transmission energy and the intra-cluster transmission energy in the corresponding clustering scheme, and then the target clustering scheme with less energy consumption can be determined by the cheetah optimization algorithm. The target clustering scheme is more reasonable than the clustering scheme determined artificially through experience, and then the wireless sensor network is clustered by the target clustering scheme, which can improve the energy utilization rate of the sensor nodes in the wireless sensor network, thereby extending the life of the wireless sensor network.
[0090] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communications interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the wireless sensor network clustering method, which includes: Determining the location of each individual cheetah in a cheetah population of a cheetah optimization algorithm, wherein the location represents a clustering scheme of a wireless sensor network; For each of the cheetah individuals, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; Iteratively determining a target clustering scheme based on the fitness value of each of the cheetah individuals; The wireless sensor network is clustered based on the target clustering scheme.
[0091] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0092] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the wireless sensor network clustering method provided by the above methods, the method includes: Determining the location of each individual cheetah in a cheetah population of a cheetah optimization algorithm, wherein the location represents a clustering scheme of a wireless sensor network; For each of the cheetah individuals, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; Iteratively determining a target clustering scheme based on the fitness value of each of the cheetah individuals; The wireless sensor network is clustered based on the target clustering scheme.
[0093] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the wireless sensor network clustering method provided by the above methods, the method comprising: Determining the location of each individual cheetah in a cheetah population of a cheetah optimization algorithm, wherein the location represents a clustering scheme of a wireless sensor network; For each of the cheetah individuals, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; Iteratively determining a target clustering scheme based on the fitness value of each of the cheetah individuals; The wireless sensor network is clustered based on the target clustering scheme.
[0094] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0095] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A wireless sensor network clustering method, characterized in that: include: Determining the location of each individual cheetah in a cheetah population of a cheetah optimization algorithm, wherein the location represents a clustering scheme of a wireless sensor network; For each of the cheetah individuals, the fitness value of the cheetah individual is calculated based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; Iteratively determining a target clustering scheme based on the fitness value of each of the cheetah individuals; The wireless sensor network is clustered based on the target clustering scheme.
2. The wireless sensor network clustering method according to claim 1, characterized in that: The step of calculating the fitness value of the cheetah individual based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual includes: Determine a plurality of cluster head sensor nodes and a plurality of non-cluster head sensor nodes corresponding to the clustering scheme based on the clustering scheme corresponding to the cheetah individual; For each of the non-cluster head sensor nodes, determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node; For each of the cluster head sensor nodes, determining the cluster head transmission energy from the cluster head sensor node to the center of the wireless sensor network; The sum of all the intra-cluster transmission energies and all the cluster head transmission energies is determined as the fitness value of the cheetah individual.
3. The wireless sensor network clustering method according to claim 2, characterized in that: The determining the intra-cluster transmission energy corresponding to the non-cluster head sensor node comprises: Determine first transmission energies from the non-cluster head sensor nodes to each of the cluster head sensor nodes; The smallest first transmission energy among all the first transmission energies is determined as the intra-cluster transmission energy corresponding to the non-cluster head sensor node.
4. The wireless sensor network clustering method according to any one of claims 1 to 3, characterized in that: The step of iteratively determining a target clustering scheme based on the fitness value of each cheetah individual comprises: When the iteration termination condition is reached, determining the target clustering scheme based on the fitness value of each cheetah individual in each iteration round; In the case where the iteration termination condition is not met, the position of each cheetah individual is updated based on the cheetah sit-and-wait strategy, or the fitness value of each cheetah individual; the fitness value of each cheetah individual is recalculated based on the updated position; the steps of updating the position and calculating the fitness value are continuously repeated until the iteration termination condition is met, and the target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round.
5. The wireless sensor network clustering method according to claim 4, characterized in that: The method of updating the position of each cheetah individual based on the cheetah sit-and-wait strategy or the fitness value of each cheetah individual includes: For each of the cheetah individuals, obtain a first random number, a second random number, a third random number, and a fourth random number corresponding to the cheetah individual; When the first random number is greater than or equal to the second random number, adopting the cheetah sit-and-wait strategy to update the position of the cheetah individual; When the first random number is less than the second random number, the target random value is determined based on the current number of iteration rounds and the third random number; when the target random value is less than or equal to the fourth random number, the position of the cheetah individual is updated based on the cheetah search strategy and the fitness value of the cheetah individual; when the target random value is greater than the fourth random number, the position of the cheetah individual is updated based on the cheetah attack strategy and the fitness value of each of the cheetah individuals.
6. The wireless sensor network clustering method according to claim 5, characterized in that: The updating of the position of the individual cheetah based on the cheetah search strategy and the fitness value of the individual cheetah includes: In the current iteration round, the position of the cheetah individual is adjusted based on the randomization parameter and the search step size corresponding to the cheetah individual to obtain the first position of the cheetah individual; When the fitness value corresponding to the first position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the first position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the first position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
7. The wireless sensor network clustering method according to claim 5, characterized in that: The updating of the position of the cheetah individual based on the cheetah attack strategy and the fitness value of each cheetah individual includes: In the current iteration round, the position of the cheetah individual with the lowest fitness value among all the cheetah individuals is determined as the position of the prey; Adjusting the position of the cheetah individual based on the position of the prey, the turning factor corresponding to the cheetah individual, and the interaction factor to obtain a second position of the cheetah individual; When the fitness value corresponding to the second position of the cheetah individual is less than the fitness value corresponding to the position of the cheetah individual before adjustment, the second position of the cheetah individual is determined as the updated position of the cheetah individual; when the fitness value corresponding to the second position of the cheetah individual is greater than or equal to the fitness value corresponding to the position of the cheetah individual before adjustment, the position of the cheetah individual before adjustment is determined as the updated position of the cheetah individual.
8. The wireless sensor network clustering method according to claim 4, characterized in that: The target clustering scheme is determined based on the fitness value of each cheetah individual in each iteration round, including: Determine the cheetah individual with the lowest fitness value in each iteration round as the global optimal cheetah individual; The clustering scheme corresponding to the position representation of the global optimal cheetah individual is determined as the target clustering scheme.
9. A wireless sensor network clustering device, characterized in that: include: A determination module, used to determine the position of each cheetah individual in the cheetah population of the cheetah optimization algorithm, wherein the position represents a clustering scheme of the wireless sensor network; A calculation module, for calculating the fitness value of each cheetah individual based on the cluster head transmission energy and the intra-cluster transmission energy in the clustering scheme corresponding to the cheetah individual; An iterative module, used for iteratively determining a target clustering scheme based on the fitness value of each cheetah individual; The clustering module is used to cluster the wireless sensor network based on the target clustering scheme.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the wireless sensor network clustering method according to any one of claims 1 to 8 is implemented.
