Network route optimization method and device, electronic equipment and storage medium

By transforming the network routing problem into a graph theory problem and using the ant colony algorithm for pruning and optimization, the problem of excessive search time and computational cost in large-scale networks is solved, enabling fast selection of the optimal path and improving network performance and efficiency.

CN118301052BActive Publication Date: 2026-01-23INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410226590.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2026-01-23
Estimated Expiration
2044-02-29

AI Technical Summary

Technical Problem

In large-scale networks, the shortest path algorithm has a large search time and computational cost, making it difficult to meet practical needs.

Method used

The network routing problem is transformed into a graph theory problem. Pruning is performed to construct a local network graph theory model. Ant colony optimization is used for route selection. By updating pheromone concentration and optimizing the evaporation coefficient, the optimal path is quickly selected.

Benefits of technology

It reduces routing time, improves network performance and efficiency, adapts to the needs of large-scale networks, and reduces packet loss and latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118301052B_ABST
    Figure CN118301052B_ABST
Patent Text Reader

Abstract

The application provides a network routing optimization method and device, electronic equipment and storage medium, belongs to the technical field of routing planning, all network devices in the network, link data between the network devices and the weight corresponding to the link data are acquired, a network graph theory model is constructed according to the network devices, the link data and the weight, the network graph theory model is pruned according to a preset source node, a preset target node and the weight, a local network graph theory model is obtained, and routing optimization is performed on the local network graph theory model based on an ant colony algorithm, so that a routing path is obtained. The network routing problem is converted into a graph theory problem, the local network graph theory model is pruned, the network scale to be routed can be reduced, the routing time is reduced, the search and routing optimization are performed in the local network graph theory model based on the ant colony algorithm, the search time is further reduced, the demand of a large-scale network is met, and the performance and efficiency of the network are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of routing planning technology, and in particular to a network routing optimization method, apparatus, electronic device, and storage medium. Background Technology

[0002] In network routing, the shortest path algorithm is one of the most commonly used algorithms. It selects the shortest path by calculating the distances and weights between network devices. Dijkstra's algorithm and Bellman-Ford's algorithm are two commonly used shortest path algorithms. Shortest path algorithms perform well in small-scale networks, exhibiting efficiency and accuracy. However, in large-scale networks, the search time and computational cost of shortest path algorithms are significant, making them difficult to meet practical requirements. Summary of the Invention

[0003] This invention provides a network routing optimization method, apparatus, electronic device, and storage medium to address the shortcomings of shortest path algorithms, which have large search times and computational loads, making them unsuitable for large-scale network routing needs.

[0004] In a first aspect, the present invention provides a network routing optimization method, comprising:

[0005] Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data. Construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes.

[0006] The network graph theory model is pruned according to the preset source node, preset target node and the weight to obtain a local network graph theory model;

[0007] The ant colony algorithm is used to optimize the routing of the local network graph theory model to obtain the routing path.

[0008] According to a network routing optimization method provided by the present invention, the step of pruning the network graph theory model according to a preset source node, a preset target node, and the weights to obtain a local network graph theory model includes:

[0009] Determine the path between the source node and the target node;

[0010] The total weight of each path is determined based on the weight of the link data.

[0011] The network graph theory model is pruned according to the total weight to obtain the local network graph theory model.

[0012] According to a network routing optimization method provided by the present invention, the step of pruning the network graph theory model according to the total weight includes:

[0013] The total weights are sorted from largest to smallest, and the nodes corresponding to the top N total weights are pruned, or the nodes corresponding to the total weights that are higher than a preset value are pruned, thus completing the pruning process of the network graph theory model.

[0014] Where N is a positive integer.

[0015] According to a network routing optimization method provided by the present invention, the step of optimizing the routing path by performing route search on the local network graph theory model based on the ant colony algorithm includes:

[0016] Set an initial pheromone for each edge in the local network graph theory model;

[0017] Initialize at least one ant by randomly selecting a node in the local network graph theory model as the starting node for each ant.

[0018] Based on the pheromone concentration, the next node is selected from the starting node until the path selection is completed. The pheromone concentration of the local network graph theory model is updated. This step is repeated until the number of iterations reaches a set value or the optimal solution that meets the set conditions is found.

