Service path calculation method, system, medium and device based on routing table

By comparing the routing table data in real time, the business paths are automatically calculated, which solves the problem of inaccurate business path selection in complex network topology, and achieves high-accurate automatic path selection.

CN116192966BActive Publication Date: 2025-03-18BEIJING TIANCHI NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310185590.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2025-03-18
Estimated Expiration
2043-03-01

AI Technical Summary

Technical Problem

In complex network topology, it is difficult for the prior art to automatically calculate and select accurate business paths, resulting in operation and maintenance personnel needing to manually specify paths, which increases the workload and may lead to inaccurate path selection.

Method used

By obtaining the current routing table data in real time and comparing it with the previous routing table data stored in the routing database, the first path from the starting node to the end node and the second path from the end node to the starting node are automatically calculated, and the full path corresponding to the target service is determined.

Benefits of technology

It realizes automatic calculation and switching to the target business path in the entire network node, improves the accuracy of business path selection and reduces the workload of operation and maintenance personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116192966B_ABST
    Figure CN116192966B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, medium and device for calculating a service path based on a routing table, wherein the method includes obtaining the routing table data of the current device and storing it in the routing database of the current device, wherein the current routing table data includes a target service consisting of a start node and an end node; comparing the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result; determining the next hop device of the current device according to the comparison result until the first path to the end node is reached; determining the second path from the end node to the start node, and determining the first path and the second path as the full path corresponding to the target service. The embodiment of the present application can automatically calculate and switch to the full path corresponding to the target service in the nodes of the entire network, thereby improving the accuracy of service path selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer network technology, and in particular to a method, system, medium and device for calculating a service path based on a routing table. Background Art

[0002] With the rapid development of the Internet and network communications, personnel need to specify paths and alternative paths for services when creating services to ensure stable operation of the services. Currently, in Layer 2 and Layer 3 networks, if network planners do not perform path planning, especially when the network topology is complex, it is impossible to detect the specific direction of the service, including which nodes and links it passes through.

[0003] At present, the path is mainly specified directly when the service is first created, and the alternative path is switched when the link, port, node, etc. in the service path have problems. Therefore, the service path and the alternative path need to be specified when the service is created, which requires the operation and maintenance personnel or network planners to have a 100% understanding of the entire network topology and understand the rated configuration and load of each link. This is a lot of work for the operation and maintenance personnel or network planners. Therefore, when manually planning the service path, the specific situation of each path may not be clear, resulting in inaccurate selection of the service path. Summary of the invention

[0004] In order to calculate and automatically switch to the path corresponding to the target service in real time and ensure the accuracy of service path selection, the present application provides a service path calculation method, system, medium and device based on a routing table.

[0005] In a first aspect of the present application, a method for calculating a service path based on a routing table is provided, which adopts the following technical solution:

[0006] Obtaining routing table data of the current device and storing it in a routing database of the current device, wherein the current routing table data includes a target service consisting of a start node and an end node;

[0007] Comparing the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result;

[0008] Determine, according to the comparison result, a next-hop device of the current device until a first path to the terminal node is reached;

[0009] A second path from the end node to the start node is determined, and the first path and the second path are determined as a full path corresponding to the target service.

[0010] By adopting the above technical solution, the current routing table data obtained in real time is compared with the previous routing table data stored in the routing database. When the current routing table data changes, the first path from the starting node to the end node and the second path from the end node to the starting node are calculated, and determined as the full path corresponding to the target business. Compared with manual selection of the business path, the present application can automatically calculate the full path corresponding to the target business, thereby improving the accuracy of business path selection.

[0011] Optionally, obtaining the routing table data of the current device and storing it in the routing database of the current device includes: receiving the routing table data of the current device sent by MQTT, the routing table data being collected by the controller through periodic polling and sent to the MQTT; and storing the routing table data of the current device in the routing database.

[0012] By adopting the above technical solution, the routing table data of the current device is sent through MQTT, and the data of the routing table of the current device can be obtained in real time. In order to avoid problems when MQTT sends data, the method of periodically polling the routing data of the current device is adopted to ensure that the routing table data can be sent in time, so that it can be judged in time whether the routing table data has changed.

