A routing method, device, electronic device, and storage medium

By building a topology diagram in the content center network and determining multiple paths using the K shortest path algorithm and the improved Dijkstra algorithm, the problem of long service recovery time after link failure is solved, and rapid failure recovery and business continuity is achieved.

CN116132356BActive Publication Date: 2025-08-01PURPLE MOUNTAIN LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211640923.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-20
Publication Date
2025-08-01
Estimated Expiration
2042-12-20

AI Technical Summary

Technical Problem

In the content center network, the service recovery time is long after the link failure, especially when the network scale expands, the path calculation time shows an exponential growth, resulting in too long service interruption time.

Method used

By constructing a topology diagram, K shortest path algorithm is used to determine the K path between the route start point and the route end point, the link distance value is calculated based on the delay and bandwidth, and the improved Dijkstra algorithm is used to determine the shortest path, remove the loop, and achieve fast network failure recovery.

Benefits of technology

After the content center network failure, the service recovery time is shortened to the millisecond level and does not increase with the increase in network size, avoiding link congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116132356B_ABST
    Figure CN116132356B_ABST
Patent Text Reader

Abstract

The present application discloses a routing method, an apparatus, an electronic device, and a computer-readable storage medium. The method includes: constructing a topology graph based on devices and links in the content-centric network, and determining a routing start point and a routing end point in the topology graph; using the K shortest path algorithm to determine K paths between the routing start point and the routing end point. The present application realizes fast convergence of network failures in the content-centric network, enables the service recovery time after a content-centric network failure to be at the millisecond level, and the network recovery time does not increase as the network scale increases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technologies, and more particularly, to a routing method, an apparatus, an electronic device, and a computer-readable storage medium. Background Art

[0002] CCN (content centric network) takes information objects as the basis for building a network, separates the location information of information from content identification, and obtains data through content names instead of host IP addresses. It uses the built-in cache in the network to improve transmission efficiency without caring about the data storage location. It requests data through a publish / subscribe mode, decoupling the provider and the consumer in space and time.

[0003] Once a link failure occurs in the CCN network, after the device reports it to the controller, the controller needs to recalculate the optimal path, delete the original path routing, and reissue the optimal path routing. As the scale of the CCN network expands, the time for recalculating the optimal path shows exponential growth. Generally, when the number of routing devices exceeds 500, the path calculation time exceeds 10 seconds, and the service interruption time is long, seriously affecting scale and business expansion.

[0004] Therefore, how to reduce the service recovery time after a failure in the content centric network is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of the present application is to provide a routing method, an apparatus, an electronic device, and a computer-readable storage medium, which reduce the service recovery time after a failure in the content centric network.

[0006] To achieve the above object, the present application provides a routing method, which is applied to a controller of a content centric network. The method includes:

[0007] Construct a topology graph based on the devices and links in the content centric network, and determine a routing start point and a routing end point in the topology graph;

[0008] Use the K-shortest path algorithm to determine K paths between the routing start point and the routing end point.

[0009] Wherein, the step of using the K-shortest path algorithm to determine K paths between the routing start point and the routing end point includes:

[0010] Calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph;

[0011] Use the K-shortest path algorithm to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph.

[0012] Among them, calculating the distance value of each link according to the delay and bandwidth of each link in the topology graph includes:

[0013] Calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology graph.

[0014] Among them, calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology graph includes:

[0015] Calculating the ratio of the delay to the bandwidth of each link in the topology graph, and taking a preset multiple of the ratio as the distance value of each link.

[0016] Among them, constructing a topology graph based on the devices and links in the content-centric network includes:

[0017] Obtaining the configuration file of the content-centric network; among them, the configuration file includes the device information of the devices in the content-centric network and the link information of the links;

[0018] Constructing a topology graph based on the configuration file.

[0019] Among them, using the K shortest path algorithm to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph includes:

[0020] Using the Dijkstra algorithm to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph, and determining the shortest path as the first path;

[0021] Determining the kth path between the routing start point and the routing end point based on the (k - 1)th path; where 2 ≤ k ≤ K.

[0022] Among them, using the Dijkstra algorithm to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph includes:

[0023] Adding the routing start point to the first node group, and adding the nodes in the topology graph other than the routing start point to the second node group;

[0024] Determining the distance of the shortest path between each node in the second node group and the routing start point; among them, the shortest path contains only the nodes in the first node group except the start point and the end point;

[0025] Determine a target node in the second node group with the shortest shortest path distance from the routing start point, and move the target node from the second node group to the first node group;

[0026] Update the distance of the shortest path between each node in the second node group and the routing start point, and re-enter the step of determining the target node with the shortest shortest path distance from the routing start point in the second node group until the second node group is empty;

