Method and apparatus for adjusting server energy consumption, computer device, and storage medium

By performing dual-layer scheduling at the software and hardware levels of the data center and optimizing energy consumption using predictive models, the problem of poor energy consumption adjustment effect in the data center is solved and more efficient energy utilization is achieved.

WO2025138564A1PCT designated stage expired Publication Date: 2025-07-03INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
PCT/CN2024/095544
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-28
Filing Date
2024-05-27
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

In the prior art, the energy consumption regulation effect of data centers is poor, resulting in low energy utilization and redundant energy use.

Method used

Using a two-layer scheduling method, the target action is selected at the software level through the first prediction model, and the operating frequency and voltage of the server are adjusted at the hardware level in combination with the second prediction model to optimize energy consumption.

Benefits of technology

It improves the energy utilization rate of data centers, reduces redundant energy use, and improves the efficiency and reliability of energy consumption regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024095544_03072025_PF_FP_ABST
    Figure CN2024095544_03072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data center control, and in particular to a method and apparatus for adjusting server energy consumption, a computer device, and a storage medium. The method for adjusting server energy consumption comprises: acquiring an environment state of a data center, and acquiring a hardware state parameter of a server in the data center; inputting the environment state into a first prediction model, using the first prediction model to select a target action from among a plurality of preset actions, and controlling the data center to perform the target action, wherein the plurality of preset actions comprise changing or maintaining the states of virtual machines in the server; and inputting the hardware state parameter into a second prediction model, using the second prediction model to predict the energy consumption of server hardware, and adjusting the working frequency and voltage of the server on the basis of the predicted energy consumption. By using the method, scheduling can be performed from two levels, i.e., a software level and a hardware level, so as to reduce the energy consumption, facilitating reduction of the use of redundant energy and thus improving the energy utilization rate.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, computer equipment and storage medium for regulating server energy consumption

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on December 28, 2023, with application number 202311831949.1, and entitled “Method, device, computer equipment and storage medium for regulating server energy consumption”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of data center control technology, and in particular to a method for regulating server energy consumption, a device for regulating server energy consumption, a computer device, and a computer-readable storage medium. Background Art

[0004] With the rapid development of technologies such as big data and cloud computing, the energy consumption generated in scenarios such as data centers is also increasing. While increasing the power supply burden, there is also a large amount of gas emissions such as carbon dioxide during power supply.

[0005] To this end, the received services are usually allocated to low-temperature servers in priority through polling and other methods. However, it is easy for low-temperature servers to be upgraded to high-temperature servers, causing the servers to be constantly switched between high-temperature and low-temperature server identities. At the same time, polling and other operating methods require a large amount of network transmission resources and transmission time, which collectively leads to poor energy consumption regulation effects.

[0006] Summary of the Invention

[0007] Based on this, it is necessary to provide a server energy consumption adjustment method, server energy consumption adjustment device, computer equipment and computer-readable storage medium that can perform scheduling at both the software and hardware levels to reduce energy consumption, which is conducive to reducing redundant energy use and improving energy utilization.

[0008] On the one hand, a method for adjusting server energy consumption is provided, which includes: obtaining the environmental status of a data center, obtaining hardware status parameters of servers in the data center; wherein the hardware status parameters include at least one of central processing unit utilization, memory utilization, and fan speed utilization; pre-training a first prediction model through a data set, inputting the environmental status into the first prediction model, using the first prediction model to select a target action from multiple preset actions, and controlling the data center to execute the target action; wherein the multiple preset actions include changing or maintaining the status of a virtual machine in the server; pre-training a second prediction model through a data set, inputting the hardware status parameters into the second prediction model, using the second prediction model to predict the energy consumption of the server hardware, and adjusting the operating frequency and voltage of the server based on the predicted energy consumption.

[0009] In one embodiment of the present application, a data center includes at least one server, and each server is allowed to mount a number of virtual machines; obtaining the environmental status of the data center includes: obtaining energy consumption data of the server within a preset period; obtaining the number of user requests received by the data center within the preset period as a first request number; obtaining the number of user requests received by the management device of the server within the preset period as a second request number; wherein the management device is used to distribute the received user requests to the virtual machines; and using the energy consumption data, the first request number, and the second request number as the environmental status.

[0010] In one embodiment of the present application, obtaining the energy consumption data of the server within a preset period includes: obtaining the resource utilization of the server, and the resource capacity of both the server and the virtual machine; wherein the resources include at least one of a central processing unit, memory, a network card, and a disk; and using the resource utilization and the resource capacity of the two as energy consumption data.

[0011] In one embodiment of the present application, selecting a target action from a plurality of preset actions using a first prediction model includes: receiving an environmental state and a current environmental reward using the first prediction model, and allowing the first prediction model to select one of the plurality of preset actions as a target action based on the environmental state and the current environmental reward; after controlling the data center to execute the target action, it also includes: in response to the data center executing the target action, evaluating the current environmental reward of the data center based on the energy consumption change trend of the data center.

[0012] In one embodiment of the present application, based on the energy consumption change trend of the data center, evaluating the environmental reward of the data center includes: measuring the current energy consumption of the data center; comparing the current energy consumption with the forward energy consumption before executing the target action; in response to the current energy consumption being no higher than the forward energy consumption, giving the first prediction model a positive incentive as the current environmental reward; in response to the current energy consumption being higher than the forward energy consumption, giving the first prediction model a negative incentive as the current environmental reward.

[0013] In one embodiment of the present application, the iteration method of the first prediction model includes: initializing the data center and the first prediction model; writing the current state of the data center into the state sequence, and performing the current round of iteration on the first prediction model; completing the current round of iteration in response to the first prediction model; judging whether the cumulative iteration rounds of the first prediction model have reached a preset round; in response to the cumulative iteration rounds not reaching the preset rounds, performing a new round of iteration using the current state of the data center; in response to the cumulative iteration rounds reaching the preset rounds, completing the iteration of the first prediction model; in response to the iteration rounds reaching the preset number of times, using the loss function and model gradient back propagation to form update parameters that can be used to update the model parameters of the first prediction model.

[0014] In one embodiment of the present application, performing the current round of iteration on the first prediction model includes: evaluating the probability of each preset action being selected in the current state based on the current state, and selecting the preset action with the highest probability as the iterative action; executing the iterative action in the current state of the data center to obtain an updated state and an environmental reward; associating the current state, the iterative action, the environmental reward, and the updated state, and storing them as samples in an experience collection; sampling at least one sample from the experience collection to calculate the current target value.

[0015] In one embodiment of the present application, the calculation formula for calculating the current target value is as follows: Among them, y j represents the target value of the jth sample; R j represents the environmental reward of the jth sample; γ represents the decay factor; S j ' represents the updated state of the jth sample; A j ' represents the iterative action of the jth sample; w' represents the network parameters of the first prediction model; Q' represents the value score; represents the maximum value score that can be achieved by executing each preset action; and / or, the loss function is calculated as follows: Among them, Loss represents the loss value; m represents the number of selected samples; Sj represents the current state of the j-th sample; Q(Sj, Aj, ω) represents the value score of the j-th sample.