[0013] Optionally, the current routing table data is compared with the routing table data last stored in the routing database to obtain a comparison result, including: determining whether the current routing table data is the same as the routing table data last stored in the routing database; if the current routing table data is not the same as the routing table data last stored in the routing database, obtaining a comparison result that the current routing table data has changed; if the current routing table data is the same as the routing table data last stored in the routing database, obtaining a comparison result that the current routing table data has not changed.

[0014] By adopting the above technical solution, it is determined whether the current routing table data is the same as the previous routing table data stored in the routing database. If they are not the same, it means that the current routing table data has changed, so that the service path can be selected in time according to the change of the routing table data.

[0015] Optionally, determining the next-hop device of the current device according to the comparison result until the first path reaches the end node includes: when the comparison result is that the current routing table data has changed, traversing the IP types from the current device to all next-hop devices; querying whether there is a device with the same IP type as the starting node among the IP types of all next-hop devices; if there is a first target device with the same IP type as the starting node among the IP types of all next-hop devices, taking the first target device as the next-hop device of the current device; judging whether the first target device is the end node; if the first target device is the end node, taking the link between the starting node and the first target device as the first path; if the first target device is not the end node, continuing to execute the step of determining the next-hop device of the current device until the first path reaches the end node.

[0016] By adopting the above technical solution, when the routing table data changes, the IP types from the current device to all next-hop devices are traversed, and the device with the same IP type as the starting node among the next-hop devices is used as the first target device, until the first target device is traversed to the end node, the first path from the starting node to the end node can be automatically calculated.

[0017] Optionally, determining the second path from the end node to the start node includes:

[0018] Query whether there is a device with the same IP type as the end node among the IP types of all the next-hop devices; if there is a second target device with the same IP type as the starting node among the IP types of all the next-hop devices, use the second target device as the next-hop device of the end node; determine whether the second target device is the starting node; if the second target device is the starting node, use the link from the end node to the second target device as the second path; if the second target device is not the starting node, continue to search for the next-hop device of the next-hop device of the end node until the second path to the starting node is reached.

[0019] By adopting the above technical solution, the devices with the same IP type as the end node in all next-hop device IP types are queried, and the devices with the same IP type as the end node in the next-hop device IP type are taken as the second target device, until the second target device is traversed to the starting node, the second path from the end node to the starting node can be automatically calculated.

[0020] Optionally, after determining the first path and the second path as the full paths corresponding to the target business, it also includes: traversing each business in the total business database to determine whether there is a business identical to the target business in the total business database; if there is no business identical to the target business in the total business database, storing the full path corresponding to the target business in the total business database; if there is a business identical to the target business in the total business database, determining whether the full path corresponding to the target business is the same as the corresponding full path in the total business database; if they are not the same, updating the target full path corresponding to the target business.

[0021] By adopting the above technical solution, it is determined in the total business database whether there is a business that is the same as the current target business. If not, the full path corresponding to the target business is stored in the total business database so that the information of each business path can be queried through the total business database later. If it exists, it is necessary to determine whether the full path is the same as the full path in the total business database. If not, the full path in the total business database is updated to achieve the update of the full path of each target business.

[0022] Optionally, after obtaining the current routing table data of the current device and storing it in the routing database, it also includes: determining whether there is a manually specified business path in the routing data; if there is a manually specified business path in the routing data, taking the manually specified business path as the target full path; if there is no manually specified business path in the routing data, executing the step of comparing the current routing table data with the routing table data last stored in the routing database to obtain a comparison result.

[0023] By adopting the above technical solution, if there is a manually specified business path in the routing data, the manually specified business path is used as the target full path, and there is no need to select the path according to the change of the routing table data, thereby reducing the calculation amount of the path selection.

[0024] In a second aspect of the present application, a service path calculation system based on a routing table is provided, the system comprising:

[0025] A routing data acquisition module, used to acquire routing table data of the current device and store it in a routing database of the current device, wherein the current routing table data includes a target service consisting of a start node and an end node;

[0026] A routing data comparison module, used to compare the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result;

[0027] A first path calculation module, used to determine the next hop device of the current device according to the comparison result, until a first path to the terminal node is reached;

[0028] The full path calculation module is used to determine a second path from the end node to the start node, and determine the first path and the second path as the full path corresponding to the target business.

[0029] In a third aspect of the present application, a computer storage medium is provided, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above method steps.

[0030] In a fourth aspect of the present application, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.

[0031] In summary, the present application includes at least one of the following beneficial technical effects:

[0032] 1. This application compares the current routing table data obtained in real time with the previous routing table data stored in the routing database, and when it is determined that the current routing table data has changed, calculates the first path from the start node to the end node and the second path from the end node to the start node, and determines them as the full path corresponding to the target service. Compared with manual selection of service paths, this application can automatically calculate and switch to the target service path in all network nodes, thereby improving the accuracy of service path selection;

[0033] 2. This application sends the routing table data of the current device through MQTT, and can obtain the data of the routing table of the current device in real time. In order to avoid problems when MQTT sends data, the routing data of the current device is polled periodically and sent to MQTT to ensure that the routing data can be sent in time, so that it can be judged in time whether the routing table data has changed. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0035] Figure 1 It is a flowchart of a method for calculating a service path based on a routing table provided in an embodiment of the present application;

[0036] Figure 2is a flowchart of a method for calculating a first path provided in an embodiment of the present application;

[0037] Figure 3 This is a schematic diagram of a template of a service path calculation system based on a routing table provided in an embodiment of the present application;

[0038] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0039] Explanation of the accompanying drawings: 1. Routing data acquisition module; 2. Routing data comparison module; 3. First path calculation module; 4. Full path calculation module; 1000. Electronic device; 1001. Processor; 1002. Communication bus; 1003. User interface; 1004. Network interface; 1005. Memory. DETAILED DESCRIPTION

[0040] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0041] In the description of the embodiments of the present application, words such as "illustrative", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "illustrative", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "illustrative", "for example" or "for example" is intended to present related concepts in a concrete way.

[0042] In the description of the embodiments of the present application, the term "and / or" is only a kind of association relationship describing the associated objects, indicating that there may be three kinds of relationships, for example, A and / or B, which can represent: A exists alone, B exists alone, and A and B exist at the same time. In addition, unless otherwise specified, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0043] With the rapid development of the network, there are more and more devices in the network. When business information is transmitted, it needs to pass through multiple devices from the sending device to the receiving device. Especially for some network topologies with complex structures, it is impossible to detect the specific direction of the business information, including which nodes and links it passes through. At present, the main method is to directly specify the business path when the business is created by the network planner. This requires the network planner to have a 100% understanding of the entire network topology and the load of each link. In addition, when manually planning the business path, the workload of the network planner is large, which can easily lead to inaccurate selection of the business path.

[0044] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below in conjunction with specific embodiments. The following embodiments may be combined with each other, and the same or similar probabilities or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0045] In one embodiment, Figure 1 As shown, a flow chart of a method for calculating a service path based on a routing table is proposed. The method is mainly used in computer equipment, and the specific method includes:

[0046] Step 10: Obtain the routing table data of the current device and store it in the routing database of the current device.

[0047] In the embodiment of the present application, each device in the entire network can be regarded as each node in the entire network, that is, each device is a node. The current device can be understood as the sending device end of the target service, that is, the starting node of the target service. The routing table data of the current device can be further understood as the data of the target service information. The routing table data will change according to the change of the service information. The routing table data may include the target service composed of the starting node and the end node.