[0027] Determine the shortest path between the routing end point and the routing start point.

[0028] Among them, determining the k-th path between the routing start point and the routing end point based on the (k - 1)-th path includes:

[0029] Take the nodes in the (k - 1)-th path except the routing end point as deviation nodes in turn, and set the distance value between the deviation node and the next node to infinity; where the next node is the next node of the deviation node in the (k - 1)-th path;

[0030] Determine the shortest path between the deviation node and the routing end point as the offset path based on the Dijkstra algorithm, and splice the path between the routing start point and the deviation node in the (k - 1)-th path and the offset path into a candidate path;

[0031] Determine the candidate path with the shortest distance as the k-th path between the routing start point and the routing end point.

[0032] Among them, it further includes:

[0033] Remove the loops in the K paths, and send the K paths after removing the loops to the routing start point.

[0034] Among them, removing the loops in the K paths includes:

[0035] Determine the paths with duplicate nodes in the K paths as target paths;

[0036] Determine the target nodes with duplicates in the target path, and delete the nodes between the duplicate target nodes and one of the target nodes in the target path.

[0037] Delay and bandwidth Delay and bandwidth Delay and bandwidth To achieve the above object, the present application provides a routing device, which is applied to the controller of the content - centric network. The device includes:

[0038] A building module, configured to build a topology graph based on devices and links in the content-centric network, and determine a routing start point and a routing end point in the topology graph;

[0039] A determining module, configured to determine K paths between the routing start point and the routing end point by using the K shortest path algorithm;

[0040] A sending module, configured to remove loops in the K paths, and send the K paths after removing the loops to the routing start point.

[0041] To achieve the above object, the present application provides an electronic device, including:

[0042] A memory, configured to store a computer program;

[0043] A processor, configured to implement the steps of the above routing method when executing the computer program.

[0044] To achieve the above object, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above routing method are implemented.

[0045] As can be seen from the above solutions, a routing method provided by the present application includes: building a topology graph based on devices and links in the content-centric network, determining a routing start point and a routing end point in the topology graph; determining K paths between the routing start point and the routing end point by using the K shortest path algorithm.

[0046] The routing method provided by the present application determines K paths between a routing start point and a routing end point by using the K shortest path algorithm. The device corresponding to the routing start point can access the device corresponding to the routing end point through the K paths. When one path fails, access can be based on the next path, realizing fast convergence of network failures in the content-centric network, making the service recovery time after a content-centric network failure in the millisecond level, and the network recovery time does not increase as the network scale increases. The present application also discloses a routing device, an electronic device, and a computer-readable storage medium, which can also achieve the above technical effects.

[0047] It should be understood that the above general description and the following detailed description are only exemplary and do not limit the present application. Description of the Drawings

[0048] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:

[0049] Figure 1 It is a flowchart of a routing method shown according to an exemplary embodiment;

[0050] Figure 2 It is a topology diagram shown according to an exemplary embodiment;

[0051] Figures 3-9 It is a topology diagram of the intermediate process of the shortest path calculated based on the improved Dijkstra algorithm shown according to an exemplary embodiment;

[0052] Figure 10 It is a flowchart of another routing method shown according to an exemplary embodiment;

[0053] Figure 11 It is another topology diagram shown according to an exemplary embodiment;

[0054] Figures 12-14 It is a topology diagram of the intermediate process of the K paths calculated based on the improved K - shortest path algorithm shown according to an exemplary embodiment;

[0055] Figure 15 It is a topology diagram of a content - centric network shown according to an exemplary embodiment;

[0056] Figure 16 It is a structural diagram of a routing device shown according to an exemplary embodiment;

[0057] Figure 17 It is a structural diagram of an electronic device shown according to an exemplary embodiment. Specific Embodiments

[0058] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts belong to the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence.

[0059] The embodiments of the present application disclose a routing method, which reduces the service recovery time after a content-centric network failure.

[0060] See Figure 1 , a flowchart of a routing method shown according to an exemplary embodiment, as Figure 1 shown, includes:

[0061] S101: Construct a topology graph based on the devices and links in the content-centric network, and determine a routing start point and a routing end point in the topology graph;

[0062] The execution subject of this embodiment is the controller of the content-centric network, and the purpose is to determine the shortest path for devices in the content-centric network to access other devices, and to achieve complex grid-like deployment. In this step, a topology graph is constructed based on the devices and links in the content-centric network. The nodes in the topology graph represent the devices in the content-centric network, and the edges between nodes represent the links in the content-centric network, that is, the links corresponding to the corresponding nodes. It can be understood that the topology graph in this embodiment can be a directed graph, and more specifically, it can be a weighted graph with the same weights, and the weight corresponding to each edge is the distance value of the corresponding link calculated subsequently.

