A method and apparatus for route construction based on genetic algorithms

By adopting a routing construction method based on genetic algorithms and multi-armed slot machines, the problems of data packet redundancy and transmission delay in underwater wireless sensor networks are solved, achieving efficient and reliable routing construction, improving network connectivity and coverage, and extending the life cycle of sensor networks.

CN119922644BActive Publication Date: 2026-03-13HAINAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510125542.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-27
Publication Date
2026-03-13
Estimated Expiration
2045-01-27

AI Technical Summary

Technical Problem

Underwater wireless sensor networks suffer from packet redundancy and collisions, as well as transmission delays and reliability issues, making it difficult for existing technologies to achieve efficient and reliable route construction.

Method used

A route construction method based on genetic algorithm is adopted, combined with multi-armed slot machine depth adjustment algorithm. By constructing routes through local topology awareness and genetic algorithm, penalty constant, forward factor, reliability energy index and link normalization index are introduced to optimize route hop count and link quality and restore node communication in hole area.

Benefits of technology

It improves network reliability and transmission efficiency, reduces void areas, enhances network connectivity and coverage, and extends the lifespan of sensor networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922644B_ABST
    Figure CN119922644B_ABST
Patent Text Reader

Abstract

This application discloses a route construction method and apparatus based on a genetic algorithm, relating to the field of underwater acoustic network communication technology. The method includes: performing local topology awareness to establish connections between nodes; searching for nodes in hole regions; if such nodes exist, using a depth adjustment algorithm based on a multi-armed slot machine to restore communication between nodes in the hole regions; and constructing routes using a genetic algorithm. The fitness function of the genetic algorithm incorporates a penalty constant, a forwarding factor, a reliability energy index, and a link normalization index. This application designs a fitness function that ensures stable delivery rates with minimal forwarding while also balancing node workloads, thereby improving reliability and transmission efficiency. Simultaneously, the multi-armed slot machine algorithm reduces hole regions, improving network connectivity and coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of underwater acoustic network communication technology, and in particular to a route construction method and apparatus based on a genetic algorithm. Background Technology

[0002] Underwater wireless sensor networks (UWSNs) have become a hot research topic in recent years. Geographic opportunistic routing and forwarding, in particular, has undergone extensive research and possesses the characteristics of adapting to dynamically changing environments, requiring no global information, and being self-adaptive. However, some intractable problems remain, such as packet redundancy and collisions, as well as transmission delay and reliability issues. Summary of the Invention

[0003] Therefore, it is necessary to provide a route construction method and apparatus based on genetic algorithms that can reliably and efficiently transmit routes, addressing the aforementioned technical problems.

[0004] Firstly, this application provides a route construction method based on a genetic algorithm. The method includes:

[0005] Perform local topology awareness and establish connections between nodes;

[0006] Check if there are any nodes in the hole region. If so, use a depth adjustment algorithm based on a multi-armed slot machine to restore communication of the nodes in the hole region.

[0007] A genetic algorithm is used to construct routes. 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 route 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 energy of the current hop and the combined 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 combined 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 sensing strategy is adopted to perform multiple rounds of local topology sensing, establish connections between nodes, and construct a neighbor set and sink set for 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, during the execution of multiple rounds of local topology sensing, each sensor node only retains the information of the sink nodes that were not shared in the previous round.

[0011] In one embodiment, constructing a route using a genetic algorithm includes: initializing the population, starting with the source node as the current node, selecting the next node from the current node's neighbor set that is connected to the sink node in the current node's sink set, 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 any two individuals randomly select different nodes for the nth hop in the path, and the (n+1)th hop of the two individuals is a neighbor of the other's nth hop, then the crossover strategy is executed.

[0015] In one embodiment, the genetic algorithm includes:

[0016] If the mutation operator node finds that the sink node exists in the corresponding two-hop neighbor set, it mutates into the one-hop neighbor node corresponding to the sink node.

[0017] Secondly, this application also provides a route construction device based on a genetic algorithm. The device includes:

[0018] The topology awareness module is used to perform local topology awareness and establish connections between nodes;

