Cloud network resource tree auditing method and device
Through the depth-first search and backtracking algorithm, the resource tree routing diagram is traversed, which solves the problems of low flexibility and low efficiency of traditional audit methods, and realizes efficient audit of complex network topology diagrams.
Patent Information
- Application Number
- CN202411677118.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-25
AI Technical Summary
The traditional resource tree routing auditing method based on metadata model has problems such as high labor cost, low flexibility and low audit efficiency, and cannot quickly and accurately perform circuit routing topology audits.
Depth priority search and backtracking algorithm are used to traverse all nodes and paths in the resource tree routing graph, and abstract the resource tree data into the resource tree routing graph through preset verification rules, remove useless nodes and define the starting point and end point equipment to realize auditing.
It improves audit efficiency, reduces the risk of omissions and errors, enhances the flexibility and adaptability of audits, and can handle complex network topology maps.
Smart Images

Figure CN119520388A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network topology management, and in particular relates to a cloud network resource tree auditing method and device. Background Art
[0002] In the context of enterprise cloud transformation and digital transformation, promoting the rapid listing, efficient acceptance and reliable guarantee of resource products is an urgent problem that enterprises need to solve.
[0003] In the traditional mode of routing audit based on metadata model resource tree, the current problem is that there are not many traditional ways to audit routing. Circuit data based on metadata model is stored in the database, and generally audit and verify by handwriting SQL by DBA, which has high labor costs. Secondly, the traditional way of auditing routing is single and has low flexibility. It is cumbersome to handle for multiple products and scenarios of cloud network, and is basically implemented by hard SQL or hard code, resulting in low audit efficiency and inability to quickly and accurately audit circuit routing topology. Summary of the invention
[0004] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a cloud network resource tree auditing method and device.
[0005] A first aspect of the present invention provides a cloud network resource tree auditing method, comprising:
[0006] S1: receiving resource tree data;
[0007] S2: abstracting the resource tree data into a resource tree routing graph according to a preset verification rule;
[0008] S3: Traverse all nodes and paths in the resource tree routing graph based on a depth-first search and backtracking algorithm to complete the audit.
[0009] According to a cloud network resource tree auditing method provided by the present invention, the resource tree data in step S1 is a network topology diagram of the cloud network to be audited.
[0010] According to a cloud network resource tree auditing method provided by the present invention, the network topology diagram includes device labels, device IDs, and link labels.
[0011] According to a cloud network resource tree auditing method provided by the present invention, step S2 further includes:
[0012] S21: according to the received resource tree data, removing useless nodes in the resource tree data to obtain pre-processed resource tree data;
[0013] S22: defining a starting point device and an end point device by the pre-processed resource tree data;
[0014] S23: Based on the verification rule, the pre-processed resource tree data is defined as a line object according to the starting point device and the end point device to obtain a resource tree routing graph including a plurality of line objects.
[0015] According to a cloud network resource tree auditing method provided by the present invention, the line object in step S22 includes a link label, a link ID, device labels at both ends of the link, and device IDs at both ends of the link.
[0016] According to a cloud network resource tree auditing method provided by the present invention, step S3 further includes:
[0017] S31: The starting device sequentially traverses the resource tree routing map according to the traversal rule; when the device tag of the end device contains a single device ID, step S32 is executed; when the device tag of the end device contains multiple device IDs, step S33 is executed;
[0018] S32: Record the current traversal path and trace back to the untraversed devices to perform sequential traversal until all devices in the resource tree routing map are traversed;
[0019] S33: Check whether the device ID of the currently examined line object is the device ID of the endpoint device. If the match fails, continue to traverse in sequence according to the device ID of the currently examined line object; if the match succeeds, execute step S32.
[0020] According to a cloud network resource tree audit method provided by the present invention, the traversal rules in step S31 include:
[0021] When the number of connected lines in the currently examined line object is 1, the audit is recursively performed on the subsequent line objects;
[0022] When the number of connection lines in the currently inspected line object is greater than 1, they are audited separately according to the number of connection lines. The device ID of each audit is unique, and the audit is recursively applied to subsequent line objects.
[0023] A second aspect of the present invention provides a cloud network resource tree auditing device, comprising:
[0024] Receiving module: used to receive resource tree data;
[0025] Abstraction module: used for abstracting the resource tree data into a resource tree routing graph according to preset verification rules;
[0026] Traversal module: used to traverse all nodes and paths in the resource tree routing graph based on depth-first search and backtracking algorithm to complete the audit.
[0027] A third aspect of the present invention provides a cloud network resource tree auditing device, comprising:
[0028] A memory and at least one processor, wherein instructions are stored in the memory;
[0029] The processor calls the instructions in the memory to enable the cloud network resource tree auditing device to execute the cloud network resource tree auditing method as described in any one of the above items.
[0030] A fourth aspect of the present invention provides a computer-readable storage medium having instructions stored thereon, and when the instructions are executed by a processor, a cloud network resource tree auditing method as described in any one of the above items is implemented.
[0031] The present invention provides a cloud network resource tree audit method, device, equipment and storage medium. By receiving resource tree data and abstracting it into a resource tree routing diagram according to verification rules, useless nodes are effectively removed, the complexity of network topology is simplified, and the efficiency of subsequent audits is improved. The present invention traverses the resource tree routing diagram based on depth-first search and backtracking algorithms, which can ensure that all nodes and paths are fully and accurately audited, reducing the risk of omissions and errors; at the same time, the present invention converts the pre-processed resource tree data into line objects, so that the audit process can flexibly adjust the starting point and end point according to different audit requirements, further enhancing the flexibility and adaptability of the audit; in addition, the present invention can process a network topology diagram containing multiple devices, links and complex connection relationships, and through the definition of line objects, the connection relationship between devices is clearly represented, providing strong support for the audit; during the traversal process, when multiple connection lines are encountered, the present invention can audit each connection line separately, and ensure that the device ID of each audit is unique, so that the audit process can cope with multiple paths and parallel connections in complex network topologies. The audit method of the present invention has clear execution logic, is easy to understand and implement, and based on the present invention, can be integrated with other network management systems or platforms to achieve broader and deeper network resource management and monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0033] Figure 1 A schematic diagram of a cloud network resource tree auditing method provided by an embodiment of the present invention;
[0034] Figure 2 A schematic diagram of the structure of a cloud network resource tree auditing device provided by an embodiment of the present invention; Figure 3A schematic diagram of a network topology diagram of a cloud network to be audited provided in an embodiment of the present invention; Figure 4 A schematic diagram of a resource tree routing diagram after abstraction of a network topology diagram provided in an embodiment of the present invention.
[0035] Reference numerals:
[0036] 100, receiving module; 200, abstract module; 300, traversal module. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0038] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0039] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0040] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0041] In order to better understand the present invention, the terms appearing in the embodiments of the present invention are first explained below.
[0042] Resource tree data: a unified JSON structure designed based on a unified model. Based on attribute specifications, it is divided into three categories: nodes, links, and relations. The nodes array contains entity data other than the cm_link stored in the model, links contains the data stored in cm_link in the model, and relations is the relationship data between entities.
[0043] Routing topology: refers to the abstract diagram composed of the networking of a type of product, which is generally a network topology formed by points and lines similar to device-link-device.
[0044] Combine the following Figures 1 to 4 Embodiments of the present invention are described.
[0045] like Figure 1 As shown, the first aspect of the present invention provides a cloud network resource tree audit method, comprising:
[0046] S1: Receive resource tree data.
[0047] The resource tree data in step S1 is a network topology diagram of the cloud network to be audited.
[0048] The network topology diagram includes device labels, device IDs, and link labels.
[0049] In step S1, the basic network topology diagram is mainly analyzed, such as Figure 3 As shown, by analyzing the network topology diagram, it can be seen that A1 and A2 are both A devices, and the link between A1-A2 is optional and can be directly from AB devices. There is a line between A1 and A2 devices. There may be multiple lines from A2 to B device, and there will only be one line from B to U1. Since U1-U2-U3 are all U devices, they can be configured as U device-U device.
[0050] S2: abstracting the resource tree data into a resource tree routing graph according to preset verification rules.
[0051] Wherein, step S2 further comprises:
[0052] S21: According to the received resource tree data, useless nodes in the resource tree data are removed to obtain pre-processed resource tree data.
[0053] S22: defining a starting point device and an end point device according to the pre-processed resource tree data.
[0054] The line object in step S22 includes a link label, a link ID, device labels at both ends of the link, and device IDs at both ends of the link.
[0055] S23: Based on the verification rule, the pre-processed resource tree data is defined as a line object according to the starting point device and the end point device to obtain a resource tree routing graph including a plurality of line objects.
[0056] In step S2, after the resource tree data is obtained in step S1, the rules are taken out from the library, and the starting point device is obtained first, for example, the id of the starting point A1 device and the id of the end point U3 device are obtained in this embodiment.
[0057] Subsequently, the resource tree data is pruned. Since the resource tree data contains a large number of nodes that are not used in the routing series, a line object is defined to record only the link label, link ID, device labels at both ends, and device IDs at both ends. The resource tree is first converted into a collection of line objects, that is, the network topology diagram in step S1 can be abstracted as follows: Figure 4 The verification rule configuration diagram is shown.
[0058] S3: Traverse all nodes and paths in the resource tree routing graph based on a depth-first search and backtracking algorithm to complete the audit.
[0059] Wherein, step S3 further comprises:
[0060] S31: The starting device sequentially traverses the resource tree routing map according to the traversal rules; when the device tag belonging to the terminal device contains a single device ID, execute step S32; when the device tag belonging to the terminal device contains multiple device IDs, execute step S33.
[0061] The traversal rules in step S31 include:
[0062] When the number of connected lines in the currently examined line object is 1, the audit is recursively performed on the subsequent line objects;
[0063] When the number of connection lines in the currently inspected line object is greater than 1, they are audited separately according to the number of connection lines. The device ID of each audit is unique, and the audit is recursively applied to subsequent line objects.
[0064] S32: Record the current traversal path and trace back to the untraversed devices to perform sequential traversal until all devices in the resource tree routing map are traversed.
[0065] S33: Check whether the device ID of the currently examined line object is the device ID of the endpoint device. If the match fails, continue to traverse in sequence according to the device ID of the currently examined line object; if the match succeeds, execute step S32.
[0066] In the specific embodiment provided by the present invention, based on the obtained rule data, traversal is performed, starting from the first rule line, and the line data collected from 1 is used to search for the line whose A-end id is the id of the A1 device, the link label is the Ethernet link, and the Z-end device label is the A device. The number of lines is counted, which is 1, which meets the condition of 0..n, and continues to recurse to the second rule line.
[0067] With A2 device ID + Ethernet link + Z end label, device B searches for two wires from the wire set. Since the two devices at both ends of the rule are not the same device, if the number of wires of the same device is greater than one, they can only be connected in parallel. Therefore, a new path is separated from here. A1-A2-B1 is path 1, and A1-A2-B2 is path 2. The id of the opposite device in each recursion cannot be repeated. It can be seen that the second rule line is also satisfied, and the recursion continues to the third line.
[0068] With B1 device id + Ethernet link + Z end label being U device, search from the line set and find 1 line (B1-U1), which meets 1 condition, and continue to recurse to the fourth rule line.
[0069] With U1 device id + Ethernet link + Z end label is U device, a line (U1-U2) is found from the line set, which meets the 0..n condition and is the last rule. It will be matched with the end point id to see if it meets the requirement. U2 is not U3. Since the rule is for the same device and is 0..n, there may be the next line. Under the current rule, continue to search recursively. With A end device is U2 device id + Ethernet link + Z end device label is U device, a line (U2-U3) is found from the first set. Compared with the end point id, it meets the requirement. Path 1 is recorded and marked with the verification pass mark to start backtracking.
[0070] Go back to the U device with B2 device id + Ethernet link + Z end label, search from the line set, find 1 line (B2-U1), meet 1 condition, and continue recursively to the fourth rule line.
[0071] With U1 device id + Ethernet link + Z end label is U device, a line (U1-U2) is found from the line set, which meets the 0..n condition and is the last rule. It will be matched with the end point id to see if it meets the requirement. U2 is not U3. Since the rule is for the same device and is 0..n, there may be another line. Under the current rule, continue to search recursively. With A end device is U2 device id + Ethernet link + Z end device label is U device, a line (U2-U3) is found from the first set. Compared with the end point id, it meets the requirement. Path 2 is recorded and marked with a pass mark.
[0072] Since there are no other paths, the recursion ends and the verification is terminated.
[0073] like Figure 2 As shown, the present invention also provides a cloud network resource tree auditing device, comprising:
[0074] Receiving module 100: used to receive resource tree data;
[0075] Abstraction module 200: used to abstract the resource tree data into a resource tree routing graph according to a preset verification rule;
[0076] The traversal module 300 is used to traverse all nodes and paths in the resource tree routing graph based on a depth-first search and backtracking algorithm to complete the audit.
[0077] The present invention also provides a cloud network resource tree auditing device, comprising:
[0078] A memory and at least one processor, wherein instructions are stored in the memory;
[0079] The processor calls the instructions in the memory to enable the cloud network resource tree auditing device to execute the cloud network resource tree auditing method as described in any one of the above items.
[0080] The present invention also provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, a cloud network resource tree auditing method as described in any one of the above items is implemented.
[0081] Furthermore, a cloud network resource tree auditing device provided by the present invention may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU), for example, one or more processors and memories, one or more storage media for storing applications or data, such as one or more massive storage devices, wherein the memories and storage media may be short-term storage or persistent storage, and the program stored in the storage medium may include one or more modules, each module may include a series of instruction operations in the cloud network resource tree auditing device, and further, the processor may be configured to communicate with the storage medium and execute a series of instruction operations in the storage medium on the cloud network resource tree auditing device.
[0082] It may also include one or more power supplies, one or more wired or wireless network interfaces, one or more input and output interfaces, and one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that the cloud network resource tree audit device structure provided by the present invention does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0083] The present invention provides a cloud network resource tree audit method, device, equipment and storage medium, which adopts DFS depth-first search + backtracking algorithm, and complements the verification rule configuration. First, the rule configuration party abstracts the routing topology proposed by the business party into the rules required for the verification rule configuration, and then performs integrity verification on the resource tree path.
[0084] Among them, the DFS depth-first search + backtracking algorithm proposed in the present invention is an algorithm for traversing or searching a tree or graph. DFS traverses nodes along the depth of the tree and searches the branches of the tree as deeply as possible. When the edges of the current node have been explored, the search will backtrack to the starting node of the edge where the current node was found. This process continues until all nodes reachable from the source node have been found. If there are still undiscovered nodes, one of them is selected as the source node and the above process is repeated. The whole process is repeated until all nodes are visited. There are two ways to implement depth-first search, mainly using recursion to implement this method, that is, using a recursive function to implement DFS, and each recursive call visits an unvisited adjacent node.
[0085] The present invention provides a cloud network resource tree audit method, device, equipment and storage medium, which realizes route integrity audit based on topology map data and the algorithm of circuit topology routing concatenation; the present invention implements a stable route integrity audit algorithm into a cloud network resource one-tree-one-map project, adopts a multi-instance mode for deployment, and adopts a divide-and-conquer, multi-threaded mode for development in the project, combines the topology map data with the algorithm, realizes unified resource tree audit, and realizes the business capability accumulation of cloud network resources; the present invention also combines the DFS depth-first search + backtracking algorithm, so that some multi-path, multi-branch route concatenation routes can be retrieved at one time, thereby realizing the stability of business audit capability and the rigor of the product, and significantly improving the audit efficiency; in addition, based on the continuously decoupled and open one-tree-one-map capability, the new circuit topology routing concatenation algorithm uses a unified data language to be designed and assembled from the perspective of easy perception and expansion by customers, and cooperates with the networking mode and dynamic routing configuration rules to quickly realize the configuration of route integrity audit rules.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A cloud network resource tree audit method, characterized in that: include: S1: receiving resource tree data; S2: abstracting the resource tree data into a resource tree routing graph according to a preset verification rule; S3: Traverse all nodes and paths in the resource tree routing graph based on a depth-first search and backtracking algorithm to complete the audit.
2. A cloud network resource tree auditing method according to claim 1, characterized in that: The resource tree data in step S1 is the network topology diagram of the cloud network to be audited.
3. A cloud network resource tree auditing method according to claim 2, characterized in that: The network topology diagram includes device labels, device IDs, and link labels.
4. A cloud network resource tree auditing method according to claim 1, characterized in that: Step S2 further comprises: S21: according to the received resource tree data, removing useless nodes in the resource tree data to obtain pre-processed resource tree data; S22: defining a starting point device and an end point device by the pre-processed resource tree data; S23: Based on the verification rule, the pre-processed resource tree data is defined as a line object according to the starting point device and the end point device to obtain a resource tree routing graph including a plurality of line objects.
5. A cloud network resource tree auditing method according to claim 4, characterized in that: The line object in step S22 includes a link label, a link ID, device labels at both ends of the link, and device IDs at both ends of the link.
6. A cloud network resource tree auditing method according to claim 4, characterized in that: Step S3 further comprises: S31: The starting device sequentially traverses the resource tree routing map according to the traversal rule; when the device tag of the end device contains a single device ID, step S32 is executed; when the device tag of the end device contains multiple device IDs, step S33 is executed; S32: Record the current traversal path and trace back to the untraversed devices to perform sequential traversal until all devices in the resource tree routing map are traversed; S33: Check whether the device ID of the currently examined line object is the device ID of the endpoint device. If the match fails, continue to traverse in sequence according to the device ID of the currently examined line object; if the match succeeds, execute step S32.
7. A cloud network resource tree auditing method according to claim 6, characterized in that: The traversal rules in step S31 include: When the number of connected lines in the currently examined line object is 1, the audit is recursively performed on the subsequent line objects; When the number of connection lines in the currently inspected line object is greater than 1, they are audited separately according to the number of connection lines. The device ID of each audit is unique, and the audit is recursively applied to subsequent line objects.
8. A cloud network resource tree auditing device, characterized in that: include: Receiving module: used to receive resource tree data; Abstraction module: used for abstracting the resource tree data into a resource tree routing graph according to preset verification rules; Traversal module: used to traverse all nodes and paths in the resource tree routing graph based on depth-first search and backtracking algorithm to complete the audit.
9. A cloud network resource tree auditing device, characterized in that: include: A memory and at least one processor, wherein instructions are stored in the memory; The processor calls the instruction in the memory so that the cloud network resource tree auditing device executes the cloud network resource tree auditing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed by the processor, the cloud network resource tree auditing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and apparatus for calculating multi-path routing tree
CN108965141A
Data query method and device, equipment and storage medium
CN113420216A
Method for topology adaptation service system of Internet of Things equipment
CN116193002A
Method for realizing AISG protocol stack of base station system based on Monte Carlo tree search
CN117202414A
Bandwidth auditing method and device, electronic equipment and medium
CN117857401A
Cited By
Resource data end-to-end full-process visual auditing method and system based on data topology
CN120763606A