Routing protocol optimization method and device of wireless sensor network, equipment and medium

The wireless sensor network routing protocol is optimized through the particle swarm optimization algorithm, which solves the problems of incomplete and inaccurate routing protocols in the existing technology and achieves efficient data transmission and low energy consumption.

CN118540756APending Publication Date: 2024-08-23SHENZHEN OCEAN KING RAILWAY LIGHTING TECH CO LTD +11
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410310994.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing wireless sensor network routing protocols have problems such as incomplete and inaccurate solutions, high routing overhead, low data throughput, and high data transmission delay.

Method used

The particle swarm optimization algorithm is used to randomly generate particles, calculate fitness values, update individual and global optimal solutions, and iteratively optimize the routing protocol until the iteration threshold is reached to determine the optimal routing protocol.

Benefits of technology

It maximizes data throughput, minimizes delay, reduces routing overhead and energy utilization, and improves the duration and packet transmission rate of wireless networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540756A
    Figure CN118540756A
Patent Text Reader

Abstract

The invention is applicable to the technical field of wireless sensor networks, and provides a routing protocol optimization method for a wireless sensor network, which comprises the following steps of: randomly generating a group of particles corresponding to an initial routing solution of a target wireless sensor network, initializing each particle, calculating the fitness value of each particle by adopting a fitness value calculation formula, updating an individual optimal solution of each particle and a global optimal solution of a population formed by all particles based on the fitness value of each particle, and updating the position and the speed of each particle based on the individual optimal solution, the global optimal solution and a particle updating equation to obtain the position and the speed of each particle. And iterating the population until the iteration is finished, and finally determining the global optimal solution as the optimal routing protocol of the target wireless sensor network, thereby realizing throughput maximization and delay minimization, reducing the routing overhead and the energy utilization rate, and improving the routing efficiency. And the duration of the wireless network, the data packet transmission rate and the performance of the application program of the Internet of Things based on the WSN are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of wireless sensor networks, and in particular relates to a routing protocol optimization method, device, equipment and medium for wireless sensor networks. Background Art

[0002] Wireless Sensor Networks (WSNs) integrate communication, sensor and distributed information processing technologies to form a network composed of a large number of micro sensor nodes in a multi-hop or single-hop communication mode. In WSNs, due to the exponential growth of smartphones and Internet of Things (IoT) devices, the quality of service (QoS) requirements are becoming more and more important. This not only involves key performance indicators such as end-to-end delay, energy consumption and packet loss, but also how to manage routing data more effectively. Among them, the network layer routing protocol is the key to the reliable and effective transmission of collected data in WSNs.

[0003] At present, B. Guruprakash, C. Balasubramanian and R. Sukumar proposed a method for achieving energy efficient and delay aware WSN by adopting multi-objective clustering and data collection along with node sleep scheduling in the journal Peer-to-Peer Networking and Applications. The method uses a sleep scheduling scheme to save power and improve the life cycle of the entire network. Through the selective tracking search algorithm, the method finds a suitable path between the source-destination pair. This method significantly reduces energy consumption, delay and overhead, and improves the life and transmission efficiency of the network. However, this method has some potential defects. First, the use of the selective tracking search algorithm may miss some potential solutions in the process of selecting the source-destination pair, resulting in the final result being not comprehensive or deviating from the optimal solution; second, in the selective tracking process, due to the deliberate neglect of some areas of the search space, certain deviations may be introduced, resulting in the algorithm's results being not accurate or comprehensive. In addition, in recent years, researchers have used ant colony algorithms, genetic algorithms, and particle swarm optimization algorithms to optimize wireless sensor network routing. Through individual collaboration and distributed computing in the group, they have accelerated the optimization speed and improved routing efficiency. Among them, the particle swarm optimization algorithm (PSO) has been widely used due to its small number of parameters and easy implementation. However, the basic particle swarm algorithm has the disadvantage of being easy to stagnate and fall into local optimality in the WSNs routing optimization process, making it difficult to obtain the global optimality. Therefore, a new routing protocol optimization method for wireless sensor networks is urgently needed to solve the above problems. Summary of the invention