[0063] As a feasible implementation manner, the constructing a topology graph based on the devices and links in the content-centric network includes: obtaining a configuration file of the content-centric network; wherein, the configuration file includes device information of devices in the content-centric network and link information of links; constructing a topology graph based on the configuration file. In a specific implementation, the controller reads the configuration file of the content-centric network, which includes device information of devices and link information of links, and generates a directed graph and the topology information therein accordingly.

[0064] Further, one of the nodes in the topology graph is determined as the routing start point, and another node is determined as the routing end point. In this embodiment, each node in the topology graph can be sequentially determined as the routing start point. After determining the routing start point, each node other than the routing start point is sequentially determined as the routing end point, and K paths between the routing start point and the routing end point are determined based on the subsequent steps, that is, K paths for each device in the content-centric network to access other each device are determined.

[0065] S102: Determine K paths between the routing start point and the routing end point using a K shortest path algorithm;

[0066] The K-shortest paths (KSP) problem is an extension and deformation of the shortest path problem, which calculates K paths between the starting point and the end point of the route.

[0067] As a preferred embodiment, the use of the K shortest path algorithm to determine the K paths between the routing start point and the routing end point includes: calculating the distance value of each link based on the delay and bandwidth of each link in the topology map; and using the K shortest path algorithm to determine the K paths between the routing start point and the routing end point based on the distance values of the links in the topology map.

[0068] In a specific implementation, the distance value of each link in the topology is calculated based on the latency and bandwidth of each link. Traditional distance algorithms only use bandwidth to calculate the distance between nodes. This embodiment improves on this traditional distance algorithm by incorporating latency into the distance calculation. This makes the paths subsequently determined based on the distance values between nodes more consistent with actual application requirements, preventing the situation where high bandwidth but high latency lead to service impairment, thereby improving the accuracy of the paths determined in subsequent steps.

[0069] As a feasible implementation method, the method of calculating the distance value of each link according to the delay and bandwidth of each link in the topology diagram includes: calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology diagram. Preferably, the method of calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology diagram includes: calculating the ratio of the delay to the bandwidth of each link in the topology diagram, and taking a preset multiple of the ratio as the distance value of each link. In a specific implementation, the distance value of the link can be set to a preset multiple of the ratio of the delay to the bandwidth of the link, for example, the preset multiple can be 10 8 , the link distance value cost = 10 8 ×delay / bandwidth, where delay is the link delay and bandwidth is the link bandwidth.

[0070] The routing method provided by the embodiment of this application uses the K shortest path algorithm to determine K paths between the routing start point and the routing end point. The device corresponding to the routing start point can access the device corresponding to the routing end point through these K paths. When one path fails, access can be based on the next path, achieving fast convergence of network failures in the content-centric network, enabling the service recovery time after a content-centric network failure to be at the millisecond level, and the network recovery time not increasing as the network scale increases.

[0071] As a feasible implementation manner, the method of the present invention further includes:

[0072] Removing loops in the K paths and sending the K paths after removing the loops to the routing start point.

[0073] In this step, loop prevention processing is performed on the K paths determined by the K shortest path algorithm to calculate K paths between the routing start point and the routing end point, so that there are no loops in the calculated multiple paths. This application performs an operation of removing loops on the K paths determined by the K shortest path algorithm to avoid link congestion caused by loops in the paths.

[0074] As a feasible implementation manner, removing loops in the K paths includes: determining the paths with duplicate nodes in the K paths as target paths; determining the target nodes with duplicates in the target paths, and deleting the nodes between the duplicate target nodes and one of the target nodes in the target paths.

[0075] In a specific implementation, the paths among the K paths that have duplicate nodes are determined as target paths with loops, and anti-loop processing needs to be performed on the target paths. The duplicate target nodes are determined in the target paths, and the nodes between the duplicate target nodes and one of the target nodes are deleted. For example, a path is: A - B - C - D - B - E, then the duplicate target nodes are the two nodes B. Remove the nodes C, D between the two nodes B and one of the nodes B, and the path obtained is: A - B - E. Of course, there may be multiple groups of duplicate nodes in the target path. For example, in A - B - C - D - B - C - E, there are two duplicate nodes B and two duplicate nodes C. At this time, any group of duplicate nodes can be selected as the target nodes. For example, select the duplicate target nodes as the two nodes C, and remove the nodes D, B between the two nodes C and one of the nodes C, and the path obtained is: A - B - C - E. In addition, the nodes between multiple groups of duplicate nodes may not overlap. For example, in A - B - C - B - D - E - F - D - G, there are two duplicate nodes B and two duplicate nodes D. At this time, each group of duplicate nodes is selected as the target nodes respectively, and the operation of removing nodes is performed respectively. For example, first select the duplicate target nodes as the two nodes B, and remove the node C between the two nodes B and one of the nodes B, and the path obtained is: A - B - D - E - F - D - G. Then select the duplicate target nodes as the two nodes D, and remove the nodes E, F between the two nodes D and one of the nodes D, and the path obtained is: A - B - D - G.

