Routing construction method and device based on genetic algorithm
By adopting a routing construction method based on genetic algorithms in the underwater wireless sensor network, the problems of data packet redundancy and conflict, transmission delay and reliability are solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202510125542.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-27
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-27
AI Technical Summary
There are problems in underwater wireless sensor networks with packet redundancy and conflict, transmission delay and reliability.
The routing construction method based on genetic algorithm is adopted to build routes through local topology perception, multi-arm slot machine depth adjustment algorithm and genetic algorithm, and the penalty constant, forward factor, reliability energy index and link normalization index are introduced to optimize routing.
Improve the reliability and efficiency of packet transmission, reduce hollow areas, and improve network connectivity and coverage.
Smart Images

Figure CN119922644A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of underwater acoustic network communication, and in particular to a routing construction method and device based on a genetic algorithm. Background Art
[0002] Underwater Wireless Sensor Networks (UWSN) has been a hot topic in the research field in recent years. Geographic Opportunistic Routing has been studied in many aspects and has the characteristics of adapting to dynamically changing environments, not requiring global information and being adaptive. However, there are also some difficult problems that are difficult to solve, such as data packet redundancy and conflict, transmission delay and reliability. Summary of the invention
[0003] Based on this, it is necessary to provide a genetic algorithm-based routing construction method and device that can be reliable and has high-efficiency transmission in order to solve the above technical problems.
[0004] In a first aspect, the present application provides a routing construction method based on a genetic algorithm. The method comprises:
[0005] Perform local topology awareness and establish connections between nodes;
[0006] Find out whether there are nodes in the hole area. If so, use the depth adjustment algorithm based on the multi-armed bandit to restore the communication of the nodes in the hole area.
[0007] A genetic algorithm is used to construct routing; the fitness function of the genetic algorithm introduces a penalty constant, a forward factor, a reliability energy index and a link normalization index. The penalty constant is used to constrain the number of routing hops, the forward factor is designed based on the depth difference between the current hop and the next hop, the reliability energy index is determined based on the current hop energy and the comprehensive energy of the forwarding area, and the link normalization index is determined based on the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
[0008] In one embodiment, the nodes include sensor nodes and sink nodes;
[0009] Performing local topology awareness and establishing connections between nodes includes:
[0010] An enhanced two-hop topology perception strategy is used to perform multiple rounds of local topology perception, establish connections between nodes, and construct neighbor sets and sink sets corresponding to each sensor node. The neighbor set includes neighbor sensor nodes connected to the sensor node, and the sink set includes sink nodes connected to the sensor node. At the same time, in the process of performing multiple rounds of local topology perception, each sensor node only retains the information of the sink nodes that were not shared in the previous round.
[0011] In one embodiment, using a genetic algorithm to construct a route includes: initializing a population, starting with a source node as a current node, selecting a next node connected to a sink node in a sink set corresponding to the current node from a neighbor set corresponding to the current node, until the last node is selected.
[0012] In one embodiment, the selection operator of the genetic algorithm adopts a roulette wheel selection strategy.
[0013] In one embodiment, the genetic algorithm includes:
[0014] If the n-th hop nodes in the paths randomly selected by any two individuals are different nodes, and the (n+1)-th hop nodes of the two individuals are neighbor nodes of each other's n-th hop nodes, the crossover strategy is executed.
[0015] In one embodiment, the genetic algorithm includes:
[0016] If the mutation operator node finds that there is a sink node in the corresponding two-hop neighbor set, it mutates to the one-hop neighbor node corresponding to the sink node.
[0017] In a second aspect, the present application also provides a route construction device based on a genetic algorithm. The device comprises:
[0018] Topology awareness module, used to perform local topology awareness and establish connections between nodes;
[0019] The depth adjustment module is used to find out whether there are nodes in the hollow area. If so, a depth adjustment algorithm based on a multi-armed bandit is used to restore the communication of the nodes in the hollow area.
[0020] The routing construction module is used to construct routing using a genetic algorithm; the fitness function of the genetic algorithm introduces a penalty constant, a forward factor, a reliability energy index, and a link normalization index. The penalty constant is used to constrain the number of routing hops. The forward factor is designed based on the depth difference between the current hop and the next hop. The reliability energy index is determined based on the current hop energy and the comprehensive energy of the forwarding area. The link normalization index is determined based on the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
[0021] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above-mentioned genetic algorithm-based routing construction method when executing the computer program.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above-mentioned genetic algorithm-based routing construction method when executed by a processor.
[0023] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps in the above-mentioned genetic algorithm-based routing construction method when executed by a processor.
[0024] The above-mentioned routing construction method and device based on genetic algorithm include executing local topology perception and establishing connections between nodes; finding whether there are nodes in the void area, and if so, using a depth adjustment algorithm based on a multi-armed slot machine to restore the communication of the nodes in the void area; using a genetic algorithm to construct routing; wherein the fitness function of the genetic algorithm introduces a penalty constant, a forward factor, a reliability energy index and a link normalization index, the penalty constant is used to constrain the number of routing hops, the forward factor is designed based on the depth difference between the current hop and the next hop, the reliability energy index is determined according to the current hop energy and the comprehensive energy of the forwarding area, and the link normalization index is determined according to the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area. The present application designs a fitness function to ensure the stability of the delivery rate with as few forwarding times as possible, while also taking into account the balance of node workloads to achieve improved reliability and transmission efficiency; at the same time, a multi-armed slot machine algorithm is used to reduce the void area and improve network connectivity and coverage. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic diagram of a genetic algorithm encoding process in one embodiment;
[0026] Figure 2 A schematic diagram of a hollow region in an embodiment;
[0027] Figure 3 The figure is a flowchart of a routing construction method based on a genetic algorithm in one embodiment. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0029] The embodiment of the present application provides a routing construction method based on a genetic algorithm, comprising the following steps:
[0030] Step 102, perform local topology awareness and establish connections between nodes.
[0031] Underwater wireless sensor networks mainly include several sensor nodes, which are connected to each other through wireless communication and are used to monitor various parameters in the underwater environment, such as temperature, pressure, salinity, etc.
[0032] When building a routing protocol, it is necessary to understand the topology of the network and confirm the connection relationship between the nodes in the underwater wireless sensor network in order to select the best path to transmit data. When the network topology changes, it must be able to perceive these changes.
[0033] Step 104, finding out whether there are any nodes in the hollow area, if so, using a depth adjustment algorithm based on a multi-armed bandit to restore the communication of the nodes in the hollow area.
[0034] In the network topology, a void area refers to a certain area in the network where there is a lack of network connectivity or a significantly insufficient number of nodes, so that an effective data transmission path cannot be formed or necessary network functions cannot be supported. Obviously, a void area will affect the effectiveness and reliability of the entire network.
[0035] In order to restore the communication of nodes in the void area, this embodiment adopts the deep adjustment strategy of the multi-armed slot machine algorithm. The core idea is to optimize the communication strategy of the node through tentative selection, so as to fill the void area and restore communication. In UWSN, each node can be regarded as the "arm" of the "slot machine", and the communication performance of these nodes is uncertain. The task of the node is to select the most effective communication path to ensure data transmission.
[0036] Step 106, constructing a route using a genetic algorithm; wherein the fitness function of the genetic algorithm introduces a penalty constant, an advancement factor, a reliability energy index, and a link normalization index, the penalty constant is used to constrain the number of routing hops, the advancement factor is designed based on the depth difference between the current hop and the next hop, the reliability energy index is determined based on the current hop energy and the comprehensive energy of the forwarding area, and the link normalization index is determined based on the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
[0037] Genetic Algorithm (GA) is an optimization algorithm based on the principles of natural selection and genetics. Its main steps include: initializing the population, evaluating fitness, selecting operations, crossover operations, mutation operations, forming a new population, and iterative evolution. Specifically, a set of chromosomes is randomly generated first; then a fitness function is defined to evaluate the quality of each individual. The higher the fitness value, the better the chromosome; individuals are selected according to the fitness value, and individuals with higher fitness are more likely to be selected as parents; crossover is performed between the selected individuals to generate new individuals (offspring). Crossover can be completed by exchanging part of the chromosome; the generated offspring are mutated to introduce new gene combinations; the new individuals that have undergone selection, crossover and mutation operations are collected to form a new population; fitness evaluation, selection, crossover and mutation are repeated until the termination condition is reached.
[0038] Among them, the design of the fitness function is very important in the genetic algorithm, and it is one of the key factors for whether the genetic algorithm can run effectively and find the optimal solution. The selection of the fitness function directly affects the convergence speed of the genetic algorithm and whether it can find the optimal solution. Because the genetic algorithm basically does not use external information in the evolutionary search, it only uses the fitness function as the basis and uses the fitness of each individual in the population to search. Therefore, this embodiment proposes a solution for the fitness function. The fitness function is mainly composed of a penalty constant, a forward factor, a reliability energy index, and a link normalization index. Whenever a node forwards a data packet to the next node, the corresponding penalty constant will be fixedly reduced. Therefore, the more hops the chromosome passes through, the smaller its fitness value will be, and the lower the priority of this chromosome. The forward factor is determined based on the depth difference between the current hop and the next hop; the reliability energy index is composed of the current hop energy and the comprehensive energy of the forwarding area; the link normalization index is composed of the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area. This fitness function enables the routing protocol to ensure the stability of the delivery rate with the least possible forwarding times, while also taking into account the balance of node workload to achieve improved reliability and transmission efficiency; at the same time, the multi-armed bandit algorithm is used to reduce the void area and improve network connectivity and coverage.
[0039] In one embodiment, the nodes include sensor nodes and sink nodes; performing local topology perception and establishing connections between nodes includes: using an enhanced two-hop topology perception strategy to perform multiple rounds of local topology perception, establish connections between nodes, and construct a neighbor set and a sink set corresponding to each sensor node, the neighbor set includes neighbor sensor nodes connected to the sensor node, and the sink set includes sink nodes connected to the sensor node; at the same time, in the process of performing multiple rounds of local topology perception, each sensor node only retains the information of the sink node that was not shared in the previous round.
[0040] In order to ensure the real-time and accuracy of the topology and meet the requirements of relay node priority calculation, an enhanced two-hop topology perception strategy is adopted to expand the local topology perception range to two hops. At the same time, in order to reduce the size of hello packets, the forwarding and receiving algorithms of hello packets are improved. Each node maintains and updates two routing tables, each of which includes the node's id, geographic location, remaining energy, number of neighbor nodes, and timestamp.
[0041] The local topology perception process is shown in Algorithm 1. Each node in the network will store its own information in a hello data packet and send it to its neighbor nodes regularly with a period of T. The difference is that each sensor node only retains the information of the sink node that was not shared in the previous round, and maintains a sink set to indicate whether the sensor node is connected to a certain sink node. Each sink node has its own unique flag Ω. If the broadcasting node is a sensor node, the Ω flag of the sink node in the corresponding sink set will be checked. If Ω is 0, it means that the information of the sink node has not been shared with its neighbor nodes. Then the information of this sink node is also stored in the hello data packet, and the corresponding Ω flag is set to 1, and then the data packet is broadcast, and the sending time of the next data packet is set. In the data packet receiving algorithm, if it is found that this data packet comes from a sink node, the information of this sink node will first be stored in the corresponding sink set; if it comes from other ordinary sensor nodes, then its neighbor set will be updated, the neighbor information will be recorded and the sink set of the node from the data packet will be checked. If its sink set is newer than its own, its own sink set will be updated. The benefit of maintaining the sink set is that in the process of constructing the initial population of the genetic algorithm, nodes that can be connected to a sink node will be preferentially selected as the initial population, so that a better initial population can be obtained, thereby accelerating the iteration process. Algorithm 1 is as follows:
[0042]
[0043] In one embodiment, using a genetic algorithm to construct a route includes: initializing a population, starting with a source node as a current node, selecting a next node connected to a sink node in a sink set corresponding to the current node from a neighbor set corresponding to the current node, until the last node is selected.
[0044] The encoding scheme of the genetic algorithm is a key link in the algorithm. It is a conversion method that converts the feasible solution of a problem from its solution space to the search space that the genetic algorithm can handle. In this paper, the number of each sensor node is used as the gene of the chromosome. Each chromosome is composed of several genes, and the chromosome is a complete routing path for transmitting data from the anchor node to the sink node. Due to the special scenario of routing, each adjacent gene should be within the sensing range of each other, and a chromosome cannot have repeated genes to avoid loops. Figure 1 A schematic diagram of the encoding process is shown in FIG.
[0045] As the first step of the genetic algorithm, population initialization directly affects the convergence, stability and solution efficiency of the algorithm. A reasonable initial population can increase the diversity of the search and help the algorithm find the global optimal solution in a wider search space. Most routing protocols based on genetic algorithms construct the initial population by simply randomly selecting the next hop node through the node. This method is simple and easy to implement, but there are problems such as uncontrollable initial population quality and insufficient population diversity due to randomness. It is also difficult to handle complex problems. At the same time, it depends on the number of iterations, and a large number of iterations are required to find better individuals, but this increases the computational cost and time cost of the algorithm.
[0046] This paper combines the enhanced local topology perception in step 102 in the processing of population initialization. Starting from the source node, the node connected to the sink node is preferentially selected from its own neighbor set as the next gene, and so on, until the last gene is selected. By selecting the node connected to the sink node as part of the chromosome, the algorithm's solution efficiency and convergence speed can be greatly improved first, because each individual can ensure a strong correlation with the destination node, which is based on a higher starting point, so that it can converge to the optimal solution faster. Secondly, it can ensure that the initial population contains a certain number of high-quality individuals, which enhances the stability of the algorithm to a certain extent, and can reduce the algorithm's computational cost, avoid blind search, and greatly improve the solution efficiency.
[0047] After initialization, construct the fitness function.
[0048] First, in the routing algorithm, the main purpose is to transmit the information of the anchor node to the sink node through the least possible forwarding times. The fewer forwarding times, the more energy the node can save. At the same time, it can ensure the reduction of bit error rate and the stability of packet delivery rate. Therefore, the design of the advancement factor is very important. Considering the depth difference of the current hop and the optimal depth difference of the next hop, it can effectively avoid falling into the situation of local optimal solution. The advancement factor ADV is shown in formula (1).
[0049]
[0050] Among them, h c Indicates the current jump depth difference, h n represents the optimal depth difference of the next hop, T r Represents the sensing radius.
[0051] The design of the forward factor can ensure that the data packet reaches the sink node in the shortest possible path, but it cannot guarantee the sustainability of the sensor network life cycle, because excessive use of nodes on the shortest path will lead to unbalanced workloads, causing the network life cycle to be rapidly shortened. Therefore, the design of the reliability energy index can effectively ensure that sensor nodes can be used fairly, and the energy distribution of nodes is more uniform, thereby extending the life of the sensor network. The reliability energy index REL is shown in formula (2):
[0052]
[0053] Among them, α1 and α2 are the corresponding proportional weights, E res 、E init are the node residual energy and initial energy, respectively, and avg(E(n)) is the regional normalized energy. The values of α1 and α2 represent the node priority focusing on the comprehensive performance of the current hop node energy or the current hop regional energy.
[0054] In the process of forwarding data packets, whether the data packet can effectively reach the next hop largely determines the transmission efficiency of the data packet. If the link quality between two nodes is unstable, the data packet may still not be successfully forwarded even after several retransmissions, resulting in a broken routing path. Therefore, factors related to link quality are added to the priority calculation of selecting relay nodes. The link normalization index takes into account the link quality between the current node and the next hop node and the average link quality and maximum link quality in the forwarding area of the next hop node. The link quality between the current node and the next hop node largely determines whether the data packet can be successfully forwarded. Here, the packet delivery rate between the two nodes is considered as the main criterion for link quality. Therefore, when forwarding data between nodes, each node will store the communication records with each node, and will check the link quality with neighboring nodes when determining the priority; and considering the link quality of the forwarding area of the next hop node can effectively avoid falling into the problem of local optimal solution. The link normalization index LNQ is shown in formula (3):
[0055]
[0056] Among them, β and γ represent the weight of the link quality between the current node and the next hop node, the average link quality in the next hop node forwarding area, and the weight of the maximum link quality. β determines whether the node gives priority to the current short-term link quality or the long-term link quality, and γ determines whether the average quality or the optimal quality is given priority in the next hop node forwarding area. s,n Indicates the link quality between the current node and the next hop node. Indicates the average link quality within the next-hop node forwarding area, Indicates the maximum link quality of the next-hop node forwarding area.
[0057] According to the above, for a population with a population size of NP, the fitness function f of the jth individual is as shown in formula (4):
[0058]
[0059] Among them, M represents the number of nodes in the chromosome, g represents the penalty constant, τ1, τ2, and τ3 represent the weights of the forward factor, the reliability energy index, and the normalized quality of the link, respectively.
[0060] Based on the fitness function, the roulette wheel selection strategy is used as the selection operator to effectively select individuals based on their fitness values and promote the convergence of the algorithm. In the selection strategy, first, the best performing individuals of the previous generation are directly passed on to the next generation to ensure the superiority of the population. Secondly, a certain number of individuals are selected as part of the next generation population according to the roulette wheel selection model. The probability p of an individual being selected is shown in formula (5):
[0061]
[0062] Where NP is the size of the population. Although the roulette strategy is a strategy based on fitness, which can ensure that individuals with higher fitness have a greater probability of being selected, it also has some disadvantages. In some cases, it may cause unstable algorithm performance. In particular, during the iteration process, the sum of the fitness of the population may be lower than the initial population, causing the algorithm to crash. To address this problem, in one embodiment, the concept of a scaling function is introduced to process the fitness value, which can alleviate the shortcomings of the roulette algorithm to a certain extent. The scaling function Q is shown in formula (6):
[0063]
[0064] Among them, G is the number of generations of the current population, c is the adjustment factor, and the larger c is, the smaller the impact on the fitness function is. In the early iterations, the difference between different individuals can be reduced, which has great advantages for the selection of potential excellent individuals and can solve the problem of local optimal solutions.
[0065] In one embodiment, the genetic algorithm further includes: if the n-th hop nodes in the randomly selected paths of any two individuals are different nodes, and the (n+1)-th hop nodes of the two individuals are neighbor nodes of each other's n-th hop nodes, then a crossover strategy is executed.
[0066] The crossover strategy is the most important means to obtain new excellent individuals in the genetic algorithm, and has an important impact on the search ability and efficiency of the algorithm. Therefore, the crossover strategy process is performed on the excellent individuals selected in the selection strategy. Due to the particularity of underwater routing, arbitrarily performing crossover operations on two individuals may result in invalid routing paths, so the crossover strategy of this embodiment is for the routing path itself. For the selected individuals, if the nth hop in the randomly selected path of any two individuals, the nth hop nodes in the two individuals are two different nodes and the node of the n+1th hop of the other individual is their neighbor, then the crossover condition is met, and the crossover operation is performed on the part after the nth hop. The nth hop node determines whether the n+1th hop node of other individuals is its neighbor by simply checking whether the node exists in its own routing table. For example, the routing path of individual 1 is: 1->3->4->6->7, and the routing path of individual 2 is: 1->2->5->7. The second hop node is selected as the crossover point. If the neighbors of node 3 include node 5, and the neighbors of node 2 include node 4, the crossover condition is met. After the crossover, individual 1 is: 1->3->5->7, and individual 2 is: 1->2->4->6->7. Such a crossover strategy is more likely to produce better individuals among excellent individuals, thereby accelerating the convergence process.
[0067] In one embodiment, the genetic algorithm includes: if the mutation operator node finds that there is a sink node in the corresponding two-hop neighbor set, it mutates to a one-hop neighbor node corresponding to the sink node.
[0068] The above process describes the steps in the mutation operation. The mutation operation is the process of replacing the gene values of certain gene positions on the chromosome string of an individual with other alleles to generate a new individual. In genetic algorithms, the mutation operation is a secondary means of evolution, but it is indispensable. It can prevent the algorithm from falling into the local optimal solution to a certain extent and improve the global search ability of the algorithm.
[0069] The mutation operation changes the genes on the chromosome according to the mutation probability. The mutation method is similar to the population initialization step. The chromosome randomly selects the mutation operator when the mutation probability is selected. The routing path after this position is similar to the population initialization step. Each hop node randomly selects the next hop node from its own neighbor set. It should be noted that in the process of randomly selecting the next hop, it should be avoided to repeat the existing routing path to avoid loops. In addition, due to the design of local topology awareness, if the mutation operator node can find that there is a sink node in its two-hop neighbor set, it will directly mutate to the corresponding one-hop neighbor, thereby accelerating the algorithm convergence process. For example, if a neighbor node B of node A is directly connected to the sink node, node A can mutate to node B.
[0070] In one embodiment, in step 104, some improvements are made to the traditional depth adjustment algorithm, and a depth adjustment algorithm MDAR based on the multi-armed bandit (MAB) framework in reinforcement learning is proposed, which is more efficient and energy-saving for hollow node processing. Compared with the traditional depth adjustment algorithm, MDAR can make better strategies in different scenarios and adjust the hollow node to the best position, so as to ensure that the data packet can smoothly reach the sink node.
[0071] For example, Figure 2 As shown in (a), node a is a hole node, and nodes b and c are reference adjustment nodes. According to the traditional depth adjustment algorithm, both nodes b and c calculate the adjustment depth and store it in the depth set. Node a selects node b as the reference node for depth adjustment because its adjustment depth is smaller. However, node b is also a hole node, which will cause data packets to be interrupted again. In another case, Figure 2 (b) shows that node a is a hollow node, while nodes b and c are reference nodes. According to the traditional depth adjustment algorithm, node a selects node b as the reference adjustment node to adjust its depth. However, the next hop node of node b is node c, which will lead to redundant data packet forwarding. If node c is used as the reference adjustment node, data packets can be forwarded more efficiently, thus saving more energy.
[0072] In the decision model, qualified nodes in the two-hop neighbor set of the hole node to be adjusted are used as the arms of the slot machine, and the hole node plays the role of the slot machine player. Each arm calculates its own reward value through a series of methods as an indicator of a single training. Based on the available information, the hole node selects the best adjustment depth in a series of trials to maximize the cumulative reward.
[0073] The design of the reward function is crucial to the depth adjustment algorithm in the MAB framework, which determines whether each arm can be selected correctly. The goal of the depth adjustment algorithm using the MAB algorithm is to select the arm that can have the maximum reward, that is, to select the benchmark adjustment node with the best performance. Consider such a scenario, node v has declared itself to be a hollow node, and its two-hop neighbor set is denoted as Γ. Among the nodes in the two-hop neighbor set, when Γ i (i=1,2,3...N, where N is the number of two-hop neighbors) The nodes whose horizontal distance to node v is less than the sensing radius and whose depth is less than node v are the reference adjustment nodes. i (i=1,2,3...M),M≤N. Then the reward function R can be defined as shown in formula (7):
[0074] R Φi =-k×q-δ1×c_E(Φ i)+δ2×d_E(Φ i )+σ×depth (7)
[0075]
[0076] Where c_E and d_E are the remaining energy related rewards, δ1 and δ2 are their weights. q is the number of times the hole node needs to adjust its depth, and k is its corresponding weight. depth is the depth that the hole node corresponding to the current benchmark node should adjust, and σ is its corresponding weight.
[0077] Algorithm 2 is used for the recovery process of hollow nodes. When a node finds itself to be a hollow node, it first broadcasts an invalid node data packet to other nodes. The node that receives this data packet will check whether the node exists in its routing table. If it exists, it will delete the node from its routing table. After the hollow node sends an invalid data packet to declare itself a hollow node, it will call the hollow adjustment algorithm based on MAB. In Algorithm 2, the benchmark adjustment node set Φ of the hollow node will be checked first. If there is a hollow node in Φ, it will determine whether the node can be readjusted. If not, the node will be deleted from Φ to prevent the hollow node from appearing again in the routing path. If it can be readjusted, the q index will be increased to evaluate the priority of the benchmark adjustment node (line3-8). It can be seen that the larger the q value of the benchmark adjustment node, the lower the reward function of the node and the lower the probability of the node being selected. Then the minimum depth of each benchmark adjustment node that allows the hollow node to recover will be calculated, and then the reward function of each benchmark adjustment node will be calculated to prepare for the subsequent process. In each learning process, the value with the maximum reward function and the arm Φ in which it is located are first stored i , then select the arm under the ε-Greedy strategy, and then change the reward with the change of normal distribution, and finally update the number of selections of each Φi and each Φ i Estimate the benefits and iterate the process. Finally, the arm with the most Φi selections is selected as the benchmark adjustment node.
[0078] In the multi-armed bandit problem, cumulative regret is a core concept used to measure the balance between exploration and exploitation and the performance of the algorithm. Specifically, it is the sum of the difference between the expected reward of pulling the current lever and the expected reward of the optimal lever. The mathematical expression is shown in formula (10):
[0079]
[0080] Among them, maxQ represents the expected reward of the optimal action, and reward(at) represents the expected reward of each selected action.
[0081] Algorithm 2 is specifically expressed as:
[0082]
[0083] In one embodiment, Figure 3 As shown in the figure, it is a complete flow chart of the routing construction method based on genetic algorithm. In the initial stage of the sensor network, enhanced local topology perception is first performed to establish connections between each node and other nodes, laying the foundation for the subsequent use of genetic algorithms to build routes and the depth adjustment algorithm based on multi-armed bandits; secondly, if there are nodes that find themselves in a hollow area, the depth adjustment algorithm will be executed to restore the communication of the node, thereby extending the life cycle of the sensor network; finally, the genetic algorithm is used to build routes to achieve the purpose of forwarding data from the anchor node to the sink node.
[0084] In summary, the present invention constructs an initialization population with high quality through the proposed enhanced local topology perception, and can accelerate the convergence speed and search efficiency of the genetic algorithm through a novel crossover scheme and scaling function. At the same time, a multi-factor fitness function is designed using the local topology to ensure the quality of the chromosome. In addition, a deep adjustment algorithm based on a multi-armed bandit is designed to restore the empty nodes in the communication invalid area to a better area, thereby improving the performance of the routing protocol. Experiments show that the routing protocol disclosed in the present invention has better performance in terms of packet delivery rate and end-to-end delay compared with other existing protocols.
[0085] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0086] Based on the same inventive concept, the embodiment of the present application also provides a genetic algorithm-based route construction device for implementing the genetic algorithm-based route construction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more genetic algorithm-based route construction device embodiments provided below can refer to the limitations of the genetic algorithm-based route construction method above, and will not be repeated here.
[0087] In one embodiment, a route construction device based on a genetic algorithm is provided, comprising:
[0088] Topology awareness module, used to perform local topology awareness and establish connections between nodes;
[0089] The depth adjustment module is used to find out whether there are nodes in the hollow area. If so, a depth adjustment algorithm based on a multi-armed bandit is used to restore the communication of the nodes in the hollow area.
[0090] The routing construction module is used to construct routing using a genetic algorithm; the fitness function of the genetic algorithm introduces a penalty constant, a forward factor, a reliability energy index, and a link normalization index. The penalty constant is used to constrain the number of routing hops. The forward factor is designed based on the depth difference between the current hop and the next hop. The reliability energy index is determined based on the current hop energy and the comprehensive energy of the forwarding area. The link normalization index is determined based on the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
[0091] Each module in the above-mentioned genetic algorithm-based route construction device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in all the above method embodiments when executing the computer program.
[0093] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in all the above method embodiments are implemented.
[0094] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in all the above method embodiments when executed by a processor.
[0095] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0096] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.
[0097] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A routing construction method based on genetic algorithm, characterized in that: The method comprises: Perform local topology perception and establish connections between nodes; the nodes include sensor nodes and sink nodes; Find whether there are nodes in the hollow area, and if so, use a depth adjustment algorithm based on a multi-armed bandit to restore the communication of the nodes in the hollow area; A genetic algorithm is used to construct routing; wherein the fitness function of the genetic algorithm introduces a penalty constant, an advancement factor, a reliability energy index and a link normalization index, the penalty constant is used to constrain the number of routing hops, the advancement factor is designed based on the depth difference between the current hop and the next hop, the reliability energy index is determined according to the current hop energy and the comprehensive energy of the forwarding area, and the link normalization index is determined according to the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
2. The method according to claim 1, characterized in that The performing of local topology awareness and establishing connections between nodes includes: An enhanced two-hop topology perception strategy is used to perform multiple rounds of local topology perception, establish connections between nodes, and construct neighbor sets and sink sets corresponding to each sensor node. The neighbor set includes neighbor sensor nodes connected to the sensor node, and the sink set includes the sink nodes connected to the sensor node. At the same time, in the process of performing multiple rounds of local topology perception, each sensor node only retains the information of the sink node that was not shared in the previous round.
3. The method according to claim 2, characterized in that The use of a genetic algorithm to construct a route includes: initializing a population, starting with a source node as a current node, selecting a next node connected to the sink node in the sink set corresponding to the current node from the neighbor set corresponding to the current node, until the last node is selected.
4. The method according to claim 1, characterized in that The selection operator of the genetic algorithm adopts a roulette wheel selection strategy.
5. The method according to claim 1, characterized in that: The genetic algorithm comprises: If the n-th hop nodes in the paths randomly selected by any two individuals are different nodes, and the (n+1)-th hop nodes of the two individuals are neighbor nodes of each other's n-th hop nodes, the crossover strategy is executed.
6. The method according to claim 1, characterized in that The genetic algorithm comprises: If the mutation operator node finds that the sink node exists in the corresponding two-hop neighbor set, it mutates to the one-hop neighbor node corresponding to the sink node.
7. A route construction device based on genetic algorithm, characterized in that: The device comprises: Topology awareness module, used to perform local topology awareness and establish connections between nodes; A depth adjustment module is used to find out whether there are nodes in the hole area. If so, a depth adjustment algorithm based on a multi-armed bandit is used to restore the communication of the nodes in the hole area. A routing construction module is used to construct routing using a genetic algorithm; wherein the fitness function of the genetic algorithm introduces a penalty constant, an advancement factor, a reliability energy index and a link normalization index, the penalty constant is used to constrain the number of routing hops, the advancement factor is designed based on the depth difference between the current hop and the next hop, the reliability energy index is determined based on the current hop energy and the comprehensive energy of the forwarding area, and the link normalization index is determined based on the link quality between the current hop and the source node and the comprehensive link quality of the forwarding area.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, 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 6 are implemented.
10. A computer program product, comprising 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 6 are implemented.
Citation Information
Patent Citations
Low-energy-consumption secure routing protocol based on dynamic trust awareness and load balancing
CN117377021A
High-coverage-rate sensor node arrangement method for forest monitoring
CN119052815A
Network topology optimization
US20160191370A1
Distributed collaborative evolution method, UAV and intelligent routing method therefor, and apparatus
WO2024021281A1