[0048] Exemplarily, the controller of the current device collects routing table data every minute and sends the collected routing table data to the routing table channel through MQTT. MQTT is a message queue telemetry transmission, which is a message protocol based on the subscription paradigm. The business logic side of the current device subscribes to the channel, sorts the obtained routing table data according to the preset priority and stores it in MQTT. In order to avoid the loss of routing table data in MQTT, the business logic side uses Celery to collect routing table data through regular polling. Celery is a distributed asynchronous message task queue. Celery regular polling is used to ensure that the routing table data can be sent in time, so that it can be judged in time whether the routing table data has changed. After obtaining the routing table data of the current device, the routing table data is stored in the routing table database corresponding to the current device.

[0049] On the basis of the above embodiment, according to the comparison result, after the step of obtaining the routing table data of the current device and storing it in the routing database of the current device, the following steps are also included:

[0050] Step 101: Determine whether there is a manually specified service path in the routing data;

[0051] Step 102: If there is a manually specified service path in the routing data, the manually specified service path is used as the target full path;

[0052] Step 103: If there is no manually specified service path in the routing data, a step of comparing the current routing table data with the routing table data stored last time in the routing database is performed to obtain a comparison result.

[0053] Specifically, after obtaining the target service in the routing table data, it is necessary to query whether there is a manually specified service path in the routing data, that is, it is necessary to determine whether there is a path ID on the controller side of the current device. If the current device has a path ID on the controller side, it means that there is a service path with manual intervention, and there is no need to subsequently calculate the full path of the target path. The service data is directly transmitted according to the manually specified service path as the target full path. If the current device does not have a path ID on the controller side, it means that there is no manually specified service path in the routing table data, and then the current routing table data is compared with the routing table data stored last time in the routing database to obtain the comparison result, so as to calculate the full path corresponding to the target service.

[0054] Step 20: Compare the routing table data of the current device with the routing table data stored last time in the routing database to obtain a comparison result.

[0055] Specifically, after obtaining the routing table data of the current device, it is necessary to determine whether the routing table data of the current device has changed, compare the routing table data of the current device with the routing table data last stored in the routing library, and determine whether the routing table data of the current device is the same as the routing table data last stored in the routing library. If the routing table data of the current device is the same as the routing table data last stored in the routing library, a comparison result indicating that the current routing table data has changed is obtained. If the routing table data of the current device is different from the routing table data last stored in the routing library, a comparison result indicating that the current routing table data has not changed is obtained.

[0056] Furthermore, when the routing table data of the current device has not changed, it is continued to determine whether the routing table data of the next device in the entire network has changed, and the device whose routing table data has changed is found as the current device. The changed new routing table data is stored in the routing table database of the corresponding device. In the embodiment of the present application, the routing table data can be stored in Redis. Redis is a high-performance database that can be used as a database, cache, and message queue. Based on Redis, data can be quickly cached so that each routing table data can be quickly stored in the routing table database, which is convenient for subsequent comparison of the last stored routing table data with the new routing table data to determine whether the routing table data has changed.

[0057] Step 30: According to the comparison result, determine the next hop device of the current device until the first path reaches the end node.

[0058] Specifically, if the comparison result shows that the current routing table data has changed, it means that the target service has changed. The current device is used as the starting node of the target service, and the next hop device from the starting node to the end node is calculated until the first path to the end node is reached.

[0059] Please refer to Figure 2 ,, is a flow chart of a method for calculating a first path provided in an embodiment of the present application. Based on the above embodiment, the step of determining the next hop device of the current device according to the comparison result until the first path to the terminal node is reached also includes the following steps:

[0060] Step 301: When the comparison result shows that the current routing table data has changed, traverse the IP types from the current device to all next-hop devices.

[0061] Specifically, when some devices or their associated nodes in the service link are disabled or not needed, such devices will be deleted. In the embodiment of the present application, all devices in the list that have not been deleted and whose associated nodes have not been deleted are used as all next-hop devices.

[0062] Furthermore, when the current routing table data changes, all next-hop devices of the current device are traversed and the data of all next-hop devices is obtained. The next-hop devices can be saved in Redis. The storage format can be hash storage, the key name is router_dict_device ID, K represents the current device, and V represents the next-hop device, so that the data of the next-hop device can be quickly queried and saved. The data of the next-hop device includes the IP type of the device.