[0019] The depth adjustment module is used to find whether there are nodes in the hole region. If so, the depth adjustment algorithm based on the multi-armed slot machine is used to restore the communication of the nodes in the hole region.

[0020] The route construction module is used to construct routes 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 route 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 energy of the current hop and the combined 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 combined link quality of the forwarding area.

[0021] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above-described route construction method based on a genetic algorithm.

[0022] Fourthly, this application also provides a computer-readable storage medium. This computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the above-described route construction method based on a genetic algorithm.

[0023] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the above-described route construction method based on a genetic algorithm.

[0024] The aforementioned route construction method and apparatus based on genetic algorithms include performing local topology awareness to establish connections between nodes; searching for nodes in hole regions; if so, using a depth adjustment algorithm based on a multi-armed slot machine to restore communication between nodes in hole regions; and constructing routes using a genetic algorithm. The fitness function of the genetic algorithm incorporates a penalty constant, a forwarding factor, a reliability energy index, and a link normalization index. The penalty constant constrains the number of route hops, the forwarding 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 energy of the current hop and the combined 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 combined link quality of the forwarding area. This application designs a fitness function that ensures stable delivery rates with as few forwardings as possible, while also balancing node workloads to improve reliability and transmission efficiency. Simultaneously, a multi-armed slot machine algorithm is used to reduce hole regions, improving network connectivity and coverage. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the genetic algorithm encoding process in one embodiment;

[0026] Figure 2 This is a schematic diagram of a cavity region in one embodiment;

[0027] Figure 3 This is a flowchart illustrating a route construction method based on a genetic algorithm in one embodiment. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0029] This application provides a route construction method based on a genetic algorithm, including the following steps:

[0030] Step 102: Perform local topology awareness to establish connections between nodes.

[0031] Underwater wireless sensor networks mainly consist of several sensor nodes that are interconnected via wireless communication to monitor various parameters in the underwater environment, such as temperature, pressure, and salinity.

[0032] Building routing protocols requires understanding the network topology and confirming the connections between nodes in the underwater wireless sensor network in order to select the optimal path for data transmission. It is also essential to be able to detect changes in the network topology.

[0033] Step 104: Check if there are any nodes in the hole region. If so, use the depth adjustment algorithm based on multi-armed slot machine to restore the communication of the nodes in the hole region.

[0034] In network topology, "holes" refer to areas where network connections are missing or the number of nodes is significantly insufficient, making it impossible to form effective data transmission paths or support necessary network functions. Clearly, holes affect the overall effectiveness and reliability of the network.

[0035] To restore communication for nodes in voided regions, this embodiment employs a depth adjustment strategy based on the multi-armed slot machine algorithm. Its core idea is to optimize node communication strategies through trial-and-error selection, thereby filling voided regions and restoring communication. In UWSN, each node can be viewed as an "arm" of a slot machine, and the communication performance of these nodes is uncertain. The task of each node is to select the most efficient communication path to ensure data transmission.

[0036] Step 106: A genetic algorithm is used to construct the route. 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 route 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 energy of the current hop 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.