[0004] The purpose of the present invention is to provide a routing protocol optimization method, device, equipment and medium for wireless sensor networks, aiming to solve the problems of incomplete and inaccurate solutions to WSNs routing protocols due to the prior art, large routing overhead, low data throughput and high data transmission delay.

[0005] In one aspect, the present invention provides a method for optimizing a routing protocol of a wireless sensor network, the method comprising the following steps:

[0006] Based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, randomly generate a group of particles corresponding to the initial routing solution, and initialize each of the particles;

[0007] The fitness value corresponding to each particle is calculated using a preset fitness value calculation formula;

[0008] Based on the fitness value corresponding to each particle, updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles;

[0009] Based on the individual optimal solution, the global optimal solution and a preset particle update equation, the position and velocity of each particle are updated respectively;

[0010] Determine whether the current iteration number of the population reaches a preset population iteration threshold. If yes, determine the global optimal solution as the optimal routing protocol of the target wireless sensor network. Otherwise, update the current iteration number of the population, and jump to the step of using the preset fitness value calculation formula to calculate the fitness value corresponding to each particle.

[0011] Preferably, the step of calculating the fitness value corresponding to each of the particles using a preset fitness value calculation formula comprises:

[0012] The fitness value calculation formula FitnessVal is used i = dist(i, base)+E(s, dist(i, base)) calculates the fitness value corresponding to each particle respectively, wherein FitnessVali is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist().

[0013] Preferably, the fitness value calculation formula FitnessVal i = dist(i, base) + E(s, dist(i, base)) The step of calculating the fitness value corresponding to each particle includes:

[0014] The Euclidean algorithm is used to calculate the minimum distance dist(i, base) between each particle and the receiver node base;

