Cost control method and device, storage medium and electronic equipment

By acquiring target resource data and data aggregating in the fields of cloud computing and container technology, the prediction results are analyzed to achieve accurate billing and cost control, the problem of insufficient resource use billing and control mechanisms in the existing technology is solved, and the accuracy of cost control and resource utilization efficiency are improved.

CN119759497APending Publication Date: 2025-04-04DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411834731.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing technology lacks refined resource usage billing and control mechanisms in the fields of cloud computing and container technology, resulting in resource waste and cost increase, reducing the accuracy of cost control.

Method used

By obtaining multiple target resource data and determining multiple data aggregation indicators, data aggregation of resource data according to these indicators is performed separately, and the prediction results are analyzed to achieve accurate billing and cost control of resources.

Benefits of technology

It effectively improves the accuracy of cost control of the target cluster, and realizes accurate resource billing and effective cost control and optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759497A_ABST
    Figure CN119759497A_ABST
Patent Text Reader

Abstract

The invention provides a cost control method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a plurality of pieces of target resource data, and determining a plurality of data aggregation indexes; performing data aggregation on the plurality of target resource data according to each data aggregation index in the plurality of data aggregation indexes to obtain to-be-analyzed data under each data aggregation index; determining a data analysis prediction result under each data aggregation index based on the to-be-analyzed data under each data aggregation index; based on the data analysis prediction result under each data aggregation index, determining a cost control prediction result under each data aggregation index; wherein the cost control prediction result under one data aggregation index is used for guiding the cost control of the target cluster. According to the embodiment of the invention, the accuracy of cost control of the target cluster can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a cost control method, device, storage medium and electronic equipment. Background Art

[0002] At present, resource clusters have been widely used (such as Kubernetes (abbreviated as k8s) clusters, Kubernetes is an open source system for managing containerized applications on multiple hosts in cloud platforms), such as cloud computing service fields, enterprise-level IT (Information Technology) systems, Internet and mobile Internet fields, etc., and with the continuous development of cloud computing and container technology, the application scope of K8S will continue to expand, which makes the cost control of clusters have a wide range of application fields and far-reaching impact. However, the resource use of related technologies often lacks refined billing and control mechanisms, resulting in resource waste and rising costs, resulting in low accuracy of cost control. Based on this, there is currently no good solution for how to improve the accuracy of cost control. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a cost control method, device, storage medium and electronic device to solve the problem of low accuracy of cost control of clusters in related technologies; that is, an embodiment of the present invention can perform data aggregation on multiple target resource data through multiple data aggregation indicators to achieve cost control of different data aggregation indicators, and can effectively achieve accurate billing of resources indicated by multiple data aggregation indicators, thereby effectively improving the accuracy of cost control of the target cluster, and thereby achieving effective cost control and optimization.

[0004] According to one aspect of an embodiment of the present invention, a cost control method is provided, the method comprising:

[0005] Acquire multiple target resource data and determine multiple data aggregation indicators;

[0006] According to each of the multiple data aggregation indicators, the multiple target resource data are aggregated to obtain the data to be analyzed under each of the multiple data aggregation indicators;

[0007] Determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator respectively;

[0008] Based on the data analysis prediction results under the respective data aggregation indicators, the cost control prediction results under the respective data aggregation indicators are determined; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

[0009] According to another aspect of an embodiment of the present invention, a cost control device is provided, the device comprising:

[0010] An acquisition unit, used for acquiring multiple target resource data;

[0011] A processing unit, configured to determine a plurality of data aggregation indicators;

[0012] The processing unit is further configured to perform data aggregation on the plurality of target resource data according to each of the plurality of data aggregation indicators, respectively, to obtain data to be analyzed under each of the plurality of data aggregation indicators;

[0013] The processing unit is further configured to determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator;

[0014] The processing unit is also used to determine the cost control prediction results under each data aggregation indicator based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising a processor and a memory storing a program, wherein the program comprises instructions, which, when executed by the processor, enable the processor to perform the above-mentioned method.

[0016] According to another aspect of an embodiment of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above-mentioned method.

[0017] After acquiring multiple target resource data and determining multiple data aggregation indicators, the embodiments of the present invention can respectively perform data aggregation on the multiple target resource data according to each data aggregation indicator in the multiple data aggregation indicators to obtain the data to be analyzed under each data aggregation indicator; and can respectively determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator. Further, the cost control prediction results under each data aggregation indicator can be determined based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction results under one data aggregation indicator are used to guide the cost control of the target cluster. It can be seen that the embodiments of the present invention can perform data aggregation on multiple target resource data through multiple data aggregation indicators to achieve cost control of different data aggregation indicators, and can effectively achieve accurate billing of resources indicated by multiple data aggregation indicators, which can effectively improve the accuracy of cost control of the target cluster, thereby achieving effective cost control and optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0019] Figure 1 A schematic diagram of a cost control method according to an exemplary embodiment of the present invention is shown;

[0020] Figure 2 A schematic diagram of data collection according to an exemplary embodiment of the present invention is shown;

[0021] Figure 3 A schematic diagram of a user interface according to an exemplary embodiment of the present invention is shown;

[0022] Figure 4 A schematic diagram showing a cost control solution according to an exemplary embodiment of the present invention is shown;

[0023] Figure 5 A schematic diagram showing a flow chart of another cost control method according to an exemplary embodiment of the present invention is shown;

[0024] Figure 6 A schematic diagram showing a cost calculation according to an exemplary embodiment of the present invention is shown;

[0025] Figure 7 A schematic block diagram of a cost control device according to an exemplary embodiment of the present invention is shown;

[0026] Figure 8 A block diagram of an exemplary electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0027] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0028] It should be understood that the various steps described in the method embodiments of the present invention 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 invention is not limited in this respect.

[0029] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0032] It should be noted that the execution subject of the cost control method provided in the embodiment of the present invention may be one or more electronic devices, and the present invention does not limit this; wherein, the electronic device may be a terminal (i.e., a client) or a server, then when the execution subject includes multiple electronic devices, and the multiple electronic devices include at least one terminal and at least one server, the cost control method provided in the embodiment of the present invention may be jointly executed by the terminal and the server. Accordingly, the terminal mentioned here may include but is not limited to: smart phones, tablet computers, laptops, desktop computers, intelligent voice interaction devices, and the like. The server mentioned here may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing (cloud computing), cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, and the like.

[0033] Based on the above description, an embodiment of the present invention proposes a cost control method, which can be executed by the electronic device (terminal or server) mentioned above; or, the cost control method can be executed by the terminal and the server together. For the sake of convenience, the following description will take the electronic device executing the cost control method as an example; Figure 1 As shown, the cost control method may include the following steps S101-S104:

[0034] S101, acquiring multiple target resource data and determining multiple data aggregation indicators.

[0035] Among them, the above-mentioned multiple target resource data may include target resource data under each target resource indicator in the multiple target resource indicators; optionally, the multiple target resource indicators include but are not limited to at least two of the following: at least one CPU (Central Processing Unit, central processing unit) resource indicator of at least one monitoring object, at least one memory resource indicator of at least one monitoring object, and at least one GPU (Graphics Processing Unit, graphics processing unit) resource indicator of at least one monitoring object, etc., which is not limited in the embodiment of the present invention; exemplary, the multiple target resource indicators may also include at least one storage resource indicator of at least one monitoring object, etc. Optionally, at least one monitoring object may include but is not limited to at least one of the following: the entire cluster (i.e., the target cluster), each Pod in the target cluster, each node in the target cluster, etc., which is not limited in the embodiment of the present invention. Among them, Pod is the smallest / most basic unit created or deployed in Kubernetes, and a Pod can represent a process running on the cluster, that is, Pod represents a unit of deployment, which is an instance of a single application in Kubernetes. Based on this, a target resource indicator may include a monitoring object and a resource indicator. Optionally, the target cluster can be any cluster, which is not limited in the embodiment of the present invention.