[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, selection, crossover, mutation, forming a new population, and iterative evolution. Specifically, a set of chromosomes is first randomly generated; then, a fitness function is defined to evaluate the quality of each individual, with higher fitness values ​​indicating better chromosomes; individuals are selected based on fitness values, with individuals with higher fitness being more likely to be chosen as parents; crossover is performed between the selected individuals to generate new individuals (offspring), which can be done by exchanging a portion of the chromosome; the generated offspring are mutated to introduce new gene combinations; the new individuals resulting from selection, crossover, and mutation are combined to form a new population; fitness evaluation, selection, crossover, and mutation are repeated until the termination condition is met.

[0038] The design of the fitness function is crucial in genetic algorithms, being a key factor in their effective operation and finding of the optimal solution. The choice of fitness function directly affects the convergence speed and the ability to find the optimal solution. Since genetic algorithms rely primarily on the fitness function, without utilizing external information, this embodiment proposes a fitness function scheme. This fitness function mainly consists of a penalty constant, a forward factor, a reliability energy index, and a link normalization index. Each time a node forwards a data packet to the next node, the corresponding penalty constant is reduced. Therefore, the more hops a chromosome traverses, the lower its fitness value, and the lower its priority. 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 energy of the current hop and the combined energy of the forwarding region; and the link normalization index is composed of the link quality between the current hop and the source node, as well as the combined link quality of the forwarding region. This fitness function enables the routing protocol to ensure a stable delivery rate with as few forwards as possible, while also balancing node workloads to improve reliability and transmission efficiency. At the same time, the multi-armed slot machine algorithm reduces hole areas and improves network connectivity and coverage.

[0039] In one embodiment, the nodes include sensor nodes and sink nodes; performing local topology sensing and establishing connections between nodes includes: performing multiple rounds of local topology sensing using an enhanced two-hop topology sensing strategy, establishing connections between nodes, and constructing 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. Meanwhile, during the execution of multiple rounds of local topology sensing, each sensor node only retains information about the sink nodes that were not shared in the previous round.

[0040] To ensure the real-time performance and accuracy of the topology, while also meeting the requirements for relay node priority calculation, an enhanced two-hop topology awareness strategy is adopted, extending the local topology awareness range to two hops. Furthermore, to reduce the size of hello packets, the forwarding and receiving algorithms for hello packets have been improved. Each node maintains and updates two routing tables, each including the node's ID, geographical location, remaining energy, number of neighboring nodes, and timestamp.

[0041] The local topology sensing process is shown in Algorithm 1. Each node in the network stores its information in a hello packet and periodically sends it to its neighboring nodes at intervals T. The difference is that each sensor node only retains information about sink nodes that were not shared in the previous round, maintaining a sink set to indicate whether the sensor node is connected to a particular sink node. Each sink node has its own unique flag Ω. If the broadcasting node is a sensor node, it checks the Ω flag of the corresponding sink node in its sink set. If Ω is 0, it means that the sink node's information has not yet been shared with its neighboring nodes. Therefore, the sink node's information is also stored in the hello packet, the corresponding Ω flag is set to 1, the packet is broadcast, and the sending time for the next packet is set. In the packet receiving algorithm, if the packet is found to originate from a sink node, the sink node's information is first stored in its corresponding sink set. If it originates from another ordinary sensor node, the sensor node updates its neighbor set, records the neighbor's information, and checks the sink set of the node from which the packet originated. If the neighbor's sink set is more up-to-date than the sensor node's, the sensor node updates its own sink set. Maintaining a sink set has the advantage that during the construction of the initial population in the genetic algorithm, nodes connected to a sink node are prioritized as the initial population, resulting in a better initial population and accelerating the iteration process. Algorithm 1 is as follows:

[0042]

[0043] In one embodiment, constructing a route using a genetic algorithm includes: initializing the population, starting with the source node as the current node, selecting the next node from the current node's neighbor set that is connected to the sink node in the current node's sink set, until the last node is selected.

[0044] The encoding scheme is a crucial part of the genetic algorithm, transforming the feasible solutions to a problem from its solution space to the search space that the genetic algorithm can handle. This paper uses the number of each sensor node as a gene of a chromosome, with each chromosome composed of several genes. The chromosome serves as a complete routing path for data transmission from the anchor node to the sink node. Due to the specific routing scenario, each adjacent gene should be within its respective sensing range, and a chromosome cannot contain duplicate genes to avoid loops. Figure 1 The diagram shown illustrates the principle of an encoding process.

[0045] Population initialization, as the first step in a genetic algorithm, directly impacts its convergence, stability, and solution efficiency. A reasonable initial population increases search diversity, helping the algorithm find the global optimum within a broader search space. Most routing protocols based on genetic algorithms simply select the next-hop node randomly. While simple and easy to implement, this method suffers from uncontrollable initial population quality, potentially insufficient population diversity due to randomness, difficulty in handling complex problems, and reliance on numerous iterations to find superior individuals, thus increasing the algorithm's computational and time costs.

[0046] This paper incorporates enhanced local topology awareness from step 102 into the population initialization process. Starting from the source node, it prioritizes selecting nodes connected to the sink node from its neighbor set as the next gene, and so on, until the last gene is selected. By selecting nodes connected to the sink node as part of the chromosome, the algorithm's solution efficiency and convergence speed are significantly improved. This is because each individual is guaranteed to have a strong correlation with the target node, starting from a higher point and thus converging to the optimal solution faster. Secondly, it ensures that the initial population contains a certain number of high-quality individuals, enhancing the algorithm's stability to some extent, reducing computational costs, avoiding blind searches, and greatly improving solution efficiency.

[0047] After initialization, construct the fitness function.

[0048] Firstly, in routing algorithms, the main objective is to transmit the information from the anchor node to the sink node with as few forwards as possible. Fewer forwards mean more energy can be saved by the node, while also ensuring a lower bit error rate and a stable packet delivery rate. Therefore, the design of the forward factor is crucial. Considering the depth difference of the current hop and the optimal depth difference of the next hop, it can effectively avoid getting trapped in local optima. The forward factor ADV is shown in formula (1).

[0049]

[0050] Among them, h c h represents the current jump depth difference. n T represents the optimal depth difference for the next hop. r Indicates the sensing radius.

[0051] The forward factor design ensures that data packets reach the sink node along the shortest possible path, but it cannot guarantee the sustainability of the sensor network's lifecycle. This is because excessive use of nodes on the shortest path leads to an unbalanced workload, causing the network's lifecycle to shorten rapidly. Therefore, the reliability energy index design can effectively ensure that sensor nodes are used fairly, and that the energy distribution of nodes is more uniform, thereby extending the lifecycle of the sensor network. The reliability energy index REL is shown in formula (2):

[0052]

[0053] Where α1 and α2 are the corresponding proportional weights, E res E init These represent the node's remaining energy and initial energy, respectively, with avg(E(n)) representing the region's normalized energy. The values ​​of α1 and α2 indicate the node priority based on the combined performance of the current hop node's energy or the current hop region's 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 there is unstable link quality between two nodes, the data packet may still fail to be forwarded even after several retransmissions, resulting in a broken routing path. Therefore, a link quality-related factor is added to the priority calculation of relay node selection. The link normalization index considers the link quality between the current node and the next hop node, as well as the average and maximum link quality within 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 forwarded successfully. Here, the packet delivery rate between the two nodes is considered as the main standard of link quality. Therefore, when forwarding data between nodes, each node will store the communication records between each node and check the link quality with neighboring nodes when determining priority; while considering the link quality of the forwarding area of ​​the next hop node can effectively avoid the problem of getting trapped in a local optimum. The link normalization index LNQ is shown in formula (3):

[0055]

[0056] Where β and γ represent the weights of the link quality between the current node and the next-hop node, the average link quality within the next-hop node's forwarding area, and the maximum link quality, respectively. β determines whether the node prioritizes the current short-term link quality or the long-term link quality, while γ determines whether the node prioritizes the average quality or the optimal quality within the next-hop node's forwarding area. s,n This indicates the link quality between the current node and the next-hop node. This indicates the average link quality within the forwarding area of ​​the next-hop node. This indicates the maximum link quality in the forwarding area of ​​the next-hop node.

[0057] Based on the above, for a population of size NP, the fitness function f of the j-th individual is shown in formula (4):

[0058]

[0059] Where M represents the number of nodes in the chromosome, g represents the penalty constant, and τ1, τ2, and τ3 represent the weights of the forward factor, the reliability energy index, and the link normalization quality, respectively.

[0060] Based on the fitness function, a roulette wheel selection strategy is used as the selection operator to effectively select individuals based on their fitness values, thus promoting the convergence of the algorithm. In the selection strategy, firstly, the best-performing individuals from the previous generation are directly carried over 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 represents the population size. Although the roulette wheel strategy is a fitness-based strategy that ensures that individuals with higher fitness have a greater probability of being selected, it also has some drawbacks. In some cases, it may lead to unstable algorithm performance, especially during iteration, where the total fitness of the population may be lower than the initial population, causing the algorithm to crash. To address this issue, in one embodiment, the concept of a scaling function is introduced to process the fitness value, which can alleviate the drawbacks of the roulette wheel algorithm to some extent. The scaling function Q is shown in formula (6):

[0063]

[0064] Where G is the generation number of the current population, and c is the adjustment factor. The larger c is, the smaller its impact on the fitness function. In early iterations, it can reduce the differences between different individuals, which is very advantageous for selecting potentially superior individuals and can solve the problem of local optima.

[0065] In one embodiment, the genetic algorithm further includes: if any two individuals randomly select different nodes in the path for the nth hop, and the (n+1)th hop nodes of the two individuals are neighbors of each other's nth hop nodes, then the crossover strategy is executed.

[0066] Crossover is the most important method for obtaining new superior individuals in genetic algorithms, significantly impacting the algorithm's search capability and efficiency. Therefore, the crossover process is performed on the superior individuals selected through the selection strategy. Due to the unique nature of underwater routing, arbitrarily performing crossover operations on two individuals may result in invalid routing paths. Therefore, the crossover strategy in this embodiment is applied to the routing path itself. For any selected individual, if the nth hop of a randomly chosen path between any two individuals is different from the nth hop node of the other individual, and the (n+1)th hop node of the other individual is their neighbor, then the crossover condition is met, and crossover operations are performed on the portion after the nth hop. The nth hop node determines whether the (n+1)th hop node of another individual is its neighbor simply by checking if that node exists in its own routing table. For example, if the routing path of individual 1 is 1->3->4->6->7 and the routing path of individual 2 is 1->2->5->7, and the second hop node is chosen as the intersection point, if node 3's neighbor includes node 5 and node 2's neighbor includes node 4, then the intersection condition is met. After the intersection, individual 1 becomes 1->3->5->7 and individual 2 becomes 1->2->4->6->7. This intersection strategy is more likely to generate better individuals from good 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, then it mutates into the one-hop neighbor node corresponding to the sink node.

[0068] The above process describes the steps in the mutation operation. Mutation is the process of replacing the gene values ​​of certain gene loci on an individual's chromosome string with other alleles, thereby generating a new individual. In genetic algorithms, mutation is a secondary evolutionary mechanism, but it is essential. It can, to some extent, prevent the algorithm from getting trapped in local optima and improve the algorithm's global search capability.

[0069] The mutation operation alters genes on the chromosome according to the mutation probability. The mutation method is similar to the population initialization steps. The chromosome randomly selects a mutation operator when the mutation probability is chosen. The routing path after this position is similar to the population initialization steps, with each hop node randomly selecting its next hop node from its neighbor set. It is important to note that during the random selection of the next hop, duplicates with existing routing paths should be avoided to prevent loops. Furthermore, due to the local topology-aware design, if a mutation operator node discovers that its two-hop neighbor set contains a sink node, it will directly mutate into the corresponding one-hop neighbor, thus accelerating the algorithm's convergence process. For example, if node A's neighbor node B is directly connected to the sink node, then node A can mutate into node B.

[0070] In one embodiment, step 104 involves improvements to the traditional depth adjustment algorithm, proposing a depth adjustment algorithm MDAR based on the Multi-Armed Slot (MAB) framework in reinforcement learning. This algorithm is more efficient and energy-saving in handling void nodes. Compared to traditional depth adjustment algorithms, MDAR can make better strategies in different scenarios, adjusting void nodes to their optimal positions, thereby ensuring that data packets can successfully reach the sink node.

[0071] For example, such as Figure 2 As shown in (a), node a is a hole node, and nodes b and c are baseline adjustment nodes. According to the traditional depth adjustment algorithm, both nodes b and c calculate the adjustment depth and store it in a depth set. Node a chooses node b as the baseline 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, such as... Figure 2 (b) shows that node a is a hole 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, node c is the next hop node for node b, which leads to redundant packet forwarding. If node c is used as the reference adjustment node, packets can be forwarded more efficiently, thus saving more energy.

[0072] In the decision-making model, qualified nodes in the two-hop neighbor set of the hollow node to be adjusted act as arms of the slot machine, while the hollow node plays the role of the slot machine player. Each arm calculates its own reward value through a series of methods, serving as an indicator for a single training iteration. Based on this available information, the hollow node selects the optimal adjustment depth through a series of trials to maximize the cumulative reward.

[0073] The design of the reward function is crucial for the depth adjustment algorithm in the MAB framework, as it determines whether each arm can be correctly selected. The goal of the depth adjustment algorithm using the MAB algorithm is to select the arm that yields the maximum reward—that is, to select the baseline adjustment node with the best performance. Consider a scenario where node v has declared itself as 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) Nodes whose horizontal distance from node v is less than the sensing radius and whose depth is less than node v are considered baseline adjustment nodes. This is denoted as Φ. i (i = 1, 2, 3... M), M ≤ N. The reward function R can then 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 rewards related to remaining energy, and δ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 base node should adjust, and σ is its corresponding weight.