[0015] The preset energy consumption calculation formula E(s, d) = E T (s,d)+ER (s) calculates the energy E(s, dist(i, base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where: E R (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, and d0 is the distance threshold.

[0016] Preferably, the step of updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles based on the fitness value corresponding to each particle comprises:

[0017] For each of the particles, when the fitness value of the particle is lower than the fitness value corresponding to the individual optimal solution experienced by the particle, the individual optimal solution of the particle is updated using the current position of the particle;

[0018] For each of the particles, when the fitness value of the particle is lower than the fitness value corresponding to the global optimal solution experienced by the population, the global optimal solution is updated using the current position of the particle.

[0019] Preferably, the step of updating the position and velocity of each particle based on the individual optimal solution, the global optimal solution and a preset particle update equation comprises:

[0020] Using the particle velocity update formula in the particle update equation The velocity of each particle is updated respectively, where: is the d-th dimension component of the flight velocity vector of particle i in the k-th iteration, is the d-th dimension component of the position vector of particle i at the k-th iteration, c1 and c2 are constants, ω is the inertia weight, r1 and r2 are uniformly distributed random values ​​set in [0,1], p id is the individual optimal solution p of particle i ibest The d-th dimension component, p bd is the global optimal solution g best The d-th dimension component of ;

[0021] Using the particle position update formula in the particle update equation The position of each particle is updated respectively.

[0022] In another aspect, the present invention provides a routing protocol optimization device for a wireless sensor network, the device comprising:

[0023] A particle swarm initialization unit, used for randomly generating a group of particles corresponding to the initial routing solution based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, and initializing each of the particles;

[0024] A fitness value calculation unit, used to calculate the fitness value corresponding to each of the particles using a preset fitness value calculation formula;

[0025] An optimal solution updating unit, used for updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles based on the fitness value corresponding to each particle;

[0026] A particle parameter updating unit, used to update the position and velocity of each particle based on the individual optimal solution, the global optimal solution and a preset particle update equation;

[0027] The routing protocol determination unit is used to determine whether the current iteration number of the population reaches a preset population iteration threshold. If yes, the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network. Otherwise, the current iteration number of the population is updated, and the fitness value calculation unit is triggered to execute the function of calculating the fitness value corresponding to each particle using a preset fitness value calculation formula.

[0028] Preferably, the fitness value calculation unit includes:

[0029] The fitness calculation subunit is used to calculate the fitness value using the fitness value calculation formula FitnessVal i = dist(i, base) + E(s, dist(i, base)) calculates the fitness value corresponding to each particle respectively, where FitnessVal i is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist().

[0030] Preferably, the fitness calculation subunit includes:

[0031] A transmission distance calculation unit, used for calculating the minimum distance dist(i, base) between each particle and a receiver node base by using a Euclidean algorithm;

[0032] Energy consumption calculation unit, used to use the preset energy consumption calculation formula E(s, d) = E T (s,d)+E R (s) calculates the energy E(s, dist(i, base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where: E R (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, and d0 is the distance threshold.

[0033] On the other hand, 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 computer program, the steps described in the above-mentioned method for optimizing routing protocols in wireless sensor networks are implemented.

[0034] On the other hand, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps described in the above-mentioned method for optimizing routing protocols in wireless sensor networks are implemented.

[0035] The present invention randomly generates a group of particles corresponding to the initial routing solution based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, initializes each particle, respectively calculates the fitness value corresponding to each particle using a fitness value calculation formula, updates the individual optimal solution corresponding to each particle and the global optimal solution of a population composed of all particles based on the fitness value corresponding to each particle, updates the position and speed of each particle based on the individual optimal solution, the global optimal solution and the particle update equation, iterates the population until a population iteration threshold is reached, and finally determines the global optimal solution as the optimal routing protocol of the target wireless sensor network, thereby maximizing throughput and minimizing delay, reducing routing overhead and energy utilization, and improving wireless network duration, data packet transmission rate and performance of WSN-based Internet of Things applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a flow chart of the implementation of the routing protocol optimization method for a wireless sensor network provided in the first embodiment of the present invention;

[0037] Figure 2 It is a structural diagram of a routing protocol optimization device for a wireless sensor network provided in Embodiment 2 of the present invention;

[0038] Figure 3 This is a schematic diagram of a preferred structure of a routing protocol optimization device for a wireless sensor network provided in Embodiment 2 of the present invention;

[0039] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0041] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments:

[0042] Embodiment 1:

[0043] Figure 1 The implementation process of the routing protocol optimization method of the wireless sensor network provided by the first embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0044] In step S101, based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, a group of particles corresponding to the initial routing solution is randomly generated, and each particle is initialized.

[0045] In the embodiment of the present invention, the initial routing solution is a possible routing path for data to be transmitted from a source node to a target node in a target wireless sensor. The initial routing solution is determined according to the number n of sensor nodes in the target wireless sensor network, the positions of the sensor nodes in the target wireless sensor network, and the network structure of the target wireless sensor network. The size M of the population is set according to the total number of the initial routing solutions. Each particle in the population represents a possible routing path (i.e., an initial routing solution), and the position and speed of each particle are randomly initialized. The position and speed of the i-th particle in the population are respectively represented as X i =(x i1 , xi2 , ..., x id ) and V i =(v i1 , v i2 , ..., v id ), where d∈n, n is the dimension of the search space determined by the number of sensor nodes n.

[0046] In step S102, the fitness value corresponding to each particle is calculated using a preset fitness value calculation formula.

[0047] In the embodiment of the present invention, a preset fitness value calculation formula is used to calculate the fitness value corresponding to each particle, so as to determine the quality of the solution according to the fitness value of the particle. The lower the fitness value, the higher the quality of the solution, that is, the better the particle.

[0048] In a feasible embodiment, the fitness value calculation formula FitnessVal is used. i = dist(i, base) + E(s, dist(i, base)) calculates the fitness value corresponding to each particle respectively, where FitnessVal i is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist(), thereby improving the stability and reliability of data transmission.

[0049] In another feasible embodiment, the calculation of the fitness value is achieved through the following steps:

[0050] ① Use the Euclidean algorithm to calculate the minimum distance dist(i, base) between each particle and the receiver node base;

[0051] In the embodiment of the present invention, the minimum distance between particle i and receiver node base is obtained by calculating the Euclidean distance between the position of particle i and the position of base, that is, dist(i, base) = || X i -X base ||2, where ||·||2 represents the Euclidean norm.

[0052] ②Use the preset energy consumption calculation formula E(s, d) = E T (s,d)+E R (s) Calculate the energy E(s, dist(i, base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where ER (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, d0 is the distance threshold

[0053] In the embodiment of the present invention, the sensor node consumes energy when transmitting and receiving data. Based on this, the energy consumption calculation formula E(s, d)=E T (s,d)+E R (s) Calculate the energy consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), that is, E(s, dist(i, base)) = E T (s, dist(i, base))+E R (s), where the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d is calculated using the formula The energy consumed by a node receiving s bits of data is calculated using the formula E R (s) = E unit *s is calculated, E unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, is the distance threshold. If the distance d is less than d0, the free space propagation model is used, otherwise the multipath fading channel model is used.

[0054] The fitness value is calculated through the above steps ① and ②, thereby maximizing throughput, minimizing latency, and reducing routing overhead and energy utilization.

[0055] In step S103, based on the fitness value corresponding to each particle, the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all particles are updated.

[0056] In the embodiment of the present invention, the individual optimal solution is the best position found by the particle so far, and the global optimal solution is the best position found by the entire particle swarm.

[0057] In a feasible embodiment, the updating of the individual optimal solution and the global optimal solution is achieved through the following steps:

[0058] (1) For each particle, when the fitness value of the particle is lower than the fitness value corresponding to the individual optimal solution that the particle has experienced, the individual optimal solution of the particle is updated with the current position of the particle;

[0059] In the embodiment of the present invention, for each particle, when the current fitness value of the i-th particle is FitnessVal i Lower than the individual optimal solution experienced by the particle When the corresponding fitness value is used, the current position X of the particle is used. i The individual optimal solution for the particle To update,

[0060] (2) For each particle, when the fitness value of the particle is lower than the fitness value corresponding to the global optimal solution experienced by the population, the global optimal solution is updated using the current position of the particle.

[0061] In the embodiment of the present invention, for each particle, the fitness value corresponding to each particle is compared with the global optimal solution g experienced by the population. best The corresponding fitness values ​​are compared. If the fitness value of a particle is lower than the global optimal solution g experienced by the population, best When the corresponding fitness value is i For the global optimal solution g best Update, that is, g best =X i .

[0062] Through the above steps (1) and (2), the individual optimal solution and the global optimal solution are updated, thereby improving the accuracy and comprehensiveness of the solution.

[0063] In step S104, based on the individual optimal solution, the global optimal solution and the preset particle update equation, the position and velocity of each particle are updated respectively.

[0064] In the embodiment of the present invention, the PSO algorithm is used to enable particles to move in the search space and find better solutions by continuously updating their positions and velocities.

[0065] In a feasible embodiment, the position and velocity of the particle are updated by the following steps:

[0066] ①Use the particle velocity update formula in the particle update equation Update the velocity of each particle separately, where is the d-th dimension component of the flight velocity vector of particle i in the k-th iteration, is the d-th dimension component of the position vector of particle i at the k-th iteration, c1 and c2 are constants, respectively called scaling parameters of social cognition and behavior (usually c1 = c2), ω is the inertia weight, which starts from 0.9 and then decreases linearly to 0.4 to improve the quality of the solution, r1 and r2 are uniformly distributed random values ​​set in [0,1], p id is the individual optimal solution of particle i The d-th dimension component, p bd is the global optimal solution g best The d-th dimension component of ;

[0067] ②Use the particle position update formula in the particle update equation Update the position of each particle separately.

[0068] Through the above steps ① and ②, the position and velocity of the particle are updated, so that a better global optimal solution can be obtained later.

[0069] In step S105, it is determined whether the current iteration number of the population reaches a preset population iteration threshold.

[0070] In the embodiment of the present invention, when the current iteration number of the population reaches the population iteration threshold, step S107 is executed, otherwise, step S106 is executed to continue iterating the population.

[0071] In step S106, the current iteration number of the population is updated.

[0072] In the embodiment of the present invention, when the current number of iterations of the population does not reach the preset population iteration threshold, the current number of iterations of the population is accumulated and added by 1 (i.e., s=s+1), and the process jumps to step S102 to continue execution, so as to recalculate the fitness value of the particle and update the individual optimal solution and the global optimal solution.

[0073] In step S107, the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network.

[0074] In the embodiment of the present invention, when the current iteration number of the population reaches a preset population iteration threshold, the population iteration ends, and the global optimal solution is the optimal routing protocol of the wireless sensor network found by the PSO algorithm.

[0075] In an embodiment of the present invention, based on an initial routing solution of a target wireless sensor network and the number of sensor nodes in the target wireless sensor network, a group of particles corresponding to the initial routing solution are randomly generated, and each particle is initialized. The fitness value corresponding to each particle is calculated using a fitness value calculation formula. Based on the fitness value corresponding to each particle, the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all particles are updated. Based on the individual optimal solution, the global optimal solution and the particle update equation, the position and speed of each particle are updated respectively, the population is iterated until a population iteration threshold is reached, and finally the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network, thereby maximizing throughput, minimizing delay, reducing routing overhead and energy utilization, and improving wireless network duration, data packet transmission rate and performance of WSN-based Internet of Things applications.

[0076] Embodiment 2:

[0077] Figure 2 The structure of the routing protocol optimization device for a wireless sensor network provided by the second embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, including:

[0078] A particle swarm initialization unit 21 is used to randomly generate a group of particles corresponding to the initial routing solution based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, and initialize each particle;

[0079] A fitness value calculation unit 22 is used to calculate the fitness value corresponding to each particle using a preset fitness value calculation formula;

[0080] The optimal solution updating unit 23 is used to update the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all particles based on the fitness value corresponding to each particle;

[0081] A particle parameter updating unit 24 is used to update the position and velocity of each particle based on the individual optimal solution, the global optimal solution and a preset particle update equation;

[0082] The routing protocol determination unit 25 is used to determine whether the current iteration number of the population reaches a preset population iteration threshold. If so, the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network. Otherwise, the current iteration number of the population is updated, and the fitness value calculation unit 22 is triggered to execute the function of calculating the fitness value corresponding to each particle using a preset fitness value calculation formula.

[0083] like Figure 3As shown, preferably, the fitness value calculation unit 22 includes:

[0084] Fitness calculation subunit 221, used to calculate the fitness value using the fitness value formula FitnessVal i = dist(i, base) + E(s, dist(i, base)) calculates the fitness value corresponding to each particle respectively, where FitnessVal i is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist().

[0085] The fitness calculation subunit 221 includes:

[0086] The transmission distance calculation unit 2211 is used to calculate the minimum distance dist(i, base) between each particle and the receiver node base using the Euclidean algorithm;

[0087] Energy consumption calculation unit 2212, used to use a preset energy consumption calculation formula E(s, d) = E T (s,d)+E R (s) Calculate the energy E(s, dist(i, base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where E R (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, and d0 is the distance threshold.

[0088] The optimal solution updating unit 23 includes:

[0089] The individual solution updating unit 231 is used for updating the individual optimal solution of each particle with the current position of the particle when the fitness value of the particle is lower than the fitness value corresponding to the individual optimal solution experienced by the particle;

[0090] The global solution updating unit 232 is used for updating the global optimal solution with the current position of each particle when the fitness value of the particle is lower than the fitness value corresponding to the global optimal solution experienced by the population.

[0091] The particle parameter updating unit 24 comprises:

[0092] The particle speed updating unit 241 is used to update the particle speed using the particle speed updating formula in the particle updating equation. Update the velocity of each particle separately, where is the d-th dimension component of the flight velocity vector of particle i in the k-th iteration, is the d-th dimension component of the position vector of particle i at the k-th iteration, c1 and c2 are constants, ω is the inertia weight, r1 and r2 are uniformly distributed random values ​​set in [0,1], p id is the individual optimal solution of particle i The d-th dimension component, p bd is the global optimal solution g best The d-th dimension component of ;

[0093] The particle position updating unit 242 is used to use the particle position updating formula in the particle updating equation Update the position of each particle separately.

[0094] In the embodiment of the present invention, each unit of the routing protocol optimization device of the wireless sensor network can be implemented by a corresponding hardware or software unit, and each unit can be an independent software or hardware unit, or can be integrated into a software or hardware unit, which is not intended to limit the present invention. Specifically, the implementation of each unit can refer to the description of the aforementioned embodiment 1, which will not be repeated here.

[0095] Embodiment three:

[0096] Figure 4 The structure of an electronic device provided by the third embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown.

[0097] The electronic device 4 of the embodiment of the present invention includes a processor 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processor 40. When the processor 40 executes the computer program 42, the steps of the above-mentioned wireless sensor network routing protocol optimization method embodiment are implemented, such as Figure 1 Alternatively, when the processor 40 executes the computer program 42, the functions of each unit in the above-mentioned device embodiments are realized, for example Figure 2 The functions of units 21 to 25 are shown.

[0098] In an embodiment of the present invention, based on an initial routing solution of a target wireless sensor network and the number of sensor nodes in the target wireless sensor network, a group of particles corresponding to the initial routing solution are randomly generated, and each particle is initialized. The fitness value corresponding to each particle is calculated using a fitness value calculation formula. Based on the fitness value corresponding to each particle, the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all particles are updated. Based on the individual optimal solution, the global optimal solution and the particle update equation, the position and speed of each particle are updated respectively, the population is iterated until a population iteration threshold is reached, and finally the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network, thereby maximizing throughput, minimizing delay, reducing routing overhead and energy utilization, and improving wireless network duration, data packet transmission rate and performance of WSN-based Internet of Things applications.

[0099] The electronic device of the embodiment of the present invention may be a personal computer or a server. The steps implemented when the processor 40 in the electronic device 4 executes the computer program 42 to implement the routing protocol optimization method of the wireless sensor network can refer to the description of the above method embodiment, which will not be repeated here.

[0100] Embodiment 4:

[0101] In an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned wireless sensor network routing protocol optimization method embodiment are implemented, for example, Figure 1 Alternatively, when the computer program is executed by a processor, the functions of each unit in the above-mentioned device embodiments are realized, for example Figure 2 The functions of units 21 to 25 are shown.

[0102] In an embodiment of the present invention, based on an initial routing solution of a target wireless sensor network and the number of sensor nodes in the target wireless sensor network, a group of particles corresponding to the initial routing solution are randomly generated, and each particle is initialized. The fitness value corresponding to each particle is calculated using a fitness value calculation formula. Based on the fitness value corresponding to each particle, the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all particles are updated. Based on the individual optimal solution, the global optimal solution and the particle update equation, the position and speed of each particle are updated respectively, the population is iterated until a population iteration threshold is reached, and finally the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network, thereby maximizing throughput, minimizing delay, reducing routing overhead and energy utilization, and improving wireless network duration, data packet transmission rate and performance of WSN-based Internet of Things applications.

[0103] The computer-readable storage medium of the embodiment of the present invention may include any entity or device or recording medium capable of carrying computer program code, for example, ROM / RAM, magnetic disk, optical disk, flash memory and other memories.

[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A routing protocol optimization method for a wireless sensor network, characterized in that: The method comprises the following steps: Based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, randomly generate a group of particles corresponding to the initial routing solution, and initialize each of the particles; The fitness value corresponding to each particle is calculated using a preset fitness value calculation formula; Based on the fitness value corresponding to each particle, updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles; Based on the individual optimal solution, the global optimal solution and a preset particle update equation, the position and velocity of each particle are updated respectively; Determine whether the current iteration number of the population reaches a preset population iteration threshold. If yes, determine the global optimal solution as the optimal routing protocol of the target wireless sensor network. Otherwise, update the current iteration number of the population, and jump to the step of using the preset fitness value calculation formula to calculate the fitness value corresponding to each particle.

2. The method according to claim 1, characterized in that The step of using a preset fitness value calculation formula to calculate the fitness value corresponding to each particle includes: The fitness value calculation formula FitnessVal is used i = dist(i, base) + E(s, dist(i, base)) calculates the fitness value corresponding to each particle, where FitnessVal i is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist().

3. The method according to claim 2, characterized in that The fitness value calculation formula FitnessVal i = dist(i, base) + E(s, dist(i, base)) The step of calculating the fitness value corresponding to each particle includes: The Euclidean algorithm is used to calculate the minimum distance dist(i, base) between each particle and the receiver node base; The preset energy consumption calculation formula E(s,d)=E T (s,d)+E R (s) calculates the energy E(s,dist(i,base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where: E R (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, and d0 is the distance threshold.

4. The method according to claim 1, characterized in that The step of updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles based on the fitness value corresponding to each particle comprises: For each of the particles, when the fitness value of the particle is lower than the fitness value corresponding to the individual optimal solution experienced by the particle, the individual optimal solution of the particle is updated using the current position of the particle; For each of the particles, when the fitness value of the particle is lower than the fitness value corresponding to the global optimal solution experienced by the population, the global optimal solution is updated using the current position of the particle.

5. The method according to claim 1, characterized in that The step of updating the position and velocity of each particle based on the individual optimal solution, the global optimal solution and a preset particle update equation comprises: Using the particle velocity update formula in the particle update equation The velocity of each particle is updated respectively, where: is the d-th dimension component of the flight velocity vector of particle i in the k-th iteration, is the d-th dimension component of the position vector of particle i at the k-th iteration, c1 and c2 are constants, ω is the inertia weight, r1 and r2 are uniformly distributed random values ​​set in [0,1], p id is the individual optimal solution of particle i The d-th dimension component, p bd is the global optimal solution g best The d-th dimension component of ; Using the particle position update formula in the particle update equation The position of each particle is updated respectively.

6. A routing protocol optimization device for a wireless sensor network, characterized in that: The device comprises: A particle swarm initialization unit, used for randomly generating a group of particles corresponding to the initial routing solution based on the initial routing solution of the target wireless sensor network and the number of sensor nodes in the target wireless sensor network, and initializing each of the particles; A fitness value calculation unit, used to calculate the fitness value corresponding to each of the particles using a preset fitness value calculation formula; An optimal solution updating unit, used for updating the individual optimal solution corresponding to each particle and the global optimal solution of the population composed of all the particles based on the fitness value corresponding to each particle; A particle parameter updating unit, used to update the position and velocity of each particle based on the individual optimal solution, the global optimal solution and a preset particle update equation; The routing protocol determination unit is used to determine whether the current iteration number of the population reaches a preset population iteration threshold. If yes, the global optimal solution is determined as the optimal routing protocol of the target wireless sensor network. Otherwise, the current iteration number of the population is updated, and the fitness value calculation unit is triggered to execute the function of calculating the fitness value corresponding to each particle using a preset fitness value calculation formula.

7. The device according to claim 6, characterized in that The fitness value calculation unit comprises: The fitness calculation subunit is used to calculate the fitness value using the fitness value calculation formula FitnessVal i = dist(i, base) + E(s, dist(i, base)) calculates the fitness value corresponding to each particle, where FitnessVal i is the fitness value of the ith particle, dist(i, base) represents the minimum distance for the ith particle to transmit s bits of data to the receiver node base, and E(s, dist(i, base)) represents the energy consumed by the ith particle when the transmitted data is s bits and the transmission distance is dist().

8. The device according to claim 7, characterized in that The fitness calculation subunit comprises: A transmission distance calculation unit, used for calculating the minimum distance dist(i, base) between each particle and a receiver node base by using a Euclidean algorithm; Energy consumption calculation unit, used to use the preset energy consumption calculation formula E(s,d)=E T (s,d)+E R (s) calculates the energy E(s,dist(i,base)) consumed by each particle when the transmitted data is s bits and the transmission distance is dist(), where: E R (s) = E unit *s,E R (s) represents the energy consumed by the sensor node when receiving s bits of data, E T (s, d) represents the energy consumed by a node when transmitting s bits of data to an adjacent sensor node at a distance d. unit is the energy required by the node to process a unit bit of data, ε f and ε m is the communication energy parameter, and d0 is the distance threshold.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.