[0036] Optionally, at least one CPU resource indicator may include but is not limited to at least one of the following: CPU utilization, CPU usage (i.e., utilization), and CPU application, etc., at least one memory resource indicator may include but is not limited to at least one of the following: memory utilization, memory usage, and memory application, etc., at least one GPU resource indicator may include but is not limited to at least one of the following: GPU utilization, GPU usage, and GPU application, etc., at least one storage resource indicator may include but is not limited to at least one of the following: storage ratio, storage quantity, and storage application, etc., and the embodiment of the present invention does not limit this. Based on this, a target resource indicator can be any one of the following: CPU utilization of the target cluster, CPU application of the target cluster, CPU utilization of a Pod, etc. It should be understood that a target resource data may include the indicator value of the corresponding target resource indicator at each collection time point in multiple collection time points. Optionally, multiple collection time points may include each collection time point within the target monitoring time range; optionally, the target monitoring time range can be any time range, such as multiple months, etc., and the embodiment of the present invention does not limit this.

[0037] For example, when a target resource data is the target resource data under the CPU utilization of the target cluster, the target resource data may include the value of the CPU utilization of the target cluster at each collection time point (i.e., the CPU utilization of the target cluster at each collection time point). For another example, when a target resource data is the target resource data under a resource indicator (such as a CPU resource indicator) of a Pod, the target resource data may include the resource data of the corresponding Pod under the corresponding resource indicator; wherein, the resource data of a Pod under a resource indicator may include the indicator value of the corresponding resource indicator of the corresponding Pod at each collection time point, i.e., the value of the corresponding resource indicator of the corresponding Pod at each collection time point, and so on.

[0038] Optionally, a data aggregation indicator may correspond to at least one target resource indicator among multiple target resource indicators. Optionally, multiple data aggregation indicators may include but are not limited to at least two of the following: at least one CPU cost control indicator of at least one aggregation object (i.e., each CPU cost control indicator of each aggregation object), at least one memory cost control indicator of at least one aggregation object, at least one GPU cost control indicator of at least one aggregation object, and at least one target cost control indicator of at least one aggregation object, etc., which are not limited to the embodiments of the present invention. Optionally, at least one aggregation object may include but are not limited to at least one of the following: a target cluster, each Pod in a target cluster, each node in a target cluster, each project in a target cluster, each user of a target cluster, and each task in a target cluster, etc., which are not limited to the embodiments of the present invention. Optionally, at least one CPU cost control indicator may include but is not limited to at least one of the following: CPU utilization, CPU application rate, CPU application cost, and CPU utilization cost, etc., at least one memory cost control indicator may include but is not limited to at least one of the following: memory utilization, memory application rate, memory application cost, and memory utilization cost, etc., at least one GPU cost control indicator may include but is not limited to at least one of the following: GPU utilization, GPU application rate, GPU application cost, and GPU utilization cost, etc., at least one target cost control indicator may include but is not limited to at least one of the following: resource application cost (such as the sum of CPU application cost, memory application cost, and GPU application cost), resource utilization cost (such as the sum of CPU utilization cost, memory utilization cost, and GPU utilization cost), and idle cost (which may be application cost-utilization cost, such as cluster resource application cost (which may be cluster total cost)-cluster resource utilization cost may be cluster idle cost), etc.; the embodiment of the present invention does not limit this. Based on this, a data aggregation indicator may include an aggregation object and a cost control indicator; optionally, an aggregation object may correspond to at least one resource object; optionally, a cost control indicator may be the same as or different from a resource indicator, and the embodiment of the present invention does not limit this.

[0039] Optionally, the target cluster can be any Kubernetes cluster, a project can include at least one task, a task can correspond to at least one Pod, and so on.

[0040] Optionally, the methods for obtaining multiple target resource data may include but are not limited to the following:

[0041] The first acquisition method: the electronic device can obtain a data download link, and download multiple target resource data based on the data download link.

[0042] The second acquisition method: the electronic device may include a monitoring data acquisition module. In this case, the electronic device may collect multiple target resource data through the monitoring data acquisition module to achieve acquisition of multiple target resource data, and so on.

[0043] Optionally, the monitoring data acquisition module can be Prometheus (a tool for pulling data); the status of the monitored components can be captured periodically through the HTTP protocol, and it is applicable to various virtualization environments, such as VM (virtual machine) or Docker (an open source application container engine). It can efficiently process a large amount of monitoring data and provide a powerful data query language PromQL (a monitoring service required for container services) for querying and aggregating monitoring data. As an open source monitoring, alarm and time series database combination, Prometheus has the advantages of easy management, strong scalability and good visualization. It plays an important role in modern cloud environments and containerized applications, helping users to monitor and ensure the stability and reliability of the system in real time. Optionally, the electronic device can pull monitoring data from at least one data monitoring tool through the monitoring data acquisition module to obtain multiple target resource data.

[0044] Optionally, at least one data monitoring tool may include but is not limited to Kubernetes API (Application Program Interface), kube-state-metrics (by listening to the Kubernetes API server, real-time collection of status information about various resource objects in the Kubernetes cluster (such as Deployment (a controller), Node, Pod, etc.). The generated indicator data is exposed to an external monitoring system such as Prometheus through an HTTP interface for further monitoring and analysis. By real-time monitoring the API server, kube-state-metrics can ensure the real-time and accuracy of the data), cAdvisor (full name: container advisor, which can perform real-time monitoring and performance data collection on resources and containers on the Node machine, including but not limited to CPU usage, memory usage, network throughput and file system usage, etc., and display this information to users in the form of charts) and DCGM (Data Center GPU Manager), etc., which are not limited to the embodiments of the present invention.

[0045] For example, Figure 2 As shown, the embodiment of the present invention can pull monitoring data from various data monitoring tools through Prometheus to obtain multiple target resource data, etc.

[0046] In other embodiments, when the electronic device does not include Prometheus, the electronic device may obtain multiple target resource data from Prometheus.

[0047] The third acquisition method: the electronic device can obtain multiple initial resource data, and one initial resource data can be the initial resource data under one target resource indicator; based on this, the electronic device can perform data filtering (i.e. data cleaning, etc.) on the multiple initial resource data to obtain the target resource data corresponding to each of the multiple initial resource data, so as to obtain multiple target resource data. It should be noted that the embodiment of the present invention does not limit the specific implementation method of data filtering; illustratively, the initial resource data under any target resource indicator can be filtered according to the filtering strategy corresponding to any target resource indicator to obtain the target resource data under any target resource indicator, and so on; optionally, the filtering strategy corresponding to any target resource indicator can be set according to experience or actual needs, which is not limited by the embodiment of the present invention.

[0048] Optionally, the electronic device may also perform persistent storage of multiple target resource data; and / or, may perform data backup of multiple target resource data, and so on.

[0049] Optionally, the monitoring data acquisition module can be a distributed architecture, thereby improving the efficiency of data acquisition and processing; based on this, the embodiment of the present invention can achieve real-time acquisition and efficient processing of monitoring data. Optionally, when Prometheus is not located in the electronic device, the embodiment of the present invention can introduce message queues and stream processing technology to obtain multiple target resource data or multiple initial resource data, thereby achieving real-time transmission and processing of monitoring data, etc.

[0050] In an embodiment of the present invention, the above-mentioned multiple target resource data can be obtained through real-time monitoring, that is, the indicator value of each target resource indicator at a collection time point can be collected every preset monitoring time, so that multiple target resource data within different target monitoring time ranges can be continuously obtained to perform continuous cost control. Optionally, the preset monitoring time can be set according to experience or according to actual needs, and the embodiment of the present invention does not limit this.

[0051] Optionally, when determining multiple data aggregation indicators, the electronic device may determine data aggregation indicator setting data, and determine multiple data aggregation indicators based on the data aggregation indicator setting data; optionally, the data aggregation indicator setting data may be set according to experience or actual needs, or may be set by the user through a data aggregation indicator setting operation, etc., which is not limited in the embodiments of the present invention. It should be noted that the embodiments of the present invention do not limit the specific implementation methods of the data aggregation indicator setting operation, such as performing a data aggregation indicator selection operation on a data aggregation indicator set to implement a data aggregation indicator setting operation, etc. Optionally, the data aggregation indicator set may include all preset data aggregation indicators, and so on.

[0052] Optionally, the electronic device may also provide a RESTful API interface (a network interface) to allow third-party systems or automation tools to access the system to achieve data sharing and integration; that is, the embodiments of the present invention may provide a user-friendly interface and a rich API interface to facilitate users to view monitoring data, analyze results, adjust configurations, and receive alarm information; wherein, the user interface may support graphical display of monitoring data, resource status, cost forecasts and other information, and provide interactive configuration adjustment functions. Based on this, users can perform data aggregation indicator setting operations and / or display target content, etc. through the client. Optionally, the target content can be any content, such as monitoring data, resource status, cost forecasts and other information.