[0016] In one embodiment of the present application, initializing the data center and the first prediction model includes: randomly initializing the current state of the data center; randomly initializing the value corresponding to each preset action; randomly initializing the model parameters of the first prediction model; and clearing the experience collection.

[0017] In one embodiment of the present application, the first prediction model includes a probability sub-model; using the first prediction model to select a target action from multiple preset actions includes: obtaining the probability of selecting each preset action as the target action; and selecting the preset action corresponding to the maximum value in the probability as the target action.

[0018] In one embodiment of the present application, a data center includes multiple physical servers, each of which mounts several virtual machines; wherein, the number of virtual machines mounted on each physical server is allowed to be different; multiple preset actions include adding virtual machines mounted on the server, deleting virtual machines, migrating virtual machines between servers, maintaining the current status, activating physical servers, and hibernating physical servers.

[0019] In one embodiment of the present application, the hardware status parameters include the utilization rates of the server's central processing unit, memory, and fan speed; the energy consumption of the server hardware is predicted using a second prediction model, and the server's operating frequency and voltage are adjusted based on the predicted energy consumption, including: evaluating the performance change trend of the server's throughput based on the utilization rate; predicting the server's predicted energy consumption within a preset period of time in the future; comparing the predicted energy consumption with the current energy consumption to obtain the energy consumption change trend; comparing the performance change trend with the energy consumption change trend, and in response to the performance change trend being performance degradation and the energy consumption change trend being energy consumption increase, reducing the server's operating frequency and voltage.

[0020] In one embodiment of the present application, the environment status is configured to identify the current software status of the data center.

[0021] In one embodiment of the present application, the first prediction model and the second prediction model are integrated into one.

[0022] In one embodiment of the present application, the first prediction model and the second prediction model are independent of each other.

[0023] In one embodiment of the present application, the plurality of preset actions may include adding a virtual machine mounted on a server, deleting a virtual machine, migrating a virtual machine between servers, maintaining a current state, activating a physical server, and hibernating a physical server.

[0024] In one embodiment of the present application, the first prediction model determines whether the target action is applicable through environmental rewards, and dynamically adjusts the selected strategy based on the environmental rewards to achieve optimization of the first prediction model.

[0025] On the other hand, a device for regulating server energy consumption is provided, which includes: a data acquisition module, a first prediction model, a second prediction model and a management module; the data acquisition module is used to obtain the environmental status of the data center and the hardware status parameters of the server in the data center; wherein the hardware status parameters include at least one of the central processing unit utilization, memory utilization, and fan speed utilization; the first prediction model is used to input the environmental status and select a target action from multiple preset actions; wherein the multiple preset actions include changing or maintaining the status of the virtual machine in the server; the second prediction model is used to input the hardware status parameters and predict the energy consumption of the server hardware; the management module is used to control the data center to execute the target action and adjust the operating frequency and voltage of the server based on the predicted energy consumption.

[0026] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are performed:

[0027] Obtain the environmental status of the data center and the hardware status parameters of the servers in the data center; wherein the hardware status parameters include at least one of central processing unit utilization, memory utilization, and fan speed utilization; input the environmental status into a first prediction model, use the first prediction model to select a target action from a plurality of preset actions, and control the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining the status of a virtual machine in the server; input the hardware status parameters into a second prediction model, use the second prediction model to predict the energy consumption of the server hardware, and adjust the operating frequency and voltage of the server based on the predicted energy consumption.

[0028] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the following steps:

[0029] Obtain the environmental status of the data center and the hardware status parameters of the servers in the data center; wherein the hardware status parameters include at least one of central processing unit utilization, memory utilization, and fan speed utilization; input the environmental status into a first prediction model, use the first prediction model to select a target action from a plurality of preset actions, and control the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining the status of a virtual machine in the server; input the hardware status parameters into a second prediction model, use the second prediction model to predict the energy consumption of the server hardware, and adjust the operating frequency and voltage of the server based on the predicted energy consumption.

[0030] The above-mentioned server energy consumption adjustment method, server energy consumption adjustment device, computer equipment and computer-readable storage medium obtain the environmental status of the data center, select the target action through the environmental status, and schedule the data center at the software level according to the current overall environment of the data center, so as to promote the reduction of the energy consumption of the data center from the software level. At the same time, the hardware status parameters of the server in the data center are obtained, and the operating frequency and voltage of the server are adjusted according to the hardware status parameters of the server, so as to adjust the operating frequency and voltage according to the operating status of the server, thereby effectively adjusting the energy consumption. In this way, the present application can integrate the software layer and the hardware layer of the data center, adjust the energy consumption at both levels, and effectively improve the efficiency and reliability of energy consumption adjustment. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] FIG1 is a schematic structural diagram of an embodiment of a device for regulating server energy consumption according to the present application;

[0032] FIG2 is a schematic diagram of an embodiment of an application scenario of a method for regulating server energy consumption according to the present application;

[0033] FIG3 is a flow chart of an embodiment of a method for adjusting server energy consumption according to the present application;

[0034] FIG4 is a flow chart of another embodiment of the method for adjusting server energy consumption of the present application;

[0035] FIG5 is a schematic structural diagram of an embodiment of a second prediction model of the present application;

[0036] FIG6 is a schematic structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0038] In order to solve the technical problem of poor energy consumption regulation effect in related technologies, the present application provides a server energy consumption regulation method, a server energy consumption regulation device, a computer device and a computer-readable storage medium.

[0039] Please refer to FIG1 , which is a schematic structural diagram of an embodiment of a device for regulating server energy consumption according to the present application.

[0040] In this embodiment, the server energy consumption regulating device can regulate the overall energy consumption of the data center, improve energy utilization as much as possible, and reduce energy waste, thereby achieving the purpose of relatively reducing the energy consumption of the data center.

[0041] The specific structure of the server energy consumption regulating device is described below with examples.

[0042] The server energy consumption regulating device includes a data acquisition module 11 , a first prediction model 12 , a second prediction model 13 and a management module 14 .

[0043] The data acquisition module 11 can obtain the environmental status of the data center. The data acquisition module 11 can also obtain the hardware status parameters of the servers in the data center. The hardware status parameters include at least one of the CPU utilization, memory utilization, and fan speed utilization.

[0044] The first prediction model 12 is used to input an environmental state and select a target action from a plurality of preset actions. The plurality of preset actions include changing or maintaining the state of a virtual machine on a server. In this embodiment, the first prediction model 12 is capable of predicting / evaluating the energy consumption that each preset action may generate. Specifically, this may be to predict the specific energy consumption value that a preset action will generate, or to predict the value of selecting each preset action, without limitation.

[0045] The second prediction model 13 is used to input hardware status parameters and predict the energy consumption of the server hardware. The second prediction model 13 can receive and identify the hardware status parameters and predict the server's future energy consumption based on the server's current hardware status parameters. This allows the model to select an operating frequency and voltage that will improve energy utilization based on the predicted energy consumption.

[0046] The first prediction model 12 and the second prediction model 13 may be integrated into one, or they may be independent of each other, which is not limited here.

[0047] The management module 14 is used to control the data center to execute target actions and adjust the operating frequency and voltage of the server based on the predicted energy consumption.