[0063] For example, assuming that the current device, that is, the starting node is A, and the service path from the starting node A to the end node Z needs to be calculated, then the next hop node B from the starting node A to the end node Z needs to be determined. Generally, the result of calculating A to the next hop node B is an IP type string. At this time, it is necessary to query the IP types of all next hop nodes.

[0064] Step 302: Query whether there is a device of the same IP type as the start node among the IP types of all next-hop devices.

[0065] Exemplarily, the routing table data of the current device includes the IP type of the target service link, that is, the IP type of the starting node, and the IP types of all next-hop devices are queried to see whether there is a device with the same IP type as the starting node, so as to find the next-hop device of the current device.

[0066] Step 303: If there is a first target device of the same IP type as the start node among the IP types of all next-hop devices, the first target device is used as the next-hop device of the current device.

[0067] Exemplarily, if there is a first target device with the same IP type as the starting node among the IP types of all next-hop devices, the first target device is used as the next-hop device of the current device. For example, if the IP type of the starting node is X, the result of the next-hop IP type is X, and it is necessary to query the first target device with IP type X among the IP types of all next-hop devices.

[0068] Step 304: Determine whether the first target device is an endpoint node.

[0069] Step 305: If the first target device is the end node, the link from the start node to the first target device is used as the first path.

[0070] Step 306: If the first target device is not the end node, continue to calculate the next hop device of the current device until the first path to the end node is reached.

[0071] Exemplarily, if the target service is Y, it is necessary to query the starting node A and the terminal node Z of Y. Read the next hop node from the starting node A to the terminal node Z. Assuming that the next hop node is B, B is used as the first target device. At this time, the first path from the starting node A to the terminal node Z is temporarily AB. It is determined whether the first target device B is the terminal node Z. If the first target device B is the terminal node Z, the first path from the starting node to the terminal node is AB. If the first target device B is not the terminal node Z, continue to read the next hop device C from B to the terminal device Z, and continue to execute the step of determining whether the first target device C is the terminal node Z until the next hop device is the terminal node Z. At this time, the first path from the starting node A to the terminal node Z can be ABC…Z.

[0072] In another possible embodiment, there may be a situation where the next-hop device cannot be queried, that is, there is no first target device with the same IP type as the starting node among the IP types of all next-hop devices. In this case, it is marked as None, indicating that A is the source node at this time, and the next hop from the starting node A to the end node Z stops at A, recorded as None, and the subsequent query steps are stopped.

[0073] Step 40: Determine a second path from the end node to the start node, and determine the first path and the second path as the full path corresponding to the target service.

[0074] Since the nodes passed by the first path from the start node to the end node may be different from the nodes passed by the second path from the end node to the start node, the second path from the end node to the start node also needs to be calculated.

[0075] Specifically, the calculation principle of the second path is: when there is no device with the same IP type as the starting node among the IP types of all next-hop devices queried, or when there is a device with the same IP type as the starting node among the IP types of all next-hop devices queried, and after the first path is calculated,

[0076] Continue to query whether there is a device with the same IP type as the end node among the IP types of all next-hop devices; if there is a second target device with the same IP type as the start node among the IP types of all next-hop devices, then use the second target device as the next-hop device of the end node; and determine whether the second target device is the start node; if the second target device is the start node, then use the link from the end node to the second target device as the second path; if the second target device is not the start node, then continue to search for the next-hop device of the next-hop device of the end node until the second path of the start node is reached. Since the calculation principle of the second path is the same as that of the first path, no further elaboration is given here.

[0077] Furthermore, the first path from the starting node to the end node and the second path from the end node to the starting node are determined as the full path corresponding to the target business, so that the node information passed by the full path of each target business can be easily queried later, so that the bandwidth occupied by each path and node can be calculated according to the information of each node, avoiding path overload.

[0078] On the basis of the above embodiment, after the first path and the second path are determined as the full paths corresponding to the target business, the full paths corresponding to the target business can be stored in the total business database. As an optional embodiment, the step of storing the full paths corresponding to the target business in the total business database can also include the following steps:

[0079] Step 401: traverse each business in the total business database to determine whether there is a business identical to the target business in the total business database;

[0080] Step 402: If it does not exist, the full path corresponding to the target business is stored in the general business database;

[0081] Step 403: If it exists, determine whether the full path corresponding to the target business is the same as the corresponding full path in the total business database; if not, update the full path corresponding to the target business.

[0082] Specifically, the total business database includes multiple businesses. After obtaining the target business, each business is traversed in the total business database to determine whether there is a business identical to the target business in the total business database. If there is no business identical to the target business in the total business database, the full path corresponding to the target business is stored in the total business database to enrich the business path in the total business database, so that the information of each business path can be queried through the total business database later. If there is a business identical to the target business in the total business database, but the path and the nodes passed by the business are different from those of the target business, it is necessary to determine whether the full path corresponding to the target business is the same as the full path corresponding to the total business database. If they are the same, no repeated storage is performed; if they are not the same, there may be additions or deletions between the nodes in the full path and the nodes passed by the full path of the target path. In this case, the full path corresponding to the target business is updated in the total business database to update the full path of each target business.

[0083] The following is a system embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the system embodiment of the present application, please refer to the method embodiment of the present application.

[0084] Please refer to Figure 3, a service path calculation system based on a routing table is provided in an embodiment of the present application. The service path calculation system based on a routing table may include: a routing data acquisition module 1, a routing data comparison module 2, a first path calculation module 3 and a full path calculation module 4, wherein:

[0085] The routing data acquisition module 1 is used to acquire the routing table data of the current device and store it in the routing database of the current device, wherein the current routing table data includes a target service consisting of a start node and an end node;

[0086] The routing data comparison module 2 is used to compare the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result;

[0087] A first path calculation module 3, used to determine the next hop device of the current device according to the comparison result, until the first path reaches the terminal node;

[0088] The full path calculation module 4 is used to determine the second path from the end node to the start node, and determine the first path and the second path as the full path corresponding to the target service.

[0089] Based on the above embodiments, as an optional embodiment, a service path calculation system based on a routing table may further include: a full path storage module and a manual path judgment module, wherein:

[0090] The full path storage module is used to traverse each business in the total business database to determine whether there is a business identical to the target business; if not, the full path corresponding to the target business is stored in the total business database; if it exists, it is determined whether the full path corresponding to the target business is the same as the corresponding full path in the total business database; if not, the target full path corresponding to the target business is updated.

[0091] The manual path judgment module is used to judge whether there is a manually specified business path in the routing data; if there is a manually specified business path in the routing data, the manually specified business path is used as the target full path; if there is no manually specified business path in the routing data, the current routing table data is compared with the routing table data last stored in the routing database to obtain a comparison result.

[0092] It should be noted that: when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0093] The present application also provides a computer storage medium, which can store multiple instructions, which are suitable for being loaded by a processor and executed by a method for calculating a service path based on a routing table as described in the above-mentioned embodiment. The specific execution process can be referred to in Figure 1-Figure 2 The specific description of the illustrated embodiment will not be repeated here.

[0094] See also Figure 4 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .

[0095] The communication bus 1002 is used to realize the connection and communication between these components.

[0096] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.

[0097] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0098] Among them, the processor 1001 may include one or more processing cores. The processor 1001 uses various interfaces and lines to connect various parts of the entire server 1000, and executes various functions and processes data of the server 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (ProgrammableLogic Array, PLA). The processor 1001 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1001, but implemented separately through a chip.

[0099] Among them, the memory 1005 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may also be optionally at least one storage device located away from the aforementioned processor 1001. As Figure 4 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program of a service path calculation method based on a routing table.

[0100] It should be noted that: when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0101] exist Figure 4 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 1001 can be used to call an application program stored in the memory 1005 for a service path calculation method based on a routing table. When executed by one or more processors, the electronic device executes one or more methods described in the above embodiments.

[0102] An electronic device readable storage medium is characterized in that the electronic device readable storage medium stores instructions. When executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments.