[0077] Algorithm 2 is used for the recovery process of holed nodes. When a node discovers it has become a holed node, it first broadcasts an invalid node data packet to other nodes. Nodes receiving this packet check if the node exists in their routing tables. If it does, they remove the node from their routing tables. After sending the invalid data packet to declare itself a holed node, the hole adjustment algorithm based on MAB is invoked. In Algorithm 2, the baseline adjustment node set Φ of the holed node is first checked. If a holed node also exists in Φ, it is determined whether the node can be readjusted. If not, the node is removed from Φ to prevent the holed node from reappearing in the routing path. If it can be readjusted, the q-exponent is increased to evaluate the priority of the baseline adjustment node (line 3-8). It can be seen that the larger the q-value of the baseline adjustment node, the lower the reward function of the node, and the lower the probability of the node being selected. Next, the minimum depth required for the holed node to recover is calculated for each baseline adjustment node, and then the reward function of each baseline adjustment node is calculated to prepare for subsequent processes. In each learning process, the value with the maximum reward function and its corresponding arm Φ are first stored. i Then, under the ε-Greedy policy, the choice arm is selected, and the reward is changed according to the normal distribution. Finally, the selection count of each Φi and the selection count of each Φi are updated. i Estimate the returns and iterate through this process. Finally, select the arm with the most selections (Φi) as the baseline adjustment node.

