A routing method, device, electronic device and storage medium
By building a topology map in the content center network and calculating the delay and bandwidth of the link using the improved Dijkstra algorithm, the lack of routing algorithms in the content center network is solved, and grid graph deployment and efficient data transmission are achieved.
Patent Information
- Application Number
- CN202211640921.5
- 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
The lack of network routing algorithms in the existing content center networks leads to only linear deployment and cannot achieve grid graph deployment.
By constructing a topology map in the content center network, the distance value of the link is calculated based on the link's delay and bandwidth, and using the improved Dijkstra algorithm to determine the shortest path between the route's start point and the end point, grid graphing deployment is achieved.
It realizes complex grid graph deployment in the content center network, ensures the accuracy of routing paths, avoids the problems of large bandwidth but large delays, and improves data transmission efficiency.
Smart Images

Figure CN116016310B_ABST
Abstract
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 the information from the content identification, and obtains data through the content name instead of the host IP address. It uses the built-in cache in the network to improve the transmission efficiency without caring about the data storage location. It requests data through the publish / subscribe mode, decoupling the provider and the consumer in terms of space and time. The existing Internet is based on IP, and it is necessary to specify the IP address of the source host and the IP address of the target host to establish a call between the hosts. However, with the development of the Internet, the main usage requirements of the current Internet are content acquisition and distribution, and the architecture is the Host-to-Host communication mode. For the Internet mainly for publishing and obtaining information, the Host-to-Host communication mode has obvious deficiencies. At the same time, the behavior of Internet users is also changing. It has changed from traditionally focusing on the server and the host IP (Internet Protocol) address to only caring whether the content of the data meets the requirements. Users no longer care which host provides the service, but care about how to obtain data faster, more accurately, and more efficiently. Thus, a content-based network architecture, that is, the content centric network, has emerged. However, in practical applications, due to the lack of a network routing algorithm, the CCN network can only be deployed linearly and cannot be deployed in a network graph pattern.
[0003] Therefore, how to achieve grid graph deployment in the content centric network and implement a routing algorithm is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of the present application is to provide a routing method, an apparatus, an electronic device, and a computer-readable storage medium, which achieve grid graph deployment in the content centric network and implement a routing algorithm.
[0005] To achieve the above purpose, the present application provides a routing method, which is applied to a controller of a content centric network. The method includes:
[0006] Constructing a topology graph based on the devices and links in the content centric network;
[0007] Calculating a distance value for each link in the topology graph according to the delay and bandwidth of each link in the topology graph;
[0008] Determining a routing start point and a routing end point in the topology graph;
[0009] 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 topological graph.
[0010] Among them, calculating the distance value of each link according to the delay and bandwidth of each link in the topological graph includes:
[0011] Calculate the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topological graph.
[0012] Among them, calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topological graph includes:
[0013] Calculate the ratio of the delay to the bandwidth of each link in the topological graph, and use a preset multiple of the ratio as the distance value of each link.
[0014] Among them, constructing a topological graph based on the devices and links in the content - centric network includes:
[0015] Obtain 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.
[0016] Construct a topological graph based on the configuration file.
[0017] Among them, the topological graph is a directed graph.
[0018] Among them, the nodes in the topological graph represent the devices in the content - centric network, and the edges between nodes represent the links in the content - centric network.
[0019] 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 topological graph includes:
[0020] Add the routing start point to the first node group, and add the nodes in the topological graph except the routing start point to the second node group;
[0021] Determine the distance of the shortest path between each node in the second node group and the routing start point; among them, in the shortest path, except for the start point and the end point, only the nodes in the first node group are included;
[0022] Determine the target node with the shortest shortest - path distance from the routing start point in the second node group, and move the target node from the second node group to the first node group;
[0023] 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 second node group and the routing start point until the second node group is empty;
[0024] Determine the shortest path between the routing end point and the routing start point.
[0025] To achieve the above object, the present application provides a routing device, which is applied to a controller of a content-centric network. The device includes:
[0026] A construction module for constructing a topology graph based on devices and links in the content-centric network;
[0027] A calculation module for calculating the distance value of each link according to the delay and bandwidth of each link in the topology graph;
[0028] A first determination module for determining a routing start point and a routing end point in the topology graph;
[0029] A second determination module for determining 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.
[0030] To achieve the above object, the present application provides an electronic device, including:
[0031] A memory for storing a computer program;
[0032] A processor for implementing the steps of the above routing method when executing the computer program.
[0033] For achieving the above object, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above routing method are implemented.
[0034] As can be seen from the above solutions, a routing method provided by the present application includes: constructing a topology graph based on devices and links in the content-centric network; calculating the distance value of each link according to the delay and bandwidth of each link in the topology graph; determining a routing start point and a routing end point in the topology graph; and determining 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.
[0035] The routing method provided by this application improves the traditional Dijkstra algorithm. In the traditional Dijkstra algorithm, only the bandwidth is used to calculate the distance value between nodes, while this application adds the time delay factor when calculating the distance value, that is, calculates the distance value of each link according to the time delay and bandwidth of each link in the topology graph. The shortest path calculated based on the improved Dijkstra algorithm is more in line with the actual application requirements, and the situation where the service is damaged due to large bandwidth but large time delay will not occur. It can be seen that this application realizes a complex grid graph deployment and a routing algorithm in the content - centric network by adopting the improved Dijkstra algorithm in the controller of the content - centric network. This application also discloses a routing device, an electronic device, and a computer - readable storage medium, which can also achieve the above - mentioned technical effects.
[0036] It should be understood that the above general description and the following detailed description are only exemplary and do not limit this application. Brief Description of the Drawings
[0037] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following - described drawings are only some embodiments of this 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, and are used together with the following specific embodiments to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:
[0038] Figure 1 It is a flowchart of a routing method shown according to an exemplary embodiment;
[0039] Figure 2 It is a flowchart of another routing method shown according to an exemplary embodiment;
[0040] Figure 3 It is a topology graph shown according to an exemplary embodiment;
[0041] Figures 4 - 10 It is a topology graph of the intermediate process of the shortest path calculated based on the improved Dijkstra algorithm shown according to an exemplary embodiment;
[0042] Figure 11 It is a topology graph of a content - centric network shown according to an exemplary embodiment;
[0043] Figure 12 It is a structural diagram of a routing device shown according to an exemplary embodiment;
[0044] Figure 13 Structural diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manner
[0045] 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 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.
[0046] The embodiments of the present application disclose a routing method, which realizes grid graph deployment in a content-centric network and realizes a routing algorithm.
[0047] See Figure 1 , a flowchart of a routing method shown according to an exemplary embodiment, as Figure 1 shown, includes:
[0048] S101: Construct a topology graph based on the devices and links in the content-centric network;
[0049] 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 realize complex grid graph 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 the nodes represent the links in the content-centric network, that is, the links between the corresponding nodes. It can be understood that the topology graph in this embodiment can be a directed graph, and more specifically, a weighted directed graph, and the weight corresponding to each edge is the distance value of the corresponding link calculated later.
[0050] 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 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.
[0051] S102: Calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph;
[0052] In this step, the distance value of each link in the topology graph is calculated according to the delay and bandwidth of each link. In traditional distance value algorithms, only the bandwidth is used to calculate the distance value between nodes. In this embodiment, the traditional distance value algorithm is improved by adding the delay factor when calculating the distance value, so that the shortest path determined based on the distance values between nodes in the subsequent steps is more in line with the actual application requirements, and the situation where the service is damaged due to large bandwidth but large delay will not occur, improving the accuracy of the shortest path determined in the subsequent steps.
[0053] As a feasible implementation manner, calculating the distance value of each link according to the delay and bandwidth of each link in the topology graph includes: calculating the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology graph. Preferably, 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: 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. In a specific implementation, the distance value of a link can be set as a preset multiple of the ratio of the bandwidth to the delay of the link. For example, the preset multiple can be 10 8 , the distance value cost of the link = 10 8 ×delay / bandwidth, where delay is the delay of the link and bandwidth is the bandwidth of the link.
[0054] S103: Determine the routing start point and the routing end point in the topology graph;
[0055] In this step, one of the nodes in the topology graph is determined as the routing start point, and the other 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 the shortest path between the routing start point and the routing end point is determined based on the subsequent steps, that is, the shortest path for each device in the content-centric network to access each other device is determined.
[0056] S104: Use Dijkstra's 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;
[0057] Dijkstra's algorithm was proposed by the Dutch computer scientist Dijkstra, so it is also called Dijkstra's algorithm. It is the shortest path algorithm from one node to the remaining nodes, and it solves the shortest path problem in a weighted graph. The main feature of Dijkstra's algorithm is to start from the starting point and adopt the strategy of the greedy algorithm. Each time, it traverses 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.
[0058] In this embodiment, the distance value algorithm in the Dijkstra algorithm is improved, and the shortest path between the routing start point and the routing end point is determined based on the improved Dijkstra algorithm.
[0059] Finally, the shortest path can be sent to the routing start point.
[0060] The controller sends the shortest path 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 based on this shortest path.
[0061] The routing method provided in the embodiment of the present application improves the traditional Dijkstra algorithm. In the traditional Dijkstra algorithm, only the bandwidth is used to calculate the distance value between nodes, while in the embodiment of the present application, the time delay factor is added when calculating the distance value, that is, the distance value of each link is calculated according to the time delay and bandwidth of each link in the topology graph. The shortest path calculated based on the improved Dijkstra algorithm better meets the actual application requirements, and the situation where the service is damaged due to large bandwidth but large time delay will not occur. It can be seen that by adopting the improved Dijkstra algorithm in the controller of the content-centric network in the embodiment of the present application, a complex grid graph deployment is realized in the content-centric network, and a routing algorithm is implemented.
[0062] 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:
[0063] See Figure 2 , according to the flowchart of another routing method shown in an exemplary embodiment, as Figure 2 shown, including:
[0064] S201: Construct a topology graph based on the devices and links in the content-centric network;
[0065] S202: Calculate the distance value of each link according to the time delay and bandwidth of each link in the topology graph;
[0066] S203: Determine the routing start point and the routing end point in the topology graph;
[0067] S204: 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;
[0068] S205: Determine the distance of the shortest path 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;
[0069] S206: Determine the 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;
[0070] S207 Update the distance of the shortest path between each node in the second node group and the routing start point;
[0071] S208: Determine whether the second node group is empty; if not, re-enter step S206; if so, enter S209;
[0072] S209: Determine the shortest path between the routing end point and the routing start point.
[0073] 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 path has been obtained. Initially, S only contains the routing start point s. After obtaining the shortest path between the routing start point s and each other node, this other node is added to the first node group S.
[0074] The second node group U is the set of the remaining nodes for which the shortest path has 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 length. 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.
[0075] 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.
[0076] 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.
[0077] The specific process includes:
[0078] (1) Initially, the first node group S only contains 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 ∞.
[0079] (2) Select the node k with the shortest distance from the second node group U, add the node k to the first node group S, and at the same time, remove the node k from the second node group U.
[0080] (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 finding the shortest path, 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).
[0081] (4) Repeat steps (2) and (3) until all nodes in the second node group U are traversed.
[0082] Figure 3 For example, for a topology graph shown in an exemplary embodiment, Figure 3 taking as an example, 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.
[0083] 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.
[0084] At this time, S = {D(0), C(3)}, U = {A(∞), B(13), E(4), F(9), G(∞)}.
[0085] 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.
[0086] At this time, S = {D(0), C(3), E(4)}, U = {A(∞), B(13), F(6), G(12)}.
[0087] 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)}.
[0088] 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)}.
[0089] 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)}.
[0090] 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)}.
[0091] 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.
[0092] Finally, the shortest path can be sent to the routing start point.
[0093] Next, an application embodiment provided by the present application is introduced. Refer to Figure 11 , Figure 11 which is a topology diagram of a content - centric network shown according to an exemplary embodiment. Figure 11 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.
[0094] The client requests the content of 12345 / index.html. The controller first reads the device and link configuration files to generate a topology diagram and topology information. Calculate according to the generated topology diagram to calculate the optimal paths for each gateway device to go to other gateway devices. Finally, issue CCN routes to the nodes on the optimal paths according to the link information, so that each CCN device knows how to forward packets to the destination device.
[0095] The following introduces a routing device provided by an embodiment of the present application. The routing device described below can be referred to in mutual reference with the routing method described above.
[0096] Referring to Figure 12 , a structural diagram of a routing device shown according to an exemplary embodiment is as Figure 12 shown, including:
[0097] A construction module 100, configured to construct a topology graph based on devices and links in the content-centric network;
[0098] A calculation module 200, configured to calculate a distance value of each link according to the delay and bandwidth of each link in the topology graph;
[0099] A first determination module 300, configured to determine a routing start point and a routing end point in the topology graph;
[0100] A second determination module 400, configured to use the Dijkstra algorithm to determine a shortest path between the routing start point and the routing end point based on the distance values of the links in the topology graph.
[0101] The routing device provided by the embodiment of the present application improves the traditional Dijkstra algorithm. In the traditional Dijkstra algorithm, only the bandwidth is used to calculate the distance value between nodes, while in the embodiment of the present application, the delay factor is added when calculating the distance value, that is, the distance value of each link is calculated according to the delay and bandwidth of each link in the topology graph. The shortest path calculated based on the improved Dijkstra algorithm better meets the actual application requirements, and the situation where the service is damaged due to large bandwidth but large delay will not occur. It can be seen that the embodiment of the present application realizes a complex grid graph deployment and a routing algorithm in the content-centric network by adopting the improved Dijkstra algorithm in the controller of the content-centric network.
[0102] Based on the above embodiment, as a preferred implementation manner, the calculation module 200 is specifically configured to: calculate the distance value of each link according to the ratio of the delay to the bandwidth of each link in the topology graph.
[0103] Based on the above embodiment, as a preferred implementation manner, the calculation module 200 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.
[0104] Based on the above embodiments, as a preferred implementation, the building module 100 is specifically configured to: obtain the 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; build a topology graph based on the configuration file.
[0105] Based on the above embodiments, as a preferred implementation, the topology graph is a directed graph.
[0106] Based on the above embodiments, as a preferred implementation, nodes in the topology graph represent devices in the content-centric network, and edges between nodes represent links in the content-centric network.
[0107] Based on the above embodiments, as a preferred implementation, the second determination module 400 is specifically configured to: add the routing start point to the first node group, and add nodes in the topology graph other than 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; wherein, in the shortest path, only nodes in the first node group are included except for the start point and the end point; 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; 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 a target node in the second node group with the shortest shortest path distance from the routing start point until the second node group is empty; determine the shortest path between the routing end point and the routing start point.
[0108] 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.
[0109] 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 13 As shown in the structural diagram of an electronic device according to an exemplary embodiment, as Figure 13 shown, the electronic device includes:
[0110] A communication interface 1 capable of information interaction with other devices such as network devices, etc.
[0111] 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 the above one or more technical solutions. And the computer program is stored on the memory 3.
[0112] Of course, in practical applications, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to implement 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 13 all kinds of buses are labeled as the bus system 4.
[0113] 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.
[0114] 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), and 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.
[0115] 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, which 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.
[0116] 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.
[0117] 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.
[0118] Those of ordinary skill in the art can understand that all or part of the steps to implement 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.
[0119] 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 such an understanding, the technical solution of the embodiments 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. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which can 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.
[0120] As described above, the above is only the specific implementation manner 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; Calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph; Determine a routing start point and a routing end point in the topology graph; 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; Among them, the 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 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; 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.
3. The routing method according to claim 1, wherein The topology graph is a directed graph.
4. The routing method according to claim 1, wherein 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.
5. The routing method according to any one of claims 1 to 4, characterized in that, The 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; wherein, in the shortest path, except for the start point and the end point, only the nodes in the first node group are included; Determine the target node with the shortest shortest - path distance between the second node group and the routing start point, 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 second node group and the routing start point until the second node group is empty; Determine the shortest path between the routing end point and the routing start point.
6. A routing device, characterized in that, A controller applied to 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; A calculation module, configured to calculate the distance value of each link according to the delay and bandwidth of each link in the topology graph; A first determination module, configured to determine a routing start point and a routing end point in the topology graph; A second determination module, configured to 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; Among them, the calculation module 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.
7. An electronic device, characterized in that, Includes: 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 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, A computer program is stored on the 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 5 are implemented.
Citation Information
Patent Citations
Route selection method and device in wireless ad hoc network
CN110300426A