[0053] For example, Figure 3As shown, the client can display the indicator category indication information corresponding to each data aggregation indicator in the multiple data aggregation indicators. One indicator category indication information can be used to indicate at least one corresponding data aggregation indicator (i.e., a user clicks on an indicator category indication information to view the cost control prediction results under each data aggregation indicator in the at least one data aggregation indicator indicated by the indicator category indication information, etc.). For example, the data aggregation indicator indicated by the indicator category indication information "cluster idle cost trend chart" can be the cluster idle cost (i.e., the idle cost of the target cluster), the data aggregation indicator indicated by the indicator category indication information "CPU Utilization (ratio) or CPU utilization" can be the CPU utilization (e.g., the CPU utilization of the target cluster), and the at least one data aggregation indicator indicated by the indicator category indication information "resource utilization trend chart in task cost" can include the resource utilization in each task cost (i.e., the resource utilization of each task, such as the CPU utilization of each task, etc.), etc. Among them, Utilization can represent utilization, and the application rate can also be represented as Requests.

[0054] S102, performing data aggregation on multiple target resource data according to each data aggregation indicator in the multiple data aggregation indicators, to obtain data to be analyzed under each data aggregation indicator.

[0055] In the embodiment of the present invention, for any data aggregation indicator among multiple data aggregation indicators, the electronic device can perform data aggregation on multiple target resource data according to any data aggregation indicator to obtain data to be analyzed under any data aggregation indicator.

[0056] Specifically, the electronic device can determine at least one target resource indicator corresponding to any data aggregation indicator; and according to at least one target resource indicator corresponding to any data aggregation indicator, perform data aggregation on multiple target resource data to obtain data to be analyzed under any data aggregation indicator; optionally, the aggregation object in any data aggregation indicator may include the resource object in each target resource indicator in at least one target resource indicator, that is, the aggregation object in any data aggregation indicator may be composed of the resource objects in each target resource indicator in at least one target resource indicator corresponding to any data aggregation indicator; optionally, when determining at least one target resource indicator corresponding to any data aggregation indicator, at least one pending target resource indicator including any resource object in at least one resource object corresponding to the aggregation object in any data aggregation indicator can be determined from multiple target resource indicators, and at least one target resource indicator including any resource indicator in at least one resource indicator corresponding to the cost control indicator in any data aggregation indicator can be determined from at least one pending target resource indicator, so as to determine at least one target resource indicator corresponding to any data aggregation indicator. Optionally, the electronic device may perform a sum operation on the target resource data under each target resource indicator in at least one target resource indicator corresponding to any data aggregation indicator, and the target resource data with the same resource indicator may be summed to obtain the target aggregated data under each resource indicator in at least one resource indicator of the aggregation object in any data aggregation indicator, and determine the data to be analyzed under any resource indicator of the aggregation object in any data aggregation indicator based on the target aggregated data under any resource indicator in at least one resource indicator of the aggregation object in any data aggregation indicator, and the at least one resource indicator may include the resource indicator in each target resource indicator in at least one target resource indicator corresponding to any data aggregation indicator, that is, may include at least one resource indicator corresponding to the cost control indicator in any data aggregation indicator; in this case, for any collection time point among multiple collection time points, and any resource indicator in the at least one resource indicator, the indicator value at any collection time point in the target resource data whose resource indicator is any resource indicator may be summed to obtain the aggregation value at any collection time point in the target aggregated data under any resource indicator of the aggregation object in any data aggregation indicator. Optionally, the data to be analyzed under a data aggregation indicator may be one or more, and the embodiment of the present invention is not limited to this.

[0057] Optionally, the electronic device may use the target aggregated data under any resource indicator of the aggregated object in any data aggregation indicator as the data to be analyzed under any resource indicator of the aggregated object in any data aggregation indicator. In this case, the data to be analyzed under any data aggregation indicator may include the data to be analyzed under each resource indicator of the aggregated object in any data aggregation indicator; or, the target aggregated data under each resource indicator of at least one resource indicator of the aggregated object in any data aggregation indicator may be integrated according to the cost control indicator in any data aggregation indicator to obtain the data to be analyzed under any data aggregation indicator (in this case, the data to be analyzed may include the indicator value of any data aggregation indicator at each collection time point, that is, it may include the value of the cost control indicator of the aggregated object in any data aggregation indicator (i.e., the cost control indicator in any data aggregation indicator) at each collection time point), etc.; the embodiments of the present invention are not limited to this.

[0058] For example, assuming that any data aggregation indicator is the CPU cost of the cluster (i.e., the CPU application cost), and multiple target resource indicators include the CPU application amount of each Pod in the target cluster, then at least one target resource indicator corresponding to any data aggregation indicator may include the CPU application amount of each Pod in the multiple target resource indicators; in this case, the target resource data under the CPU application amount of each Pod can be summed to obtain the target aggregation data under the CPU application amount of the target cluster, and the target aggregation data under the CPU application amount of the target cluster can be used as the data to be analyzed under any data aggregation indicator, or the data to be analyzed under the CPU application cost of the target cluster can be calculated based on the CPU price within the current target monitoring time range and the target aggregation data under the CPU application amount of the target cluster as the data to be analyzed under any data aggregation indicator, and so on.

[0059] For another example, assuming that any data aggregation indicator is the application cost of a task, and multiple target resource indicators include the CPU application amount, memory application amount, and GPU application amount of each Pod, then at least one target resource indicator corresponding to any data aggregation indicator may include the CPU application amount of each Pod corresponding to the task, the memory application amount of each Pod corresponding to the task, and the GPU application amount of each Pod corresponding to the task. In this case, the target resource data under the CPU application amount of each Pod corresponding to the task can be summed up (that is, the indicator values ​​at the same collection time point in the target resource data under the CPU application amount of each Pod are summed up) to obtain the target aggregation data under the CPU application amount of the task, and the target resource data under the memory application amount of each Pod corresponding to the task can be summed up to obtain the target aggregation data under the memory application amount of the task, and the target resource data under the GPU application amount of each Pod corresponding to the task can be summed up to obtain the target aggregation data under the GPU application amount of the task. Optionally, the target aggregate data under the CPU application amount of the task, the target aggregate data under the memory application amount of the task, and the target aggregate data under the GPU application amount of the task can be used as the data to be analyzed under the CPU application amount, memory application amount, and GPU application amount of the task, respectively, to obtain the data to be analyzed under any data aggregation indicator. At this time, the data to be analyzed under any data aggregation indicator may include the data to be analyzed under the CPU application amount of the task, the data to be analyzed under the memory application amount of the task, and the data to be analyzed under the GPU application amount of the task; or, according to the cost control indicator "application cost" in any data aggregation indicator, the target aggregate data under the CPU application amount of the task, the memory application amount of the task, and the GPU application amount of the task can be analyzed. The target aggregate data under the target monitoring time range and the target aggregate data under the GPU application amount of the task are integrated, that is, based on the CPU price, memory price and GPU price within the target monitoring time range, the target aggregate data under the CPU application amount of the task, the target aggregate data under the memory application amount of the task and the target aggregate data under the GPU application amount of the task, the data to be analyzed under any data aggregation indicator is calculated. At this time, the data to be analyzed under any data aggregation indicator may include the indicator value of any data aggregation indicator at each collection time point (that is, the indicator value of the cost control indicator in any data aggregation indicator of the aggregation object in any data aggregation indicator at each collection time point, which is the application cost of the task at each collection time point here), etc. Optionally, the resource price (such as CPU price, etc.) within the target monitoring time range may include the resource price at each collection time point within the target monitoring time range; optionally, the resource prices at different collection time points may be the same or different, and the embodiment of the present invention is not limited to this.

[0060] For another example, assuming that any data aggregation indicator is the CPU utilization of a project, multiple target resource indicators may include the CPU utilization of each node in the target cluster. At this time, at least one target resource indicator corresponding to any data aggregation indicator may include the CPU utilization of each node corresponding to the project, and so on. Based on this, the electronic device can sum the target resource data under the CPU utilization of each node corresponding to the project to obtain the target aggregation data under the CPU utilization of the project, and use the target aggregation data under the CPU utilization of the project as the data to be analyzed under the CPU utilization of the project, thereby obtaining the data to be analyzed under any data aggregation indicator. At this time, the data to be analyzed under any data aggregation indicator includes the data to be analyzed under the CPU utilization of the project.