[0078] In the multi-armed slot machine problem, cumulative regret is a core concept used to measure the balance between exploration and exploitation, as well as the algorithm's performance. Specifically, it is the sum of the differences between the expected reward of pulling the current lever and the expected reward of pulling the optimal lever. Mathematically, this is expressed as formula (10).

[0079]

[0080] Here, maxQ represents the expected reward of the optimal action, while reward(at) represents the expected reward of each action chosen.

[0081] Algorithm 2 is specifically represented as follows:

[0082]

[0083] In one embodiment, such as Figure 3 The diagram illustrates the complete process of the route construction method based on genetic algorithms. In the initial stage of the sensor network, enhanced local topology sensing is first implemented to establish connections between each node and other nodes, laying the foundation for subsequent route construction using genetic algorithms and depth adjustment algorithms based on multi-armed slot machines. Secondly, if a node discovers it is in a hole region, a depth adjustment algorithm is executed to restore the node's communication, thereby extending the sensor network's lifespan. Finally, genetic algorithms are used to construct routes, achieving the goal of forwarding data from anchor nodes to sink nodes.

[0084] In summary, this invention constructs a high-quality initial population through the proposed enhanced local topology awareness. A novel crossover scheme and scaling function accelerate the convergence speed and search efficiency of the genetic algorithm. Furthermore, a multi-factor fitness function is designed using local topology to ensure chromosome quality. Additionally, a depth adjustment algorithm based on a multi-armed slot machine is designed to restore hollow nodes in communication-ineffective regions to better regions, thereby improving the performance of the routing protocol. Experiments show that the routing protocol disclosed in this invention has better performance in terms of packet delivery rate and end-to-end latency compared to other existing protocols.

