Method, device, electronic device, and medium for generating association relationships for cloud native applications

By identifying workload resources in cloud-native applications and adding hierarchical tags, building a multi-dimensional correlation index and event-driven architecture, we solve the problem of incomplete correlation relationships in existing technologies, achieve comprehensive monitoring and management of cloud-native applications, and improve the accuracy and real-time performance of topology maps.

CN120067605BActive Publication Date: 2025-09-05BEIJING SOHU NEW MEDIA INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510551748.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-09-05
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Traditional monitoring and visualization solutions are difficult to adapt to the high dynamics and complexity of cloud-native applications, and cannot fully reflect user-defined relationships and cross-resource dependencies. As a result, the generated topology diagrams are not comprehensive enough and it is difficult to accurately present complex application architectures.

Method used

By identifying the workload resources of the cluster and adding hierarchical tags, building a multi-dimensional correlation index, using an event-driven architecture to monitor resource change events, using a composite health indicator algorithm to evaluate health status, and configuring an adaptive rendering engine for topology rendering, real-time difference calculation and historical status viewing are achieved.

Benefits of technology

It achieves comprehensive capture of cloud-native application resource relationships, builds a more complete and accurate application topology map, improves the real-time and observability of operations and management, reduces processing delays, and improves problem troubleshooting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067605B_ABST
    Figure CN120067605B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and medium for generating association relationships of cloud native applications. The method and device are applied to electronic devices, specifically to identify workload resources of a cluster and add hierarchical labels 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. The present application realizes the comprehensive capture of the relationship between resources of cloud native applications through a dynamic label association mechanism, and reflects the dynamic status and dependency relationships of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationships in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and more specifically, to a method, device, electronic device, and medium for generating association relationships for 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 utilize microservices architecture, containerized deployment, and DevOps processes, offering advantages such as elastic scalability, rapid iteration, and high availability. Kubernetes, as the de facto standard for cloud-native application orchestration platforms, has been widely adopted.

[0003] However, the highly dynamic and complex nature of cloud-native applications also presents new challenges for their operations, maintenance, and management. Traditional monitoring and visualization solutions struggle to adapt to the rapid changes and complex relationships in cloud-native environments. Existing technologies, such as Weave Scope, offer visualization of Kubernetes clusters. However, these technologies rely primarily on built-in Kubernetes relationships, resulting in limited dynamic association capabilities. These technologies are unable to fully reflect user-defined relationships and cross-resource dependencies (such as storage and networking). Consequently, the resulting topology maps are incomplete and struggle to accurately represent complex application architectures. Summary of the Invention

[0004] In view of this, the present application provides a method, device, 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] In order to achieve the above objectives, the following solutions are proposed:

[0006] A method for generating association relationships of cloud native applications, applied to electronic devices, comprises the following steps:

[0007] Identifying workload resources of the cluster and adding a hierarchical label to each of the identified workload resources;

[0008] By constructing a multi-dimensional association index, the association relationship of the cloud native applications in the cluster is obtained.

[0009] Optionally, the hierarchical tags include explicit tags and / or implicit tags;

[0010] Optionally, the association relationship includes a horizontal service dependency relationship and a vertical configuration dependency relationship.

[0011] Optionally, the following steps may also be included:

[0012] A priority event queue is constructed, and based on the priority event queue, change events of workload resources in the cluster are monitored. Topology calculation is performed on the change events to obtain real-time differences, thereby realizing a topology snapshot service.

[0013] Optionally, the following steps may also be included:

[0014] The health status of the cluster is evaluated based on a composite health indicator algorithm.

[0015] Optionally, the following steps may also be included:

[0016] 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 display a historical topology state based on a timeline drag operation of a user.

[0017] A device for generating association relationships of cloud-native applications, applied to an electronic device, includes:

[0018] A load identification module is configured to identify workload resources of a cluster and add a hierarchical label to each identified workload resource, wherein the hierarchical label includes an explicit label and / or an implicit label;

