Hybrid cloud architecture graph construction method and system, electronic device, and storage medium
By collecting and building container asset information tables in real time in hybrid clouds, the problems of long self-discovery time and untimely updates of architecture graphs in hybrid clouds are solved, achieving efficient and accurate architecture graph construction and updates, and reducing operation and maintenance difficulties.
Patent Information
- Application Number
- CN202410162038.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-02-05
AI Technical Summary
In hybrid cloud environments, container self-discovery takes a long time and the architecture map is not updated in a timely manner, leading to differences in application system architecture on different cloud platforms and causing operational failures.
By deploying a collection agent on a hybrid cloud platform or embedding data points in container images, application container information can be collected in real time, container self-discovery can be performed, a container asset information table can be built, and an architecture graph can be constructed based on dependencies.
It improves the efficiency and accuracy of container self-discovery, updates the architecture diagram in a timely manner, has strong application adaptive capabilities, and reduces operational cognitive biases.
Smart Images

Figure CN118796301B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a hybrid cloud architecture graph construction method and system, an electronic device, and a storage medium. BACKGROUND
[0002] Hybrid cloud refers to a cloud computing architecture mode that combines public cloud and private cloud, which provides enterprises with more flexible and customizable cloud computing solutions, enabling enterprises to choose the most suitable deployment method according to actual needs.
[0003] Containers in the hybrid cloud change rapidly, and due to different index data structures of different cloud platforms in the hybrid cloud, the time consumption of container self-discovery under the hybrid cloud is relatively long. Moreover, the architecture of the application system in the hybrid cloud may change at any time, and due to the fact that the architecture graph is not updated in time in the prior art, differences in the architecture graph of the same application system on different cloud platforms occur, resulting in running failures. SUMMARY
[0004] The present application provides a hybrid cloud architecture graph construction method and system, an electronic device, and a storage medium, to solve the problem of long time consumption of container self-discovery under the hybrid cloud and the problem of untimely updating of the architecture graph in the prior art.
[0005] The present application provides a hybrid cloud architecture graph construction method, comprising:
[0006] By deploying a collection agent on at least one cloud platform of the hybrid cloud, or by burying points in the container image of the application system of the cloud platform, application container information can be obtained when the application container is started;
[0007] Based on the container name in the application container information, container self-discovery is performed to obtain new container information;
[0008] Based on the new container information, container asset life cycle management and asset data integration are performed to obtain a container asset information table;
[0009] Based on the container asset information table and the dependency relationship in the configuration management database, the architecture graph of the application system is constructed, the dependency relationship including the association relationship between the application system and the cluster module, and the association relationship between the cluster modules, and the cluster module and the container cluster are in one-to-one correspondence.
[0010] Optionally, the application container information includes the container name, container state, namespace information, and container cluster information, the namespace information indicating the cloud platform to which the current application container belongs, and the container cluster information indicating the information of the container cluster to which the current application container belongs.
[0011] Optionally, the collection agent and the embedded point are both used to collect the application container information when the application container is started, and transmit the application container information to a KAFKA message queue;
[0012] The step of obtaining the application container information by deploying the collection agent on at least one cloud platform of the hybrid cloud or embedding the point in the container image of the application system of the cloud platform when the application container is started includes:
[0013] Real-time consumption of data in the KAFKA message queue to obtain the application container information, the application container information being JSON string data.
[0014] Optionally, the step of container self-discovery based on the container name in the application container information to obtain new container information includes:
[0015] Based on the container name, container self-discovery is performed to determine all information associated with the container name in the application container information as new container information, the new container information being JSON string data.
[0016] Optionally, the step of container asset lifecycle management and asset data integration based on the new container information to obtain a container asset information table includes:
[0017] Based on the container state in the new container information, expired container information is determined and deleted, the expired container information referring to the new container information whose container state is destroyed;
[0018] Based on the remaining new container information, asset data integration is performed to obtain the container asset information table.
[0019] Optionally, the step of asset data integration based on the remaining new container information to obtain the container asset information table includes:
[0020] The container name in the new container information is written into a preset container asset information table template;
[0021] The container name in the container asset information table template is used as a primary key, and the remaining new container information is subjected to a loop exhaustive matching to obtain namespace information associated with the container name, the namespace information referring to the cloud platform to which the current application container belongs, the namespace information being information associated with the container name in the new container information;
[0022] The namespace information associated with the container name is determined as a PAAS tag of the current container name, and the PAAS tag is written into the container asset information table template;
[0023] Taking the container name in the container asset information table template as a primary key, performing a loop exhaustive matching on the remaining new container information, obtaining container cluster information associated with the container name, the container cluster information indicating a container cluster to which the application container currently belongs, and the container cluster information being information associated with the container name in the new container information;
[0024] Writing the container cluster information associated with the container name into the container asset information table template;
[0025] Taking the container name and the container cluster information in the container asset information table template as a joint primary key, traversing each of the remaining new container information, obtaining a target string, the container name in the target string being the same as the container name in the current joint primary key, and the container cluster information in the target string being the same as the container cluster information in the current joint primary key;
[0026] Performing field segmentation on the target string to obtain a segmented field;
[0027] Writing the segmented field into the container asset information table template until no field is added, to obtain the container asset information table.
[0028] Optionally, based on the container asset information table and a dependency relationship in a configuration management database, the step of constructing an architecture graph of the application system comprises:
[0029] Matching the container cluster information in the container asset information table with the cluster module in the configuration management database, and in the case of completing the matching, traversing the container asset information table according to the container cluster information to establish an association relationship between the cluster module and the container name;
[0030] Based on the dependency relationship, taking the cluster module as a starting point, searching for an application system node, and obtaining a first shortest path between the cluster module and the application system node;
[0031] Determining the application system node as a source node, and based on the first shortest path, obtaining a second shortest path from the source node to each child node associated with the source node, the child node being an application container;
[0032] In the case of obtaining the second shortest path, generating a shortest path tree;
[0033] In the case of obtaining the shortest path tree, based on the PAAS label associated with each application container, dividing the cluster module to determine the cloud platform to which the cluster module belongs, and completing the construction of the architecture graph.
[0034] The application further provides a hybrid cloud architecture graph construction system, comprising:
[0035] A data receiving module is configured to deploy a collection agent on at least one cloud platform of the hybrid cloud or to bury a point in a container image of an application system of the cloud platform, so as to obtain application container information when the application container is started.
[0036] A container self-discovery module is configured to perform container self-discovery based on a container name in the application container information, so as to obtain new container information.
[0037] A container asset management module is configured to perform container asset life cycle management and asset data integration based on the new container information, so as to obtain a container asset information table.
[0038] A graph construction module is configured to construct an architecture graph of the application system based on the container asset information table and a dependency relationship in a configuration management database, wherein the dependency relationship comprises an association relationship between the application system and a cluster module and between the cluster modules, and the cluster modules and container clusters are in one-to-one correspondence.
[0039] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the hybrid cloud architecture graph construction method according to any one of the above when executing the program.
[0040] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the hybrid cloud architecture graph construction method according to any one of the above.
[0041] The hybrid cloud architecture graph construction method, system, electronic device, and storage medium provided by the application can effectively improve the efficiency and accuracy of container self-discovery under a hybrid cloud, and can update the architecture graph in a timely manner, has high accuracy, and has strong application adaptive ability. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0043] Figure 1 is a flowchart of the hybrid cloud architecture graph construction method provided by the present application;
[0044] Figure 2 is an exemplary schematic diagram of the dependency relationship in the hybrid cloud architecture graph construction method provided by the present application;
[0045] Figure 3 is an exemplary schematic diagram of the architecture graph in the hybrid cloud architecture graph construction method provided by the present application;
[0046] Figure 4 is a structural schematic diagram of the hybrid cloud architecture graph construction system provided by the present application;
[0047] Figure 5 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0048] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0049] The hybrid cloud architecture graph construction method, system, electronic device and storage medium provided by the present application will be described below in the form of embodiments in combination with Figures 1-5
[0050] Please refer to Figure 1 The hybrid cloud architecture graph construction method provided by the present application comprises the following steps.
[0051] S110: Collecting agents are deployed on at least one cloud platform of the hybrid cloud, or points are buried in the container image of the application system of the cloud platform, so that application container information can be obtained when the application container is started.
[0052] Specifically, by deploying a collection agent on a cloud platform or by instrumenting an application system container image, and then distributing the instrumented container image to various cloud platforms (such as PAAS1, PAAS2, PAAS3, etc.), the application container information is collected. The full name of PAAS is Platform as a Service (Platform as a Service). When the application container starts, the collection agent or the instrumentation obtains the application container information from the configuration of the environment variable of the application container.
[0053] It should be noted that, since the container data output by the mainstream cloud platform at present, that is, the application container information, is unstructured, which can easily lead to application container information collection failure and data loss, etc., therefore, the embodiment eliminates the data differences of different cloud platforms, adapts the application container information of different cloud platforms, and effectively improves the real-time stability of the application container information collection by generalizing the collection mode, that is, by deploying a collection agent on at least one cloud platform of a hybrid cloud or by instrumenting the container image of the application system of the cloud platform. It can be understood that the generalization collection mode means that the application container information can be collected by deploying a collection agent or by instrumenting a container image, and the adaptation to different cloud platforms is realized.
[0054] S120: based on the container name in the application container information, container self-discovery is performed to obtain new container information.
[0055] It should be noted that, by performing container self-discovery based on the container name in the application container information, the timeliness of container self-discovery is effectively improved.
[0056] S130: based on the new container information, container asset life cycle management and asset data integration are performed to obtain a container asset information table.
[0057] It should be noted that, by performing container asset life cycle management and asset data integration based on the new container information, the management of the data volume in the container asset information table is better realized, the real-time information of the container asset is ensured, and dynamic management of the container asset under the hybrid cloud is realized.
[0058] S140: based on the container asset information table and the dependency relationship in the configuration management database (CMDB, Configuration Management Database), an architecture map of the application system is constructed. The dependency relationship includes the association relationship between the application system and the cluster module, and between the cluster modules, and the cluster module and the container cluster one-to-one correspondence.
[0059] It should be noted that when each application system joins the network, its dependencies, i.e., application relationships, are entered into the configuration management database, generating an application asset model. Please refer to the example diagram of dependencies or application asset models. Figure 2 .like Figure 2 As shown, there are relationships or dependencies between application system 1, cluster module 1, cluster module 2, cluster module 3, and cluster module n, where n represents the number of cluster modules. By constructing an architecture graph of the application system based on the dependencies in the container asset information table and configuration management database, the timeliness of architecture graph construction can be ensured, while also helping to improve the accuracy of the architecture graph.
[0060] In some embodiments, the application container information includes: the container name, container status, namespace information, and container cluster information, wherein the namespace information refers to the cloud platform to which the current application container belongs, and the container cluster information refers to the information of the container cluster to which the current application container belongs.
[0061] Specifically, the container names include dp-pod1, dp-pod2, etc. The container status includes: healthy, starting, and destroyed. The namespace information includes: PAAS1, PAAS2, and PAAS3, etc. The container cluster information includes APPID1, APPID2, and APPID3, etc. It should be noted that the application container information also includes application container association information such as container storage unit, host IP, and collection time, which will not be elaborated here.
[0062] In some embodiments, both the acquisition agent and the data entry point are used to acquire application container information when the application container starts, and transmit the application container information to the KAFKA message queue.
[0063] Furthermore, the steps to obtain application container information when the application container starts include deploying a collection agent on at least one cloud platform in a hybrid cloud, or embedding data points in the container image of the application system on the cloud platform:
[0064] The application container information, which is a JSON string, is obtained by consuming data from the Kafka message queue in real time. It should be noted that obtaining the JSON string by consuming data from the Kafka message queue in real time facilitates the subsequent extraction of new container information, thereby achieving the goal of container self-discovery in a hybrid cloud environment.
[0065] In some embodiments, the step of performing container self-discovery based on the container name in the application container information to obtain new container information includes:
[0066] Based on the container name, container self-discovery is performed to determine all information associated with the container name in the application container information as new container information, which is JSON string data. It should be noted that the new container information is extracted from the application container information, and the new container information includes the container name, the container state, the namespace information, the container cluster information, etc. associated with the container name.
[0067] In some embodiments, based on the new container information, the step of performing container asset life cycle management and asset data integration to obtain the container asset information table includes:
[0068] ① Based on the container state in the new container information, determine and delete expired container information, which refers to the new container information whose container state is destroyed. It should be noted that by deleting the expired container information based on the container state field in the new container information, the effective control of the volume of asset data can be achieved, the real-time effectiveness of the container asset is guaranteed, and the dynamic management of the life cycle of the container asset is realized.
[0069] ② Based on the remaining new container information, perform asset data integration to obtain the container asset information table.
[0070] It should be noted that by integrating asset data based on the remaining new container information, a real-time and effective container asset information table can be obtained. Moreover, by using a single table storage method, subsequent dynamic management of the life cycle of the container asset can be facilitated.
[0071] In some embodiments, it further includes: based on a preset management period, periodically performing dynamic management of the life cycle of the container asset on the container asset information table to ensure the real-time effectiveness of the container asset. Specifically, based on the management period, periodically query the container state in the container asset information table, and delete the corresponding container asset data in the container asset information table when the container state is destroyed.
[0072] In some embodiments, based on the remaining new container information, the step of performing asset data integration to obtain the container asset information table includes:
[0073] First, write the container name in the new container information into a preset container asset information table template.
[0074] It should be noted that the container asset information table template can be defined using a FLINK stream processing task.
[0075] Secondly, taking the container name in the container asset information table template as the primary key, the remaining new container information is cyclically and exhaustively matched to obtain namespace information associated with the container name, the namespace information indicating the cloud platform to which the current application container belongs, and the namespace information being information associated with the container name in the new container information.
[0076] It should be noted that the primary key can be defined using the FLINK stream processing task, i.e., the container name is defined as the primary key, or the container name and container cluster information are defined as the joint primary key.
[0077] Then, the namespace information associated with the container name is determined as the PAAS label of the current container name, and the PAAS label is written into the container asset information table template. Specifically, in this embodiment, a label model is adopted, and the running logic of the label model is that the container name field is taken as the primary key, the remaining new container information is cyclically and exhaustively matched to obtain the namespace information associated with the container name, and the corresponding PAAS label is added to the container name according to the obtained namespace information. Table 1 below shows the container name and PAAS label fields after storage.
[0078] Table 1: Container name and PAAS label field examples after storage
[0079] Container name PAAS tag dp-pod1 PAAS1 dp-pod2 PAAS1 dp-pod3 PAAS2
[0080] Secondly, taking the container name in the container asset information table template as the primary key, the remaining new container information is cyclically and exhaustively matched to obtain namespace information associated with the container name, the namespace information indicating the cloud platform to which the current application container belongs, and the namespace information being information associated with the container name in the new container information.
[0081] Then, the container cluster information associated with the container name is written into the container asset information table template. Specifically, the container cluster information associated with the container name is stored.
[0082] After that, taking the container name and container cluster information in the container asset information table template as the joint primary key, each piece of the remaining new container information is traversed to obtain a target string, the container name in the target string being the same as the container name of the current joint primary key, and the container cluster information in the target string being the same as the container cluster information of the current joint primary key. Specifically, based on the joint primary key, a string search algorithm is used cyclically to traverse each piece of the remaining new container information, i.e., to traverse each piece of JSON string data to obtain the target string.
[0083] Then, the target string is field-split to obtain a split field. Specifically, each field in the target string is split using a field-splitting method to obtain the split field.
[0084] Finally, the split field is written into the container asset information table template until no field is added, to obtain the container asset information table. Specifically, the split field is appended to the database until no field is added, to obtain the complete container asset information table. It should be noted that if the split field is a non-primary key duplicate field, that is, it is not one of the joint primary keys, and a repetition occurs with other fields already stored in the database, such as the container IP port field of application container 1 already existing in the container asset information table, and the container IP port appears in the split field this time, the latest appearing container IP port is used to overwrite the original container IP port field in the container asset information table. In addition, if there is a field that cannot be cut, it is discarded. It should also be noted that the last non-destroyed container valid field is retained as the asset information and attribute value of the container. The container asset information table is shown in Table 2 as follows:
[0085] Table 2 Container asset information example
[0086]
[0087] It should be noted that the step of integrating asset data based on the remaining new container information to obtain the container asset information table is performed by a preset integration model.
[0088] It should be noted that in the above embodiments, the container name is used as the primary key, and the newly added container is discovered in real time, and the expired container information is deleted. A single table storage form is used to integrate container asset data. And according to the container state, the asset life cycle is dynamically managed to realize real-time running state of the container asset lightweight management, solve the problem of low data processing efficiency caused by fast container change and large data volume. In performance index, application log, business index association, historical data fast retrieval and other consumption scenarios, the query efficiency of the container name can be effectively improved, and the positioning of fault root cause is accelerated.
[0089] In some embodiments, based on the container asset information table and the dependency relationship in the configuration management database, the step of constructing the architecture graph of the application system includes:
[0090] Firstly, container cluster information in the container asset information table is matched with the cluster module in the configuration management database (the cluster module is a professional term in the configuration management database, which is equivalent to a container cluster), and in the case of matching, the container asset information table is traversed according to the container cluster information to establish an association relationship between the cluster module and the container name.
[0091] Secondly, based on the dependency relationship, the application system node is searched from the cluster module as a starting point, and the first shortest path between the cluster module and the application system node is obtained. Specifically, in order to quickly construct the architecture graph, the breadth-first search method is adopted to search the upstream application system node from the cluster module node, and the path between the cluster module and the application system node is obtained, and then the first shortest path between the cluster module and the application system node (i.e. the application system) is obtained.
[0092] It should be noted that since the application container has dynamic variability, the container information is not maintained or updated in the CMDB, that is, the dependency relationship between different nodes. In this embodiment, in order to realize real-time construction of the architecture graph, the container cluster information field of each application container is matched with the cluster module, and based on the container cluster information, the container asset information table is traversed, and the association between the container cluster information and the corresponding container name is established in a unit of time, that is, the association between the cluster module and the container name, to determine the superior-inferior relationship of the application container and the container cluster.
[0093] Then, the application system node is determined as a source node, and based on the first shortest path, the second shortest path from the source node to each child node associated with the source node is obtained, and the child node is an application container.
[0094] Then, in the case of obtaining the second shortest path, a shortest path tree is generated. It should be noted that through the generation of the shortest path tree, the cascade relationship data mapping between the application system-container cluster\cluster module-application container is realized.
[0095] Finally, in the case of obtaining the shortest path tree, based on the PAAS tag associated with each application container, the cluster module is divided to determine the cloud platform to which the cluster module belongs, and the construction of the architecture graph is completed. Figure 3 An exemplary schematic diagram of the architecture graph is shown in FIG. Figure 3As shown, the application system 1 is associated with a cloud platform 1, a cloud platform 2, and a cloud platform z, where z represents the number of cloud platforms. Each cloud platform includes at least one cluster module, i.e., a container cluster. There is an association path between each cluster module, such as cluster module 1, cluster module 2, cluster module 3, and cluster module n in the cloud platform 1, cluster module 1 and cluster module 2 in the cloud platform 2, and cluster module 1, cluster module 3, and cluster module n in the cloud platform z. Due to the large number of application containers, Figure 3 In the architecture atlas, the specific implementation process can be detailed by drilling down the page.
[0096] The above embodiment preferably realizes real-time construction and presentation of the architecture atlas in the hybrid cloud, which can facilitate correction of cognitive bias of application operation and maintenance caused by changes in architecture deployment of different cloud platforms due to release changes. It can be understood that in the case of application system release changes, if the architecture atlas construction or update is not timely, the corresponding operation and maintenance personnel may have cognitive bias, which may have unnecessary impact on the overall architecture of the hybrid cloud.
[0097] It should be noted that the hybrid cloud architecture atlas construction method in the above embodiment addresses the problem of difficulty in drawing the architecture atlas due to changes in the architecture of the same application system in different cloud platforms in the hybrid cloud. By taking the application container information as the entry point, not only is efficient container self-discovery achieved, but also the architecture atlas of different application systems is quickly drawn, and changes in architecture deployment are presented in real time. The architecture atlas drawing efficiency is high, the accuracy is high, and no manual intervention is required, which is low in cost.
[0098] The hybrid cloud architecture atlas construction system provided by the present application will be described below. The hybrid cloud architecture atlas construction system described below can be correspondingly referred to the hybrid cloud architecture atlas construction method described above.
[0099] Please refer to Figure 4 The hybrid cloud architecture atlas construction system provided by the present embodiment comprises:
[0100] The data receiving module 410 is configured to collect the application container information by deploying a collection agent in at least one cloud platform of the hybrid cloud or by setting a point in the container image of the application system of the cloud platform, so as to obtain the application container information when the application container is started.
[0101] The container self-discovery module 420 is configured to perform container self-discovery based on the container name in the application container information to obtain new container information.
[0102] The container asset management module 430 is configured to perform container asset life cycle management and asset data integration based on the new container information to obtain a container asset information table.
[0103] The atlas construction module 440 is configured to construct an architecture atlas of the application system based on the container asset information table and dependency relationships in the configuration management database, the dependency relationships including association relationships between the application system and the cluster modules and between the cluster modules, and the cluster modules correspond to the container clusters one by one. The data receiving module 410, the container self-discovery module 420, the container asset management module 430, and the atlas construction module 440 are connected. The hybrid cloud architecture atlas construction system in this embodiment can effectively improve the efficiency and accuracy of container self-discovery under a hybrid cloud, and can update the architecture atlas in a timely manner, has high accuracy, has strong application adaptive ability, has strong implementability, and has low cost.
[0104] In some embodiments, the data receiving module 410 is specifically configured to consume data in the KAFKA message queue in real time to obtain the application container information, and the application container information is JSON string data.
[0105] In some embodiments, the container self-discovery module 420 is specifically configured to perform container self-discovery based on the container name to determine all information associated with the container name in the application container information as new container information, and the new container information is JSON string data.
[0106] In some embodiments, the container asset management module 430 is specifically configured to determine and delete expired container information based on a container state in the new container information, and the expired container information refers to the new container information whose container state is destroyed.
[0107] Based on the remaining new container information, asset data integration is performed to obtain the container asset information table.
[0108] In some embodiments, the container asset management module 430 is further specifically configured to write the container name in the new container information into a preset container asset information table template.
[0109] The container name in the container asset information table template is used as a primary key, and the remaining new container information is subjected to cyclic exhaustive matching to obtain namespace information associated with the container name, and the namespace information refers to a cloud platform to which the current application container belongs, and the namespace information is information associated with the container name in the new container information.
[0110] The namespace information associated with the container name is determined as a PAAS tag of the current container name, and the PAAS tag is written into the container asset information table template.
[0111] taking the container name in the container asset information table template as a primary key, performing a loop exhaustive matching on the remaining new container information to obtain container cluster information associated with the container name, the container cluster information indicating the container cluster to which the current application container belongs, the container cluster information being information associated with the container name in the new container information;
[0112] writing the container cluster information associated with the container name into the container asset information table template;
[0113] taking the container name and the container cluster information in the container asset information table template as a joint primary key, traversing each of the remaining new container information to obtain a target string, the container name in the target string being the same as the container name in the current joint primary key, and the container cluster information in the target string being the same as the container cluster information in the current joint primary key;
[0114] performing field segmentation on the target string to obtain a segmented field;
[0115] writing the segmented field into the container asset information table template until no field is added, to obtain the container asset information table.
[0116] In some embodiments, the graph construction module 440 is specifically configured to match the container cluster information in the container asset information table with the cluster module in the configuration management database, and in the case of matching completion, traverse the container asset information table according to the container cluster information to establish an association relationship between the cluster module and the container name;
[0117] based on the dependency relationship, taking the cluster module as a starting point, searching for an application system node, and obtaining a first shortest path between the cluster module and the application system node;
[0118] determining the application system node as a source node, and based on the first shortest path, obtaining a second shortest path from the source node to each child node associated with the source node, the child node being an application container;
[0119] in the case of obtaining the second shortest path, generating a shortest path tree;
[0120] in the case of obtaining the shortest path tree, based on the PAAS label associated with each application container, dividing the cluster module to determine the cloud platform to which the cluster module belongs, and completing the construction of the architecture graph.
[0121] Figure 5 An example of an entity structure diagram of an electronic device is shown as Figure 5As shown, the electronic device can include a processor 510, a communications interface 520, a memory 530, and a communications bus 540, wherein the processor 510, the communications interface 520, and the memory 530 complete mutual communication through the communications bus 540. The processor 510 can invoke a logical instruction in the memory 530 to execute a hybrid cloud architecture graph construction method, which includes: obtaining application container information by deploying a collection agent on at least one cloud platform of the hybrid cloud or by burying a point in a container image of an application system of the cloud platform, so that the application container information is obtained when the application container is started; performing container self-discovery based on a container name in the application container information to obtain new container information; performing container asset life cycle management and asset data integration based on the new container information to obtain a container asset information table; and constructing an architecture graph of the application system based on the container asset information table and a dependency relationship in a configuration management database, the dependency relationship including an association relationship between the application system and a cluster module and between the cluster modules, and the cluster module and the container cluster corresponding to each other.
[0122] In addition, the logical instruction in the memory 530 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0123] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the hybrid cloud architecture graph construction method provided by the above method, and the method comprises: obtaining application container information by deploying a collection agent on at least one cloud platform of the hybrid cloud or by burying a point in a container image of an application system of the cloud platform, so that the application container information is obtained when the application container is started; performing container self-discovery based on the container name in the application container information to obtain new container information; performing container asset life cycle management and asset data integration based on the new container information to obtain a container asset information table; and constructing an architecture graph of the application system based on the container asset information table and a dependency relationship in a configuration management database, the dependency relationship comprising an association relationship between the application system and a cluster module and between the cluster modules, and the cluster module and the container cluster corresponding to each other.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0125] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary universal hardware platforms, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for constructing a hybrid cloud architecture graph, characterized in that, include: By deploying a collection agent on at least one cloud platform in a hybrid cloud, or by embedding data points in the container image of the application system on the cloud platform, application container information can be obtained when the application container starts. Based on the container name in the application container information, container self-discovery is performed to obtain new container information; Based on the newly added container information, container asset lifecycle management and asset data integration are performed to obtain a container asset information table; Based on the container asset information table and the dependencies in the configuration management database, the architecture diagram of the application system is constructed. The dependencies include the association between the application system and the cluster module, and between the cluster modules. Each cluster module corresponds one-to-one with a container cluster. The steps of performing container asset lifecycle management and asset data integration based on the newly added container information to obtain a container asset information table include: Based on the container status in the newly added container information, expired container information is identified and deleted, where expired container information refers to newly added container information whose container status is destroyed; Based on the remaining information of the newly added containers, asset data is integrated to obtain the container asset information table; The steps for constructing the architecture diagram of the application system based on the container asset information table and the dependency relationships in the configuration management database include: The container cluster information in the container asset information table is matched with the cluster module in the configuration management database. If the match is successful, the container asset information table is traversed according to the container cluster information to establish the association between the cluster module and the container name. Based on the aforementioned dependency relationship, starting from the cluster module, the application system nodes are searched, and the first shortest path between the cluster module and the application system nodes is obtained. The application system node is determined as the source node. Based on the first shortest path, a second shortest path is obtained from the source node to each child node associated with the source node, where the child node is an application container. Given the second shortest path, generate a shortest path tree; Given the shortest path tree, the cluster modules are divided based on the PaaS tag associated with each application container to determine the cloud platform to which the cluster modules belong, thus completing the construction of the architecture graph.
2. The hybrid cloud architecture graph construction method according to claim 1, characterized in that, The application container information includes: the container name, container status, namespace information, and container cluster information. The namespace information refers to the cloud platform to which the current application container belongs, and the container cluster information refers to the information of the container cluster to which the current application container belongs.
3. The hybrid cloud architecture graph construction method according to claim 1, characterized in that, Both the data collection agent and the data entry point are used to collect application container information when the application container starts, and transmit the application container information to the KAFKA message queue. The steps to obtain application container information when the application container starts include deploying a collection agent on at least one cloud platform in a hybrid cloud, or embedding data points in the container image of the application system on the cloud platform: The data in the KAFKA message queue is consumed in real time to obtain the application container information, which is a JSON string.
4. The hybrid cloud architecture graph construction method according to claim 1, characterized in that, The steps for obtaining new container information through container self-discovery based on the container name in the application container information include: Based on the container name, container self-discovery is performed to identify all information in the application container information associated with the container name as new container information, which is JSON string data.
5. The hybrid cloud architecture graph construction method according to claim 1, characterized in that, The steps for integrating asset data based on the remaining newly added container information to obtain the container asset information table include: Write the container name from the newly added container information into the preset container asset information table template; Using the container name in the container asset information table template as the primary key, the remaining new container information is cyclically and exhaustively matched to obtain the namespace information associated with the container name. The namespace information refers to the cloud platform to which the current application container belongs, and the namespace information is the information associated with the container name in the new container information. The namespace information associated with the container name is determined as the PAAS tag of the current container name, and the PAAS tag is written into the container asset information table template; Using the container name in the container asset information table template as the primary key, the remaining newly added container information is cyclically and exhaustively matched to obtain the container cluster information associated with the container name. The container cluster information refers to the container cluster to which the current application container belongs. The container cluster information is the information associated with the container name in the newly added container information. Write the container cluster information associated with the container name into the container asset information table template; Using the container name and container cluster information in the container asset information table template as a composite primary key, traverse each remaining piece of newly added container information to obtain a target string. The container name in the target string is the same as the container name in the current composite primary key, and the container cluster information in the target string is the same as the container cluster information in the current composite primary key. The target string is split into fields to obtain the split fields; Write the segmentation fields into the container asset information table template until no more fields are added, thus obtaining the container asset information table.
6. A hybrid cloud architecture graph construction system, characterized in that, include: The data receiving module is used to obtain application container information when the application container starts by deploying a collection agent on at least one cloud platform in a hybrid cloud or by embedding a point in the container image of the application system on the cloud platform. The container self-discovery module is used to perform container self-discovery based on the container name in the application container information to obtain information on newly added containers; The container asset management module is used to perform container asset lifecycle management and asset data integration based on the newly added container information to obtain a container asset information table. The graph construction module is used to construct the architecture graph of the application system based on the container asset information table and the dependency relationship in the configuration management database. The dependency relationship includes the association relationship between the application system and the cluster module, and the association relationship between the cluster modules. The cluster module corresponds one-to-one with the container cluster. The steps of performing container asset lifecycle management and asset data integration based on the newly added container information to obtain a container asset information table include: Based on the container status in the newly added container information, expired container information is identified and deleted, where expired container information refers to newly added container information whose container status is destroyed; Based on the remaining information of the newly added containers, asset data is integrated to obtain the container asset information table; The steps for constructing the architecture diagram of the application system based on the container asset information table and the dependency relationships in the configuration management database include: The container cluster information in the container asset information table is matched with the cluster module in the configuration management database. If the match is successful, the container asset information table is traversed according to the container cluster information to establish the association between the cluster module and the container name. Based on the aforementioned dependency relationship, starting from the cluster module, the application system nodes are searched, and the first shortest path between the cluster module and the application system nodes is obtained. The application system node is determined as the source node. Based on the first shortest path, a second shortest path is obtained from the source node to each child node associated with the source node, where the child node is an application container. Given the second shortest path, generate a shortest path tree; Given the shortest path tree, the cluster modules are divided based on the PaaS tag associated with each application container to determine the cloud platform to which the cluster modules belong, thus completing the construction of the architecture graph.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the hybrid cloud architecture graph construction method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the hybrid cloud architecture graph construction method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Application topological graph identification method and device
CN109840533A
Knowledge graph application method and platform, electronic equipment and storage medium
CN113377739A