[0019] The optimal solution is used as the routing path.

[0020] According to a network routing optimization method provided by the present invention, updating the pheromone concentration of the local network graph theory model includes:

[0021] The update formula for the pheromone concentration in the local network graph theory model is as follows:

[0022] T ij (t+1)=(1-ρ)T ij (t)+ΔT ij (t);

[0023]

[0024] Among them, T ij (t+1) represents the updated pheromone concentration, ρ is the pheromone evaporation coefficient, and ΔT ij (t) represents the pheromone concentration increment from position i to position j, and I represents the number of ants.

[0025] According to a network routing optimization method provided by the present invention, the increment of pheromone concentration is calculated using an ant-week system model, and the calculation formula is as follows:

[0026]

[0027] Where Q represents the total amount of pheromones released, and L... k This represents the length of the path traversed by the ant.

[0028] A network routing optimization method provided by the present invention further includes:

[0029] The pheromone evaporation coefficient is improved to dynamically decrease, and the improved formula is as follows:

[0030]

[0031] Where ρ is the volatility coefficient, ρ max ρ represents the maximum volatility coefficient. min For the minimum volatility coefficient, n max This represents the maximum number of iterations.

[0032] Secondly, the present invention also provides a network routing optimization device, comprising:

[0033] A construction module is used to obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data, and to construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and edges between the nodes.

[0034] The preprocessing module is used to prune the network graph theory model according to the preset source node, the preset target node and the weight, so as to obtain a local network graph theory model.

[0035] The optimization module is used to perform route optimization on the local network graph theory model based on the ant colony algorithm to obtain the routing path.

[0036] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the network routing optimization methods described above.

[0037] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the network routing optimization methods described above.

[0038] The network routing optimization method, apparatus, electronic device, and storage medium provided by this invention transform the network routing problem into a graph theory problem. By pruning the network graph theory model, the size of the network to be routed can be reduced, thus reducing routing time. Based on the ant colony algorithm, search and route optimization are performed in the local network graph theory model, further reducing search time, adapting to the needs of large-scale networks, and improving network performance and efficiency. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 This is one of the flowcharts illustrating the network routing optimization method provided by the present invention;

[0041] Figure 2 This is a flowchart illustrating step S200 provided by the present invention;

[0042] Figure 3 This is a flowchart illustrating step S300 provided by the present invention;

[0043] Figure 4 This is the second flowchart of the network routing optimization method provided by the present invention;

[0044] Figure 5 This is a schematic diagram of the network routing optimization device provided by the present invention;

[0045] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0047] It should be noted that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly, for example, as a fixed connection, a detachable connection, or an integral connection; a mechanical connection or an electrical connection; a direct connection or an indirect connection through an intermediate medium; or a connection within two elements. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0048] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0049] The purpose of this invention is to solve the problems of excessively long search time and excessive computation in large-scale networks. By using the ant colony algorithm, an optimal path is quickly selected to transmit data packets from the source node to the destination node, reducing data packet loss and delay.

[0050] The following is combined Figures 1-6 This invention describes the network routing optimization method, apparatus, electronic device, and storage medium provided by the present invention.

[0051] Figure 1 This is one of the flowcharts illustrating the network routing optimization method provided by the present invention, such as... Figure 1 As shown, the present invention provides a network routing optimization method, including but not limited to the following steps:

[0052] Step S100: Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data; construct a network graph theory model based on the network devices, the link data, and the weights; the network graph theory model includes nodes and edges between the nodes.

[0053] Network devices include routers or switches. Link data refers to the communication path between two network devices, and the weights corresponding to the link data represent the distance or cost of that link. Network graph theory models can use DAGs (Directed Acyclic Graphs) to represent the network topology.

[0054] Step S200: Prune the network graph theory model according to the preset source node, preset target node and the weight to obtain a local network graph theory model;

[0055] Specifically, all network devices have a unique address in the network graph theory model. The source node refers to the network device that sends the data packet, and the destination node is the network device that receives the data packet.