[0085] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0086] Based on the same inventive concept, this application also provides a genetic algorithm-based route construction apparatus for implementing the above-mentioned genetic algorithm-based route construction method. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the genetic algorithm-based route construction apparatus provided below can be found in the limitations of the genetic algorithm-based route construction method described above, and will not be repeated here.

[0087] In one embodiment, a route construction apparatus based on a genetic algorithm is provided, comprising:

[0088] The topology awareness module is used to perform local topology awareness and establish connections between nodes;

[0089] The depth adjustment module is used to find whether there are nodes in the hole region. If so, the depth adjustment algorithm based on the multi-armed slot machine is used to restore the communication of the nodes in the hole region.

[0090] The route construction module is used to construct routes 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 route 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 energy of the current hop and the combined 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 combined link quality of the forwarding area.

[0091] The modules in the aforementioned route construction device based on genetic algorithms can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in all of the above method embodiments.

[0093] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in all of the above method embodiments.

[0094] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in all of the above method embodiments.

[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, data stored, data displayed, 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 the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0096] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0097] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A route construction method based on genetic algorithm, characterized in that, The method includes: Perform local topology awareness and establish connections between nodes; the nodes include sensor nodes and sink nodes. Check if there are any nodes in the hole region. If so, use a depth adjustment algorithm based on a multi-armed slot machine to restore the communication of the nodes in the hole region. A genetic algorithm is used to construct routes. The fitness function of the genetic algorithm incorporates 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 route 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 energy of the current hop and the combined 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 combined link quality of the forwarding area. The formula for the forward factor is as follows: Among them, h c h represents the current jump depth difference. n T represents the optimal depth difference for the next hop. r Indicates the sensing radius; The formula for the reliability energy index is as follows: Among them, E res E init These are the node's remaining energy and initial energy, respectively. avg(E(n)) represents the region's normalized energy. The values ​​of α1 and α2 are the corresponding proportional weights, representing the node's priority based on the combined performance of the current hop node's energy or the current hop region's energy. The formula for the link normalization index is as follows: Where β and γ represent the weights of the link quality between the current node and the next-hop node, the average link quality within the forwarding area of ​​the next-hop node, and the maximum link quality, respectively. s,n This indicates the link quality between the current node and the next-hop node. This indicates the average link quality within the forwarding area of ​​the next-hop node. This indicates the maximum link quality in the forwarding area of ​​the next-hop node.

