Real-time routing optimization method and system based on two-dimensional matrix dynamic programming
By building a multi-point to multi-point shortest path model in the routing optimization system and using a two-dimensional matrix dynamic programming algorithm, the flexible adaptation problem of routing optimization methods in the existing technology when network changes is solved, real-time routing optimization and traffic management are realized, and network performance is improved.
Patent Information
- Application Number
- CN202510049282.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-04-25
AI Technical Summary
The existing real-time routing optimization method based on two-dimensional matrix dynamic programming lacks flexibility and adaptability when network topology and traffic requirements change, resulting in path overload or underutilization of other paths.
By building a multi-point to multi-point shortest path model, the shortest path is calculated using a two-dimensional matrix dynamic programming algorithm, and the path information in the matrix is periodically updated. When the traffic changes, the new shortest path is calculated in time to optimize traffic allocation and path selection.
It realizes timely updates the shortest path of each pair of nodes in the network, optimizes the transmission path of data flow, reduces latency, improves network throughput, and automatically adjusts traffic allocation to cope with network topology changes.
Smart Images

Figure CN119892714A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of communication network optimization, and more specifically, particularly relates to a real-time routing optimization method and system based on two-dimensional matrix dynamic programming. Background Art
[0002] In modern communication networks, the Internet of Things, intelligent transportation systems and other fields, with the continuous expansion of network scale and the increase in complexity, traditional routing algorithms can no longer meet the needs of efficient and real-time routing optimization. In order to optimize data flow, improve the utilization of network resources and reduce network delays, routing optimization methods based on dynamic programming have emerged. By constructing a two-dimensional matrix and using the dynamic programming method to calculate the shortest path, the shortest path calculation from multiple points to multiple points can be realized, thereby effectively performing traffic planning and path optimization.
[0003] In actual networks, topology, traffic demand, node status, and link bandwidth often change. For example, link failure, node failure, bandwidth change, and traffic fluctuation may affect the shortest path calculation. If the entire path matrix needs to be recalculated every time the network environment changes, it will lead to unnecessary computational waste. The routing optimization method based on two-dimensional matrix dynamic programming sticks to the framework of shortest path calculation and lacks the ability to flexibly adapt to changes in actual network load and traffic demand. When traffic demand changes significantly, the system may not be able to adjust the routing strategy in real time, resulting in overload of some paths and underutilization of other paths. Summary of the invention
[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0005] In view of the above or existing problems of the real-time routing optimization method and system based on two-dimensional matrix dynamic programming, the present invention is proposed.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] The embodiment of the present invention provides a real-time routing optimization method based on two-dimensional matrix dynamic programming, including: constructing the entire routing system as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, setting the matrix dimension, defining the matrix D m,n As the calculation result of the shortest path;
[0008] Initialize the vertical and horizontal axes of the matrix and the initial state;
[0009] For each node m, the shortest path from the starting point to the node is calculated step by step, and the corresponding value in the matrix is updated. For each step of calculation, the shortest path of the current step is calculated by the shortest path of the previous step and the weight of the edge;
[0010] Calculate the shortest path from the starting point to all nodes at each number of steps, and iterate the calculation step by step until the shortest paths of all nodes have been updated;
[0011] Based on the calculation results of the matrix, for each node and path, optimization is performed according to the network traffic demand to determine the distribution of traffic and the selection of paths;
[0012] The path information in the matrix is updated periodically, and when the traffic changes, the new shortest path is calculated in time.
[0013] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: the matrix dimension is set, and the matrix D is defined m,n The shortest path calculation results include:
[0014] The vertical axis of the matrix is the node, including L1 node, L2 node and original station, and the horizontal axis is the number of steps; m is the node, n is the step number mark, and each element of the matrix represents the shortest path length from a starting point to a certain node.
[0015] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: the vertical axis and horizontal axis and the initial state of the initialization matrix include:
[0016] For each node m, when the step number is 0, the matrix value D m,0 =0, indicating that the shortest path of the node itself is zero. For other nodes, it is initialized to a maximum value, indicating that they are unreachable.
[0017] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: for each node m, the shortest path from the starting point to the node is calculated step by step, and the corresponding value in the matrix is updated, including:
[0018] Create a matrix D m,n , where m is the node, n is the number of steps, and initially D source,0 = 0, indicating that the shortest path of the source node is 0. For all other nodes m, initialize D m,0 =∞, indicating that the paths to these nodes cannot be reached without any steps. For each node m, the shortest path from the source node to m is updated step by step; check whether each edge (u, v) can update the shortest path through relaxation operations:
[0019] D v,k =min(D v,k , D u,k-1 +w(u,v))
[0020] Among them, D v,k represents the shortest path to node v through k steps, D u,k-1 represents the shortest path to node u through k-1, w(u,v) is the weight of the edge from node u to node v;
[0021] Introducing the adjustment factor f(u,v), the adjusted path weight W(u,v) is expressed as:
[0022] W(u, v) = w(u, v) + f(u, v) where f(u, v) is a function related to the current traffic level;
[0023] The traffic adjustment factor is introduced into the calculation of the comprehensive path weight, and the new path weight W(u,v) is expressed as:
[0024] W(u,v)=w(u,v)+λ×ρ(u,v)
[0025] Among them, w(u,v) is the initial path weight, reflecting the static cost, ρ(u,v) is the bandwidth utilization, reflecting the current traffic level; λ is the adjustment coefficient;
[0026] According to the network conditions, the value of the proportional coefficient λ is adjusted to balance the relationship between path cost and traffic load; whenever the traffic or topology in the network changes, the path is dynamically updated by recalculating the matrix.
[0027] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: the shortest path from the starting point to all nodes at each number of steps is calculated, and the shortest paths of all nodes are gradually iterated until the shortest paths have been updated, including:
[0028] Check the path cost from the source node to the directly adjacent node and update it, and check the path from the source node to an intermediate node until the path information of all nodes is updated;
[0029] If the path cost in a column of the matrix cannot be updated, the shortest path cost of each node is extracted and further traffic planning is performed according to the demand.
[0030] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: for each node and path, the relative balance of the distribution of the overall traffic is determined according to the Nth shortest path assigned by the user:
[0031] For each path, evaluate its performance indicators, including latency, bandwidth, and packet loss rate. According to the processing capacity and current load of the server, assign the request to different servers by weight. Prioritize assigning new requests to the server with the least current connections to balance the load. According to the real-time response time of the server, assign the request to the server with the fastest response.
[0032] According to the performance index of each path, a weighted allocation strategy is adopted to allocate the total flow R ij Assign to multiple paths. Assume that K paths are calculated for the node pair (i, j), and the weight of the k-th path is Wk. Then the flow Rk assigned to the k-th path is expressed as:
[0033]
[0034] The weight Wk is determined based on the performance index of the path.
[0035] As a preferred solution of the real-time routing optimization method based on two-dimensional matrix dynamic programming of the present invention, wherein: the path information in the matrix is periodically updated, and when the traffic changes, a new shortest path is calculated in time, including:
[0036] When the shortest path matrix is updated, the system redistributes traffic based on the new path information. For each pair of nodes (i, j), based on the new shortest path matrix D (i,j) , reselect the path for traffic transmission. If there are multiple optional paths in the network, the system will select the optimal path based on the new shortest path cost;
[0037] According to the traffic demand R of each pair of nodes ij , as well as the updated shortest path and path bandwidth, reallocate traffic. During traffic allocation, if the bandwidth of a certain path is insufficient, the system ensures that traffic demand is met by adjusting traffic allocation or selecting an alternative path.
[0038] A real-time routing optimization system based on two-dimensional matrix dynamic programming, comprising: a model definition module, for constructing the entire routing system as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, setting the matrix dimension, defining the matrix D m,n As the calculation result of the shortest path;
[0039] The matrix initialization module is used to initialize the vertical axis and horizontal axis of the matrix as well as the initial state;
[0040] The planning transfer module is used to calculate the shortest path from the starting point to each node m step by step, update the corresponding value in the matrix, and for each step of calculation, calculate the shortest path of the current step through the shortest path of the previous step and the weight of the edge;
[0041] The path calculation module is used to calculate the shortest path from the starting point to all nodes at each number of steps, and gradually iterate the calculation until the shortest path of all nodes;
[0042] Traffic planning module, used to determine the relative balance of overall traffic distribution based on the calculation results of the matrix for each node and path according to the Nth shortest path assigned by the user;
[0043] The real-time optimization module is used to periodically update the path information in the matrix and calculate the new shortest path in time when the traffic changes.
[0044] A computing device, comprising:
[0045] at least one processor, memory, and input-output unit;
[0046] The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the steps of the real-time routing optimization method based on two-dimensional matrix dynamic programming.
[0047] A computer-readable storage medium includes instructions, which, when executed on a computer, enable the computer to execute the steps of a real-time routing optimization method based on two-dimensional matrix dynamic programming.
[0048] The beneficial effects of the present invention are as follows: the present invention can simultaneously calculate the shortest paths from multiple starting points to multiple end points through a dynamic programming algorithm based on a two-dimensional matrix, thereby significantly improving the efficiency of route selection. By dynamically updating the path matrix during the calculation process, the shortest path of each pair of nodes in the network can be updated in a timely manner, effectively optimizing the transmission path of the data stream, reducing delays and improving the throughput of the network. The present invention introduces an incremental update method, and when the network topology changes, only the shortest path of the affected part is recalculated, thereby avoiding repeated calculations of the path matrix of the entire network, significantly reducing the complexity of the calculation. The flow distribution can be automatically adjusted, and a new shortest path can be selected to cope with changes in the network topology, thereby ensuring the stability and reliability of the data stream. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0050] Figure 1 A flowchart of a real-time routing optimization method based on two-dimensional matrix dynamic programming is provided in an embodiment of the present invention.
[0051] Figure 2 A schematic diagram of the structure of a real-time routing optimization system based on two-dimensional matrix dynamic programming is provided in an embodiment of the present invention.
[0052] Figure 3 A schematic structural diagram of a medium according to an embodiment of the present invention is schematically shown.
[0053] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is schematically shown.
[0054] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0058] Example
[0059] Reference below Figure 1 , Figure 1 This is a flow chart of a real-time routing optimization method based on two-dimensional matrix dynamic programming provided by an embodiment of the present invention. It should be noted that the embodiments of the present invention can be applied to any applicable scenario.
[0060] Figure 1 The process of the real-time routing optimization method based on two-dimensional matrix dynamic programming provided by an embodiment of the present invention includes:
[0061] S1: Construct the entire routing system as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, set the matrix dimension, and define the matrix D m,n As the calculation result of the shortest path.
[0062] Preferably, the vertical axis of the matrix is nodes, including L1 nodes, L2 nodes and the original station, and the horizontal axis is the number of steps; m is the node, n is the step number mark, and each element of the matrix represents the shortest path length from a starting point to a certain node.
[0063] Furthermore, let the matrix D m,n The dimension is M×M, where row m represents a starting node N m , i.e. from node N m Starting from, column n represents a terminal node N n , that is, the target node of the path is N n ;
[0064] Assume there is a network consisting of 4 nodes (N1, N2, N3, N4), and the initial connections between the nodes are as follows:
[0065] The path cost from N1 to N2 is 2, the path cost from N2 to N3 is 3, the path cost from N1 to N3 is 5, the path cost from N3 to N4 is 1, and there is no direct connection between the remaining nodes, which is initialized to ∞.
[0066] Therefore, the matrix D m,n Initially as follows:
[0067]
[0068] If a shorter path can be obtained through an intermediate node k, the value of the shortest path is updated. For each pair of nodes (m, n) and each intermediate node k, the value of the matrix D is updated:
[0069] D m,n =min(D m,n , D m,k +D k,n )
[0070] From Node N m To Node N n The shortest path is either directly from D m,n Given, either through the intermediate node N k the path passed;
[0071] Taking matrix D as an example, the Floyd-Warshall algorithm is used to update the shortest path. After one round of calculation, the value of matrix D will change. In the first round, node N1 is used as the intermediate node to update the path.
[0072] Calculate whether the path from N2 to N3 is shorter via N1: D 2,3 =min(D2,3,D2,1+D1,3), but D 2,1 =∞, so no update, calculate other paths;
[0073] The second round uses node N2 as the intermediate node to update the path and continues to calculate until the value in matrix D no longer changes. The final updated matrix may be as follows:
[0074]
[0075] This matrix represents that from node N m To Node N n The shortest path cost.
[0076] S2: Initialize the vertical and horizontal axes of the matrix and the initial state.
[0077] Preferably, for each node m, when the step number is 0, the matrix value D m,0 =0, indicating that the shortest path of the node itself is zero. For other nodes, it is initialized to a maximum value, indicating that they are unreachable.
[0078] Furthermore, we use the previously initialized matrix D to represent the initial path cost of the network. The first iteration (using N1 as the intermediate node): for each pair of nodes (m, n), check whether there is a shorter path through the intermediate node N1. If the path from node N m To Node N n If the path through N1 is shorter, the corresponding element in the matrix is updated.
[0079] For example, calculate D 2,3 :D2,3=min(D 2,3 ,D 2,1 +D 1,3 )=min(3,∞+5)=3;
[0080] Second iteration (using N2 as the intermediate node): Update the matrix. Similarly, check whether a shorter path can be found through N2 as the intermediate node. Continue iterating until all intermediate nodes have been checked. Suppose after all iterations, we get the following shortest path matrix:
[0081]
[0082] This matrix represents the shortest path cost from any node to any other node.
[0083] S3: For each node m, the shortest path from the starting point to the node is calculated step by step, and the corresponding value in the matrix is updated. For each step of calculation, the shortest path of the current step is calculated by the shortest path of the previous step and the weight of the edge.
[0084] Preferably, create a matrix D m,n , where m is the node, n is the number of steps, and initially D source,0= 0, indicating that the shortest path of the source node is 0. For all other nodes m, initialize D m,0 =∞, indicating that the paths to these nodes cannot be reached without any steps. For each node m, the shortest path from the source node to m is updated step by step; check whether each edge (u, v) can update the shortest path through relaxation operations:
[0085] D v,k =min(D v,k ,D u,k-1 +w(u,v)) where, D v,k represents the shortest path to node v through k steps, D u,k-1 represents the shortest path to node u through k-1, w(u,v) is the weight of the edge from node u to node v;
[0086] Introducing the adjustment factor f(u,v), the adjusted path weight W(u,v) is expressed as:
[0087] W(u,v)=w(u,v)+f(u,v)
[0088] Among them, f(u,v) is a function related to the current traffic level;
[0089] The traffic adjustment factor is introduced into the calculation of the comprehensive path weight, and the new path weight W(u,v) is expressed as:
[0090] W(u,v)=w(u,v)+λ×ρ(u,v)
[0091] Among them, w(u,v) is the initial path weight, reflecting the static cost, ρ(u,v) is the bandwidth utilization, reflecting the current traffic level; λ is the adjustment coefficient;
[0092] According to the network conditions, the value of the proportional coefficient λ is adjusted to balance the relationship between path cost and traffic load; whenever the traffic or topology in the network changes, the path is dynamically updated by recalculating the matrix.
[0093] Furthermore, assume that there is the following network topology:
[0094]
[0095] Among them, N1, N2, N3, N4 are nodes, and the edge weights are as follows: edge (N1, N2) weight is 2, edge (N1, N3) weight is 5, edge (N2, N4) weight is 3, edge (N3, N4) weight is 6, edge (N2, N3) weight is 1. Assume that the source node is N1, and initialize the matrix D:
[0096]
[0097] Assume that the matrix is updated with step number k=1, check each edge: edge (N1, N2), current D N2,0 =∞, through relaxation operation: D N2,1 =min(∞,D N1,0 +w(N1,N2))=min(∞,0+2)=2;edge(N1,N3), current D N3,0 =∞, through relaxation operation: D N3,1 =min(∞,D N1,0 +w(N1,N3))=min(∞,0+5)=5. After updating, the matrix becomes:
[0098]
[0099] The second step is to update using k=2 and check all edges: edge (N2, N3), current D N3,1 =5, through relaxation operation: D N3,2 =min(5,D N2,1 +w(N2,N3))=min(5,2+1)=3;
[0100] Edge (N2, N4), current D N4,1 =∞, through relaxation operation: D N4,2 =min(∞,D N2,1 +w(N2,N4))=min(∞,2+3)=5, the updated matrix is:
[0101]
[0102] Continue to perform more step updates until the shortest paths of all nodes are calculated, and finally, the shortest paths from the source node N1 to all other nodes will be obtained.
[0103] Furthermore,
[0104] S4: Calculate the shortest path from the starting point to all nodes at each number of steps, and iterate the calculation step by step until the shortest paths of all nodes have been updated.
[0105] Preferably, the path cost from the source node to the directly adjacent node is checked and updated, and the path from the source node to the path passing through an intermediate node is checked until the path information of all nodes is updated;
[0106] If the path cost in a column of the matrix cannot be updated, the shortest path cost of each node is extracted and further traffic planning is performed according to the demand.
[0107] S5: Based on the calculation results of the matrix, for each node and path, the relative balance of the overall traffic distribution is determined according to the Nth shortest path assigned by the user.
[0108] Preferably, for each path, its performance indicators, including latency, bandwidth and packet loss rate, are evaluated. According to the processing capacity and current load of the server, the request is assigned to different servers according to the weight. New requests are preferentially assigned to the server with the least current connections to balance the load. According to the real-time response time of the server, the request is assigned to the server with the fastest response.
[0109] According to the performance index of each path, a weighted allocation strategy is adopted to allocate the total flow R ij Assign to multiple paths. Assume that K paths are calculated for the node pair (i, j), and the weight of the k-th path is Wk. Then the flow Rk assigned to the k-th path is expressed as:
[0110]
[0111] The weight Wk is determined based on the performance index of the path.
[0112] Furthermore, assume that there are three paths P1, P2, and P3, and their performance indicators are as follows:
[0113] P1: Latency = 50ms, Bandwidth = 100Mbps, Packet Loss = 1%
[0114] P2: Latency = 30ms, Bandwidth = 80Mbps, Packet Loss = 2%
[0115] P3: Latency = 40ms, Bandwidth = 60Mbps, Packet Loss = 0.5%
[0116] Set the weight coefficients α = 0.5, β = 0.3, γ = 0.2. After normalization, calculate the weight of each path:
[0117] W_path(P1)=0.5×(1 / 50)+0.3×100+0.2×(1 / 0.01)
[0118] W_path(P2)=0.5×(1 / 30)+0.3×80+0.2×(1 / 0.02)
[0119] W_path(P3)=0.5×(1 / 40)+0.3×60+0.2×(1 / 0.005)
[0120] According to the calculation results, it is assumed that the weight ratio is P1:P2:P3=5:3:2.
[0121] Therefore, under the weighted round-robin policy, 50% of the requests are assigned to P1, 30% to P2, and 20% to P3.
[0122] S6: Periodically update the path information in the matrix and calculate the new shortest path in time when the traffic changes.
[0123] Preferably, when the shortest path matrix is updated, the system redistributes traffic based on the new path information. For each pair of nodes (i, j), based on the new shortest path matrix D (i,j) , reselect the path for traffic transmission. If there are multiple optional paths in the network, the system will select the optimal path based on the new shortest path cost;
[0124] According to the traffic demand R of each pair of nodes ij , as well as the updated shortest path and path bandwidth, reallocate traffic. During traffic allocation, if the bandwidth of a certain path is insufficient, the system ensures that traffic demand is met by adjusting traffic allocation or selecting an alternative path.
[0125] After introducing the method of the exemplary embodiment of the present invention, next, refer to Figure 2 A real-time routing optimization system based on two-dimensional matrix dynamic programming according to an exemplary embodiment of the present invention is described. The system includes:
[0126] The model definition module is used to build the entire routing system into a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, set the matrix dimension, and define the matrix D m,n As the calculation result of the shortest path;
[0127] The matrix initialization module is used to initialize the vertical axis and horizontal axis of the matrix as well as the initial state;
[0128] The planning transfer module is used to calculate the shortest path from the starting point to each node m step by step, update the corresponding value in the matrix, and for each step of calculation, calculate the shortest path of the current step through the shortest path of the previous step and the weight of the edge;
[0129] The path calculation module is used to calculate the shortest path from the starting point to all nodes at each number of steps, and gradually iterate the calculation until the shortest paths of all nodes have been updated;
[0130] Traffic planning module, used to determine the relative balance of overall traffic distribution based on the calculation results of the matrix for each node and path according to the Nth shortest path assigned by the user;
[0131] The real-time optimization module is used to periodically update the path information in the matrix and calculate the new shortest path in time when the traffic changes.
[0132] After introducing the method and apparatus of the exemplary embodiment of the present invention, next, reference is made to Figure 3 For a description of a computer-readable storage medium according to an exemplary embodiment of the present invention, please refer to Figure 3 The computer-readable storage medium shown is a CD 30, on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, the steps described in the above method implementation are implemented, for example, the entire routing system is constructed as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, and the matrix dimension is set to define the matrix D m,n as the calculation result of the shortest path; initialize the vertical axis and horizontal axis of the matrix and the initial state; for each node m, gradually calculate the shortest path from the starting point to the node, update the corresponding value in the matrix, and for each step of the calculation, calculate the shortest path of the current step through the shortest path of the previous step and the weight of the edge; calculate the shortest path from the starting point to all nodes at each step, and gradually iterate the calculation until the shortest paths of all nodes have been updated; based on the calculation results of the matrix, for each node and path, determine the relative balance of the overall traffic distribution according to the Nth shortest path assigned by the user; periodically update the path information in the matrix, and when the traffic changes, calculate the new shortest path in time; the specific implementation method of each step will not be repeated here.
[0133] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.
[0134] After introducing the method, apparatus and medium of the exemplary embodiments of the present invention, next, reference is made to Figure 4 A computing device for real-time route optimization based on two-dimensional matrix dynamic programming according to an exemplary embodiment of the present invention.
[0135] Figure 4 A block diagram of an exemplary computing device 40 suitable for implementing embodiments of the present invention is shown, and the computing device 40 may be a computer system or a server. Figure 4 The computing device 40 shown is only an example and should not bring any limitation to the functionality and scope of use of the embodiments of the present invention.
[0136] like Figure 4As shown, the components of the computing device 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 connecting different system components (including the system memory 402 and the processing unit 401).
[0137] The computing device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 40, including volatile and non-volatile media, removable and non-removable media.
[0138] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 4021 and / or cache memory 4022. Computing device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 4023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 is not shown in the Figure 4 As shown in FIG. 4 , a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data medium interfaces. System memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0139] A program / utility 4025 having a set (at least one) of program modules 4024 may be stored, for example, in system memory 402, and such program modules 4024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 4024 generally perform the functions and / or methods of the embodiments described herein.
[0140] The computing device 40 may also communicate with one or more external devices 404 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output (I / O) interface 405. Furthermore, the computing device 40 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 406. Figure 4 As shown, the network adapter 406 communicates with other modules (such as the processing unit 401, etc.) of the computing device 40 via the bus 403. It should be understood that although Figure 4 Not shown, other hardware and / or software modules may be used in conjunction with computing device 40 .
[0141] The processing unit 401 executes various functional applications and data processing by running the program stored in the system memory 402, for example, constructing the entire routing system as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, setting the matrix dimension, and defining the matrix D m,n As the calculation result of the shortest path; initialize the vertical axis and horizontal axis of the matrix as well as the initial state; for each node m, gradually calculate the shortest path from the starting point to the node, update the corresponding value in the matrix, and for each step of the calculation, calculate the shortest path of the current step through the shortest path of the previous step and the weight of the edge; calculate the shortest path from the starting point to all nodes at each step, and gradually iterate the calculation until the shortest paths of all nodes have been updated; based on the calculation results of the matrix, for each node and path, determine the relative balance of the overall traffic distribution according to the Nth shortest path assigned by the user; periodically update the path information in the matrix, and when the traffic changes, calculate the new shortest path in time.
[0142] The specific implementation method of each step will not be repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the synchronous escape wiring device based on multiple commodity flows are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided to be concretized by multiple units / modules.
[0143] In the description of the present invention, it should be noted that the terms “first”, “second” and “third” are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0144] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0145] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0148] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0149] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
[0150] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
Claims
1. A real-time routing optimization method based on two-dimensional matrix dynamic programming, characterized in that: include: The entire routing system is constructed as a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, setting the matrix dimension and defining the matrix D m,n As the calculation result of the shortest path; Initialize the vertical and horizontal axes of the matrix and the initial state; For each node m, the shortest path from the starting point to the node is calculated step by step, and the corresponding value in the matrix is updated. For each step of calculation, the shortest path of the current step is calculated by the shortest path of the previous step and the weight of the edge; Calculate the shortest path from the starting point to all nodes at each number of steps, and iterate step by step until the shortest path of all nodes is reached; Based on the calculation results of the matrix, for each node and path, the relative balance of the overall traffic distribution is determined according to the Nth shortest path assigned by the user; The path information in the matrix is updated periodically, and when the traffic changes, the new shortest path is calculated in time.
2. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: The setting matrix dimension is defined as the matrix D m,n The shortest path calculation results include: The vertical axis of the matrix is the node, including L1 node, L2 node and original station, and the horizontal axis is the number of steps; m is the node, n is the step number mark, and each element of the matrix represents the shortest path length from a starting point to a certain node.
3. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: The vertical axis and horizontal axis and the initial state of the initialization matrix include: For each node m, when the step number is 0, the matrix value D m,0 =0, indicating that the shortest path of the node itself is zero. For other nodes, it is initialized to a maximum value, indicating that they are unreachable.
4. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: For each node m, the shortest path from the starting point to the node is calculated step by step, and the corresponding value in the matrix is updated, including: Create a matrix D m,n , where m is the node, n is the number of steps, and initially D source,0 = 0, indicating that the shortest path of the source node is 0. For all other nodes m, initialize D m,0 =∞, indicating that the paths to these nodes cannot be reached without any steps. For each node m, the shortest path from the source node to m is updated step by step; check whether each edge (u, v) can update the shortest path through relaxation operations: D v,k =min(D v,k ,D u,k-1 +w(u,v))where, D v,k represents the shortest path to node v through k steps, D u,k-1 represents the shortest path to node u through k-1, w(u,v) is the weight of the edge from node u to node v; Introducing the adjustment factor f(u,v), the adjusted path weight W(u,v) is expressed as: W(u,v)=w(u,v)+f(u,v) Among them, f(u,v) is a function related to the current traffic level; The traffic adjustment factor is introduced into the calculation of the comprehensive path weight, and the new path weight W(u,v) is expressed as: W(u,v)=w(u,v)+λ×ρ(u,v) Among them, w(u,v) is the initial path weight, reflecting the static cost, ρ(u,v) is the bandwidth utilization, reflecting the current traffic level; λ is the adjustment coefficient; According to the network conditions, adjust the value of the proportional coefficient λ to balance the relationship between path cost and traffic load; Whenever the traffic or topology in the network changes, the paths are dynamically updated by recalculating the matrix.
5. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: The method of calculating the shortest path from the starting point to all nodes at each number of steps, and iterating the calculation step by step until the shortest path of all nodes is obtained, includes: Check the path cost from the source node to the directly adjacent node and update it, and check the path from the source node to an intermediate node until the path information of all nodes is updated; If the path cost in a column of the matrix cannot be updated, the shortest path cost of each node is extracted and further traffic planning is performed according to the demand.
6. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: For each node and path, the relative balance of the overall traffic distribution is determined according to the Nth shortest path assigned by the user: For each path, evaluate its performance indicators, including latency, bandwidth, and packet loss rate. According to the processing capacity and current load of the server, assign the request to different servers by weight. Prioritize assigning new requests to the server with the least current connections to balance the load. According to the real-time response time of the server, assign the request to the server with the fastest response. According to the performance index of each path, a weighted allocation strategy is adopted to allocate the total flow R ij Assign to multiple paths. Assume that K paths are calculated for the node pair (i, j), and the weight of the k-th path is Wk. Then the flow Rk assigned to the k-th path is expressed as: The weight Wk is determined based on the performance index of the path.
7. The real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in claim 1, characterized in that: The method of periodically updating the path information in the matrix and calculating a new shortest path in a timely manner when the traffic volume changes includes: When the shortest path matrix is updated, the system redistributes traffic based on the new path information. For each pair of nodes (i, j), based on the new shortest path matrix D (i,j) , reselect the path for traffic transmission. If there are multiple optional paths in the network, the system will select the optimal path based on the new shortest path cost; According to the traffic demand R of each pair of nodes ij , as well as the updated shortest path and path bandwidth, reallocate traffic. During traffic allocation, if the bandwidth of a certain path is insufficient, the system ensures that traffic demand is met by adjusting traffic allocation or selecting an alternative path.
8. A real-time routing optimization system based on two-dimensional matrix dynamic programming, characterized in that: include: The model definition module is used to build the entire routing system into a multi-point to multi-point shortest path model, including multiple starting points and multiple end points, set the matrix dimension, and define the matrix D m,n As the calculation result of the shortest path; The matrix initialization module is used to initialize the vertical axis and horizontal axis of the matrix as well as the initial state; The planning transfer module is used to calculate the shortest path from the starting point to each node m step by step, update the corresponding value in the matrix, and for each step of calculation, calculate the shortest path of the current step through the shortest path of the previous step and the weight of the edge; The path calculation module is used to calculate the shortest path from the starting point to all nodes at each number of steps, and gradually iterate the calculation until the shortest path of all nodes; Traffic planning module, used to determine the relative balance of overall traffic distribution based on the calculation results of the matrix for each node and path according to the Nth shortest path assigned by the user; The real-time optimization module is used to periodically update the path information in the matrix and calculate the new shortest path in time when the traffic changes.
9. A computing device, comprising: at least one processor, memory, and input-output unit; The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the steps of the real-time routing optimization method based on two-dimensional matrix dynamic programming as described in any one of claims 1 to 7.
10. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the real-time routing optimization method based on two-dimensional matrix dynamic programming as claimed in any one of claims 1 to 7.