[0019] The index construction module is configured to obtain the association relationship of the cloud native applications in the cluster by constructing a multi-dimensional association index, where the association relationship includes horizontal service dependency and vertical configuration dependency.

[0020] Optionally, also include:

[0021] The 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 topology snapshot service.

[0022] Optionally, also include:

[0023] The health assessment module is configured to assess the health status of the cluster based on a composite health indicator algorithm.

[0024] Optionally, also include:

[0025] 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 user's timeline dragging operation.

[0026] An electronic device comprising 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 configured to execute the computer program or instruction so as to enable the electronic device to implement the association relationship generating method as described above.

[0029] A computer-readable storage medium is applied to an electronic device, wherein the storage medium carries one or more computer programs, and the one or more computer programs can be executed by the electronic device, thereby enabling the electronic device to implement the association relationship generation method as described above.

[0030] It can be seen from the above technical solutions that the present application discloses a method, device, electronic device and medium for generating association relationships of cloud native applications. The method and device are applied to electronic devices, specifically to identify workload resources of a cluster, and add hierarchical labels 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. The present application realizes the comprehensive capture of the relationship between resources of cloud native applications through a dynamic label association mechanism, and reflects the dynamic status and dependency relationships of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationships in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0032] Figure 1 This is a flowchart of a method for generating association relationships for cloud native applications according to an embodiment of the present application;

[0033] Figure 2 This is a flowchart of another method for generating association relationships for cloud native applications according to an embodiment of the present application;

[0034] Figure 3 This is a flowchart of another method for generating association relationships of cloud native applications according to an embodiment of the present application;

[0035] Figure 4 This is a flowchart of another method for generating association relationships of cloud native applications according to an embodiment of the present application;

[0036] Figure 5 This is a block diagram of a device for generating association relationships for cloud-native applications according to an embodiment of the present application;

[0037] Figure 6 This is a block diagram of another device for generating association relationships for cloud-native applications according to an embodiment of the present application;

[0038] Figure 7 This is a block diagram of another device for generating association relationships for cloud-native applications according to an embodiment of the present application;

[0039] Figure 8 This is a block diagram of another device for generating association relationships for cloud-native applications according to an embodiment of the present application;

[0040] Figure 9 This is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0041] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0042] This application provides a technical solution for generating association relationships for native applications, taking Kubernetes clusters as an example. The main technical means is to solve the above technical problems by building a dynamic, real-time, multi-dimensional cloud native application topology model. The core of this model lies in the dynamic label association mechanism, which adds explicit and implicit labels to resource objects through an intelligent injection controller, and uses a cross-resource topology discovery algorithm to resolve the dependencies between resources, thereby building a comprehensive resource association map.

[0043] To achieve real-time performance, this application adopts an event-driven architecture, using the Kubernetes Informers mechanism to monitor resource change events, and quickly generates topology differences through priority event queues and topology calculation workers to ensure real-time updates of the topology map. At the same time, through a composite health indicator algorithm and a fault propagation prediction model, a multi-dimensional assessment of resource health status and a prediction of the impact range of anomalies are achieved. Finally, using an adaptive rendering engine and time-space shuttle functions, a clear and intuitive visual display is provided, thereby comprehensively improving the observability of cloud-native applications and helping users quickly discover and resolve problems.

[0044] This application involves the following specific concepts:

[0045] Label inheritance: refers to the mechanism by which child resources automatically inherit the labels of their parent resources.

[0046] Service Dependency: refers to a service calling the functions or data of another service.

[0047] Configuration Dependency: refers to the configuration of one resource being dependent on another resource.

[0048] Priority Event Queue: A special type of queue in which events are sorted by priority, with higher priority events being processed first.

[0049] Topology Snapshot: refers to the state of the system topology recorded at a specific point in time.

[0050] Timeline Playback: refers to the function of viewing historical topology snapshots.

