Topological graph verification method and device, equipment, storage medium and program product
By constructing a directed topology graph and using in-degree values to identify problem nodes, the problem of low efficiency and insufficient accuracy of existing topology graph verification is solved, achieving efficient and accurate topology graph verification, and improving user experience and the accuracy of marketing decisions.
Patent Information
- Application Number
- CN202411540031.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-12-12
AI Technical Summary
Existing topology verification methods are inefficient and inaccurate. Manual verification is labor-intensive and sampling methods leave errors, affecting user experience and marketing decisions.
By constructing a directed topology graph, determining the in-degree value of each node, and using the in-degree value to identify problem nodes in the presence of a topology cycle, the vertex sequence of the topology graph is output using an in-degree table algorithm, thereby rapidly improving data analysis efficiency.
It improves the accuracy of topology graph verification results, reduces the cost of manually verifying the entire topology graph, enhances user experience and the accuracy of marketing decisions, and reduces user complaints.
Smart Images

Figure CN121125458A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for verifying topology maps. Background Technology
[0002] Currently, operators need to build home device topology maps for hundreds of millions of users. To ensure the accuracy of these topology maps, they also need to be verified. However, existing verification methods are usually manual, which is inefficient, and random sampling verification methods may leave behind some incorrect topology maps, thus affecting the accuracy of the verification results. Summary of the Invention
[0003] This invention provides a method, apparatus, device, storage medium, and program product for verifying topology graphs, in order to overcome the shortcomings of low accuracy in manual verification of topology graphs in the prior art and improve the accuracy of topology graph verification results.
[0004] This invention provides a method for verifying a topology graph, comprising the following steps: Based on the topology graph, construct the directed topology graph from the data. Determine the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of all edges in the directed topology graph that point to that node; In the case where a topological cycle exists in the directed topological graph, the problem node in the directed topological graph is determined based on the in-degree value of each node in the topological cycle.
[0005] According to a method for verifying a topology graph provided by the present invention, the method further includes: determining whether the directed topology graph contains a topology cycle; the determination of whether the directed topology graph contains a topology cycle includes: Select a node with an in-degree of 0 from the directed topology graph and add it to a preset list; In the directed topology graph, the nodes with an in-degree value of 0 and their out-degree edges are deleted to obtain a new directed topology graph. Update the in-degree value of each node in the new directed topology graph; The process iterates through the new directed topology graph, selecting a node with an in-degree of 0 and adding it to the preset list until there are no more nodes with an in-degree of 0 in the new directed topology graph, and then outputs the preset list. If the number of nodes in the preset list is less than the original number of nodes in the directed topology graph, then it is determined that the directed topology graph contains the topological cycle.
[0006] According to a method for verifying a topology graph provided by the present invention, determining the problem node in the directed topology graph based on the in-degree value of each node in the topology ring includes: Determine the original in-degree and current in-degree of each node in the topological ring; the original in-degree is the in-degree of the node in the directed topological graph; the current in-degree is the in-degree of the node in the topological ring. The nodes in the topological ring whose original in-degree value and current in-degree value are inconsistent are designated as the problem nodes.
[0007] According to a method for verifying a topology graph provided by the present invention, determining the in-degree value of each node in the directed topology graph includes: Determine the triple array of the directed topological graph; the triple array includes a vertex set, an arc set, and an association function; the vertex set represents the set of all nodes in the directed topological graph, and the arc set represents the set of all directed edges in the directed topological graph; Traverse each arc in the arc set, and obtain the start and end points of each arc from the vertex set using the association function; Based on the start and end points of each arc, the number of arcs ending at the target node is determined, and the in-degree value of each node in the directed topology graph is obtained; the target node is any node in the directed topology graph.
[0008] According to a method for verifying a topology graph provided by the present invention, the step of constructing a directed topology graph based on topology graph construction data includes: Data is constructed based on the topology graph to determine multiple nodes and the connection relationships between them; Based on the connection relationships between nodes, directed edges are added between each node to construct the directed topology graph.
[0009] According to a method for verifying a topology graph provided by the present invention, the method further includes: If the directed topology graph includes a single node, then the single node is taken as the problem node.
[0010] The present invention also provides a topology graph verification device, comprising the following modules: The directed topology graph construction module is used to construct a directed topology graph based on the topology graph construction data. The in-degree value determination module is used to determine the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of all edges in the directed topology graph pointing to that node; The topology graph verification module is used to determine the problematic nodes in the directed topology graph based on the in-degree values of each node in the topology cycle when a topology cycle exists in the directed topology graph.
[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the topology map verification method as described above.
[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the topology graph verification method as described above.
[0013] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a topology graph verification method as described above.
[0014] The present invention provides a method, apparatus, device, storage medium, and program product for verifying topology graphs. It constructs a directed topology graph based on topology graph construction data; determines the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of edges pointing to that node in the directed topology graph; and, in the case of a topological cycle in the directed topology graph, identifies problematic nodes in the directed topology graph based on the in-degree values of nodes in the topological cycle. This invention reduces the human effort required for manually verifying the accuracy of the entire topology graph when a topological cycle exists, saving costs. Simultaneously, it improves the accuracy of the topology graph verification results, thereby enhancing user experience and reducing user complaints. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating the topology graph verification method provided by the present invention.
[0017] Figure 2 This is one of the schematic diagrams of the directed topology graph provided by the present invention.
[0018] Figure 3 This is the second schematic diagram of the directed topology graph provided by the present invention.
[0019] Figure 4 This is a schematic diagram of the topological sorting provided by the present invention.
[0020] Figure 5 This is a schematic diagram of the topological ring after sorting by the in-degree algorithm provided by the present invention.
[0021] Figure 6 This is a flowchart illustrating the method for checking the accuracy of a home device topology map based on topological sorting and in-degree algorithm provided by the present invention.
[0022] Figure 7 This is a schematic diagram of the structure of the topology map verification device provided by the present invention.
[0023] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] In related technologies, there are two main methods for verifying the accuracy of the constructed topology graph: Method 1: Manual verification. When the data volume is small, the entire constructed topology graph is manually verified to analyze the correctness of node relationships. However, given the current data volume of brands and network operators in the ecosystem, manual verification is extremely labor-intensive. An improved approach is sampling verification, which uses statistical sampling for manual verification, reducing manpower investment. However, this method may leave behind some erroneous topology graphs, ultimately affecting subsequent marketing decisions or user experience.
[0026] Method 2: For manual verification, a historical topology comparison method is used. When constructing the first batch of topology maps, a sample of the largest possible size is extracted for manual verification. Subsequent topology map constructions are compared against this historical topology map. Topology maps with discrepancies are then manually analyzed, and the baseline is adjusted. This reduces subsequent manpower input and allows for more timely detection of erroneous topology maps. However, this method also has limitations. Because it relies on sampling, if the initial topology map is incorrect, subsequent topology maps may also be affected. Figure 1 If there is no change, it will lead to this topology. Figure 1 This is incorrect, and if the topology data is updated frequently, a large number of discrepancies in the topology will be generated, which will significantly increase the time and effort required for manual verification.
[0027] To address the aforementioned issues, this invention proposes a method for verifying topological graphs. This method outputs a vertex sequence of the topological graph using an in-degree table algorithm. Then, based on a comparison between the total number of nodes in the vertex sequence and the total number of nodes in the topological graph, it determines whether a topological cycle exists. Using the existence of a topological cycle and the comparison of the in-degree values of each node as the criteria for judging data accuracy can quickly improve overall data analysis efficiency, solve the problem of inaccurate topological graph verification, enhance user experience and the accuracy of marketing decisions, and reduce user complaints.
[0028] The following is combined with Figures 1-8 The present invention describes a method, apparatus, device, storage medium, and program product for verifying topology diagrams.
[0029] Figure 1 This is a flowchart illustrating the topology graph verification method provided by the present invention, as shown below. Figure 1 As shown, the method includes the following: Step 101: Construct a directed topology graph based on the topology graph data.
[0030] Topology graph construction data includes user data, device data, device binding data, and device subscription service data; for operator systems, topology graph construction data also includes gateway broadband information data. A directed topology graph is a graph structure composed of vertices and directed edges, used to represent the relationships between elements, where the directionality of the edges indicates the unidirectionality of the relationship.
[0031] Before constructing a directed topology graph, the data for topology graph construction needs to undergo data aggregation and integration, data cleaning, and other processing. The specific processing operations are as follows: (1) Data aggregation and integration: Aggregate all relevant data needed to construct the topology map, including all user data, routing device and other household small appliance data, device binding data, device ordering business data, etc. If it is an operator system, gateway broadband information data also needs to be aggregated.
[0032] (2) Data Cleaning: For the raw data, clean the data structures and data required to construct the topology map. For example, user data, device data, device relationship data, subscription business data, and device business relationship data need to be cleaned. For general ecosystem brand owners, user data needs to be cleaned, such as user code, mobile phone number, ID card number, province code, and certificate number. Among them, device data includes device code, media access control address (MAC), China Mobile Equipment Identifier (CMEI), serial number (SN), order number, mobile phone number, province code, device type (including routers, small appliances, etc.), and gateway account. Device relationship data is associated with device MAC, CMEI, and SN; business subscription data includes business type, business code, mobile phone number, associated device MAC, and business related data. For operators, specific broadband data also needs to be cleaned, such as broadband account and associated user. The specific node information is summarized in the following table:
[0033] After data aggregation, integration, and cleaning, a directed topology graph is constructed based on the topology graph. In one embodiment, multiple nodes and their connections are determined based on the topology graph; then, directed edges are added between the nodes based on these connections to construct the directed topology graph.
[0034] For example, the steps to construct a directed topology graph include: (1) Define nodes: Construct data based on the topology graph, identify each element, such as device, user or service, and use the identified elements as nodes in the graph. Optionally, a unique identifier and related attributes (such as name, type, etc.) can be assigned to each node.
[0035] (2) Determine the connection relationship: Identify the dependencies between nodes and determine which nodes point to other nodes. At the same time, it is necessary to clarify the direction of each edge, indicating the direction of data or information flow.
[0036] (3) Constructing edges: Based on the relationships identified in step (2), add directed edges for each pair of related nodes. Optionally, a weight value can be assigned to each edge to represent the strength or importance of the relationship.
[0037] (4) Generate graph structure: Use graph theory data structures (such as adjacency matrix or adjacency list) to represent the directed topological graph. At the same time, store the node and edge data in a database or memory for subsequent processing.
[0038] It is understandable that, unlike previous undirected topology graphs, this invention uses a directed topology graph construction method. Starting data is selected, typically using users as the starting node. Based on the cleaned data structure described above, the starting node for topology sorting is first constructed based on user data, with an in-degree value of 0. For the topology graph of the operator system, the next step is to construct home nodes dependent on user nodes based on user data, and then construct the topology graph based on device data and device association data. For ecosystem brand owners, related devices are connected to router gateways, so all other devices can be considered to depend on the router, and a device topology graph is constructed based on this. For operators, there are even more basic devices than routers, such as broadband gateway devices. Therefore, devices of the gateway type can be identified, associated with home addresses through broadband accounts, and then all devices are associated with the broadband gateway, thus constructing a user-device relationship topology graph. Devices are linked through device-device dependencies, such as routers depending on gateways, smart locks depending on routers, etc. Finally, through service subscription data and service device binding relationships, the dependencies between service nodes and device nodes are linked, and dependencies may also exist within the service itself. The household business topology sorting diagram constructed based on the above method is as follows: Figure 2 and Figure 3 As shown.
[0039] for Figure 2 and Figure 3 The two topological maps are easily distinguishable by manual identification. Figure 3 There's a problem. Normally, a router shouldn't be connected to both the gateway and another router. The issue arises because the router's MAC address is linked to the gateway, but the device association data is incorrect, resulting in additional association data mapping to another router.
[0040] Step 102: Determine the in-degree value of each node in the directed topology graph.
[0041] The in-degree value of each node represents the number of edges in the directed graph that point to that node. In other words, in a directed graph, the in-degree value refers to the number of edges a particular node receives, where each edge represents a relationship from other nodes to that node.
[0042] In one embodiment, a triple array of directed topological graphs is determined; the triple array includes a vertex set, an arc set, and an association function; the vertex set represents the set of all nodes in the directed topological graph, and the arc set represents the set of all directed edges in the directed topological graph; then, each arc in the arc set is traversed, and the start and end points of each arc are obtained from the vertex set through the association function; based on the start and end points of each arc, the number of arcs ending at the target node is determined, and the in-degree value of each node in the directed topological graph is obtained.
[0043] For example, the in-degree value of each node in a directed topology graph is determined based on the following method: (1) Define the data structure: A directed topological graph D can be abstracted as a triple array (V(D), A(D), ψD), where V(D) represents a non-empty set of vertices, A(D) represents a set of arcs, and ψD represents an association function, which makes each arc of D correspond to an ordered pair of vertices in D. The specific formula is: ψD(a) = (u, v), then a is called the arc from u to v, u and v are the endpoints of a, u is the head of a, and v is the tail of a. The number of arcs with the in-degree value v of vertex v is: f(v) = count(ψD(a), (X, v)), where X is the node connected to node v.
[0044] (2) Create a dictionary or array in_degree[v] to store the in-degree value of each node, and set the initial in-degree value of each node to 0.
[0045] (3) Traverse the arc set and update the in-degree value: Traverse each arc in the arc set. For each arc, obtain its endpoint (u, v) through the association function, where (u) is the starting point of the arc and (v) is the ending point of the arc. Both the starting point (u) and the ending point (v) belong to the vertex set. For each arc, perform the following operations: Increase the in-degree of the target node (v): in_degree[v] += 1.
[0046] The above method can effectively obtain relevant nodes from the vertex set and accurately update the in-degree value.
[0047] Step 103: If a topological cycle exists in the directed topological graph, determine the problem node in the directed topological graph based on the in-degree value of each node in the topological cycle.
[0048] If a directed topological graph contains a topological cycle, it indicates a problem. In this case, the problematic node in the directed topological graph needs to be identified based on the in-degree values of the nodes in the cycle. It's understandable that in a directed topological graph, topological sorting is a linear sorting method used to arrange the nodes such that for each edge ((u,v)), node (u) appears before node (v) in the sort. If a cycle exists in the graph—that is, if a node can return to itself through a series of edges—an effective topological sort cannot be performed. This indicates a problem with the directed topological graph.
[0049] The topology graph verification method provided in this invention constructs a directed topology graph based on topology graph construction data; determines the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of edges pointing to that node in the directed topology graph; and, in the case of a topological cycle in the directed topology graph, identifies problematic nodes in the directed topology graph based on the in-degree values of the nodes in the topological cycle. This invention, by analyzing the in-degree values of nodes in a directed topology graph containing a topological cycle, reduces the manual effort required to verify the accuracy of the entire topology graph, saving costs. Simultaneously, it improves the accuracy of the topology graph verification results, thereby enhancing user experience and reducing user complaints.
[0050] Based on the above embodiments, determining that the directed topological graph contains a topological cycle includes: Step 310: Select a node with an in-degree value of 0 from the directed topology graph and add it to a preset list; Step 311: In the directed topology graph, delete the nodes with an in-degree value of 0 and their out-degree edges to obtain a new directed topology graph; Step 312: Update the in-degree value of each node in the new directed topology graph; Step 313: Iterate through the new directed topology graph to select a node with an in-degree value of 0 and add it to the preset list until there are no nodes with an in-degree value of 0 in the new directed topology graph, and output the preset list. Step 314: If the number of nodes in the preset list is less than the original number of nodes in the directed topology graph, then it is determined that the directed topology graph contains the topological cycle.
[0051] The steps to determine if a directed topological graph contains a topological cycle include: (1) Selecting nodes with an in-degree of 0: At the beginning of each iteration, select a node with an in-degree of 0 from the list of candidate nodes. These nodes have no other nodes that depend on them, so they can be safely processed first.
[0052] (2) Update the topology sorting results: Add the selected nodes with an in-degree of 0 to the topology sorting results queue.
[0053] (3) Delete the node and its out-degree edges: Remove the node and its out-degree edges from the directed topology graph. The out-degree edges of the node are edges that start from a certain vertex and point to other vertices. For example, refer to Figure 4 The out-degree edges of node A include edge a and edge c; in addition, the following processing is performed on all out-degree edges of this node: For each out-degree edge, decrement the in-degree value of the target node pointed to by that out-degree edge by 1; Check the in-degree value after subtraction. If the in-degree value of the target node becomes 0, add the target node to the candidate node list.
[0054] (4) Check the candidate node list: Continue checking if there are any nodes with an in-degree of 0 available. If so, return to step 1 and continue the loop; if not, and the topology sort result is full, end the loop and output a preset list, which is a directed sequence list. The termination conditions include all nodes have been processed and added to the topology sort result, or no nodes with an in-degree of 0 are available, but unprocessed nodes still exist, indicating that a topological cycle exists in the graph.
[0055] (5) Result verification: Compare the number of nodes in the preset list with the number of nodes in the original graph. If the two are equal, it indicates that the topology sorting is successful and there is no topological cycle in the directed topology graph; if the number of nodes in the topology sorting result is less than the number of nodes in the original graph, it indicates that there is a topological cycle in the directed topology graph.
[0056] For example, with Figure 4 Taking a directed topology graph as an example, the process is as follows: After adding in-degree values to each node, a node with an in-degree of 0 is found in the topologically sorted graph and output to the topological sorting result queue. This node and its out-degree edge are then deleted. Next, nodes with an in-degree of 0 are found in the remaining graph, output to the topological sorting result queue, and their out-degree edges are deleted. This process is repeated until all nodes are output, and a preset list is generated. If the number of nodes in the preset list is less than the original number of nodes in the directed topology graph, it indicates that there are still nodes with a non-zero in-degree in the directed topology graph. Therefore, it can be concluded that a topological cycle exists in the directed topology graph, indicating a problem with the graph.
[0057] This invention employs an in-degree algorithm to output a topological sequence based on a directed topological graph. The existence of a topological cycle is determined by comparing the output topological sequence with the original set, thereby assessing the accuracy of the directed topological graph. This method improves the efficiency of topological graph accuracy assessment, enhances the accuracy of marketing promotions, avoids presenting users with incorrect topological graphs, and reduces user complaints.
[0058] Based on the above embodiments, determining the problem node in the directed topology graph according to the in-degree value of each node in the topology ring includes: Step 320: Determine the original in-degree value and the current in-degree value of each node in the topology ring; the original in-degree value is the in-degree value of the node in the directed topology graph; the current in-degree value is the in-degree value of the node in the topology ring. Step 321: The nodes in the topological ring whose original in-degree value and current in-degree value are inconsistent are identified as the problem nodes.
[0059] For directed topology graphs with problems, it is necessary to output the problematic nodes to facilitate manual troubleshooting. This embodiment of the invention uses a comparison of the in-degree values of the directed topology graph before and after outputting the directed sequence list to find problematic nodes. (Reference) Figure 5 The algorithm iterates through the nodes of the topological graph following the directed sequence list. If the original in-degree of a node is not equal to its current in-degree, then that node is the problem node; otherwise, it iterates until the problem node is found. Figure 5 As shown in the directed topology graph, the problem node is node D. Figure 5 In this diagram, node A represents a person, node B represents a home, node C represents a gateway, node D represents router 1, node E represents router 2, and node F represents router 3. The in-degree values of the nodes in the directed topology graph before and after the output directed sequence list are shown in the table below:
[0060] The output topology sequence is: [person, home, gateway], and the original set of the directed topology graph is: [person, home, gateway, router 1, router 2, router 3]. Therefore, the number of nodes output by the topology sort is less than the number of nodes in the original set of the directed topology graph, indicating that there are still nodes in the directed topology graph with a non-zero in-degree. Figure 5 In the graph, node D has an original in-degree of 2 and a current in-degree of 1, indicating that the problematic node in the directed topology is router 1.
[0061] If a directed topology graph includes a single node, that single node is designated as a problem node. For example, if a directed topology graph starts with a single node, such as a single router or a single service node, that node is directly marked as a problem node and pushed to a human for judgment.
[0062] Finally, based on the problem nodes, the complete proportion of devices and services, and the overall correlation are statistically analyzed, which serve as the evaluation criteria for data governance and the basis for marketing promotion.
[0063] This invention, based on directed topological cycles, analyzes and identifies problem nodes by comparing the original and current in-degree values. For cases where the initial topological graph contains only a single node, it directly classifies the node as a problem node, thus improving the in-degree algorithm. This method of identifying problem nodes reduces the manual effort required to verify the accuracy of the entire topological graph, saving costs while simultaneously improving the accuracy of topological graph verification.
[0064] To further explain the topology graph verification method proposed in this invention, please refer to... Figure 6 and the following examples.
[0065] This invention specifically proposes a method for checking the accuracy of a home device topology map based on topological sorting and in-degree algorithm, including the following steps: (1) Data aggregation; (2) Single-dimensional data quality analysis; (3) Data cleaning; (4) Construct a directed topological graph; (5) Calculate the in-degree value of the node and the set of all nodes according to the in-degree algorithm; (6) Using the in-degree value of 0 as the starting node, output the directed sequence list; (7) Compare the directed sequence list with the set of all nodes to find the topological cycle and determine the accuracy of the directed topological graph; (8) Compare the original in-degree value and the current in-degree value in the topological cycle to determine the problem node; (9) Statistical analysis of problem nodes and governance assessment; (10) Topology graph tags are stored in the database.
[0066] This invention employs a directed topology graph method to construct a topology graph. Based on the in-degree algorithm, a topology sequence is output from this graph, revealing the problematic topology cycle. Compared to manual inspection, this method is more accurate and efficient. Compared to historical topology data comparison, this invention applies a wider range of data. By improving the in-degree algorithm and comparing the original and current in-degree values, problematic nodes within the topology cycle are identified. This method is more efficient and accurate than manual node inspection, more comprehensive than sampling inspection, and applies a larger data scale than historical data comparison. Data results derived from the overall topology graph analysis are of higher quality than those from single-dimensional analysis, and the problems exposed are more intuitive. Furthermore, it is more efficient than single-dimensional data analysis, providing a more direct basis for promoting data governance.
[0067] The topology graph verification device provided by the present invention will be described below. The topology graph verification device described below can be referred to in correspondence with the topology graph verification method described above.
[0068] refer to Figure 7 The topology graph verification device provided by the present invention includes a directed topology graph construction module 701, an in-degree value determination module 702, and a topology graph verification module 703.
[0069] The directed topology graph construction module 701 is used to construct a directed topology graph based on the topology graph construction data. The in-degree value determination module 702 is used to determine the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of all edges in the directed topology graph pointing to that node; The topology graph verification module 703 is used to determine the problematic nodes in the directed topology graph based on the in-degree values of each node in the topology cycle when a topology cycle exists in the directed topology graph.
[0070] The topology graph verification device provided in this invention constructs a directed topology graph based on topology graph construction data; determines the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of edges pointing to that node in the directed topology graph; and, in the case of a topological cycle in the directed topology graph, identifies problematic nodes in the directed topology graph based on the in-degree values of the nodes in the topological cycle. This invention, by analyzing the in-degree values of nodes in a directed topology graph containing a topological cycle, reduces the manual effort required to verify the accuracy of the entire topology graph, saving costs. Simultaneously, it improves the accuracy of the topology graph verification results, thereby enhancing user experience and reducing user complaints.
[0071] In one embodiment, the topology graph verification module 703 is further configured to: Select a node with an in-degree of 0 from the directed topology graph and add it to a preset list; In the directed topology graph, the nodes with an in-degree value of 0 and their out-degree edges are deleted to obtain a new directed topology graph. Update the in-degree value of each node in the new directed topology graph; The process iterates through the new directed topology graph, selecting a node with an in-degree of 0 and adding it to the preset list until there are no more nodes with an in-degree of 0 in the new directed topology graph, and then outputs the preset list. If the number of nodes in the preset list is less than the original number of nodes in the directed topology graph, then it is determined that the directed topology graph contains the topological cycle.
[0072] In one embodiment, the topology graph verification module 703 is specifically used for: Determine the original in-degree and current in-degree of each node in the topological ring; the original in-degree is the in-degree of the node in the directed topological graph; the current in-degree is the in-degree of the node in the topological ring. The nodes in the topological ring whose original in-degree value and current in-degree value are inconsistent are designated as the problem nodes.
[0073] In one embodiment, the in-degree value determination module 702 is specifically used for: Determine the triple array of the directed topological graph; the triple array includes a vertex set, an arc set, and an association function; the vertex set represents the set of all nodes in the directed topological graph, and the arc set represents the set of all directed edges in the directed topological graph; Traverse each arc in the arc set, and obtain the start and end points of each arc from the vertex set using the association function; Based on the start and end points of each arc, the number of arcs ending at the target node is determined, and the in-degree value of each node in the directed topology graph is obtained; the target node is any node in the directed topology graph.
[0074] In one embodiment, the directed topology graph construction module 701 is specifically used for: Data is constructed based on the topology graph to determine multiple nodes and the connection relationships between them; Based on the connection relationships between nodes, directed edges are added between each node to construct the directed topology graph.
[0075] In one embodiment, the topology graph verification module 703 is further configured to: If the directed topology graph includes a single node, then the single node is taken as the problem node.
[0076] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute a topology graph verification method. This method includes: constructing a directed topology graph based on topology graph construction data; determining the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of edges pointing to that node in the directed topology graph; and, if a topology cycle exists in the directed topology graph, determining the problematic node in the directed topology graph based on the in-degree values of the nodes in the topology cycle.
[0077] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0078] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the topology graph verification method provided by the above methods. The method includes: constructing a directed topology graph based on topology graph construction data; determining the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of edges pointing to that node in the directed topology graph; and, in the case that a topology cycle exists in the directed topology graph, determining the problem node in the directed topology graph based on the in-degree value of each node in the topology cycle.
[0079] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for verifying a topology graph provided by the methods described above. This method includes: constructing a directed topology graph based on topology graph construction data; determining the in-degree value of each node in the directed topology graph; the in-degree value of each node representing the number of edges pointing to that node in the directed topology graph; and, in the case of a topology cycle in the directed topology graph, determining a problem node in the directed topology graph based on the in-degree values of nodes in the topology cycle.
[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for verifying a topology graph, characterized in that, include: Based on the topology graph, construct the directed topology graph from the data. Determine the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of all edges in the directed topology graph that point to that node; In the case where a topological cycle exists in the directed topological graph, the problem node in the directed topological graph is determined based on the in-degree value of each node in the topological cycle.
2. The method for verifying a topology graph according to claim 1, characterized in that, The method further includes: determining whether the directed topological graph contains a topological cycle; Determining whether the directed topological graph contains a topological cycle includes: Select a node with an in-degree of 0 from the directed topology graph and add it to a preset list; In the directed topology graph, the nodes with an in-degree value of 0 and their out-degree edges are deleted to obtain a new directed topology graph. Update the in-degree value of each node in the new directed topology graph; The process iterates through the new directed topology graph, selecting a node with an in-degree of 0 and adding it to the preset list until there are no more nodes with an in-degree of 0 in the new directed topology graph, and then outputs the preset list. If the number of nodes in the preset list is less than the original number of nodes in the directed topology graph, then it is determined that the directed topology graph contains the topological cycle.
3. The method for verifying topology graphs according to claim 2, characterized in that, The step of determining the problem node in the directed topology graph based on the in-degree value of each node in the topology ring includes: Determine the original in-degree and current in-degree of each node in the topological ring; the original in-degree is the in-degree of the node in the directed topological graph; the current in-degree is the in-degree of the node in the topological ring. The nodes in the topological ring whose original in-degree value and current in-degree value are inconsistent are designated as the problem nodes.
4. The method for verifying a topology graph according to claim 1, characterized in that, Determining the in-degree value of each node in the directed topology graph includes: Determine the triple array of the directed topological graph; the triple array includes a vertex set, an arc set, and an association function; the vertex set represents the set of all nodes in the directed topological graph, and the arc set represents the set of all directed edges in the directed topological graph; Traverse each arc in the arc set, and obtain the start and end points of each arc from the vertex set using the association function; Based on the start and end points of each arc, the number of arcs ending at the target node is determined, and the in-degree value of each node in the directed topology graph is obtained; the target node is any node in the directed topology graph.
5. The method for verifying a topology graph according to claim 1, characterized in that, The step of constructing a directed topological graph based on the topological graph data includes: Data is constructed based on the topology graph to determine multiple nodes and the connection relationships between them; Based on the connection relationships between nodes, directed edges are added between each node to construct the directed topology graph.
6. The method for verifying a topology graph according to claim 1, characterized in that, The method further includes: If the directed topology graph includes a single node, then the single node is taken as the problem node.
7. A topology graph verification device, characterized in that, include: The directed topology graph construction module is used to construct a directed topology graph based on the topology graph construction data. The in-degree value determination module is used to determine the in-degree value of each node in the directed topology graph; the in-degree value of each node represents the number of all edges in the directed topology graph pointing to that node; The topology graph verification module is used to determine the problematic nodes in the directed topology graph based on the in-degree values of each node in the topology cycle when a topology cycle exists in the directed topology graph.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for verifying the topology graph as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for verifying the topology graph as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for verifying the topology graph as described in any one of claims 1 to 6.