[0048] As such, the server energy consumption adjustment device in this embodiment can integrate the software layer information and hardware layer information of the data center, and adjust the energy consumption from both software and hardware aspects, thereby effectively improving the efficiency and reliability of energy consumption adjustment.

[0049] Please refer to FIG2 , which is a schematic diagram of an embodiment of an application scenario of the method for regulating server energy consumption of the present application.

[0050] The data center 20 may include at least one server.

[0051] Each server can host several virtual machines. Of course, a server can also have no virtual machines currently mounted, which is not a limitation here. In other words, each server is allowed to host several virtual machines.

[0052] The data center 20 may include infrastructure for providing computing, storage, network, virtual machine and other resources.

[0053] The data acquisition module 11 can obtain environmental status and / or hardware status parameters at a set frequency, such as user requests, resource usage such as CPU (Central Processing Unit), memory, disk I / O (Input / Output), and energy consumption information of the data center 20.

[0054] The service management module 14 may be responsible for splitting the user-submitted request into independent virtual machine resources according to the specified configuration requirements and placing the resources into the virtual machine queue.

[0055] The scheduling decision module formed by the first prediction model 12 and the second prediction model 13 can monitor the server resource utilization, virtual machine configuration distribution, and the number of resource requests in the task queue based on the collected information, and make decisions from the software and hardware levels with the goal of minimizing energy consumption.

[0056] The specific definition of the server energy consumption adjustment device can be found in the definition of the server energy consumption adjustment method below and will not be repeated here. The various modules in the above-mentioned server energy consumption adjustment device can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor of the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.

[0057] The following is a detailed explanation of the working principle of the server energy consumption regulation device to reduce energy consumption.

[0058] Please refer to FIG3 , which is a flow chart of an embodiment of a method for adjusting server energy consumption of the present application.

[0059] S301: Acquire the environmental status of the data center and obtain the hardware status parameters of the servers in the data center; wherein the hardware status parameters include at least one of central processing unit utilization, memory utilization, and fan speed utilization.

[0060] In this embodiment, a data center is a scenario where energy consumption regulation is required. The data center has several servers.

[0061] The environment status identifies the current software status of the data center.

[0062] The hardware status parameters can identify the current working efficiency of the server. By analyzing the hardware status parameters, the energy utilization rate of the server can be obtained.

[0063] The hardware status parameter may include at least one of a CPU utilization rate, a memory utilization rate, and a fan speed utilization rate. For example, the hardware status parameter may include the CPU utilization rate; or the hardware status parameter may include the memory utilization rate; or the hardware status parameter may include the fan speed utilization rate; or the hardware status parameter may include the CPU utilization rate, the memory utilization rate, and the fan speed utilization rate. Detailed descriptions are omitted here.

[0064] S302: Inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining the state of a virtual machine in a server.

[0065] In this embodiment, a first prediction model can be pre-trained using a dataset. The environmental state is input into the pre-trained first prediction model. In response to the received environmental state, the first prediction model evaluates the suitability of each preset action based on the software-level data for the current scenario and selects one of the preset actions as the target action. The first prediction model can output the target action; alternatively, it can output the probability of selecting each preset action; or alternatively, it can output the value of selecting each preset action.

[0066] The plurality of preset actions include changing or maintaining the status of a virtual machine in the server.

[0067] In response to selecting a target action, the data center is controlled to execute the target action, adjusting the data center's software layer operations. During each server energy consumption adjustment process, only one preset action can be selected as the target action, or multiple preset actions can be selected as the target action. For example, the target action selected may be migrating one virtual machine or deleting another virtual machine, etc., which will not be detailed here.

[0068] The target action selection criteria include ensuring that the energy consumption of the selected action is no greater than the energy consumption of the data center without executing the target action, provided the environmental conditions remain unchanged. However, if environmental conditions change, particularly if software workload increases, the energy consumption of executing the target action need not be less than the energy consumption of not executing the target action. Alternatively, the target action can be selected from among the preset actions that improve or maintain energy efficiency.

[0069] S303: Inputting the hardware status parameters into the second prediction model, using the second prediction model to predict the energy consumption of the server hardware, and adjusting the operating frequency and voltage of the server based on the predicted energy consumption.

[0070] In this embodiment, the second prediction model can receive and identify hardware status parameters, and predict the future energy consumption of the server based on the current hardware status parameters of the server, thereby selecting the operating frequency and voltage that can improve energy utilization based on the predicted energy consumption.

[0071] The operating frequency can be adjusted. For example, when the required operating frequency is lower than the current operating frequency, the operating frequency can be lowered, thereby helping to reduce energy consumption.

[0072] The first prediction model and the second prediction model may be integrated into one, or they may be independent of each other, which is not limited here.

[0073] It can be seen that in this embodiment, the environmental status of the data center is obtained, and the target action is selected based on the environmental status to schedule the data center at the software level according to the current overall environment of the data center, so as to promote the reduction of the energy consumption of the data center from the software level. At the same time, the hardware status parameters of the servers in the data center are obtained, and the operating frequency and voltage of the servers are adjusted based on the hardware status parameters of the servers, so as to adjust the operating frequency and voltage according to the operating status of the servers, thereby effectively adjusting the energy consumption. In this way, this embodiment can take the overall environment of the data center into consideration when reducing the energy consumption of the server, and reduce the one-sidedness of conditioning the energy consumption of a single server. At the same time, this embodiment can also integrate the software layer and the hardware layer of the data center, and adjust the energy consumption at both levels, effectively improving the efficiency and reliability of energy consumption regulation.

[0074] Please refer to FIG4 , which is a flow chart of another embodiment of the method for adjusting server energy consumption of the present application.

[0075] S401: Acquire the environmental status of the data center.

[0076] In this embodiment, the data center may include at least one server, and each server is allowed to mount several virtual machines.

[0077] For example, a data center includes multiple physical servers, each of which is mounted with a number of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.

[0078] Thus, this embodiment can flexibly adjust the number of servers and virtual machines mounted on them based on user business conditions, which is beneficial to ensuring the reliability and stability of data center operations. At the same time, this embodiment can improve the utilization efficiency of data center servers and virtual machines by adjusting the energy consumption of the data center, thereby improving the performance of the data center.

[0079] Specifically, the energy consumption data of the server within a preset period can be obtained.

[0080] Optionally, the resource utilization of the server and the resource capacity of both the server and the virtual machine can be obtained; where the resources include at least one of the central processing unit, memory, network interface card, and disk; and the resource utilization and resource capacity of both can be used as energy consumption data. In this way, environmental rewards can help the first prediction model determine whether the currently selected target action is applicable, allowing the first prediction model to dynamically adjust the selected strategy based on the current environmental rewards, thereby optimizing the first prediction model.

[0081] In this way, the energy required for resource utilization is predicted / evaluated through the actual server software resource utilization, and the preset action is selected as the target action. This can improve the adaptability of the target action to the actual situation and improve the reliability and efficiency of energy consumption regulation.

[0082] Furthermore, the number of user requests received by the data center within a preset period may be obtained as the first number of requests.

[0083] The number of user requests received by the management device of the server within a preset period may be obtained as the second number of requests; wherein the management device is configured to distribute the received user requests to the virtual machines.

