A cloud network resource tree auditing method and device
Patent Information
- Application Number
- CN202411677118.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-11-22
AI Technical Summary
[0003]在以基于元数据模型资源树路由稽核的传统模式下,当前问题表现在传统稽核路由的方式不多,基于元数据模型的电路数据存放在数据库中,一般采用dba手写sql方式稽核校验,人力成本较高,其次传统稽核路由的方式单一,灵活性低,针对云网多产品多场景,处理起来比较繁琐,基本靠硬sql或硬代码实现,导致稽核效率低,无法快速并准确的进行电路路由拓扑稽核
[0031]本发明提供的一种云网资源树稽核方法、装置、设备及存储介质,通过接收资源树数据,并根据校验规则抽象为资源树路由图,有效地去除了无用节点,简化了网络拓扑的复杂性,从而提高了后续稽核的效率,本发明基于深度优先搜索及回溯算法对资源树路由图进行遍历,能够确保所有节点及路径都被全面、准确地稽核,降低了遗漏和错误的风险;同时本发明在将预处理资源树数据转换为线对象,使得稽核过程可以根据不同的稽核需求灵活调整起点和终点,进一步增强了稽核的灵活性和适应性;另外本发明能够处理包含多个设备、链路以及复杂连接关系的网络拓扑图,通过线对象的定义,清晰地表示了设备之间的连接关系,为稽核提供了有力的支持;在遍历过程中,当遇到多条连接线时,本发明能够分别稽核每条连接线,并确保每次稽核的设备ID唯一,使得稽核过程能够应对复杂网络拓扑中的多条路径和并行连接。本发明的稽核方法执行逻辑清晰,易于理解和实施,基于本发明,可以与其他网络管理系统或平台进行集成,实现更广泛、更深入的网络资源管理和监控。
Smart Images

Figure CN119520388B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of network topology management, and in particular relates to a cloud network resource tree auditing method and apparatus. Background Technology
[0002] In the context of enterprise cloud transformation and digital transformation, promoting the rapid listing, efficient processing, and reliable support of resource products are urgent issues that enterprises need to solve.
[0003] In the traditional model of resource tree routing audit based on metadata model, the current problems are as follows: there are not many traditional audit routing methods. The circuit data based on the metadata model is stored in the database, and the audit verification is generally carried out by DBA writing SQL by hand, which has high labor costs. Secondly, the traditional audit routing method is simple and inflexible. It is cumbersome to handle multiple cloud network products and multiple scenarios. It is basically implemented by hard SQL or hard code, resulting in low audit efficiency and inability to quickly and accurately perform circuit routing topology audit. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the purpose of the invention is to provide a cloud network resource tree auditing method and device.
[0005] The first aspect of the present invention provides a cloud network resource tree auditing method, comprising:
[0006] S1: Receive resource tree data;
[0007] S2: Abstract the resource tree data into a resource tree routing graph according to preset verification rules;
[0008] S3: Based on the depth-first search and backtracking algorithm, all nodes and paths in the resource tree routing graph are traversed to complete the audit.
[0009] According to the cloud network resource tree auditing method provided by the present invention, the resource tree data in step S1 is the 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 the cloud network resource tree auditing method provided by the present invention, step S2 further includes:
[0012] S21: Based on the received resource tree data, remove the useless nodes in the resource tree data to obtain preprocessed resource tree data;
[0013] S22: Define the starting device and the ending device based on the preprocessed resource tree data;
[0014] S23: Based on the verification rules, define the preprocessed resource tree data as line objects according to the starting device and the ending device to obtain a resource tree routing diagram including multiple 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, link end device labels, and link end device IDs.
[0016] According to the cloud network resource tree auditing method provided by the present invention, step S3 further includes:
[0017] S31: The resource tree routing graph is sequentially traversed by the starting device according to the traversal rules; when the device label of the destination device contains a single device ID, step S32 is executed; when the device label of the destination device contains multiple device IDs, step S33 is executed.
[0018] S32: Record the current traversal path and backtrack to the untraversed devices for sequential traversal until all devices in the resource tree routing graph have been traversed;
[0019] S33: Match 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 according to the device ID order of the currently examined line object; if the match succeeds, execute step S32.
[0020] According to the cloud network resource tree auditing method provided by the present invention, the traversal rules in step S31 include:
[0021] If the number of connecting lines in the currently examined line object is 1, the audit will be recursively applied to subsequent line objects.
[0022] If there are more than 1 connecting lines in the currently examined line object, the audit will be conducted according to the number of connecting lines. Each audited device ID is unique, and the audit will be 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 to abstract 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 algorithms 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 the memory stores instructions;
[0029] The processor invokes the instructions in the memory to cause the cloud network resource tree auditing device to execute the cloud network resource tree auditing method as described in any of the above.
[0030] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the cloud network resource tree auditing method as described in any of the preceding claims.
[0031] This invention provides a cloud network resource tree auditing method, apparatus, device, and storage medium. By receiving resource tree data and abstracting it into a resource tree routing graph according to verification rules, it effectively removes useless nodes, simplifies the complexity of the network topology, and thus improves the efficiency of subsequent auditing. Based on depth-first search and backtracking algorithms, this invention traverses the resource tree routing graph, ensuring that all nodes and paths are comprehensively and accurately audited, reducing the risk of omissions and errors. Furthermore, by converting preprocessed resource tree data into line objects, the auditing process can flexibly adjust the starting and ending points according to different auditing needs, further enhancing the flexibility and adaptability of the audit. In addition, this invention can handle network topologies containing multiple devices, links, and complex connection relationships. Through the definition of line objects, the connection relationships between devices are clearly represented, providing strong support for auditing. During the traversal process, when multiple connection lines are encountered, this invention can audit each connection line separately and ensure that the device ID audited each time is unique, enabling the auditing process to handle multiple paths and parallel connections in complex network topologies. The auditing method of this invention has a clear execution logic, is easy to understand and implement. Based on this invention, it can be integrated with other network management systems or platforms to achieve broader and deeper network resource management and monitoring. Attached Figure Description
[0032] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0033] Figure 1 This is a schematic diagram of a cloud network resource tree auditing method provided in an embodiment of the present invention;
[0034] Figure 2 This is a schematic diagram of a cloud network resource tree auditing device provided in an embodiment of the present invention; Figure 3This is a schematic diagram of the network topology of the cloud network to be audited, provided in an embodiment of the present invention. Figure 4 This is a schematic diagram of a resource tree routing diagram after abstracting the network topology diagram provided in an embodiment of the present invention.
[0035] Figure label:
[0036] 100. Receiving module; 200. Abstracting module; 300. Traversal module. Detailed Implementation
[0037] 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 with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely 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 those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0038] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0039] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0041] To better understand this invention, the terms used in the embodiments of this invention will be explained below.
[0042] Resource tree data: Based on a unified model, the data is structured into a unified JSON structure and divided into three categories based on attribute specifications: nodes, links, and relations. The nodes array contains entity data excluding the cm_link stored in the model, the links contain the data stored in the cm_link in the model, and the relations are the relationship data between entities.
[0043] Routing topology: refers to the abstract diagram formed by the networking of a type of product. It is generally a network topology formed by points and lines such as device-link-device.
[0044] The following is combined 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 auditing method, comprising:
[0046] S1: Receive resource tree data.
[0047] In step S1, the resource tree data is the 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 main focus is on analyzing the basic network topology, such as... Figure 3 As shown in the diagram, by analyzing the network topology, we can see that A1 and A2 are both devices A, and the link between A1 and A2 is optional. It can be directly connected from devices A and B. There is one line between devices A1 and A2. There may be multiple lines from A2 to device B, but there will only be one line from B to U1. Since U1-U2-U3 all belong to devices U, they can be configured as U-device-U-device.
[0050] S2: The resource tree data is abstracted into a resource tree routing graph according to preset verification rules.
[0051] Step S2 further includes:
[0052] S21: Based on the received resource tree data, remove the useless nodes in the resource tree data to obtain preprocessed resource tree data.
[0053] S22: Define the starting device and the ending device based on the preprocessed 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 rules, define the preprocessed resource tree data as line objects according to the starting device and the ending device to obtain a resource tree routing diagram including multiple line objects.
[0056] In step S2, after obtaining the resource tree data in step S1, rules are retrieved from the database, and the starting point device is obtained first. For example, in this embodiment, the starting point is the ID of device A1 and the ending point is the ID of device U3.
[0057] Subsequent pruning operations are performed on the resource tree data. Since the resource tree data contains a large number of nodes that are not used for routing concatenation, a line object is defined, which only records the link label, link ID, end device labels, and end device IDs. The entire resource tree is first converted into a collection of line objects, which allows the network topology diagram in step S1 to be abstracted as follows: Figure 4 The diagram shows the configuration of the verification rules.
[0058] S3: Based on the depth-first search and backtracking algorithm, all nodes and paths in the resource tree routing graph are traversed to complete the audit.
[0059] Step S3 further includes:
[0060] S31: The resource tree routing graph is sequentially traversed by the starting device according to the traversal rules; when the device label of the destination device contains a single device ID, step S32 is executed; when the device label of the destination device contains multiple device IDs, step S33 is executed.
[0061] The traversal rules in step S31 include:
[0062] If the number of connecting lines in the currently examined line object is 1, the audit will be recursively applied to subsequent line objects.
[0063] If there are more than 1 connecting lines in the currently examined line object, the audit will be conducted according to the number of connecting lines. Each audited device ID is unique, and the audit will be recursively applied to subsequent line objects.
[0064] S32: Record the current traversal path and backtrack to the untraversed devices for sequential traversal until all devices in the resource tree routing graph have been traversed.
[0065] S33: Match 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 according to the device ID order of the currently examined line object; if the match succeeds, execute step S32.
[0066] In the specific embodiment provided by the present invention, the obtained rule data is used as the basis for traversal. Starting from the first rule line, the line data collected from 1 is searched for lines where the A-end id is the id of device A1, the link label is an Ethernet link, and the Z-end device label is device A. The number of lines is counted and is 1, which meets the condition of 0..n. The process continues to recursively to the second rule line.
[0067] Using device ID A2 + Ethernet link + Z-end label, device B searches for two lines in the line set. Since the devices at both ends of the rule are not the same device, and if the same device has more than one line, they can only be connected in parallel. Therefore, a new path is branched off from here: A1-A2-B1 is path 1, and A1-A2-B2 is path 2. The peer device ID cannot be repeated in each recursion. Thus, the second rule line is also satisfied, and the recursion continues to the third line.
[0068] If the device ID of B1, the Ethernet link, and the Z-end label are U devices, search the line set and find one line (B1-U1), which satisfies the condition of one. Continue recursively to the fourth rule line.
[0069] Given that device ID U1 + Ethernet link + Z-end label is device U, a line (U1-U2) is found in the line set, satisfying the 0..n condition, and it is the last rule. It will be matched with the destination ID to see if it is satisfied. U2 is not U3. Since this rule is for the same device and is 0..n, there may be another line. Under the current rule, continue the recursive search. Given that device A is device ID U2 + Ethernet link + Z-end device label is device U, a line (U2-U3) is found in the set. It is compared with the destination ID and it is satisfied. Path 1 is recorded and marked with a verification pass mark, and backtracking begins.
[0070] Tracing back to the point where the device ID of B2, the Ethernet link, and the Z-end tag indicate that the device is U, we search the line set and find one line (B2-U1), which satisfies the condition of one. We then recursively proceed to the fourth rule line.
[0071] Given that device ID U1 + Ethernet link + Z-end label is device U, a line (U1-U2) is found in the line set that satisfies the 0..n condition and is the last rule. It will be matched with the destination ID to see if it is satisfied. U2 is not U3. Since this rule is for the same device and is 0..n, there may be another line. Under the current rule, the recursive search continues. Given that device A is device ID U2 + Ethernet link + Z-end device label is device U, a line (U2-U3) is found in the set. It is compared with the destination ID and is satisfied. Path 2 is recorded and marked as passed.
[0072] Since there are no other paths, the recursion ends and the verification terminates.
[0073] like Figure 2 As shown, the present invention also provides a cloud network resource tree auditing device, comprising:
[0074] Receiver module 100: Used to receive resource tree data;
[0075] Abstract module 200: used to abstract the resource tree data into a resource tree routing graph according to preset verification rules;
[0076] Traversal module 300: Used to traverse all nodes and paths in the resource tree routing graph based on depth-first search and backtracking algorithms 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 the memory stores instructions;
[0079] The processor invokes the instructions in the memory to cause the cloud network resource tree auditing device to execute the cloud network resource tree auditing method as described in any of the above.
[0080] The present invention also provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the cloud network resource tree auditing method as described in any of the preceding claims.
[0081] Furthermore, the cloud network resource tree auditing device provided by the present invention can vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs), for example, one or more processors and memory, and one or more storage media for storing applications or data, such as one or more mass storage devices. The memory and storage media may be temporary or persistent storage. The program stored in the storage media may include one or more modules, each module may include a series of instruction operations on the cloud network resource tree auditing device. Furthermore, the processor may be configured to communicate with the storage media and execute a series of instruction operations in the storage media 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 / output interfaces, and one or more operating systems, such as Windows Server, MacOSX, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that the cloud network resource tree auditing device structure provided by this invention does not constitute a limitation on the device, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0083] This invention provides a cloud network resource tree auditing method, apparatus, device, and storage medium, which adopts a depth-first search (DFS) algorithm with backtracking, complementing the verification rule configuration. First, the rule configuration party abstracts the rules required for verification rule configuration according to the routing topology proposed by the business party, and then performs integrity verification on the resource tree path.
[0084] The Depth-First Search (DFS) algorithm with backtracking proposed in this invention is used for traversing or searching trees or graphs. DFS traverses nodes along the depth of the tree, searching the branches of the tree as deeply as possible. When all edges containing the current node have been explored, the search backtracks to the starting node of the edge that found the current node. 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 entire process is repeated until all nodes have been visited. Depth-First Search has two implementation methods, mainly using recursion. That is, DFS is implemented using recursive functions, and each recursive call visits an unvisited adjacent node.
[0085] This invention provides a cloud network resource tree auditing method, apparatus, device, and storage medium. Based on topology map data and combined with the algorithm for routing concatenation of this circuit topology, it achieves route integrity auditing. This invention implements a stable route integrity auditing algorithm in the cloud network resource tree-one-map project, deploying it in a multi-instance mode. The project adopts a divide-and-conquer, multi-threaded development mode, combining topology map data with the algorithm to achieve unified auditing of the resource tree and accumulate business capabilities of cloud network resources. This invention also combines a depth-first search (DFS) algorithm with backtracking, enabling the retrieval of some multi-path, multi-branch routing concatenation routes at once, thereby achieving stable business auditing capabilities and product rigor, significantly improving auditing efficiency. In addition, based on the continuously decoupled and open tree-one-map capability, the new circuit topology routing concatenation algorithm is designed and assembled using a unified data language from a customer-friendly and easily scalable perspective. Combined with network topology mode and dynamic routing configuration rules, it quickly realizes the configuration of route integrity auditing 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, and are not intended 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. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
Claims
1. A cloud network resource tree auditing method, characterized in that, include: S1: Receive resource tree data; S2: Abstract the resource tree data into a resource tree routing graph according to preset verification rules; Step S2 further includes: S21: Based on the received resource tree data, remove the useless nodes in the resource tree data to obtain preprocessed resource tree data; S22: Define the starting device and the ending device based on the preprocessed resource tree data; S23: Based on the verification rules, define line objects in the preprocessed resource tree data according to the starting device and the ending device to obtain a resource tree routing map including multiple line objects; the line objects in step S23 include link label, link ID, link end device label, and link end device ID. S3: Traverse all nodes and paths in the resource tree routing graph based on depth-first search and backtracking algorithms to complete the audit; Step S3 further includes: S31: The resource tree routing graph is sequentially traversed by the starting device according to the traversal rules; when the device label of the destination device contains a single device ID, step S32 is executed; when the device label of the destination device contains multiple device IDs, step S33 is executed. S32: Record the current traversal path and backtrack to the untraversed devices for sequential traversal until all devices in the resource tree routing graph have been traversed; S33: Check if the device ID of the currently examined line object is the device ID of the endpoint device. If the match fails, continue to traverse according to the device ID order of the currently examined line objects; if the match succeeds, execute step S32. The traversal rules in step S31 include: If the number of connecting lines in the currently examined line object is 1, the audit will be recursively applied to subsequent line objects. If the number of connecting lines in the currently examined line object is greater than 1, the audit will be performed according to the number of connecting lines. Each audited device ID is unique, and the audit will be recursively applied to subsequent line objects.
2. The 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. The 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 device, characterized in that, include: Receiving module: Used to receive resource tree data; Abstraction module: used to abstract the resource tree data into a resource tree routing graph according to preset verification rules; The abstract module is further used to: remove useless nodes from the received resource tree data to obtain preprocessed resource tree data; The start and end devices are defined by the preprocessed resource tree data; Based on the verification rules, the preprocessed resource tree data is defined into line objects according to the starting device and the ending device to obtain a resource tree routing map including multiple line objects; the line object includes a link label, a link ID, a label of the devices at both ends of the link, and the ID of the devices at both ends of the link. Traversal module: used to traverse all nodes and paths in the resource tree routing graph based on depth-first search and backtracking algorithms to complete the audit; The traversal module is further configured to: traverse the resource tree routing graph sequentially from the starting device according to traversal rules; when the device label of the destination device contains a single device ID, record the current traversal path and backtrack to the untraversed devices for sequential traversal until all devices in the resource tree routing graph have been traversed; when the device label of the destination device contains multiple device IDs, match whether the device ID of the currently examined line object is the device ID of the destination device; if the match fails, continue sequential traversal according to the device ID of the currently examined line object; if the match succeeds, record the current traversal path and backtrack to the untraversed devices for sequential traversal until all devices in the resource tree routing graph have been traversed. The traversal rules include: If the number of connecting lines in the currently examined line object is 1, the audit will be recursively applied to subsequent line objects. If the number of connecting lines in the currently examined line object is greater than 1, the audit will be performed according to the number of connecting lines. Each audited device ID is unique, and the audit will be recursively applied to subsequent line objects.
5. A cloud network resource tree auditing device, characterized in that, include: A memory and at least one processor, wherein the memory stores instructions; The processor invokes the instructions in the memory to cause the cloud network resource tree auditing device to execute the cloud network resource tree auditing method as described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement the cloud network resource tree auditing method as described in any one of claims 1-3.
Citation Information
Patent Citations
Bandwidth auditing method and device, electronic equipment and medium
CN117857401A