[0076] Further, the controller sends the K paths between the routing start point and the routing end point to the routing start point, and the device corresponding to the routing start point can access the device corresponding to the routing end point through the above paths. When a path fails, access can be based on the next path, realizing fast convergence of network faults in the content - centric network, restoring network services at the millisecond level, and the recovery time does not increase with the expansion of the network scale.

[0077] The routing method provided by the embodiment of the present application uses the K - shortest - path algorithm to determine K paths between the routing start point and the routing end point. The device corresponding to the routing start point can access the device corresponding to the routing end point through the K paths. When a path fails, access can be based on the next path, realizing fast convergence of network faults in the content - centric network, making the service recovery time after a content - centric network fault at the millisecond level, and the network recovery time does not increase with the increase of the network scale.

[0078] In addition, the embodiment of the present application performs an operation of removing loops on the K paths determined by the K - shortest - path algorithm to avoid link congestion caused by loops in the paths.

[0079] The embodiment of the present application discloses a routing method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0080] See Figure 2 , a flowchart of another routing method shown according to an exemplary embodiment, as Figure 2 shown, includes:

[0081] S201: Construct a topology graph based on the devices and links in the content - centric network, and determine a routing start point and a routing end point in the topology graph;

[0082] S202: Calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph;

[0083] S203: Use the Dijkstra algorithm to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph, and determine the shortest path as the first path;

[0084] In a specific implementation, first, determine the shortest path between the routing start point and the routing end point based on the Dijkstra algorithm as the first path. The Dijkstra algorithm is proposed by the Dutch computer scientist Dijkstra, so it is also called the Dijkstra algorithm. It is the shortest - path algorithm from one node to the remaining nodes, which solves the shortest - path problem in a weighted graph. The main feature of the Dijkstra algorithm is to start from the starting point, adopt the strategy of the greedy algorithm, and each time traverse the adjacent nodes of the node that is closest to the starting point and has not been visited until it expands to the end point. In a specific implementation, improve the distance - value algorithm in the Dijkstra algorithm, and determine the shortest path between the routing start point and the routing end point based on the improved Dijkstra algorithm.

[0085] Specifically, determining the shortest path between the routing start point and the routing end point based on the Dijkstra algorithm includes: adding the routing start point to the first node group, and adding the nodes in the topology graph except the routing start point to the second node group; determining the distance of the shortest path between each node in the second node group and the routing start point; where, in the shortest path, except for the start point and the end point, it only contains the nodes in the first node group; determining the target node with the shortest distance of the shortest path between it and the routing start point in the second node group, moving the target node from the second node group to the first node group; updating the distance of the shortest path between each node in the second node group and the routing start point, and re - entering the step of determining the target node with the shortest distance of the shortest path between it and the routing start point in the second node group until the second node group is empty; determining the shortest path between the routing end point and the routing start point.

[0086] In a specific implementation, the topology graph G of the content-centric network is a weighted directed graph. The nodes in the topology graph G are divided into two groups. The first node group S is the set of nodes for which the shortest paths have been found. Initially, S contains only the routing start point s. After finding the shortest path between the routing start point s and another node each time, this other node is added to the first node group S.

[0087] The second node group U is the set of the remaining nodes for which the shortest paths have not been determined. The nodes in the second node group U are added to the first node group S in ascending order of the shortest path lengths. During the addition process, it is always ensured that the shortest path length from the routing start point s to each node in the first node group S is not greater than the shortest path length from the routing start point s to any node in the second node group U.

[0088] In addition, each node corresponds to a distance. The distance of the nodes in the first node group S is the shortest path length from the routing start point s to this node. The distance of the nodes in the second node group U is the current shortest path length from the routing start point s to this node with only the nodes in the first node group S as intermediate nodes.

[0089] When all the nodes in the second node group U are added to the first node group S, the algorithm ends. The shortest paths between the routing start point and all other nodes can be obtained, and thus the shortest path between the routing start point and the routing end point can be obtained.

[0090] The specific process includes:

[0091] (1) Initially, the first node group S contains only the routing start point s, the second node group U contains the other nodes except the routing start point s, and the distance of the nodes in the second node group U is the distance from the routing start point s to this node. For example, the distance of the node v in the second node group U is the length of (s, v). If s and v are not adjacent, the distance of v is ∞.

[0092] (2) Select the node k with the shortest distance from the second node group U, and add the node k to the first node group S. At the same time, remove the node k from the second node group U.