[0084] Optionally, the management device may be a management module in the apparatus for regulating server energy consumption of the present application, or an independent management device, which is not limited here.

[0085] In this embodiment, the energy consumption data, the first request quantity, and the second request quantity may be used as the environmental status.

[0086] That is, in this embodiment, when acquiring the environmental status, the server's energy consumption and user requests can be acquired simultaneously, so that the server's energy consumption and user requests can be comprehensively considered when adjusting energy consumption. The number of user requests can be used to evaluate the number of virtual machines required, which can improve the rationality of energy consumption adjustment in this embodiment and reduce the data center's energy consumption as much as possible without interfering with business operations. At the same time, this embodiment can also take into account the time difference between user requests reaching the data center and the server, and therefore simultaneously acquire the first request number and the second request number, thereby improving the refinement of the energy consumption adjustment considerations in this embodiment, improving the accuracy of predictions, and thereby improving the reliability of target action selection.

[0087] S402: Inputting the environmental state into a first prediction model, and using the first prediction model to select a target action from a plurality of preset actions.

[0088] In this embodiment, the first prediction model may be used to receive the environment state and the current environment reward, and the first prediction model may select one of a plurality of preset actions as the target action based on the environment state and the current environment reward.

[0089] For example, the plurality of preset actions may include adding a virtual machine mounted on a server, deleting a virtual machine, migrating a virtual machine between servers, maintaining a current state, activating a physical server, and hibernating a physical server.

[0090] S403: Control the data center to execute the target action and evaluate the current environmental reward based on the energy consumption change trend.

[0091] In this embodiment, in response to the data center executing the target action, the current environmental reward of the data center may be evaluated based on the energy consumption variation trend of the data center.

[0092] Specifically, the current energy consumption of the data center can be measured and compared with the forward energy consumption before executing the target action. If the current energy consumption is not higher than the forward energy consumption, a positive incentive is given to the first prediction model as a current environmental reward. If the current energy consumption is higher than the forward energy consumption, a negative incentive is given to the first prediction model as a current environmental reward.

[0093] That is to say, in this embodiment, positive excitation and negative excitation with opposite signs can be used to facilitate the first prediction model to effectively identify whether the purpose of reducing energy consumption is achieved, simplify the optimization process, and help improve the optimization efficiency of the first prediction model, thereby improving the efficiency of energy consumption regulation.

[0094] Furthermore, if the action selected is to migrate the virtual machine, information such as the distance between the source and target locations and the network bandwidth can be added when evaluating the environmental reward. The current environmental reward calculation formula can be as follows:

[0095] Where R represents the current environmental reward of migrating the virtual machine, R0 represents the environmental reward obtained by the same environmental reward algorithm as other preset actions; dist represents the distance between the source location and the target location; f_band represents the network bandwidth.

[0096] As such, in this embodiment, it is possible to select a machine with a larger bandwidth and a shorter distance for migration, which is beneficial to shortening the task completion time, that is, it is beneficial to ensure that the task is completed in a shorter time, thereby improving the energy consumption regulation efficiency.

[0097] S404: Obtain hardware status parameters of servers in the data center.

[0098] In this embodiment, the hardware status parameters may be used to evaluate the performance change trend of the server's throughput.

[0099] Optionally, the hardware status parameters include utilization rates of the server's central processing unit, memory, and fan speed, and the performance change trend of the server's throughput can be evaluated based on the utilization rates.

[0100] Furthermore, the hardware status parameter may also include graphics card utilization, etc., which is not limited here.

[0101] S405: Predicting the energy consumption of the server within a preset time period in the future.

[0102] In this embodiment, in response to obtaining the hardware status parameters of the server, the energy consumption for a preset time period in the future can be predicted using the hardware status parameters, that is, the predicted energy consumption can be obtained. The prediction can be performed using a second prediction model.

[0103] The preset duration may be consistent with the scheduling period of energy consumption regulation, or may be longer than the preset scheduling period, which is not limited here.

[0104] S406: Compare the predicted energy consumption with the current energy consumption to obtain the energy consumption change trend.

[0105] In this embodiment, the predicted energy consumption is compared with the current energy consumption to determine whether the energy consumption of the data center will increase within a preset period of time in the future, and to form an energy consumption change trend.

[0106] Optionally, the energy consumption change trend may be a simple increase or decrease; or the proportion of increase / decrease may be predicted in detail, which is not limited here.

[0107] S407: Analyze both the performance change trend and the energy consumption change trend, and adaptively adjust the operating frequency and voltage.

[0108] In this embodiment, the performance variation trend may be compared with the energy consumption variation trend.

[0109] In response to the performance change trend being performance degradation and the energy consumption change trend being energy consumption increase, the operating frequency and voltage of the server are reduced.

[0110] In this case, this embodiment can input the hardware status parameters into the second prediction model, use the second prediction model to predict the energy consumption of the server, and adjust the operating frequency and voltage of the server based on the prediction results.

[0111] As shown in Figure 5, which is a schematic diagram of the structure of an embodiment of the second prediction model of the present application, the second prediction model may include an input layer, a hidden layer, and an output layer. The number of hidden layers may be at least one. The input layer receives hardware state parameters, and the output layer outputs predicted energy consumption.

[0112] The following is an example of the iterative method of the first prediction model:

[0113] Initialize the data center and the first prediction model.

[0114] Specifically, the current state of the data center can be randomly initialized; the values ​​corresponding to each preset action can be randomly initialized; the model parameters of the first prediction model can be randomly initialized; and the experience collection can be cleared. This ensures that the optimization of the current first prediction model is based on the actual situation of the current data center, improving the reliability of the optimization process, thereby enabling the first prediction model to better serve the target action selection and further improving the reliability of energy consumption regulation.

[0115] The current state of the data center is written to the state sequence, and the first prediction model is iterated for the current round.

[0116] In response to the first prediction model completing the current round of iteration; determining whether the cumulative number of iterations of the first prediction model reaches a preset number.

[0117] In response to the cumulative number of iterations not reaching the preset number, a new round of iterations is performed using the current state of the data center; in response to the cumulative number of iterations reaching the preset number, the iteration of the first prediction model is completed.

[0118] In response to reaching a preset number of iterations, the loss function and model gradient backpropagation are used to generate update parameters that can be used to update the model parameters of the first prediction model. By setting appropriate update timing, frequent, ineffective, and relatively ineffective updates are reduced, thereby facilitating the rational use of computing resources and reducing energy consumption, thereby reducing energy consumption in the data center and the adjustment process.

[0119] The detailed process of performing the current round of iteration on the first prediction model can be exemplified as follows:

[0120] The probability of each preset action being selected in the current state can be evaluated based on the current state, and the one with the highest probability among the preset actions is selected as the iterative action.

[0121] Perform iterative actions on the current state of the data center to obtain the updated state and environmental rewards.

[0122] Associate the current state, iterative action, environmental reward, and updated state and store them as samples in the experience collection.

[0123] Collect at least one sample from the experience collection and calculate the current target value.

[0124] The formula for calculating the current target value is as follows:

[0125] Among them, y jrepresents the target value of the jth sample; R j represents the environmental reward of the jth sample; γ represents the decay factor; S j ' represents the updated state of the jth sample; A j ' represents the iterative action of the jth sample; w' represents the network parameters of the first prediction model; Q' represents the value score; Indicates the maximum value score that can be achieved by calculating and executing each preset action.

[0126] The calculation formula of the loss function mentioned above is as follows:

[0127] Among them, Loss represents the loss value; m represents the number of selected samples; Sj represents the current state of the j-th sample; Q(Sj, Aj, ω) represents the value score of the j-th sample.

[0128] The following describes the present application by taking a data center as an example.

[0129] In one embodiment, a data center may be composed of k physical servers PM (Physical Machine), which can be expressed as PM = {p1, ..., p k}.

[0130] VM (Virtual Machine) represents the virtual machine in the data system. A data center can be composed of q virtual machines, which can be expressed as VM = {p1, ..., p q}.

[0131] R n It represents the number of user requests received by the data center within an interval of n hours. Assuming that there are m user requests, it can be expressed as R n ={r1, ..., r m}.

[0132] PM n Represents the state of the physical server at interval n. Assuming n is the number of states the server has experienced, it can be expressed as PM n ={r1, ..., rλ } .

[0133] L n It can represent the number of user requests received by the management module of the server at interval n.

[0134] The energy consumption of the server at time t is defined as E t , which can be represented by the sum of the energy consumption of all virtual machines running in it, specifically expressed as E t =∑ i E it, where E it represents the energy consumption of the i-th virtual machine.

[0135] In this embodiment, intelligent agents such as the first prediction model and the second prediction model can learn in the process of interacting with the data center environment, obtain rewards from environmental feedback, and thus continuously optimize their own strategies, and implement the server's energy consumption process using models such as reinforcement learning models and deep learning models.

[0136] Taking the reinforcement learning model as an example, the element definition can be as follows:

[0137] The state S of the environment can be expressed by {PM n , R n , L n} represents the overall energy consumption level of a physical machine such as a server (i.e., a server); n Indicates the status of the physical server at interval n, R n L represents the number of user requests received by the data center within n hours. n It can represent the number of user requests received by the management module of the server at interval n.

[0138] Individual actions A can represent the number of virtual machine execution actions that the control decision module can take under all possible states. In this embodiment, the action space can be divided into four states, namely, migrating virtual machines, adding virtual machines, deleting virtual machines, and maintaining the original state virtual machine allocation strategy.

[0139] Environmental Reward R: The goal of the first and second prediction models, or the server energy consumption adjustment mechanism, is to adjust the virtual machine configuration to minimize energy consumption. Therefore, when migrating virtual machines, a comprehensive judgment is made based on information such as the distance between the source and target locations and network bandwidth to ensure that the task is completed in the shortest possible time. When designing the reward mechanism, server energy consumption, distance, and network bandwidth are comprehensively considered.

[0140] In this embodiment, an action-value function can be used to evaluate the value of an action. The action-value function can be understood as the value of a state consisting of the reward of that state and the value of subsequent states, at a certain decay ratio. The value of states closer to the current moment has a greater impact on the current moment.

[0141] The execution process of this embodiment may be as follows:

[0142] The algorithm inputs: number of iterations T, environment state S, action set A, decay factor γ, current Z network Q, target Z network Z', number of samples for batch gradient descent m, and target Z network Z' parameter update frequency C. The output can be the Z network parameters.

[0143] Randomly initialize the values ​​Q corresponding to all states and actions, randomly initialize all parameters w of the current Z network, and initialize the parameters w^' = w of the target Z network Z'. Clear the experience replay set D.

[0144] Perform T iterations on the reinforcement learning model. The iteration process can be as follows:

[0145] Initialize the environment state S to the first state of the current state sequence.

[0146] The preprocessed environment state S is used as input in the Z network to obtain the value Q output corresponding to all actions of the Z network. The action A with the highest probability is selected from the current value Q output.

[0147] Execute the current action A in state S and obtain the preprocessed new state S' and the environment reward R.

[0148] Store {S,A,R,S^'} into the experience replay set D.

[0149] The environmental state of the new iteration / energy consumption adjustment is updated, that is, S=S'.

[0150] Sample m samples from the experience replay set D {S j , A j , R j , S′ j}, calculate the current target Q value, the calculation formula can be as above formula 1-3 and formula 1-4:

[0151] Using the mean squared error loss function, all parameters w of the Z network are updated by backpropagating the gradient of the neural network.

[0152] Among them, the calculation formula of the loss function can be as follows:

[0153] The current iteration number i is identified, and in response to i%C=1 (the remainder of i divided by the preset constant C is 1), the target Z network parameter w'=w is updated.

[0154] If the loss function decreases by less than the set threshold, the current iteration is complete. Otherwise, the process switches to the Z network, using the preprocessed environment state S as input. The value Q output corresponding to all actions of the Z network is obtained. The action A with the highest probability is selected from the current value Q output.

[0155] In summary, this application can save the overall energy consumption of the cluster from a global granularity at the software level, and can use a reinforcement learning model to dynamically configure physical and virtual machine resources (such as reducing the number of running physical and virtual machines, and migrating the running location of virtual machines). At the same time, this application can optimize the hardware energy consumption of a single server from the hardware level when the configured resources do not meet the software adjustment conditions. Based on the hardware granularity utilization information of the CPU, memory, etc. of a single server, a deep learning model is used to predict the energy consumption of a single server in the future. From the hardware component granularity, the operating frequency, voltage, etc. of the corresponding components are adjusted to maximize the energy utilization of a single server. Therefore, for cloud service customers, under the same conditions, this application can reduce the completion time of user submitted tasks and improve efficiency; for cloud service operators, it can balance the load resource utilization of each component of the system, reduce the use loss and electricity of service components, and reduce overall operating costs.

[0156] It should be understood that, although the various steps in the flow charts of Figures 3-4 are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless clearly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in Figures 3-4 may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0157] Please refer to FIG. 6 , which is a schematic structural diagram of an embodiment of a computer device of the present application.

[0158] In one embodiment, the computer device may be a terminal, and its internal structure diagram may be as shown in FIG6 .

[0159] A computer device includes a processor, memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for regulating server energy consumption is implemented. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or may be a key, trackball, or touchpad provided on the computer device housing, or may be an external keyboard, touchpad, or mouse.

[0160] Those skilled in the art will understand that the structure shown in FIG6 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0161] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0162] S301: Acquire the environmental status of the data center and obtain the hardware status parameters of the servers in the data center; wherein the hardware status parameters include at least one of central processing unit utilization, memory utilization, and fan speed utilization.

[0163] S302: Inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining the state of a virtual machine in a server.

[0164] S303: Inputting the hardware status parameters into the second prediction model, using the second prediction model to predict the energy consumption of the server hardware, and adjusting the operating frequency and voltage of the server based on the predicted energy consumption.

[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0166] S401: Acquire the environmental status of the data center.

[0167] In this embodiment, the data center includes at least one server, and each server is allowed to mount several virtual machines.

[0168] For example, a data center includes multiple physical servers, each of which is mounted with a number of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.

[0169] Specifically, the energy consumption data of the server within a preset period can be obtained.