[0051] Force-Directed Layout: A graph layout algorithm that simulates the attractive and repulsive forces between nodes, automatically distributing the nodes to a balanced state.

[0052] Hierarchical Collapse Layout: A graph layout algorithm that groups and collapses nodes according to 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 a system.

[0054] Anomaly Impact Radius: refers to the range that an anomaly may affect.

[0055] Service Call Chain: refers to the path along which a request is transmitted between multiple services.

[0056] Label Intelligent Injection Controller: This unique component automatically identifies workload resources and assigns hierarchical labels to them, enabling dynamic label association. Unlike conventional label controllers, the intelligent injection controller enables bidirectional binding and cross-resource topology discovery.

[0057] Bidirectional Label Binding: This concept, proposed in this invention, refers 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: This algorithm is used to discover dependencies across different resource types in a Kubernetes cluster, particularly storage dependencies. Existing technologies typically only discover dependencies within services.

[0059] Event-Driven Collector: This component, built on Kubernetes Informers, provides real-time awareness of cluster resource change events. Compared to traditional polling methods, it is more efficient and real-time.

[0060] Topology Calculation Worker: A component in the present invention that receives events pushed by the event-driven collector, performs topology calculations, and generates real-time differences.

[0061] Composite Health Indicator Algorithm: This algorithm, proposed in this paper, integrates multiple dimensions (ReadyStatus, CPUThrottle, ProbeSuccessRate, LogErrorFrequency) to evaluate the health status of resources.

[0062] Space-Time Travel Function: This function proposed by the present invention allows users to view historical topological states and compare topological structures of different environments.

[0063] Based on this, the following specific implementation methods are provided:

[0064] Figure 1 This is a flowchart of a method for generating association relationships for cloud-native applications according to an embodiment of the present application.

[0065] like Figure 1 As shown, the association relationship generation method provided in this embodiment is applied to an electronic device to identify and display the association relationship of a corresponding cluster, such as a cloud native application of a Kubernetes cluster, to a user. The electronic device can be understood as a computer, server, cloud platform, etc. with data computing 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] In specific implementation, this can be achieved by developing a label intelligent injection controller that can automatically identify workload resources in clusters, such as Kubernetes clusters, and add hierarchical labels to each workload resource. These labels are divided into two categories: 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 associations. 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 dependencies automatically discovered by the system, and realize two-way label binding. In order to achieve label inheritance across namespaces, the controller will support a mechanism for child resources to automatically inherit parent labels.

[0068] S2. Obtain the association relationship of cloud native applications by building a multi-dimensional association index.

[0069] That is, by building a multi-dimensional correlation index for all, we can obtain the correlation relationship of cloud native applications in the cluster. This includes horizontal service dependencies (Service→Endpoint→Pod) and vertical configuration dependencies (ConfigMap→Deployment→Pod). After obtaining the correlation relationship, it is rendered and displayed through the rendering engine to provide users with an intuitive understanding of the correlation.

[0070] In particular, this application implements a cross-resource topology discovery algorithm for storage dependencies.

[0071] The algorithm is implemented through the following steps: First, use the Kubernetes API to obtain detailed information about all PVCs, PVs, and StorageClasses. Then, perform association analysis to find the corresponding PV through the PVC's spec.volumeName field, and then find the corresponding StorageClass through the PV's spec.storageClassName field. For StorageClasses driven by CSI, more detailed storage backend information is obtained through the CSIAPI; for in-tree storage plug-ins, specific parsing is performed based on the plug-in type. Next, use PVC, PV, StorageClass, and storage backend information as nodes, establish directed edges based on the association analysis results, and construct a dependency graph. Finally, pass the labels on the PV and StorageClass to the corresponding PVC as implicit labels.

[0072] A PersistentVolume (PV) is a cluster-level storage resource abstraction, pre-created and configured by the administrator and independent of any namespace. It is directly linked to underlying storage technologies (such as NFS, Ceph, and cloud storage) and integrated through a plug-in mechanism. It defines parameters such as storage capacity, access mode (such as ReadWriteOnce), and eviction policy (such as Retain or Delete).