[0093] (3) Update the distances from each node in the second node group U to the routing start point s. The reason for updating the distances of the nodes in the second node group U is that in the previous step, it is determined that the node k is the node for which the shortest path has been found, so the node k can be used to update the distances of other nodes. For example, the distance of (s, v) may be greater than the distance of (s, k)+(k, v). At this time, update the distance of the node v to (s, k)+(k, v).

[0094] (4) Repeat steps (2) and (3) until all the nodes in the second node group U are traversed.

[0095] Figure 3 A topological graph shown according to an exemplary embodiment will be used Figure 3 for illustration. If the routing start point is D, initially as Figure 4 shown, the gray in the figure represents the nodes included in the first node group S, and the white represents the nodes included in the second node group U. S = {D(0)}, U = {A(∞), B(∞), C(3), E(4), F(∞), G(∞)}. C(3) means that the distance from node C to the routing start point D is 3.

[0096] The distance from node C in the second node group U to the routing start point D is the shortest. Add node C to the first node group S, as Figure 5 shown. At the same time, update the distances of the nodes in the second node group U. Taking node F as an example, the distance between node F and the routing start point D was ∞ before, but after adding node C to the first node group S, the distance from node F to the routing start point D is (F, C) + (C, D) = 9.

[0097] At this time, S = {D(0), C(3)}, U = {A(∞), B(13), E(4), F(9), G(∞)}.

[0098] The distance from node E in the second node group U to the routing start point D is the shortest. Add node E to the first node group S, as Figure 6 shown. At the same time, update the distances of the nodes in the second node group U. Taking node F as an example, the distance between node F and the routing start point D was 9 before, but after adding node E to the first node group S, the distance from node F to the routing start point D is (F, E) + (E, D) = 6.

[0099] At this time, S = {D(0), C(3), E(4)}, U = {A(∞), B(13), F(6), G(12)}.

[0100] And so on, add node F to the first node group S, as Figure 7 shown. At this time, S = {D(0), C(3), E(4), F(6)}, U = {A(22), B(13), G(12)}.

[0101] Add node G to the first node group S, as Figure 8 shown. At this time, S = {D(0), C(3), E(4), F(6), G(12)}, U = {A(22), B(13)}.

[0102] Add node B to the first node group S, as Figure 9 shown. At this time, S = {D(0), C(3), E(4), F(6), G(12), B(13)}, U = {A(22)}.

[0103] Add node A to the first node group S, as Figure 10 shown. At this time, S = {D(0), C(3), E(4), F(6), G(12), B(13), A(22)}.

[0104] At this time, the shortest distances between the routing start point D and each node are obtained. The shortest distance between the routing start point D and node A is 22, the shortest distance between the routing start point D and node B is 13, the shortest distance between the routing start point D and node C is 3, the shortest distance between the routing start point D and node E is 4, the shortest distance between the routing start point D and node F is 6, and the shortest distance between the routing start point D and node G is 12.

[0105] S204: Determine the kth path between the routing start point and the routing end point based on the (k - 1)th path; where 2 ≤ k ≤ K;

[0106] In this embodiment, the second path is determined based on the first path, the third path is determined based on the second path, and so on, until the Kth path between the routing start point and the routing end point is obtained.

[0107] When determining the kth path, all nodes except the routing end point in the (k - 1)th path are regarded as deviation nodes, and the shortest path between each deviation node and the routing end point is calculated, and then spliced with the path from the routing start point to the deviation node in the (k - 1)th path to form a candidate path, and then the shortest candidate path is determined as the kth path. Determine the Kth path in the above manner until.

[0108] As a feasible implementation manner, determining the kth path between the routing start point and the routing end point based on the (k - 1)th path includes: sequentially taking the nodes except the routing end point in the (k - 1)th path as deviation nodes, and setting the distance value between the deviation node and the next node to infinity; where the next node is the next node of the deviation node in the (k - 1)th path; determining the shortest path between the deviation node and the routing end point as the offset path based on the Dijkstra algorithm, and splicing the path between the routing start point and the deviation node in the (k - 1)th path with the offset path to form a candidate path; determining the candidate path with the shortest distance as the kth path between the routing start point and the routing end point.

[0109] In this embodiment, when determining the k-th path, all nodes in the (k - 1)-th path except the routing end point are sequentially used as deviation nodes, and the distance value between the deviation node and the next node in the (k - 1)-th path is set to infinity. Based on the improved Dijkstra algorithm, the shortest path from the deviation node to the routing end point is determined, and then it is spliced with the path from the routing start point to the deviation node in the (k - 1)-th path to form a candidate path. Then, the shortest candidate path is determined therefrom as the k-th path. The K-th path is determined in the above manner until the K-th path is determined.