[0061] S103, determining the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator.

[0062] In an embodiment of the present invention, for any data aggregation indicator among multiple data aggregation indicators, the electronic device can determine the target analysis model corresponding to any data aggregation indicator; optionally, one data aggregation indicator can correspond to one or more target analysis models, that is, the number of target analysis models corresponding to one data aggregation indicator can be one or more, and the embodiment of the present invention is not limited to this.

[0063] Based on this, the electronic device can call the target analysis model corresponding to any data aggregation indicator, and determine the data analysis prediction result under any data aggregation indicator based on the data to be analyzed under any data aggregation indicator; wherein, the model parameters in a target analysis model support being continuously optimized. Optionally, a data analysis prediction result can be a resource analysis prediction result, or a cost control prediction result (in this case, the data analysis prediction result under a data aggregation indicator can be directly used as the cost control prediction result under the corresponding data aggregation indicator), etc., and the embodiments of the present invention are not limited to this. Optionally, the number of data analysis prediction results under a data aggregation indicator can be the number of data to be analyzed under the corresponding data aggregation indicator, that is, the number of data analysis prediction results under a data aggregation indicator can be one or more, and the embodiments of the present invention are not limited to this. Optionally, one data to be analyzed can correspond to a target analysis model, that is, the target analysis model corresponding to a data aggregation indicator can include the target analysis models corresponding to each data to be analyzed under the corresponding data aggregation indicator, and so on.

[0064] Optionally, a target analysis model can be an AR model (auto regressive, an autoregressive model), or an MA model (moving average, a moving average model), or an ARMA model (an autoregressive moving average model), etc.; the embodiment of the present invention is not limited to this. Optionally, the target analysis model corresponding to a data aggregation indicator can be set according to experience or according to actual needs, and the embodiment of the present invention is not limited to this. Based on this, the embodiment of the present invention can select a machine learning algorithm suitable for time series data processing to improve the accuracy and reliability of resource prediction, so as to obtain data analysis and prediction results under any data aggregation indicator with higher accuracy.

[0065] Furthermore, the electronic device can continuously use multiple target resource data within different target monitoring time ranges to fit target analysis models corresponding to different data aggregation indicators to update the target analysis model corresponding to any data aggregation indicator, so that the model parameters in a target analysis model can be continuously optimized. Based on this, the embodiment of the present invention can continuously optimize the algorithm parameters and model structure, and can fit the corresponding target analysis model through multiple target resource data under different business scenarios, which can adapt to the needs of different business scenarios.

[0066] Optionally, the target monitoring time range may include a time range of one month, a time range of one quarter, or a time range of one year, which is not limited in the embodiments of the present invention. Optionally, a data analysis prediction result may include a resource demand trend in a future period of time, that is, a data analysis prediction result under a data aggregation indicator may include a data analysis prediction result of a corresponding data aggregation indicator within the target prediction time range. Optionally, the target prediction time range may be set according to experience or according to actual needs, which is not limited in the embodiments of the present invention.

[0067] Optionally, when calling the target analysis model corresponding to any data aggregation indicator and determining the data analysis prediction result under any data aggregation indicator based on the data to be analyzed under any data aggregation indicator, the electronic device may determine the prediction time indicator corresponding to any data aggregation indicator, and based on the prediction time indicator corresponding to any data aggregation indicator, divide the target monitoring time range into multiple first time ranges, and divide the target prediction time into at least one second time range; optionally, the prediction time indicator corresponding to a data aggregation indicator may be 1 hour (in which case a second time range may be 1 hour), or 1 day (in which case a second time range may be 1 day), or 1 month (in which case a second time range may be 1 month), etc., and the embodiment of the present invention does not limit this; optionally, the prediction time indicator corresponding to a data aggregation indicator may be set according to experience or actual needs, and the embodiment of the present invention does not limit this; optionally, the prediction time indicators corresponding to different data aggregation indicators may be the same or different, and the embodiment of the present invention does not limit this.

[0068] Furthermore, the electronic device may perform data integration on the data to be analyzed under any data aggregation indicator according to multiple first time ranges, and obtain the data integration value of any data aggregation indicator in each first time range in the multiple first time ranges; it should be understood that when the number of data to be analyzed under any data aggregation indicator is multiple, data integration may be performed on each data to be analyzed under any data aggregation indicator respectively to obtain the data integration value of each data to be analyzed under any data aggregation indicator in each first time range, such as the data to be analyzed under any data aggregation indicator includes the data to be analyzed under the CPU application amount of any task, the data to be analyzed under the memory application amount of any task, and the data to be analyzed under the GPU application amount of any task. When analyzing data, the data integration value of the CPU application amount of any task in each first time range (i.e., the data integration value of the data to be analyzed under the CPU application amount of any task in each first time range), the data integration value of the memory application amount of any task in each first time range, and the data integration value of the GPU application amount of any task in each first time range can be obtained. At this time, the data integration value of any data aggregation index in any first time range may include the data integration value of the CPU application amount of any task in any first time range, the data integration value of the memory application amount of any task in any first time range, and the data integration value of the GPU application amount of any task in any first time range, etc. Optionally, for any first time range within multiple first time ranges, the electronic device can determine the value of any data aggregation index at each collection time point within any first time range from the data to be analyzed under any data aggregation index, and perform weighted summation (such as mean operation or summation operation, etc.) on the value of any data aggregation index at each collection time point within any first time range to obtain the data integration value of any data aggregation index in any first time range.

[0069] Based on this, the electronic device can call the target analysis model corresponding to any data aggregation indicator, and determine the predicted value of any data aggregation indicator in each second time range in at least one second time range based on the data integration value of any data aggregation indicator in each first time range. In other words, the data integration value of any data aggregation indicator in each first time range can be used to fit the target analysis model corresponding to any data aggregation indicator to obtain the fitted target analysis model corresponding to any data aggregation indicator, so as to determine the predicted value of any data aggregation indicator in each second time range through the fitted target analysis model corresponding to any data aggregation indicator. It should be understood that when the number of data to be analyzed under any data aggregation indicator is multiple, the number of target analysis models corresponding to any data aggregation indicator can be multiple, and one data to be analyzed can correspond to one target analysis model; based on this, the electronic device can call the target analysis model corresponding to any data to be analyzed under any data aggregation indicator, and determine the predicted value of the data to be analyzed under any data aggregation indicator within each second time range based on the data integration value of any data to be analyzed under any data aggregation indicator within each first time range. For example, when the data to be analyzed under any data aggregation indicator includes the data to be analyzed under the CPU application amount of any task, the data to be analyzed under the memory application amount of any task, and the data to be analyzed under the GPU application amount of any task, the target analysis model of any task can be called respectively. The target analysis model corresponding to the CPU application amount (i.e., the target analysis model corresponding to the data to be analyzed under the CPU application amount of any task) determines the predicted value of the CPU application amount of any task in each second time range based on the data integration value of the CPU application amount of any task in each first time range, calls the target analysis model corresponding to the memory application amount of any task, determines the predicted value of the memory application amount of any task in each second time range based on the data integration value of the memory application amount of any task in each first time range, and calls the target analysis model corresponding to the GPU application amount of any task, determines the predicted value of the GPU application amount of any task in each second time range based on the data integration value of the GPU application amount of any task in each first time range, and so on.

[0070] In summary, it can be seen that the embodiments of the present invention can use machine learning algorithms to perform in-depth analysis of monitoring data, predict resource demand trends in the future, and identify potential resource bottlenecks and overload risks. For example, when the data analysis prediction result under any data aggregation indicator (including the predicted value of any data aggregation indicator in each second time range) exceeds the specified threshold corresponding to any data aggregation indicator in a certain second time range, it can be determined that there is a resource bottleneck and overload risk, etc.; optionally, the specified threshold corresponding to a data aggregation indicator can be set according to experience or according to actual needs, and the embodiments of the present invention are not limited to this; optionally, a data analysis prediction result under a data aggregation indicator can correspond to a specified threshold.