[0073] A PersistentVolumeClaim (PVC) is a user's declaration of storage resources, belonging to a specific namespace, and used to request storage space from a PV. It specifies the desired storage capacity, access mode, and StorageClass type. When a pod uses a PVC for storage resources, it must reside in the same namespace as the PVC.

[0074] StorageClass is used to dynamically create PVs, supporting on-demand storage resource allocation and simplifying administrators' manual operations. It defines the storage type (such as fast and slow) and backend storage configuration parameters (such as the Provisioner and volume expansion policy). It allows PVCs to automatically trigger PV creation by specifying a StorageClass.

[0075] It can be seen from the above technical solution that this embodiment provides a method for generating association relationships of cloud native applications. The method is applied to electronic devices, specifically identifying workload resources of a cluster and adding hierarchical labels 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 uses a dynamic label association mechanism to achieve comprehensive capture of the relationship between resources of cloud native applications, and reflects the dynamic status and dependency relationships of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationships in the existing technology.

[0076] In addition, in a specific embodiment of the present application, the following steps are also included: Figure 2 shown.

[0077] S3, implements topology snapshot service through real-time topology construction engine.

[0078] This application designs an event-driven collector that builds a priority event queue based on Kubernetes Informers. Leveraging the efficient mechanisms of Informers, it monitors cluster resource change events (such as creation, update, and deletion) and pushes key events to the topology calculation worker in real time. Upon receiving the event, the topology calculation worker immediately performs topology calculations, generates real-time differences, and passes them to the rendering engine, thus implementing a topology snapshot service.

[0079] The service generates a topology difference snapshot every 5 seconds and supports a timeline backtracking function, allowing users to view historical topology status. 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 map update is less than 200 milliseconds, which is much lower than the 3-5 second delay of traditional solutions. In addition, a topology weight calculation model is constructed. Among them, the connection line weight is determined by the API call frequency and QoS level. The node size is calculated according to the following steps: First, the CPU usage, memory usage and health status of the node are obtained through the Kubernetes Metrics API or a third-party monitoring system. Then, the resource ratio is calculated: CPU ratio = node CPU usage / total CPU capacity of the cluster, Memory ratio = node memory usage / total memory capacity of the cluster. Next, the health coefficient is calculated based on health. If it is ready, the coefficient is 1, and if it is unhealthy, it is 0, or a value between 0 and 1 is set according to the unhealthy time. Finally, the node size is calculated: node size = (w1×CPU ratio + w2×Memory ratio)×health coefficient, where w1 and w2 are weight coefficients, which can be adjusted according to actual needs to normalize the node size.