[0110] Figure 11 Another topology graph shown according to an exemplary embodiment is used for Figure 11 illustration. The routing start point is node C, the routing end point is node H, K is 3, A is the set of K paths, and B is the set of deviation paths.

[0111] The shortest path A[1]: C - E - F - H is calculated by the improved Dijkstra algorithm, the path distance is 5, A[1] = C - E - F - H, as Figure 12 shown.

[0112] Taking A[1] as the iterative path, the first iteration is carried out:

[0113] (1) In the partial iterative path (i.e., A[1]) C path, with C as the starting point, the weight value between C - E is set to infinity. Based on the improved Dijkstra algorithm, the shortest path C - D - F - H is obtained, the path distance is 8, and it is added to B;

[0114] (2) In the partial iterative path (i.e., A[1]) C - E path, with E as the starting point, the weight value between E - F is set to infinity. Based on the improved Dijkstra algorithm, the shortest path C - E - G - H is obtained, the path distance is 7, and it is added to B;

[0115] (3) In the partial iterative path (i.e., A[1]) C - E - F path, with F as the starting point, the weight value between F - H is set to infinity. Based on the improved Dijkstra algorithm, the shortest path C - E - F - G - H is obtained, the path distance is 8, and it is added to B;

[0116] After the iteration is completed, there are three paths in the B set: C - D - F - H, C - E - G - H, C - E - F - G - H. The deviation path C - E - G - H with the smallest path distance is selected, A[2] = C - E - G - H, and it is removed from the B set, as Figure 13 shown.

[0117] Taking A[2] as the iterative path, the second iteration is carried out:

[0118] (1) In the partial iterative path (i.e., A[2]) C path, with point C as the starting point, set the weight between the C-E path to infinity. Based on the improved Dijkstra algorithm, the shortest path C-D-F-H is obtained. However, this path already exists in set B, so there is no offset path.

[0119] (2) In the partial iterative path (i.e., A[2]) C-E path, with point E as the starting point, set the weights between the E-G and E-F paths to infinity. The reason for setting the weights of these two paths is that these two paths exist in A[1] and A[2] respectively. Based on the improved Dijkstra algorithm, the shortest path C-E-D-F-H is obtained, and the path distance is 8. Add it to B.

[0120] (3) In the partial iterative path (i.e., A[2]) C-E-G path, with point G as the starting point, set the weight between the C-H path to infinity. There is no offset path.

[0121] The iteration is completed. There are three paths in set B: C-D-F-H, C-E-F-G-H, C-E-D-F-H. Since the path distances of the three paths are all 8, then according to the minimum number of nodes for judgment, select the deviation path C-D-F-H, and A[3] = C-D-F-H.

[0122] At this time, three shortest paths are selected, which are A[1] = C-E-F-H, A[2] = C-E-G-H, A[3] = C-D-F-H, as Figure 14 shown.

[0123] S205: Remove the loops in the K paths and send the K paths after removing the loops to the routing starting point.

[0124] The following introduces an application embodiment provided by the present application. Refer to Figure 15 , Figure 15 which is a topological diagram of a content-centric network shown according to an exemplary embodiment. Figure 15 In it, client is the client, Server is the server (12345 / index.html), R1, R2, R3, and R4 are physical routes, GW (GateWay) is the gateway, CCN represents the nodes in the content-centric network, and switch is the switch.

[0125] The client requests the content of 12345 / index.html. The controller first reads the device and link configuration files, generates a topology graph and topology information. Based on the generated graph, it calculates the k optimal paths from each gateway device to other gateway devices. Further, it performs loop prevention processing on the generated paths. The paths generated by the traditional k shortest path algorithm have loop problems that can cause link congestion. The paths with loops are processed to remove duplicate nodes to prevent loop problems, enabling the message to be correctly delivered to the destination node and avoiding link congestion. Then, it calculates the path set from GW1 to other GWs. Finally, it distributes CCN routes to the nodes on the optimal path according to the link information, enabling each CCN device to know how to forward messages to the destination device. When the first link fails, the CCN route is directly deleted, and the CCN route of the second link is distributed. After the distribution is completed, 3 paths are recalculated and saved.

[0126] The following introduces a routing device provided by an embodiment of the present application. A routing device described below can be referred to with a routing method described above.

[0127] See Figure 16 , a structural diagram of a routing device shown according to an exemplary embodiment, as Figure 16 shown, includes:

[0128] A construction module 100, configured to construct a topology graph based on devices and links in the content-centric network, and determine a routing start point and a routing end point in the topology graph;

[0129] A determination module 200, configured to use the k shortest path algorithm to determine k paths between the routing start point and the routing end point.

