Association relation generation method and device of cloud native application, electronic equipment and medium
By identifying and tagging workload resources in a cloud-native environment and building multi-dimensional association indexes, the problem that existing technology cannot fully reflect user-defined associations and cross-resource dependencies is solved, and a more complete and accurate application topology diagram is achieved.
Patent Information
- Application Number
- CN202510551748.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The existing technology is difficult to fully reflect user-defined associations and cross-resource dependencies in a cloud-native environment, resulting in the generated topology maps that are not comprehensive enough and it is difficult to accurately present complex application architectures.
By identifying the workload resources of the cluster and adding hierarchical labels to them, a multi-dimensional association index is built to obtain the association relationship of cloud-native applications. This method includes identifying workload resources, adding explicit and implicit labels, building multi-dimensional correlation indexes, and building priority event queues and topological calculation modules for real-time difference calculations.
A comprehensive capture of the relationship between cloud-native application resources is achieved, and a more complete and accurate application topology diagram is built through hierarchical labels, which solves the problem of incomplete association relationships.
Smart Images

Figure CN120067605A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and more specifically, to a method, apparatus, electronic device, and medium for generating association relationships of cloud-native applications. Background Art
[0002] In recent years, with the rapid development of cloud computing technology, cloud-native applications have gradually become the mainstream application development and deployment model. They adopt microservice architectures, containerized deployments, DevOps processes, etc., and have advantages such as elastic scaling, rapid iteration, and high availability. Among them, Kubernetes, as the de facto standard for cloud-native application orchestration platforms, has been widely used.
[0003] However, the high dynamism and complexity of cloud-native applications also pose new challenges to the operation and management of applications. Traditional monitoring and visualization solutions are difficult to adapt to the rapid changes and complex associations in the cloud-native environment. Some existing technologies, such as Weave Scope, although it provides visualization functions for Kubernetes clusters, due to its mainly relying on the built-in association relationships in Kubernetes, its dynamic association ability is limited, and it cannot fully reflect user-defined association relationships and dependencies across resources (such as storage and network), resulting in an incomplete topology graph that is difficult to accurately present complex application architectures. Summary of the Invention
[0004] In view of this, the present application provides a method, apparatus, electronic device, and medium for generating association relationships of cloud-native applications, which are used to generate complete association relationships of cloud-native applications.
[0005] To achieve the above object, the following solutions are proposed:
[0006] A method for generating association relationships of cloud-native applications, which is applied to an electronic device. The association relationship generation method includes the steps of:
[0007] Identifying the workload resources of the cluster and adding hierarchical tags to each of the identified workload resources;
[0008] Obtaining the association relationships of cloud-native applications in the cluster by constructing a multi-dimensional association index.
[0009] Optionally, the hierarchical tags include explicit tags and / or implicit tags;
[0010] Optionally, the association relationships include horizontal service dependency relationships and vertical configuration dependency relationships.
[0011] Optionally, it further includes the step of:
[0012] Build a priority event queue, listen for change events of workload resources in the cluster based on the priority event queue, and perform topological calculations on the change events to obtain real-time differences, thereby implementing a topological snapshot service.
[0013] Optionally, it further includes the steps of:
[0014] Evaluate the health status of the cluster based on a composite health metric algorithm.
[0015] Optionally, it further includes the steps of:
[0016] Configure an adaptive rendering engine, which is used to automatically select a layout mode based on the scale of the cluster and display the historical topological state based on the user's timeline dragging operation.
[0017] An association relationship generation device for cloud-native applications, which is applied to an electronic device. The association relationship generation device includes:
[0018] A load identification module, configured to identify the workload resources of the cluster and add hierarchical tags to each identified workload resource. The hierarchical tags include explicit tags and / or implicit tags;
[0019] An index construction module, configured to obtain the association relationships of cloud-native applications in the cluster by constructing multi-dimensional association indexes. The association relationships include horizontal service dependency relationships and vertical configuration dependency relationships.
[0020] Optionally, it further includes:
[0021] A topological calculation module, configured to build a priority event queue, listen for change events of workload resources in the cluster based on the priority event queue, and perform topological calculations on the change events to obtain real-time differences, thereby implementing a topological snapshot service.
[0022] Optionally, it further includes:
[0023] A health assessment module, configured to evaluate the health status of the cluster based on a composite health metric algorithm.
[0024] Optionally, it further includes:
[0025] An engine configuration module, used to configure an adaptive rendering engine, which is used to automatically select a layout mode based on the scale of the cluster and display the historical topological state based on the user's timeline dragging operation.
[0026] An electronic device, the electronic device includes at least one processor and a memory connected to the processor, wherein:
[0027] The memory is used to store computer programs or instructions;
[0028] The processor is used to execute the computer programs or instructions, so that the electronic device implements the association relationship generation method as described above.
[0029] A computer-readable storage medium is applied to an electronic device. The storage medium carries one or more computer programs, and the one or more computer programs can be executed by the electronic device, so that the electronic device implements the association relationship generation method as described above.
[0030] As can be seen from the above technical solutions, this application discloses an association relationship generation method, device, electronic device, and medium for cloud-native applications. The method and device are applied to an electronic device. Specifically, it identifies the workload resources of a cluster and adds hierarchical tags to each of the identified workload resources; by constructing a multi-dimensional association index, the association relationships of cloud-native applications in the cluster are obtained. This application realizes a comprehensive capture of the relationships between the resources of cloud-native applications through a dynamic tag association mechanism, and reflects the dynamic state and dependency relationships of resources through a hierarchical tag system, thereby constructing a more complete and accurate application topology diagram, and solving the problem of incomplete association relationships in the prior art. Description of the Drawings
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0032] Figure 1 It is a flowchart of an association relationship generation method for cloud-native applications according to an embodiment of the present application;
[0033] Figure 2 It is a flowchart of another association relationship generation method for cloud-native applications according to an embodiment of the present application;
[0034] Figure 3 It is a flowchart of yet another association relationship generation method for cloud-native applications according to an embodiment of the present application;
[0035] Figure 4 It is a flowchart of yet another association relationship generation method for cloud-native applications according to an embodiment of the present application;
[0036] Figure 5 It is a block diagram of an association relationship generation device for cloud-native applications according to an embodiment of the present application;
[0037] Figure 6 Block diagram of another apparatus for generating association relationships of cloud native applications according to an embodiment of the present application;
[0038] Figure 7 Block diagram of yet another apparatus for generating association relationships of cloud native applications according to an embodiment of the present application;
[0039] Figure 8 Block diagram of yet another apparatus for generating association relationships of cloud native applications according to an embodiment of the present application;
[0040] Figure 9 Block diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0041] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0042] The present application provides a technical solution for generating association relationships of native applications, taking a Kubernetes cluster as an example. The main technical means is to construct a dynamic, real-time, and multi-dimensional cloud native application topology model to solve the above technical problems. The core of this model lies in the dynamic label association mechanism. By using an intelligent injection controller to add explicit and implicit labels to resource objects, and using a cross-resource topology discovery algorithm to parse the dependency relationships between resources, a comprehensive resource association map is constructed.
[0043] To achieve real-time performance, the present application adopts an event-driven architecture, uses the Kubernetes Informers mechanism to listen for resource change events, and quickly generates topology differences through a priority event queue and a topology calculation Worker to ensure real-time update of the topology map. At the same time, through a composite health metric algorithm and a fault propagation prediction model, a multi-dimensional evaluation of the resource health status and a prediction of the abnormal influence range are realized. Finally, by using an adaptive rendering engine and a time-space shuttle function, a clear and intuitive visual display is provided, thereby comprehensively improving the observability of cloud native applications and helping users quickly discover and solve problems.
[0044] The present application relates to the following specific concepts::
[0045] Label Inheritance: It refers to the mechanism in which child resources automatically inherit the labels of parent resources.
[0046] Service Dependency: It refers to a service invoking the functions or data of another service.
[0047] Configuration Dependency: It refers to the configuration of a resource depending on another resource.
[0048] Priority Event Queue: A special type of queue where events are sorted according to their priorities, and high-priority events are processed first.
[0049] Topology Snapshot: It refers to the state of the system topology structure recorded at a specific point in time.
[0050] Timeline Playback: It refers to the function of viewing historical topology snapshots.
[0051] Force-Directed Layout: A graph layout algorithm that simulates the gravitational and repulsive forces between nodes, enabling the nodes to automatically distribute to a balanced state.
[0052] Hierarchical Collapse Layout: A graph layout algorithm that groups and folds nodes according to their hierarchical relationships to simplify the display of large-scale graphs.
[0053] Anomaly Propagation Model: A model used to analyze and predict the propagation path of anomalies in the system.
[0054] Anomaly Impact Radius: It refers to the range that an anomaly may affect.
[0055] Service Call Chain: It refers to the path through which a request is passed among multiple services.
[0056] Label Intelligent Injection Controller: A unique component of the present invention, responsible for automatically identifying workload resources and adding hierarchical labels to them to achieve dynamic label association. Different from ordinary label controllers, the intelligent injection controller can achieve two-way binding and cross-resource topology discovery.
[0057] Bidirectional Label Binding: A concept proposed in the present invention, referring to a label association mechanism that supports both explicit labels (user-defined) and implicit labels (automatically derived by the system).
[0058] Cross-Resource Topology Discovery Algorithm: An algorithm proposed in the present invention, used to discover dependencies across different resource types in a Kubernetes cluster, especially storage dependencies. Existing technologies generally can only discover dependencies within a service.
[0059] Event-Driven Collector: A component in the present invention, built based on Kubernetes Informers, to achieve real-time perception of cluster resource change events. Compared with traditional polling methods, it has higher efficiency and real-time performance.
[0060] Topology Calculation Worker: A component in the present invention, which receives events pushed by the Event-Driven Collector, performs topology calculation, and generates real-time differences.
[0061] Composite Health Indicator Algorithm: An algorithm proposed in the present invention, which comprehensively evaluates the health status of resources from multiple dimensions (ReadyStatus, CPUThrottle, ProbeSuccessRate, LogErrorFrequency).
[0062] Space-Time Travel Function: A function proposed in the present invention, which allows users to view historical topology states and compare topology structures in different environments.
[0063] Based on this, the following specific implementation manners are provided:
[0064] Figure 1 It is a flowchart of a method for generating association relationships of a cloud-native application in an embodiment of the present application.
[0065] As Figure 1 shown, the association relationship generation method provided in this embodiment is applied to an electronic device, used to identify and display the association relationships of cloud-native applications in a corresponding cluster, such as a Kubernetes cluster. This electronic device can be understood as a computer, server, cloud platform, etc. with data computing capabilities and information processing capabilities. The association relationship generation method specifically includes the following steps:
[0066] S1. Identify the workload resources of the cluster and label each resource.
[0067] Specifically, it can be implemented by developing a label intelligent injection controller, which can automatically identify the workload resources in the cluster, such as in a Kubernetes cluster, and add hierarchical labels to each workload resource. These labels are divided into two categories, namely explicit labels and implicit labels. Explicit labels are user-defined static associations, such as app-group=payment, which are used to identify the business attributes of resources and user-defined association relationships. Implicit labels are dynamically derived associations automatically deduced by the system, such as storage-mounted=redis-01, which reflect the dynamic state of resources and dependencies automatically discovered by the system, and realize two-way label binding. To achieve cross-namespace label inheritance, the controller will support the mechanism of sub-resources automatically inheriting parent-level labels.
[0068] S2. Obtain the association relationships of cloud-native applications by constructing a multi-dimensional association index.
[0069] That is, by constructing a multi-dimensional association index for all, the association relationships of cloud-native applications in the cluster are obtained. It includes horizontal service dependency relationships (Service→Endpoint→Pod) and vertical configuration dependency relationships (ConfigMap→Deployment→Pod). After obtaining these association relationships, they are rendered and displayed through a rendering engine so that users can obtain an intuitive association.
[0070] In particular, this application implements a cross-resource topology discovery algorithm for storage dependencies.
[0071] This algorithm is implemented through the following steps: First, use the Kubernetes API to obtain the detailed information of all PVCs, PVs, and StorageClasses. Then, perform association analysis. Find the corresponding PV through the spec.volumeName field of the PVC, and then find the corresponding StorageClass through the spec.storageClassName field of the PV. For StorageClasses using CSI drivers, obtain more detailed storage backend information through the CSI API; for in-tree storage plugins, specific parsing is performed according to the plugin type. Next, use the PVC, PV, StorageClass, and storage backend information as nodes, and establish directed edges according to the association analysis results to construct a dependency graph. Finally, pass the labels on the PV and StorageClass to the corresponding PVC as implicit labels.
[0072] PV (PersistentVolume) is an abstraction of storage resources at the cluster level, which is pre-created and configured by the administrator and is independent of any Namespace. It is directly associated with underlying storage technologies (such as NFS, Ceph, cloud storage, etc.) and is docked through a plug-in mechanism. It can define parameters such as storage capacity, access mode (such as ReadWriteOnce), and recycling policy (such as Retain or Delete).
[0073] PVC (PersistentVolumeClaim) is a user's claim for storage resources, which belongs to a certain Namespace and is used to apply for storage space from PV. It can specify the required storage capacity, access mode, and StorageClass type. When a Pod uses storage resources through PVC, it must be in the same Namespace as the PVC.
[0074] StorageClass is used to dynamically create PVs, supports on-demand allocation of storage resources, and simplifies the manual operations of administrators. It defines storage types (such as fast, slow) and configuration parameters of the backend storage (such as Provisioner, volume expansion policy). It allows PVCs to automatically trigger the creation of PVs by specifying StorageClass.
[0075] As can be seen from the above technical solutions, this embodiment provides a method for generating association relationships of cloud-native applications. This method is applied to an electronic device, specifically to identify the workload resources of a cluster and add hierarchical tags to each of the identified workload resources; by constructing a multi-dimensional association index, the association relationships of cloud-native applications in the cluster are obtained. Through the dynamic label association mechanism of this application, a comprehensive capture of the relationships between the resources of cloud-native applications is achieved, and the dynamic state and dependency relationships of the resources are reflected through the hierarchical label system, thereby constructing a more complete and accurate application topology graph, solving the problem of incomplete association relationships in the prior art.
[0076] In addition, in a specific implementation manner of this application, the following steps are further included, as Figure 2 shown.
[0077] S3. Implement a topology snapshot service through a real-time topology construction engine.
[0078] This application designs an event-driven collector, which constructs a priority event queue based on Kubernetes Informers. By leveraging the efficient mechanism of Informers, it listens for resource change events (such as creation, update, deletion) in the cluster and pushes key events to the topology calculation Worker in real time. After receiving the events, the topology calculation Worker immediately performs topology calculation, generates real-time differences, and passes them to the rendering engine, thus realizing the topology snapshot service.
[0079] This service generates a topology difference snapshot every 5 seconds and supports the timeline backtracking function, enabling users to view historical topology states. The design goal of the entire event stream processing architecture is to achieve extremely low processing latency, ensuring that the time from the occurrence of a resource change event to the completion of the topology graph update is less than 200 milliseconds, far lower than the 3 - 5 seconds latency of traditional solutions. In addition, a topology weight calculation model is constructed. Among them, the weight of the connection line is jointly determined by the API call frequency and the QoS level. The node size is calculated according to the following steps: First, obtain the CPU usage, memory usage, and health status of the node through the Kubernetes Metrics API or a third-party monitoring system. Then, calculate the resource occupancy ratio: CPU occupancy ratio = node CPU usage / total cluster CPU capacity, Memory occupancy ratio = node memory usage / total cluster memory capacity. Next, calculate the health coefficient based on health. If it is ready, the coefficient is 1; if it is unhealthy, it is 0, or a value between 0 and 1 is set according to the unhealthy time. Finally, calculate the node size: node size = (w1 × CPU occupancy ratio + w2 × Memory occupancy ratio) × health coefficient, where w1 and w2 are weight coefficients that can be adjusted according to actual needs, and the node size is normalized.
[0080] As can be seen from the above content, this application uses an event-driven collector based on Kubernetes Informers and a low-latency topology calculation Worker to achieve real-time update of topology information, ensuring that users can timely understand the latest status of the application. The processing latency is less than 200 milliseconds, far lower than traditional solutions, effectively solving the problem of insufficient real-time performance in the prior art.
[0081] In addition, in another specific implementation of this application, the following steps are further included, as Figure 3 shown.
[0082] S4. Evaluate the health status of the cluster based on a composite health index algorithm.
[0083] This application proposes a composite health index algorithm, which comprehensively considers multiple dimensions to evaluate the health status of resources. The algorithm formula is:
[0084] HealthScore = α × ReadyStatus + β × (1 - CPUThrottle) + γ × ProbeSuccessRate + δ × LogErrorFrequency。
[0085] Among them, ReadyStatus reflects real-time availability, CPUThrottle reflects resource performance, ProbeSuccessRate reflects service stability, and LogErrorFrequency reflects the frequency of exceptions. The coefficients α, β, γ, and δ will be dynamically adjusted and automatically optimized according to the service level objective (SLO). The adjustment and optimization of the coefficients are achieved through the following steps:
[0086] First, define a clear SLO for each service and convert it into specific thresholds. Then, collect historical data of HealthScore and each indicator over a period of time, and analyze the correlation between HealthScore and each indicator. Next, adjust the coefficients manually or automatically according to the correlation, SLO, and experience or expert knowledge. Automatic optimization can use machine learning algorithms (such as regression models, neural networks) to train a model, automatically predict HealthScore based on historical data, and optimize the coefficients; or use reinforcement learning algorithms, take HealthScore as a reward signal, train an agent to automatically adjust the coefficients to maximize HealthScore and meet the SLO. Based on the calculated health score, use a directed graph algorithm to calculate the influence range of abnormal nodes and predict potential cascading failures. When presenting visually, the risk of cascading failures will be shown in the form of a heat map to help users quickly identify and locate problems.
[0087] The above technical content comprehensively considers multiple dimensions such as the availability, performance, stability, and exception frequency of resources, and provides a more comprehensive and accurate application health status assessment through coefficient dynamic adjustment and fault propagation prediction, overcoming the defect of single-dimensional health assessment in the existing technology.
[0088] In addition, in another specific embodiment of this application, the following steps are also included, as Figure 4 shown.
[0089] S5. Configure an adaptive rendering engine for rendering the topology graph.
[0090] Configure an adaptive rendering engine that can automatically select a suitable layout method according to the cluster scale. For small-scale clusters, use a force-directed layout, and through an automatic avoidance and dynamic balancing mechanism, ensure that the topology graph is clear and easy to read. For large-scale clusters, use a hierarchical contraction layout, aggregate according to the namespace or component type, and avoid information overload.
[0091] Through this engine, the function of time and space shuttle can be realized, allowing users to view the historical topological state by dragging the timeline, and providing a space comparison mode, which supports users to compare the production environment and the test environment simultaneously, facilitating problem troubleshooting.
[0092] Through the above technical content, the intelligent visualization engine can automatically select the best layout according to the cluster scale and provide the time and space shuttle function, improving the user experience and the efficiency of problem troubleshooting.
[0093] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0094] Although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous.
[0095] It should be understood that the various steps recited in the method embodiments of the present disclosure may be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0096] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as C language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0097] Figure 5 Block diagram of an apparatus for generating association relationships of a cloud-native application according to an embodiment of the present application.
[0098] As Figure 5 As shown, the association relationship generation apparatus provided in this embodiment is applied to an electronic device, and is used to identify and display to the user the association relationships of cloud-native applications in a corresponding cluster, such as a Kubernetes cluster. The electronic device can be understood as a computer, a server, a cloud platform, etc. with data computing capabilities and information processing capabilities. The association relationship generation apparatus specifically includes a load identification module 10 and an index construction module 20.
[0099] The load identification module is used to identify the workload resources of the cluster and label each resource.
[0100] Specifically, it can be implemented by developing a label intelligent injection controller. The controller can automatically identify the workload resources in a cluster, such as a Kubernetes cluster, and add hierarchical labels to each workload resource. These labels are divided into two categories, namely explicit labels and implicit labels. Explicit labels are static associations defined by users, such as app-group=payment, which are used to identify the business attributes of resources and the association relationships defined by users. Implicit labels are dynamic associations automatically derived by the system through analysis, such as storage-mounted=redis-01, which reflect the dynamic state of resources and the dependency relationships automatically discovered by the system, and realize two-way label binding. In order to achieve cross-namespace label inheritance, the controller will support the mechanism of sub-resources automatically inheriting parent-level labels.
[0101] The index construction module is used to obtain the association relationships of cloud-native applications by constructing a multi-dimensional association index.
[0102] That is, by constructing multi-dimensional association indexes for all, the association relationships of cloud-native applications in the cluster are obtained. It includes horizontal service dependency relationships (Service→Endpoint→Pod) and vertical configuration dependency relationships (ConfigMap→Deployment→Pod). After obtaining the association relationships, they are rendered and displayed through a rendering engine so that users can obtain intuitive associations.
[0103] In particular, the present application implements a cross-resource topology discovery algorithm for storage dependencies.
[0104] This algorithm is implemented through the following steps: First, use the Kubernetes API to obtain the detailed information of all PVCs, PVs, and StorageClasses. Then, perform association analysis. Find the corresponding PV through the spec.volumeName field of the PVC, and then find the corresponding StorageClass through the spec.storageClassName field of the PV. For StorageClasses using CSI drivers, obtain more detailed storage backend information through the CSI API; for in-tree storage plugins, perform specific parsing according to the plugin type. Next, use the PVC, PV, StorageClass, and storage backend information as nodes, and establish directed edges according to the association analysis results to construct a dependency graph. Finally, pass the labels on the PV and StorageClass to the corresponding PVC as implicit labels.
[0105] As can be seen from the above technical solution, this embodiment provides an apparatus for generating association relationships of cloud-native applications. This apparatus is applied to an electronic device, specifically to identify the workload resources of the cluster and add hierarchical labels to each of the identified workload resources; by constructing multi-dimensional association indexes, obtain the association relationships of cloud-native applications in the cluster. The present application realizes a comprehensive capture of the relationships between resources of cloud-native applications through a dynamic label association mechanism, and reflects the dynamic state and dependency relationships of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology diagram, solving the problem of incomplete association relationships in the prior art.
[0106] In addition, in a specific implementation manner of the present application, it further includes a topology calculation module 30, as Figure 6 shown.
[0107] The topology calculation module is used to implement a topology snapshot service through a real-time topology construction engine.
[0108] This application designs an event-driven collector, which constructs a priority event queue based on Kubernetes Informers. By leveraging the efficient mechanism of Informers, it listens for resource change events (such as creation, update, deletion) in the cluster and pushes key events to the topology calculation Worker in real time. After receiving the events, the topology calculation Worker immediately performs topology calculation, generates real-time differences, and passes them to the rendering engine, thus realizing the topology snapshot service.
[0109] This service generates a topology difference snapshot every 5 seconds and supports the timeline backtracking function, enabling users to view historical topology states. The design goal of the entire event stream processing architecture is to achieve extremely low processing latency, ensuring that the time from the occurrence of a resource change event to the completion of topology graph update is less than 200 milliseconds, far lower than the 3 - 5 seconds latency of traditional solutions. In addition, a topology weight calculation model is constructed. Among them, the connection line weight is jointly determined by the API call frequency and the QoS level. The node size is calculated according to the following steps: First, obtain the CPU usage, memory usage, and health status of the node through the Kubernetes MetricsAPI or a third-party monitoring system. Then, calculate the resource occupancy ratio: CPU occupancy ratio = node CPU usage / total cluster CPU capacity, Memory occupancy ratio = node memory usage / total cluster memory capacity. Next, calculate the health coefficient based on health. If it is ready, the coefficient is 1; if it is unhealthy, it is 0, or a value between 0 and 1 is set according to the unhealthy time. Finally, calculate the node size: node size = (w1 × CPU occupancy ratio + w2 × Memory occupancy ratio) × health coefficient, where w1 and w2 are weight coefficients that can be adjusted according to actual needs, and the node size is normalized.
[0110] As can be seen from the above content, this application uses an event-driven collector based on Kubernetes Informers and a low-latency topology calculation Worker to achieve real-time update of topology information, ensuring that users can timely understand the latest status of the application. The processing latency is less than 200 milliseconds, far lower than traditional solutions, effectively solving the problem of insufficient real-time performance in the prior art.
[0111] In addition, in another specific embodiment of this application, it further includes a health assessment module 40, as Figure 7 shown.
[0112] The health assessment module is used to evaluate the health status of the cluster based on a composite health metric algorithm.
[0113] This application proposes a composite health metric algorithm, which comprehensively considers multiple dimensions to evaluate the health status of resources. The algorithm formula is:
[0114] HealthScore = α × ReadyStatus + β × (1 - CPUThrottle) + γ × ProbeSuccessRate + δ × LogErrorFrequency。
[0115] Among them, ReadyStatus reflects real-time availability, CPUThrottle reflects resource performance, ProbeSuccessRate reflects service stability, and LogErrorFrequency reflects the frequency of exceptions. The coefficients α, β, γ, and δ will be dynamically adjusted and automatically optimized according to the service level objective (SLO). The adjustment and optimization of the coefficients are achieved through the following steps:
[0116] First, define a clear SLO for each service and convert it into specific thresholds. Then, collect historical data of HealthScore and various indicators over a period of time, and analyze the correlation between HealthScore and various indicators. Next, adjust the coefficients manually or automatically according to the correlation, SLO, and experience or expert knowledge. Automatic optimization can use machine learning algorithms (such as regression models, neural networks) to train models, automatically predict HealthScore based on historical data, and optimize the coefficients; or use reinforcement learning algorithms, take HealthScore as the reward signal, train the agent to automatically adjust the coefficients to maximize HealthScore and meet the SLO. Based on the calculated health score, use the directed graph algorithm to calculate the influence range of abnormal nodes and predict potential cascading failures. When visualizing, the risk of cascading failures will be displayed in the form of a heat map to help users quickly identify and locate problems.
[0117] The above technical content comprehensively considers multiple dimensions such as the availability, performance, stability, and exception frequency of resources, and provides a more comprehensive and accurate application health status assessment through coefficient dynamic adjustment and fault propagation prediction, overcoming the defect of single-dimensional health assessment in the prior art.
[0118] In addition, in another specific embodiment of the present application, it further includes an engine configuration module 50, as Figure 8 shown.
[0119] The engine configuration module is used to configure an adaptive rendering engine for rendering the topology graph.
[0120] Configure the adaptive rendering engine, which can automatically select a suitable layout method according to the cluster scale. For small-scale clusters, use the force-directed layout, and through the automatic avoidance and dynamic balance mechanisms, ensure that the topology graph is clear and easy to read. For large-scale clusters, use the hierarchical contraction layout, aggregate according to the namespace or component type, and avoid information overload.
[0121] Through this engine, a time-space shuttle function can be realized, allowing users to view historical topological states by dragging the timeline, and providing a spatial comparison mode that supports users to compare the production environment and the test environment simultaneously, facilitating problem troubleshooting.
[0122] Based on the above technical content, the intelligent visualization engine can automatically select the best layout according to the cluster scale and provide a time-space shuttle function, improving the user experience and the efficiency of problem troubleshooting.
[0123] The units involved in the embodiments of the present disclosure can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit can also be described as "the unit for acquiring at least two Internet protocol addresses".
[0124] The functions described above in this article can be at least partially executed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0125] Figure 9 It is a block diagram of an electronic device according to an embodiment of the present application.
[0126] The following refers to Figure 9 , which shows a schematic structural diagram suitable for implementing the electronic device in the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. This electronic device is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0127] The electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory ROM 902 or the program loaded from the input device 906 into the random access memory RAM 903. In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, the ROM, and the RAM are connected to each other through a bus 904. The input / output (I / O) interface 905 is also connected to the bus 904.
[0128] Typically, the following devices can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and a communication device 909. The communication device 909 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows an electronic device with various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0129] This application also provides an embodiment of a computer-readable medium.
[0130] The above computer-readable medium is applied to an electronic device and carries one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device identifies the workload resources of the cluster and adds hierarchical tags to each of the identified workload resources; by constructing a multi-dimensional association index, the association relationships of the cloud-native applications in the cluster are obtained. Through the dynamic tag association mechanism of this application, a comprehensive capture of the relationships between the resources of cloud-native applications is achieved, and the dynamic state and dependency relationships of the resources are reflected through the hierarchical tag system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationships in the prior art.
[0131] It should be noted that the above computer-readable medium in this disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0132] In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0133] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.
[0134] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
[0135] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such a process, method, article, or terminal device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or terminal device including the said element.
[0136] The above has introduced the technical solution provided by the present invention in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for generating association relationships of cloud native applications, applied to electronic devices, characterized in that: The association relationship generation method comprises the steps of: Identify workload resources of the cluster, and add hierarchical tags to each of the identified workload resources; By constructing a multi-dimensional association index, the association relationship of the cloud native applications in the cluster is obtained.
2. The method for generating an association relationship according to claim 1, wherein: The hierarchical tags include explicit tags and / or implicit tags.
3. The method for generating an association relationship according to claim 1, wherein: The association relationship includes a horizontal service dependency relationship and a vertical configuration dependency relationship.
4. The method for generating an association relationship according to any one of claims 1 to 3, characterized in that: Also includes the steps: A priority event queue is constructed, and based on the priority event queue, change events of workload resources in the cluster are monitored, and topology calculation is performed on the change events to obtain real-time differences, thereby realizing a topology snapshot service.
5. The method for generating an association relationship according to claim 4, wherein: Also includes the steps: The health status of the cluster is evaluated based on a composite health indicator algorithm.
6. The method for generating an association relationship according to claim 4, characterized in that: Also includes the steps: An adaptive rendering engine is configured, wherein the adaptive rendering engine is used to automatically select a layout mode based on the scale of the cluster and to display a historical topology state based on a timeline dragging operation of a user.
7. A device for generating association relationships of cloud native applications, applied to electronic devices, characterized in that: The association relationship generating device comprises: A load identification module is configured to identify workload resources of a cluster and add a hierarchical label to each of the identified workload resources, wherein the hierarchical label includes an explicit label and / or an implicit label; The index building module is configured to obtain the association relationship of the cloud native applications in the cluster by building a multi-dimensional association index, wherein the association relationship includes a horizontal service dependency and a vertical configuration dependency.
8. The association relationship generating device according to claim 7, characterized in that: Also includes: A topology calculation module is configured to build a priority event queue, monitor the change events of workload resources in the cluster based on the priority event queue, and perform topology calculation on the change events to obtain real-time differences and implement a topology snapshot service; A health assessment module, configured to assess the health status of the cluster based on a composite health indicator algorithm; and / or, The engine configuration module is used to configure an adaptive rendering engine, wherein the adaptive rendering engine is used to automatically select a layout mode based on the scale of the cluster and display a historical topology state based on a timeline drag operation of a user.
9. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs or instructions; The processor is used to execute the computer program or instruction so that the electronic device implements the association relationship generation method as described in any one of claims 1 to 6.
10. A computer-readable medium, applied to an electronic device, characterized in that: The medium carries one or more computer programs, and the one or more computer programs can be executed by the electronic device, so that the electronic device implements the association relationship generation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for realizing observability for cloud native chaos engineering experiment
CN114791846A
Kubernetes resource index construction method and system
CN115623008A
Cloud native state evaluation method and device, equipment and storage medium
CN117215589A
Topological graph generation method and device, computer equipment and storage medium
CN117668309A
Cloud native storage method, electronic equipment and computer readable storage medium
CN119668510A