[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 updates of topology information, ensuring that users can promptly understand the latest status of the application. The processing delay is less than 200 milliseconds, which is much lower than traditional solutions, effectively solving the problem of insufficient real-time performance of existing technologies.

[0081] In addition, in another specific embodiment of the present application, the following steps are also included: Figure 3 shown.

[0082] S4. Evaluate the health status of the cluster based on the composite health indicator algorithm.

[0083] This application proposes a composite health indicator algorithm that comprehensively considers multiple dimensions to evaluate the health status of resources. The algorithm formula is:

[0084] HealthScore=α×ReadyStatus+β×(1-CPUThrottle)+γ×ProbeSuccessRate+δ×LogErrorFrequency.

[0085] ReadyStatus reflects real-time availability, CPUThrottle reflects resource performance, ProbeSuccessRate reflects service stability, and LogErrorFrequency reflects exception frequency. Coefficients α, β, γ, and δ are dynamically adjusted and automatically optimized based on service level objectives (SLOs). Coefficient adjustment and optimization are achieved through the following steps:

[0086] First, define clear SLOs for each service and convert them into specific thresholds. Then, collect historical data on 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 based on the correlation, SLO, and experience or expert knowledge. Automatic optimization can use machine learning algorithms (such as regression models and neural networks) to train models, automatically predict HealthScore based on historical data, and optimize coefficients; or use reinforcement learning algorithms to use HealthScore as a reward signal to train the agent to automatically adjust coefficients to maximize HealthScore and meet SLO. Based on the calculated health score, use a directed graph algorithm to calculate the impact 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.

[0087] The above technical content comprehensively considers multiple dimensions such as resource availability, performance, stability and abnormal frequency, and provides a more comprehensive and accurate application health status assessment through dynamic coefficient adjustment and fault propagation prediction, overcoming the defect of the single health assessment dimension of existing technologies.

[0088] In addition, in another specific embodiment of the present application, the following steps are also included: Figure 4 shown.

[0089] S5. Configure an adaptive rendering engine for rendering the topology map.

[0090] Configure an adaptive rendering engine that automatically selects the appropriate layout based on cluster size. For small clusters, a force-directed layout is used, ensuring clear and easy-to-read topology through automatic avoidance and dynamic balancing. For large clusters, a hierarchical contraction layout is used, aggregating components by namespace or type to avoid information overload.

[0091] This engine enables time-space travel, allowing users to view historical topology status by dragging the timeline, and provides a spatial comparison mode that supports users to compare production and test environments at the same time, facilitating problem troubleshooting.

[0092] The above technical content enables the intelligent visualization engine to automatically select the optimal layout based on the cluster size and provide time and space travel functions, improving user experience and problem troubleshooting efficiency.

[0093] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.

[0095] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders 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 respect.

[0096] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, 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 cases involving a remote computer, the remote computer may be connected to the user's computer via any type 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 This is a block diagram of a device for generating association relationships for cloud-native applications according to an embodiment of the present application.

[0098] like Figure 5 As shown, the association relationship generation device provided in this embodiment is applied to an electronic device for identifying and displaying the association relationships of cloud-native applications in corresponding clusters, such as Kubernetes clusters, to a user. The electronic device can be understood as a computer, server, or cloud platform with data computing and information processing capabilities. The association relationship generation device 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] In specific implementation, this can be achieved by developing a label intelligent injection controller that can automatically identify workload resources in clusters, such as Kubernetes clusters, and add hierarchical labels to each workload resource. These labels are divided into two categories: 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 associations. 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 dependencies automatically discovered by the system, and realize two-way label binding. In order to achieve label inheritance across namespaces, the controller will support a mechanism for child resources to automatically inherit parent labels.

[0101] The index building module is used to obtain the association relationship of cloud native applications by building a multi-dimensional association index.

[0102] That is, by building a multi-dimensional correlation index for all, we can obtain the correlation relationship of cloud native applications in the cluster. This includes horizontal service dependencies (Service→Endpoint→Pod) and vertical configuration dependencies (ConfigMap→Deployment→Pod). After obtaining the correlation relationship, it is rendered and displayed through the rendering engine to provide users with an intuitive understanding of the correlation.

[0103] In particular, this application implements a cross-resource topology discovery algorithm for storage dependencies.

[0104] The algorithm is implemented through the following steps: First, use the Kubernetes API to obtain detailed information about all PVCs, PVs, and StorageClasses. Then, perform association analysis to 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 StorageClass driven by CSI, more detailed storage backend information is obtained through the CSI API; for in-tree storage plug-ins, specific parsing is performed based on the plug-in type. Next, use PVC, PV, StorageClass, and storage backend information as nodes, establish directed edges based on the association analysis results, and construct a dependency graph. Finally, pass the labels on the PV and StorageClass to the corresponding PVC as implicit labels.

[0105] It can be seen from the above technical solution that this embodiment provides a device for generating association relationships of cloud native applications, which is applied to electronic devices, specifically for identifying workload resources of a cluster and adding hierarchical labels 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 the comprehensive capture of the relationship between resources of cloud native applications through a dynamic label association mechanism, and reflects the dynamic status and dependency relationships of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationships in the existing technology.