[0130] The routing device provided by the embodiment of the present application uses the k shortest path algorithm to determine k paths between the routing start point and the routing end point. The device corresponding to the routing start point can access the device corresponding to the routing end point through k paths. When one path fails, it can be accessed based on the next path, realizing fast convergence of network failures in the content-centric network, enabling the service recovery time after a content-centric network failure to be in the millisecond level, and the network recovery time not increasing as the network scale increases.

[0131] Based on the above embodiment, as a preferred implementation manner, it further includes:

[0132] A sending module, configured to remove loops in the k paths and send the k paths after removing loops to the routing start point. The embodiment of the present application performs an operation of removing loops on the k paths determined by the k shortest path algorithm, avoiding link congestion caused by loops in the paths.

[0133] Based on the above embodiments, as a preferred embodiment, the determining module 200 includes:

[0134] A calculation unit, configured to calculate a distance value for each link in the topology graph according to the delay and bandwidth of each link in the topology graph;

[0135] A determination unit, configured to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph by using the K shortest path algorithm.

[0136] Based on the above embodiments, as a preferred embodiment, the calculation unit is specifically configured to: calculate a distance value for each link in the topology graph according to the ratio of the delay to the bandwidth of each link in the topology graph.

[0137] Based on the above embodiments, as a preferred embodiment, the calculation unit is specifically configured to: calculate the ratio of the delay to the bandwidth of each link in the topology graph, and use a preset multiple of the ratio as the distance value for each link.

[0138] Based on the above embodiments, as a preferred embodiment, the construction module 100 is specifically configured to: obtain a configuration file of the content-centric network; wherein, the configuration file includes device information of devices in the content-centric network and link information of links; construct a topology graph based on the configuration file, and determine a routing start point and a routing end point in the topology graph.

[0139] Based on the above embodiments, as a preferred embodiment, the determination unit includes:

[0140] A first determination subunit, configured to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph by using the Dijkstra algorithm, and determine the shortest path as the first path;

[0141] A second determination subunit, configured to determine the kth path between the routing start point and the routing end point based on the (k - 1)th path; wherein, 2 ≤ k ≤ K.

[0142] Based on the above embodiments, as a preferred implementation manner, the first determination subunit is specifically configured to: add the routing start point to the first node group, and add the nodes in the topology graph except the routing start point to the second node group; determine the distances of the shortest paths between each node in the second node group and the routing start point; wherein, only the nodes in the first node group are included in the shortest path except the start point and the end point; determine a target node with the shortest distance of the shortest path between the target node and the routing start point in the second node group, move the target node from the second node group to the first node group; update the distances of the shortest paths between each node in the second node group and the routing start point, and re-enter the step of determining the target node with the shortest distance of the shortest path between the target node and the routing start point in the second node group until the second node group is empty; determine the shortest path between the routing end point and the routing start point, and determine the shortest path as the first path.

[0143] Based on the above embodiments, as a preferred implementation manner, the second determination subunit is specifically configured to: sequentially use the nodes except the routing end point in the (k - 1)-th path as deviation nodes, and set the distance value between the deviation node and the next node to infinity; wherein, the next node is the next node of the deviation node in the (k - 1)-th path; determine the shortest path between the deviation node and the routing end point as the offset path based on the Dijkstra algorithm, and splice the path between the routing start point and the deviation node in the (k - 1)-th path and the offset path into a candidate path; determine the candidate path with the shortest distance as the k-th path between the routing start point and the routing end point.

[0144] Based on the above embodiments, as a preferred implementation manner, the sending module 300 is specifically configured to: determine the paths with duplicate nodes among the K paths as target paths; determine the target nodes with duplicates in the target paths, and delete the nodes between the duplicate target nodes and one of the target nodes in the target paths; send the K paths after removing the loops to the routing start point.

[0145] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0146] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of the present application, the embodiments of the present application further provide an electronic device, Figure 17 As shown in the structural diagram of an electronic device according to an exemplary embodiment, as Figure 17 shown, the electronic device includes:

[0147] A communication interface 1, capable of interacting with other devices such as network devices for information exchange;

[0148] A processor 2, connected to the communication interface 1 to achieve information interaction with other devices, and when running a computer program, executes the routing method provided by one or more of the above technical solutions. And the computer program is stored on a memory 3.

[0149] Of course, in actual application, each component in the electronic device is coupled together through a bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 17 all kinds of buses are labeled as the bus system 4.

[0150] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program for operating on the electronic device.

[0151] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), a ferromagnetic random access memory (FRAM, ferromagnetic random access memory), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM, Random Access Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as a static random access memory (SRAM, Static Random Access Memory), a synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), a dynamic random access memory (DRAM, Dynamic Random Access Memory), a synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), a double data rate synchronous dynamic random access memory (DDR SDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), an enhanced synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), a sync link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), a direct rambus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memories.