[0103] Those skilled in the art can clearly understand that the technical solution of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.

[0104] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0105] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0107] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0108] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0110] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware. The program may be stored in a computer-readable memory, and the memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0111] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are only regarded as exemplary, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A service path calculation method based on a routing table, characterized in that: The method comprises: Obtaining routing table data of the current device and storing it in a routing database of the current device, wherein the routing table data of the current device includes a target service consisting of a start node and an end node; Comparing the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result; When the comparison result is that the routing table data of the current device has changed, traverse the IP types of all next-hop devices from the current device; Check whether there is a device with the same IP type as the starting node among the IP types of all the next-hop devices; If there is a first target device of the same IP type as the start node among the IP types of all the next-hop devices, use the first target device as the next-hop device of the current device; Determining whether the first target device is the endpoint node; If the first target device is the end node, taking the link from the start node to the first target device as the first path; If the first target device is not the terminal node, continue to perform the step of determining the next hop device of the current device until the first path to the terminal node is reached; Check whether there is a device with the same IP type as the end node among the IP types of all the next-hop devices; If there is a second target device of the same IP type as the starting node among the IP types of all the next-hop devices, the second target device is used as the next-hop device of the end node; Determining whether the second target device is the starting node; If the second target device is the starting node, taking the link from the end node to the second target device as the second path; If the second target device is not the starting node, continue to search for the next hop device of the next hop device of the end node until the second path to the starting node is reached; The first path and the second path are determined as full paths corresponding to the target service.

2. The method for calculating a service path based on a routing table according to claim 1, characterized in that: The step of obtaining the routing table data of the current device and storing it in the routing database of the current device includes: Receive the routing table data of the current device sent by MQTT, the routing table data is collected by the controller through periodic polling and sent to the MQTT; The routing table data of the current device is stored in a routing database.

3. The method for calculating a service path based on a routing table according to claim 1, characterized in that: The comparing the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result includes: Determine whether the routing table data of the current device is the same as the routing table data last stored in the routing database; If the routing table data of the current device is different from the routing table data stored last time in the routing database, a comparison result showing that the routing table data of the current device has changed is obtained; If the routing table data of the current device is the same as the routing table data stored last time in the routing database, a comparison result is obtained that the routing table data of the current device has not changed.

4. The method for calculating a service path based on a routing table according to claim 1, characterized in that: After determining the first path and the second path as the full path corresponding to the target service, the method further includes: Traversing each business in the total business database, and determining whether there is a business identical to the target business in the total business database; If there is no business identical to the target business in the total business database, then storing the full path corresponding to the target business in the total business database; If the total business database contains the same business as the target business, determine whether the full path corresponding to the target business is the same as the corresponding full path in the total business database; if not, update the target full path corresponding to the target business.

5. The method for calculating a service path based on a routing table according to claim 1, characterized in that: After obtaining the routing table data of the current device and storing it in the routing database, the method further includes: Determining whether there is a manually specified service path in the routing data; If there is a manually specified service path in the routing data, the manually specified service path is used as the target full path; If there is no manually specified service path in the routing data, a step of comparing the routing table data of the current device with the routing table data last stored in the routing database is performed to obtain a comparison result.

6. A service path calculation system based on a routing table for implementing the service path calculation method based on a routing table as claimed in claim 1, characterized in that: The system comprises: A routing data acquisition module (1) is used to acquire routing table data of a current device and store it in a routing database of the current device, wherein the routing table data of the current device includes a target service consisting of a start node and an end node; A routing data comparison module (2) is used to compare the routing table data of the current device with the routing table data last stored in the routing database to obtain a comparison result; A first path calculation module (3), used to determine the next hop device of the current device according to the comparison result, until the first path reaches the terminal node; A full path calculation module (4) is used to determine a second path from the end node to the start node, and determine the first path and the second path as the full path corresponding to the target service.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method steps as described in any one of claims 1 to 5 are executed.

8. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and apparatus for generating optical transport network path sections

    WO2016061982A1