[0106] In addition, in a specific embodiment of the present application, a topology calculation module 30 is also included, such as Figure 6 shown.

[0107] The topology calculation module is used to implement topology snapshot services through a real-time topology construction engine.

[0108] This application designs an event-driven collector that builds a priority event queue based on Kubernetes Informers. Leveraging the efficient mechanisms of Informers, it monitors cluster resource change events (such as creation, update, and deletion) and pushes key events to the topology calculation worker in real time. Upon receiving the event, the topology calculation worker immediately performs topology calculations, generates real-time differences, and passes them to the rendering engine, thus implementing a topology snapshot service.

[0109] The service generates a topology difference snapshot every 5 seconds and supports a timeline backtracking function, allowing users to view historical topology status. 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 map update is less than 200 milliseconds, which is much lower than the 3-5 second delay of traditional solutions. In addition, a topology weight calculation model is constructed. Among them, the connection line weight is determined by the API call frequency and QoS level. The node size is calculated according to the following steps: First, the CPU usage, memory usage and health status of the node are obtained through the Kubernetes Metrics API or a third-party monitoring system. Then, the resource ratio is calculated: CPU ratio = node CPU usage / total CPU capacity of the cluster, Memory ratio = node memory usage / total memory capacity of the cluster. Next, the health coefficient is calculated based on health. If it is ready, the coefficient is 1, and if it is unhealthy, it is 0, or a value between 0 and 1 is set according to the unhealthy time. Finally, the node size is calculated: node size = (w1×CPU ratio + w2×Memory ratio)×health coefficient, where w1 and w2 are weight coefficients, which can be adjusted according to actual needs to normalize the node size.

[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 updates of topology information, ensuring that users can promptly understand the latest status of the application. The processing delay is less than 200 milliseconds, which is much lower than traditional solutions, effectively solving the problem of insufficient real-time performance of existing technologies.

[0111] In addition, in another specific embodiment of the present application, a health assessment module 40 is also included, such as Figure 7 shown.

[0112] The health assessment module is used to evaluate the health status of the cluster based on a composite health indicator algorithm.

[0113] This application proposes a composite health indicator algorithm that comprehensively considers multiple dimensions to evaluate the health status of resources. The algorithm formula is:

[0114] HealthScore=α×ReadyStatus+β×(1-CPUThrottle)+γ×ProbeSuccessRate+δ×LogErrorFrequency.

[0115] ReadyStatus reflects real-time availability, CPUThrottle reflects resource performance, ProbeSuccessRate reflects service stability, and LogErrorFrequency reflects exception frequency. Coefficients α, β, γ, and δ are dynamically adjusted and automatically optimized based on service level objectives (SLOs). Coefficient adjustment and optimization are achieved through the following steps:

[0116] First, define clear SLOs for each service and convert them into specific thresholds. Then, collect historical data on 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 based on the correlation, SLO, and experience or expert knowledge. Automatic optimization can use machine learning algorithms (such as regression models and neural networks) to train models, automatically predict HealthScore based on historical data, and optimize coefficients; or use reinforcement learning algorithms to use HealthScore as a reward signal to train the agent to automatically adjust coefficients to maximize HealthScore and meet SLO. Based on the calculated health score, use a directed graph algorithm to calculate the impact 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 resource availability, performance, stability and abnormal frequency, and provides a more comprehensive and accurate application health status assessment through dynamic coefficient adjustment and fault propagation prediction, overcoming the defect of the single health assessment dimension of existing technologies.

[0118] In addition, in another specific embodiment of the present application, an engine configuration module 50 is also included, such as Figure 8 shown.

[0119] The engine configuration module is used to configure an adaptive rendering engine for rendering the topology map.

[0120] Configure an adaptive rendering engine that automatically selects the appropriate layout based on cluster size. For small clusters, a force-directed layout is used, ensuring clear and easy-to-read topology through automatic avoidance and dynamic balancing. For large clusters, a hierarchical contraction layout is used, aggregating components by namespace or type to avoid information overload.

[0121] This engine enables time-space travel, allowing users to view historical topology status by dragging the timeline, and provides a spatial comparison mode that supports users to compare production and test environments at the same time, facilitating problem troubleshooting.

[0122] The above technical content enables the intelligent visualization engine to automatically select the optimal layout based on the cluster size and provide time and space travel functions, improving user experience and problem troubleshooting efficiency.

[0123] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0124] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0125] Figure 9 This is a block diagram of an electronic device according to an embodiment of the present application.