2. The method according to claim 1, characterized in that, The process of performing local topology awareness and establishing connections between nodes includes: An enhanced two-hop topology awareness strategy is adopted to perform multiple rounds of local topology awareness, 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 the sink node connected to the sensor node. At the same time, during the execution of multiple rounds of local topology awareness, 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 method of constructing routes using a genetic algorithm includes: initializing the population, starting from the source node as the current node, selecting the 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 includes: If any two individuals randomly select different nodes for the nth hop in the path, and the (n+1)th hop of the two individuals is a neighbor of the other's nth hop, then the crossover strategy is executed.

6. The method according to claim 1, characterized in that, The genetic algorithm includes: If the mutation operator node finds that the sink node exists in the corresponding two-hop neighbor set, it mutates into the one-hop neighbor node corresponding to the sink node.

7. A route construction device based on a genetic algorithm, characterized in that, The device includes: The topology awareness module is used to perform local topology awareness and establish connections between nodes; The depth adjustment module is used to find whether there are nodes in the hole region. If so, the communication of the nodes in the hole region is restored by the depth adjustment algorithm based on the multi-armed slot machine. A route construction module is used to construct routes using a genetic algorithm. The fitness function of the genetic algorithm incorporates 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 route 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 energy of the current hop and the combined 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 combined link quality of the forwarding area. The formula for the forward factor is as follows: Among them, h c h represents the current jump depth difference. n T represents the optimal depth difference for the next hop. r Indicates the sensing radius; The formula for the reliability energy index is as follows: Among them, E res E init These are the node's remaining energy and initial energy, respectively. avg(E(n)) represents the region's normalized energy. The values ​​of α1 and α2 are the corresponding proportional weights, representing the node's priority based on the combined performance of the current hop node's energy or the current hop region's energy. The formula for the link normalization index is as follows: Where β and γ represent the weights of the link quality between the current node and the next-hop node, the average link quality within the forwarding area of ​​the next-hop node, and the maximum link quality, respectively. s,n This indicates the link quality between the current node and the next-hop node. This indicates the average link quality within the forwarding area of ​​the next-hop node. This indicates the maximum link quality in the forwarding area of ​​the next-hop node.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

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