[0071] Optionally, the electronic device may also determine N data aggregation indicators from multiple data aggregation indicators, where N is a positive integer; and based on the data analysis prediction results under each data aggregation indicator among the N data aggregation indicators, generate a resource demand prediction report under each data aggregation indicator; optionally, the electronic device may also output the resource demand prediction report under each data aggregation indicator, such as displaying the resource demand prediction report under any data aggregation indicator, and may also send the resource demand prediction report under any data aggregation indicator to the target client, which may be any client, and so on; the embodiments of the present invention are not limited to this.

[0072] Exemplarily, the N data aggregation indicators may include but are not limited to at least one of the following: the CPU application amount of at least one aggregation object, the memory application amount of at least one aggregation object, and the GPU application amount of at least one aggregation object, etc.; the embodiment of the present invention is not limited to this. Optionally, a resource demand forecast report may include but is not limited to the data analysis forecast results under the corresponding data aggregation indicator (i.e., the predicted value of the corresponding data aggregation indicator in each corresponding second time range (also referred to as the resource demand amount here)), peak time, fluctuation range, etc., and the embodiment of the present invention is not limited to this. The optional fluctuation range may include but is not limited to the difference between the predicted values ​​of any two adjacent second time ranges greater than the preset difference threshold and the difference between the predicted values ​​of any two adjacent second time ranges greater than the preset difference threshold, etc., and the embodiment of the present invention is not limited to this; optionally, the preset difference threshold may be set according to experience or according to actual needs, and the embodiment of the present invention is not limited to this.

[0073] S104, based on the data analysis prediction results under each data aggregation indicator, determine the cost control prediction results under each data aggregation indicator; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

[0074] In an embodiment of the present invention, for any data aggregation indicator among multiple data aggregation indicators, the electronic device can determine the cost control prediction result under any data aggregation indicator based on the data analysis prediction result under any data aggregation indicator.

[0075] In one embodiment, when the data analysis prediction result under any data aggregation indicator is a resource analysis prediction result (such as resource utilization, resource application amount, etc.), and the cost control indicator in any data aggregation indicator is a price cost (such as application cost, etc.), the electronic device can determine the resource price (such as CPU price, etc.) corresponding to any data aggregation indicator, and determine the cost control prediction result under any data aggregation indicator based on the data analysis prediction result under any data aggregation indicator. Exemplarily, assuming that the data analysis prediction result under any data aggregation indicator is the predicted value of the CPU application amount of any task in each second time range, then the electronic device can determine the CPU price within the target prediction time range, and use the CPU price to determine the CPU application cost of any task in each second time range (the CPU application cost within a second time range can be the product of the CPU application amount and the CPU price within the corresponding second time range); or, assuming that any data aggregation indicator is the resource application cost of any task, the data analysis prediction result under any data aggregation indicator includes the predicted value of the CPU application amount of any task in each second time range, the predicted value of the CPU application amount of any task in each second time range, and the predicted value of the CPU application amount of any task in each second time range. If the predicted value of the memory application amount of any task in each second time range and the predicted value of the GPU application amount of any task in each second time range are obtained, the electronic device can determine the CPU price, memory price and GPU price in the target prediction time range to determine the CPU application cost, memory application cost and GPU application cost of any task in each second time range, thereby summing the CPU application cost, memory application cost and GPU application cost of any task in each second time range to obtain the resource application cost (which can be simply referred to as application cost) of any task in each second time range, thereby obtaining the cost control prediction result under any data aggregation indicator, and so on.

[0076] In another implementation, the data analysis prediction result under any data aggregation indicator is a cost control prediction result (for example, the data to be analyzed under any data aggregation indicator is the data to be analyzed under a cost control indicator of an aggregation object, and the corresponding cost control prediction result can be directly obtained through the corresponding target analysis model). In this case, the electronic device can use the data analysis prediction result under any data aggregation indicator as the cost control prediction result under any data aggregation indicator, and so on.

[0077] Optionally, the electronic device may monitor and display the cost control prediction results under each data aggregation indicator; or, the electronic device may send the cost control prediction results under each data aggregation indicator to the target client through the monitoring data acquisition module, so that the target client monitors and displays the cost control prediction results under each data aggregation indicator; or, in other embodiments, the electronic device may not include the monitoring data acquisition module, in which case the cost control prediction results under each data aggregation indicator may be sent to the monitoring data acquisition module, so that the monitoring data acquisition module sends the cost control prediction results under each data aggregation indicator to the target client for monitoring and display, such as Figure 4 As shown, etc.; the present invention is not limited to this. Among them, Figure 4 In the example, etcd is a distributed key-value storage system, and api-server is an interface service, that is, kube-state-metrics can obtain data from etcd through api-server; correspondingly, dcgm-exporter can be a component for monitoring GPU, and cgroup is a mechanism for limiting, recording, and isolating the physical resources used by process groups; kubelet is an important component in the Kubernetes cluster, which runs on each node and is responsible for managing containers and Pods on the node.

[0078] Optionally, the electronic device may also output peak indication information and trough indication information in the cost control prediction results under each data aggregation index; this is not limited in the embodiment of the present invention. Optionally, a peak indication information may include but is not limited to a peak interval (i.e., the interval where the peak value is located) and a peak value, etc., and a trough indication information may include but is not limited to a trough interval (i.e., the interval where the trough value is located) and a trough value, etc., which is not limited in the embodiment of the present invention.

[0079] Optionally, the electronic device may also output an alarm prompt when an alarm demand is detected to notify the target object (such as a monitoring person) of an abnormality. Optionally, a data aggregation indicator may correspond to at least one alarm prompt, and the alarm prompt corresponding to a data aggregation indicator may be set according to experience or according to actual needs. The embodiment of the present invention does not limit this. For example, the alarm prompt may be the following suggestion information, etc.

[0080] After acquiring multiple target resource data and determining multiple data aggregation indicators, the embodiments of the present invention can respectively perform data aggregation on the multiple target resource data according to each data aggregation indicator in the multiple data aggregation indicators to obtain the data to be analyzed under each data aggregation indicator; and can respectively determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator. Further, the cost control prediction results under each data aggregation indicator can be determined based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction results under one data aggregation indicator are used to guide the cost control of the target cluster. It can be seen that the embodiments of the present invention can perform data aggregation on multiple target resource data through multiple data aggregation indicators to achieve cost control of different data aggregation indicators, and can effectively achieve accurate billing of resources indicated by multiple data aggregation indicators, which can effectively improve the accuracy of cost control of the target cluster, thereby achieving effective cost control and optimization.

[0081] Based on the above description, the embodiment of the present invention also proposes a more specific cost control method. Accordingly, the cost control method can be executed by the electronic device (terminal or server) mentioned above; or, the cost control method can be executed by the terminal and the server together. For the sake of convenience, the following description will take the electronic device executing the cost control method as an example; please refer to Figure 5 The cost control method may include the following steps S501-S507:

[0082] S501, acquiring multiple target resource data and determining multiple data aggregation indicators.

[0083] S502 , performing data aggregation on multiple target resource data according to each of the multiple data aggregation indicators to obtain data to be analyzed under each data aggregation indicator.

[0084] S503, determining the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator.

[0085] S504, based on the data analysis prediction results under each data aggregation indicator, determine the cost control prediction results under each data aggregation indicator; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

[0086] Among them, multiple data aggregation indicators may include at least one cluster aggregation indicator corresponding to the target cluster, and the aggregation object in a cluster aggregation indicator may be the target cluster; that is, at least one cluster aggregation indicator may include at least one cost control indicator of the target cluster, and at least one cost control indicator may include but is not limited to at least one of the following: at least one CPU cost control indicator, at least one memory cost control indicator, at least one GPU cost control indicator and at least one target cost control indicator, etc.; the embodiments of the present invention are not limited to this.

[0087] S505 , determining a health indicator value of the target cluster under each cluster cost health indicator in multiple cluster cost health indicators based on the data analysis prediction result and / or the cost control prediction result under each cluster aggregation indicator in at least one cluster aggregation indicator corresponding to the target cluster.