[0126] Reference below Figure 9 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are 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 (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. This electronic device is merely an example and should not limit the functionality or scope of use of the embodiments of the present disclosure.

[0127] The electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 902 or programs loaded from an input device 906 into a random access memory (RAM) 903. The RAM also stores various programs and data required for the operation of the electronic device. The processing device, ROM, and RAM are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0128] Typically, the following devices may be connected to the I / O interface: input devices such as a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 907 such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 908 such as a magnetic tape, hard disk, etc.; and communication devices 909. Communication devices 909 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.

[0129] The present application also provides a computer-readable medium embodiment.

[0130] The above-mentioned computer-readable medium is applied to an electronic device and carries one or more computer programs. When the above-mentioned one or more computer programs are executed by the electronic device, the electronic device identifies the workload resources of the cluster and adds a hierarchical label 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. This application realizes the comprehensive capture of the relationship between the resources of cloud-native applications through a dynamic label association mechanism, and reflects the dynamic status and dependency relationship of resources through a hierarchical label system, thereby constructing a more complete and accurate application topology map, solving the problem of incomplete association relationship in the prior art.

[0131] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection having 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 thereof.

[0132] In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in conjunction with an instruction execution system, apparatus, or device. Furthermore, in this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, fiber optic cable, RF (radio frequency), or any suitable combination thereof.

[0133] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0134] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0135] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only 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 terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.

[0136] The technical solution provided by the present invention is introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting 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 the workload resources of the cluster and add hierarchical tags to each identified workload resource. The hierarchical tags include explicit tags and implicit tags. The explicit tags are user-defined static associations used to identify the business attributes of the resources and the user-defined associations. The implicit tags are dynamic associations automatically derived by the system through analysis and used to reflect the dynamic state of the resources and the dependencies automatically discovered by the system. 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 association relationship includes horizontal service dependency and vertical configuration dependency.

3. The method for generating an association relationship according to any one of claims 1 to 2, wherein: 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. Topology calculation is performed on the change events to obtain real-time differences, thereby realizing a topology snapshot service.

4. The method for generating an association relationship according to claim 3, wherein: Also includes the steps: The health status of the cluster is evaluated based on a composite health indicator algorithm.

5. The method for generating an association relationship according to claim 3, wherein: 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 display a historical topology state based on a timeline drag operation of a user.

6. A device for generating association relationships of cloud native applications, applied to electronic devices, characterized in that: The association relationship generating device includes: A load identification module is configured to identify workload resources in a cluster and add hierarchical tags to each identified workload resource. The hierarchical tags include explicit tags and implicit tags. The explicit tags are user-defined static associations used to identify the business attributes of the resources and the user-defined association relationships. The implicit tags are dynamic associations automatically derived by the system through analysis and used to reflect the dynamic state of the resources and the dependencies automatically discovered by the system. The index construction module is configured to obtain the association relationship of the cloud native applications in the cluster by constructing a multi-dimensional association index, where the association relationship includes horizontal service dependency and vertical configuration dependency.

7. The association relationship generating device according to claim 6, wherein: Also includes: A topology calculation module is configured to build a priority event queue, monitor 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 user's timeline dragging operation.

8. 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 according to any one of claims 1 to 5.

9. 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 according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Kubernetes resource index construction method and system

    CN115623008A

  • Cloud native state evaluation method and device, equipment and storage medium

    CN117215589A