[0056] Irrelevant nodes can be pruned using the addresses of the source and destination nodes in the network graph model. After pruning, the edges between nodes are also removed. Higher weights indicate greater latency or higher cost for data packet transmission, and routes are typically avoided. Therefore, nodes associated with higher weights can be pre-pruned based on their values, thus completing the pruning process for the network graph model. The nodes contained in a local network graph model are a subset of the network graph model.

[0057] Step S300: Optimize the routing of the local network graph theory model based on the ant colony algorithm to obtain the routing path.

[0058] Ant colony optimization (ACO) is an optimization algorithm that simulates the process of ants searching for food. Its core idea is to use a group of ants to search the solution space, leveraging pheromones and the cooperation of the colony to find the optimal solution. ACO has good search capabilities and adaptability, enabling it to find relatively good solutions to complex problems. Its parallel search and pheromone update mechanism makes the algorithm highly efficient and accurate. Therefore, in routing optimization problems of large-scale networks, ACO can better meet practical needs and improve network performance and efficiency.

[0059] For network routing problems, ant colony optimization methods can improve routing performance and efficiency. In ant colony optimization, each ant represents a routing path, and through the action of pheromones and the cooperation of the ants, the optimal routing path is ultimately found.

[0060] Ant colony optimization (ACO) uses pheromones to guide ant behavior. In route optimization, pheromones can represent the distance and weight between nodes. When a node is frequently used, its pheromone concentration increases, attracting more ants to search around that node. By continuously updating the pheromones, ACO can gradually converge to the optimal solution.

[0061] Optionally, if the distance between the source node and the target node is long, determining the routing path will take a long time. To adapt to network changes, at least one intermediate target node can be selected between the source node and the target node. First, the routing path between the source node and the intermediate target node is determined based on the ant colony algorithm, and data packets are transmitted according to this routing path. At the same time, the routing path between the intermediate target node and the target node is determined based on the ant colony algorithm. Using the above scheme can adapt to real-time network changes, facilitate the search for a better path, and at the same time, confuse attackers and improve the security of data packet transmission.

[0062] Understandably, this invention transforms the network routing problem into a graph theory problem, performs pruning on the network graph theory model, reduces the size of the network to be routed, and decreases routing time. Based on the ant colony algorithm, it performs search and route optimization in the local network graph theory model, further reducing search time, adapting to the needs of large-scale networks, and improving network performance and efficiency.

[0063] Figure 2 This is a flowchart illustrating step S200 provided by the present invention, as shown below. Figure 2 As shown, based on the above embodiments, as an optional embodiment, the step of pruning the network graph theory model according to the preset source node, the preset target node, and the weights to obtain a local network graph theory model includes:

[0064] Step S210: Determine the path between the source node and the target node; the path is a feasible path from the source node to the target node.

[0065] Step S220: Determine the total weight of each path based on the weight of the link data;

[0066] Step S230: Prune the network graph theory model according to the total weight to obtain the local network graph theory model.

[0067] Specifically, the pruning process for the network graph theory model based on the total weight includes:

[0068] The total weights are sorted from largest to smallest, and the nodes corresponding to the top N total weights are pruned, or the nodes corresponding to the total weights that are higher than a preset value are pruned, thus completing the pruning process of the network graph theory model.

[0069] Where N is a positive integer.

[0070] Optionally, in other embodiments, after performing one or more route optimizations on the local network graph theory model based on the ant colony algorithm, a secondary pruning process can be performed on the local network graph theory model based on the cases where the target node cannot be reached or the cost of reaching the target node is too high, as determined by the ant colony algorithm. Then, the ant colony algorithm is executed in the local network graph theory model after the secondary pruning process to improve the time for determining the route path.

[0071] Optionally, after reducing the network size, the shortest path algorithm can be combined to determine the routing path. The paths of the shortest path algorithm and the ant colony algorithm can be compared to avoid the defect of local optima.

[0072] It is understandable that this invention can effectively shorten the routing optimization time and thus improve efficiency by pruning the network scale.

[0073] Figure 3 This is a flowchart illustrating step S300 provided by the present invention, as shown below. Figure 3 As shown, based on the above embodiments, as an optional embodiment, the step of optimizing the local network graph theory model using the ant colony algorithm to obtain the routing path includes:

[0074] Step S310: Set an initial pheromone for each edge in the local network graph theory model;

[0075] Step S320: Initialize at least one ant by randomly selecting a node in the local network graph theory model as the starting node for each ant.

[0076] Step S330: Based on the pheromone concentration, select the next node from the starting node until the path selection is completed, update the pheromone concentration of the local network graph theory model, and repeat this step until the number of iterations reaches a set value or the optimal solution that meets the set conditions is found.

[0077] Step S340: The optimal solution is taken as the routing path.

[0078] Optionally, updating the pheromone concentration of the local network graph theory model includes:

[0079] The update formula for the pheromone concentration in the local network graph theory model is as follows:

[0080] T ij(t+1)=(1-ρ)T ij (t)+ΔT ij (t);

[0081]

[0082] Among them, T ij (t+1) represents the updated pheromone concentration, ρ is the pheromone evaporation coefficient, and ΔT ij (t) represents the pheromone concentration increment from position i to position j, and I represents the number of ants.

[0083] The increment of pheromone concentration was calculated using the ant-circle system model, and the calculation formula is as follows:

[0084]

[0085] Where Q represents the total amount of pheromones released, and L... k This represents the length of the path traversed by the ant.

[0086] Optionally, the present invention also improves the pheromone evaporation coefficient, so that the pheromone evaporation coefficient dynamically decreases. The improved formula is as follows:

[0087]

[0088] Where ρ is the volatility coefficient, ρ max ρ represents the maximum volatility coefficient. min For the minimum volatility coefficient, n max This represents the maximum number of iterations.

[0089] Figure 4 This is the second flowchart of the network routing optimization method provided by the present invention, as shown below. Figure 4 As shown, this invention provides a network routing optimization method based on ant colony algorithm, which can be divided into the following steps:

[0090] 1. Modeling Problem: Transform the network routing problem into a graph theory problem. Represent the network topology using a graph, where nodes represent devices in the network (routers or switches), and edges represent links (communication paths) between two devices. Each edge also needs to be associated with a weight, representing the distance or cost of that link.

[0091] 2. Initialize pheromones: Initialize the pheromone on each edge to a small constant value, representing the attractiveness of the path.

[0092] 3. Generate ants: Based on the network size and algorithm design requirements, initialize a certain number of ants and randomly select a starting node in the graph.

[0093] 4. Choosing the next node: Each ant chooses the next node at the current node with a certain probability, using pheromone concentration as the basis for decision-making.

[0094] 5. Pheromone Update: After all ants have completed their path selection, the pheromone concentration along the path is updated based on the quality of the chosen path. The pheromone update involves two parts: pheromone evaporation and pheromone accumulation. Pheromones continuously accumulate along the paths traversed by ants, while pheromones gradually evaporate along those paths. The specific update mechanism is shown in formulas (1) and (2):

[0095] T ij (t+1)=(1-ρ)T ij (t)+ΔT ij (t) (1)

[0096]

[0097] Wherein: T ij (t+1) represents the pheromone concentration after the pheromone update, ρ is the pheromone volatility coefficient, and ΔT ij (t) represents the pheromone concentration increment from position i to position j, and I represents the number of ants.

[0098] The increment ΔT of pheromone concentration was calculated using the ant-period system model. ij As shown in formula (3):

[0099]

[0100] Where: Q is the total amount of pheromones released, L k This represents the length of the path traversed by the ant.

[0101] Because the more hops the ant makes, the smaller the increase in pheromone concentration, leading to a local optimum, the volatility coefficient ρ is improved by using a gradually decreasing dynamic parameter, as shown in formula (4):

[0102]

[0103] Where: ρ is the volatility coefficient, ρ max ρ represents the maximum volatility coefficient. min For the minimum volatility coefficient, n max This represents the maximum number of iterations. The volatile coefficient is optimized to decrease dynamically, enhancing the global search capability in the early stages of the algorithm and avoiding getting trapped in local optima. In the later stages of the algorithm, the volatile coefficient gradually decreases, causing the pheromone concentration to increase rapidly and accelerating the convergence speed of the algorithm.

