Disclosure of Invention
The invention provides an energy consumption capping adjusting method and device, which are used for distributing different power capping values according to different equipment requirements so as to improve the utilization rate of electric energy.
The invention provides a method for adjusting energy consumption capping, which comprises the following steps:
acquiring the load state of each device in the group;
sorting each device in the group according to the load state of each device in the group and the service priority of the service which is running by each device in the group;
and acquiring the power capping value of each device in the group according to the sequence of each device in the group.
With reference to the first aspect, in a first possible implementation manner, before the obtaining the load state of each device in the group, the method further includes:
acquiring a power capping initial value of each device in the group;
and acquiring the effective range of power capping adjustment of each device in the group.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the power capping initial value of each device in the group is obtained by the following formula:
wherein, the PxiFor the initial value of the power capping for each device in the group, the CPUxiAverage CPU utilization for the ith device in the group, theThe average utilization rate of n devices in the group is the sum, and G is the initial value of group power capping;
the effective range of power capping adjustment comprises:
the power capping value for each device in the group is greater than or equal to the minimum effective power consumption value for each device in the group, and the power capping value for each device in the group is less than or equal to the maximum effective power consumption value for each device in the group.
With reference to the first aspect or the foregoing various possible implementation manners of the first aspect, in a third possible implementation manner, the acquiring a load state of each device in the group includes:
acquiring the average CPU utilization rate of each device in the group according to historical data;
the sorting each device in the group according to the load status of each device in the group and the service priority of the service being operated by each device in the group comprises:
obtaining an average of the average CPU utilization for all devices in the group by:
wherein, theIs the average of the average CPU utilization of all devices in the group,the sum of the average CPU utilization rates of all the devices in the group is obtained, and n is the number of all the devices in the group;
dividing all the devices in the group into a first subgroup or a second subgroup respectively, wherein the average CPU utilization rate of each device in the first subgroup is greater than or equal to that of each device in the first subgroupThe average CPU utilization of each device of the second subset is less than the average CPU utilization of each device of the second subset
According to the service priority of the service which is running by each device in the first subgroup, sequencing each device in the first subgroup from high to low, if the service priorities of the services which are running by at least two devices in the first subgroup are the same, sequencing at least two devices in the first subgroup from high to low according to the average utilization rate of CPUs of at least two devices in the first subgroup;
according to the service priority of the service which is running by each device in the second subgroup, sequencing each device in the second subgroup from low to high, if the service priorities of the services which are running by at least two devices in the second subgroup are the same, sequencing at least two devices in the second subgroup from low to high according to the average CPU utilization rate of at least two devices in the second subgroup;
the power capping increase value of the first subset ith device or the power capping decrease value of the second subset ith device is obtained by the following formula:
wherein, DeltaiIncreasing a power capping value for the first subset ith device or decreasing a power capping value for the second subset ith device, the Pi BLast set power capping value for the second subset, theAverage CPU utilization for the ith device of the second subset;
the theoretical value of power capping for the ith device of the first subset is obtained by the following equation:
Ai=Pi A+Δi
wherein, A isiCapping theoretical values for power of the ith device of the first subset;
the theoretical value of power capping for the ith device of the second subset is obtained by the following formula:
Bi=Pi B-Δi
wherein, B isiPower capping for the ith device of the second subsetTheoretical value;
the power capping value for the first subset ith device is obtained by the following equation:
wherein said newPi AFor the power capping value of the first subgroup ith device, the Pi AFor the last power capping value of the ith device of the first subset, the Pi BFor the last power capping value of the second subset ith device, theFor a minimum effective power consumption value of the ith device of the second subset, theFor the maximum effective power consumption value of the ith device of the second subsetFor a minimum effective power consumption value of the first subgroup i devices, saidA maximum effective power consumption value for the ith device of the first subset;
the power capping value for the second subset ith device is obtained by the following equation:
wherein, theCapping the power of the second subset ith device.
The second aspect of the present invention provides an energy consumption capping adjustment apparatus, comprising:
the acquisition module is used for acquiring the load state of each device in the group;
the sequencing module is used for sequencing each device in the group according to the load state of each device in the group and the service priority of the service which is running by each device in the group;
the obtaining module is further configured to obtain a power capping value of each device in the group according to the ranking of each device in the group.
With reference to the second aspect, in a first possible implementation manner, the obtaining module is further configured to obtain a power capping initial value of each device in the group before the obtaining module obtains the load state of each device in the group;
the obtaining module is further configured to obtain a power capping adjustment effective range of each device in the group.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the power capping initial value of each device in the group is obtained by the following formula:
wherein, the PxiFor the initial value of the power capping for each device in the group, the CPUxiAverage CPU utilization for the ith device in the group, theThe average utilization rate of n devices in the group is the sum, and G is the initial value of group power capping;
the effective range of power capping adjustment comprises:
the power capping value for each device in the group is greater than or equal to the minimum effective power consumption value for each device in the group, and the power capping value for each device in the group is less than or equal to the maximum effective power consumption value for each device in the group.
With reference to the second aspect or the foregoing various possible implementation manners of the second aspect, in a third possible implementation manner, the obtaining module is specifically configured to obtain, according to historical data, an average utilization rate of a CPU of each device in the group;
the obtaining module is specifically configured to obtain an average value of the average CPU utilization rates of all the devices in the group by using the following formula:
wherein, theIs the average of the average CPU utilization of all devices in the group,the sum of the average CPU utilization rates of all the devices in the group is obtained, and n is the number of all the devices in the group;
the sorting module is specifically configured to divide all the devices in the group into a first sub-group or a second sub-group, where an average CPU utilization of each device in the first sub-group is greater than or equal to that of the first sub-groupThe average CPU utilization of each device of the second subset is less than the average CPU utilization of each device of the second subset
The sorting module is specifically configured to sort each device of the first subset from high to low according to the service priority of the service being operated by each device of the first subset, and if the service priorities of the services being operated by at least two devices of the first subset are the same, sort the at least two devices of the first subset from high to low according to the average utilization rate of the CPUs of the at least two devices of the first subset;
the sorting module is specifically configured to sort, from low to high, each device of the second subset according to the service priority of the service being operated by each device of the second subset, and if the service priorities of the services being operated by at least two devices of the second subset are the same, sort, from low to high, at least two devices of the second subset according to the average utilization rate of the CPUs of the at least two devices of the second subset;
the obtaining module is specifically configured to obtain a power capping increase value of the first subset of ith devices or a power capping decrease value of the second subset of ith devices according to the following formula:
wherein, DeltaiIncreasing a power capping value for the first subset ith device or decreasing a power capping value for the second subset ith device, the Pi BLast set power capping value for the second subset, theAverage CPU utilization for the ith device of the second subset;
the obtaining module is specifically configured to obtain a theoretical power capping value of the ith device of the first subset by using the following formula:
Ai=Pi A+Δi
wherein, A isiCapping theoretical values for power of the ith device of the first subset;
the obtaining module is specifically configured to obtain a theoretical power capping value of the ith device in the second subset according to the following formula:
Bi=Pi B-Δi
wherein, B isiCapping theoretical values for power of the ith device of the second subset;
the obtaining module is specifically configured to obtain a power capping value of the ith device of the first subset by using the following formula:
wherein said newPi AFor the power capping value of the first subgroup ith device, the Pi AFor the last power capping value of the ith device of the first subset, the Pi BFor the last power capping value of the second subset ith device, theFor a minimum effective power consumption value of the ith device of the second subset, theFor the maximum effective power consumption value of the ith device of the second subsetFor a minimum effective power consumption value of the first subgroup i devices, saidFor the ith of the first subgroupThe maximum effective power consumption value of the device;
the obtaining module is specifically configured to obtain a power capping value of the ith device of the second subset by using the following formula:
wherein, theCapping the power of the second subset ith device.
The method and apparatus for adjusting energy consumption capping according to this embodiment rank, by obtaining the load state of each device in the group, each device in the group according to the load state of each device in the group and the service priority of the service being operated by each device in the group, and obtain the power capping value of each device in the group according to the ranking of each device in the group. Different power capping values are distributed to different equipment according to different load states of each equipment and the importance of the service operated by each equipment, so that the utilization rate of electric energy is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of an energy consumption capping adjustment method provided in this embodiment, and as shown in fig. 1, the method includes the following steps:
and step 100, acquiring the load state of each device in the group.
Step 101, sorting each device in the group according to the load state of each device in the group and the service priority of the service being operated by each device in the group.
And 102, acquiring a power capping value of each device in the group according to the sequence of each device in the group.
In the method for adjusting energy consumption capping provided in this embodiment, the load state of each device in the group is obtained, then each device in the group is sorted according to the load state of each device in the group and the service priority of the service being operated by each device in the group, and the power capping value of each device in the group is obtained according to the sorting of each device in the group. Different power capping values are distributed to different equipment according to different load states of each equipment and the importance of the service operated by each equipment, so that the utilization rate of electric energy is improved.
Further, before step 100 in fig. 1, the method further includes:
and 103, acquiring a power capping initial value of each device in the group.
And 104, acquiring the effective range of power capping adjustment of each device in the group.
Specifically, the effective range of power capping adjustment includes: the power capping value for each device within the group is greater than or equal to the minimum effective power consumption value for each of the devices within the group, and the power capping value for each device within the group is less than or equal to the maximum effective power consumption value for each device within the group.
It should be noted that the power capping value finally allocated to each device should not exceed the effective range of power capping adjustment of each device in the group, and the application of the effective range of power capping adjustment of each device in the group will be described in detail in the following embodiments, which are not described herein again.
Preferably, the initial value of the power capping for each device in the group in step 103 is obtained by the following formula (1):
wherein, PxiFor initial values of power capping for each device in the group, CPUxiThe average CPU utilization for the ith device in the group,is the sum of the average utilization of n devices in the group, and G is the initial value of group power capping.
Preferably, one possible implementation manner of step 100 in fig. 1 is:
step 100a, obtaining the average CPU utilization rate of each device in the group according to the historical dataxi;
The historical data can be obtained by obtaining the CPU utilization rate of each device in a period of time and obtaining the average CPU utilization rate of each device in the period of time according to the CPU utilization ratesxi. The period of time is a period of time prior to the time at which the power capping value is assigned to each device.
Preferably, one possible implementation manner of step 102 in fig. 1 is:
step 102a, obtaining the average value of the CPU average utilization rate of all the devices in the group through the following formula (2)
Wherein,is the average of the average CPU utilization for all devices in the group,the sum of the average utilization rates of the CPUs of all the devices in the group, and n is the number of all the devices in the group.
102b, dividing all the devices in the group into a first subgroup or a second subgroup respectively, wherein the average CPU utilization rate of each device in the first subgroup is greater than or equal toThe average CPU utilization of each device of the second subset is less than
And 102c, sequencing each device in the first subgroup from high to low according to the service priority of the service which is running by each device in the first subgroup, and if the service priorities of the services which are running by at least two devices in the first subgroup are the same, sequencing at least two devices in the first subgroup from high to low according to the CPU utilization rate of at least two devices in the first subgroup.
And 102d, sequencing each device in the second subgroup from low to high according to the service priority of the service running by each device in the second subgroup, and if the service priorities of the services running by at least two devices in the second subgroup are the same, sequencing at least two devices in the second subgroup from low to high according to the average utilization rate of the CPUs of at least two devices in the second subgroup.
Step 102e, the power capping increase value of the first subset ith device or the power capping decrease value of the second subset ith device is obtained by the following formula (3):
wherein, DeltaiIncreasing value for power capping of the ith device of the first subset or decreasing value for power capping of the ith device of the second subset, Pi BFor the last set power capping value of the second subgroup, CPUi BThe average CPU utilization rate of the ith device in the second subgroup;
the theoretical value of power capping for the ith device of the first subset is obtained by equation (4) below:
Ai=Pi A+Δi(4);
wherein A isiCapping the theoretical value for the power of the ith device of the first subset;
the theoretical value of power capping for the ith device of the second subset is obtained by equation (5) below:
Bi=Pi B-Δi(5);
wherein, BiCapping the theoretical value for the power of the ith device of the second subset;
further, after obtaining the theoretical power capping value of the ith device in the first subgroup and the theoretical power capping value of the ith device in the second subgroup, it is necessary to ensure that the two theoretical power capping values satisfy the effective power capping adjustment ranges of the ith device in the first subgroup and the ith device in the second subgroup, so as to obtain the final power capping value of the ith device in the first subgroup and the final power capping value of the ith device in the second subgroup.
Specifically, the theoretical value B of power capping when the ith device of the second subgroup isiWhen the minimum effective power consumption value of the ith device in the second subgroup is smaller than the minimum effective power consumption value of the ith device in the second subgroup, the power capping value of the ith device in the first subgroup is obtained by the following formula (6):
or when the power of the ith device in the first subgroup is capped at theoretical value AiTheoretical value of power capping B with the ith device of the second subgroupiWhen the power capping adjustment effective range is not exceeded, the power capping value of the ith device in the first subgroup is obtained by the following formula (7):
or when the power of the ith device in the first subgroup is capped at theoretical value AiGreater than the maximum effective power consumption value P of the ith device of the first subgroupAi maxThen, the power capping value of the ith device of the first sub-group at this time is obtained by the following equation (8):
wherein newPi AFor the power capping value, P, of the ith device of the first subgroupi AFor the last power capping value, P, of the ith device of the first subseti BIs the second sonThe last power capping value for the group ith device,is the minimum effective power consumption value of the ith device of the second subset,for the maximum effective power consumption value of the second subset ith device,is the minimum effective power consumption value of the first sub-group of the ith device,is the maximum effective power consumption value of the ith device of the first subset.
Similarly, when the power of the ith device of the second subset is capped at the theoretical value BiWhen the minimum effective power consumption value of the ith device in the second subgroup is smaller than the minimum effective power consumption value of the ith device in the second subgroup, the power capping value of the ith device in the second subgroup is obtained by the following formula (9):
or when the power of the ith device in the first subgroup is capped at theoretical value AiTheoretical value of power capping B with the ith device of the second subgroupiWhen the power capping adjustment effective range is not exceeded, the power capping value of the ith device in the second subgroup is obtained through the following formula:
or when the power of the ith device in the first subgroup is capped at theoretical value AiGreater than the maximum effective power consumption value P of the ith device of the first subgroupAi maxThen, the power capping value of the ith device of the second subset at this time is determined by the following equation (10)Obtaining:
wherein,the power capping value for the second subset ith device.
The energy consumption capping adjustment method is described below by a specific example: if a rack has 5 servers, the maximum power consumption of the rack is 1500W (the power capping value of the rack is 1500W, see the above formula (1), G is 1500W), and the power capping value dynamic adjustment period T is 10 min; and taking the CPU utilization rate data of the previous hour to estimate the device power capping value. Initially, the average CPU utilization for the previous hour is obtained as shown in Table 1. (the smaller the traffic priority value, the higher the priority)
Table 1 initial, intra-group server load and traffic priority conditions
Step 200, according to table 1, the average utilization rate of the CPU obtains the initial power capping value of each device, such as the power capping value of device 1: 1500 × (0.32/(0.32+0.53+0.37+0.41+0.68)) ═ 208 w; other devices similarly obtain, and each device initial power capping value device is as in table 2.
TABLE 2 initial capping values for in-group device power
Step 201, obtaining a power capping adjustment effective range:
for each device in the group, the average power consumption value when the CPU utilization rate is 1% -5% is taken as the minimum effective power consumption value, and 110% of the power consumption when the CPU utilization rate is 100% is taken as the maximum effective power consumption value of each device in the group. The results obtained are shown in Table 3.
TABLE 3 effective range of power capping adjustment
Every adjustment period comes (i.e. every T ═ 10min), the power capping value is re-estimated according to step 1) -step 5 in the algorithm described above). If 10min after initialization.
Step 202, obtain the average utilization of the CPU for each device in the group one hour before, as shown in table 4.
TABLE 4 average CPU utilization and priority of running services
Step 203, obtaining the average value of the average utilization rate of the CPUs of all the devices in the groupIs 0.418.
Step 204, dividing the CPU with the average utilization rate more than 0.418 into a first sub-group A, and dividing the rest equipment into a second sub-group B; i.e. the devices 2, 3 belong to a first subgroup a and the devices 1, 4, 5 belong to a second subgroup B. The equipment in the first subgroup A is ranked from high to low according to the priority of the current operation service, and then the equipment with the same priority is ranked from high to low according to the average utilization rate of the CPU; namely the device sequence in the first subgroup A after sorting: 2. 3. The equipment in the second subgroup B is sorted from low to high according to the service priority, and then the equipment with the same service priority is sorted from low to high according to the CPU utilization rate; the equipment sequence after the second subgroup B is: 4. 5 and 1.
Step 204, estimating the power capping value of the equipment from the new estimation:
adding the power value clipped by device 4 to device 2 and the power value clipped by device 5 to device 3 (device 1 does not adjust the power capping value this time since there are no other devices in the first subgroup a); namely, the power capping values of the devices 2 to 5 are reset as follows:
new power capping value for device 2: 344+266 (0.418-0.27) 383, since 383 is greater than the maximum active power consumption value of the device (see table 3, the maximum active power consumption value of this device 2 is 380); therefore, the power capping value of the current adjusting device 2 is 380; new power capping value for device 4: 266- (380) 344) 230;
new power capping value for device 3: 240+442 (0.418-0.33) 279 (within the power capping adjustment effective range); new power capping value for device 5: 442-. Therefore, after this adjustment, the power capping values for each device in the group are shown in Table 5.
TABLE 5 adjusted Power capping values
In the above embodiment of the present invention, by considering the priority condition of the currently running service of the device, the device currently running the high-priority service can properly allocate a plurality of electric energy; the method not only carries out power capping on the equipment in the group, but also can avoid influencing important services as much as possible. Moreover, the load condition of the equipment is further considered, so that the power distribution can be more reasonable.
Fig. 2 is a schematic structural diagram of an energy consumption capping adjustment apparatus according to an embodiment of the present invention, and it should be noted that the apparatus is disposed on a server or in a chassis with energy consumption adjustment requirements. Referring to fig. 2, the apparatus includes: the device comprises an acquisition module 10 and a sorting module 11.
An obtaining module 10, configured to obtain a load state of each device in the group;
the sorting module 11 is configured to sort each device in the group according to a load state of each device in the group and a service priority of a service being operated by each device in the group;
the obtaining module 10 is further configured to obtain a power capping value of each device in the group according to the ranking of each device in the group.
In the method for adjusting energy consumption capping provided in this embodiment, the load state of each device in the group is determined by the obtaining module, the sorting module sorts each device in the group according to the load state of each device in the group and the service priority of the service being operated by each device in the group, the obtaining module sorts each device in the group according to the priority of each device in the group, and the obtaining module calculates the power capping value of each device in the group. Different power capping values are distributed to different equipment according to different load states of each equipment and the importance of the service operated by each equipment, so that the utilization rate of electric energy is improved.
Further, the obtaining module 10 is further configured to obtain a power capping initial value of each device in the group before the obtaining module 10 obtains the load state of each device in the group;
the obtaining module 10 is further configured to obtain a power capping adjustment effective range of each device in the group.
Further, the initial value of the power capping for each device in the group is obtained by the following formula:
wherein, PxiFor initial values of power capping for each device in the group, CPUxiThe average CPU utilization for the ith device in the group,is the sum of the average utilization of n devices in the group, and G is the initial value of group power capping.
The effective range of power capping adjustment comprises:
the power capping value for each device within the group is greater than or equal to the minimum effective power consumption value for each device within the group, and the power capping value for each device within the group is less than or equal to the maximum effective power consumption value for each device within the group.
Preferably, the obtaining module 10 is specifically configured to obtain, according to the historical data, the average CPU utilization of each device in the groupxi;
The obtaining module 10 is further configured to obtain an average value of the average CPU utilization of all the devices in the group according to the following formula:
wherein,is the average of the average CPU utilization for all devices in the group,the sum of the average CPU utilization rates of all the devices in the group, and n is the number of all the devices in the group;
a sorting module 11, configured to divide all the devices in the group into a first sub-group or a second sub-group, where an average CPU utilization of each device in the first sub-group is greater than or equal toThe average CPU utilization of each device of the second subset is less than
The sorting module 11 is further configured to sort, from high to low, each device of the first subset according to the service priority of the service being operated by each device of the first subset, and if the service priorities of the services being operated by at least two devices of the first subset are the same, sort, from high to low, at least two devices of the first subset according to the size of the average utilization rate of the CPUs of the at least two devices of the first subset;
the sorting module 11 is further specifically configured to sort, from low to high, each device of the second subset according to the service priority of the service being operated by each device of the second subset, and if the service priorities of the services being operated by at least two devices of the second subset are the same, sort, from low to high, at least two devices of the second subset according to the average CPU utilization of the at least two devices of the second subset;
the obtaining module 10 is further configured to obtain a power capping increase value of the ith device in the first sub-group or a power capping decrease value of the ith device in the second sub-group according to the following formula:
wherein, DeltaiIncreasing value for power capping of the ith device of the first subset or decreasing value for power capping of the ith device of the second subset, Pi BThe last set power cap value for the second subset,the average CPU utilization rate of the ith device in the second subgroup;
the obtaining module 10 is further configured to obtain a theoretical power capping value of the ith device in the first sub-group according to the following formula:
Ai=Pi A+Δi;
wherein A isiCapping the theoretical value for the power of the ith device of the first subset;
the obtaining module 10 is further specifically configured to obtain a theoretical power capping value of the ith device in the second subset according to the following formula:
Bi=Pi B-Δi;
wherein, BiCapping the theoretical value for the power of the ith device of the second subset;
the obtaining module 10 is further configured to obtain a power capping value of the ith device in the first sub-group according to the following formula:
wherein newPi AFor the power capping value, P, of the ith device of the first subgroupi AFor the last power capping value, P, of the ith device of the first subseti BFor the last power capping value of the second subset ith device,is the minimum effective power consumption value of the ith device of the second subset,for the maximum effective power consumption value of the second subset ith device,is the minimum effective power consumption value of the first sub-group of the ith device,a maximum effective power consumption value for the ith device of the first subset;
the obtaining module 10 is further configured to obtain a power capping value of the ith device in the second subset by using the following formula:
wherein,the power capping value for the second subset ith device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in an acquisition machine-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.