Multi-cluster resource management method, apparatus, device, medium, and computer program product

CN122547530APending Publication Date: 2026-08-11CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610683312.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

但是,管理统计这些分布式应用程序的容量资源,以达到精确的资源管理和分配,变得复杂而困难

Benefits of technology

[0014] Compared to existing technologies, the beneficial effects of the multi-cluster resource management method, apparatus, device, medium, and computer program product provided by this invention are as follows: By acquiring capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones; statistically analyzing the capacity data and resource usage data to calculate the resource utilization rate of each node; based on the resource utilization rate of all nodes and the availability zone identifier, separately statistically analyzing the resource usage within each availability zone and summarizing statistics across availability zones to obtain multi-availability zone capacity data and resource utilization rate; and uniformly managing the resources of multiple target clusters according to the multi-availability zone capacity data and resource utilization rate. This invention overcomes the limitations of a single cluster, achieving real-time capacity statistics of CPU, memory, Pods, and network bandwidth across multiple clusters and multiple Availability Zones, effectively improving data statistical accuracy and real-time performance, and responding more quickly to changes in resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122547530A_ABST
    Figure CN122547530A_ABST
Patent Text Reader

Abstract

This invention discloses a multi-cluster resource management method, apparatus, device, medium, and computer program product. The method includes: acquiring capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; performing statistical analysis on the capacity data and resource usage data to calculate the resource utilization rate of each node; based on the resource utilization rate of all nodes and the availability zone identifier, performing separate statistical analysis on resource usage within each availability zone and summarizing statistical analysis across availability zones to obtain multi-availability zone capacity data and resource utilization rate; and performing unified management of resources in multiple target clusters based on the multi-availability zone capacity data and resource utilization rate. This invention overcomes the limitations of a single cluster, realizing real-time capacity statistics of CPU, memory, Pods, and network bandwidth across multiple clusters and multiple Availability Zones, effectively improving the accuracy and real-time performance of data statistics, and responding more quickly to changes in resource usage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a multi-cluster resource management method, apparatus, equipment, medium, and computer program product. Background Technology

[0002] With the widespread adoption of cloud computing and containerization technologies, enterprises are increasingly inclined to deploy applications across multiple geographic locations or cloud providers to improve availability, flexibility, and performance. However, managing and statistically analyzing the capacity resources of these distributed applications for precise resource management and allocation has become complex and difficult. Current resource management methods are primarily suited for single clusters and cannot handle the complexity of multiple clusters across multiple Availability Zones (AZs), resulting in inefficiencies in resource allocation, scheduling, and fault recovery. Furthermore, the lack of precise statistics and analysis of resource usage across the entire multi-cluster, multi-AZ environment prevents existing solutions from providing granular resource management, leading to resource waste. Additionally, existing solutions suffer from high latency in data acquisition, and monitoring data may be missing or inaccurate during network fluctuations or when some clusters are unavailable. Therefore, current resource management methods cannot provide real-time, accurate, and low-latency management of resources in large-scale multi-AZ container clusters. Summary of the Invention

[0003] The purpose of this invention is to provide a multi-cluster resource management method, apparatus, device, medium, and computer program product that breaks through the limitations of a single cluster, realizes real-time capacity statistics of CPU, memory, Pod, and network bandwidth across multiple clusters and multiple Availability Zones, effectively improves the accuracy and real-time performance of data statistics, and responds more quickly to changes in resource usage.

[0004] To achieve the above objectives, embodiments of the present invention provide a multi-cluster resource management method, including: Obtain capacity data of nodes, resource usage data of Pods, and availability zone identifier of each target cluster in multiple target clusters; wherein, the target clusters span multiple availability zones; Perform statistical analysis on the capacity data and the resource usage data to calculate the resource utilization rate of each node; Based on the resource utilization rate of all nodes and the availability zone identifier, the resource utilization in each availability zone is statistically analyzed separately and aggregated across availability zones to obtain capacity data and resource utilization rate for multiple availability zones. Based on the capacity data and resource utilization of the multiple availability zones, the resources of the multiple target clusters are managed in a unified manner.

[0005] As an improvement to the above solution, obtaining the capacity data of nodes in multiple target clusters, the resource usage data of Pods, and the availability zone identifier of each target cluster includes: Based on the multi-cluster federated control plane, the scheduling policy information and cluster metadata information of multiple target clusters are obtained; Based on the scheduling policy information and cluster metadata information, identify and obtain the availability zone identifier of each target cluster; Based on the preset product code information and node tags, a list of nodes for the target product is selected from multiple target clusters; Traverse the node list to obtain the total CPU, total memory, and total Pods of each node, and obtain the capacity data of the node; Based on the running status and annotation information of the Pods running on each node, the resource usage data of the Pods is obtained, including Pod usage, byte usage, total bytes, CPU usage, and memory usage.

[0006] As an improvement to the above solution, the statistical analysis of the capacity data and the resource usage data to calculate the resource utilization rate of each node includes: Based on the capacity data and the resource usage data, the CPU utilization and memory utilization of each node are calculated using a moving average algorithm; Based on the capacity data and the resource usage data, the Pod utilization rate of each node is calculated using an exponential moving average algorithm; Based on the capacity data and the resource usage data, the bandwidth utilization rate of each node is calculated using a time window-based calculation method.

[0007] As an improvement to the above scheme, the moving average algorithm uses a symmetrical window for calculation. Taking the current data point as the center, it calculates the average value of a preset number of data points before and after the current data point. The calculation formula is as follows: ; in, y ( n () represents the smoothed data. x ( n (This refers to the original data.) N For window length, k To extend the step size.

[0008] As an improvement to the above scheme, the calculation formula for the exponential moving average algorithm is as follows: ; in, EMAt It is the exponential moving average at the current moment. EMAt 1 represents the exponential moving average of the previous time step. (0, 1) represents the degree of weight decay. α =2 / (1+ T ), T For time period parameters, yt This represents the observed value at the current moment.

[0009] As an improvement to the above scheme, the calculation method based on time windows includes: Define a fixed time window; Add the real-time collected byte usage to the time window; Periodically clean up historical byte usage that exceeds the specified time window; Calculate the peak and average byte usage within the current time window.

[0010] This invention also provides a multi-cluster resource management device, comprising: The data acquisition module is used to acquire capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones; The statistical analysis module is used to perform statistical analysis on the capacity data and the resource usage data, and calculate the resource utilization rate of each node; The cross-regional calculation module is used to perform separate statistics on resource usage in each availability zone and aggregate statistics across availability zones based on the resource utilization rate of all nodes and the availability zone identifier, so as to obtain capacity data and resource utilization rate of multiple availability zones; The resource management module is used to uniformly manage the resources of multiple target clusters based on the capacity data and resource utilization of the multiple availability zones.

[0011] This invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the multi-cluster resource management method described in any of the preceding claims.

[0012] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the multi-cluster resource management method described above.

[0013] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the multi-cluster resource management method described above.

[0014] Compared to existing technologies, the beneficial effects of the multi-cluster resource management method, apparatus, device, medium, and computer program product provided by this invention are as follows: By acquiring capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones; statistically analyzing the capacity data and resource usage data to calculate the resource utilization rate of each node; based on the resource utilization rate of all nodes and the availability zone identifier, separately statistically analyzing the resource usage within each availability zone and summarizing statistics across availability zones to obtain multi-availability zone capacity data and resource utilization rate; and uniformly managing the resources of multiple target clusters according to the multi-availability zone capacity data and resource utilization rate. This invention overcomes the limitations of a single cluster, achieving real-time capacity statistics of CPU, memory, Pods, and network bandwidth across multiple clusters and multiple Availability Zones, effectively improving data statistical accuracy and real-time performance, and responding more quickly to changes in resource usage. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a preferred embodiment of a multi-cluster resource management method provided by the present invention; Figure 2 This is a schematic diagram of a preferred embodiment of a multi-cluster resource management device provided by the present invention; Figure 3 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Please see Figure 1 , Figure 1 This is a flowchart illustrating a preferred embodiment of a multi-cluster resource management method provided by the present invention. The multi-cluster resource management method includes: S1, obtain the capacity data of nodes in multiple target clusters, the resource usage data of Pods, and the availability zone identifier of each target cluster; wherein, the target clusters span multiple availability zones; S2, Perform statistical analysis on the capacity data and the resource usage data, and calculate the resource utilization rate of each node; S3, based on the resource utilization rate of all nodes and the availability zone identifier, perform separate statistics on resource utilization in each availability zone and aggregate statistics across availability zones to obtain capacity data and resource utilization rate of multiple availability zones; S4. Based on the capacity data and resource utilization of the multiple availability zones, the resources of the multiple target clusters are managed in a unified manner.

[0018] Specifically, this embodiment of the invention uses Kosmos to connect multiple Kubernetes clusters, enabling Pods to access Pods and Services across clusters as if they were in the same cluster. This lays the foundation for capacity statistics across multiple clusters in this embodiment. Kosmos is a collection of distributed cloud-native federated cluster technologies that integrates infrastructure resources at the lower level and provides advanced capabilities for platform products at the upper level, achieving unified management and orchestration of resources, network connectivity, and multi-level scheduling in large-scale scenarios with multiple clouds, multiple clusters, and multiple Availability Zones. Kosmos is fully compatible with the Kubernetes API, allowing users to use federated clusters as if they were single clusters. Kosmos can synchronize resources with multiple clusters and provides more powerful network connectivity capabilities while maintaining compatibility with the Kubernetes OpenAPI. This embodiment of the invention first obtains capacity data of each node, resource usage data of each Pod, and the Availability Zone identifier of each target cluster based on the Kosmos multi-cluster management service. The target clusters can span multiple Availability Zones. Then, statistical analysis is performed on the capacity data of each node and the resource usage data of each Pod to calculate the resource utilization rate of each node. The statistical analysis employs advanced algorithms such as moving averages, exponential moving averages (EMA), and time-window-based calculations to smooth and statistically analyze the raw data, preventing transient fluctuations from impacting decision-making. Secondly, based on the resource utilization and availability zone (AZ) identifiers of all nodes, resource usage within each AZ, such as total capacity, total usage, and resource utilization rate, is statistically analyzed separately and aggregated across AZs. This yields capacity and resource utilization data for each AZ, as well as total capacity and resource utilization data for all AZs. This allows for insight into resource distribution from an Availability Zone (AZ) perspective, identifying single AZ resource bottlenecks and providing decision support for cross-AZ scheduling and expansion. Finally, based on the capacity and resource utilization data for each AZ and the total capacity and resource utilization data for all AZs, resources across multiple target clusters are managed uniformly. For example, the calculated detailed capacity data with AZ dimensions is pushed to a shared cloud capacity platform for unified management of resources across multiple target clusters, achieving overall capacity awareness and management of multi-cluster, multi-AZ environments. Furthermore, the unified shared capacity data monitoring platform can set capacity thresholds; products exceeding the threshold will be automatically removed from the platform. If you receive a delisting notice from the unified shared capacity data monitoring platform when ordering cloud products, you cannot order those products.

[0019] This invention overcomes the limitations of a single cluster, enabling real-time capacity statistics of CPU, memory, Pods, and network bandwidth across multiple clusters and Availability Zones, effectively improving the accuracy and real-time performance of data statistics and providing a faster response to changes in resource usage.

[0020] In another preferred embodiment, step S1, obtaining capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster, includes: S11, Based on the multi-cluster federated control plane, obtain scheduling policy information and cluster metadata information of multiple target clusters; S12, based on the scheduling policy information and cluster metadata information, identify and obtain the availability zone identifier of each target cluster; S13, Based on the preset product code information and node tags, filter out the node list of the target product from multiple target clusters; S14, traverse the node list to obtain the total CPU, total memory, and total Pods of each node, and obtain the capacity data of the node; S15. Based on the running status and annotation information of the Pods running on each node, obtain the Pod usage, byte usage, total bytes, CPU usage, and memory usage to obtain the resource usage data of the Pod.

[0021] Specifically, in Kubernetes, all resources are uniquely identified by Group, Version, and Resource, i.e., GVR. This embodiment defines routePolicyGvr: the GVR of the scheduling policy resource. This policy defines which clusters an application should be scheduled to (possibly based on Availability Zones, load balancing, affinity, etc.). clusterGvr: the GVR of the cluster resource. This resource describes information about the managed Kubernetes clusters (such as API Server address, certificate, Availability Zone, etc.). Multiple Kubernetes clusters are connected via the kubeconfig file of multi-cluster Kosmos, and multi-cluster scheduling policy resource information and multi-cluster metadata information are obtained by synchronizing GVR resource types. Kosmos, combined with the custom routepolicy's crd resource, can accurately locate specific cluster names. A multi-Availability Zone (AZ) awareness mechanism is introduced. Based on the scheduling policy information and cluster metadata information, the AZ identifier of each target cluster is identified and obtained. Through awareness of the multi-AZ environment, the system can consider geographical location during scheduling and resource allocation. A periodically running background task (CronJob) is initiated to periodically collect capacity data. The scheduled task iterates through the clusters list in the routepolicy, combines it with item information parsed from clusterpedia (a multi-cluster resource retrieval system), and connects to the corresponding Kubernetes cluster. Then, based on the product code `productCodeInfo`, it retrieves the node list for different products using different node labels `nodeLabels`. By loading the configmap file, it reads the Availability Zone (AZ) configuration items for each product and perceives capacity based on different AZs. It queries the Kubernetes API, iterates through the node list, and obtains the total CPU, total memory, and total Pods for each node, thus obtaining the node's capacity data. Based on the running status and annotation information of the Pods running on each node, it obtains Pod usage, byte usage, total bytes, CPU usage, and memory usage, thus obtaining Pod resource usage data. Leveraging Kosmos's multi-cluster resource acquisition mechanism and multi-cluster network connectivity, it can obtain the specific node / pod resource information for the corresponding cluster, and periodically polls and pushes it to a unified shared capacity data monitoring platform for unified supervision. For example, the `GetCapacity(nodeList)` method iterates through the nodes to retrieve the `cpuTotal`, `memoryTotal`, and `podTotal` capacity data for each node. Based on the pod's running / pending status, the number of `podUsage` values ​​is obtained.The byteUsage / byteTotal values ​​are obtained from the corresponding product's pod.Annotations["pulsar.capacity / bandwidth.publishInMB"] / pod.Annotations["pulsar.capacity / bandwidth.resourceLimitInMB"]. The cpuUsage / memoryUsage values ​​are then obtained by calculating the CPU and memory metrics of the container within the pod using Cpu().MilliValue() / Memory().MilliValue().

[0022] In another preferred embodiment, step S2 involves statistically analyzing the capacity data and the resource usage data to calculate the resource utilization rate of each node, including: S21, Based on the capacity data and the resource usage data, the CPU utilization and memory utilization of each node are calculated using a moving average algorithm; S22, Based on the capacity data and the resource usage data, the Pod utilization rate of each node is calculated using an exponential moving average algorithm; S23, based on the capacity data and the resource usage data, calculate the bandwidth utilization rate of each node using a time window-based calculation method.

[0023] Specifically, this embodiment of the invention uses a moving average algorithm to calculate the CPU utilization and memory utilization of each node based on the capacity data of each node and the resource usage data of each Pod, in order to smooth the impact of abnormal peak traffic on the statistical results. Based on the capacity data of each node and the resource usage data of each Pod, an exponential moving average algorithm is used to calculate the Pod utilization of each node. This algorithm is more sensitive to the latest data points, enabling the system to respond to changes more quickly. Based on the capacity data of each node and the resource usage data of each Pod, a time window-based calculation method is used to calculate the bandwidth utilization of each node, which can better reflect the actual usage situation.

[0024] The embodiments of this invention introduce moving average, exponential moving average and time window algorithms to effectively filter out instantaneous traffic spikes, smooth abnormal fluctuations, and make resource utilization data closer to the real load, thereby effectively improving the accuracy of scheduling decisions.

[0025] As a preferred embodiment, the moving average algorithm uses a symmetrical window for calculation. Taking the current data point as the center, it calculates the average value of a preset number of data points before and after the current data point. The calculation formula is as follows: ; in, y ( n () represents the smoothed data. x ( n (This refers to the original data.) N For window length, k To extend the step size.

[0026] Specifically, the moving average algorithm is a method for calculating the average value of a dataset over time. It works by defining a window containing data points up to and including the current data point. Typically, the window is symmetrical to prevent phase bias. The window size is usually odd. For example, in a 3-point average (window length 3), the original data is x, and the smoothed data is y:

[0027] As a preferred embodiment, the calculation formula for the exponential moving average algorithm is as follows: ; in, EMAt It is the exponential moving average at the current moment. EMAt 1 represents the exponential moving average of the previous time step. (0, 1) represents the degree of weight decay. α =2 / (1+ T ), T For time period parameters, yt This represents the observed value at the current moment.

[0028] Specifically, the exponential moving average algorithm combines the current data point with previous EMA values ​​to calculate a new EMA. The weights decrease exponentially over time, thus EMA places greater emphasis on recent data points than a simple moving average. For example, the formula for the exponential moving average algorithm is: ; in, EMAt It is the exponential moving average at the current moment. EMAt 1 represents the exponential moving average of the previous time step. (0, 1) represents the degree of weight decay. The larger the value, the faster the past observations decay. α =2 / (1+ T ), T For use in calculation The time period parameter does not indicate that exponential decay ends after period T. yt This represents the observed value at the current moment.

[0029] As a preferred embodiment, the calculation method based on time windows includes: Define a fixed time window; Add the real-time collected byte usage to the time window; Periodically clean up historical byte usage that exceeds the specified time window; Calculate the peak and average byte usage within the current time window.

[0030] Specifically, time-window-based calculation methods compute data only within a specific time window. This algorithm is typically used in real-time systems to calculate the sum of a quantity or other statistical data within a given time period. For example, a fixed time window is defined; real-time collected byte usage is continuously added to this time window; historical byte usage exceeding the time window is periodically cleaned up; and the peak and average byte usage within the current time window are calculated. In essence, time-window-based calculation methods divide the timeline into independent small blocks at regular intervals and then perform statistical analysis based on these blocks.

[0031] In this embodiment of the invention, Kosmos can handle the hybrid deployment of multiple data service products, unified capacity awareness and management reporting, saving the cost of developing a separate capacity management system for each product for separate statistical reporting, reducing resource fragmentation, and reducing the code from multiple sets to a single set, significantly lowering development costs. Kosmos uses a unified capacity push interface ( / api / capacity / v1 / normal_product / bulk_insert / ) for capacity push reporting, reducing the resource waste caused by the interface overhead of separate reporting by each product. Furthermore, in the later stages of operation and maintenance (OPS) system maintenance, only one capacity statistics system, Kosmos, needs to be maintained, and monitoring and alarms only require monitoring this one system, greatly saving operation and maintenance costs.

[0032] Accordingly, the present invention also provides a multi-cluster resource management device, which can implement all the processes of the multi-cluster resource management method in the above embodiments.

[0033] Please see Figure 2 , Figure 2 This is a schematic diagram of a preferred embodiment of a multi-cluster resource management device provided by the present invention. The multi-cluster resource management device includes: The data acquisition module 201 is used to acquire capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones. The statistical analysis module 202 is used to perform statistical analysis on the capacity data and the resource usage data, and calculate the resource utilization rate of each node; The cross-regional calculation module 203 is used to perform separate statistics on resource usage in each availability zone and cross-availability zone summary statistics based on the resource utilization rate of all nodes and the availability zone identifier, so as to obtain capacity data and resource utilization rate of multiple availability zones; The resource management module 204 is used to uniformly manage the resources of multiple target clusters based on the capacity data and resource utilization of the multiple availability zones.

[0034] Preferably, the data acquisition module 201 is specifically used for: Based on the multi-cluster federated control plane, the scheduling policy information and cluster metadata information of multiple target clusters are obtained; Based on the scheduling policy information and cluster metadata information, identify and obtain the availability zone identifier of each target cluster; Based on the preset product code information and node tags, a list of nodes for the target product is selected from multiple target clusters; Traverse the node list to obtain the total CPU, total memory, and total Pods of each node, and obtain the capacity data of the node; Based on the running status and annotation information of the Pods running on each node, the resource usage data of the Pods is obtained, including Pod usage, byte usage, total bytes, CPU usage, and memory usage.

[0035] Preferably, the statistical analysis module 202 is specifically used for: Based on the capacity data and the resource usage data, the CPU utilization and memory utilization of each node are calculated using a moving average algorithm; Based on the capacity data and the resource usage data, the Pod utilization rate of each node is calculated using an exponential moving average algorithm; Based on the capacity data and the resource usage data, the bandwidth utilization rate of each node is calculated using a time window-based calculation method.

[0036] Preferably, the moving average algorithm uses a symmetrical window for calculation, taking the current data point as the center and averaging the values ​​of a preset number of data points before and after the current data point. The calculation formula is as follows: ; in, y ( n () represents the smoothed data. x ( n (This refers to the original data.) N For window length, k To extend the step size.

[0037] Preferably, the calculation formula for the exponential moving average algorithm is as follows: ; in, EMAt It is the exponential moving average at the current moment. EMAt 1 represents the exponential moving average of the previous time step. (0, 1) represents the degree of weight decay. α =2 / (1+ T ), T For time period parameters, yt This represents the observed value at the current moment.

[0038] Preferably, the time window-based calculation method includes: Define a fixed time window; Add the real-time collected byte usage to the time window; Periodically clean up historical byte usage that exceeds the specified time window; Calculate the peak and average byte usage within the current time window.

[0039] In specific implementation, the working principle, control process and technical effects of the multi-cluster resource management device provided in the embodiments of the present invention are the same as those of the multi-cluster resource management method in the above embodiments, and will not be repeated here.

[0040] Please see Figure 3 , Figure 3 This is a schematic diagram of a preferred embodiment of a terminal device provided by the present invention. The terminal device includes a processor 301, a memory 302, and a computer program stored in the memory 302 and configured to be executed by the processor 301. When the processor 301 executes the computer program, it implements the multi-cluster resource management method described in any of the above embodiments.

[0041] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0042] The processor 301 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 301 can be any conventional processor. The processor 301 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.

[0043] The memory 302 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 302 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card, etc., or the memory 302 can also be other volatile solid-state storage devices.

[0044] It should be noted that the aforementioned terminal devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 3 The structural diagram is merely an example of the terminal device described above and does not constitute a limitation on the terminal device described above. It may include more or fewer components than shown in the diagram, or combine certain components, or use different components.

[0045] This invention also provides a computer-readable storage medium, which includes a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to execute the multi-cluster resource management method described in any of the above embodiments.

[0046] This invention also provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the multi-cluster resource management method described in any of the above embodiments.

[0047] This invention provides a multi-cluster resource management method, apparatus, device, medium, and computer program product. It acquires capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones; statistically analyzes the capacity data and resource usage data to calculate the resource utilization rate of each node; based on the resource utilization rate of all nodes and the availability zone identifier, it performs separate statistical analysis of resource usage within each availability zone and aggregate statistical analysis across availability zones to obtain multi-availability zone capacity data and resource utilization rate; and manages the resources of multiple target clusters uniformly based on the multi-availability zone capacity data and resource utilization rate. This invention overcomes the limitations of a single cluster, achieving real-time capacity statistics of CPU, memory, Pods, and network bandwidth across multiple clusters and multiple Availability Zones, effectively improving data statistical accuracy and real-time performance, and enabling faster response to changes in resource usage.

[0048] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0049] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A multi-cluster resource management method, characterized in that, include: Obtain capacity data of nodes, resource usage data of Pods, and availability zone identifier of each target cluster in multiple target clusters; wherein, the target clusters span multiple availability zones; Perform statistical analysis on the capacity data and the resource usage data to calculate the resource utilization rate of each node; Based on the resource utilization rate of all nodes and the availability zone identifier, the resource utilization in each availability zone is statistically analyzed separately and aggregated across availability zones to obtain capacity data and resource utilization rate for multiple availability zones. Based on the capacity data and resource utilization of the multiple availability zones, the resources of the multiple target clusters are managed in a unified manner.

2. The multi-cluster resource management method as described in claim 1, characterized in that, The acquisition of capacity data of nodes in multiple target clusters, resource usage data of Pods, and availability zone identifier of each target cluster includes: Based on the multi-cluster federated control plane, the scheduling policy information and cluster metadata information of multiple target clusters are obtained; Based on the scheduling policy information and cluster metadata information, identify and obtain the availability zone identifier of each target cluster; Based on the preset product code information and node tags, a list of nodes for the target product is selected from multiple target clusters; Traverse the node list to obtain the total CPU, total memory, and total Pods of each node, and obtain the capacity data of the node; Based on the running status and annotation information of the Pods running on each node, the resource usage data of the Pods is obtained, including Pod usage, byte usage, total bytes, CPU usage, and memory usage.

3. The multi-cluster resource management method as described in claim 2, characterized in that, The statistical analysis of the capacity data and resource usage data to calculate the resource utilization rate of each node includes: Based on the capacity data and the resource usage data, the CPU utilization and memory utilization of each node are calculated using a moving average algorithm; Based on the capacity data and the resource usage data, the Pod utilization rate of each node is calculated using an exponential moving average algorithm; Based on the capacity data and the resource usage data, the bandwidth utilization rate of each node is calculated using a time window-based calculation method.

4. The multi-cluster resource management method as described in claim 3, characterized in that, The moving average algorithm uses a symmetrical window for calculation. Taking the current data point as the center, it calculates the average of a preset number of data points before and after the current data point. The calculation formula is as follows: ; in, y ( n () represents the smoothed data. x ( n (This refers to the original data.) N For window length, k To extend the step size.

5. The multi-cluster resource management method as described in claim 3, characterized in that, The calculation formula for the exponential moving average algorithm is as follows: ; in, EMAt This is the exponential moving average at the current moment. EMAt 1 represents the exponential moving average of the previous time step. (0, 1) represents the degree of weight decay. α =2 / (1+ T ), T For time period parameters, yt This represents the observed value at the current moment.

6. The multi-cluster resource management method as described in claim 3, characterized in that, The time window-based calculation method includes: Define a fixed time window; Add the real-time collected byte usage to the time window; Periodically clean up historical byte usage that exceeds the specified time window; Calculate the peak and average byte usage within the current time window.

7. A multi-cluster resource management device, characterized in that, include: The data acquisition module is used to acquire capacity data of nodes in multiple target clusters, resource usage data of Pods, and the availability zone identifier of each target cluster; wherein the target clusters span multiple availability zones; The statistical analysis module is used to perform statistical analysis on the capacity data and the resource usage data, and calculate the resource utilization rate of each node; The cross-regional calculation module is used to perform separate statistics on resource usage in each availability zone and aggregate statistics across availability zones based on the resource utilization rate of all nodes and the availability zone identifier, so as to obtain capacity data and resource utilization rate of multiple availability zones; The resource management module is used to uniformly manage the resources of multiple target clusters based on the capacity data and resource utilization of the multiple availability zones.

8. A terminal device, characterized in that, The system includes a processor and a memory, wherein the memory stores a computer program and the computer program is configured to be executed by the processor, wherein the processor, when executing the computer program, implements the multi-cluster resource management method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the device containing the computer-readable storage medium executes the computer program, it implements the multi-cluster resource management method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, which, when executed by a processor, implement the multi-cluster resource management method as described in any one of claims 1 to 6.