[0104] 6. Determine the stopping condition: Determine whether the stopping condition is met, such as the number of iterations reaching a set value or finding the optimal solution that meets the set condition.

[0105] 7. Repeat steps 5-7: Based on the set number of iterations or stopping conditions, repeat steps 5-7 until the optimal solution is found.

[0106] 8. Output the optimal solution: After the algorithm finishes execution, output the optimal solution found, which is the best path chosen by the ant colony on the network.

[0107] In ant colony optimization, pheromone updating is a crucial step. The initial pheromone value can be set to a small value and continuously updated during the search process. After each ant completes its search, the pheromone concentration is updated based on its path. When a node is frequently used, its pheromone concentration increases, attracting more ants to search around that node. Through multiple searches and pheromone updates, the ant colony algorithm gradually converges to the optimal solution.

[0108] Understandably, the backend employs the ant colony algorithm to solve network routing optimization problems, and has been optimized and improved for the characteristics of large-scale networks. Through the parallel search and pheromone update mechanism of the ant colony algorithm, optimized network routing schemes can be found quickly and can adapt to real-time network changes. This improves network transmission efficiency, enhances network performance, reduces network congestion and latency, and provides users with a better experience.

[0109] It should be noted that the execution subject of the network routing optimization method provided by the present invention can be a server, computer equipment, such as mobile phone, tablet computer, laptop computer, handheld computer, vehicle electronic equipment, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (PDA), etc.

[0110] The network routing optimization apparatus provided in this application is described below. The network routing optimization apparatus described below can be referred to in correspondence with the network routing optimization method described above.

[0111] Figure 5 This is a schematic block diagram of the network routing optimization device provided in this application, such as... Figure 5 As shown, this application also provides a network routing optimization device, including:

[0112] The construction module 510 is used to obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data, and to construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and edges between the nodes.

[0113] The preprocessing module 520 is used to prune the network graph theory model according to the preset source node, the preset target node and the weight to obtain a local network graph theory model.

[0114] The optimization module 530 is used to perform route optimization on the local network graph theory model based on the ant colony algorithm to obtain the routing path.

[0115] As one embodiment, the preprocessing module 520 is further configured to:

[0116] Determine the path between the source node and the target node;

[0117] The total weight of each path is determined based on the weight of the link data.

[0118] The network graph theory model is pruned according to the total weight to obtain the local network graph theory model.

[0119] As one embodiment, the preprocessing module 520 is further configured to:

[0120] The total weights are sorted from largest to smallest, and the nodes corresponding to the top N total weights are pruned, or the nodes corresponding to the total weights that are higher than a preset value are pruned, thus completing the pruning process of the network graph theory model.

[0121] Where N is a positive integer.

[0122] As one embodiment, the optimization module 530 is further configured to:

[0123] Set an initial pheromone for each edge in the local network graph theory model;

[0124] Initialize at least one ant by randomly selecting a node in the local network graph theory model as the starting node for each ant.

[0125] Based on the pheromone concentration, the next node is selected from the starting node until the path selection is completed. The pheromone concentration of the local network graph theory model is updated. This step is repeated until the number of iterations reaches a set value or the optimal solution that meets the set conditions is found.

[0126] The optimal solution is used as the routing path.

[0127] As one embodiment, the optimization module 530 is further configured to:

[0128] The update formula for the pheromone concentration in the local network graph theory model is as follows:

[0129] T ij (t+1)=(1-ρ)Tij (t)+ΔT ij (t);

[0130]

[0131] Among them, T ij (t+1) represents the updated pheromone concentration, ρ is the pheromone evaporation coefficient, and ΔT ij (t) represents the pheromone concentration increment from position i to position j, and I represents the number of ants.

[0132] As an example, the increment of pheromone concentration is calculated using an ant-week system model, and the calculation formula is as follows:

[0133]

[0134] Where Q represents the total amount of pheromones released, and L... k This represents the length of the path traversed by the ant.

[0135] As one embodiment, the optimization module 530 is further configured to:

[0136] The pheromone evaporation coefficient is improved to dynamically decrease, and the improved formula is as follows:

[0137]

[0138] Where ρ is the volatility coefficient, ρ max ρ represents the maximum volatility coefficient. min For the minimum volatility coefficient, n max This represents the maximum number of iterations.

[0139] It should be noted that the network routing optimization device provided by the present invention can execute the network routing optimization method described in any of the above embodiments during specific operation, and has the technical effects corresponding to the method. This embodiment will not elaborate on this.

[0140] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a network routing optimization method, which includes:

[0141] Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data. Construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes.

[0142] The network graph theory model is pruned according to the preset source node, preset target node and the weight to obtain a local network graph theory model;

[0143] The ant colony algorithm is used to optimize the routing of the local network graph theory model to obtain the routing path.

[0144] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0145] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the network routing optimization method provided in the above embodiments, the method comprising:

[0146] Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data. Construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes.

[0147] The network graph theory model is pruned according to the preset source node, preset target node and the weight to obtain a local network graph theory model;

[0148] The ant colony algorithm is used to optimize the routing of the local network graph theory model to obtain the routing path.

[0149] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the network routing optimization method provided in the above embodiments, the method comprising:

[0150] Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data. Construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes.

[0151] The network graph theory model is pruned according to the preset source node, preset target node and the weight to obtain a local network graph theory model;

[0152] The ant colony algorithm is used to optimize the routing of the local network graph theory model to obtain the routing path.

[0153] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0154] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A network routing optimization method, characterized in that, include: Obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data. Construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes. The network graph theory model is pruned according to the preset source node, preset target node and the weight to obtain a local network graph theory model; The ant colony algorithm is used to optimize the routing of the local network graph theory model to obtain the routing path. The step of pruning the network graph theory model according to the preset source node, preset target node, and weights to obtain a local network graph theory model includes: Determine the path between the source node and the target node; The total weight of each path is determined based on the weight of the link data. The network graph theory model is pruned according to the total weight to obtain the local network graph theory model; The pruning process for the network graph theory model based on the total weight includes: The total weights are sorted from largest to smallest, and the nodes corresponding to the top N total weights are pruned, or the nodes corresponding to the total weights that are higher than a preset value are pruned, thus completing the pruning process of the network graph theory model. Where N is a positive integer.

2. The network routing optimization method according to claim 1, characterized in that, The method of optimizing the local network graph theory model based on the ant colony algorithm to obtain the routing path includes: Set an initial pheromone for each edge in the local network graph theory model; Initialize at least one ant by randomly selecting a node in the local network graph theory model as the starting node for each ant. Based on the pheromone concentration, the next node is selected from the starting node until the path selection is completed. The pheromone concentration of the local network graph theory model is updated. This step is repeated until the number of iterations reaches a set value or the optimal solution that meets the set conditions is found. The optimal solution is used as the routing path.

3. A network routing optimization device, characterized in that, include: A construction module is used to obtain all network devices in the network, the link data between the network devices, and the weights corresponding to the link data, and to construct a network graph theory model based on the network devices, the link data, and the weights. The network graph theory model includes nodes and the edges between the nodes. The preprocessing module is used to prune the network graph theory model according to the preset source node, the preset target node and the weight, so as to obtain a local network graph theory model. The optimization module is used to perform route optimization on the local network graph theory model based on the ant colony algorithm to obtain the routing path; The step of pruning the network graph theory model according to the preset source node, preset target node, and weights to obtain a local network graph theory model includes: Determine the path between the source node and the target node; The total weight of each path is determined based on the weight of the link data. The network graph theory model is pruned according to the total weight to obtain the local network graph theory model; The pruning process for the network graph theory model based on the total weight includes: The total weights are sorted from largest to smallest, and the nodes corresponding to the top N total weights are pruned, or the nodes corresponding to the total weights that are higher than a preset value are pruned, thus completing the pruning process of the network graph theory model. Where N is a positive integer.

4. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the network routing optimization method as described in any one of claims 1 to 2.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the network routing optimization method as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Distributed intrusion detection method based on ant colony algorithm

    CN107612916A

  • Attack-defense countermeasure considered intelligent planning method for unmanned aerial vehicle track

    CN108318032A