[0170] Optionally, the resource utilization of the server and the resource capacity of both the server and the virtual machine can be obtained; wherein the resources include at least one of the central processing unit, memory, network card and disk; the resource utilization and the resource capacity of both are used as energy consumption data.

[0171] Furthermore, the number of user requests received by the data center within a preset period may be obtained as the first number of requests.

[0172] The number of user requests received by the management device of the server within a preset period may be obtained as the second number of requests; wherein the management device is configured to distribute the received user requests to the virtual machines.

[0173] In this embodiment, the energy consumption data, the first request quantity, and the second request quantity may be used as the environmental status.

[0174] That is, in this embodiment, when acquiring the environmental status, the server's energy consumption and user requests can be acquired simultaneously, so that the server's energy consumption and user requests can be comprehensively considered when adjusting energy consumption. The number of user requests can be used to evaluate the number of virtual machines required, which can improve the rationality of energy consumption adjustment in this embodiment and reduce the data center's energy consumption as much as possible without interfering with business operations. At the same time, this embodiment can also take into account the time difference between user requests reaching the data center and the server, and therefore simultaneously acquire the first request number and the second request number, thereby improving the refinement of the energy consumption adjustment considerations in this embodiment, improving the accuracy of predictions, and thereby improving the reliability of target action selection.

[0175] In an alternative embodiment, the number of user requests from one of the data center and the management device may be obtained as the environmental status, which will not be described in detail here.

[0176] S402: Inputting the environmental state into a first prediction model, and using the first prediction model to select a target action from a plurality of preset actions.

[0177] In this embodiment, the first prediction model may be used to receive the environment state and the current environment reward, and the first prediction model may select one of a plurality of preset actions as the target action based on the environment state and the current environment reward.

[0178] For example, the plurality of preset actions include adding a virtual machine mounted on a server, deleting a virtual machine, migrating a virtual machine between servers, maintaining a current state, activating a physical server, and hibernating a physical server.

[0179] S403: Control the data center to execute the target action and evaluate the current environmental reward based on the energy consumption change trend.

[0180] In this embodiment, in response to the data center executing the target action, the current environmental reward of the data center may be evaluated based on the energy consumption variation trend of the data center.

[0181] Specifically, the current energy consumption of the data center can be measured and compared with the forward energy consumption before executing the target action. If the current energy consumption is not higher than the forward energy consumption, a positive incentive is given to the first prediction model as a current environmental reward. If the current energy consumption is higher than the forward energy consumption, a negative incentive is given to the first prediction model as a current environmental reward.

[0182] S404: Obtain hardware status parameters of servers in the data center.

[0183] In this embodiment, the hardware status parameters may be used to evaluate the performance change trend of the server's throughput.

[0184] Optionally, the hardware status parameters include utilization rates of the server's central processing unit, memory, and fan speed, and the performance change trend of the server's throughput can be evaluated based on the utilization rates.

[0185] S405: Predicting the energy consumption of the server within a preset time period in the future.

[0186] S406: Compare the predicted energy consumption with the current energy consumption to obtain the energy consumption change trend.

[0187] S407: Analyze both the performance change trend and the energy consumption change trend, and adaptively adjust the operating frequency and voltage.

[0188] In this embodiment, the performance variation trend may be compared with the energy consumption variation trend.

[0189] In response to the performance change trend being performance degradation and the energy consumption change trend being energy consumption increase, the operating frequency and voltage of the server are reduced.

[0190] In this case, this embodiment can input the hardware status parameters into the second prediction model, use the second prediction model to predict the energy consumption of the server, and adjust the operating frequency and voltage of the server based on the prediction results.

[0191] In one embodiment, when performing the iterative method for the first prediction model, the processor further implements the following steps when executing the computer program: initializing the data center and the first prediction model.

[0192] Specifically, the current state of the data center can be randomly initialized; the value corresponding to each preset action can be randomly initialized; the model parameters of the first prediction model can be randomly initialized; and the experience collection can be cleared.

[0193] The current state of the data center is written to the state sequence, and the first prediction model is iterated for the current round.

[0194] In response to the first prediction model completing the current round of iteration; determining whether the cumulative number of iterations of the first prediction model reaches a preset number.

[0195] In response to the cumulative number of iterations not reaching the preset number, a new round of iterations is performed using the current state of the data center; in response to the cumulative number of iterations reaching the preset number, the iteration of the first prediction model is completed.

[0196] In response to the number of iteration rounds reaching a preset number, the loss function and the model gradient back propagation are used to form update parameters that can be used to update the model parameters of the first prediction model. By setting a reasonable update timing, frequent, ineffective, and relatively ineffective updates are reduced, which is conducive to the rational use of computing resources, can reduce energy consumption, and reduce the energy consumption of the adjustment process while reducing the energy consumption of the data center.

[0197] In this embodiment, the block where the number of iterations reaches a preset number may be updated when the number threshold is reached, or updated in the next iteration after the number threshold is reached, which is not limited here.

[0198] The detailed process of iterating the first prediction model in the current round can be illustrated as follows: the probability of each preset action being selected in the current state can be evaluated based on the current state, and the one with the highest probability among the preset actions is selected as the iterative action.

[0199] Perform iterative actions on the current state of the data center to obtain the updated state and environmental rewards.

[0200] Associate the current state, iterative action, environmental reward, and updated state and store them as samples in the experience collection.

[0201] Collect at least one sample from the experience collection and calculate the current target value.

[0202] The formula for calculating the current target value is as follows:

[0203] Among them, y j represents the target value of the jth sample; Rj represents the environmental reward of the jth sample; γ represents the decay factor; S j ' represents the updated state of the jth sample; A j ' represents the iterative action of the jth sample; w' represents the network parameters of the first prediction model; Q' represents the value score; Indicates the maximum value score that can be achieved by calculating and executing each preset action.

[0204] The calculation formula of the loss function mentioned above is as follows: Where Loss represents the loss value; m represents the number of selected samples; Sj represents the current state of the j-th sample; and Q(Sj, Aj, ω) represents the value score of the j-th sample.

[0205] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: S301: Obtain the environmental status of the data center and obtain the hardware status parameters of the servers in the data center; wherein the hardware status parameters include at least one of the central processing unit utilization, memory utilization, and fan speed utilization.

[0206] S302: Inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining the state of a virtual machine in a server.

[0207] S303: Inputting the hardware status parameters into the second prediction model, using the second prediction model to predict the energy consumption of the server hardware, and adjusting the operating frequency and voltage of the server based on the predicted energy consumption.

[0208] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: S401: Acquire the environmental status of the data center.

[0209] In this embodiment, the data center includes at least one server, and each server is allowed to mount several virtual machines.

[0210] For example, a data center includes multiple physical servers, each of which is mounted with a number of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.

[0211] Specifically, the energy consumption data of the server within a preset period can be obtained.

[0212] Optionally, the resource utilization of the server and the resource capacity of both the server and the virtual machine can be obtained, wherein the resource includes at least one of a central processing unit, a memory, a network card, and a disk. The resource utilization and the resource capacity of both can be used as energy consumption data.

[0213] The resource utilization rate can be further obtained by obtaining the graphics card utilization rate, etc., which is not limited here.

[0214] Furthermore, the number of user requests received by the data center within a preset period may be obtained as the first number of requests.

[0215] The number of user requests received by the management device of the server within a preset period may be obtained as the second number of requests; wherein the management device is configured to distribute the received user requests to the virtual machines.

[0216] In this embodiment, the energy consumption data, the first request quantity, and the second request quantity may be used as the environmental status.

[0217] S402: Inputting the environmental state into a first prediction model, and using the first prediction model to select a target action from a plurality of preset actions.

[0218] In this embodiment, the first prediction model may be used to receive the environment state and the current environment reward, and the first prediction model may select one of a plurality of preset actions as the target action based on the environment state and the current environment reward.

[0219] For example, the plurality of preset actions include adding a virtual machine mounted on a server, deleting a virtual machine, migrating a virtual machine between servers, maintaining a current state, activating a physical server, and hibernating a physical server.

[0220] S403: Control the data center to execute the target action and evaluate the current environmental reward based on the energy consumption change trend.

[0221] In this embodiment, in response to the data center executing the target action, the data center's current environmental rewards can be evaluated based on the data center's energy consumption trends. This environmental reward facilitates the first prediction model's determination of the applicability of the currently selected target action, allowing the first prediction model to dynamically adjust the selected strategy based on the current environmental rewards, thereby optimizing the first prediction model.

[0222] Specifically, the current energy consumption of the data center can be measured. The current energy consumption is compared with the forward energy consumption before executing the target action. In response to the current energy consumption not being higher than the forward energy consumption, a positive incentive is given to the first prediction model as a current environmental reward; in response to the current energy consumption being higher than the forward energy consumption, a negative incentive is given to the first prediction model as a current environmental reward. The use of positive and negative incentives with opposite signs facilitates the first prediction model's effective identification of whether the goal of reducing energy consumption has been achieved, simplifies the optimization process, and helps improve the optimization efficiency of the first prediction model, thereby improving the efficiency of energy consumption regulation.

[0223] S404: Obtain hardware status parameters of servers in the data center.

[0224] In this embodiment, the hardware status parameters may be used to evaluate the performance change trend of the server's throughput.

[0225] Optionally, the hardware status parameters include utilization rates of the server's central processing unit, memory, and fan speed, and the performance change trend of the server's throughput can be evaluated based on the utilization rates.

[0226] Furthermore, the hardware status parameter may also include graphics card utilization, etc., which is not limited here.

[0227] S405: Predicting the energy consumption of the server within a preset time period in the future.

[0228] In this embodiment, in response to obtaining the hardware status parameters of the server, the energy consumption for a preset time period in the future can be predicted using the hardware status parameters, that is, the predicted energy consumption can be obtained. The prediction can be performed using a second prediction model.

[0229] The preset duration may be consistent with the scheduling period of energy consumption regulation, or may be longer than the preset scheduling period, which is not limited here.

[0230] S406: Compare the predicted energy consumption with the current energy consumption to obtain the energy consumption change trend.

[0231] In this embodiment, the predicted energy consumption is compared with the current energy consumption to determine whether the energy consumption of the data center will increase within a preset period of time in the future, and to form an energy consumption change trend.

[0232] Optionally, the energy consumption change trend may be a simple increase or decrease; or the proportion of increase / decrease may be predicted in detail, which is not limited here.

[0233] S407: Analyze both the performance change trend and the energy consumption change trend, and adaptively adjust the operating frequency and voltage.

[0234] In this embodiment, the performance variation trend may be compared with the energy consumption variation trend.

[0235] In response to the performance change trend being performance degradation and the energy consumption change trend being energy consumption increase, the operating frequency and voltage of the server are reduced.

[0236] In this case, this embodiment can input the hardware status parameters into the second prediction model, use the second prediction model to predict the energy consumption of the server, and adjust the operating frequency and voltage of the server based on the prediction results.

[0237] In one embodiment, when performing the iterative method for the first prediction model, the computer program, when executed by the processor, further implements the following steps: initializing the data center and the first prediction model.

[0238] Specifically, the current state of the data center can be randomly initialized; the value corresponding to each preset action can be randomly initialized; the model parameters of the first prediction model can be randomly initialized; and the experience collection can be cleared.

[0239] The current state of the data center is written to the state sequence, and the first prediction model is iterated for the current round.

[0240] In response to the first prediction model completing the current round of iteration; determining whether the cumulative number of iterations of the first prediction model reaches a preset number.

[0241] In response to the cumulative number of iterations not reaching the preset number, a new round of iterations is performed using the current state of the data center; in response to the cumulative number of iterations reaching the preset number, the iteration of the first prediction model is completed.

[0242] In response to the number of iterations reaching a preset number, the loss function and the model gradient back propagation are used to form update parameters that can be used to update the model parameters of the first prediction model.

[0243] The detailed process of performing the current round of iteration on the first prediction model can be exemplified as follows:

[0244] The probability of each preset action being selected in the current state can be evaluated based on the current state, and the one with the highest probability among the preset actions is selected as the iterative action.

[0245] Perform iterative actions on the current state of the data center to obtain the updated state and environmental rewards.

[0246] Associate the current state, iterative action, environmental reward, and updated state and store them as samples in the experience collection.

[0247] Collect at least one sample from the experience collection and calculate the current target value.

[0248] The formula for calculating the current target value is as follows: Among them, y j represents the target value of the jth sample; R j represents the environmental reward of the jth sample; γ represents the decay factor; S j ' represents the updated state of the jth sample; A j ' represents the iterative action of the jth sample; w' represents the network parameters of the first prediction model; Q' represents the value score; Indicates the maximum value score that can be achieved by calculating and executing each preset action.

[0249] The calculation formula of the loss function mentioned above is as follows: Among them, Loss represents the loss value; m represents the number of selected samples; Sj represents the current state of the j-th sample; Q(Sj, Aj, ω) represents the value score of the j-th sample.

[0250] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0251] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0252] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A method for adjusting the energy consumption of a server, characterized in that, The method includes: Obtaining the environmental status of the data center and obtaining the hardware status parameters of the servers in the data center; wherein, the hardware status parameters include at least one of the central processing unit utilization rate, the memory utilization rate, and the fan speed utilization rate; Pre-training a first prediction model through a data set, inputting the environmental status into the first prediction model, using the first prediction model to select a target action from multiple preset actions, and controlling the data center to execute the target action; wherein, the multiple preset actions include changing or maintaining the status of virtual machines in the server; Pre-training a second prediction model through a data set, inputting the hardware status parameters into the second prediction model, using the second prediction model to predict the energy consumption of the server hardware, and adjusting the working frequency and voltage of the server based on the predicted energy consumption.

2. The method for adjusting the server energy consumption according to claim 1, wherein The data center includes at least one of the servers, and each of the servers allows a plurality of virtual machines to be mounted; The obtaining the environmental status of the data center includes: Obtaining the energy consumption data of the server within a preset period; Obtaining the number of user requests received by the data center within the preset period as the first request number; Obtaining the number of user requests received by the management device of the server within the preset period as the second request number; wherein, the management device is used to distribute the received user requests to the virtual machines; Taking the energy consumption data, the first request number, and the second request number as the environmental status.

3. The method for adjusting the server power consumption according to claim 2, wherein The obtaining the energy consumption data of the server within a preset period includes: Obtaining the resource utilization rate of the server and the resource capacities of both the server and the virtual machines; wherein, the resources include at least one of the central processing unit, the memory, the network card, and the disk; Taking the resource utilization rate and the resource capacities of both as the energy consumption data.

4. The method for adjusting the server energy consumption according to claim 1, wherein The using the first prediction model to select a target action from multiple preset actions includes: Using the first prediction model to receive the environmental status and the current environmental reward, and making the first prediction model select one of the multiple preset actions as the target action based on the environmental status and the current environmental reward; After the controlling the data center to execute the target action, it further includes: In response to the data center executing the target action, evaluating the current environmental reward of the data center based on the energy consumption change trend of the data center.

5. The method for adjusting the server energy consumption according to claim 4, wherein The evaluating the environmental reward of the data center based on the energy consumption change trend of the data center includes: Measuring the current energy consumption of the data center; Comparing the current energy consumption with the forward energy consumption before executing the target action; In response to the current energy consumption not being higher than the forward energy consumption, giving the first prediction model a positive incentive as the current environmental reward; in response to the current energy consumption being higher than the forward energy consumption, giving the first prediction model a negative incentive as the current environmental reward.

6. The method for adjusting the server energy consumption according to claim 1, characterized in that The iterative method of the first prediction model includes: Initializing the data center and the first prediction model; Write the current state of the data center to the state sequence and perform the current round of iteration on the first prediction model; In response to the first prediction model completing the current round of iteration, determine whether the cumulative number of iteration rounds of the first prediction model reaches a preset number of rounds; In response to the cumulative number of iteration rounds not reaching the preset number of rounds, use the current state of the data center to perform a new round of iteration; in response to the cumulative number of iteration rounds reaching the preset number of rounds, complete the iteration of the first prediction model; In response to the number of iteration rounds reaching a preset number, use the loss function and model gradient backpropagation to form update parameters that can be used to update the model parameters of the first prediction model.

7. The method for adjusting the server power consumption according to claim 6, wherein The performing the current round of iteration on the first prediction model includes: Based on the current state, evaluate the probability of each preset action being selected in the current state, and select the preset action with the highest probability as the iterative action; Execute the iterative action in the current state of the data center to obtain an updated state and an environmental reward; Associate the current state, the iterative action, the environmental reward, and the updated state and store them as samples in the experience replay buffer; Sample at least one of the samples from the experience replay buffer and calculate the current target value.

8. The method for adjusting the server energy consumption according to claim 7, wherein The calculation formula for the current target value is as follows: Among them, yj represents the target value of the j-th sample; Rj represents the environmental reward of the j-th sample; γ represents the attenuation factor; Sj’ represents the updated state of the j-th sample; Aj’ represents the iterative action of the j-th sample; w’ represents the network parameters of the first prediction model; Q’ represents the value score; represents calculating the maximum value score that can be achieved by executing each preset action; And / or, the calculation formula of the loss function is as follows: Where Loss represents the loss value; m represents the number of selected samples; Sj represents the current state of the j-th sample; Q(Sj, Aj, ω) represents the value score of the j-th sample.

9. The method for adjusting the server energy consumption according to claim 7, wherein The initializing the data center and the first prediction model includes: Randomly initialize the current state of the data center; Randomly initialize the values corresponding to each preset action; Randomly initialize the model parameters of the first prediction model; Empty the experience replay buffer.

10. The method for adjusting the server energy consumption according to claim 1, wherein, The first prediction model includes a probability sub-model; The selecting a target action from multiple preset actions using the first prediction model includes: Obtain the probability of selecting each preset action as the target action; Select the preset action corresponding to the maximum value of the probability as the target action.

11. The method for adjusting the server energy consumption according to claim 1, wherein The data center includes multiple physical servers, and each physical server is respectively mounted with a number of virtual machines; wherein, the number of virtual machines allowed to be mounted on each physical server is different; The multiple preset actions include adding virtual machines mounted on the server, deleting the virtual machines, migrating the virtual machines between the servers, maintaining the current state, activating the physical server, and sleeping the physical server.

12. The method for adjusting the server energy consumption according to claim 1, wherein The hardware state parameters include the utilization rates of the central processing unit, memory, and fan speed of the server respectively; The predicting the energy consumption of the server hardware using the second prediction model and adjusting the working frequency and voltage of the server based on the predicted energy consumption includes: Based on the utilization rate, evaluate the performance change trend of the throughput of the server; Predict the predicted energy consumption of the server within a preset future duration; Compare the predicted energy consumption with the current energy consumption to obtain an energy consumption change trend; Compare the performance change trend with the energy consumption change trend. In response to the performance change trend being performance degradation and the energy consumption change trend being energy consumption increase, reduce the operating frequency and voltage of the server.

13. The method for adjusting the server energy consumption according to claim 1, wherein The environmental status is configured to identify the current software status of the data center.

14. The method for adjusting the server energy consumption according to claim 1, wherein The first prediction model and the second prediction model are integrated into one.

15. The method for adjusting the server energy consumption according to claim 1, wherein The first prediction model and the second prediction model are independent of each other.

16. The method for adjusting the server energy consumption according to claim 1, characterized in that, The multiple preset actions may include adding the virtual machines mounted on the server, deleting the virtual machines, migrating the virtual machines between the servers, maintaining the current state, activating the physical server, and hibernating the physical server.

17. The method for adjusting the server energy consumption according to claim 4, wherein Through the environmental reward, the first prediction model determines whether the target action is applicable, and dynamically adjusts the selected strategy based on the environmental reward to optimize the first prediction model.

18. An adjustment device for server energy consumption, characterized in that The device for adjusting the server energy consumption includes: A data acquisition module, configured to obtain the environmental status of the data center and obtain the hardware status parameters of the servers in the data center; wherein, the hardware status parameters include at least one of the central processor utilization rate, the memory utilization rate, and the fan speed utilization rate; A first prediction model, configured to input the environmental status and select a target action from multiple preset actions; wherein, the multiple preset actions include changing or maintaining the status of the virtual machines in the server; A second prediction model, configured to input the hardware status parameters and predict the energy consumption of the server hardware; A management module, configured to control the data center to execute the target action and adjust the operating frequency and voltage of the server based on the predicted energy consumption.

19. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method for adjusting the server energy consumption according to any one of claims 1 to 17 are implemented.

20. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method for adjusting the server energy consumption according to any one of claims 1 to 17 are implemented.

Citation Information

Patent Citations

  • Virtual machine resource optimal control method and control system based on elastic virtual machine pool

    CN102662750A

  • Server integration method oriented to minimum energy consumption

    CN104298339A

  • Data center energy-saving scheduling method and system

    CN109800066A

  • Resource scheduling method and system of data center, scheduling equipment and medium

    CN113204429A

  • Energy consumption model training method, energy consumption characterization method and related equipment

    CN116090546A

Cited By

  • Scheduling method of server cluster and electronic equipment

    CN122412114A