[0088] Optionally, multiple cluster cost health indicators may include but are not limited to at least two of the following: at least one GPU utilization indicator of the cluster, at least one model indicator, at least one hardware indicator, and at least one behavior indicator, etc., which are not limited in the embodiments of the present invention. Optionally, the electronic device may determine the health indicator value under each cluster cost health indicator based on the data analysis prediction results and / or cost control prediction results under each cluster aggregation indicator, and the initial value (i.e., initial score) of each cluster cost health indicator. Optionally, the initial value of each cluster cost health indicator may be set according to experience or actual needs, which is not limited in the embodiments of the present invention; optionally, the sum of the initial values ​​of each cluster cost health indicator may be a preset total score value; optionally, the preset total score value may be set according to experience or actual needs, which is not limited in the embodiments of the present invention; illustratively, the preset total score value may be 100 points, and so on. Furthermore, the electronic device can also determine the deduction strategy for each cluster cost health indicator, and determine the health indicator value under each cluster cost health indicator based on the data analysis prediction results and / or cost control prediction results under each cluster aggregation indicator, as well as the initial value and deduction strategy of each cluster cost health indicator; optionally, the deduction strategy for a cluster cost health indicator can be set according to experience or actual needs, which is not limited to the embodiments of the present invention.

[0089] Optionally, at least one GPU utilization indicator may include but is not limited to at least one of the following: GPU application rate (such as GPU application amount / total number of cluster GPUs) and GPU application utilization (such as GPU utilization / GPU application amount, an application utilization rate may also be called utilization rate), etc., and the embodiments of the present invention are not limited to this. For example, the initial value of the GPU application rate may be 25 points. When the GPU application rate is greater than or equal to 80%, the GPU application rate may be full marks (here it is 25 points, that is, the health index value under the GPU application rate at this time may be 25 points), and 1.5 points may be deducted for every 5% decrease in the GPU application rate from 80%, and if it is less than 5%, it may be calculated as 5% to obtain the health index value under the GPU application rate; optionally, when the cluster average GPU application rate is continuously lower than a first preset threshold (such as 80%) for a first preset time period, the electronic device may output a first suggestion information, which may be used to suggest clearing idle GPU resources, adding a new training model, or scheduling more tasks to the first node (meaning that the GPU application rate is significantly lower than the cluster average GPU application rate); optionally, the first preset time period, the first preset threshold, and the first suggestion information may be set according to experience or actual needs, and the embodiments of the present invention are not limited to this. For another example, the initial value of the GPU application utilization rate may be 25 points. When the GPU application utilization rate is greater than or equal to a second preset threshold value (such as 80%), the GPU application utilization rate may be full marks (here it is 25 points, that is, the health index value under the GPU application utilization rate at this time may be 25 points). For every 5% decrease in the GPU application utilization rate from 80%, 1.5 points may be deducted. If it is less than 5%, it may be calculated as 5% to obtain the health index value under the GPU application utilization rate. Optionally, when the proportion of projects whose GPU application utilization rate is lower than the second preset threshold value reaches the project quantity proportion threshold, the electronic device may output a second suggestion information, and the second suggestion information may be used to indicate that the data loading speed may be increased by preprocessing the data, and / or to prompt a reduction in the GPU application amount for such projects, and to improve the GPU application utilization rate of the project through model optimization.

[0090] Optionally, at least one model indicator (i.e., a scoring indicator for model training of a project) may include, but is not limited to, at least one of the following: effective training time ratio, throughput, HFU (a model indicator), and MFU (another model indicator), etc., which are not limited in the embodiments of the present invention. For example, the initial values ​​of effective training time ratio, throughput, HFU, and MFU may be 5.5 points, 5.5 points, 5.5 points, and 5.5 points, respectively.

