CN117472167B - Method and device for adjusting energy consumption of server, computer equipment and storage medium - Google Patents

Method and device for adjusting energy consumption of server, computer equipment and storage medium Download PDF

Info

Publication number
CN117472167B
CN117472167B CN202311831949.1A CN202311831949A CN117472167B CN 117472167 B CN117472167 B CN 117472167B CN 202311831949 A CN202311831949 A CN 202311831949A CN 117472167 B CN117472167 B CN 117472167B
Authority
CN
China
Prior art keywords
energy consumption
server
data center
state
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311831949.1A
Other languages
Chinese (zh)
Other versions
CN117472167A (en
Inventor
王东清
李道童
张炳会
李婷婷
陈衍东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202311831949.1A priority Critical patent/CN117472167B/en
Publication of CN117472167A publication Critical patent/CN117472167A/en
Application granted granted Critical
Publication of CN117472167B publication Critical patent/CN117472167B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3296Power saving characterised by the action undertaken by lowering the supply or operating voltage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present invention relates to the field of data center control technologies, and in particular, to a method and an apparatus for adjusting server energy consumption, a computer device, and a storage medium. The method for adjusting the energy consumption of the server comprises the following steps: acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by 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 a state of a virtual machine in the server; and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption. The method can be used for dispatching from the software layer and the hardware layer to reduce energy consumption, and is beneficial to reducing redundant energy use so as to improve the energy utilization rate.

Description

Method and device for adjusting energy consumption of server, computer equipment and storage medium
Technical Field
The present invention relates to the field of data center control technologies, and in particular, to a method for adjusting server energy consumption, an apparatus for adjusting server energy consumption, a computer device, and a computer readable storage medium.
Background
With the rapid technologies of big data, cloud computing and the like, the energy consumption generated in scenes such as data centers and the like is increasingly increased, and a large amount of gas emission such as carbon dioxide and the like can be generated when power supply exists while the power supply burden is increased.
Therefore, the received service is preferentially distributed to the low-temperature server by means of polling or the like, but the situation that the low-temperature server is raised to the high-temperature server easily occurs, so that the server is continuously switched between the high-temperature server and the low-temperature server, and meanwhile, the polling or the like operation mode needs to occupy larger network transmission resources, transmission time and the like, so that the comprehensive energy consumption adjusting effect is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method for adjusting server power consumption, an apparatus for adjusting server power consumption, a computer device, and a computer-readable storage medium, which are capable of performing scheduling from a software-level and a hardware-level dual-layer to reduce power consumption, thereby advantageously reducing redundant power usage to improve energy utilization.
In one aspect, a method for adjusting energy consumption of a server is provided, where the method for adjusting energy consumption of a server includes: acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization; inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by 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 a state of a virtual machine in the server; and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In one embodiment of the present application, a data center includes at least one server, each server allowing mounting of a plurality of virtual machines; acquiring the environmental state of the data center includes: acquiring energy consumption data of a server in a preset period; acquiring the number of user requests received by a data center in a preset period as a first request number; acquiring the number of user requests received by management equipment of the server in a preset period as a second request number; the management device is used for distributing the received user request to the virtual machine; the energy consumption data, the first request quantity and the second request quantity are taken as environmental states.
In an embodiment of the present application, obtaining energy consumption data of a server in a preset period includes: acquiring the resource utilization rate of a server, and the resource capacity of the server and the virtual machine; the resource comprises at least one of a central processing unit, a memory, a network card and a magnetic disk; and taking the resource utilization rate and the resource capacity of the resource utilization rate and the resource capacity as energy consumption data.
In an embodiment of the present application, selecting the target action from the plurality of preset actions using the first prediction model includes: receiving an environmental state and a current environmental reward by using a first prediction model, and enabling the first prediction model to select one of a plurality of preset actions as a target action based on the environmental state and the current environmental reward; the control data center further comprises the following steps after executing the target action: in response to the data center performing the target action, a current environmental reward of the data center is assessed based on the energy consumption trend of the data center.
In one embodiment of the present application, based on the trend of energy consumption variation of the data center, evaluating environmental rewards of the data center includes: measuring and calculating the current energy consumption of the data center; comparing the current energy consumption with the forward energy consumption before executing the target action; responsive to the current energy consumption not being higher than the forward energy consumption, assigning a first predictive model forward incentive as a current environmental benefit; and in response to the current energy consumption being higher than the forward energy consumption, giving a negative incentive to the first predictive model as a current environmental benefit.
In an embodiment of the present application, the iterative method of the first prediction model includes: initializing a data center and a first prediction model; writing the current state of the data center into the state sequence, and carrying out current round iteration on the first prediction model; completing a current round of iteration in response to the first predictive model; judging whether the accumulated iteration turns of the first prediction model reach a preset turn or not; in response to the accumulated iteration round not reaching the preset round, performing a new round of round iteration by utilizing the current state of the data center; responding to the accumulated iteration turns to reach a preset turn, and completing iteration of the first prediction model; in response to the iteration run reaching a preset number of times, update parameters that can be used to update model parameters of the first predictive model are formed using the loss function and model gradient back propagation.
In an embodiment of the present application, performing a current round iteration on the first predictive model includes: evaluating the probability of each preset action in the current state based on the current state, and selecting one with the highest probability in the preset actions as an iterative action; performing iterative actions under the current state of the data center to obtain an updated state and environmental rewards; correlating the current state, iterative action, environmental rewards and updated state, and storing the correlated state, iterative action, environmental rewards and updated state as a sample for experience collection; at least one sample is sampled from the back-inspected collection and the current target value is calculated.
In an embodiment of the present application, the calculation formula for calculating the current target value is as follows:wherein y is j Representing the target value of the jth sample; r is R j An environmental reward representing a jth sample; gamma represents an attenuation factor; s is S j ' represents the update status of the jth sample; a is that j ' represents the iterative action of the j-th sample; w' represents a network parameter of the first predictive model; q' represents a value score; />Representing calculating a maximum value score which can be realized by executing each preset action; and/or, the loss function is calculated as follows:wherein Loss represents a Loss value; m represents the number of selected samples; sj represents the current state of the jth sample; q (Sj, aj, ω) represents the value score of the jth sample.
In one embodiment of the present application, initializing the data center and the first predictive model includes: randomly initializing the current state of a data center; randomly initializing the value corresponding to each preset action; randomly initializing model parameters of a first prediction model; the experience is emptied and collected.
In an embodiment of the present application, the first predictive model includes a probabilistic sub-model; the selecting a target action from a plurality of preset actions by using the first prediction model comprises: acquiring the probability of selecting each preset action as a target action; and selecting a preset action corresponding to the maximum value in the probabilities as a target action.
In an embodiment of the present application, a data center includes a plurality of physical servers, each of which mounts a plurality of virtual machines; the number of virtual machines allowed to be mounted on each physical server is different; the plurality of preset actions include adding virtual machines mounted by the servers, deleting virtual machines, migrating virtual machines among the servers, maintaining a current state, activating physical servers, and hibernating physical servers.
In an embodiment of the present application, the hardware state parameter includes utilization rates of a central processor, a memory, and a fan rotation speed of the server; predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption comprises: evaluating the performance change trend of the throughput of the server based on the utilization rate; predicting the predicted energy consumption of the server in a future preset time length; comparing the predicted energy consumption with the current energy consumption to obtain an energy consumption fluctuation trend; and comparing the performance change trend with the energy consumption change trend, and reducing the working frequency and the voltage of the server in response to the performance change trend being performance decay and the energy consumption change trend being energy consumption increase.
On the other hand, a device for adjusting energy consumption of a server is provided, and the device for adjusting energy consumption of a server comprises: the system comprises a data acquisition module, a first prediction model, a second prediction model and a management module; the data acquisition module is used for acquiring the environmental state of the data center and acquiring the hardware state parameters of the server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization; the first prediction model is used for inputting an environmental state and selecting a target action from a plurality of preset actions; wherein the plurality of preset actions include changing or maintaining a state of a virtual machine in the server; the second prediction model is used for inputting hardware state parameters and predicting the energy consumption of the server hardware; the management module is used for controlling the data center to execute target actions and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In yet another aspect, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization; inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by 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 a state of a virtual machine in the server; and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In yet another aspect, a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization; inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by 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 a state of a virtual machine in the server; and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
According to the method for adjusting the energy consumption of the server, the device for adjusting the energy consumption of the server, the computer equipment and the computer readable storage medium, the environment state of the data center is obtained, and the target action is selected through the environment state, so that the data center is scheduled in a software layer according to the current overall environment of the data center, and the energy consumption of the data center is reduced from the software layer. Meanwhile, hardware state parameters of a server in the data center are obtained, and the working frequency and the voltage of the server are adjusted through the hardware state parameters of the server, so that the working frequency and the voltage are adjusted according to the working state of the server, and the energy consumption is effectively adjusted. If so, the application can fuse the software layer and the hardware layer of the data center, adjust the energy consumption at both layers, and effectively improve the energy consumption adjusting efficiency and the reliability.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a device for adjusting energy consumption of a server according to the present application;
FIG. 2 is a schematic view of an embodiment of an application scenario of a method for adjusting energy consumption of a server according to the present application;
FIG. 3 is a flow chart of an embodiment of a method for adjusting energy consumption of a server according to the present application;
FIG. 4 is a schematic flow chart of another embodiment of a method for adjusting energy consumption of a server according to the present application;
FIG. 5 is a schematic diagram illustrating the structure of an embodiment of a second predictive model of the present application;
FIG. 6 is a schematic diagram of an embodiment of a computer device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In order to solve the technical problem of poor energy consumption adjusting effect in the related art, the application provides a method for adjusting energy consumption of a server, an adjusting device for energy consumption of the server, computer equipment and a computer readable storage medium.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an embodiment of an apparatus for adjusting energy consumption of a server according to the present application.
In this embodiment, the device for adjusting energy consumption of the server can adjust the overall energy consumption of the data center, so as to improve the energy utilization rate as much as possible and reduce the energy waste, thereby achieving the purpose of relatively reducing the energy consumption of the data center.
The specific structure of the device for adjusting the power consumption of the server is illustrated below.
The regulation device of the server energy consumption comprises a data acquisition module 11, a first prediction model 12, a second prediction model 13 and a management module 14.
The data acquisition module 11 is capable of acquiring the environmental status of the data center. The data acquisition module 11 is also capable of acquiring hardware state parameters of servers in the data center. The hardware state parameter includes at least one of CPU utilization, memory utilization, and fan rotation speed utilization.
The first prediction model 12 is used for inputting an environmental state and selecting a target action from a plurality of preset actions. Wherein the plurality of preset actions includes changing or maintaining a state of a virtual machine in the server. In this embodiment, the first prediction model 12 can predict/evaluate the energy consumption that may be generated by each preset action, specifically, may predict a specific energy value that may be generated by the preset action, or may predict the value of selecting each preset action, which is not limited herein.
The second prediction model 13 is used for inputting hardware state parameters and predicting the energy consumption of the server hardware. The second prediction model 13 can receive and identify hardware state parameters, and predict future energy consumption of the server according to the current hardware state parameters of the server, so as to select an operating frequency and a voltage capable of improving the energy utilization rate according to the predicted energy consumption.
The first prediction model 12 and the second prediction model 13 may be integrated into one body, or may be independent of each other, which is not limited herein.
The management module 14 is used to control the data center to perform target actions and adjust the operating frequency and voltage of the server based on the predicted energy consumption.
If so, the device for adjusting the energy consumption of the server in the embodiment can be used for synchronously adjusting the energy consumption from two aspects of software and hardware by integrating the software layer information and the hardware layer information of the data center, so that the energy consumption adjusting efficiency and the reliability are effectively improved.
Referring to fig. 2, fig. 2 is a schematic view of an application scenario of an embodiment of a method for adjusting energy consumption of a server according to the present application.
The data center 20 may include at least one server.
Each server can mount a plurality of virtual machines. Of course, the server may not mount the virtual machine, which is not limited herein. In other words, each server is allowed to mount several virtual machines.
The data center 20 may include infrastructure for providing computing, storage, networking, virtual machines, and the like resources.
The data acquisition module 11 is capable of acquiring environmental status and/or hardware status parameters at a set frequency. For example, user requests, resource usage such as CPU (Central Processing Unit ), memory, disk I/O (Input/Output), and the like, and data center 20 power consumption information.
The service management module 14 may be responsible for splitting user commit requests into virtual machine resources that are independent of each other according to the specified configuration requirements and placing them into virtual machine queues.
The scheduling decision module formed by the first prediction model 12 and the second prediction model 13 can monitor the resource utilization rate of the server, the configuration distribution of the virtual machine, the number of resource requests of the task queue based on the collected information, and make decisions by taking the minimum energy consumption as a target from the software and hardware level.
For a specific definition of the means for adjusting the energy consumption of the server, reference may be made to the definition of the method for adjusting the energy consumption of the server hereinafter, which is not described in detail. The modules in the server energy consumption adjusting device can be all or partially realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The working principle of the energy consumption reducing device of the server energy consumption regulating device is explained in detail below.
Referring to fig. 3, fig. 3 is a flow chart illustrating an embodiment of a method for adjusting energy consumption of a server according to the present application.
S301: acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; the hardware state parameter includes at least one of CPU utilization, memory utilization, and fan rotation speed utilization.
In this embodiment, the data center is a scene in which energy consumption adjustment is required. The data center has a plurality of servers.
The environmental state may identify a current software state of the data center.
The hardware state parameters can identify the current working efficiency of the server, and the energy utilization rate of the server can be obtained by analyzing the hardware state parameters.
The hardware status parameters may include at least one of central processor utilization, memory utilization, fan speed utilization. For example, the hardware state parameters may include CPU utilization; alternatively, the hardware state parameters may include memory utilization; alternatively, the hardware state parameters may include fan speed utilization; alternatively, the hardware status parameters may include cpu utilization, memory utilization, and fan speed utilization, which are not described herein.
S302: inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions includes changing or maintaining a state of a virtual machine in the server.
In this embodiment, the first predictive model may be trained beforehand by the data set. Inputting the environment state into a pre-trained first prediction model, and if the first prediction model responds to the received environment state, evaluating the applicability of each preset action by combining software layer data of the current scene, and selecting one of the preset actions as a target action. The first predictive model may output the target action; or, the probability value of each preset action can be output and selected; alternatively, the value of each preset action can be output.
Wherein the plurality of preset actions includes changing or maintaining a state of a virtual machine in the server.
And in response to the target action, controlling the data center to execute the target action, and adjusting the software layer work of the data center. In the process of adjusting the energy consumption of the server each time, only one preset action can be selected as a target action, and a plurality of preset actions can be selected as target actions. For example, the selected target action is to migrate one of the virtual machines, delete the other virtual machine, and so on, which will not be described in detail herein.
The selection condition of the target action comprises that under the condition that the environmental state is kept unchanged, the energy consumption of the selection condition is not higher than the energy consumption of the data center which does not execute the target action. Of course, if the environmental state changes, especially if the software layer increases in operation, the energy consumption for executing the target action is not required to be lower than the energy consumption for not executing the target action, and one of the preset actions, which is beneficial to improving or maintaining the energy utilization efficiency, may be selected as the target action.
S303: and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In this embodiment, the second prediction model may receive and identify the hardware state parameter, and predict future energy consumption of the server according to the current hardware state parameter of the server, so as to select the operating frequency and the voltage capable of improving the energy utilization rate according to the predicted energy consumption.
The operating frequency is adjusted, for example, when the operating demand frequency is lower than the current operating frequency, the operating frequency can be reduced, thereby being beneficial to reducing the energy consumption.
The first prediction model and the second prediction model may be integrated, or may be independent of each other, which is not limited herein.
Therefore, in this embodiment, the environmental state of the data center is obtained, and the target action is selected according to the environmental state, so that the data center is scheduled at the software level according to the current overall environment of the data center, and the energy consumption of the data center is reduced from the software level. Meanwhile, hardware state parameters of a server in the data center are obtained, and the working frequency and the voltage of the server are adjusted through the hardware state parameters of the server, so that the working frequency and the voltage are adjusted according to the working state of the server, and the energy consumption is effectively adjusted. If so, the whole environment of the data center can be macroscopically considered when the energy consumption of the server is reduced, the unilateral performance of the condition for singly carrying out the energy consumption of one server is reduced, meanwhile, the software layer and the hardware layer of the data center can be fused, the energy consumption can be regulated at both layers, and the energy consumption regulating efficiency and the reliability are effectively improved.
Referring to fig. 4, fig. 4 is a flow chart of another embodiment of a method for adjusting energy consumption of a server according to the present application.
S401: the environmental status of the data center is obtained.
In this embodiment, the data center may include at least one server, and each server allows mounting a plurality of virtual machines.
For example, the data center includes a plurality of physical servers, each of which mounts a plurality of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.
In this embodiment, the number of servers and virtual machines mounted on the servers can be flexibly adjusted according to the service condition of the users, which is beneficial to guaranteeing the reliability and stability of the data center. Meanwhile, in the embodiment, the utilization efficiency of the data center server and the virtual machine can be improved through energy consumption adjustment of the data center, so that the performance of the data center is improved.
Specifically, energy consumption data of the server in a preset period may be acquired.
Alternatively, the resource utilization of the server, the resource capacity of both the server and the virtual machine may be obtained; the resource comprises at least one of a central processing unit, a memory, a network card and a magnetic disk; and taking the resource utilization rate and the resource capacity of the resource utilization rate and the resource capacity as energy consumption data. If so, the environment rewards are used for facilitating the first prediction model to determine whether the currently selected target action is applicable or not, facilitating the first prediction model to dynamically adjust the selected strategy based on the current environment rewards, and optimizing the first prediction model.
If so, through the real server software resource utilization condition, the energy required by the resource utilization is predicted/estimated, and the preset action serving as the target action is selected, so that the adaptation degree of the target action and the real condition can be improved, and the reliability and the adjustment efficiency of energy consumption adjustment are improved.
Further, the number of user requests received by the data center in the preset period may be obtained as the first request number.
The number of user requests received by the management equipment of the server in a preset period can be obtained and used as a second request number; the management device is used for distributing the received user request to the virtual machine.
Alternatively, the management device may be a management module in the energy consumption adjusting device of the server of the present application, or may be a stand-alone management device, which is not limited herein.
In this embodiment, the energy consumption data, the first request number, and the second request number may be used as the environmental status.
That is, in this embodiment, when the environmental state is acquired, the energy consumption of the server and the user request can be synchronously acquired, so that the energy consumption of the server and the user request are comprehensively considered when the energy consumption is adjusted, the number of virtual machines required by the user request can be evaluated, the rationality of the energy consumption adjustment in this embodiment can be improved, and the energy consumption of the data center can be reduced as far as possible on the premise of not interfering with the service. Meanwhile, in the embodiment, a certain time difference exists between the user request reaching the data center and the server, so that the first request quantity and the second request quantity are obtained simultaneously, the energy consumption adjustment consideration refinement in the embodiment is improved, the prediction accuracy is improved, and the reliability of target action selection is further improved.
S402: the environmental state is input into a first prediction model, and a target action is selected from a plurality of preset actions by using the first prediction model.
In this embodiment, the environmental state and the current environmental reward may be received by using the first prediction model, so that the first prediction model selects one of the plurality of preset actions as the target action based on the environmental state and the current environmental reward.
For example, the plurality of preset actions may include adding virtual machines mounted by the servers, deleting virtual machines, migrating virtual machines between servers, maintaining a current state, activating physical servers, hibernating physical servers.
S403: and controlling the data center to execute target actions, and evaluating the current environmental rewards based on the energy consumption fluctuation trend.
In this embodiment, in response to the data center performing the target action, the current environmental reward of the data center may be evaluated based on the energy consumption trend of the data center.
Specifically, the current energy consumption of the data center may be measured. And comparing the current energy consumption with the forward energy consumption before the target action is executed. Responsive to the current energy consumption not being higher than the forward energy consumption, assigning a first predictive model forward incentive as a current environmental benefit; and in response to the current energy consumption being higher than the forward energy consumption, giving a negative incentive to the first predictive model as a current environmental benefit.
That is, in this embodiment, by positive excitation and negative excitation with opposite signs, it is convenient for the first prediction model to effectively identify whether the purpose of reducing energy consumption is achieved, simplifying the optimization process, and being beneficial to improving the optimization efficiency of the first prediction model, so as to improve the efficiency of energy consumption adjustment.
Further, if the selected action is to migrate the virtual machine, the distance between the source location and the target location, the network bandwidth, and other information can be increased when the environmental rewards are evaluated, and the calculation formula of the current environmental rewards can be as follows:
1-1
Wherein R represents the current environmental rewards of migrating virtual machines, R 0 Representing the environment obtained by the same environment rewarding algorithm as other preset actionsRewards; dist represents the distance between the source location and the target location; f_band represents network bandwidth.
In this embodiment, the machine migration with larger selection bandwidth and as close as possible can be realized, which is favorable for shortening the task completion time, i.e. is favorable for ensuring that the task is completed in a shorter time, and further improving the energy consumption adjustment efficiency.
S404: hardware state parameters of servers in the data center are obtained.
In the present embodiment, the performance trend of the throughput of the server can be evaluated using the hardware status parameter.
Optionally, the hardware state parameter includes the utilization rate of the central processing unit, the memory, and the fan rotation speed of the server, and the performance variation trend of the throughput of the server can be estimated based on the utilization rate.
Further, the hardware status parameters may also include graphics card utilization, and the like, which are not limited herein.
S405: the prediction server predicts the energy consumption in a future preset time period.
In this embodiment, in response to obtaining the hardware state parameter of the server, the predicted energy consumption may be obtained by predicting the energy consumption of the future preset duration by using the hardware state parameter. The prediction may be performed by a second prediction model.
The preset duration may be consistent with the scheduling period of the energy consumption adjustment, or may be longer than the preset scheduling period, which is not limited herein.
S406: and comparing the predicted energy consumption with the current energy consumption to obtain the energy consumption fluctuation trend.
In this embodiment, the predicted energy consumption is compared with the current energy consumption, and whether the energy consumption of the data center is increased within a preset time length in the future is judged, and an energy consumption fluctuation trend is formed.
Alternatively, the energy consumption trend may be simply increasing or decreasing; or the increased/decreased specific gravity may be predicted in detail, which is not limited herein.
S407: and analyzing both the performance change trend and the energy consumption change trend, and adaptively adjusting the working frequency and the voltage.
In the present embodiment, the performance variation trend may be compared with the energy consumption variation trend.
And in response to the performance change trend being performance decay and the energy consumption change trend being energy consumption increase, reducing the working frequency and the voltage of the server.
In this way, the embodiment can predict the energy consumption of the server by inputting the hardware state parameter into the second prediction model, and adjust the operating frequency and voltage of the server based on the prediction result.
As illustrated in fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a second prediction model of the present application, where the second prediction model may include an input layer, an hidden layer, and an output layer, and the number of hidden layers may be at least one layer. The input layer receives the hardware state parameters, and the output layer outputs predicted energy consumption.
The following exemplifies an iterative method of the first prediction model:
the data center and the first predictive model are initialized.
Specifically, the current state of the data center may be randomly initialized; randomly initializing the value corresponding to each preset action; randomly initializing model parameters of a first prediction model; the experience is emptied and collected. If so, the real situation of the current data center based on the optimization of the current first prediction model can be ensured, and the reliability of the optimization process is improved, so that the first prediction model is favorable for better serving the target action selection, and the reliability of energy consumption adjustment is improved.
And writing the current state of the data center into the state sequence, and carrying out current round iteration on the first prediction model.
Completing a current round of iteration in response to the first predictive model; and judging whether the accumulated iteration turns of the first prediction model reach the preset turns.
In response to the accumulated iteration round not reaching the preset round, performing a new round of round iteration by utilizing the current state of the data center; and finishing iteration of the first prediction model in response to the accumulated iteration turns reaching a preset turn.
In response to the iteration run reaching a preset number of times, update parameters that can be used to update model parameters of the first predictive model are formed using the loss function and model gradient back propagation. By setting reasonable updating time, frequent, poor-effect and relatively ineffective updating is reduced, so that the reasonable utilization of operation resources is facilitated, the consumed energy can be reduced, and the energy consumption of a data center is reduced while the energy consumption of an adjusting process is reduced.
The detailed process of performing the current iteration of the first prediction model may be exemplified as follows:
the probability that each preset action is selected in the current state can be evaluated based on the current state, and one of the preset actions with the highest probability is selected as the iterative action.
And executing iterative actions under the current state of the data center to obtain an updated state and environmental rewards.
The current state, the iterative action, the environmental rewards and the updated state are correlated and stored as samples into experience loop collection.
At least one sample is sampled from the back-inspected collection and the current target value is calculated.
The calculation formula for calculating the current target value is as follows:
1-2
Wherein y is j Representing the target value of the jth sample; r is R j An environmental reward representing a jth sample; gamma represents an attenuation factor; s is S j ' represents the update status of the jth sample; a is that j ' represents the iterative action of the j-th sample; w' represents a network parameter of the first predictive model; q' represents a value score;representing the calculation of the maximum value score achievable by performing each preset action.
The calculation formula of the loss function mentioned in the foregoing is as follows:
1-3
Wherein Loss represents a Loss value; m represents the number of selected samples; sj represents the current state of the jth sample; q (Sj, aj, ω) represents the value score of the jth sample.
The present application is illustrated below by taking a data center as an example.
In one embodiment, the data center may be made up of k physical servers PM (Physical Machine), which may be represented as
VM (Virtual Machine) represents a Virtual Machine mounted on a system in data, and a data center may be composed of q Virtual machines and may be expressed as
R n Representing the number of requests of users received during the interval n of the data center, the number of user requests is assumed to be m, and can be expressed as
PM n Representing the state of the physical server at interval n, which can be expressed as if the internal server experiences lambda states
L n The number of user requests received by the management module of the server at interval n may be represented.
The energy consumption of the server at time t is defined as E t Can be represented by the sum of all virtual machine energies running therein, and can be specifically represented asWherein E is it Representing the power consumption of the i-th virtual machine.
In this embodiment, the agents such as the first prediction model and the second prediction model may learn in the process of interacting with the environment such as the data center, and obtain rewards of environmental feedback, so as to continuously tune own policies, and implement the energy consumption process of the server by using models such as a reinforcement learning model and a deep learning model.
Taking the reinforcement learning model as an example, the element definition may be as follows: the state S of the environment can be determined byA representation representing an overall energy consumption level of a physical machine (i.e., server) such as a server; wherein PM n Representing the state of the physical server at interval n, R n Indicating the number of requests received by the user during the interval n of the data center, L n The number of user requests received by the management module of the server at interval n may be represented.
The individual action a may represent the amount of virtual machine execution action that the control decision module may take in all possible states. In this embodiment, the action space may be divided into 4 states, that is, migrating virtual machines, adding virtual machines, deleting virtual machines, and maintaining the original state virtual machine allocation policy.
Environmental rewards R: the goal of the first predictive model as well as the second predictive model, or the means for adjusting server power consumption, is to adjust the virtual machine configuration to achieve power consumption minimization. Therefore, when the virtual machine is migrated, comprehensive judgment can be performed according to the information such as the distance between the source position and the target position, the network bandwidth and the like, so that the task is guaranteed to finish the design of the rewarding mechanism in a shorter time, and the energy consumption, the distance and the network bandwidth factors of the server are comprehensively considered when the rewarding mechanism is stimulated in the environment.
In this embodiment, an action cost function may be selected to evaluate the action cost. An action cost function can be understood as a state whose value is composed of a combination of rewards of that state and the values of subsequent states in a certain decay ratio. Wherein, the more the state value of the forward moment is close to the current moment, the more the influence of the state value of the forward moment on the current moment is.
The implementation process of this embodiment may be as follows: algorithm input: the method comprises the steps of iteration round number T, environment state S, action set A, attenuation factor gamma, current Z network Q, target Z network Z ', sample number m of batch gradient descent, and target Z network Z' parameter updating frequency C. The output may be a Z network parameter.
And randomly initializing all values Q corresponding to all states and actions, randomly initializing all parameters w of the current Z network, and initializing parameters w+ '=w of the target Z network Z'. The set D of experience playback is emptied.
T iterations are performed on the reinforcement learning model. Wherein the iterative process may be as follows: the initialization environment state S is the first state of the current state sequence.
And using the preprocessed environment state S as input in the Z network to obtain value Q output corresponding to all actions of the Z network. And selecting an action A with the maximum corresponding probability from the current value Q output.
And executing the current action A in the state S to obtain a preprocessed new state S' and environment rewards R.
{ S, A, R, S' } is stored in the experience playback set D.
The environmental state of the new iteration/energy consumption adjustment is updated, i.e. let s=s'.
Sampling m samples from experience playback set DThe current target Q value is calculated, and the calculation formulas may be as in formulas 1 to 3 and formulas 1 to 4 above:
1-3
All parameters w of the Z-network are updated by gradient back-propagation of the neural network using the mean square error loss function. The calculation formula of the loss function may be as follows:
1-4
Identifying the current iteration number i, and updating the target Z network parameter w' =w in response to i%c=1 (i divided by a preset constant C, with remainder being 1).
If the reduction amplitude of the loss function is smaller than the set threshold value, finishing the current iteration, otherwise, turning to the process of using the preprocessed environment state S as input in the Z network to obtain the value Q output corresponding to all actions of the Z network. And selecting an action A with the maximum corresponding probability from the current value Q output.
In summary, the method and the device can save the whole energy consumption of the cluster from the global granularity at the software level, and can dynamically configure the physical machine and the virtual machine resources by adopting a reinforcement learning model (such as reducing the running number of the physical machine and the virtual machine and migrating the running position of the virtual machine). Meanwhile, under the condition that configuration resources do not meet software adjustment conditions, hardware energy consumption of a single server can be optimized from a hardware layer, according to hardware granularity utilization rate information of a CPU, a memory and the like of the single server, the deep learning model is adopted to predict the energy consumption of the single server in a period of time in the future, and the working frequency, the voltage and the like of corresponding parts are adjusted from the granularity of hardware parts, so that the maximum energy utilization of the single server is realized. Therefore, for cloud service clients, the method and the system can reduce the task completion time submitted by users and improve the efficiency under the same conditions; for cloud service operators, the utilization rate of load resources of each component of the system can be balanced, the use loss of service components and the electric energy are reduced, and the operation cost is reduced as a whole.
It should be understood that, although the steps in the flowcharts of fig. 3 to 4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps of fig. 3-4 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or stages are performed necessarily occur in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps or stages of other steps.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an embodiment of a computer device of the present application.
In one embodiment, the computer device may be a terminal, the internal structure of which may be as illustrated in FIG. 6.
The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured 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 computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of regulating server power consumption. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 6 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
s301: acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; the hardware state parameter includes at least one of CPU utilization, memory utilization, and fan rotation speed utilization.
S302: inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions includes changing or maintaining a state of a virtual machine in the server.
S303: and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In an embodiment, the processor when executing the computer program further performs the steps of: s401: the environmental status of the data center is obtained.
In this embodiment, the data center includes at least one server, and each server allows mounting a plurality of virtual machines.
For example, the data center includes a plurality of physical servers, each of which mounts a plurality of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.
Specifically, energy consumption data of the server in a preset period may be acquired.
Alternatively, the resource utilization of the server, the resource capacity of both the server and the virtual machine may be obtained; the resource comprises at least one of a central processing unit, a memory, a network card and a magnetic disk; and taking the resource utilization rate and the resource capacity of the resource utilization rate and the resource capacity as energy consumption data.
Further, the number of user requests received by the data center in the preset period may be obtained as the first request number.
The number of user requests received by the management equipment of the server in a preset period can be obtained and used as a second request number; the management device is used for distributing the received user request to the virtual machine.
In this embodiment, the energy consumption data, the first request number, and the second request number may be used as the environmental status.
That is, in this embodiment, when the environmental state is acquired, the energy consumption of the server and the user request can be synchronously acquired, so that the energy consumption of the server and the user request are comprehensively considered when the energy consumption is adjusted, the number of virtual machines required by the user request can be evaluated, the rationality of the energy consumption adjustment in this embodiment can be improved, and the energy consumption of the data center can be reduced as far as possible on the premise of not interfering with the service. Meanwhile, in the embodiment, a certain time difference exists between the user request reaching the data center and the server, so that the first request quantity and the second request quantity are obtained simultaneously, the energy consumption adjustment consideration refinement in the embodiment is improved, the prediction accuracy is improved, and the reliability of target action selection is further improved.
In an alternative embodiment, the number of user requests of one of the data center and the management device may be obtained, and as the environmental status, a description thereof will be omitted.
S402: the environmental state is input into a first prediction model, and a target action is selected from a plurality of preset actions by using the first prediction model.
In this embodiment, the environmental state and the current environmental reward may be received by using the first prediction model, so that the first prediction model selects one of the plurality of preset actions as the target action based on the environmental state and the current environmental reward.
For example, the plurality of preset actions include adding virtual machines mounted by the servers, deleting virtual machines, migrating virtual machines between servers, maintaining a current state, activating physical servers, and hibernating physical servers.
S403: and controlling the data center to execute target actions, and evaluating the current environmental rewards based on the energy consumption fluctuation trend.
In this embodiment, in response to the data center performing the target action, the current environmental reward of the data center may be evaluated based on the energy consumption trend of the data center.
Specifically, the current energy consumption of the data center may be measured. And comparing the current energy consumption with the forward energy consumption before the target action is executed. Responsive to the current energy consumption not being higher than the forward energy consumption, assigning a first predictive model forward incentive as a current environmental benefit; and in response to the current energy consumption being higher than the forward energy consumption, giving a negative incentive to the first predictive model as a current environmental benefit.
S404: hardware state parameters of servers in the data center are obtained.
In the present embodiment, the performance trend of the throughput of the server can be evaluated using the hardware status parameter.
Optionally, the hardware state parameter includes the utilization rate of the central processing unit, the memory, and the fan rotation speed of the server, and the performance variation trend of the throughput of the server can be estimated based on the utilization rate.
S405: the prediction server predicts the energy consumption in a future preset time period.
S406: and comparing the predicted energy consumption with the current energy consumption to obtain the energy consumption fluctuation trend.
S407: and analyzing both the performance change trend and the energy consumption change trend, and adaptively adjusting the working frequency and the voltage.
In the present embodiment, the performance variation trend may be compared with the energy consumption variation trend.
And in response to the performance change trend being performance decay and the energy consumption change trend being energy consumption increase, reducing the working frequency and the voltage of the server.
In this way, the embodiment can predict the energy consumption of the server by inputting the hardware state parameter into the second prediction model, and adjust the operating frequency and voltage of the server based on the prediction result.
In an embodiment, the iterative method of the first predictive model, when executed by the processor, further implements the steps of: the data center and the first predictive model are initialized.
Specifically, the current state of the data center may be randomly initialized; randomly initializing the value corresponding to each preset action; randomly initializing model parameters of a first prediction model; the experience is emptied and collected.
And writing the current state of the data center into the state sequence, and carrying out current round iteration on the first prediction model.
Completing a current round of iteration in response to the first predictive model; and judging whether the accumulated iteration turns of the first prediction model reach the preset turns.
In response to the accumulated iteration round not reaching the preset round, performing a new round of round iteration by utilizing the current state of the data center; and finishing iteration of the first prediction model in response to the accumulated iteration turns reaching a preset turn.
In response to the iteration rounds reaching the preset times, the loss function and the model gradient back propagation are utilized to form update parameters which can be used for updating the model parameters of the first prediction model, and frequent, poor-effect and relatively ineffective updating is reduced by setting reasonable update time, so that reasonable utilization of operation resources is facilitated, consumed energy can be reduced, and energy consumption of a data center is reduced while energy consumption of an adjusting process is reduced.
The block of the number of times reached by the iteration round may be updated when the number of times threshold is reached, or may be updated in the next iteration after the number of times threshold is reached, which is not limited herein.
The detailed process of performing the current iteration of the first prediction model may be exemplified as follows: the probability that each preset action is selected in the current state can be evaluated based on the current state, and one of the preset actions with the highest probability is selected as the iterative action.
And executing iterative actions under the current state of the data center to obtain an updated state and environmental rewards.
The current state, the iterative action, the environmental rewards and the updated state are correlated and stored as samples into experience loop collection.
At least one sample is sampled from the back-inspected collection and the current target value is calculated.
The calculation formula for calculating the current target value is as follows:
wherein y is j Representing the target value of the jth sample; r is R j An environmental reward representing a jth sample; gamma represents an attenuation factor; s is S j ' represent a more of the jth sampleA new state; a is that j ' represents the iterative action of the j-th sample; w' represents a network parameter of the first predictive model; q' represents a value score;representing the calculation of the maximum value score achievable by performing each preset action.
The calculation formula of the loss function mentioned in the foregoing is as follows:wherein Loss represents a Loss value; m represents the number of selected samples; sj represents the current state of the jth sample; q (Sj, aj, ω) represents the value score of the jth sample.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of: s301: acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; the hardware state parameter includes at least one of CPU utilization, memory utilization, and fan rotation speed utilization.
S302: inputting the environmental state into a first prediction model, selecting a target action from a plurality of preset actions by using the first prediction model, and controlling the data center to execute the target action; wherein the plurality of preset actions includes changing or maintaining a state of a virtual machine in the server.
S303: and inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption.
In an embodiment, the computer program when executed by the processor further performs the steps of: s401: the environmental status of the data center is obtained.
In this embodiment, the data center includes at least one server, and each server allows mounting a plurality of virtual machines.
For example, the data center includes a plurality of physical servers, each of which mounts a plurality of virtual machines; wherein the number of virtual machines allowed to be mounted on each physical server is different.
Specifically, energy consumption data of the server in a preset period may be acquired.
Alternatively, the resource utilization of the server, the resource capacity of both the server and the virtual machine may be obtained; the resource comprises at least one of a central processing unit, a memory, a network card and a magnetic disk. And taking the resource utilization rate and the resource capacity of the resource utilization rate and the resource capacity as energy consumption data.
The resource utilization rate may be further obtained, for example, by obtaining a display card utilization rate, which is not limited herein.
Further, the number of user requests received by the data center in the preset period may be obtained as the first request number.
The number of user requests received by the management equipment of the server in a preset period can be obtained and used as a second request number; the management device is used for distributing the received user request to the virtual machine.
In this embodiment, the energy consumption data, the first request number, and the second request number may be used as the environmental status.
S402: the environmental state is input into a first prediction model, and a target action is selected from a plurality of preset actions by using the first prediction model.
In this embodiment, the environmental state and the current environmental reward may be received by using the first prediction model, so that the first prediction model selects one of the plurality of preset actions as the target action based on the environmental state and the current environmental reward.
For example, the plurality of preset actions include adding virtual machines mounted by the servers, deleting virtual machines, migrating virtual machines between servers, maintaining a current state, activating physical servers, and hibernating physical servers.
S403: and controlling the data center to execute target actions, and evaluating the current environmental rewards based on the energy consumption fluctuation trend.
In this embodiment, in response to the data center performing the target action, the current environmental reward of the data center may be evaluated based on the energy consumption trend of the data center. If so, the environment rewards are used for facilitating the first prediction model to determine whether the currently selected target action is applicable or not, facilitating the first prediction model to dynamically adjust the selected strategy based on the current environment rewards, and optimizing the first prediction model.
Specifically, the current energy consumption of the data center may be measured. And comparing the current energy consumption with the forward energy consumption before the target action is executed. Responsive to the current energy consumption not being higher than the forward energy consumption, assigning a first predictive model forward incentive as a current environmental benefit; and in response to the current energy consumption being higher than the forward energy consumption, giving a negative incentive to the first predictive model as a current environmental benefit. Through positive excitation and negative excitation with opposite signs, the first prediction model is convenient to effectively identify whether the purpose of reducing energy consumption is achieved, the optimization process is simplified, the optimization efficiency of the first prediction model is improved, and the energy consumption adjusting efficiency is improved.
S404: hardware state parameters of servers in the data center are obtained.
In the present embodiment, the performance trend of the throughput of the server can be evaluated using the hardware status parameter.
Optionally, the hardware state parameter includes the utilization rate of the central processing unit, the memory, and the fan rotation speed of the server, and the performance variation trend of the throughput of the server can be estimated based on the utilization rate.
Further, the hardware status parameters may also include graphics card utilization, and the like, which are not limited herein.
S405: the prediction server predicts the energy consumption in a future preset time period.
In this embodiment, in response to obtaining the hardware state parameter of the server, the predicted energy consumption may be obtained by predicting the energy consumption of the future preset duration by using the hardware state parameter. The prediction may be performed by a second prediction model.
The preset duration may be consistent with the scheduling period of the energy consumption adjustment, or may be longer than the preset scheduling period, which is not limited herein.
S406: and comparing the predicted energy consumption with the current energy consumption to obtain the energy consumption fluctuation trend.
In this embodiment, the predicted energy consumption is compared with the current energy consumption, and whether the energy consumption of the data center is increased within a preset time length in the future is judged, and an energy consumption fluctuation trend is formed.
Alternatively, the energy consumption trend may be simply increasing or decreasing; or the increased/decreased specific gravity may be predicted in detail, which is not limited herein.
S407: and analyzing both the performance change trend and the energy consumption change trend, and adaptively adjusting the working frequency and the voltage.
In the present embodiment, the performance variation trend may be compared with the energy consumption variation trend.
And in response to the performance change trend being performance decay and the energy consumption change trend being energy consumption increase, reducing the working frequency and the voltage of the server.
In this way, the embodiment can predict the energy consumption of the server by inputting the hardware state parameter into the second prediction model, and adjust the operating frequency and voltage of the server based on the prediction result.
In an embodiment, the iterative method of the first predictive model, when executed by the processor, further performs the steps of: the data center and the first predictive model are initialized.
Specifically, the current state of the data center may be randomly initialized; randomly initializing the value corresponding to each preset action; randomly initializing model parameters of a first prediction model; the experience is emptied and collected.
And writing the current state of the data center into the state sequence, and carrying out current round iteration on the first prediction model.
Completing a current round of iteration in response to the first predictive model; and judging whether the accumulated iteration turns of the first prediction model reach the preset turns.
In response to the accumulated iteration round not reaching the preset round, performing a new round of round iteration by utilizing the current state of the data center; and finishing iteration of the first prediction model in response to the accumulated iteration turns reaching a preset turn.
In response to the iteration run reaching a preset number of times, update parameters that can be used to update model parameters of the first predictive model are formed using the loss function and model gradient back propagation.
The detailed process of performing the current iteration of the first prediction model may be exemplified as follows:
the probability that each preset action is selected in the current state can be evaluated based on the current state, and one of the preset actions with the highest probability is selected as the iterative action.
And executing iterative actions under the current state of the data center to obtain an updated state and environmental rewards.
The current state, the iterative action, the environmental rewards and the updated state are correlated and stored as samples into experience loop collection.
At least one sample is sampled from the back-inspected collection and the current target value is calculated.
The calculation formula for calculating the current target value is as follows:wherein y is j Representing the target value of the jth sample; r is R j An environmental reward representing a jth sample; gamma represents an attenuation factor; s is S j ' represents the update status of the jth sample; a is that j ' represents the iterative action of the j-th sample; w' represents a network parameter of the first predictive model; q' represents a value score; />Representing the calculation of the maximum value score achievable by performing each preset action.
The calculation formula of the loss function mentioned in the foregoing is as follows:wherein Loss represents a Loss value; m represents the number of selected samples; sj represents the current state of the jth sample; q (Sj, aj, ω) represents the value score of the jth sample.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile 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 a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples represent only a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (15)

1. A method for regulating energy consumption of a server, the method comprising:
acquiring an environmental state of a data center, and acquiring hardware state parameters of a server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization;
inputting the environmental state into a first prediction model, and selecting a target action from a plurality of preset actions by using the first prediction model to control the data center to execute the target action; wherein the plurality of preset actions include changing or maintaining a state of a virtual machine in the server;
Inputting the hardware state parameters into a second prediction model, predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption;
the environmental status identifies a current software status of the data center.
2. The method for adjusting energy consumption of servers according to claim 1, wherein the data center comprises at least one server, and each server allows a plurality of virtual machines to be mounted;
the acquiring the environmental state of the data center comprises the following steps:
acquiring energy consumption data of the server in a preset period;
acquiring the number of user requests received by the data center in the preset period as a first request number;
acquiring the number of user requests received by the management equipment of the server in the preset period as a second request number; the management device is used for distributing the received user request to the virtual machine;
and taking the energy consumption data, the first request quantity and the second request quantity as the environment state.
3. The method for adjusting energy consumption of a server according to claim 2, wherein the obtaining the energy consumption data of the server in a preset period includes:
Acquiring the resource utilization rate of the server, and the resource capacities of the server and the virtual machine; the resource comprises at least one of a central processing unit, a memory, a network card and a magnetic disk;
and taking the resource utilization rate and the resource capacity of the two as the energy consumption data.
4. The method for adjusting energy consumption of a server according to claim 1, wherein selecting a target action from a plurality of preset actions by using the first prediction model comprises:
receiving the environmental state and the current environmental rewards by using the first prediction model, and enabling the first prediction model to select one of the plurality of preset actions as the target action based on the environmental state and the current environmental rewards;
the control of the data center to execute the target action further comprises:
and in response to the data center executing the target action, evaluating the current environmental rewards of the data center based on the energy consumption fluctuation trend of the data center.
5. The method for regulating energy consumption of a server according to claim 4, wherein the evaluating environmental rewards of the data center based on the energy consumption variation trend of the data center comprises:
Measuring and calculating the current energy consumption of the data center;
comparing the current energy consumption with forward energy consumption before the target action is executed;
responsive to the current energy consumption not being higher than the forward energy consumption, assigning the first predictive model forward incentive as the current environmental reward; and in response to the current energy consumption being higher than the forward energy consumption, assigning a negative incentive to the first predictive model as the current environmental benefit.
6. The method for adjusting energy consumption of a server according to claim 1, wherein the iterative method of the first prediction model comprises:
initializing the data center and the first prediction model;
writing the current state of the data center into a state sequence, and carrying out current round iteration on the first prediction model; completing the current round of iterations in response to the first predictive model; judging whether the accumulated iteration turns of the first prediction model reach a preset turn or not;
responding to the accumulated iteration round not reaching the preset round, and performing a new round of round iteration by utilizing the current state of the data center; responding to the accumulated iteration round reaching the preset round, and completing iteration of the first prediction model;
In response to the iteration run reaching a preset number of times, update parameters usable to update model parameters of the first predictive model are formed using a loss function and model gradient back propagation.
7. The method of claim 6, wherein performing a current round of iteration on the first predictive model comprises:
evaluating the probability that each preset action is selected in the current state based on the current state, and selecting one with the largest probability in the preset actions as an iterative action;
executing the iterative action under the current state of the data center to obtain an updated state and environmental rewards;
correlating the current state, the iterative action, the environmental rewards and the updated state, and storing the correlated current state, the iterative action, the environmental rewards and the updated state as samples for experience back collection;
at least one of the samples is collected and sampled back from the experience, and a current target value is calculated.
8. The method for adjusting energy consumption of a server according to claim 7, wherein the calculation formula for calculating the current target value is as follows:wherein y is j Representing the target value of the jth sample; r is R j An environmental reward representing a jth sample; gamma represents an attenuation factor; s is S j ' represents the update status of the jth sample; a is that j ' represents the iterative action of the j-th sample; w' represents a network parameter of the first predictive model; q' represents a value score;representing calculating a maximum value score which can be realized by executing each preset action;
and/or, the calculation formula of the loss function is as follows:wherein Loss represents a Loss value; m represents the number of selected samples; sj represents the current state of the jth sample; q (Sj, aj, ω) represents the value score of the jth sample.
9. The method of claim 7, wherein initializing the data center and the first predictive model comprises:
randomly initializing the current state of the data center;
randomly initializing the value corresponding to each preset action;
randomly initializing model parameters of the first prediction model;
the experience is emptied and collected.
10. The method for regulating server energy consumption according to claim 1, wherein the first predictive model comprises a probabilistic sub-model;
the selecting a target action from a plurality of preset actions by using the first prediction model comprises:
acquiring the probability of selecting each preset action as the target action;
And selecting a preset action corresponding to the maximum value in the probability as the target action.
11. The method for regulating power consumption of a server according to claim 1,
the data center comprises a plurality of physical servers, and each physical server is respectively provided with a plurality of virtual machines; the number of virtual machines allowed to be mounted on each physical server is different;
the plurality of preset actions include adding virtual machines mounted by the servers, deleting the virtual machines, migrating the virtual machines among the servers, maintaining a current state, activating the physical servers, and hibernating the physical servers.
12. The method for adjusting energy consumption of a server according to claim 1, wherein the hardware state parameter includes utilization rates of a central processor, a memory, and a fan rotation speed of the server;
the predicting the energy consumption of the server hardware by using the second prediction model, and adjusting the working frequency and the voltage of the server based on the predicted energy consumption includes:
evaluating a performance change trend of throughput of the server based on the utilization;
predicting the predicted energy consumption of the server in a future preset time length;
Comparing the predicted energy consumption with the current energy consumption to obtain an energy consumption fluctuation trend;
and comparing the performance change trend with the energy consumption change trend, and reducing the working frequency and the voltage of the server in response to the performance change trend being performance decay and the energy consumption change trend being energy consumption increase.
13. A device for adjusting energy consumption of a server, wherein the device for adjusting energy consumption of a server comprises:
the data acquisition module is used for acquiring the environmental state of the data center and acquiring the hardware state parameters of the server in the data center; wherein the hardware state parameter comprises at least one of CPU utilization, memory utilization, and fan rotation speed utilization;
the first prediction model is used for inputting the environment state and selecting a target action from a plurality of preset actions; wherein the plurality of preset actions include changing or maintaining a state of a virtual machine in the server;
the second prediction model is used for inputting the hardware state parameters and predicting the energy consumption of the server hardware;
the management module is used for controlling the data center to execute the target action and adjusting the working frequency and the voltage of the server based on the predicted energy consumption;
The environmental status identifies a current software status of the data center.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method for regulating the energy consumption of a server according to any one of claims 1 to 12 when the computer program is executed by the processor.
15. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method for regulating the energy consumption of a server according to any one of claims 1 to 12.
CN202311831949.1A 2023-12-28 2023-12-28 Method and device for adjusting energy consumption of server, computer equipment and storage medium Active CN117472167B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311831949.1A CN117472167B (en) 2023-12-28 2023-12-28 Method and device for adjusting energy consumption of server, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311831949.1A CN117472167B (en) 2023-12-28 2023-12-28 Method and device for adjusting energy consumption of server, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117472167A CN117472167A (en) 2024-01-30
CN117472167B true CN117472167B (en) 2024-03-22

Family

ID=89640173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311831949.1A Active CN117472167B (en) 2023-12-28 2023-12-28 Method and device for adjusting energy consumption of server, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117472167B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800066A (en) * 2018-12-13 2019-05-24 中国科学院信息工程研究所 A kind of data center's energy-saving scheduling method and system
CN112966431A (en) * 2021-02-04 2021-06-15 西安交通大学 Data center energy consumption joint optimization method, system, medium and equipment
CN116795198A (en) * 2023-07-05 2023-09-22 国家电网有限公司信息通信分公司 Energy consumption optimization method and device for data center and storage medium
CN116954866A (en) * 2023-08-10 2023-10-27 曲阜师范大学 Edge cloud task scheduling method and system based on deep reinforcement learning
CN117215789A (en) * 2023-09-18 2023-12-12 中国工商银行股份有限公司 Resource allocation method and device for data processing task and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109800066A (en) * 2018-12-13 2019-05-24 中国科学院信息工程研究所 A kind of data center's energy-saving scheduling method and system
CN112966431A (en) * 2021-02-04 2021-06-15 西安交通大学 Data center energy consumption joint optimization method, system, medium and equipment
CN116795198A (en) * 2023-07-05 2023-09-22 国家电网有限公司信息通信分公司 Energy consumption optimization method and device for data center and storage medium
CN116954866A (en) * 2023-08-10 2023-10-27 曲阜师范大学 Edge cloud task scheduling method and system based on deep reinforcement learning
CN117215789A (en) * 2023-09-18 2023-12-12 中国工商银行股份有限公司 Resource allocation method and device for data processing task and computer equipment

Also Published As

Publication number Publication date
CN117472167A (en) 2024-01-30

Similar Documents

Publication Publication Date Title
Tang et al. Migration modeling and learning algorithms for containers in fog computing
Tuli et al. COSCO: Container orchestration using co-simulation and gradient based optimization for fog computing environments
CN110869909B (en) System and method for applying machine learning algorithms to calculate health scores for workload scheduling
US10929165B2 (en) System and method for memory resizing in a virtual computing environment
CN109324875B (en) Data center server power consumption management and optimization method based on reinforcement learning
US8533719B2 (en) Cache-aware thread scheduling in multi-threaded systems
Deng et al. Reliability‐aware server consolidation for balancing energy‐lifetime tradeoff in virtualized cloud datacenters
Sampaio et al. Towards high-available and energy-efficient virtual computing environments in the cloud
Li An adaptive overload threshold selection process using Markov decision processes of virtual machine in cloud data center
Mostafavi et al. A stochastic approximation approach for foresighted task scheduling in cloud computing
Bird et al. {PACORA}: Performance Aware Convex Optimization for Resource Allocation
CN111290831B (en) Virtual machine migration method based on reinforcement learning of cloud computing
CN108769253A (en) A kind of adaptive prefetching control method of distributed system access performance optimization
KR102118799B1 (en) Apparatus and Method for managing power of processor in a mobile terminal device
Niknia et al. An SMDP-based approach to thermal-aware task scheduling in NoC-based MPSoC platforms
CN117472167B (en) Method and device for adjusting energy consumption of server, computer equipment and storage medium
Cheng et al. Self-tuning batching with dvfs for improving performance and energy efficiency in servers
Jiang et al. Effective data management strategy and RDD weight cache replacement strategy in Spark
Ki et al. Co-optimizing CPU voltage, memory placement, and task offloading for energy-efficient mobile systems
CN114466014B (en) Service scheduling method and device, electronic equipment and storage medium
Kumar et al. EAEFA: An Efficient Energy-Aware Task Scheduling in Cloud Environment
Garg et al. Resource optimization using predictive virtual machine consolidation approach in cloud environment
US10417050B2 (en) Apparatus and method to control calculation resources of an information processing device based on predictive values of reference data
KR20220026110A (en) Method, appratus and system for managing energy in self-powered network
Naeen Cost reduction using SLA-aware genetic algorithm for consolidation of virtual machines in cloud data centers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant