Atlas construction method and device and electronic equipment
By constructing a topology and optimizing the knowledge graph, the problem of high knowledge graph complexity is solved, achieving efficient querying and reduced storage costs in the construction of subgraphs, which is suitable for unified operation and maintenance data integration systems.
Patent Information
- Application Number
- CN202511647816.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-17
AI Technical Summary
In existing technologies, the knowledge graphs corresponding to configuration items and relationships are highly complex, leading to query performance bottlenecks and high storage costs. This is especially true in unified operation and maintenance data integration systems, where the data scale is large and the relationships are complex, and existing solutions have failed to effectively address these issues.
By acquiring configuration item data for preset software requirements, an initial subgraph is constructed, and a topological structure, including point topology and edge topology, is created in the initial subgraph. The relationships between configuration items are aggregated, the knowledge graph is trimmed and expanded, and the graph structure is optimized to meet the software requirements.
It reduces the complexity of knowledge graphs, improves query performance, and reduces storage costs, achieving the construction of target subgraphs that meet preset software requirements.
Smart Images

Figure CN121542473A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of system operation and maintenance, and more specifically, to a map construction method, apparatus, and electronic device. Background Technology
[0002] As a data hub, the unified operations and maintenance data integration system has seen its configuration data scale grow to the millions, with data sources covering various heterogeneous data sources such as automated collection tools and data monitoring. The configuration types in the main data entity configuration management database (CMDB) have also expanded from single IT device management to diversified channels such as cloud resources, containers, and microservices. These changes have led to: an explosion in data dimensions: the number of attribute fields in each configuration item has increased from the traditional 10-20 to 50-100; and increased relationship complexity: the types of relationships between configuration items have expanded from simple "dependency" and "containment" to dozens of business semantic relationships. While the resulting knowledge graph can better express semantic relationships, it also brings new problems, including:
[0003] (1) The graph is too large: A complete knowledge graph contains hundreds of configuration item types and hundreds of relation types. Each configuration item corresponds to a point in the graph, and each relation corresponds to an edge in the graph, which makes the number of points and edges in the complete knowledge graph particularly large.
[0004] (2) Query performance bottleneck: The time complexity of full graph traversal increases exponentially;
[0005] (3) High storage cost: A distributed graph database is required to support the storage of massive amounts of data.
[0006] There is currently no effective solution to the above problems. Summary of the Invention
[0007] This invention provides a graph construction method, apparatus, and electronic device to at least solve the technical problem of high complexity in knowledge graphs corresponding to configuration items and relationships in related technologies.
[0008] According to one aspect of the present invention, a graph construction method is provided, comprising: acquiring configuration item data required by preset software requirements, and obtaining an initial subgraph based on the configuration item data, wherein the initial subgraph includes: nodes representing configuration items in the configuration item data and edges representing the association relationships between the configuration items in the configuration item data; creating a topology structure in the initial subgraph to obtain a target subgraph, wherein the topology structure records at least one of the following: a structure set and a management set, wherein the management set includes: a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software, and the structure set includes: a set obtained by selecting the topology structure of the operation and maintenance object based on software operation and maintenance data.
[0009] Further, creating a topology structure in the initial subgraph to obtain a target subgraph includes: creating a vertex topology structure and an edge topology structure in the initial subgraph to obtain a processed initial subgraph, wherein a vertex topology structure represents a topology structure by a vertex, and an edge topology structure represents a topology structure by an edge; in the processed initial subgraph, the association relationship between configuration items within every two topologies is aggregated into a relationship relationship between topologies to obtain the target subgraph.
[0010] Further, creating a point topology in the initial subgraph includes: obtaining a target set of topologies to be created, wherein the target set includes at least one of the following: the structure set, the management set; when the type of the target set is a management set, creating a first type of node in the initial subgraph, and adding a first preset relationship between the first type of node and the corresponding node in the initial subgraph of the configuration item in the target set, so as to create the point topology in the initial subgraph, wherein the first type of node is used to represent the management set; when the type of the target set is a structure set, determining whether the structure set can correspond to the existing configuration item in the initial subgraph, obtaining a determination result, and creating the point topology in the initial subgraph based on the determination result.
[0011] Further, based on the judgment result, creating the point topology in the initial subgraph includes: when the judgment result indicates that the structure set cannot correspond to an existing configuration item in the initial subgraph, creating a second type of node in the initial subgraph, and adding a second preset relationship between the second type of node and the node corresponding to the configuration item in the target set in the initial subgraph, to create the point topology in the initial subgraph, wherein the second type of node is used to represent the structure set; when the judgment result indicates that the structure set can correspond to an existing configuration item in the initial subgraph, modifying the node type of the node corresponding to the configuration item in the structure set in the initial subgraph to configuration item and structure set, to create the point topology in the initial subgraph.
[0012] Further, acquiring configuration item data required by preset software requirements, and obtaining an initial subgraph based on the configuration item data, includes: acquiring a knowledge graph associated with a configuration management database to obtain a target knowledge graph, wherein the target knowledge graph includes: nodes recording all configuration items in the configuration management database and edges recording the relationships between all configuration items; pruning the target knowledge graph based on the preset software requirements to obtain a pruned target knowledge graph, and expanding the pruned target knowledge graph to obtain the initial subgraph, wherein the configuration item data further includes: the pruned target knowledge graph.
[0013] Further, the target knowledge graph is pruned based on the preset software requirements to obtain a pruned target knowledge graph, including: filtering nodes and edges in the target knowledge graph based on the preset software requirements to obtain the pruned target knowledge graph; and expanding the configuration item data to obtain the initial subgraph, including: when there is a target attribute requirement for a certain configuration item in the preset software requirements, expanding the target attribute into an attribute of the configuration item in the pruned target knowledge graph to obtain the initial subgraph, wherein the target attribute requirement includes: the requirement to obtain the attribute of another type of configuration item associated with the configuration item through a one-to-one or many-to-one relationship link.
[0014] Further, before creating the topology in the initial subgraph to obtain the target subgraph, the process includes: obtaining software query requirements, wherein the software query requirements include query requirements for querying links in the initial subgraph; based on the software query requirements, determining links in the initial subgraph with query frequencies higher than a preset frequency threshold to obtain multiple target query links; extracting the common portions of the multiple target query links to obtain shared query links and non-shared query links; and performing path aggregation on the shared query links and non-shared query links based on their hop counts to obtain an aggregated target subgraph, wherein the path aggregation method includes adding a direct relationship between configuration items at both ends of the links that need path aggregation.
[0015] Furthermore, creating a topology structure in the initial subgraph to obtain the target subgraph also includes: when the topology structure to be created is a multi-level topology structure, creating the topology structure sequentially in the initial subgraph according to the order of hierarchy from low to high to obtain a multi-level topology structure, wherein the higher-level topology structure includes the lower-level topology structure; and performing link aggregation on the multi-level topology structure based on the link query frequency of the multi-level topology structure to obtain the target subgraph.
[0016] According to another aspect of the present invention, a graph construction apparatus is also provided, comprising: a processing unit, configured to acquire configuration item data required by preset software requirements, and obtain an initial subgraph based on the configuration item data, wherein the initial subgraph includes: nodes representing configuration items in the configuration item data and edges representing the association relationships between the configuration items in the configuration item data; and a creation unit, configured to create a topology structure in the initial subgraph to obtain a target subgraph, wherein the topology structure records at least one of the following: a structure set and a management set, wherein the management set includes: a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software, and the structure set includes: a set obtained by selecting the topology structure of the maintenance object based on software maintenance data.
[0017] Further, the creation unit includes: a first creation subunit, used to create a point topology and an edge topology in the initial subgraph to obtain a processed initial subgraph, wherein a point topology represents a topology and an edge topology represents a topology by an edge; and a first aggregation subunit, used to aggregate the association relationships between configuration items within every two topologies into relationships between topologies in the processed initial subgraph to obtain the target subgraph.
[0018] Further, the first creation subunit includes: an acquisition module, configured to acquire a target set of topologies to be created, wherein the target set includes at least one of the following: the structure set, the management set; a first processing module, configured to, when the type of the target set is a management set, create a first type of node in the initial subgraph, and add a first preset relationship between the first type of node and the corresponding node in the initial subgraph of the configuration item in the target set, so as to create the point topology in the initial subgraph, wherein the first type of node is used to represent the management set; and a second processing module, configured to, when the type of the target set is a structure set, determine whether the structure set can correspond to the existing configuration item in the initial subgraph, obtain a determination result, and create the point topology in the initial subgraph based on the determination result.
[0019] Further, the second processing module includes: a first processing submodule, configured to, when the judgment result indicates that the structure set cannot correspond to an existing configuration item in the initial subgraph, create a second type of node in the initial subgraph and add a second preset relationship between the second type of node and the node corresponding to the configuration item in the target set in the initial subgraph, so as to create the point topology in the initial subgraph, wherein the second type of node is used to represent the structure set; and a second processing submodule, configured to, when the judgment result indicates that the structure set can correspond to an existing configuration item in the initial subgraph, modify the node type of the node corresponding to the configuration item in the structure set in the initial subgraph to configuration item and structure set, so as to create the point topology in the initial subgraph.
[0020] Further, the processing unit includes: an acquisition subunit, used to acquire a knowledge graph associated with the configuration management database to obtain a target knowledge graph, wherein the target knowledge graph includes: nodes recording all configuration items in the configuration management database and edges recording the relationships between all configuration items; and a processing subunit, used to trim the target knowledge graph based on the preset software requirements to obtain a trimmed target knowledge graph, and to expand the trimmed target knowledge graph to obtain the initial subgraph, wherein the configuration item data further includes: the trimmed target knowledge graph.
[0021] Further, the processing subunit includes: a filtering module, used to filter nodes and edges in the target knowledge graph based on the preset software requirements to obtain the pruned target knowledge graph; the processing subunit also includes: an expansion module, used to expand the target attribute into the attribute of the configuration item in the pruned target knowledge graph when there is a target attribute requirement for a certain configuration item in the preset software requirements, to obtain the initial subgraph, wherein the target attribute requirement includes: the requirement to obtain the attribute of another type of configuration item associated with the configuration item through a one-to-one or many-to-one relationship link.
[0022] Furthermore, the graph construction device further includes: an acquisition unit, configured to acquire software query requirements before creating a topology structure in the initial subgraph and obtaining a target subgraph, wherein the software query requirements include query requirements for querying links in the initial subgraph; a determination unit, configured to determine links in the initial subgraph with query frequencies higher than a preset frequency threshold based on the software query requirements, thereby obtaining multiple target query links; a truncation unit, configured to truncate the common portions of the multiple target query links, thereby obtaining shared query links and non-shared query links; and an aggregation unit, configured to perform path aggregation on the shared query links and non-shared query links based on the hop count of the shared query links and non-shared query links, respectively, to obtain an aggregated target subgraph, wherein the path aggregation method includes adding a direct relationship between configuration items at both ends of the links that need path aggregation.
[0023] Furthermore, the creation unit also includes: a second creation subunit, used to create the topology in the initial subgraph in the order of hierarchy from low to high when the topology to be created is a multi-level topology, to obtain a multi-level topology, wherein the higher-level topology includes the lower-level topology; and a second aggregation subunit, used to perform link aggregation on the multi-level topology based on the link query frequency of the multi-level topology to obtain the target subgraph.
[0024] According to another aspect of the present invention, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the map construction method of any of the above-mentioned methods by executing the executable instructions.
[0025] According to another aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the map construction method of any of the above-mentioned methods when it is running.
[0026] In this invention, configuration item data required by preset software requirements is obtained, and an initial subgraph is obtained based on the configuration item data. The initial subgraph includes nodes representing configuration items in the configuration item data and edges representing the relationships between configuration items. A topology structure is created in the initial subgraph to obtain a target subgraph. The topology structure records at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items without direct relationships based on software management requirements. The structure set includes a set obtained by selecting the topology structure of the maintenance object based on software maintenance data. This solves the technical problem of high complexity in the knowledge graph corresponding to configuration items and relationships in related technologies. In this invention, the total configuration item data is trimmed and a topology structure is added according to software requirements to obtain a target subgraph that meets the preset software requirements. This avoids the high complexity of knowledge graphs in related technologies, which leads to high storage costs and low data retrieval efficiency, thereby achieving the technical effect of reducing the complexity of the knowledge graph recording configuration items and relationships. Attached Figure Description
[0027] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0028] Figure 1 This is a flowchart of an optional map construction method according to an embodiment of the present invention;
[0029] Figure 2 This is a flowchart of another optional map construction method according to an embodiment of the present invention;
[0030] Figure 3 This is a schematic diagram of an optional map construction apparatus according to an embodiment of the present invention;
[0031] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.), the collected information and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse.
[0035] Example 1
[0036] According to an embodiment of the present invention, an optional map construction method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] Figure 1 This is a flowchart of an optional map construction method according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0038] Step S101: Obtain the configuration item data required by the preset software requirements, and obtain an initial subgraph based on the configuration item data. The initial subgraph includes: nodes representing configuration items in the configuration item data and edges representing the relationships between configuration items in the configuration item data.
[0039] The aforementioned preset software requirements can be specific requirements for the software system. For example, fault location only requires hardware topology relationships, while capacity planning focuses on resource attributes. In this embodiment, software requirements can also be determined according to the type of software system. For example, an operation and maintenance monitoring system mainly focuses on the topology relationships of the infrastructure layer; a change management system needs to focus on configuration items within the scope of change impact; and a capacity planning system is more concerned with resource utilization and dependencies.
[0040] In this embodiment, the required configuration items can be filtered from the total configuration item data according to the preset software requirements, and the less frequently used configuration items can be degenerated into the attributes of the frequently used configuration items. Based on the filtered configuration items, the above-mentioned initial sub-graph is obtained.
[0041] In one optional example, the required configuration item types and relationships in the CMDB (Configuration Management Database) master diagram (or CMDB relational configuration library) can be filtered according to preset software requirements, and the required attributes of the configuration items can be filtered to construct the CMDB sub-diagram required by the software (corresponding to the initial sub-diagram).
[0042] Step S102: Create a topology structure in the initial subgraph to obtain the target subgraph. The topology structure record includes at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software. The structure set includes a set obtained by selecting the topology structure of the operation and maintenance object based on the software operation and maintenance data.
[0043] The aforementioned topology can be a collection of configuration items and relationships within the CMDB master diagram. Based on their definition, topologies can be categorized into two types: structure sets (SS) and management sets (MS). Management sets are collections that logically group configuration items that are not directly related based on specific management needs. Structure sets, on the other hand, are collections that define the topology of operational objects based on operational data. Specially labeling this data in the CMDB master diagram can reduce the query overhead for this data.
[0044] In this embodiment, the aforementioned topological structure can be created in the initial subgraph to obtain the target subgraph. For example, the configuration item type or relationship type that needs to be created for the topological structure can be determined according to preset software requirements. A topological structure can also contain some specific configuration items and relationships in the initial subgraph. Since edges in knowledge graphs require the existence of vertices, a vertex topological structure can be constructed first, followed by an edge topological structure. Here, a vertex topological structure represents the topological structure represented by a vertex in the graph, and an edge topological structure represents the topological structure represented by an edge in the graph.
[0045] In one alternative example, after obtaining the initial subgraph and the target subgraph, path aggregation can be performed on the links in the graph. That is, long links can be aggregated into direct relationships according to the common query logic of the software. Specifically, (1) the software query requirements can be collected and the commonly used query links of the requirements can be sorted out. Usually, only a small number of commonly used query links can be extracted from the requirements. Therefore, the query frequency of various query links can be counted by collecting historical query records. (2) Based on the query frequency of the query links, the high-frequency query links can be analyzed, the common parts can be extracted, and the common parts can be divided. The links that need to be path aggregated are determined under the condition of balancing the link length and the number of new aggregation relationships. A direct relationship is added between the configuration items at both ends of the links that need to be path aggregated, and a label is added to the relationship to record the original link corresponding to the relationship.
[0046] Through the above steps, in this embodiment, the total configuration item data is trimmed and a topological structure is added according to software requirements to obtain a target subgraph that meets the preset software requirements. This avoids the high complexity of knowledge graphs in related technologies, which leads to high storage costs and low data retrieval efficiency. Thus, it achieves the technical effect of reducing the complexity of the knowledge graph recording configuration items and relationships. This solves the technical problem of high complexity in the knowledge graphs corresponding to configuration items and relationships in related technologies.
[0047] Optionally, a topology structure is created in the initial subgraph to obtain the target subgraph, including: creating a vertex topology structure and an edge topology structure in the initial subgraph to obtain a processed initial subgraph, wherein a vertex topology structure represents a topology structure by a vertex, and an edge topology structure represents a topology structure by an edge; in the processed initial subgraph, the association relationship between configuration items within every two topologies is aggregated into a relationship relationship between topologies to obtain the target subgraph.
[0048] For example, the types of configuration items or relationships that need to be created for the topology can be determined based on preset software requirements. A topology can also contain some specific configuration items and relationships in the initial subgraph. Since edges in knowledge graphs require the existence of vertices, a vertex topology can be constructed first, followed by an edge topology. Here, a vertex topology represents the topology represented by a single vertex in the graph, and an edge topology represents the topology represented by a single edge in the graph.
[0049] Specifically, a point topology is created. If it's a management collection, a point corresponding to that management collection is created in the initial subgraph. A specific relationship is created between this point and the points corresponding to the configuration items contained in the management collection to indicate the inclusion relationship. If it's a structure collection, it's verified whether the structure collection can correspond to an existing CMDB configuration item in the initial subgraph. If so, a structure collection attribute is added to the configuration item. In this case, the point corresponding to the configuration item in the initial subgraph is shared by both the configuration item and the structure collection. Otherwise, a point corresponding to that structure collection is created in the initial subgraph. A specific relationship is created between this point and the points corresponding to the configuration items contained in the structure collection to indicate the inclusion relationship. Information about the structure collection is also added to the configuration items contained in the structure collection and the relationships.
[0050] Create an edge topology. Since edges in a knowledge graph require nodes to exist, the edge topology can correspond to existing edges in the initial subgraph. Furthermore, because edges can only be added between nodes in a knowledge graph, a corresponding node can be created for this edge topology (for example, an attribute can be added to the edge to record the unique identifier of the corresponding topology node, usually the node's ID). Then, process it as a node topology.
[0051] Creating an edge topology can be seen as a method to abstract and simplify complex relationship patterns in a graph, aiming to reduce computational complexity and improve query efficiency. It can be based on two principles: first, edges must exist in relation to vertices; second, edges can only be established between vertices in a graph, not directly between edges or between edges and vertices. The specific steps for creating an edge topology are as follows:
[0052] Step 1: Identify Edge Topology Requirements: Analyze the software query requirements to determine which complex or frequently used edges (i.e., relationships) need to be abstracted into an edge topology. These edges may involve complex interactions between multiple points or multi-level relationships, such as complex dependencies between multiple configuration items.
[0053] Step 2: Create a representative point for the edge topology: Create a new point in the initial subgraph specifically to represent the edge topology. This new point may not directly correspond to any physical or logical configuration item, but rather serve as a carrier of the abstract edge topology.
[0054] Step 3: Connect the representative points of the edge topology with relevant configuration items: Establish specific relationships between the newly created representative points and the relevant configuration item points in the edge topology. Use these relationships to indicate which configuration items participate in the edge topology. These relationships can be named with English terms that reflect the characteristics of the edge topology to distinguish them from the original CMDB relationships.
[0055] Step 4: Record edge topology information: Add attributes to the relevant edges and vertices to record the unique identifier (such as ID) of the edge topology. This helps to quickly locate the edge topology during subsequent queries. Attributes can be in list form, allowing the same configuration item to participate in multiple different edge topologies, thus maintaining the flexibility and integrity of the graph.
[0056] Step 5: Aggregate Relationships: Relationships that were originally connected to configuration items can now be aggregated through new representative points to form a relationship network within the edge topology. This aggregation can reduce redundancy in the original graph and lower query complexity.
[0057] Step 6: Maintain the edge topology. When relevant configuration items in the CMDB change, the edge topology needs to be updated synchronously to ensure consistency with the actual configuration state. The edge topology can be periodically checked and automatically adjusted to adapt to configuration changes.
[0058] The core of creating edge topologies lies in introducing abstract points to carry complex edge relationships. This not only simplifies graph queries but also effectively manages and aggregates relationships, reducing data size and query costs. It ensures that the generated topology meets the needs of specific software while maintaining the graph's simplicity and efficiency. In practice, the strategy for creating edge topologies can be flexibly adjusted according to specific application scenarios and pre-defined software requirements to achieve optimal performance and resource utilization.
[0059] In this embodiment, the relationship between configuration items within two topologies in the processed initial subgraph can be aggregated into a relationship between topologies.
[0060] In one alternative example, if a multi-level topology is required, it can be created sequentially from lowest to highest level. A topology at level 1 contains only configuration items. A topology at level 2 must contain the topology at level 1 and may contain configuration items. A topology at level n must contain the topology at level n-1 and may contain topologies at levels n-2 and below, or configuration items.
[0061] If the graph has multiple topological layers, then link aggregation may be required for these layers to reduce the graph size.
[0062] Optionally, creating a point topology in the initial subgraph includes: obtaining a target set of the topology to be created, wherein the target set includes at least one of the following: a structure set and a management set; if the type of the target set is a management set, creating a first type of node in the initial subgraph, and adding a first preset relationship between the first type of node and the corresponding node in the initial subgraph of the configuration item in the target set, so as to create a point topology in the initial subgraph, wherein the first type of node is used to represent the management set; if the type of the target set is a structure set, determining whether the structure set can correspond to the existing configuration item in the initial subgraph, obtaining the determination result, and creating a point topology in the initial subgraph based on the determination result.
[0063] In this embodiment, the first step is to identify which specific topology needs to be created based on preset software requirements. The target set can be a structure set (SS) or a management set (MS). The structure set can define the topology of the operation and maintenance objects based on operation and maintenance data, while the management set logically groups configuration items that are not directly related based on specific management requirements.
[0064] For example, if it's a management set, a point (i.e., a first-type node) corresponding to the management set is created in the initial subgraph. A specific relationship is established between this point and the points corresponding to the configuration items contained in the management set to indicate the inclusion relationship. If it's a structure set, it's confirmed whether the structure set can correspond to an existing CMDB configuration item. If so, a structure set attribute is added to the configuration item. In this case, the point corresponding to the configuration item in the initial subgraph is shared by both the configuration item and the structure set. Otherwise, a point corresponding to the structure set is created in the initial subgraph. A specific relationship is established between this point and the points corresponding to the configuration items contained in the structure set to indicate the inclusion relationship. Simultaneously, information about the structure set is added to the configuration items contained in the structure set and the relationships. In this embodiment, special annotations are made for the structure set and management set in the subgraph to reduce the query overhead for this part of the data.
[0065] In an optional example, if it is a management collection, a point corresponding to the management collection is created in the initial graph, following the CMDB graph construction rules. A specific relationship is then created between this point and the points corresponding to the configuration items contained in the management collection to indicate the inclusion relationship. To distinguish this from the original relationship, the original CMDB relationship can use Chinese relationship names, while the fictitious relationship can use English relationship names.
[0066] In this embodiment, a point topology is constructed on the initial subgraph of the CMDB data. Whether it is a management set or a structure set, the graph can be further optimized based on these point topologies to improve query performance while maintaining data integrity and relevance.
[0067] Optionally, based on the judgment result, a point topology structure is created in the initial subgraph, including: if the judgment result indicates that the structure set cannot correspond to an existing configuration item in the initial subgraph, a second type of node is created in the initial subgraph, and a second preset relationship is added between the second type of node and the node corresponding to the configuration item in the target set in the initial subgraph, so as to create a point topology structure in the initial subgraph, wherein the second type of node is used to represent the structure set; if the judgment result indicates that the structure set can correspond to an existing configuration item in the initial subgraph, the node type of the node corresponding to the configuration item in the structure set in the initial subgraph is modified to configuration item and structure set, so as to create a point topology structure in the initial subgraph.
[0068] For example, if it's a structure set, it checks if the structure set corresponds to an existing CMDB configuration item in the initial subgraph. If it does (i.e., the result indicates that the structure set corresponds to an existing configuration item in the initial subgraph), the "node type" attribute of the configuration item is changed from configuration item to both configuration item and structure set. In this case, the point corresponding to the configuration item in the initial subgraph is shared by both the configuration item and the topology. Otherwise (i.e., the result indicates that the structure set does not correspond to an existing configuration item in the initial subgraph), a point corresponding to the topology (i.e., a second type of node) is created in the initial subgraph. A specific relationship is created between this point and the points corresponding to the configuration items contained in the structure set to indicate the inclusion relationship. Simultaneously, information about the topology is added to the configuration items contained in the topology and the relationships. This can be done by adding a unique identifier for the topology to the point and edge, such as an ID. Since the same configuration item may belong to multiple topologies, this attribute can usually be a list. Taking the construction of a structure set for a middleware cluster as an example, it includes the three logical servers used to deploy the cluster and their communication relationships. Because of the configuration item for this middleware cluster, the node type of the point corresponding to this configuration item is changed from configuration item to configuration item and structure cluster. At the same time, an svcCompose relationship (an English relationship name) is added between this point and the points corresponding to the three servers, and the ownSvc (an English relationship name) attribute is added to the communication relationship between the servers. The attribute value is the ID of this middleware cluster.
[0069] Optionally, the configuration item data required by the software requirements is obtained, and an initial subgraph is obtained based on the configuration item data, including: obtaining the knowledge graph associated with the configuration management database to obtain the target knowledge graph, wherein the target knowledge graph includes: nodes recording all configuration items in the configuration management database and edges recording the relationships between all configuration items; pruning the target knowledge graph based on the software requirements to obtain the pruned target knowledge graph, and expanding the pruned target knowledge graph to obtain the initial subgraph, wherein the configuration item data also includes: the pruned target knowledge graph.
[0070] The aforementioned target knowledge graph can be the overall knowledge graph of the configuration management database (CMDB) of the unified operation and maintenance data integration system. This knowledge graph includes knowledge graphs of configuration items of diverse configuration types such as IT equipment management, cloud resources, containers, and microservices. Each configuration item corresponds to a point in the graph, and each relationship corresponds to an edge in the graph.
[0071] To avoid the problem of an excessively large complete knowledge graph, high time complexity of full graph traversal, and high storage costs, this embodiment can select the required configuration items and their corresponding attributes from the CMDB master graph (corresponding to the target knowledge graph) according to preset software requirements, copy them to the software subgraph to be constructed, and then select the required relationships from the master knowledge graph except those in the subgraph and copy them to the software subgraph to obtain the trimmed target knowledge graph.
[0072] In this embodiment, in the pruned target knowledge graph, for the requirement that only one type of configuration item needs to be obtained through a one-to-one or many-to-one relationship link, the other type of configuration item node can be degenerated into an extended attribute and assigned to the configuration item to obtain an initial subgraph, thereby reducing the size of the subgraph.
[0073] Optionally, the target knowledge graph is pruned based on preset software requirements to obtain a pruned target knowledge graph, including: filtering nodes and edges in the target knowledge graph based on preset software requirements to obtain a pruned target knowledge graph; and expanding configuration item data to obtain an initial subgraph, including: if there is a target attribute requirement for a certain configuration item in the preset software requirements, expanding the target attribute into the attribute of the configuration item in the pruned target knowledge graph to obtain an initial subgraph, wherein the target attribute requirement includes: the requirement to obtain the attribute of another type of configuration item associated with the configuration item through a one-to-one or many-to-one relationship link.
[0074] In this embodiment, the required configuration item types and attributes of these configuration items in the CMDB master graph can be filtered out according to preset software requirements, copied to the software subgraph to be constructed, and then the required relationships in the master graph can be filtered out and copied to the software subgraph to obtain the trimmed target knowledge graph.
[0075] In the trimmed target knowledge graph, if there is a need to obtain specific attributes of one type of configuration item associated with another type of configuration item through a one-to-one or many-to-one relationship link, for example, needing to obtain middleware products deployed on a server without being concerned about the middleware deployment architecture, and the CMDB has a "middleware cluster -- middleware member -- logic server" link, where the middleware cluster is associated with a one-to-many relationship with the middleware member and the middleware member is associated with a one-to-one relationship with the logic server, then the logic server is associated with a many-to-one relationship with the middleware cluster. The attributes of the middleware cluster configuration item can be added as extended attributes to the logic server configuration item, thereby removing the middleware member, the middleware cluster, and the relationship between the three types of configuration items from the trimmed target knowledge graph, obtaining the initial subgraph, and achieving the technical effect of reducing the image size.
[0076] Optionally, before creating the topology in the initial subgraph and obtaining the target subgraph, the process further includes: obtaining software query requirements, which include query requirements for querying links in the initial subgraph; based on the software query requirements, identifying links in the initial subgraph with query frequencies higher than a preset frequency threshold to obtain multiple target query links; extracting the common portions of the multiple target query links to obtain shared query links and non-shared query links; and performing path aggregation on the shared query links and non-shared query links based on their hop counts to obtain the aggregated target subgraph, wherein the path aggregation method includes adding direct relationships between configuration items at both ends of the links that need path aggregation.
[0077] In this embodiment, software query requirements can be collected, and commonly used query paths can be identified. For example, starting from software requirements, some relatively fixed query logics can usually be identified. Based on these query logics, specific query paths can be determined and preset as high-frequency query paths. At the same time, the actual query situation can be recorded in the system background, and the query frequency can be counted, thereby adjusting the high-frequency query paths (i.e., paths with a query frequency higher than a preset frequency threshold).
[0078] Specifically, analyzing high-frequency query links can include: if multiple high-frequency query links share a common portion, and this portion is longer than 2 hops, then this portion can be extracted and recorded as a shared high-frequency query link. The remaining non-shared portion replaces the original high-frequency query link (for example, in the high-frequency query links abcde and abcdf, the extracted shared high-frequency query link can be abcde, and the non-shared portion can be de and df, in which case de and df can replace the original high-frequency query link). Then, for high-frequency query links longer than 3 hops and each high-frequency query link within the shared high-frequency query links, pre-aggregation analysis can be performed separately. The pre-aggregation analysis process for a link is as follows: count the number of new edges added to the graph when adding direct relationships between configuration items at both ends of the link (for example, adding direct relationships ac and bd to abcd). Then, removing the head or tail of the link yields two new links (for example, bcd and abc). If the hop count of the new link is greater than 1, repeat the above process until the hop count of the new link is 1. Then, select the link with the smallest number of new edges divided by the link's hop count as the aggregated link.
[0079] Add a direct relationship between the configuration items at both ends of the link that needs path aggregation, and add an attribute to the relationship to record the original link corresponding to the relationship, so as to trace the original query logic. If it can be guaranteed that there are no multiple links associated between the two types of configuration items in the diagram, this attribute can be omitted.
[0080] In one alternative example, link aggregation may not adhere to the principle of minimizing the number of new edges, and the aggregation logic can be adjusted based on experience according to business needs.
[0081] In this embodiment, by aggregating the links, the scale of graph data can be reduced, the efficiency of link data query can be accelerated, and the update and maintenance costs can be reduced.
[0082] Optionally, creating a topology structure in the initial subgraph to obtain the target subgraph further includes: if the topology structure to be created is a multi-level topology structure, creating topology structures sequentially in the initial subgraph according to the order of hierarchy from low to high to obtain a multi-level topology structure, wherein the higher-level topology structure includes the lower-level topology structure; and performing link aggregation on the multi-level topology structure based on the link query frequency of the multi-level topology structure to obtain the target subgraph.
[0083] In this embodiment, it can also be confirmed whether the preset software requirements involve a multi-layered topology. For example, it may be necessary to build a first-level topology representing the basic hardware infrastructure, and then build a second-level topology representing the middleware services, the latter possibly containing the former. The creation of multi-layered topologies follows a hierarchical order from low to high. First, the lowest-level topology is created, typically this level can contain the topology of configuration items (i.e., the first level). After completing the construction of the first-level topology, the second-level topology can be created based on the preset software requirements and existing CMDB data. This level of topology can contain not only configuration items but also the topology of the first level. Similarly, creation proceeds layer by layer upwards until the highest level of requirements is reached. Each level of topology can contain lower-level topologies, forming a hierarchical data structure.
[0084] After constructing a multi-layered topology, the frequency of graph queries performed by various software systems can be collected and analyzed, especially those query links involving cross-layered topologies. Identification of high-frequency query links can be based on statistics of historical query records, which helps determine the focus of aggregation. For identified high-frequency query links, especially those spanning multiple topologies, link aggregation operations can be performed. The basic idea of aggregation is to create a direct relationship between the start and end configuration items of the link to reduce the number of intermediate hops during querying, thereby accelerating the query process. While aggregating links, additional attributes are added to the relationship to record which one or more original links this direct relationship originated from, facilitating the tracing of the original query logic. After configuration item trimming and expansion, link aggregation, and the creation and processing of multi-layered topologies, the final subgraph can be considered the target subgraph. The target subgraph not only meets the needs of specific software but also significantly improves query efficiency and data management flexibility through the construction of multi-layered topologies and aggregated links.
[0085] For example, if a multi-level topology is required, it is created sequentially from lowest to highest level. A topology at level 1 contains only configuration items. A topology at level 2 must contain the topology at level 1 and may contain configuration items. A topology at level n must contain the topology at level n-1 and may contain topologies at levels n-2 and below, or configuration items. If the graph contains multiple levels of topology and there are high-frequency query links involving topology structures, these links are aggregated.
[0086] Figure 2 This is a flowchart of another optional map construction method according to an embodiment of the present invention, such as... Figure 2As shown, the process includes: obtaining raw data (i.e., original CMDB data), filtering the data required for the subgraph, determining whether the source of extended attributes is included in the graph, supplementing the graph with extended attribute data, determining whether the topology creation rules are based on the original data relationships, supplementing the graph with topology rule data, including data inclusion in the graph, creating extended attributes, obtaining the initial subgraph, creating aggregated links, creating the topology, aggregating the relationships between topology members into topology relationships, determining whether there is a higher-level SS, and creating aggregated links based on the new SS relationship.
[0087] This embodiment prunes the complete knowledge graph into subgraphs required by specific software, preserving essential semantic relationships while significantly reducing data size. This enables various business systems to efficiently utilize CMDB data. Currently, the graph construction method provided in this embodiment has been put into practice and fully utilized in knowledge graph retrieval tools and unified end-to-end analysis and monitoring tools. It solves the problems of quickly querying complex configuration item links and rapidly displaying configuration item topology structures in actual production use. Furthermore, the graph construction method provided in this embodiment has a certain degree of compatibility, optimizing queries for graph structures containing long links and complex abstract node groups. It can reduce the size of graph data, lower update and maintenance costs, accelerate CMDB long-link data queries, and reduce the difficulty and performance consumption of obtaining specific graph data sets.
[0088] Example 2
[0089] Embodiment 2 of the present invention provides an optional map construction device, wherein each implementation unit in the map construction device corresponds to each implementation step in Embodiment 1.
[0090] Figure 3 This is a schematic diagram of an optional map construction apparatus according to an embodiment of the present invention, such as... Figure 3 As shown, it includes: a processing unit 31 and a creation unit 32.
[0091] The processing unit 31 is used to obtain configuration item data required by the preset software requirements, and to obtain an initial subgraph based on the configuration item data. The initial subgraph includes nodes representing configuration items in the configuration item data and edges representing the relationships between configuration items in the configuration item data.
[0092] Create unit 32, used to create a topology structure in the initial subgraph to obtain the target subgraph. The topology structure record has at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software. The structure set includes a set obtained by selecting the topology structure of the operation and maintenance object based on the software operation and maintenance data.
[0093] In the graph construction apparatus provided in Embodiment 2 of the present invention, a processing unit 31 is used to acquire configuration item data required by preset software requirements, and an initial subgraph is obtained based on the configuration item data. The initial subgraph includes nodes representing configuration items in the configuration item data and edges representing the relationships between configuration items. A creation unit 32 creates a topology structure in the initial subgraph to obtain a target subgraph. The topology structure records at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items without direct relationships based on software management requirements. The structure set includes a set obtained by selecting the topology structure of the maintenance object based on software maintenance data. This solves the technical problem of high complexity in knowledge graphs corresponding to configuration items and relationships in related technologies. In this embodiment, the total configuration item data is trimmed and a topology structure is added according to software requirements to obtain a target subgraph that meets preset software requirements. This avoids the high complexity of knowledge graphs in related technologies, which leads to high storage costs and low data retrieval efficiency, thereby achieving the technical effect of reducing the complexity of knowledge graphs recording configuration items and relationships.
[0094] Optionally, in the graph construction apparatus provided in Embodiment 2 of the present invention, the creation unit includes: a first creation subunit, used to create a point topology and an edge topology in the initial subgraph to obtain a processed initial subgraph, wherein a point topology represents a topology by a point, and an edge topology represents a topology by an edge; and a first aggregation subunit, used to aggregate the association relationship between configuration items in every two topologies into a relationship between topologies in the processed initial subgraph to obtain a target subgraph.
[0095] Optionally, in the map construction apparatus provided in Embodiment 2 of the present invention, the first creation subunit includes: an acquisition module, configured to acquire a target set of topologies to be created, wherein the target set includes at least one of the following: a structure set and a management set; a first processing module, configured to create a first type of node in the initial subgraph when the type of the target set is a management set, and add a first preset relationship between the first type of node and the node corresponding to the configuration item in the target set in the initial subgraph, so as to create a point topology in the initial subgraph, wherein the first type of node is used to represent the management set; and a second processing module, configured to determine whether the structure set can correspond to the existing configuration item in the initial subgraph when the type of the target set is a structure set, obtain a determination result, and create a point topology in the initial subgraph based on the determination result.
[0096] Optionally, in the atlas construction apparatus provided in Embodiment 2 of the present invention, the second processing module includes: a first processing submodule, configured to create a second type of node in the initial subgraph when the judgment result indicates that the structure set cannot correspond to the existing configuration items in the initial subgraph, and add a second preset relationship between the second type of node and the node corresponding to the configuration item in the target set in the initial subgraph, so as to create a point topology in the initial subgraph, wherein the second type of node is used to represent the structure set; and a second processing submodule, configured to modify the node type of the node corresponding to the configuration item in the structure set in the initial subgraph to configuration item and structure set when the judgment result indicates that the structure set can correspond to the existing configuration items in the initial subgraph, so as to create a point topology in the initial subgraph.
[0097] Optionally, in the graph construction apparatus provided in Embodiment 2 of the present invention, the processing unit includes: an acquisition subunit, used to acquire a knowledge graph associated with a configuration management database to obtain a target knowledge graph, wherein the target knowledge graph includes: nodes that record all configuration items in the configuration management database and edges that record the relationships between all configuration items; and a processing subunit, used to trim the target knowledge graph based on preset software requirements to obtain a trimmed target knowledge graph, and to expand the trimmed target knowledge graph to obtain an initial subgraph, wherein the configuration item data also includes: the trimmed target knowledge graph.
[0098] Optionally, in the graph construction apparatus provided in Embodiment 2 of the present invention, the processing subunit includes: a filtering module, used to filter nodes and edges in the target knowledge graph based on preset software requirements to obtain a trimmed target knowledge graph; the processing subunit further includes: an extension module, used to extend the target attribute to the attribute of the configuration item in the trimmed target knowledge graph when there is a target attribute requirement for a certain configuration item in the preset software requirements, to obtain an initial subgraph, wherein the target attribute requirement includes: the requirement to obtain the attribute of another type of configuration item associated with the configuration item through a one-to-one or many-to-one relationship link.
[0099] Optionally, in the graph construction apparatus provided in Embodiment 2 of the present invention, the graph construction apparatus further includes: an acquisition unit, used to acquire software query requirements before creating a topology structure in the initial subgraph and obtaining the target subgraph, wherein the software query requirements include: query requirements for querying links in the initial subgraph; a determination unit, used to determine links in the initial subgraph whose query frequency is higher than a preset frequency threshold based on the software query requirements, thereby obtaining multiple target query links; a truncation unit, used to truncate the common parts in the multiple target query links, thereby obtaining common query links and non-common query links; and an aggregation unit, used to perform path aggregation on the common query links and non-common query links based on the hop count of the common query links and non-common query links, respectively, thereby obtaining an aggregated target subgraph, wherein the path aggregation method includes: adding a direct relationship between the configuration items at both ends of the links that need to be path aggregated.
[0100] Optionally, in the map construction apparatus provided in Embodiment 2 of the present invention, the creation unit further includes: a second creation subunit, used to create topological structures sequentially in the initial subgraph according to the order of hierarchy from low to high when the topological structure to be created is a multi-level topological structure, thereby obtaining a multi-level topological structure, wherein the higher-level topological structure includes the lower-level topological structure; and a second aggregation subunit, used to perform link aggregation on the multi-level topological structure based on the link query frequency of the multi-level topological structure, thereby obtaining a target subgraph.
[0101] The above-mentioned map construction device may also include a processor and a memory. The processing unit 31 and the creation unit 32 are stored in the memory as program units, and the processor executes the program units stored in the memory to realize the corresponding functions.
[0102] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, the total configuration data can be trimmed and topological structures added according to software requirements to obtain a target subgraph that meets preset software needs. This avoids the high complexity of knowledge graphs in related technologies, which leads to high storage costs and low data retrieval efficiency, thus achieving the technical effect of reducing the complexity of knowledge graphs recording configuration items and relationships.
[0103] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0104] According to another aspect of the present invention, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the map construction method of any of the above-mentioned methods by executing the executable instructions.
[0105] According to another aspect of the present invention, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program controls the device where the computer-readable storage medium is located to execute the map construction method of any of the above-mentioned methods when it is running.
[0106] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention, such as... Figure 4 As shown, an embodiment of the present invention provides an electronic device 40, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the map construction method of any of the above-mentioned methods.
[0107] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0108] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0109] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0110] 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 units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0111] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0112] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. 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, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0113] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for constructing a map, characterized in that, include: Obtain the configuration item data required by the preset software requirements, and obtain an initial subgraph based on the configuration item data, wherein the initial subgraph includes: nodes for representing configuration items in the configuration item data and edges for representing the association relationships between the configuration items in the configuration item data; A topology structure is created in the initial subgraph to obtain the target subgraph. The topology structure records at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software. The structure set includes a set obtained by selecting the topology structure of the operation and maintenance object based on the software operation and maintenance data.
2. The map construction method according to claim 1, characterized in that, A topological structure is created in the initial subgraph to obtain the target subgraph, including: In the initial subgraph, a vertex topology and an edge topology are created to obtain the processed initial subgraph. In the vertex topology, a topology is represented by a vertex, and in the edge topology, a topology is represented by an edge. In the processed initial subgraph, the associations between configuration items within every two topologies are aggregated into relationships between topologies to obtain the target subgraph.
3. The map construction method according to claim 1, characterized in that, Creating a point topology in the initial subgraph includes: Obtain the target set of topologies to be created, wherein the target set includes at least one of the following: the structure set, the management set; When the type of the target set is a management set, a first type of node is created in the initial subgraph, and a first preset relationship is added between the first type of node and the corresponding node in the initial subgraph in the configuration items of the target set, so as to create the point topology structure in the initial subgraph, wherein the first type of node is used to represent the management set; If the type of the target set is a structure set, determine whether the structure set can correspond to the existing configuration items in the initial subgraph, obtain the determination result, and create the point topology structure in the initial subgraph based on the determination result.
4. The map construction method according to claim 3, characterized in that, Based on the judgment result, the point topology structure is created in the initial subgraph, including: If the judgment result indicates that the structure set cannot correspond to the existing configuration item in the initial subgraph, a second type of node is created in the initial subgraph, and a second preset relationship is added between the second type of node and the configuration item in the target set corresponding to the node in the initial subgraph, so as to create the point topology structure in the initial subgraph, wherein the second type of node is used to represent the structure set; If the determination result indicates that the structure set corresponds to the existing configuration item in the initial subgraph, the node type of the corresponding node in the initial subgraph of the configuration item in the structure set is modified to configuration item and structure set, so as to create the point topology structure in the initial subgraph.
5. The map construction method according to claim 2, characterized in that, Obtain the configuration item data required by the preset software requirements, and based on the configuration item data, obtain an initial subgraph, including: Obtain the knowledge graph associated with the configuration management database to obtain the target knowledge graph, wherein the target knowledge graph includes: nodes that record all configuration items in the configuration management database and edges that record the association relationships between all configuration items; The target knowledge graph is trimmed based on the preset software requirements to obtain a trimmed target knowledge graph, and the trimmed target knowledge graph is expanded to obtain the initial subgraph. The configuration item data also includes the trimmed target knowledge graph.
6. The map construction method according to claim 5, characterized in that, The target knowledge graph is trimmed based on the preset software requirements to obtain a trimmed target knowledge graph, including: filtering nodes and edges in the target knowledge graph based on the preset software requirements to obtain the trimmed target knowledge graph. Expanding the configuration item data to obtain the initial subgraph includes: when there is a target attribute requirement for a certain configuration item in the preset software requirements, expanding the target attribute into the attribute of the configuration item in the trimmed target knowledge graph to obtain the initial subgraph, wherein the target attribute requirement includes: the requirement to obtain the attribute of another type of configuration item associated with the configuration item through a one-to-one or many-to-one relationship link.
7. The map construction method according to claim 1, characterized in that, Before creating the topology in the initial subgraph and obtaining the target subgraph, the process also includes: Obtain software query requirements, wherein the software query requirements include: query requirements for querying links in the initial subgraph; Based on the software query requirements, links in the initial subgraph with query frequencies higher than a preset frequency threshold are identified, resulting in multiple target query links. The common parts of multiple target query links are extracted to obtain the common query links and the non-common query links; Based on the hop count of the shared query link and the non-shared query link, path aggregation is performed on the shared query link and the non-shared query link respectively to obtain the aggregated target subgraph. The path aggregation method includes adding a direct relationship between the configuration items at both ends of the link that needs to be path aggregated.
8. The map construction method according to claim 1, characterized in that, Creating a topology in the initial subgraph to obtain the target subgraph also includes: When the topology to be created is a multi-level topology, the topology is created sequentially in the initial subgraph according to the order of hierarchy from low to high, resulting in a multi-level topology, wherein the higher-level topology includes the lower-level topology. Based on the link query frequency of the multi-layered topology, link aggregation is performed on the multi-layered topology to obtain the target subgraph.
9. A map construction apparatus, characterized in that, include: The processing unit is used to acquire configuration item data required by preset software requirements, and to obtain an initial subgraph based on the configuration item data, wherein the initial subgraph includes: nodes representing configuration items in the configuration item data and edges representing the association relationships between the configuration items in the configuration item data; A creation unit is used to create a topology structure in the initial subgraph to obtain a target subgraph, wherein the topology structure records at least one of the following: a structure set and a management set. The management set includes a set obtained by logically grouping configuration items that are not directly related based on the management requirements of the software. The structure set includes a set obtained by selecting the topology structure of the operation and maintenance object based on the software operation and maintenance data.
10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the map construction method according to any one of claims 1 to 8.