[0152] The method disclosed in the embodiments of the present application above can be applied to the processor 2 or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 2 or the instructions in the form of software. The above-mentioned processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute each method, step, and logic block diagram disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the method disclosed in the embodiments of the present application, it can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in the storage medium, and this storage medium is located in the memory 3. The processor 2 reads the program in the memory 3 and combines its hardware to complete the steps of the foregoing method.

[0153] When the processor 2 executes the program, it implements the corresponding processes in each method of the embodiments of the present application. For the sake of brevity, it will not be elaborated here.

[0154] In an exemplary embodiment, the embodiments of the present application also provide a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 including a stored computer program. The above computer program can be executed by the processor 2 to complete the steps of the foregoing method. The computer-readable storage medium may be a FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM, etc.

[0155] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various media such as mobile storage devices, ROM, RAM, magnetic disks, or optical discs that can store program codes.

[0156] Alternatively, if the above integrated units of the present application are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, 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 is stored in a storage medium and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.

[0157] As described above, the foregoing are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A routing method, characterized in that, A controller applied to a content - centric network, the method includes: Construct a topology graph based on the devices and links in the content - centric network, and determine a routing start point and a routing end point in the topology graph; Use the K - shortest path algorithm to determine K paths between the routing start point and the routing end point; Among them, the step of using the K - shortest path algorithm to determine K paths between the routing start point and the routing end point includes: Calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph; Use the K - shortest path algorithm to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph; Among them, the step of calculating the distance value of each link according to the delay and bandwidth of each link in the topology graph includes: Calculate the ratio of the delay to the bandwidth of each link in the topology graph, and use a preset multiple of the ratio as the distance value of each link.

2. The routing method according to claim 1, wherein The step of constructing a topology graph based on the devices and links in the content - centric network includes: Obtain the configuration file of the content - centric network; where the configuration file includes device information of devices in the content - centric network and link information of links; Construct a topology graph based on the configuration file.

3. The routing method according to claim 1, characterized in that The step of using the K - shortest path algorithm to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph includes: Use the Dijkstra algorithm to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph, and determine the shortest path as the first path; Determine the k - th path between the routing start point and the routing end point based on the (k - 1) - th path; where 2 ≤ k ≤ K.

4. The routing method according to claim 3, wherein The step of using the Dijkstra algorithm to determine the shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph includes: Add the routing start point to the first node group, and add the nodes in the topology graph except the routing start point to the second node group; Determine the distance of the shortest path between each node in the second node group and the routing start point; where the shortest path contains only nodes in the first node group except the start point and the end point; Determine the target node with the shortest shortest - path distance between the routing start point in the second node group, and move the target node from the second node group to the first node group; Update the distance of the shortest path between each node in the second node group and the routing start point, and re - enter the step of determining the target node with the shortest shortest - path distance between the routing start point in the second node group until the second node group is empty; Determine the shortest path between the routing end point and the routing start point.

5. The routing method according to claim 3, wherein The step of determining the k - th path between the routing start point and the routing end point based on the (k - 1) - th path includes: Take the nodes in the (k - 1)-th path except the routing end point as deviation nodes in turn, and set the distance value between the deviation node and the next node to infinity; where the next node is the next node of the deviation node in the (k - 1)-th path; Based on the Dijkstra algorithm, determine the shortest path between the deviation node and the routing end point as the offset path, and splice the path between the routing start point and the deviation node in the (k - 1)-th path and the offset path into a candidate path; Determine the candidate path with the shortest distance as the k-th path between the routing start point and the routing end point.

6. The routing method according to any one of claims 1 to 5, characterized in that Further include: Remove the loops in the K paths, and send the K paths after removing the loops to the routing start point.

7. The routing method according to claim 6, wherein The removing the loops in the K paths includes: Determine the paths with duplicate nodes in the K paths as target paths; Determine the target nodes with duplicates in the target path, and delete the nodes between the duplicate target nodes and one of the target nodes in the target path.

8. A routing device, characterized in that, Applied to a controller of a content-centric network, the device includes: A construction module, configured to construct a topology graph based on the devices and links in the content-centric network, and determine a routing start point and a routing end point in the topology graph; A determination module, configured to use the K shortest path algorithm to determine K paths between the routing start point and the routing end point; Wherein, the determination module includes: A calculation unit, configured to calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph; A determination unit, configured to use the K shortest path algorithm to determine K paths between the routing start point and the routing end point based on the distance values of the links in the topology graph; Wherein, the calculation unit is specifically configured to: calculate the ratio of the delay to the bandwidth of each link in the topology graph, and use a preset multiple of the ratio as the distance value of each link.

9. An electronic device, characterized in that, Include: A memory, configured to store a computer program; A processor, configured to implement the steps of the routing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the routing method according to any one of claims 1 to 7 are implemented.