Topology Graph Generation Method, Device, Equipment and Storage Medium for Routing Data
By importing the routing data into the graph database and generating the topology map of the routing data using the shortest path search algorithm, the problem of unintuitive routing topology map in the existing technology is solved, and the effect of intuitively displaying network paths and protection mechanisms is achieved.
Patent Information
- Application Number
- CN202510413793.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-03
AI Technical Summary
In the prior art, the routing topology map formed by automatic layout is not intuitive and cannot effectively display the path direction, primary and backup protection, and branch information from the source end to the sink end.
By importing the routing data into the graph database, the source and sink ports are determined according to the service type, and the initial path is determined using the shortest path search algorithm. The initial path is then processed to obtain the target path and arrangement order, and finally the topology diagram is generated according to the arrangement order of the target paths.
The generated routing data topology map is intuitive and clear, which can effectively display the network structure and help users understand network paths and protection mechanisms.
Smart Images

Figure CN119945965B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of routing data processing and related technical fields. Specifically, it relates to a method, device, equipment, and storage medium for generating a topology graph based on routing data. Background Art
[0002] Although routing data can accurately describe the connection relationship between ports, when it comes to displaying information such as the path direction from the source end to the destination end, primary and standby protection, and branches, it is difficult to intuitively express only at the routing data level. Therefore, it is necessary to convert routing data into an intuitive, clear, and human-intuitive routing topology graph.
[0003] In the prior art, the port positions are determined by relying on the segment group order attribute, and the automatically generated routing topology graph is not intuitive. It does not start from the business scenario, does not fix the source and destination positions, and does not reasonably arrange the primary path and the standby path, and cannot well help users understand the network structure. Summary of the Invention
[0004] The embodiments described herein provide a method, device, equipment, and storage medium for generating a topology graph of routing data, which solves the problems existing in the prior art.
[0005] In a first aspect, according to the content of the present disclosure, there is provided a method for generating a topology graph of routing data, including:
[0006] Import the routing data into a graph database, where the routing data includes ports, routing segments, weight information of the routing segments, and ports included in network elements;
[0007] Determine a source-end port and a destination-end port according to the service type to which the routing data belongs, and determine an initial path included between the source-end port and the destination-end port, where the initial path includes a key initial path and a non-key initial path;
[0008] Process the initial path to obtain a target path and the arrangement order of each target path;
[0009] Determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong;
[0010] Generate a topology graph of the routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0011] In some embodiments of the present disclosure, the determining the initial path included between the source-end port and the destination-end port includes:
[0012] Determine the critical initial path between the source port and the sink port according to the shortest path search algorithm;
[0013] Taking the source port and the sink port as starting points respectively, and taking the ports not covered in the critical initial path as end points, determine the non-critical initial paths.
[0014] In some embodiments of the present disclosure, the determining the critical initial path between the source port and the sink port according to the shortest path search algorithm includes:
[0015] Determine the first shortest path between the source port and the sink port according to the port, the routing segment and the weight information of the routing segment;
[0016] After increasing the weight information of the routing segments included in the first shortest path between the source port and the sink port to the preset weight information, search for the second shortest path between the source port and the sink port. After the Nth shortest path between the source port and the sink port is found for the Nth time, if the first shortest path between the source port and the sink port is found again, then the first shortest path to the Nth shortest path are the critical initial paths between the source port and the sink port, where the ith shortest path includes at least one port that is not covered in any of the first shortest path to the (i - 1)th shortest path, and i is an integer greater than 1 and less than or equal to N.
[0017] In some embodiments of the present disclosure, the processing the initial path to obtain the target path and the arrangement order of each target path includes:
[0018] Perform duplicate removal processing on the initial path to obtain the target path;
[0019] Determine the initial arrangement order of each target path according to the weight information of the routing segments included in each target path;
[0020] Adjust the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order.
[0021] In some embodiments of the present disclosure, the adjusting the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order includes:
[0022] Determine the intimacy information of any two target paths according to the number of identical ports and the number of ports with connection relationships included in any two target paths in the initial arrangement order;
[0023] Adjust the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order of each target path.
[0024] In some embodiments of the present disclosure, determining the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network element to which the ports included in each target path belong includes:
[0025] Determining the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the ports included in each target path, the sorting of the ports included in each target path, and the network element to which the ports included in each target path belong;
[0026] Determining the horizontal coordinate positions of the ports included in each network element according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element;
[0027] Determining the vertical coordinate positions of the ports included in each network element according to the arrangement order of each target path.
[0028] In some embodiments of the present disclosure, it further includes:
[0029] Marking the relationship type and the direction information of each routing segment on the routing segment.
[0030] In a second aspect, according to the content of the present disclosure, there is provided a topology graph generation device for routing data, including:
[0031] A data import module, configured to import routing data into a graph database, where the routing data includes ports, routing segments, weight information of the routing segments, and ports included in network elements;
[0032] An initial path determination module, configured to determine a source - end port and a destination - end port according to the service type to which the routing data belongs, and determine an initial path included between the source - end port and the destination - end port, where the initial path includes a key initial path and a non - key initial path;
[0033] A sorting module, configured to process the initial path to obtain a target path and the arrangement order of each target path;
[0034] An arrangement position determination module, configured to determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network element to which the ports included in each target path belong;
[0035] A topology graph generation module, configured to generate a topology graph of routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0036] In a third aspect, according to the content of the present disclosure, there is provided a computer device, including:
[0037] One or more processors;
[0038] A storage device for storing one or more programs,
[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the first aspect.
[0040] In a fourth aspect, according to the content of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the first aspect is implemented.
[0041] The method, apparatus, device, and medium for generating a topology graph of routing data provided by the embodiments of the present disclosure first import the routing data into a graph database; then determine a source port and a destination port according to the service type to which the routing data belongs, and determine an initial path included between the source port and the destination port; and process the initial path to obtain a target path and the arrangement order of each target path; and determine the arrangement position of each network element and the arrangement position of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong; finally, generate a topology graph of the routing data according to the arrangement position of each network element and the arrangement position of the ports included in each network element. By determining the source port and the destination port, the target path between the source port and the destination port is found, and it is not necessary to rely on the segment group order attribute in the routing data. The complete routing path can be concatenated according to the connection relationship of the ports, and since the target path found according to the source port and the destination port has the arrangement order of the ports, therefore, after determining the arrangement order between each target path, the arrangement position of each network element and the arrangement position of the ports included in each network element can be determined according to the arrangement order between each target path and the sorting order of each port on each target path, and then a topology graph of the routing data is generated.
[0042] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the specific embodiments of the present application are hereinafter specifically exemplified. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be understood that the following described drawings only relate to some embodiments of the present disclosure and do not limit the present disclosure, where:
[0044] Figure 1 It is a schematic flowchart of a method for generating a topology graph of routing data provided by an embodiment of the present disclosure;
[0045] Figure 2 It is a schematic structural diagram of a device for generating a topology graph of routing data provided by an embodiment of the present disclosure;
[0046] Figure 3 It is a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
[0047] In the drawings, reference numerals with the same last two digits correspond to the same elements. It should be noted that the elements in the drawings are schematic and not drawn to scale. Detailed implementation manners
[0048] In order to make the objectives, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those skilled in the art without creative efforts based on the described embodiments of the present disclosure also fall within the scope of protection of the present disclosure.
[0049] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which the subject matter of the present disclosure belongs. Further, it will be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless expressly defined herein. As used herein, a statement that two or more parts are "connected" or "coupled" together shall mean that these parts are directly joined together or joined through one or more intermediate components.
[0050] Reference to "embodiment" herein means that a particular feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The phrase "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0051] In this text, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists, both A and B exist, and B exists. Additionally, in this text, the character " / " generally indicates that the related objects before and after are in an "or" relationship.
[0052] Furthermore, in all embodiments of the present disclosure, terms such as "first" and "second" are only used to distinguish one component (or a part of the component) from another component (or another part of the component).
[0053] In the description of this application, unless otherwise specified, the meaning of "a plurality of" refers to more than two (including two). Similarly, "a plurality of groups" refers to more than two groups (including two groups).
[0054] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0055] Based on the problems existing in the prior art, the embodiments of the present disclosure provide a method for generating a topology graph of routing data. Figure 1 It is a schematic flowchart of a method for generating a topology graph of routing data provided by the embodiments of the present disclosure. As Figure 1 shown, the specific process of the method for generating a topology graph of routing data includes:
[0056] S110. Import the routing data into the graph database.
[0057] Among them, the routing data includes ports, routing segments, weight information of the routing segments, and ports included in the network elements.
[0058] In a specific implementation manner, the routing data is stored in a relational database in Excel format. For example, the ports, routing segments, weight information of the routing segments, and ports included in the network elements included in the routing data of a certain service type, etc.
[0059] In the method for generating a topology graph of routing data provided by the embodiments of the present disclosure, first, the routing data in the relational database is imported into the graph database.
[0060] S120. Determine the source-end port and the destination-end port according to the service type to which the routing data belongs, and determine the initial path included between the source-end port and the destination-end port.
[0061] Among them, the initial path includes a critical initial path and a non-critical initial path.
[0062] In a specific implementation, when routing data is stored in a relational database, it is stored according to the service type to which the routing data belongs. Therefore, after the service type to which the routing data belongs is known, the source port and the destination port in the routing data can be determined. Then, based on the shortest path search method, the key initial path included between the source port and the destination port, as well as the non-key initial path other than the key search path, can be determined.
[0063] Exemplarily, if the routing data is likened to the data included in a train number passing through various stations, then according to the train number, the starting station, the ending station of the train number, and the intermediate stations passed by the train number can be determined.
[0064] Among them, the specific process of determining the initial path included between the source port and the destination port includes: determining the key initial path included between the source port and the destination port according to the shortest path search algorithm; respectively taking the source port and the destination port as the starting point and the ports not covered in the key initial path as the ending point to determine the non-key initial path.
[0065] Specifically, determining the key initial path included between the source port and the destination port according to the shortest path search algorithm includes: determining the first shortest path between the source port and the destination port according to the port, the routing segment, and the weight information of the routing segment; after increasing the weight information of the routing segment included in the first shortest path between the source port and the destination port to the preset weight information, searching for the second shortest path between the source port and the destination port. After the Nth shortest path between the source port and the destination port is found for the Nth time, if the first shortest path between the source port and the destination port is found again, then the first shortest path to the Nth shortest path is the key initial path between the source port and the destination port, where the i-th shortest path includes at least one port not covered in any of the first shortest path to the (i - 1)-th shortest path, and i is an integer greater than 1 and less than or equal to N.
[0066] Exemplarily, starting from the source port of the source end as the starting point and the destination port as the terminal, search for the paths included between the source port and the destination port. Then, according to the weight information of the routing segments included in each path, determine the weight information of each path, and select the path with the smallest weight information as the first shortest path (which can be one path or multiple paths). Then, increase the weight information of each routing segment included in the first shortest path to a preset weight information. Again, search for the path with the smallest weight information from the paths included between the source port and the destination port as the second shortest path. Furthermore, increase the weight information of each routing segment included in the second shortest path to the preset weight information until the Nth shortest path between the source port and the destination port is found at the Nth time. After increasing the weight information of each routing segment included in the Nth shortest path to the preset weight information, if the first shortest path between the source port and the destination port is found again, then the first shortest path to the Nth shortest path are the key initial paths between the source port and the destination port.
[0067] It should be noted that during the process of determining the key initial paths, the second shortest path includes at least one port not covered by the first shortest path, the ith shortest path includes at least one port not covered by any of the first shortest path to the (i - 1)th shortest path, and the Nth shortest path includes at least one port not covered by any of the first shortest path to the (N - 1)th shortest path.
[0068] In addition, it should be noted that after finding the first shortest path between the source port and the destination port, increasing the weight information of the routing segments included in the first shortest path between the source port and the destination port to the preset weight information is to be able to find the second shortest path. The setting of the preset weight information can be determined according to the number of ports and the number of routing segments included in the routing data.
[0069] In addition, since the routing data may be incomplete and there are disconnected routing segments, the routing segments passed through in the key initial paths do not include these disconnected routing segments. Therefore, after finding the key initial paths between the source port and the destination port, it is necessary to find the non - key initial paths.
[0070] Specifically, the specific process of finding the non - key initial paths is as follows: First, taking the source port as the starting point and the ports not covered in the key initial paths as the terminals, obtain the first non - key initial path. Then, taking the destination port as the starting point and the ports not covered in the key initial paths as the terminals, obtain the second non - key initial path. The first non - key initial path and the second non - key initial path form the non - key initial paths.
[0071] S130. Process the initial paths to obtain the target paths and the arrangement order of each target path.
[0072] After obtaining the initial paths, there may be a situation where one path contains another path. Therefore, first, it is necessary to remove duplicates from the initial paths to obtain the target paths, and then sort the target paths to obtain the arrangement order of each path.
[0073] In a specific implementation manner, processing the initial paths to obtain the target paths and the arrangement order of each target path includes: removing duplicates from the initial paths to obtain the target paths; determining the initial arrangement order of each target path according to the weight information of the routing segments included in each target path; and adjusting the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order.
[0074] Among them, adjusting the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order includes: determining the intimacy information of any two target paths according to the number of identical ports and the number of ports with a connection relationship included in any two target paths in the initial arrangement order; and adjusting the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order of each target path.
[0075] A specific and exemplary process of removing duplicates from the initial paths includes: If starting from the source - end port and ending at port 8 not covered by the key initial path, the non - key initial path obtained is: port 1 - port 2 - port 8. If starting from the source - end port and ending at port 9 not covered by the key initial path, the non - key initial path obtained is: port 1 - port - port 8 - port 9. Therefore, the non - key initial path port 1 - port - port 8 - port 9 covers the non - key initial path port 1 - port - port 8. At this time, it is necessary to remove the non - key initial path port 1 - port - port 8.
[0076] After removing duplicates from the initial paths to obtain the target paths, first, it is necessary to determine the initial arrangement order of each target path according to the weight information of the routing segments included in each target path. Specifically, after summing up the weight information of the routing segments included in each target path and then taking the average, the target weight information of each target path is obtained. Then, the target weight information of each target path is sorted from smallest to largest to obtain the initial arrangement order of each target path.
[0077] Specifically, the selected target paths include Path 1, Path 2, Path 3, and Path 4. Among them, the weight information of Path 1 is less than that of Path 2, the weight information of Path 2 is less than that of Path 3, and the weight information of Path 3 is less than that of Path 4. Then, the initial arrangement order of each target path is: Path 1, Path 2, Path 3, and Path 4.
[0078] After obtaining the initial arrangement order of the target paths, first, according to the number of identical ports included in any two target paths under the initial arrangement order and the number of ports with a connection relationship, determine the intimacy information of any two target paths.
[0079] Specifically, if the determined target paths include: Path 1, Path 2, Path 3, and Path 4, then determine the number of identical ports in the ports included in Path 1 and Path 2 and the number of connection ports between Path 1 and Path 2. According to the number of identical ports in the ports included in Path 1 and Path 2 and the number of connection ports between Path 1 and Path 2, calculate the intimacy information of Path 1 and Path 2. Similarly, determine the intimacy information of Path 1 and Path 3, the intimacy information of Path 1 and Path 4, the intimacy information of Path 2 and Path 3, the intimacy information of Path 2 and Path 4, and the intimacy information of Path 3 and Path 4. Finally, sort each target path according to the intimacy information of Path 1 and Path 2, the intimacy information of Path 1 and Path 3, the intimacy information of Path 1 and Path 3, the intimacy information of Path 2 and Path 3, the intimacy information of Path 2 and Path 4, and the intimacy information of Path 3 and Path 4 to obtain the target arrangement order of each target path.
[0080] As a specific implementable manner, if the intimacy information of Path 1 and Path 2 is greater than the intimacy information of Path 1 and Path 3 and the intimacy information of Path 1 and Path 4, then first is Path 1, then is Path 2. Then, further compare the intimacy information of Path 2 and Path 3 with the intimacy information of Path 2 and Path 4. If the intimacy information of Path 2 and Path 4 is greater than the intimacy information of Path 2 and Path 3, then adjust Path 4 to the front of Path 3.
[0081] S140. According to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong, determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0082] After determining the target paths, the sorting of the ports included in each target path can be determined.
[0083] And since the routing data includes the ports included in each network element, therefore, the network elements to which the ports included in each target path belong are known.
[0084] In a specific implementation manner, according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong, determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element, including: according to the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong, determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element; according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element, determine the horizontal coordinate positions of the ports included in each network element; according to the arrangement order of each target path, determine the vertical coordinate positions of the ports included in each network element.
[0085] That is, first, according to the ports included in each target path and the network elements to which the ports included in each target path belong, determine the arrangement positions of each network element, and then, according to the sorting of the ports included in each target path and the arrangement positions of each network element, determine the arrangement positions of the ports included in each network element. Furthermore, according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element, determine the horizontal coordinate positions of the ports included in each network element; finally, according to the arrangement order of each target path, determine the vertical coordinate positions of the ports included in each network element.
[0086] S150. Generate a topology diagram of routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0087] After determining the arrangement positions of each network element and the arrangement positions of the ports included in each network element, a topology diagram of routing data can be generated based on the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0088] The topology graph generation method for routing data provided by the embodiments of the present disclosure first imports the routing data into a graph database; then determines the source - end port and the destination - end port according to the service type to which the routing data belongs, and determines the initial path included between the source - end port and the destination - end port; processes the initial path to obtain the target path and the arrangement order of each target path; and determines the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong; finally, generates the topology graph of the routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element. By determining the source - end port and the destination - end port, the target path between the source - end port and the destination - end port can be found. Without relying on the segment - group order attribute in the routing data, the complete routing path can be concatenated according to the connection relationship of the ports. Moreover, since the target path found according to the source - end port and the destination - end port has the arrangement order of the ports, after determining the arrangement order between each target path, the arrangement positions of each network element and the arrangement positions of the ports included in each network element can be determined according to the arrangement order between each target path and the sorting order of each port on each target path, and then the topology graph of the routing data is generated.
[0089] Based on the above - mentioned embodiments, the topology graph generation method for routing data provided by the embodiments of the present disclosure further includes:
[0090] Mark the relationship type and the direction information of each routing segment on the routing segment.
[0091] Among them, the relationship type of the routing segment includes topology type, cross - type, port protection group type, cascade cross - type, etc.
[0092] In addition, mapping cut - over, alarm information, and the direction information of each routing segment can be added to the generated topology graph according to requirements.
[0093] Based on the above - mentioned embodiments, Figure 2 is the structural schematic diagram of a topology graph generation device for routing data provided by the embodiments of the present disclosure. As Figure 2 shown, the topology graph generation device for routing data includes:
[0094] A data import module 210, configured to import the routing data into a graph database, where the routing data includes ports, routing segments, the weight information of the routing segments, and the ports included in the network elements;
[0095] An initial path determination module 220, configured to determine the source - end port and the destination - end port according to the service type to which the routing data belongs, and determine the initial path included between the source - end port and the destination - end port, where the initial path includes a key initial path and a non - key initial path;
[0096] A sorting module 230, configured to process the initial paths to obtain target paths and the arrangement order of each target path;
[0097] An arrangement position determination module 240, configured to determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong;
[0098] A topology graph generation module 250, configured to generate a topology graph of the routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
[0099] The topology graph generation device for routing data provided by the embodiments of the present disclosure first imports the routing data into a graph database; then determines a source - end port and a destination - end port according to the service type to which the routing data belongs, and determines the initial paths included between the source - end port and the destination - end port; processes the initial paths to obtain target paths and the arrangement order of each target path; and determines the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong; finally, generates a topology graph of the routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element. By the determined source - end port and destination - end port, the target paths between the source - end port and the destination - end port can be found. Without relying on the segment group order attribute in the routing data, a complete routing path can be concatenated according to the connection relationship of the ports. Moreover, since the target paths found according to the source - end port and the destination - end port have the arrangement order of the ports, after determining the arrangement order between each target path, the arrangement positions of each network element and the arrangement positions of the ports included in each network element can be determined according to the arrangement order between each target path and the sorting order of each port on each target path, and then a topology graph of the routing data is generated.
[0100] In a specific implementation manner, determining the initial paths included between the source - end port and the destination - end port includes:
[0101] Determining the key initial paths included between the source - end port and the destination - end port according to the shortest - path search algorithm;
[0102] Taking the source - end port and the destination - end port as starting points respectively, and taking the ports not covered in the key initial paths as ending points, to determine non - key initial paths.
[0103] In a specific implementation manner, determining the key initial paths included between the source - end port and the destination - end port according to the shortest - path search algorithm includes:
[0104] Determine the first shortest path between the source port and the destination port according to the port, the routing segment, and the weight information of the routing segment;
[0105] After increasing the weight information of the routing segments included in the first shortest path between the source port and the destination port to the preset weight information, search for the second shortest path between the source port and the destination port. After the Nth shortest path between the source port and the destination port is found for the Nth time, if the first shortest path between the source port and the destination port is found again, then the first shortest path to the Nth shortest path are the key initial paths between the source port and the destination port, where the i-th shortest path includes at least one port that is not covered in any of the first shortest path to the (i - 1)-th shortest path, and i is an integer greater than 1 and less than or equal to N.
[0106] In a specific implementation manner, the processing the initial path to obtain the target path and the arrangement order of each target path includes:
[0107] Perform duplicate removal processing on the initial path to obtain the target path;
[0108] Determine the initial arrangement order of each target path according to the weight information of the routing segments included in each target path;
[0109] Adjust the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order.
[0110] In a specific implementation manner, the adjusting the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order includes:
[0111] Determine the intimacy information of any two target paths according to the number of identical ports and the number of ports with a connection relationship included in any two target paths in the initial arrangement order;
[0112] Adjust the initial arrangement order of each target path according to the intimacy information of any two target paths in the initial arrangement order to obtain the target arrangement order of each target path.
[0113] In a specific implementation manner, the determining the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the arrangement order of each target path, the ports included in each target path, the sorting of the ports included in each target path, and the network elements to which the ports included in each target path belong includes:
[0114] Determine the arrangement positions of each network element and the arrangement positions of the ports included in each network element according to the ports included in each target path, the sorting of the ports included in each target path, and the network element to which the ports included in each target path belong;
[0115] Determine the horizontal coordinate positions of the ports included in each network element according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element;
[0116] Determine the vertical coordinate positions of the ports included in each network element according to the arrangement order of each target path.
[0117] In a specific embodiment, it further includes:
[0118] Mark the relationship type and direction information of each routing segment on the routing segment.
[0119] The embodiment of the present application also provides a computer device. For details, please refer to Figure 3 , Figure 3 which is the basic structure block diagram of the computer device in this embodiment.
[0120] The computer device includes a memory 510 and a processor 520 that communicate with each other through a system bus. It should be noted that only the computer device with components 510 - 520 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0121] The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touchpad or a voice control device, etc.
[0122] The memory 510 includes at least one type of readable storage medium, and the readable storage medium includes non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disc, etc. The RAM may include static RAM or dynamic RAM. In some embodiments, the memory 510 may be an internal storage unit of the computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory 510 may also be an external storage device of the computer device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device. Of course, the memory 510 may also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the memory 510 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 510 may also be used to temporarily store various data that have been output or will be output.
[0123] The processor 520 is generally used to execute the overall operations of the computer device. In this embodiment, the memory 510 is used to store program code or instructions, and the program code includes computer operation instructions. The processor 520 is used to execute the program code or instructions stored in the memory 510 or process data, such as running the program code of the above method.
[0124] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure to represent it, but it does not mean that there is only one bus or one type of bus.
[0125] Another embodiment of the present application further provides a computer-readable medium, which can be a computer-readable signal medium or a computer-readable medium. The processor in the computer reads the computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or the combination of steps in the above method; and generate a device that implements the functional actions specified in each block or the combination of blocks in the block diagram.
[0126] The computer-readable medium includes but is not limited to electronic, magnetic, optical, electromagnetic, infrared memories or semiconductor systems, devices or apparatuses, or any suitable combination of the foregoing. The memory is used to store program codes or instructions, and the program codes include computer operation instructions. The processor is used to execute the program codes or instructions of the above method stored in the memory.
[0127] For the definitions of the memory and the processor, reference can be made to the description of the foregoing computer device embodiments, and details are not described herein again.
[0128] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical or other forms.
[0129] In each embodiment of the present application, each functional unit or module can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0130] When an 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 storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
[0131] Unless the context clearly indicates otherwise, the singular forms of the words used in this specification and the appended claims include the plural, and vice versa. Thus, when referring to the singular, the plural of the corresponding term is usually included. Similarly, the terms "comprising" and "including" shall be interpreted as inclusive rather than exclusive. Likewise, the term "including" and "or" shall be interpreted as inclusive, unless such an interpretation is explicitly prohibited in this specification. Where the term "example" is used in this specification, especially when it is located after a group of terms, the said "example" is merely illustrative and explanatory and should not be considered exclusive or extensive.
[0132] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that the various aspects of this application can be implemented alone or in combination with one or more other aspects. It should also be understood that the description herein and the specific embodiments are for illustrative purposes only and are not intended to limit the scope of this application.
[0133] The above has described several embodiments of the present disclosure in detail. However, obviously, those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the appended claims.
Claims
1. A method for generating a topological graph of routing data, characterized in that: include: Importing routing data into a graph database, wherein the routing data includes ports, routing segments, weight information of routing segments, and ports included in network elements; According to the service type to which the routing data belongs, the source port and the sink port are determined, and according to the port, the routing segment and the weight information of the routing segment, the first shortest path between the source port and the sink port is determined, and after the weight information of the routing segment included in the first shortest path between the source port and the sink port is increased to the preset weight information, the second shortest path between the source port and the sink port is found, and after the Nth shortest path between the source port and the sink port is found for the Nth time, the first shortest path between the source port and the sink port is found again, then the first shortest path to the Nth shortest path is the critical initial path between the source port and the sink port, and the non-critical initial path is determined with the source port and the sink port as the starting point and the port not covered in the critical initial path as the end point, respectively, wherein the i-th shortest path includes at least one port not covered in the first shortest path to the i-1-th shortest path, i is an integer greater than 1 and less than or equal to N, and the initial path includes the critical initial path and the non-critical initial path; Deduplication processing is performed on the initial paths to obtain target paths, and an initial arrangement order of each target path is determined according to weight information of routing segments included in each target path, and intimacy information of any two target paths is determined according to the number of identical ports included in any two target paths under the initial arrangement order and the number of ports having a connection relationship, and the initial arrangement order of each target path is adjusted according to the intimacy information of any two target paths under the initial arrangement order to obtain a target arrangement order of each target path; Determine the arrangement position of each network element and the arrangement position of the ports included in each network element according to the ports included in each target path, the order of the ports included in each target path, and the network elements to which the ports included in each target path belong, and determine the horizontal coordinate position of the ports included in each network element according to the arrangement position of each network element and the arrangement position of the ports included in each network element, and determine the vertical coordinate position of the ports included in each network element according to the arrangement order of each target path; A topology diagram of routing data is generated according to the arrangement positions of the network elements and the arrangement positions of the ports included in the network elements.
2. The method according to claim 1, characterized in that Also includes: The relationship type of each routing segment and the direction information of each routing segment are marked on the routing segment.
3. A device for generating a topological map of routing data, characterized in that: include: A data import module, used to import routing data into a graph database, wherein the routing data includes ports, routing segments, weight information of routing segments, and ports included in network elements; An initial path determination module, used to determine a source port and a sink port according to a service type to which the routing data belongs, and determine a first shortest path between the source port and the sink port according to ports, routing segments and weight information of the routing segments, and after increasing the weight information of the routing segments included in the first shortest path between the source port and the sink port to a preset weight information, find a second shortest path between the source port and the sink port, and after finding the Nth shortest path between the source port and the sink port for the Nth time, find the first shortest path between the source port and the sink port again, then the first shortest path to the Nth shortest path is a critical initial path between the source port and the sink port, and determine a non-critical initial path with the source port and the sink port as starting points and a port not covered in the critical initial path as an end point, respectively, wherein the i-th shortest path includes at least one port not covered in the first shortest path to the i-1-th shortest path, i is an integer greater than 1 and less than or equal to N, and the initial path includes a critical initial path and a non-critical initial path; A sorting module is used to perform deduplication processing on the initial paths to obtain target paths, and determine the initial arrangement order of each target path according to the weight information of the routing segments included in each target path, and determine the intimacy information of any two target paths according to the number of the same ports included in any two target paths under the initial arrangement order and the number of ports with a connection relationship, and adjust the initial arrangement order of each target path according to the intimacy information of any two target paths under the initial arrangement order to obtain the target arrangement order of each target path; An arrangement position determination module is used to perform deduplication processing on the initial paths to obtain target paths, and determine the initial arrangement order of each target path according to the weight information of the routing segments included in each target path, and determine the intimacy information of any two target paths according to the number of identical ports included in any two target paths under the initial arrangement order and the number of ports having a connection relationship, and adjust the initial arrangement order of each target path according to the intimacy information of any two target paths under the initial arrangement order to obtain the target arrangement order of each target path; The topology map generating module is used to generate a topology map of routing data according to the arrangement positions of each network element and the arrangement positions of the ports included in each network element.
4. A computer device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 2 is implemented.
Citation Information
Patent Citations
Optical transport network routing calculation method and device, and computer readable storage medium
CN113873359A
Route search method, device and equipment based on topology route and medium
CN114422885A