Wireless sensor network unicast routing optimization method and device
Patent Information
- Application Number
- CN202411662099.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-04-01
Smart Images

Figure CN119743813A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication technology, and in particular to a method and device for optimizing unicast routing in a wireless sensor network. Background Art
[0002] With the rapid development of science and technology, the application of wireless sensor networks (WSN) is becoming more and more extensive, especially in environments that require high dynamics and adaptability, such as mountain forest search, smart agriculture, emergency communications, and smart transportation. These applications usually require the network to quickly adapt to environmental changes and achieve efficient data transmission and processing.
[0003] Traditional routing algorithms, such as shortest path first and broadcast transmission, often fail to meet the requirements of wireless sensor networks in terms of energy efficiency, network latency, and routing load. Although these algorithms perform well in some simple applications, they may not be able to effectively balance routing efficiency and energy consumption in scenarios that require high data rates and multiple Quality of Service (QoS) requirements. In addition, frequent communication and data processing by sensor nodes may lead to rapid energy depletion, thus affecting the life and performance of the network.
[0004] With the diversification of application requirements, a single routing strategy is difficult to adapt to all scenarios. For example, environmental monitoring may require a long network life, while emergency response systems may require low latency. The existing technology lacks a flexible routing optimization mechanism that can dynamically adjust the routing strategy according to the network status and application requirements to optimize energy consumption and enhance the reliability of data transmission. Summary of the invention
[0005] The present invention provides a method and device for optimizing unicast routing in a wireless sensor network, which is used to solve the defects that routing algorithms in the prior art cannot meet the various requirements of wireless sensor networks and are difficult to adapt to diversified scenarios, and dynamically adjust routing strategies according to network status and application requirements, effectively balancing routing efficiency and energy consumption.
[0006] The present invention provides a method for optimizing unicast routing in a wireless sensor network, comprising the following steps: Acquire the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network; Constructing an objective function based on the communication capability of each node and the QoS parameter of each link; The objective function is solved based on the giant water lily algorithm to obtain a unicast routing path result in the wireless sensor network.
[0007] According to a wireless sensor network unicast routing optimization method provided by the present invention, the objective function is solved based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network, specifically comprising: Initialize the giant water lily algorithm to obtain the initial growth probability path set; Obtaining the fitness value of each path in the initial growth probability path set based on the objective function, and determining the optimal path position in the initial growth probability path set based on the fitness value of each path; the optimal path position includes the optimal growth probability path position and the suboptimal growth probability path position; Based on the optimal path position, the initial growth probability path set is updated and replaced with a growth probability to obtain an updated and replaced growth probability path set; When the preset conditions are met, the optimal path position in the updated and replaced growth probability path set is output as the unicast routing path result in the wireless sensor network; when the preset conditions are not met, the steps of obtaining the fitness value of each path in the updated and replaced growth probability path set based on the objective function, determining the optimal path position in the updated and replaced growth probability path set, and performing growth probability update and growth probability replacement on the updated and replaced growth probability path set are repeated until the preset conditions are met.
[0008] According to a wireless sensor network unicast routing optimization method provided by the present invention, the initial growth probability path set and the optimal growth probability path in the updated and replaced growth probability path set are updated based on the following formula:
[0009] in, represents the growth probability of the optimal growth probability path after the t-th growth probability update; Represents the position of the optimal growth probability path during the t-th growth probability update; Indicates the position of the suboptimal growth probability path during the t-th growth probability update; represents the growth probability of the optimal growth probability path before the tth iteration; is a random coefficient between [0.1,0.95]; is the weight coefficient, , is a random number between [0.05, 0.98]; PD represents the density of path selection, , MGF represents the number of optimal growth probability paths, and MDF represents the number of suboptimal growth probability paths.
[0010] According to a wireless sensor network unicast routing optimization method provided by the present invention, the suboptimal growth probability paths in the initial growth probability path set and the updated and replaced growth probability path set are updated based on the following formula:
[0011] in, represents the growth probability of the suboptimal growth probability path after the t-th growth probability update; is a random number between [0,1]; Represents the position of the optimal growth probability path during the t-th growth probability update; represents the growth probability of the suboptimal growth probability path before the t-th growth probability update; represents the update intensity of the growth probability path, , and A constant used to control the variation in the update strength of the growing probability path, It decreases linearly to 0 with the preset number of iterations.
[0012] According to a wireless sensor network unicast routing optimization method provided by the present invention, the initial growth probability path set and the updated growth probability path set are replaced by growth probability according to the following formula:
[0013] in, represents the optimal growth probability path when the t-th growth probability is updated and replaced, It represents the suboptimal growth probability path when the t-th growth probability is updated and replaced, and EP is the fitness function.
[0014] According to a wireless sensor network unicast routing optimization method provided by the present invention, the giant water lily algorithm is initialized to obtain an initial growth probability path set, specifically including: Randomly generate an N×L two-dimensional matrix, where N represents the number of nodes in the wireless sensor network, L represents the number of paths in the wireless sensor network, and each component of the N×L two-dimensional matrix represents the initial growth probability of each path; Based on the N×L two-dimensional matrix, multiple groups of path selection matrices are generated through ecological competition mapping, and each component of the multiple groups of path selection matrices is mapped to a value interval of growth probability to generate an initial growth probability path set.
[0015] The present invention also provides a wireless sensor network unicast routing optimization device, comprising the following modules: An acquisition module, used to acquire the communication capability of each node in the wireless sensor network and the quality of service QoS parameters of each link in the wireless sensor network; A construction module, configured to construct an objective function based on the communication capability of each node and the QoS parameter of each link; The solution module is used to solve the objective function based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network.
[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 one of the wireless sensor network unicast routing optimization 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 method for optimizing unicast routing in a wireless sensor network as described 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 computer program implements any of the above-mentioned methods for optimizing unicast routing in a wireless sensor network.
[0019] The wireless sensor network unicast routing optimization method and device provided by the present invention obtain the communication capability of each node and the QoS parameters of each link in the wireless sensor network, construct an objective function according to the communication capability of each node and the QoS parameters of each link, and then solve the objective function through the giant water lily algorithm. It can provide a more reasonable and accurate routing optimization strategy for data transmission in the wireless sensor network, improve the energy efficiency and reliability of routing, reduce energy consumption and enhance network performance, thereby extending the operating life of the wireless sensor network and reducing the impact on the environment. 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 unicast routing optimization method provided by the present invention.
[0022] Figure 2 It is a schematic diagram of performance comparison between the unicast routing optimization method provided by the present invention and the existing routing optimization method.
[0023] Figure 3 It is a structural schematic diagram of the wireless sensor network unicast routing optimization 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] Figure 1 FIG. 1 is a flow chart of the wireless sensor network unicast routing optimization method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step 100: Acquire the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network.
[0027] Specifically, the communication type of the wireless sensor network in the embodiment of the present invention may include at least one of data transmission, status report and control command. The execution subject of the embodiment of the present invention may be any electronic device with certain computing capabilities, such as a computer device, and may be each computer system of the network management center when the method is specifically applied. Taking the network management center as an example, each node of the wireless sensor network is connected to the network status monitoring system of the network management center, and the network management center uniformly allocates according to the path optimization strategy.
[0028] The method provided by the embodiment of the present invention first obtains the topological structure of the wireless sensor network by the network status monitoring system, determines the number of nodes in the wireless sensor network, the communication capability of each node, and the QoS parameters of each link in the network, such as the energy state of the node, data rate, delay, bandwidth, packet loss rate and delay jitter, etc., which are very important for routing optimization.
[0029] Step 101: construct an objective function based on the communication capability of each node and the QoS parameters of each link.
[0030] Specifically, after obtaining the communication capability of each node and the QoS parameters of each link, the objective function of multi-constraint QoS routing optimization can be constructed according to the communication capability of each node and the QoS parameters of each link in the network. This objective function aims to improve the data transmission efficiency and overall network stability of the network by optimizing routing decisions, while reducing energy consumption.
[0031] In some implementations, the QoS parameters of each node and its link, such as delay, bandwidth, packet loss rate, and delay jitter, can be obtained based on the existing data communication evaluation data of the network monitoring center, combined with the number of nodes in the wireless sensor network and the communication capability of each node, so as to construct an objective function for achieving unicast routing optimization.
[0032] In some implementations, the objective function The formula can be shown as follows:
[0033] in, Represents a possible routing path and is used to evaluate QoS indicators such as energy consumption, delay, and bandwidth of the path. These two parameters represent the link arrive QoS parameters, Indicates a constant or additional weight in routing, which is used to balance other factors affecting path selection. is the weight factor, which is used to control the weight of energy consumption or other factors in the objective function. It is usually used to represent the energy consumption evaluation parameter on the path, which can be the energy consumed by a single node or path.
[0034] The formula combines multiple network QoS indicators (such as latency and bandwidth) and adjusts the pros and cons of different paths through weights. Ultimately, when looking for the optimal routing path, the goal is to minimize energy consumption and optimize communication quality. Using the collected data to dynamically generate and adjust routing decisions can adapt to real-time changes in the network environment.
[0035] It should be noted that, in the embodiment of the present invention, it is also necessary to set a quality of service constraint on the communication path of each node, that is, all communication paths in the network must meet a preset quality of service standard.
[0036] Step 102: Solve the objective function based on the giant water lily algorithm to obtain a unicast routing path result in the wireless sensor network.
[0037] Specifically, Victoria Amazonica Optimization (VAO), as an emerging heuristic algorithm, can be applied to optimize the unicast routing problem in wireless sensor networks.
[0038] After constructing an objective function for dynamically optimized routing path selection, the control parameters and path set of the giant water lily algorithm can be initialized, and the routing selection model can be solved by the giant water lily algorithm.
[0039] In the process of solving the routing selection model by the giant water lily algorithm, the fitness value of each path can be calculated by the objective function. The giant water lily algorithm is continuously iterated and when the algorithm meets the preset conditions, the path with the highest fitness value under the comprehensive consideration of communication quality and energy consumption is selected as the optimal unicast routing path, and the data transmission in the network is optimized to achieve efficient communication. The optimal unicast routing path can be found. This path not only takes into account the shortest path, but also combines the requirements of energy consumption and communication quality to achieve routing optimization.
[0040] The network management center generates the optimal routing solution based on the giant water lily algorithm through the network status monitoring system, and optimizes the data transmission according to this solution, which is convenient for network administrators to make decisions and management. By applying the giant water lily algorithm to the unicast routing optimization problem, a more reasonable and accurate routing configuration can be made for each node in the wireless sensor network, improving the network communication efficiency and reducing the network's impact on the environment and overall energy consumption.
[0041] The optimized routing path obtained by the giant water lily algorithm is used to adjust the energy balance of each node in the network to ensure that the overall stability and reliability of the network are enhanced while meeting the minimum energy consumption. During this process, the algorithm calculates the energy consumption of each node and the ratio of the number of packets it receives and sends. By adjusting the data transmission frequency and power, the overall performance of the network is optimized, especially when the node energy is low, by reducing its task load and extending the network life.
[0042] The wireless sensor network unicast routing optimization method provided by the present invention obtains the communication capability of each node in the wireless sensor network and the QoS parameters of each link, constructs an objective function according to the communication capability of each node and the QoS parameters of each link, and then solves the objective function through the giant water lily algorithm. It can provide a more reasonable and accurate routing optimization strategy for data transmission in the wireless sensor network, improve the energy efficiency and reliability of routing, reduce energy consumption and enhance network performance, thereby extending the operating life of the wireless sensor network and reducing the impact on the environment.
[0043] According to a wireless sensor network unicast routing optimization method provided by the present invention, the objective function is solved based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network, specifically including: Initialize the giant water lily algorithm to obtain the initial growth probability path set; Based on the objective function, the fitness value of each path in the initial growth probability path set is obtained, and based on the fitness value of each path, the optimal path position in the initial growth probability path set is determined; the optimal path position includes the optimal growth probability path position and the suboptimal growth probability path position; Based on the optimal path position, the initial growth probability path set is updated and replaced with a growth probability to obtain an updated and replaced growth probability path set; When the preset conditions are met, the optimal path position in the updated and replaced growth probability path set is output as the unicast routing path result in the wireless sensor network; when the preset conditions are not met, the steps of obtaining the fitness value of each path in the updated and replaced growth probability path set based on the objective function, determining the optimal path position in the updated and replaced growth probability path set, and performing growth probability update and growth probability replacement on the updated and replaced growth probability path set are repeated until the preset conditions are met.
[0044] Specifically, the embodiment of the present invention provides a giant water lily algorithm based on natural expansion and competition simulation, including steps such as growth probability initialization process, growth probability update, path selection and growth probability reinforcement. These operations can perform large-scale global search and detailed local search on the search space, thereby increasing the global search capability of the algorithm.
[0045] In the process of using the giant water lily algorithm, first, the giant water lily algorithm is initialized to generate an initial growth probability path set, where each path is formed by a series of node connections, and the initial growth probability value on each node represents the probability of the path being selected. The initial growth probability path set can be expressed as an initial growth probability matrix Indicates that Representation Node To Node The growth probability.
[0046] In some implementations, the initial growth probability path set may be generated by a natural selection strategy. Preferably, the natural selection strategy is an evaluation model based on historical communication success rates and node energy consumption to adjust the initial distribution of growth probabilities.
[0047] In the embodiment of the present invention, the giant water lily algorithm is initialized, which may include setting the growth attenuation coefficient, the expansion enhancement factor, and the path selection probability. The upper and lower limits of the growth probability of each node are , you can also set the preset conditions for the termination of the giant water lily algorithm, for example, you can set the maximum number of iterations to , or the algorithm terminates when an intermediate quantity (such as the optimal path position) in the process meets the set threshold.
[0048] According to a wireless sensor network unicast routing optimization method provided by the present invention, the giant water lily algorithm is initialized to obtain an initial growth probability path set, specifically including: Randomly generate an N×L two-dimensional matrix, where N represents the number of nodes in the wireless sensor network, L represents the number of paths in the wireless sensor network, and each component of the N×L two-dimensional matrix represents the initial growth probability of each path; Based on the N×L two-dimensional matrix, multiple groups of path selection matrices are generated through ecological competition mapping, and each component of the multiple groups of path selection matrices is mapped to the value interval of growth probability to generate an initial growth probability path set.
[0049] Specifically, the initial growth probability path set of the giant water lily algorithm in the embodiment of the present invention can be generated by an ecological mapping strategy. The initial path set, that is, the initial growth probability path set, is generated by a heuristic strategy, and the individual encoding of each path is a two-dimensional matrix N×L, in which the number of rows is the number of nodes in the network N, and the number of columns is the number of possible routing paths L. Therefore, the growth probability path set is a three-dimensional matrix, and its encoding method is positive real number encoding.
[0050] In the specific process, an N×L two-dimensional matrix can be randomly generated first, where N represents the number of nodes in the network, L represents the number of possible routing paths, and each component of the matrix represents the initial growth probability of the path, with a value ranging from 0 to 1.
[0051] Preferably, the control parameter range of the routing probability is [0.2, 0.8]. This parameter range is the basic setting of the giant water lily algorithm when simulating leaf growth and resource competition, ensuring that the algorithm can be effectively adjusted and adapted in different network environments to optimize path selection and resource allocation.
[0052] Preferably, the optimal growth probability is 0.5. This setting ensures that the giant water lily algorithm can find a balance between maintaining network performance and resource efficiency when selecting a path, especially when the network conditions are complex or change greatly, it can still maintain high data transmission efficiency and routing stability.
[0053] After randomly generating an N×L two-dimensional matrix, multiple groups of routing path selection matrices can be generated based on the N×L two-dimensional matrix through ecological competition mapping. The formula is:
[0054] in, is the control parameter of the mapping, or can be understood as a threshold control factor. Optionally, =4.0.
[0055] Furthermore, each component of the Z matrix is mapped to the specific parameters of the routing selection (the value interval of the routing selection probability) to generate the initial growth probability path set. The formula is:
[0056] Where LL is the lower limit of the routing probability, and UL is the upper limit of the routing probability. Indicates a rounding operation.
[0057] Optionally, the size of the growth probability path set can be set to 25; the number of nodes N in the network is 20, that is, it includes various types of sensor nodes; the number of possible routing paths L is 10, the growth probability matrix NL of each path is 20×10, the upper and lower limits of the matrix element change are [0, 1], and the maximum number of iterations is =50. This method optimizes the unicast routing of wireless sensor networks by dynamically adjusting the growth probability, thereby improving the transmission efficiency and reliability of the network.
[0058] The natural selection mapping strategy is adopted to increase the globality of the initial path set when the algorithm is initialized, providing a better basis for subsequent path selection.
[0059] After initializing the giant water lily algorithm, the growth attenuation coefficient and expansion enhancement factor can be dynamically adjusted according to the real-time feedback of the network. Each possible path is represented by a growth probability value, which can be adjusted according to the success rate and delay of data transmission.
[0060] The giant water lily algorithm can be used to simulate the behavior of water lilies expanding on the water surface, adopt the growth expansion rule and use the fitness function to evaluate and select the routing path, thereby optimizing the objective function. Solve and obtain the unicast routing path that meets the transmission QoS requirements .
[0061] In some implementations, the natural growth simulation strategy selects the path, that is, the path is naturally selected based on the growth probability. In the process of path selection using the giant water lily algorithm, each "leaf" represents a potential routing path.
[0062] The fitness value of each path can be calculated through the path quality evaluation function (fitness function), and the fitness values are sorted from large to small, and the path with the largest fitness value in the current growth probability path set (if the current round is initialized, it is determined from the initialized growth probability path set) is selected as the optimal growth probability path position, and the path with the second largest fitness value in the current growth probability path set (if the current round is initialized, it is determined from the initialized growth probability path set) is selected as the suboptimal growth probability path position. These two are used as the optimal path positions described in the embodiment of the present invention.
[0063] The growth probability of the initial path set can be updated according to the optimal path position (the optimal growth probability path position and the suboptimal growth probability path position) to obtain a path set after the growth probability update, and then the growth probability is replaced between the path sets after the growth probability update according to the growth probability of each path in the path set after the growth probability update to obtain a path set after the growth probability replacement, and then based on the giant water lily algorithm, the growth probability of the path set after the growth probability replacement is iteratively updated and replaced according to the growth probability of each path in the path set after the growth probability replacement until the preset number of iterations is met to obtain the data transmission optimization strategy corresponding to the optimal path.
[0064] In some implementations, the formula of the path quality evaluation function (ie, fitness function) is:
[0065] in, is the fitness value, indicating that any path The effectiveness value of the corresponding routing strategy; Indicates the path The corresponding growth probability code is, Indicates the path Service quality evaluation indicators Indicates the path Energy consumption evaluation indicators.
[0066] For example, the path The growth probability coding can be expressed as: =[0.51,0.41,0.45,0.40,0.43,0.17,0.06,0.42,0.58,0.27]
[0067] Among them, in the individual code In , each component represents the growth probability of the corresponding node in the path, which is used to describe the importance and selection probability of the node in the path.
[0068] In some implementations, the growth and expansion probability during path selection is proportional to the path quality, and the update formula is:
[0069] in and Represent the growth expansion probability after and before the update, respectively. is the growth attenuation coefficient, is the amount of growth probability that increases due to leaf expansion.
[0070] Then, the objective function , evaluate the fitness values of all possible paths, and determine the optimal expansion probability in the initial matrix based on the fitness values The growth expansion probability matrix is updated by the following formula :
[0071] in, is the growth attenuation coefficient, By path Resulting in an increase in growth expansion.
[0072] Through the above dynamically adjusted growth probability model, the routing table of each node is updated to guide the data packet to be transmitted along the optimal path. The performance of each routing path is evaluated, and the path with the highest growth probability is taken as the optimal path. The optimization is continuously iterated until the preset termination conditions are met. For example, the maximum number of iterations is reached or the fitness value does not change significantly, the optimal path can be determined. .
[0073] According to the expansion of leaves and the resource competition mechanism, the growth probability is dynamically adjusted to reflect the communication quality and reliability of different paths, thereby optimizing data transmission in the network and ensuring that the update of growth probability reflects the actual network conditions to support efficient routing decisions.
[0074] In some implementations, the optimal growth probability path position and the suboptimal growth probability path position in the current growth probability path set are determined through the above process, and the growth probabilities are updated respectively.
[0075] Optionally, the growth probability of the optimal growth probability path in the initial growth probability path set and the updated and replaced growth probability path set is updated based on the following formula:
[0076] in, represents the growth probability of the optimal growth probability path after the t-th growth probability update; Represents the position of the optimal growth probability path during the t-th growth probability update; Indicates the position of the suboptimal growth probability path during the t-th growth probability update; represents the growth probability of the optimal growth probability path before the tth iteration; is a random coefficient between [0.1,0.95]; is the weight coefficient, , is a random number between [0.05, 0.98]; PD represents the density of path selection, , MGF represents the number of optimal growth probability paths, and MDF represents the number of suboptimal growth probability paths.
[0077] Through the above growth probability update method, the network can dynamically adjust the unicast routing, optimize the transmission path of data packets, and improve network efficiency and stability.
[0078] Optionally, the suboptimal growth probability paths in the initial growth probability path set and the updated and replaced growth probability path set are updated with growth probabilities based on the following formula:
[0079] in, represents the growth probability of the suboptimal growth probability path after the t-th growth probability update; is a random number between [0,1]; Represents the position of the optimal growth probability path during the t-th growth probability update; represents the growth probability of the suboptimal growth probability path before the t-th growth probability update; represents the update intensity of the growth probability path, , and A constant used to control the variation in the update strength of the growing probability path, It decreases linearly to 0 with the preset number of iterations.
[0080] In some embodiments, The initial value can be set to 5. It can be set to 0.002.
[0081] It should be noted that, in the present invention, when AP is greater than a certain threshold (eg, 0.58), the entire growth probability path set is updated; when AP is less than the threshold, only a portion of the growth probability path set is updated.
[0082] The update range of the partial growth probability path set is defined as follows:
[0083] in, Indicates the number of suboptimal growth probability paths that need to be updated; Indicates the number of nodes in the path that need to be updated; is a fixed value, i.e., the number of nodes in a single path. Such an update strategy ensures that the network can adapt to the needs of dynamic changes in the network while maintaining the stability of the growth probability path.
[0084] Optionally, the growth probabilities of the paths may be replaced according to the fitness value of each path in the path set after the growth probability is updated, so as to obtain the path set after the growth probability is replaced.
[0085] In the present invention, the growth probability and fitness value of each path are compared to ensure the effective update of the growth probability. Specifically, if the fitness value caused by the growth probability of a certain path is better than that of other paths (i.e., the fitness value of the path is higher than that of other paths), the growth probability is updated, that is, the initial growth probability path set and the updated growth probability path set are replaced according to the following formula:
[0086] in, represents the optimal growth probability path when the t-th growth probability is updated and replaced, It represents the suboptimal growth probability path when the t-th growth probability is updated and replaced. EP is the fitness function used to evaluate the quality of the path.
[0087] The maximum number of iterations is based on the preset condition Take as an example, after iterating through the above steps, we can get the path set for the new round of iteration. In each round of iteration, the growth probability is updated and replaced according to the fitness value of the path, and the iteration is repeated until the maximum number of iterations is reached. If the maximum number of iterations is reached, the giant water lily algorithm outputs the current optimal growth probability path as the unicast routing path result in the wireless sensor network, and can also output the network performance index value corresponding to the path ; If the maximum number of iterations is not reached , continue to perform the above growth probability update and replacement steps until the number of iterations reaches This process ensures the continuous optimization of unicast routing in wireless sensor networks to improve the overall transmission efficiency and reliability of the network.
[0088] The technical effect of the method provided by the present invention is further illustrated below through embodiments in specific application scenarios.
[0089] In one embodiment, the performance of the growth probability path selection method provided by the present invention is compared with that of the existing routing optimization algorithm through the parameter setting and simulation results of the software simulation experiment. In this embodiment, 20 network nodes are provided, and each node can participate in routing decision making. Among them, the number of growth probability paths of the growth probability path selection algorithm adopted by the present invention is 25, and the upper limit of the number of iterations is set to , the growth probability value of each path varies in the range of [0,1].
[0090] As a comparison algorithm, the Grey Wolf Optimizer (GWO) has a population size of 50 and an upper limit of the number of iterations. .
[0091] As a comparative algorithm, the particle swarm optimization algorithm (PSO) has a particle number of 50 and an upper limit of the number of iterations. , the social learning factor and individual learning factor of the particle are both set to 2.
[0092] Figure 2 This is a schematic diagram showing the performance comparison between the unicast routing optimization method provided by the present invention and the existing routing optimization method. Figure 2 As shown, after each algorithm runs 50 times, the average energy cost calculated by the method provided in this embodiment is 0.6629J. The cost of GWO is 0.6863J, and the cost of PSO is 0.7201J. These results show that compared with GWO and PSO, the giant water lily algorithm reduces the energy cost by 3.4% and 7.9%, respectively. The convergence speed of the giant water lily algorithm is also faster than that of GWO and PSO. The giant water lily algorithm only needs 9 generations to reduce the energy cost to below 0.7, while GWO needs 34 generations to reach this cost level, and PSO needs more than 50 generations. This result proves that the routing scheme obtained by using the growth probability path selection algorithm provided by the present invention can address the problems of high energy consumption and slow convergence speed in existing routing optimization algorithms, and can significantly improve the routing optimization performance of wireless sensor networks. It has the advantages of simple structure, fewer parameters, strong optimization ability, fast convergence and good stability, so as to meet the requirements of real-time and high efficiency in wireless sensor networks.
[0093] The wireless sensor network unicast routing optimization device provided by the present invention is described below. The wireless sensor network unicast routing optimization device described below and the wireless sensor network unicast routing optimization method described above can be referred to each other.
[0094] Figure 3 Schematic diagram of the structure of the wireless sensor network unicast routing optimization device provided by the present invention. Figure 3 As shown, the device includes the following modules: The acquisition module 300 is used to acquire the communication capability of each node in the wireless sensor network and the quality of service QoS parameters of each link in the wireless sensor network; A construction module 310, configured to construct an objective function based on the communication capability of each node and the QoS parameters of each link; The solving module 320 is used to solve the objective function based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network.
[0095] According to a wireless sensor network unicast routing optimization device provided by the present invention, the objective function is solved based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network, specifically including: Initialize the giant water lily algorithm to obtain the initial growth probability path set; Based on the objective function, the fitness value of each path in the initial growth probability path set is obtained, and based on the fitness value of each path, the optimal path position in the initial growth probability path set is determined; the optimal path position includes the optimal growth probability path position and the suboptimal growth probability path position; Based on the optimal path position, the initial growth probability path set is updated and replaced with a growth probability to obtain an updated and replaced growth probability path set; When the preset conditions are met, the optimal path position in the updated and replaced growth probability path set is output as the unicast routing path result in the wireless sensor network; when the preset conditions are not met, the steps of obtaining the fitness value of each path in the updated and replaced growth probability path set based on the objective function, determining the optimal path position in the updated and replaced growth probability path set, and performing growth probability update and growth probability replacement on the updated and replaced growth probability path set are repeated until the preset conditions are met.
[0096] According to a wireless sensor network unicast routing optimization device provided by the present invention, the initial growth probability path set and the optimal growth probability path in the updated and replaced growth probability path set are updated based on the following formula:
[0097] in, represents the growth probability of the optimal growth probability path after the t-th growth probability update; Represents the position of the optimal growth probability path during the t-th growth probability update; Represents the position of the suboptimal growth probability path during the t-th growth probability update; represents the growth probability of the optimal growth probability path before the tth iteration; is a random coefficient between [0.1,0.95]; is the weight coefficient, , is a random number between [0.05, 0.98]; PD represents the density of path selection, , MGF represents the number of optimal growth probability paths, and MDF represents the number of suboptimal growth probability paths.
[0098] According to a wireless sensor network unicast routing optimization device provided by the present invention, the suboptimal growth probability paths in the initial growth probability path set and the updated and replaced growth probability path set are updated based on the following formula:
[0099] in, represents the growth probability of the suboptimal growth probability path after the t-th growth probability update; is a random number between [0,1]; Represents the position of the optimal growth probability path during the t-th growth probability update; represents the growth probability of the suboptimal growth probability path before the t-th growth probability update; represents the update intensity of the growth probability path, , and A constant used to control the variation in the update strength of the growing probability path, It decreases linearly to 0 with the preset number of iterations.
[0100] According to a wireless sensor network unicast routing optimization device provided by the present invention, the initial growth probability path set and the updated growth probability path set are replaced according to the following formula:
[0101] in, represents the optimal growth probability path when the t-th growth probability is updated and replaced, It represents the suboptimal growth probability path when the t-th growth probability is updated and replaced, and EP is the fitness function.
[0102] According to a wireless sensor network unicast routing optimization device provided by the present invention, the giant water lily algorithm is initialized to obtain an initial growth probability path set, specifically including: Randomly generate an N×L two-dimensional matrix, where N represents the number of nodes in the wireless sensor network, L represents the number of paths in the wireless sensor network, and each component of the N×L two-dimensional matrix represents the initial growth probability of each path; Based on the N×L two-dimensional matrix, multiple groups of path selection matrices are generated through ecological competition mapping, and each component of the multiple groups of path selection matrices is mapped to the value interval of growth probability to generate an initial growth probability path set.
[0103] Figure 4 A schematic diagram of the structure of an electronic device provided by the present invention, such as 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 unicast routing optimization method, which includes: Obtain the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network; Based on the communication capability of each node and the QoS parameters of each link, an objective function is constructed; The objective function is solved based on the giant water lily algorithm, and the unicast routing path results in wireless sensor networks are obtained.
[0104] 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.
[0105] 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 unicast routing optimization method provided by the above methods, the method includes: Obtain the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network; Based on the communication capability of each node and the QoS parameters of each link, an objective function is constructed; The objective function is solved based on the giant water lily algorithm, and the unicast routing path results in wireless sensor networks are obtained.
[0106] 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 unicast routing optimization method provided by the above methods, the method comprising: Obtain the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network; Based on the communication capability of each node and the QoS parameters of each link, an objective function is constructed; The objective function is solved based on the giant water lily algorithm, and the unicast routing path results in wireless sensor networks are obtained.
[0107] 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.
[0108] 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.
[0109] 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 method for optimizing unicast routing in a wireless sensor network, characterized in that: include: Acquire the communication capability of each node in the wireless sensor network and the quality of service (QoS) parameters of each link in the wireless sensor network; Constructing an objective function based on the communication capability of each node and the QoS parameter of each link; The objective function is solved based on the giant water lily algorithm to obtain a unicast routing path result in the wireless sensor network.
2. The wireless sensor network unicast routing optimization method according to claim 1, characterized in that: The objective function is solved based on the giant water lily algorithm to obtain a unicast routing path result in the wireless sensor network, specifically including: Initialize the giant water lily algorithm to obtain the initial growth probability path set; Obtaining the fitness value of each path in the initial growth probability path set based on the objective function, and determining the optimal path position in the initial growth probability path set based on the fitness value of each path; the optimal path position includes the optimal growth probability path position and the suboptimal growth probability path position; Based on the optimal path position, the initial growth probability path set is updated and replaced with a growth probability to obtain an updated and replaced growth probability path set; When the preset conditions are met, the optimal path position in the updated and replaced growth probability path set is output as the unicast routing path result in the wireless sensor network; when the preset conditions are not met, the steps of obtaining the fitness value of each path in the updated and replaced growth probability path set based on the objective function, determining the optimal path position in the updated and replaced growth probability path set, and performing growth probability update and growth probability replacement on the updated and replaced growth probability path set are repeated until the preset conditions are met.
3. The wireless sensor network unicast routing optimization method according to claim 2, characterized in that: The optimal growth probability path in the initial growth probability path set and the updated growth probability path set is updated based on the following formula: in, represents the growth probability of the optimal growth probability path after the t-th growth probability update; Represents the position of the optimal growth probability path during the t-th growth probability update; Indicates the position of the suboptimal growth probability path during the t-th growth probability update; represents the growth probability of the optimal growth probability path before the tth iteration; is a random coefficient between [0.1,0.95]; is the weight coefficient, , is a random number between [0.05, 0.98]; PD represents the density of path selection, , MGF represents the number of optimal growth probability paths, and MDF represents the number of suboptimal growth probability paths.
4. The wireless sensor network unicast routing optimization method according to claim 2, characterized in that: The suboptimal growth probability paths in the initial growth probability path set and the updated and replaced growth probability path set are updated with growth probabilities based on the following formula: in, represents the growth probability of the suboptimal growth probability path after the t-th growth probability update; is a random number between [0,1]; Represents the position of the optimal growth probability path during the t-th growth probability update; represents the growth probability of the suboptimal growth probability path before the t-th growth probability update; represents the update intensity of the growth probability path, , and A constant used to control the variation in the update strength of the growing probability path, It decreases linearly to 0 with the preset number of iterations.
5. The wireless sensor network unicast routing optimization method according to any one of claims 2 to 4, characterized in that: The initial growth probability path set and the updated growth probability path set are replaced by growth probability according to the following formula: in, represents the optimal growth probability path when the t-th growth probability is updated and replaced, It represents the suboptimal growth probability path when the t-th growth probability is updated and replaced, and EP is the fitness function.
6. The wireless sensor network unicast routing optimization method according to claim 2, characterized in that: Initialize the giant water lily algorithm to obtain the initial growth probability path set, including: Randomly generate an N×L two-dimensional matrix, where N represents the number of nodes in the wireless sensor network, L represents the number of paths in the wireless sensor network, and each component of the N×L two-dimensional matrix represents the initial growth probability of each path; Based on the N×L two-dimensional matrix, multiple groups of path selection matrices are generated through ecological competition mapping, and each component of the multiple groups of path selection matrices is mapped to a value interval of growth probability to generate an initial growth probability path set.
7. A wireless sensor network unicast routing optimization device, characterized in that: include: An acquisition module, used to acquire the communication capability of each node in the wireless sensor network and the quality of service QoS parameters of each link in the wireless sensor network; A construction module, configured to construct an objective function based on the communication capability of each node and the QoS parameter of each link; The solution module is used to solve the objective function based on the giant water lily algorithm to obtain the unicast routing path result in the wireless sensor network.
8. 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 method for optimizing unicast routing in a wireless sensor network according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for optimizing unicast routing in a wireless sensor network as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for optimizing unicast routing in a wireless sensor network as claimed in any one of claims 1 to 6 is implemented.