Container cluster multi-target scheduling method and system cooperating with energy prediction
By introducing power generation prediction values and reinforcement learning models into container clusters, the problem of ignoring energy supply characteristics in container cluster scheduling is solved, realizing power consumption during peak power generation and energy saving and load reduction during power shortages, thereby improving energy utilization and grid stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, the deployment and scheduling of container clusters ignore the characteristics of energy supply, resulting in the inability to quickly absorb electricity during peak power generation periods, and exacerbating the burden on the power grid and affecting computing stability when power supply is tight.
By introducing predicted power generation values, the scheduling strategy for container clusters is determined. Combined with a reinforcement learning model, the long-term expected reward value is calculated to achieve a reasonable allocation of container groups in the container cluster, coordinate energy supply, ensure that electricity is consumed during peak power generation, and proactively save energy and reduce load during power shortages.
It improves energy efficiency, ensures stable grid operation, avoids the impact of insufficient power supply on computing stability, and realizes efficient scheduling and power consumption of container clusters.
Smart Images

Figure CN121636178A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a multi-objective scheduling method and system for container clusters in conjunction with energy forecasting. Background Technology
[0002] Container technology is a lightweight virtualization technology that packages applications and their dependencies into a portable container for running in different environments. A container cluster refers to a pool of computing resources consisting of multiple servers (physical machines or virtual machines) that are managed and scheduled in a unified manner for containerized applications. Within a container cluster, container orchestration platforms can be used to deploy and schedule container groups.
[0003] In related technologies, the deployment and scheduling of container groups typically focus only on the computing resources themselves, ignoring the energy supply characteristics upon which container clusters depend for operation. Since data centers are high-energy-consuming units, they require a large amount of electricity during operation. If they cannot coordinate with the power supply, they will not be able to quickly absorb power during peak generation periods, and will further burden the power grid during periods of power shortage, potentially affecting computing stability due to insufficient power supply. Summary of the Invention
[0004] In view of the above problems, this application provides a multi-objective scheduling method and system for container clusters that improves computational stability and coordinates with energy forecasting.
[0005] According to the first aspect of this application, a multi-objective scheduling method for container clusters in coordination with energy forecasting is provided, comprising: obtaining a power generation forecast value; determining a container cluster scheduling strategy based on the relationship between the baseline power consumption of the container cluster and the power generation forecast value; obtaining a group of containers to be scheduled; calculating the long-term expected reward value corresponding to allocating the group of containers to be scheduled to each candidate node in the container cluster, binding the group of containers to be scheduled to the candidate node with the highest long-term expected reward value, and completing the scheduling; wherein, the container cluster scheduling strategy indicates the correlation between the long-term expected reward value and the power consumption generated by the group of containers to be scheduled in the container cluster.
[0006] According to an embodiment of this application, when the predicted power generation value is greater than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the first strategy, and the long-term expected reward value of the candidate node is positively correlated with the power consumption generated by the container group to be scheduled.
[0007] According to an embodiment of this application, the method further includes: when the container cluster scheduling strategy is a first strategy, creating a group of containers to be scheduled based on the batch processing tasks pre-stored in the task queue, so as to consume power when the power generation capacity is sufficient; wherein, the batch processing tasks pre-stored in the task queue are batch processing tasks that can be processed with delay.
[0008] According to an embodiment of this application, when the predicted power generation value is less than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the second strategy, where the long-term expected reward value of the candidate node is negatively correlated with the power consumption generated by the container group to be scheduled.
[0009] According to an embodiment of this application, calculating the long-term expected reward value corresponding to allocating the container group to be scheduled to each candidate node in the container cluster includes: constructing a state vector; the state vector includes the performance index of each candidate node and the performance requirement index of the container group to be scheduled; inputting the state vector into a pre-trained reinforcement learning model; for each candidate node, when the container group to be scheduled is bound to the candidate node, calculating the instantaneous reward value at each future time based on the reinforcement learning model, and accumulating the instantaneous reward values to obtain the long-term expected reward value corresponding to the candidate node; wherein, the instantaneous reward value is obtained by weighted summation of a first score, a second score, and a third score, the first score indicating the magnitude of the performance index of each candidate node, the second score indicating the balance of the performance index of each candidate node, and the third score indicating the contribution of the power consumption generated by the container group to be scheduled according to the performance requirement index under the container cluster scheduling strategy to the instantaneous reward value.
[0010] According to an embodiment of this application, the power generation prediction value is obtained based on the prediction model based on the input prediction data, and the scheduling priority of the container group corresponding to the prediction model is greater than the scheduling priority of other container groups.
[0011] According to a second aspect of this application, a container cluster multi-objective scheduling device in coordination with energy forecasting is provided, comprising: a data acquisition module for acquiring predicted power generation values; a strategy engine module for determining a container cluster scheduling strategy based on the relationship between the baseline power consumption of the container cluster and the predicted power generation values; a container group acquisition module for acquiring container groups to be scheduled; and a scheduling module for calculating the long-term expected reward value corresponding to each candidate node in the container cluster to allocate the container groups to be scheduled, binding the container groups to be scheduled with the candidate node with the highest long-term expected reward value, and completing the scheduling; wherein, the container cluster scheduling strategy indicates the correlation between the long-term expected reward value and the power consumption generated by the container groups to be scheduled in the container cluster.
[0012] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0013] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0014] According to a fifth aspect of this application, a computer program product is also provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0015] The above one or more embodiments have the following beneficial effects: By introducing the power generation prediction value into the container group scheduling process, the corresponding container group scheduling strategy is determined according to the relationship between the power generation prediction value and the baseline power consumption of the container group. Based on the correlation between the long-term expected reward value indicated by the container group scheduling strategy and the power consumption of the container group to be scheduled in the container group, the calculation of the long-term expected reward value is guided. This realizes the combination of container group scheduling and power supply. It can maximize the calculated power consumption during peak power generation to improve power consumption, improve energy utilization and ensure the stable operation of the power grid. It can also actively reduce load when power supply is tight, reduce the load on the power grid and avoid the impact of insufficient power supply on the calculation stability. Attached Figure Description
[0016] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0017] Figure 1 This illustration schematically depicts an application scenario of a container cluster multi-objective scheduling method and system in coordination with energy forecasting, according to embodiments of this application.
[0018] Figure 2 A flowchart illustrating a method according to an embodiment of this application is shown schematically;
[0019] Figure 3 The diagram illustrates a container cluster scheduling system architecture corresponding to the method according to an embodiment of this application.
[0020] Figure 4 This illustration schematically shows the overall workflow of a method according to an embodiment of this application;
[0021] Figure 5 The schematic diagram illustrates the workflow of the intelligent decision-making module according to an embodiment of this application;
[0022] Figure 6 This schematically illustrates a structural block diagram of a container cluster multi-objective scheduling apparatus in coordination with energy forecasting according to an embodiment of this application; and
[0023] Figure 7 A block diagram of an electronic device suitable for implementing a container cluster multi-objective scheduling method in conjunction with energy forecasting, according to an embodiment of this application, is illustrated. Detailed Implementation
[0024] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0028] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0029] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this application all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0030] First, some terms in the embodiments of this application will be explained.
[0031] Container: A software container is a virtualization technology used to encapsulate an application and all its dependencies and configurations so that it can run in different computer environments.
[0032] A container cluster is a group of compute nodes or worker machines that can run containerized applications. It includes multiple nodes and a management component (API Server). The API Server provides an application programming interface (API) for container management, which can manage the individual nodes in the container cluster.
[0033] Container orchestration platform: A platform used for the automated deployment, scaling and management of containerized applications. In this embodiment, the container orchestration platform used is Kubernetes, or K8s for short.
[0034] A Pod (also known as an instance or pod) is a group of related containers that is the smallest deployable unit of computing created and managed in a container orchestration platform.
[0035] A node is a compute node in a container cluster. It is the smallest unit of compute hardware and can be bound to a Pod to execute the Pod's compute tasks.
[0036] In the embodiments of this application, scheduling in a Kubernetes container cluster is used as an example for illustration, but it is not limited to the embodiments of this application being used in a Kubernetes container cluster. For example, the embodiments of this application can also be used in container clusters with other architectures. Furthermore, the embodiments of this application can also be used to manage applications deployed in clusters of other computing instances (including virtual machines, containers, or bare metal servers, etc.). For example, the applications in the embodiments of this application can be deployed in a cluster containing multiple virtual machines, etc.
[0037] In related technologies, the deployment and scheduling of container groups usually only focus on the computing resources themselves, such as the computing efficiency of the current Pod, but ignore the characteristics of the external energy supply that the container cluster depends on during operation. The data center where the container cluster is located is a high-energy-consuming unit that requires a lot of electricity during operation. If the characteristics of the external energy supply are ignored, it is impossible to coordinate with the power supply. On the one hand, it is impossible to quickly consume the power during peak power generation, and on the other hand, it will increase the burden on the power grid when the power supply is tight, and may affect the stability of computing due to insufficient power supply.
[0038] Based on this, in the embodiments of this application, considering the volatility and intermittency of renewable energy (such as photovoltaic power generation, hydropower, etc.), the power generation prediction results are introduced into the container cluster scheduling, realizing the coordination between the container scheduling process and energy supply. On the one hand, it can maximize the local consumption of energy during peak power generation periods, and on the other hand, it can proactively save energy and reduce load during energy shortages, thereby ensuring the stability of data calculation and the stability of grid operation.
[0039] Figure 1 The illustration shows an application scenario of a container cluster multi-objective scheduling method and system in coordination with energy forecasting, according to an embodiment of this application.
[0040] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0041] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers. Furthermore, the first terminal device 101, the second terminal device 102, and the third terminal device 103 can also be business processing terminals with image acquisition capabilities at the business site.
[0043] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. In the embodiments of this application, server 105 can be a node in a content delivery network, i.e., a CDN server. Multiple CDN servers with the same caching rules can form a CDN cluster. Multiple CDN servers communicate with the origin server to obtain content from the origin server for caching.
[0044] It should be noted that the methods provided in the embodiments of this application can generally be executed by the server 105. Accordingly, the apparatus provided in the embodiments of this application can generally be located in the server 105. The methods provided in the embodiments of this application can also be executed by a server or server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the apparatus provided in the embodiments of this application can also be located in a server or server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0045] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0046] The following will be based on Figure 1 The described scene, through Figures 2-5 A multi-objective scheduling method for container clusters in coordination with energy forecasting, according to embodiments of this application, is described in detail.
[0047] Figure 2 A flowchart illustrating a multi-objective scheduling method for container clusters in coordination with energy forecasting, according to an embodiment of this application, is shown schematically.
[0048] like Figure 2As shown, the method of this embodiment includes operations S210 to S240.
[0049] In operation S210, the predicted power generation value is obtained.
[0050] In operation S220, the container cluster scheduling strategy is determined based on the relationship between the baseline power consumption and the predicted power generation of the container cluster.
[0051] In operation S230, obtain the container group to be scheduled.
[0052] In operation S240, the long-term expected reward value corresponding to each candidate node in the container cluster is calculated to allocate the container group to be scheduled. The container group to be scheduled is then bound to the candidate node with the highest long-term expected reward value, thus completing the scheduling. The container cluster scheduling policy indicates the correlation between the long-term expected reward value and the power consumption generated by the container group to be scheduled in the container cluster.
[0053] In the embodiments of this application, for ease of description, photovoltaic power generation is used as an example to illustrate the method of the embodiments of this application. In some other embodiments, photovoltaic power generation can also be replaced by other forms of renewable energy such as hydropower and wind power generation. In this case, in operation S210, the method includes: obtaining a predicted value of photovoltaic power generation. The predicted value of photovoltaic power generation can be obtained directly from an external source, or it can be obtained by obtaining historical data of photovoltaic power generation and predicting it based on a prediction model.
[0054] In operation S220, the container cluster scheduling strategy is determined based on the relationship between the base power consumption of the container cluster and the predicted power generation value. When the base power consumption of the container cluster is greater than the predicted power generation value, it can be determined that the power supply is insufficient. The power supply can be reduced and critical business operations can be guaranteed to adapt to the energy shortage and minimize the dependence on fossil fuel power grid. When the base power consumption of the container cluster is less than the predicted power generation value, it can be determined that the power supply is sufficient. The power supply can be increased to absorb the excess power.
[0055] In the embodiments of this application, when the predicted power generation value is greater than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the first strategy, where the long-term expected reward value of the candidate node is positively correlated with the power consumption generated by the container group to be scheduled. This set multiple serves as a computational cost threshold, used to define the energy break-even point for the container cluster's computational behavior, and can be preset, for example, taking a value between (0,1). Taking photovoltaic power generation as an example, the first strategy can be defined as a "photovoltaic-driven mode," which aims to maximize the absorption of green energy and increase computing power supply to convert surplus photovoltaic power into computational output. The calculation of the long-term expected reward value of the candidate node is related to the power consumption generated by the container group to be scheduled. A parameter related to power consumption can be set in the long-term expected reward value, and different weighting coefficients can be assigned to the calculation of this parameter under different scheduling strategies to achieve the correlation between the scheduling strategy and power consumption. Under the first strategy, the long-term expected reward value of the candidate node is positively correlated with the power consumption generated by the container group to be scheduled; therefore, high power consumption corresponds to a high long-term expected reward value, encouraging the absorption of electricity.
[0056] In the embodiments of this application, when the predicted power generation is less than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the second strategy, in which the long-term expected reward value of the candidate node is negatively correlated with the power consumption generated by the container group to be scheduled. The second strategy can be defined as a "photovoltaic adaptation mode". Under the second strategy, the predicted photovoltaic power generation is insufficient. At this time, it is necessary to reduce computing power to adapt to energy shortages, and the dependence on fossil fuel grids can be minimized by ensuring critical business operations.
[0057] In embodiments of this application, a task queue for storing batch processing tasks that can be delayed can also be designed, serving as a "green task queue." Under the first strategy, pre-stored batch processing tasks can be retrieved from this queue, and corresponding Pods can be created and scheduled to consume power when there is sufficient generating capacity. Under the second strategy, tasks can be paused from the task queue, and the operation of Pods corresponding to retrieved tasks can be further paused to reduce the power consumption of non-critical tasks.
[0058] When operating S230, the container group to be scheduled can be a Pod that is currently running, or a new Pod created after the API Server receives a Pod creation request triggered by a new task.
[0059] In some implementations, after operation S230, the method further includes filtering out nodes with insufficient resources. This can be done by comparing parameters such as CPU utilization, memory utilization, disk I / O utilization, and network speed of each node in the cluster with the CPU core count, memory size, disk I / O resource quantity, and network bandwidth parameters requested by the Pod, thereby excluding nodes that do not meet the requirements.
[0060] In operation S240, after excluding nodes with insufficient resources, the remaining nodes are selected as candidate nodes, and the node with the highest long-term expected reward value is chosen for binding. The long-term expected reward value of a candidate node represents the benefit that can be obtained by binding the Pod to be scheduled to a candidate node.
[0061] The selection of the node with the highest long-term expected reward can be achieved based on a pre-trained reinforcement learning model. In the embodiments of this application, the reinforcement learning model employs a deep Q-network, which can learn the optimal scheduling policy and select the best candidate node by maximizing the long-term expected reward. In other embodiments, other reinforcement learning models, such as dual deep Q-networks, can also be used for candidate node selection.
[0062] In the embodiments of this application, calculating the long-term expected reward value corresponding to each candidate node in the container cluster to which the container group to be scheduled is allocated includes: constructing a state vector; the state vector includes the performance index of each candidate node and the performance requirement index of the container group to be scheduled; inputting the state vector into a pre-trained reinforcement learning model, and for each candidate node, when the container group to be scheduled is bound to the candidate node, calculating the instant reward value at each future time based on the reinforcement learning model, and accumulating the instant reward values to obtain the long-term expected reward value corresponding to the candidate node; wherein, the instant reward value is obtained by weighted summation of a first score, a second score and a third score, the first score indicating the magnitude of the performance index of each candidate node, the second score indicating the balance of the performance index of each candidate node, and the third score indicating the contribution of the power consumption generated by the container group to be scheduled according to the performance requirement index under the container cluster scheduling strategy to the instant reward value.
[0063] In related technologies, container orchestration platforms typically make scheduling decisions based solely on the current resource status of nodes, aiming for resource balancing on a single node without considering the actual utilization rate of nodes. This can easily lead to cluster-level resource fragmentation and reduced resource utilization. Furthermore, they can only perceive limited resources such as CPU and memory, failing to achieve effective load balancing of critical resources like network and disk, potentially causing resource contention and performance bottlenecks. In the embodiments of this application, by collecting the multi-dimensional resource status of each candidate node in the cluster, constructing a state vector, and using a deep Q-network to analyze and evaluate the future scheduling situation of the cluster, long-term value assessment can be performed from the perspective of the global cluster status. This avoids resource fragmentation and local hotspots caused by short-sighted scheduling decisions, thereby significantly improving the overall resource utilization and stability of the cluster. Simultaneously, by designing a composite multi-objective reward function, it can automatically learn and collaboratively optimize multiple objectives such as resource utilization, load balancing, and service quality, achieving better scheduling quality and meeting complex business needs.
[0064] In the embodiments of this application, the performance metrics of a node include the node's CPU utilization, memory utilization, disk I / O utilization, and network speed, and the performance requirements of the container group to be scheduled include the requested number of CPU cores, memory size, disk I / O resource quantity, and network bandwidth of the container group to be scheduled.
[0065] Specifically, in the embodiments of this application, the state vector It is a multi-dimensional vector that integrates the internal resource status of the cluster and the external energy situation, and can be represented as:
[0066]
[0067] in, , , , These represent the CPU utilization, memory utilization, disk I / O utilization, and network speed of the i-th node, respectively, i=1,2,3,...,N, which can be obtained by monitoring each node, and the value range is normalized to [0,1]. , , , These represent the number of CPU cores, memory size, disk I / O resources, and network bandwidth requested by the Pod to be scheduled, respectively. These values are derived from the requests field in the Pod specification definition. , These represent the normalized power generation forecasts for future times t+1 and t+2, respectively. Here, we take photovoltaic (PV) power generation as an example, representing the PV power generation forecast. This design enables the deep Q-network to sense and proactively respond to changing trends in energy supply.
[0068] In the embodiments of this application, the instant reward value Represented as:
[0069]
[0070] in, , , The dynamic weighting coefficient can be determined based on the container cluster scheduling strategy. Since the long-term expected reward value is obtained by accumulating the immediate reward value, different dynamic weighting coefficients can be determined according to different container cluster scheduling strategies, which can change the correlation between the long-term expected reward value and the power consumption generated by the scheduled container group in the container cluster under different strategies. This is a performance bonus, which is the sum of the average performance metrics (CPU utilization, memory utilization, disk I / O utilization, and network speed) of each node in the container cluster after the scheduling action is completed, aiming to improve the overall resource utilization efficiency. This is a balancing penalty term used to measure the degree of imbalance in resource utilization among nodes. It is obtained by summing the standard deviations of various performance indicators among the nodes. The green reward item is one of the core improvements of the method provided in this application embodiment. This design enables the deep Q network to autonomously understand and realize the adaptive strategy switching between "photovoltaic driven mode" and "photovoltaic adaptive mode" without relying on the upper layer mode switching instructions.
[0071] It can be represented as:
[0072]
[0073] in, It is a dimensionless, standardized resource point number used to quantify the relative power consumption level corresponding to the resource request of a Pod to be scheduled; This represents the normalized predicted photovoltaic power generation at time t+1 in the future; This represents the baseline power required for the container cluster to maintain basic operation. An adjustable computation cost threshold is used to define the energy break-even point for computational activities, with a preferred value range of (0,1).
[0074] The calculation of standardized resource points is based on the resource request volume defined in the Pod specification and is implemented through a predefined linear weighted model. The calculation formula is as follows:
[0075]
[0076] in, The number of CPU cores requested for the Pod. The amount of memory requested by the Pod. The amount of disk I / O resources requested by the Pod. For the network bandwidth requested by the Pod, , , , These are the standardized weighting coefficients corresponding to each resource type, which can be obtained by performing power consumption profiling and regression analysis on the cluster.
[0077] In some implementations, the weighting coefficients can be obtained by running a series of benchmark loads covering different resource combinations on cluster nodes, measuring their corresponding actual power consumption, and then using methods such as multiple linear regression to fit a set of weighting coefficients that best reflects the power consumption characteristics of the cluster.
[0078] In the embodiments of this application, green reward items Its innovation lies in the fact that this formula essentially defines the "green value" of a unit of computing power, and the reward value of this reward item is jointly determined by "resource consumption" and "green value coefficient". When photovoltaic power is abundant (autonomously entering photovoltaic-driven mode), at this time... Much larger ,lead to It is a significantly positive number, therefore, The value and Positive correlation: any successful scheduling of Pods and consumption of computing resources will earn a high green reward. To maximize accumulated rewards, the Deep Q network will proactively and actively schedule tasks to improve cluster computing power output, thereby achieving photovoltaic-driven computing. When photovoltaic power is insufficient (it autonomously enters photovoltaic adaptation mode), at this time... Very small, leading to Since it is a negative number, therefore, The value and Negative correlation means that any behavior that consumes computing resources will result in a green penalty (negative reward). Deep Q networks will generally suppress scheduling behavior to avoid penalties, only scheduling high-priority Pods when the performance reward is realized. The model will only execute scheduling when the power is large enough to offset the green penalty. This drives the model to accurately identify and ensure critical business operations under the premise of global computing power reduction, thereby achieving the strategic goal of the "photovoltaic adaptation mode". It should be noted that "high priority" here refers to the priority of Pods. Different Pods correspond to different task priorities. Important tasks or tasks that need to ensure the basic operation of the system have higher priorities, while tasks that can be delayed have lower priorities. When photovoltaic power is insufficient and computing power needs to be reduced, priority is given to ensuring the operation of high-priority tasks, and the remaining tasks are judged in descending order of priority to determine whether they can be scheduled.
[0079] In the embodiments of this application, the long-term expected reward value R can be calculated based on the instantaneous reward value at the current moment. And the instant reward value predicted for the next moment. We obtain the weighted sum, for example, it can be represented as ,in This serves as a discount factor to balance immediate rewards and long-term returns. In calculating the immediate reward value for the next time step, the performance index can be the current time step's performance index, or the predicted performance index for the next time step can be derived from the current time step's performance index and the task prediction. The normalized photovoltaic power generation prediction value can be based on the photovoltaic power generation prediction value for the next time step (t+2) predicted by the prediction model. Normalization yields the result.
[0080] In the embodiments of this application, the predicted power generation value is obtained by regression prediction of a prediction model trained based on historical time series data (including meteorological data and photovoltaic power generation data), and the scheduling priority of the container group corresponding to the prediction model is greater than the scheduling priority of other container groups.
[0081] In the embodiments of this application, to achieve high overall system reliability and prediction accuracy, a self-guaranteed scheduling mechanism for the prediction model itself is further provided. The prediction model, as a high-priority AI workload requiring guaranteed service quality, is deployed in a container cluster, corresponding to a Pod instance. Its priority is set to the highest, meaning that the prediction model's Pod instance is identified and guaranteed first. Specifically, when resource contention occurs, the scheduler prioritizes allocating nodes with sufficient resources and stable operation to the prediction model Pod. Under the "photovoltaic adaptation mode," when the system tightens its computing power, the prediction model, as the highest-priority core business, has its resource requirements prioritized and is unaffected by the computing power contraction strategy.
[0082] Through the above mechanism, the continuous and stable operation of the forecasting task is ensured, thereby providing accurate and reliable energy status input for the scheduling decision of the entire system, forming a reinforced closed-loop system from "accurate forecasting" to "efficient scheduling" and then to "guaranteed forecasting".
[0083] In the embodiments of this application, the deep Q network uses the ε-greedy strategy (also known as the epsilon-greedy strategy or the greedy strategy) to conduct random exploration with a certain probability or select the node with the highest long-term expected reward value as the scheduling target with the highest probability.
[0084] In the embodiments of this application, the deep Q network is pre-trained using historical running data and optimized based on real-time data during real-time operation. Its training process may include two stages: offline pre-training and online learning.
[0085] Offline pre-training phase: Before the system is officially deployed, an initial experience replay pool is built using historical cluster load data collected from the production environment, simulated Pod request sequences, and corresponding historical meteorological and photovoltaic power generation data. The deep Q network is then trained offline on a large scale to obtain an initial model with basic scheduling and energy coordination capabilities.
[0086] Online learning phase: After system deployment and operation, the system continuously collects real-time generated scheduling experience tuples (including state, action, reward, and next state) and stores them in an experience replay pool. The online training process is then initiated asynchronously or periodically to fine-tune the parameters of the online network. This mechanism enables the intelligent decision-making module to adapt to long-term changes in cluster workload and photovoltaic power generation patterns, achieving continuous self-optimization of the scheduling strategy. The parameters of the target network are synchronized from the online network at fixed intervals or using a moving average update method to ensure the stability of the training process.
[0087] The training of a deep Q-network aims to optimize its network parameters θ by minimizing the temporal difference error. The loss function L(θ) used during training is defined as:
[0088]
[0089] Where E((s,a,r,s')~D) represents the expectation of experience replay. These are experience tuples randomly sampled from the experience pool D, representing state s, action a, reward r, and the next time step state, respectively. ; This is a discount factor used to weigh immediate rewards against long-term returns; Predicting the Q-value output of the online network; Let Q be the maximum Q value among all possible actions in the next state s'.
[0090] By minimizing the loss function L(θ) using stochastic gradient descent, the parameters θ of the online network are updated, and the parameters of the online network are periodically synchronized to the target network to ensure the stability of training.
[0091] In some implementations, based on the method provided above, a container cluster scheduling system is further provided, including an external input layer, a core system layer, and a container cluster layer. The core system layer includes a computing power strategy engine module, a distributed monitoring module, an intelligent decision-making module, and a scheduling execution module. It should be noted that, for ease of description, photovoltaic forecast data is used here as a specific implementation of the power generation forecast value in the above method. In practical applications, the forecast data can also be wind power forecast data, hydropower forecast data, or other forms of renewable energy forecast data.
[0092] Figure 3 This diagram illustrates a container cluster scheduling system architecture corresponding to the method according to an embodiment of this application. See also... Figure 3The system comprises an external input layer, a container cluster layer, and a core system layer. The external input layer is used to acquire photovoltaic prediction data and input the acquired photovoltaic prediction data into the core system layer. The container cluster layer includes an API server and multiple nodes. The core system layer is used to implement the above methods.
[0093] In the embodiments of this application, the computing power strategy engine module is used to generate dynamic cluster-level computing power management strategies based on externally input photovoltaic power generation prediction data; the cluster-level computing power management strategies include "photovoltaic driven mode" and "photovoltaic adaptive mode" as well as the corresponding control parameters (i.e., dynamic weight coefficients in the instant reward value) under different modes.
[0094] The distributed monitoring module is used to collect multi-dimensional resource data from multiple nodes in the container cluster in real time. The distributed monitoring module uses a lightweight thread pool and sliding window queue mechanism to periodically collect actual usage data, including CPU utilization, memory utilization, disk I / O utilization and network speed, from all nodes in the container cluster, and aggregates them to generate a global resource status view.
[0095] The intelligent decision-making module, as the core of the system, integrates the instructions from the computing power strategy engine with the global resource status view to output the optimal scheduling decision. This module incorporates a deep Q-network and is configured to: receive the global resource status view generated by the monitoring module, normalize it, and construct a state vector; and based on this state vector, calculate the long-term expected reward value for allocating the Pod to be scheduled to each candidate node using the deep Q-network, selecting the node with the highest long-term expected reward value as the optimal node and outputting it. The weights of the multi-objective reward function of the deep Q-network can be dynamically adjusted according to the instructions from the computing power strategy engine. Specifically, the "photovoltaic driven" or "photovoltaic adaptive" mode instructions issued by the computing power strategy engine are mapped to a set of preset weight configurations (e.g., increasing green weights in driven mode and increasing performance weights in adaptive mode), thereby achieving dynamic weight switching. The deep Q-network, based on the ε-greedy strategy, either randomly explores with a certain probability or selects the node with the highest long-term expected reward value as the scheduling target with the highest probability.
[0096] The scheduling execution module is used to execute the scheduling decisions output by the intelligent decision module. The scheduling execution module interacts with the Kubernetes API Server through an asynchronous communication mechanism, binds the Pod to the optimal node determined by the intelligent decision module, and has a retry queue to ensure the continuity of the scheduling process in the event of scheduling failure.
[0097] Figure 4 This schematically illustrates the overall workflow of a method according to an embodiment of this application, such as... Figure 4As shown, once a Pod creation request is received by the API Server, the scheduling process officially begins. The created Pod to be scheduled is sent to the scheduling execution module. This module first performs a filtering phase to exclude nodes with insufficient resources. Subsequently, it enters the scoring phase, calling the intelligent decision-making module to execute the decision-making process.
[0098] The intelligent decision-making module initiates the decision-making process: it constructs a normalized state vector based on the global resource status obtained from the distributed monitoring module; then, the built-in deep Q network, guided by the current policy mode and corresponding parameters determined by the computing power policy engine, performs reasoning and action selection using an ε-greedy policy (e.g., 10% probability of random exploration, 90% probability of selecting the node with the largest Q value), and finally outputs the optimal node to the scheduling execution module.
[0099] The scheduling execution module marks the node as having a perfect score (Score=100) and triggers the node binding process. If the binding is successful, the scheduling ends; if it fails, the Pod is added to the retry queue for later re-initiation of scheduling. Throughout the system's operation, the intelligent decision-making module asynchronously performs experience replay, network training, and target network synchronization, thereby achieving continuous self-optimization of the scheduling strategy.
[0100] Figure 5 This illustration schematically shows a workflow diagram of the intelligent decision-making module according to an embodiment of this application, such as... Figure 5 As shown, the core of the intelligent decision-making module lies in constructing a state vector that can comprehensively represent the internal and external environment of the cluster, and based on this, driving the deep Q-network to make decisions and learn through a multi-objective reward function.
[0101] Constructed state vector It is a multi-dimensional vector that integrates the internal resource status of the cluster and the external energy situation, and can be represented as:
[0102]
[0103] in, , , , These represent the CPU utilization, memory utilization, disk I / O utilization, and network speed of the i-th node, respectively, i=1,2,3,...,N, which can be obtained by monitoring each node, and the value range is normalized to [0,1]. , , , These represent the CPU, memory, disk I / O resources, and network bandwidth requested by the Pod to be scheduled, respectively. These values are derived from the requests field in the Pod specification definition. , : These represent the normalized power generation forecasts for future times t+1 and t+2, respectively. Here, we take photovoltaic power generation as an example, representing the photovoltaic power generation forecast. This design enables the deep Q-network to sense and proactively respond to changes in energy supply trends.
[0104] The action space of a deep Q-network consists of the remaining candidate nodes after excluding nodes with insufficient resources. The goal is to select the candidate node with the highest long-term expected reward R. The long-term expected reward R can be calculated based on the instantaneous reward value at the current moment. And the instant reward value predicted for the next moment. The weighted summation yields the result, which can be expressed as: ,in It serves as a discount factor, used to balance immediate rewards with long-term benefits.
[0105] Instant reward value Represented as:
[0106]
[0107] in, , , The dynamic weighting coefficient can be determined based on the container cluster scheduling strategy. Since the long-term expected reward value is obtained by accumulating the immediate reward value, different dynamic weighting coefficients can be determined according to different container cluster scheduling strategies, which can change the correlation between the long-term expected reward value and the power consumption generated by the scheduled container group in the container cluster under different strategies. This is a performance bonus, which is the sum of the average performance metrics (CPU utilization, memory utilization, disk I / O utilization, and network speed) of each node in the container cluster after the scheduling action is completed, aiming to improve the overall resource utilization efficiency. This is a balancing penalty term used to measure the degree of imbalance in resource utilization among nodes. It is obtained by summing the standard deviations of various performance indicators among the nodes. The green reward item is one of the core improvements in this application's embodiments. This design enables the deep Q network to autonomously understand and implement adaptive strategy switching between "photovoltaic driven mode" and "photovoltaic adaptive mode" without relying on upper-layer mode switching instructions.
[0108] It can be represented as:
[0109]
[0110] in, It is a dimensionless, standardized resource point number used to quantify the relative power consumption level corresponding to the resource request of a Pod to be scheduled; This represents the normalized predicted photovoltaic power generation at time t+1 in the future; This represents the baseline power required for the container cluster to maintain basic operation. An adjustable computation cost threshold is used to define the energy break-even point for computational activities, with a preferred value range of (0,1).
[0111] The calculation of standardized resource points is based on the resource request volume defined in the Pod specification and is implemented through a predefined linear weighted model. The calculation formula is as follows:
[0112]
[0113] in, The number of CPU cores requested for the Pod. The amount of memory requested by the Pod. The amount of disk I / O resources requested by the Pod. For the network bandwidth requested by the Pod, , , , These are the standardized weighting coefficients corresponding to each resource type, which can be obtained by performing power consumption profiling and regression analysis on the cluster.
[0114] In calculating the instantaneous reward value at the next moment, the performance index can be the performance index at the current moment, or the performance index for the next moment can be predicted based on the performance index at the current moment and the task prediction. The normalized photovoltaic power generation prediction value can be based on the photovoltaic power generation prediction value for the next moment (t+2) predicted by the prediction model. Normalization yields the result.
[0115] After deployment and operation, the Deep Q-network continuously collects real-time scheduling experience tuples (including state, action, reward, and next state) and stores them in an experience replay pool. This allows for asynchronous or periodic online training to fine-tune the online network's parameters. This mechanism enables the intelligent decision-making module to adapt to long-term changes in cluster workload and photovoltaic power generation patterns, achieving continuous self-optimization of the scheduling strategy. The target network's parameters are synchronized from the online network using a fixed-period or moving average update to ensure the stability of the training process.
[0116] The method provided in this application embodiment can achieve the following beneficial effects:
[0117] (1) Global and long-term optimization: Through the deep reinforcement learning model, long-term value assessment can be carried out from the global state of the cluster, avoiding resource fragmentation and local hot spot problems caused by short-sighted scheduling decisions, thereby significantly improving the overall resource utilization and stability of the cluster.
[0118] (2) Intelligent multi-objective trade-off: By designing a composite multi-objective reward function, it can automatically learn and collaboratively optimize multiple objectives such as resource utilization, load balancing and service quality, thereby achieving better scheduling quality and meeting complex business needs.
[0119] (3) High adaptability: The system can automatically adapt to the dynamic changes in cluster load through continuous experience playback and learning, adjust the scheduling strategy, reduce the dependence on manual parameter tuning and preset rules, and reduce the operation and maintenance burden.
[0120] (4) Enhanced robustness: The distributed modular design, combined with asynchronous communication and retry mechanism, reduces the risk of single point of failure and ensures the high availability of the scheduling system itself.
[0121] (5) Outstanding green and economic benefits: Through the intelligent synergy of computing power and photovoltaic power generation, the local consumption rate of renewable energy has been significantly improved, the carbon consumption and electricity cost of data centers have been reduced, environmental and economic benefits have been guaranteed, and key technical support has been provided for building sustainable digital infrastructure.
[0122] Based on the methods provided above, this application also provides a container cluster multi-objective scheduling device that coordinates with energy forecasting. The following will combine... Figure 6 The device is described in detail.
[0123] Figure 6 The diagram illustrates a structural block diagram of a container cluster multi-objective scheduling apparatus in coordination with energy forecasting, according to an embodiment of this application.
[0124] like Figure 6 As shown, the apparatus 600 in this embodiment includes a data acquisition module 610, a strategy engine module 620, a container group acquisition module 630, and a scheduling module 640.
[0125] The data acquisition module 610 is used to acquire the predicted power generation value. In one embodiment, the data acquisition module 610 can be used to perform the operation S210 described above, which will not be repeated here.
[0126] The policy engine module 620 is used to determine the container cluster scheduling policy based on the relationship between the baseline power consumption and the predicted power generation of the container cluster. In one embodiment, the policy engine module 620 can be used to perform the operation S220 described above, which will not be repeated here.
[0127] The container group acquisition module 630 is used to acquire container groups to be scheduled. In one embodiment, the container group acquisition module 630 can be used to perform the operation S230 described above, which will not be repeated here.
[0128] The scheduling module 640 calculates the long-term expected reward value corresponding to each candidate node in the container cluster to which the container group to be scheduled is assigned, and binds the container group to be scheduled with the candidate node with the highest long-term expected reward value to complete the scheduling. The container cluster scheduling policy indicates the correlation between the long-term expected reward value and the power consumption generated by the container group to be scheduled in the container cluster. In one embodiment, the scheduling module 640 can be used to execute the operation S240 described above, which will not be repeated here.
[0129] According to an embodiment of this application, when the predicted power generation value is greater than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the first strategy, and the long-term expected reward value of the candidate node is positively correlated with the power consumption generated by the container group to be scheduled.
[0130] According to an embodiment of this application, the container group acquisition module 630 is further configured to create a container group to be scheduled based on the batch processing tasks pre-stored in the task queue when the container cluster scheduling strategy is the first strategy, so as to consume power when the power generation capacity is sufficient; wherein, the batch processing tasks pre-stored in the task queue are batch processing tasks that can be processed with delay.
[0131] According to an embodiment of this application, when the predicted power generation value is less than a set multiple of the baseline power consumption, the container cluster scheduling strategy is the second strategy, where the long-term expected reward value of the candidate node is negatively correlated with the power consumption generated by the container group to be scheduled.
[0132] According to an embodiment of this application, the scheduling module 640 is further configured to construct a state vector; the state vector includes the performance index of each candidate node and the performance requirement index of the container group to be scheduled; the state vector is input into a pre-trained reinforcement learning model, and for each candidate node, with the scheduling container group bound to the candidate node, the instant reward value at each future time is calculated based on the reinforcement learning model, and the instant reward values are accumulated to obtain the long-term expected reward value corresponding to the candidate node; wherein, the instant reward value is obtained by weighted summation of a first score, a second score and a third score, the first score indicating the magnitude of the performance index of each candidate node, the second score indicating the balance of the performance index of each candidate node, and the third score indicating the contribution of the power consumption generated by the container group to be scheduled according to the performance requirement index under the container cluster scheduling strategy to the instant reward value.
[0133] According to an embodiment of this application, the power generation prediction value is obtained based on the prediction model based on the input prediction data, and the scheduling priority of the container group corresponding to the prediction model is greater than the scheduling priority of other container groups.
[0134] According to embodiments of this application, any multiple modules among the data acquisition module 610, policy engine module 620, container group acquisition module 630, and scheduling module 640 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the data acquisition module 610, policy engine module 620, container group acquisition module 630, and scheduling module 640 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in hardware or firmware, or in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the data acquisition module 610, the strategy engine module 620, the container group acquisition module 630, and the scheduling module 640 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.
[0135] Figure 7 A block diagram of an electronic device suitable for implementing a container cluster multi-objective scheduling method in conjunction with energy forecasting, according to an embodiment of this application, is illustrated.
[0136] like Figure 7 As shown, an electronic device 700 according to an embodiment of this application includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.
[0137] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0138] According to embodiments of this application, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the input / output (I / O) interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the input / output (I / O) interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0139] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0140] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.
[0141] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0142] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0143] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0144] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0145] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0147] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A multi-objective scheduling method for container clusters in coordination with energy forecasting, characterized in that, The method comprises: obtaining a power generation prediction value; determining a container cluster scheduling strategy based on a size relationship between a benchmark power consumption of a container cluster and the power generation prediction value; obtaining a container group to be scheduled; calculating a long-term expected reward value corresponding to each candidate node in the container cluster to which the container group to be scheduled is allocated, and binding the container group to be scheduled to the candidate node with the highest long-term expected reward value, to complete scheduling; wherein the container cluster scheduling strategy indicates an association between the long-term expected reward value and power consumption generated by the container group to be scheduled in the container cluster.
2. The method of claim 1, wherein, In a case where the power generation prediction value is greater than a set multiple of the benchmark power consumption, the container cluster scheduling strategy is a first strategy, and the long-term expected reward value of the candidate node is positively correlated with the power consumption generated by the container group to be scheduled.
3. The method of claim 2, wherein, The method further comprises: in a case where the container cluster scheduling strategy is the first strategy, creating a container group to be scheduled according to a pre-stored batch processing task in a task queue, to accommodate power in a case where power generation is sufficient; wherein the pre-stored batch processing task in the task queue is a batch processing task that can be delayed.
4. The method of claim 1, wherein, In a case where the power generation prediction value is less than a set multiple of the benchmark power consumption, the container cluster scheduling strategy is a second strategy, and the long-term expected reward value of the candidate node is negatively correlated with the power consumption generated by the container group to be scheduled.
5. The method of claim 1, wherein, The calculation of the long-term expected reward value corresponding to each candidate node in the container cluster to which the container group to be scheduled is allocated comprises: constructing a state vector; the state vector comprises a performance indicator of each candidate node and a performance demand indicator of the container group to be scheduled; inputting the state vector into a pre-trained reinforcement learning model, and for each candidate node, based on the reinforcement learning model, calculating an immediate reward value at each future time in a case where the scheduled container group is bound to the candidate node, and accumulating the immediate reward values to obtain the long-term expected reward value corresponding to the candidate node; wherein the immediate reward value is obtained by weighted summation of a first score, a second score and a third score, the first score indicating the size of the performance indicator of each candidate node, the second score indicating the balance of the performance indicator of each candidate node, and the third score indicating the contribution degree of the power consumption generated by the container group to be scheduled according to the performance demand indicator to the immediate reward value under the container cluster scheduling strategy.
6. The method of claim 1, wherein, The power generation prediction value is obtained based on a prediction model predicting input prediction data, and a scheduling priority of a container group corresponding to the prediction model is greater than scheduling priorities of other container groups.
7. A container cluster multi-objective scheduling device cooperating with energy prediction, characterized in that, The method comprises: a data acquisition module configured to obtain a power generation prediction value; a strategy engine module configured to determine a container cluster scheduling strategy based on a size relationship between a benchmark power consumption of a container cluster and the power generation prediction value; a container group acquisition module configured to obtain a container group to be scheduled; The scheduling module is configured to calculate a long-term expected reward value of assigning the to-be-scheduled container group to each candidate node in the container cluster, bind the to-be-scheduled container group to the candidate node with the highest long-term expected reward value, and complete the scheduling. The container cluster scheduling strategy indicates an association between the long-term expected reward value and power consumption generated by the to-be-scheduled container group in the container cluster. 8.An electronic device comprising: one or more processors; memory storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1-6.
9. A computer readable storage medium having stored thereon a computer program or instructions, characterized in that, The computer program or instruction is executed by the processor to implement the steps of the method according to any one of claims 1-6.
10. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instruction is executed by the processor to implement the steps of the method according to any one of claims 1-6. The computer program or instruction is executed by the processor to implement the steps of the method according to any one of claims 1-6.