[0091] Optionally, at least one hardware indicator may include but is not limited to at least one of the following: video memory utilization / GPU utilization, video memory / GPU load balance, CPU utilization / GPU utilization, etc., which is not limited to the embodiments of the present invention; optionally, at least one behavior indicator may include but is not limited to at least one of the following: node GPU utilization (if more than 30% of the node GPU utilization is less than 80%, corresponding points will be deducted), tidal layout rationality (if higher than 90% is at peak, lower than 40% is at low peak, and there are peak and low peak periods of more than 6 hours in a day, corresponding points will be deducted), user behavior rationality (if 30% of users' GPU application utilization is less than 80%, corresponding points will be deducted), etc.; the embodiments of the present invention are not limited to this.

[0092] Based on this, the electronic device can output the suggestion information corresponding to each cluster cost health indicator (such as the first suggestion information or the second suggestion information, etc.) according to the health reminder strategy corresponding to each cluster cost health indicator, when each cluster cost health indicator meets the corresponding health reminder strategy; optionally, the electronic device can also output the deduction value (i.e., the deduction score) under each cluster cost health indicator, and so on. Optionally, the health reminder strategy corresponding to a cluster cost health indicator can be set according to experience or actual needs, and the embodiment of the present invention is not limited to this; optionally, the suggestion information corresponding to a cluster cost health indicator can be set according to experience or actual needs, or can be generated according to the corresponding health reminder strategy, and the embodiment of the present invention is not limited to this.

[0093] S506 , performing weighted summation on the health indicator values ​​of the target cluster under each cluster cost health indicator to obtain the cluster cost health of the target cluster.

[0094] Optionally, when the sum of the initial values ​​of each cluster cost health indicator is equal to the preset total score value, the health indicator values ​​of the target cluster under each cluster cost health indicator can be summed to obtain the cluster cost health of the target cluster; optionally, when the initial values ​​of each cluster cost health indicator are all the preset total score value, the health indicator values ​​of the target cluster under each cluster cost health indicator can be averaged to obtain the cluster cost health of the target cluster, and so on; the embodiment of the present invention does not limit the specific implementation process of the weighted summation.

[0095] S507: Determine cluster cost health indication information of the target cluster based on the cluster cost health.

[0096] Optionally, the cluster cost health indication information may include the cluster cost health and / or the cluster cost health level corresponding to the health sub-range where the cluster cost health is located, and one health sub-range corresponds to one cluster cost health level. Optionally, a cluster cost health may be located in any health sub-range of multiple health sub-ranges; optionally, multiple health sub-ranges and the cluster cost health levels corresponding to each health sub-range may be set according to experience or according to actual needs, and the embodiments of the present invention are not limited to this.

[0097] Based on this, the electronic device can use the cluster cost health as the cluster cost health indication information of the target cluster, or use the cluster cost health level corresponding to the health sub-range of the cluster cost health as the cluster cost health indication information of the target cluster, or use both the cluster cost health and the cluster cost health level corresponding to the health sub-range of the cluster cost health as the cluster cost health indication information of the target cluster, and so on.

[0098] Optionally, multiple data aggregation indicators may include resource utilization indicators of each Pod in the target cluster (such as CPU utilization or memory utilization, etc.); based on this, the electronic device can also determine the target resource utilization of each Pod resource prediction time range in at least one Pod resource prediction time range based on the data analysis prediction results under the resource utilization indicators of each Pod. A Pod resource prediction time range can be a second time range within the target preset time determined according to the prediction time indicator corresponding to the resource utilization indicator of each Pod; optionally, the values ​​of the resource utilization indicators of each Pod within each Pod resource prediction time range can be weighted summed (such as mean operation or sum operation, etc.) to obtain the target resource utilization of each Pod resource prediction time range.

[0099] Based on this, the electronic device can determine whether there is a target Pod resource prediction time range with expansion and contraction requirements based on the target resource utilization within each Pod resource prediction time range; optionally, for any Pod resource prediction time range in at least one Pod resource prediction time range, when the target resource utilization within any Pod resource prediction time range is greater than the first preset Pod resource utilization threshold, it can be determined that there is a capacity expansion requirement for any Pod resource prediction time range, and any Pod resource prediction time range can be used as a target Pod resource prediction time range with expansion requirements; when the target resource utilization within any Pod resource prediction time range is less than the second preset Pod resource utilization threshold, it can be determined that there is a capacity reduction requirement for any Pod resource prediction time range, and any Pod resource prediction time range can be used as a target Pod resource prediction time range with capacity reduction requirements, so as to determine whether there is a target Pod resource prediction time range with expansion and contraction requirements, etc. Optionally, both the first preset Pod resource utilization threshold and the second preset Pod resource utilization threshold can be set according to experience or according to actual needs, and the embodiment of the present invention does not limit this; wherein the first preset Pod resource utilization threshold is greater than the second preset Pod resource utilization threshold.

[0100] Correspondingly, if there is a target Pod resource prediction time range, the expansion and contraction indication information corresponding to the target Pod resource prediction time range is determined based on the target resource utilization within the target Pod resource prediction time range; and when the current system time reaches the start time of the target Pod resource prediction time range, the Pod expansion and contraction processing is performed according to the expansion and contraction indication information. Optionally, the number of target Pod resource prediction time ranges can be one or more, and the embodiment of the present invention is not limited to this. Optionally, when the target Pod resource prediction time range is greater than the first preset Pod resource utilization threshold, the expansion and contraction indication information corresponding to the target Pod resource prediction time range can be expansion indication information; when the target Pod resource prediction time range is less than the second preset Pod resource utilization threshold, the expansion and contraction indication information corresponding to the target Pod resource prediction time range can be contraction indication information, and so on; Optionally, both the expansion indication information and the contraction indication information can be set according to experience or according to actual needs, and the embodiment of the present invention is not limited to this. Correspondingly, when the expansion and contraction indication information is expansion indication information, the electronic device can expand the Pod when the current system time reaches the start time of the target Pod resource prediction time range; when the expansion and contraction indication information is contraction indication information, the Pod can be contracted when the current system time reaches the start time of the target Pod resource prediction time range. It can be seen that the embodiment of the present invention can perform expansion and contraction processing on the Pod in advance, which can effectively avoid expanding and contracting the Pod only when the actual Pod resource utilization is detected to be greater than the first preset Pod resource utilization threshold, or less than the second Pod resource utilization threshold, which can effectively avoid resource bottlenecks and effectively avoid resource waste.

[0101] Based on this, the embodiments of the present invention can automatically adjust the resource scheduling strategy of the target cluster based on the results of data analysis and prediction, and realize dynamic allocation and optimization of resources.

[0102] Optionally, the electronic device may also determine the idle cost calculation function of the target cluster; and call the target optimization algorithm to search for the optimal solution for the resource allocation data of each Pod in the target cluster based on the idle cost calculation function, and obtain the guiding resource allocation data of each Pod. Optionally, the idle cost of the target cluster may be the total application cost of the target cluster (i.e., resource application cost) minus the total utilization cost of the target cluster (i.e., resource utilization cost), that is, the idle cost calculation function of the target cluster may be the total application cost calculation function of the target cluster minus the total utilization cost calculation function, such as Figure 6As shown; wherein, the application cost can also be referred to as the allocation cost, and the utilization cost can also be referred to as the allocated cost. Optionally, the total application cost calculation function can be the target cluster's CPU application amount (such as the sum of the CPU application amounts of each Pod) × CPU price + target cluster's memory application amount × memory price + target cluster's GPU application amount × GPU price, and the utilization total cost calculation function can be the target cluster's CPU utilization amount × CPU price + target cluster's utilization application amount × memory price + target cluster's GPU utilization amount × GPU price; wherein, the target cluster's CPU application amount (which may include the CPU application amount of each Pod in the target cluster), memory application amount (which may include the memory application amount of each Pod in the target cluster), GPU application amount (which may include the GPU application amount of each Pod in the target cluster), CPU utilization (which may include the CPU utilization of each Pod in the target cluster), memory utilization (which may include the memory utilization of each Pod in the target cluster), and GPU utilization (which may include the GPU utilization of each Pod in the target cluster) can be the parameters to be optimized in the idle cost calculation function. Based on this, the embodiment of the present invention can construct a cost model based on factors such as resource usage and market prices to calculate and predict the operating cost of the cluster. Optionally, the costs may also include but are not limited to software licensing fees, operation and maintenance costs, etc.

[0103] Optionally, the above-mentioned target optimization algorithm can be a heuristic search algorithm, a genetic algorithm, a simulated annealing algorithm, etc., and the embodiment of the present invention does not limit this; based on this, the embodiment of the present invention can seek the optimal solution for resource allocation through the target optimization algorithm, that is, the embodiment of the present invention can design an efficient heuristic search and global optimization algorithm to achieve dynamic allocation and optimization of resources. It can be seen that the embodiment of the present invention can achieve cost optimization, that is, it can combine the output of the intelligent scheduling and optimization module to propose a cost saving plan, such as adjusting resource specifications and optimizing resource configuration based on the guiding resource allocation data of each Pod.

[0104] Optionally, the electronic device may also determine multiple constraints and call the target optimization algorithm to search for the optimal solution for the resource allocation data of each Pod in the target cluster based on the idle cost calculation function and multiple constraints, and obtain the guiding resource allocation data for each Pod. The optional multiple constraints may be set based on experience or actual needs, which is not limited in the embodiments of the present invention; illustratively, the multiple constraints may include various resource restrictions, such as CPU application amount, memory application amount, and so on.

[0105] In summary, it can be seen that the embodiments of the present invention can comprehensively consider various cost factors and build a comprehensive cost model, so as to continuously optimize and adjust the cost model by using historical data and prediction results.

[0106] According to the embodiment of the present invention, after acquiring multiple target resource data and determining multiple data aggregation indicators, the multiple target resource data can be aggregated according to each data aggregation indicator in the multiple data aggregation indicators to obtain the data to be analyzed under each data aggregation indicator. Then, the data analysis prediction results under each data aggregation indicator can be determined based on the data to be analyzed under each data aggregation indicator; and the cost control prediction results under each data aggregation indicator can be determined based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction results under one data aggregation indicator are used to guide the cost control of the target cluster. Wherein, the multiple data aggregation indicators include at least one cluster aggregation indicator corresponding to the target cluster; based on this, the health indicator value of the target cluster under each cluster cost health indicator in the multiple cluster cost health indicators can be determined based on the data analysis prediction results and / or cost control prediction results under each cluster aggregation indicator in the at least one cluster aggregation indicator corresponding to the target cluster. And the health indicator values ​​of the target cluster under each cluster cost health indicator are weighted and summed to obtain the cluster cost health of the target cluster, so as to determine the cluster cost health indication information of the target cluster based on the cluster cost health. It can be seen that the embodiments of the present invention can achieve effective cost control and optimization by accurately billing the CPU, memory GPU and other resources consumed by different aggregation objects (such as tasks, etc.) running in the K8S cluster. It has the functions of refined resource metering, dynamic billing mechanism (that is, the embodiments of the present invention can be based on the results of refined resource metering, and can calculate and adjust the billing amount in real time according to the actual resource consumption of tasks, etc., to ensure the accuracy and fairness of billing), cost control strategies (such as resource quota restrictions, automatic scaling mechanisms, etc., these strategies can dynamically adjust resource allocation according to the resource usage and business needs of the cluster, avoid resource waste, and reduce operating costs) and deep support for large models, which can effectively avoid resource waste and cost increases. In addition, the embodiment of the present invention also takes into account the compatibility with the existing K8S cluster and can be easily integrated into the existing K8S environment. At the same time, the solution also supports expansion and can add new billing rules or cost control strategies according to actual needs (i.e., setting data aggregation indicators on demand, etc.), so that it is suitable for various business scenarios; and the embodiment of the present invention takes into account the training and reasoning of the K8S-based GPU cluster and the existing large models, and can deeply explore the usage details and cost consumption of the GPU in the training of large models to achieve better GPU utilization efficiency.

[0107] Based on the description of the relevant embodiments of the above cost control method, the embodiment of the present invention further proposes a cost control device, which can be a computer program (including program code) running in an electronic device; Figure 7 As shown, the cost control device may include an acquisition unit 701 and a processing unit 702. The cost control device may execute Figure 1 or Figure 5 The cost control method shown, that is, the cost control device can run the above units:

[0108] An acquisition unit 701 is used to acquire multiple target resource data;

[0109] A processing unit 702, configured to determine a plurality of data aggregation indicators;

[0110] The processing unit 702 is further configured to perform data aggregation on the plurality of target resource data according to each of the plurality of data aggregation indicators, respectively, to obtain data to be analyzed under each of the plurality of data aggregation indicators;

[0111] The processing unit 702 is further configured to determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator;

[0112] The processing unit 702 is further used to determine the cost control prediction results under each data aggregation indicator based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

[0113] In one implementation, the multiple data aggregation indicators include at least one cluster aggregation indicator corresponding to the target cluster, and the processing unit 702 may further be used to:

[0114] Determine a health indicator value of the target cluster under each cluster cost health indicator in multiple cluster cost health indicators based on a data analysis prediction result and / or a cost control prediction result under each cluster aggregation indicator in at least one cluster aggregation indicator corresponding to the target cluster;

[0115] Performing weighted summation on the health index values ​​of the target cluster under each cluster cost health index to obtain the cluster cost health of the target cluster;

[0116] Based on the cluster cost health, cluster cost health indication information of the target cluster is determined.

[0117] In another embodiment, the multiple target resource data include target resource data under each target resource indicator among multiple target resource indicators, and the multiple target resource indicators include at least two of the following: at least one CPU resource indicator of at least one monitored object, at least one memory resource indicator of the at least one monitored object, and at least one GPU resource indicator of the at least one monitored object.

[0118] In another implementation manner, when the processing unit 702 performs data aggregation on the plurality of target resource data according to each of the plurality of data aggregation indicators to obtain the data to be analyzed under each of the plurality of data aggregation indicators, it may be specifically used to:

[0119] For any data aggregation indicator among the multiple data aggregation indicators, determine at least one target resource indicator corresponding to the any data aggregation indicator;

[0120] According to at least one target resource indicator corresponding to any one of the data aggregation indicators, data aggregation is performed on the multiple target resource data to obtain the data to be analyzed under any one of the data aggregation indicators.

[0121] In another implementation manner, when the processing unit 702 determines the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator, it can be specifically used to:

[0122] For any data aggregation indicator among the multiple data aggregation indicators, determining a target analysis model corresponding to the any data aggregation indicator;

[0123] Calling the target analysis model corresponding to any of the data aggregation indicators, and determining the data analysis prediction result under any of the data aggregation indicators based on the data to be analyzed under any of the data aggregation indicators;

[0124] Among them, the model parameters in a target analysis model can be continuously optimized.

[0125] In another implementation, the multiple data aggregation indicators include resource usage indicators of each Pod in the target cluster, and the processing unit 702 may also be used to:

[0126] Determine the target resource utilization rate of each Pod resource prediction time range in at least one Pod resource prediction time range based on the data analysis prediction results under the resource utilization rate indicators of each Pod;

[0127] Based on the target resource utilization within the prediction time range of each Pod resource, determine whether there is a target Pod resource prediction time range where expansion or contraction needs to be made;

[0128] If the target Pod resource prediction time range exists, the scaling indication information corresponding to the target Pod resource prediction time range is determined based on the target resource utilization within the target Pod resource prediction time range; and when the current system time reaches the start time of the target Pod resource prediction time range, the Pod scaling processing is performed according to the scaling indication information.

[0129] In another implementation, the processing unit 702 may also be configured to:

[0130] Determining an idle cost calculation function of the target cluster;

[0131] The target optimization algorithm is called to search for an optimal solution for the resource allocation data of each Pod in the target cluster based on the idle cost calculation function to obtain the guiding resource allocation data of each Pod.

[0132] According to one embodiment of the present invention, Figure 7 Each unit in the cost control device shown can be separately or completely combined into one or several other units to form, or one (some) of the units can be further divided into multiple smaller units in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present invention, any cost control device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0133] According to another embodiment of the present invention, the program can be executed by running a program on a general electronic device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 1 or Figure 5 A computer program (including program code) for each step involved in the corresponding method shown in Figure 7 The cost control device shown in the embodiment of the present invention is used to implement the cost control method of the embodiment of the present invention. The computer program can be recorded on a computer storage medium, for example, and loaded into the above-mentioned electronic device through the computer storage medium and run therein.

[0134] Based on the description of the above method embodiment and device embodiment, the exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to enable the electronic device to perform the method according to the embodiment of the present invention when executed by the at least one processor.

[0135] Exemplary embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0136] An exemplary embodiment of the present invention further provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor of a computer, the computer is used to enable the computer to perform a method according to an embodiment of the present invention.

[0137] refer to Figure 8 , a block diagram of an electronic device 800 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0138] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0139] A plurality of components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. The input unit 806 may be any type of device capable of inputting information to the electronic device 800, and the input unit 806 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 807 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 808 may include, but is not limited to, a disk, an optical disk. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0140] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above. For example, in some embodiments, the cost control method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. In some embodiments, the computing unit 801 may be configured to perform the cost control method in any other appropriate manner (e.g., by means of firmware).

[0141] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0142] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0143] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0144] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0145] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0146] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0147] Furthermore, it should be understood that what is disclosed above is only a preferred embodiment of the present invention, and certainly cannot be used to limit the scope of rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A cost control method, characterized in that: include: Acquire multiple target resource data and determine multiple data aggregation indicators; According to each of the multiple data aggregation indicators, the multiple target resource data are aggregated to obtain the data to be analyzed under each of the multiple data aggregation indicators; Determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator respectively; Based on the data analysis prediction results under the respective data aggregation indicators, the cost control prediction results under the respective data aggregation indicators are determined; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

2. The method according to claim 1, characterized in that The multiple data aggregation indicators include at least one cluster aggregation indicator corresponding to the target cluster, and the method further includes: Determine a health indicator value of the target cluster under each cluster cost health indicator in multiple cluster cost health indicators based on a data analysis prediction result and / or a cost control prediction result under each cluster aggregation indicator in at least one cluster aggregation indicator corresponding to the target cluster; Performing weighted summation on the health index values ​​of the target cluster under each cluster cost health index to obtain the cluster cost health of the target cluster; Based on the cluster cost health, cluster cost health indication information of the target cluster is determined.

3. The method according to claim 1 or 2, characterized in that: The multiple target resource data include target resource data under each target resource indicator among the multiple target resource indicators, and the multiple target resource indicators include at least two of the following: at least one CPU resource indicator of at least one monitored object, at least one memory resource indicator of the at least one monitored object, and at least one GPU resource indicator of the at least one monitored object.

4. The method according to claim 1 or 2, characterized in that: The step of respectively aggregating the plurality of target resource data according to each of the plurality of data aggregation indicators to obtain the data to be analyzed under each of the plurality of data aggregation indicators includes: For any data aggregation indicator among the multiple data aggregation indicators, determine at least one target resource indicator corresponding to the any data aggregation indicator; According to at least one target resource indicator corresponding to any one of the data aggregation indicators, data aggregation is performed on the multiple target resource data to obtain the data to be analyzed under any one of the data aggregation indicators.

5. The method according to claim 1 or 2, characterized in that: The determining the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator respectively includes: For any data aggregation indicator among the multiple data aggregation indicators, determining a target analysis model corresponding to the any data aggregation indicator; Calling the target analysis model corresponding to any of the data aggregation indicators, and determining the data analysis prediction result under any of the data aggregation indicators based on the data to be analyzed under any of the data aggregation indicators; Among them, the model parameters in a target analysis model can be continuously optimized.

6. The method according to claim 1 or 2, characterized in that: The multiple data aggregation indicators include resource usage indicators of each Pod in the target cluster, and the method further includes: Determine the target resource utilization rate of each Pod resource prediction time range in at least one Pod resource prediction time range based on the data analysis prediction results under the resource utilization rate indicators of each Pod; Based on the target resource utilization within the prediction time range of each Pod resource, determine whether there is a target Pod resource prediction time range where expansion or contraction needs to be made; If the target Pod resource prediction time range exists, the scaling indication information corresponding to the target Pod resource prediction time range is determined based on the target resource utilization within the target Pod resource prediction time range; and when the current system time reaches the start time of the target Pod resource prediction time range, the Pod scaling processing is performed according to the scaling indication information.

7. The method according to claim 1 or 2, characterized in that: The method further comprises: Determining an idle cost calculation function of the target cluster; The target optimization algorithm is called to search for an optimal solution for the resource allocation data of each Pod in the target cluster based on the idle cost calculation function to obtain the guiding resource allocation data of each Pod.

8. A cost control device, characterized in that: The device comprises: An acquisition unit, used for acquiring multiple target resource data; A processing unit, configured to determine a plurality of data aggregation indicators; The processing unit is further configured to perform data aggregation on the plurality of target resource data according to each of the plurality of data aggregation indicators, respectively, to obtain data to be analyzed under each of the plurality of data aggregation indicators; The processing unit is further configured to determine the data analysis prediction results under each data aggregation indicator based on the data to be analyzed under each data aggregation indicator; The processing unit is also used to determine the cost control prediction results under each data aggregation indicator based on the data analysis prediction results under each data aggregation indicator; wherein the cost control prediction result under one data aggregation indicator is used to guide the cost control of the target cluster.

9. An electronic device, characterized in that: include: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-7.