Server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources

CN122594026APending Publication Date: 2026-08-18BEIJING ZIGUANG INTELLIGENCE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611010931.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]本申请目的是提供一种基于异构资源动态分配的服务器能耗优化方法及系统,以解决现有技术中异构资源动态分配过程中任务与资源适配精度不足、服务器集群能耗难以有效降低的问题

Benefits of technology

[0016]The server energy consumption optimization method based on dynamic allocation of heterogeneous resources provided in this application has the following beneficial effects: This application can provide a multi-dimensional data foundation for subsequent analysis by synchronously acquiring fine-grained time-series data from both the task demand side and the resource supply side; then, by eliminating the interference of short-term load fluctuations on the idle rate, it can accurately reflect the average idle degree of resources within the statistical window; subsequently, by characterizing the non-linear change trend of resource power consumption at the current load point with the increase of load, it can quantify the energy consumption cost of adding tasks; then, by screening out combinations in which the task computing demand rhythm and the resource idle rhythm have the same relationship in time, it can narrow down the allocation candidate range; finally, it prioritizes the allocation of tasks to the resources with the most stable energy consumption behavior to reduce the risk of power consumption fluctuations after allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594026A_ABST
    Figure CN122594026A_ABST
Patent Text Reader

Abstract

This application provides a server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources, belonging to the technical field of server energy consumption optimization. This application collects the queue depth sequence of tasks to be allocated, the idle period sequence of heterogeneous resources, and the load power consumption curve, and calculates the smoothed idle rate; then, it integrates the load power consumption curve to obtain the power load integral curve, and after converting the smoothed idle rate into equivalent load, it performs second-order difference on the power load integral curve to obtain the energy consumption sensitivity; then, it compares the numerical change direction of the queue depth sequence and the smoothed idle rate within a preset historical period and determines them as candidate matching pairs; then, it calculates the rate of change of the energy consumption sensitivity of heterogeneous resources in the candidate matching pairs relative to the previous scheduling period, and allocates the tasks to be allocated in the candidate matching pairs with the smallest rate of change to the corresponding target heterogeneous resources, which can realize the dynamic allocation of heterogeneous resources, thereby reducing the overall energy consumption of the server cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of server energy consumption optimization, and in particular relates to a server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources. Background Technology

[0002] With the continuous expansion of cloud computing and data center scale, heterogeneous resource dynamic allocation technology has become an important means to improve server energy consumption efficiency and has broad application prospects in large-scale computing scenarios.

[0003] Currently, existing heterogeneous resource scheduling methods typically make task allocation decisions based on macro-level indicators at the operating system level, such as CPU utilization and memory usage, or use static rules to map specific types of tasks to corresponding resource types. Some methods introduce power consumption constraints to limit resource allocation, but power consumption modeling is mostly based on the instantaneous power consumption at the current load point, lacking fine-grained characterization of the energy consumption change trend of resources in different load ranges.

[0004] However, the above methods have significant shortcomings in server cluster scenarios with diverse task types and dynamic load changes. Since the indicators on which scheduling decisions rely cannot accurately reflect the dynamic matching relationship between task computing needs and the actual operating status of resources, tasks are easily migrated to resources with higher energy consumption, which in turn leads to scheduling oscillations and persistently high overall energy consumption. Summary of the Invention

[0005] The purpose of this application is to provide a server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources, so as to solve the problems of insufficient accuracy of task and resource adaptation and difficulty in effectively reducing the energy consumption of server clusters in the process of dynamic allocation of heterogeneous resources in the prior art.

[0006] To address the aforementioned technical problems, in a first aspect, this application provides a server energy consumption optimization method based on dynamic allocation of heterogeneous resources, comprising: Collect the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned for multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource for multiple sampling cycles. The ratio of the sum of the number of idle cycles in the idle cycle sequence within the sliding window to the total number of clock cycles in the sliding window is calculated to obtain the smooth idle rate of each heterogeneous resource in different sampling periods. The power consumption curve is numerically integrated from no load to each load point to obtain the power consumption load integral curve. After the smooth idle rate is converted into the equivalent load, the power consumption load integral curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. Calculate the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource. Determine the tasks to be assigned and their corresponding heterogeneous resources whose ratio of the target period number to the total number of historical periods is greater than a preset ratio threshold as candidate matching pairs. Calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate fitting pair relative to the previous scheduling cycle, assign the tasks to be assigned in the candidate fitting pair with the smallest rate of change to the corresponding target heterogeneous resources, and remove the candidate fitting pair associated with the assigned tasks.

[0007] Optionally, before calculating the rate of change of the energy sensitivity of the heterogeneous resources of the candidate matching pair relative to the previous scheduling period, the method further includes: Heterogeneous resources with energy consumption sensitivity greater than a preset threshold are marked as prohibited from allocation, and the candidate matching pairs associated with heterogeneous resources marked as prohibited from allocation are removed.

[0008] Optionally, after assigning the tasks to be assigned from the candidate adaptation pairs with the smallest rate of change to the corresponding target heterogeneous resources and unassociating the assigned tasks from the candidate adaptation pairs, the method further includes: Calculate the ratio of the estimated number of clock cycles consumed by the assigned task to the total number of clock cycles in the corresponding sliding window. Subtract this ratio from the current smooth idle rate of the target heterogeneous resource to obtain the recalculated smooth idle rate of the target heterogeneous resource. Based on the recalculated smooth idle rate, re-determine candidate matching pairs and allocate heterogeneous resources to other tasks to be assigned until all tasks to be assigned have completed the heterogeneous resource allocation.

[0009] Optionally, the ratio of the sum of the number of idle cycles in the idle cycle sequence within the sliding window to the total number of clock cycles in the sliding window is calculated to obtain the smoothed idle rate of each heterogeneous resource in different sampling periods, including: The window length of the corresponding sliding window is set according to the parallelism of each heterogeneous resource, and the total number of clock cycles is determined according to the clock cycles of the sampling period included in the window length. By calculating the ratio of the total number of idle cycles within the sliding window corresponding to each sampling cycle to the total number of clock cycles, the smooth idle rate of each heterogeneous resource in different sampling cycles can be obtained.

[0010] Optionally, the power consumption curve is numerically integrated from no-load to each load point to obtain the power consumption load integral curve. After converting the smoothed idle rate into an equivalent load, the power consumption load integral curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource, including: Calculate the product of the average power consumption value of adjacent load points in the load power consumption curve and the load difference between adjacent load points to obtain the power load increment between each adjacent load point. Then, accumulate each power load increment starting from no load to obtain the power load integral value from no load to each load point. Construct the power load integral curve based on all power load integral values. The difference between the value 1 and the smooth idle rate is used to obtain the equivalent load of each heterogeneous resource. The reference load point corresponding to the equivalent load is determined on the power load integral curve. The target power load integral value of the reference load point, the first power load integral value of the previous measured load point and the second power load integral value of the next measured load point are extracted. The forward slope is obtained by calculating the ratio of the difference between the target power load integral value and the first power load integral value to the corresponding load difference. The backward slope is obtained by calculating the ratio of the difference between the second power load integral value and the target power load integral value to the corresponding load difference. The energy sensitivity of each heterogeneous resource is obtained by calculating the difference between the backward slope and the forward slope.

[0011] Optionally, the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource is calculated. Tasks to be assigned whose ratio of the target period number to the total number of historical periods is greater than a preset threshold, along with their corresponding heterogeneous resources, are identified as candidate matching pairs, including: The first change direction sequence of each task to be assigned is obtained by calculating the positive and negative values ​​of the difference between the instruction transmission queue depths of adjacent sampling periods in the queue depth sequence. By calculating the positive and negative values ​​of the difference in smooth idle rates between adjacent sampling periods of each heterogeneous resource, the second change direction sequence of each heterogeneous resource is obtained; Within a preset historical period, the number of sampling periods in which the first and second change direction sequences exhibit the same change direction is accumulated to obtain the target number of each task to be assigned and each combination of heterogeneous resources. The combination of the task to be assigned and the corresponding heterogeneous resources that has a ratio of the target number of cycles to the preset total number of historical cycles greater than a preset ratio threshold is identified as a candidate fit.

[0012] Optionally, the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate matching pairs relative to the previous scheduling cycle is calculated, and the tasks to be assigned in the candidate matching pairs with the smallest rate of change are assigned to the corresponding target heterogeneous resources. The candidate matching pairs with already assigned tasks are then decoupled, including: Read the preceding energy consumption sensitivity of each heterogeneous resource in the previous scheduling cycle from the historical cache, calculate the absolute value of the difference between the current energy consumption sensitivity of each heterogeneous resource in the candidate adaptation and the corresponding preceding energy consumption sensitivity, and obtain the change rate of each candidate adaptation. All candidate fit pairs are sorted from smallest to largest according to their rate of change. The tasks to be assigned in the candidate fit pair with the smallest rate of change are assigned to the corresponding target heterogeneous resources, and the candidate fit pairs with assigned tasks are unassociated.

[0013] Secondly, this application provides a server energy consumption optimization system based on dynamic allocation of heterogeneous resources, comprising: The acquisition module is used to acquire the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned for multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource for multiple sampling cycles. The calculation module is used to accumulate the number of idle cycles in the idle cycle sequence within the sliding window and calculate the ratio to the total number of clock cycles in the sliding window, so as to obtain the smooth idle rate of each heterogeneous resource in different sampling periods. The integration module is used to numerically integrate the power consumption value of the load power consumption curve from no load to each load point to obtain the power consumption load integral curve. After converting the smooth idle rate into the equivalent load, the power consumption load integral curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. The comparison module is used to calculate the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource. Tasks to be assigned with a target period ratio greater than a preset ratio threshold and their corresponding heterogeneous resources are identified as candidate matching pairs. The allocation module is used to calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate adaptation pair relative to the previous scheduling cycle, allocate the tasks to be allocated in the candidate adaptation pair with the smallest rate of change to the corresponding target heterogeneous resources, and remove the candidate adaptation pair associated with the already allocated tasks.

[0014] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor, used to execute computer programs, implements the steps of the server energy consumption optimization method based on dynamic allocation of heterogeneous resources as described in the first aspect above.

[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps of the server energy consumption optimization method based on dynamic allocation of heterogeneous resources as described in the first aspect above.

[0016] The server energy consumption optimization method based on dynamic allocation of heterogeneous resources provided in this application has the following beneficial effects: This application can provide a multi-dimensional data foundation for subsequent analysis by synchronously acquiring fine-grained time-series data from both the task demand side and the resource supply side; then, by eliminating the interference of short-term load fluctuations on the idle rate, it can accurately reflect the average idle degree of resources within the statistical window; subsequently, by characterizing the non-linear change trend of resource power consumption at the current load point with the increase of load, it can quantify the energy consumption cost of adding tasks; then, by screening out combinations in which the task computing demand rhythm and the resource idle rhythm have the same relationship in time, it can narrow down the allocation candidate range; finally, it prioritizes the allocation of tasks to the resources with the most stable energy consumption behavior to reduce the risk of power consumption fluctuations after allocation.

[0017] Furthermore, this application calculates the positive and negative differences between adjacent sampling periods for the queue depth sequence and the smoothed idle rate, respectively, to obtain the first change direction sequence for each task and the second change direction sequence for each resource. Then, within a preset historical period, it counts the number of sampling periods where the two directions are opposite, and identifies task-resource combinations with a proportion exceeding a preset threshold as candidate suitable pairs. This method can accurately identify the dynamic matching relationship between tasks and resources from the perspective of temporal similarity, thereby avoiding the allocation of tasks to resources with conflicting operating rhythms and reducing energy waste caused by incorrect allocation. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a server energy consumption optimization method based on dynamic allocation of heterogeneous resources, provided in an embodiment of this application; Figure 2 A flowchart illustrating a method for generating energy sensitivity provided in an embodiment of this application; Figure 3 A flowchart illustrating a method for generating candidate adapters provided in an embodiment of this application; Figure 4 A schematic diagram of a server energy consumption optimization system based on dynamic allocation of heterogeneous resources, provided for an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0020] Existing heterogeneous resource scheduling methods rely on macro-level indicators at the operating system level for task allocation. They cannot perceive the dynamic matching relationship between task computing needs and resource operating status in time. Furthermore, power consumption modeling is based only on instantaneous power consumption and lacks fine-grained characterization of energy consumption trends in different load ranges. This leads to frequent task migration to resources with higher energy costs and causes scheduling oscillations, resulting in consistently high overall energy consumption of the server cluster.

[0021] To address the aforementioned issues, this application proposes a server energy consumption optimization method based on dynamic allocation of heterogeneous resources. This method quantifies the nonlinear trend of resource power consumption at the current load point by collecting the command issuance queue depth of tasks and the number of idle cycles of resources. Based on the temporal synchronization of task computing requirements and resource idle rhythm, candidate matching combinations are screened, and tasks are preferentially allocated to resources with the most stable energy consumption behavior. This improves the accuracy of task and resource matching, effectively suppresses scheduling oscillations, and reduces the overall energy consumption of the server cluster.

[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0023] To address the problems of existing technologies, embodiments of this application provide a server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources. The server energy consumption optimization method based on dynamic allocation of heterogeneous resources provided in this application embodiment will be described below first.

[0024] Figure 1 This illustration shows a flowchart of a server energy consumption optimization method based on dynamic allocation of heterogeneous resources according to an embodiment of this application. Figure 1 As shown.

[0025] S101. Collect the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned for multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource for multiple sampling cycles. In this sub-step, the instruction issue queue depth refers to the number of instructions waiting to be issued by the processor at a given sampling moment, reflecting the computational demand intensity of the task to be assigned at that moment. The queue depth sequence refers to the historical average queue depth sequence or resource usage prediction sequence of the business type to which the task to be assigned belongs, used to represent the evolution trend of the task's computational resource demand within the sampling period. Heterogeneous resources refer to independent processor chips within the server with different instruction set architectures or computational characteristics, which may include central processing units, graphics processing units, and field-programmable gate arrays.

[0026] The number of idle cycles refers to the number of clock cycles in which a heterogeneous resource is in a state where no instructions can be executed within a single sampling period. An idle cycle sequence is a sequence formed by arranging the number of idle cycles obtained from multiple consecutive sampling periods of the same heterogeneous resource in chronological order. A load-power consumption curve is a curve showing the relationship between load and power consumption obtained by fitting piecewise linear interpolation after pre-measuring the steady-state power consumption of each heterogeneous resource at multiple load gradient points. The horizontal axis represents the load percentage, and the vertical axis represents the corresponding steady-state power consumption value.

[0027] In this embodiment of the application, in a server cluster running multiple computing tasks simultaneously, for each task to be assigned, the instruction issuance queue depth is periodically sampled according to a preset sampling period interval to obtain the queue depth sequence of the task, which can be denoted as... ,in, The number of sampling periods is preset. The preset sampling period interval can be set in advance according to the processor clock frequency and scheduling response requirements to ensure that the sampling granularity is sufficient to capture the dynamic changes in task computing needs.

[0028] Simultaneously, within each sampling period, the idle flag bits of each heterogeneous resource are read and accumulated to count the number of idle periods within that sampling period, thereby obtaining the idle period sequence of each heterogeneous resource, which can be denoted as... Then, during the system deployment phase, different proportions of load are applied to each heterogeneous resource in advance, and the steady-state power consumption value at each load gradient point is recorded. Then, the power consumption value at each load gradient point is fitted into a continuous load power consumption curve by piecewise linear interpolation and stored, thereby obtaining the load power consumption curve of each heterogeneous resource.

[0029] This application collects instruction issuance queue depth sequences from the task demand side and idle cycle sequences from the resource supply side, while also acquiring load power consumption curves of various heterogeneous resources. It establishes a multi-dimensional data foundation covering dynamic task computing requirements, changes in resource operating status, and resource energy consumption characteristics. This provides fine-grained time-series data support for subsequent smooth idle rate calculation, energy-sensitive metric quantification, and task-resource matching, breaking through the limitations of existing technologies that rely solely on macroscopic indicators at the operating system level.

[0030] S102. After accumulating the number of idle cycles in the idle cycle sequence within the sliding window, calculate the ratio to the total number of clock cycles in the sliding window to obtain the smooth idle rate of each heterogeneous resource in different sampling periods. In one specific implementation, S102 includes: Step 1021: Set the window length of the corresponding sliding window according to the parallelism of each heterogeneous resource, and determine the total number of clock cycles based on the clock cycles of the sampling period included in the window length. In this sub-step, the window length refers to the number of sampling periods contained within the sliding window, which determines the time span covered when statistically smoothing the idle rate. Parallelism refers to the number of instructions or computation threads that heterogeneous resources can process simultaneously, reflecting the parallel processing capability of the resources.

[0031] In this embodiment, the sliding window length is set according to the parallelism of different processor chips in the heterogeneous resources. Specifically, the CPU mainly processes general serial tasks, and its load changes relatively smoothly. To improve scheduling response speed, a shorter window length is set, for example, 16 sampling cycles. The GPU has extremely high parallelism and is used to process large-scale concurrent tasks. Its load fluctuates frequently and drastically, requiring a longer statistical window to smooth short-term jitter, for example, 64 sampling cycles. The FPGA, as a programmable logic array, depends on the activity level of logic gates and the continuity of data flow. Its parallelism and fluctuation characteristics are between those of the CPU and GPU, for example, 32 sampling cycles. The above window length settings can be pre-calibrated based on the characteristic frequencies observed in the historical operation of each chip.

[0032] After determining the window length, multiply the window length by the number of clock cycles in a single sampling period to obtain the total number of clock cycles. The calculation formula is as follows: ,in, For the first The total number of clock cycles for heterogeneous resources. The subscript k is used to distinguish heterogeneous resource categories with different architectural characteristics. For example, k=1,2,3 represent CPU, GPU, and FPGA, respectively. For the corresponding window length, The number of clock cycles for a single sampling period, which is preset based on the processor clock frequency and sampling period interval.

[0033] Step 1022: By calculating the ratio of the total number of idle cycles in the sliding window corresponding to each sampling cycle to the total number of clock cycles, the smooth idle rate of each heterogeneous resource in different sampling cycles is obtained.

[0034] In this sub-step, the total number of idle cycles refers to the sum of the number of idle cycles across all sampling cycles within the sliding window. The smoothed idle rate is the ratio of the total number of idle cycles to the total number of clock cycles within the sliding window, reflecting the average idle level of heterogeneous resources within the current statistical window.

[0035] In this embodiment, the step size of the sliding window is set to one sampling period. That is, after each sampling time, the sliding window slides backward by one unit, and the smoothing value within the current window is recalculated to ensure the real-time and continuous feedback of the idle rate. For example, if the sliding window length for a heterogeneous resource is 32 sampling periods, then when the 33rd sampling period arrives, the number of idle periods from the 1st sampling period is removed. And add the number of idle cycles from the 33rd sampling period. Get the updated total number of idle cycles. ,in, This represents the total number of idle cycles after an update of a heterogeneous resource. This is the accumulated value of the idle period before a certain heterogeneous resource is updated.

[0036] After obtaining the updated total number of idle cycles, divide it by the total number of clock cycles for the corresponding heterogeneous resources to obtain the smoothed idle rate for that sampling period. The calculation formula is as follows: ,in, For the first The smoothed idle rate of the heterogeneous resource per sampling period. For the first Each sampling period corresponds to the total number of idle periods within the sliding window. This represents the total number of clock cycles for this type of heterogeneous resource.

[0037] This application accumulates the number of idle cycles using a sliding window and refreshes it cycle by cycle using a rolling update method, eliminating the interference of short-term load bursts on the idle rate and obtaining a smooth idle rate that reflects the average idle degree of resources. Furthermore, the window length is set according to the difference in parallelism of each heterogeneous resource, taking into account both scheduling response speed and statistical stability, and providing low-jitter resource status input data for subsequent equivalent load conversion and energy consumption sensitivity calculation.

[0038] S103. Perform numerical integration on the power consumption curve from no load to each load point to obtain the power consumption load integral curve. After converting the smooth idle rate into the equivalent load, perform second-order difference on the power consumption load integral curve at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. In one specific implementation, such as Figure 2 As shown, step S103 includes: Step 1031: Calculate the product of the average power consumption value of adjacent load points in the load power consumption curve and the load difference between adjacent load points to obtain the power consumption load increment between each adjacent load point. Accumulate each power consumption load increment from no load to each load point in sequence to obtain the power consumption load integral value from no load to each load point. Construct the power consumption load integral curve based on all power consumption load integral values. In this sub-step, the power load increment refers to the area under the power curve between two adjacent load points on the load power consumption curve, reflecting the additional energy cost required to increase the load within this interval. The power load integral value is the sum of all power load increments from the no-load state to a certain load point, representing the total energy cost accumulated from no-load to that load point. The power load integral curve is a curve constructed with load as the horizontal axis and power load integral value as the vertical axis, describing the relationship between the cumulative energy cost changes of resources from no-load to each load point.

[0039] In this embodiment of the application, adjacent load points in the load power consumption curve are traversed, and the power consumption load increment between each adjacent load point is calculated. Specifically, for the first... The load point and the first At each load point, the power consumption values ​​for both are as follows: and The load values ​​are respectively and The formula for calculating the power consumption load increment in this interval is: ,in, For the first The power load increment for each interval is calculated, with subscript j representing the index of the measured load point sequence arranged in ascending order of load percentage. This calculation is then repeated for all adjacent load points on the load power curve to obtain the power load increment sequence for each interval. ,in, Decrease the number of load points by one.

[0040] Next, starting from no-load, the power load increments are sequentially accumulated to obtain the power load integral value from no-load to each load point. The calculation formula is as follows: ,in, From no load to the first The power load integral value of each load point is given by subscript j, which is the index of the measured load point sequence arranged in ascending order of load proportion. The load values ​​of all load points are then used as the horizontal axis coordinate and the corresponding power load integral value is used as the vertical axis coordinate to connect the points and construct the power load integral curve.

[0041] Step 1032: Calculate the difference between value 1 and smooth idle rate to obtain the equivalent load of each heterogeneous resource. Determine the reference load point corresponding to the equivalent load on the power load integral curve. Extract the target power load integral value of the reference load point, the first power load integral value of the previous measured load point and the second power load integral value of the next measured load point. In this sub-step, the equivalent load refers to the percentage of the resource that is occupied, which is obtained by subtracting the smoothed idle rate from a value of 1, reflecting the current actual load level of the resource. The target power load integral value refers to the power load integral value corresponding to the measured load point on the power load integral curve that is closest to the equivalent load.

[0042] In this embodiment, for each heterogeneous resource, the equivalent load of each heterogeneous resource is obtained by subtracting the corresponding smoothed idle rate from the value 1. The calculation formula is as follows: ,in, For equivalent load, For the first The smoothed idle rate of the heterogeneous resource is calculated for each sampling period. After obtaining the equivalent load, the measured load point closest to the equivalent load is located on the power load integral curve as the reference load point, and the integral value corresponding to the reference load point is extracted as the target power load integral value. The integral value corresponding to the previous measured load point of the reference load point is recorded as the first power load integral value. The power consumption load integral value corresponding to the next measured load point is recorded as the second power consumption load integral value. .

[0043] Step 1033: Calculate the ratio of the difference between the target power load integral value and the first power load integral value to the corresponding load difference to obtain the forward slope. Calculate the ratio of the difference between the second power load integral value and the target power load integral value to the corresponding load difference to obtain the backward slope. Calculate the difference between the backward slope and the forward slope to obtain the energy sensitivity of each heterogeneous resource.

[0044] In this sub-step, the forward slope refers to the slope between the reference load point and the previous measured load point on the power load integral curve, reflecting the rate of change of the power load integral value from the previous measured load point to the equivalent load. The backward slope refers to the slope between the equivalent load position and the next measured load point on the power load integral curve, reflecting the rate of change of the power load integral value from the equivalent load point to the next measured load point. Energy sensitivity characterizes the second-order change of the power load integral curve at the equivalent load, reflecting the degree of nonlinear change in resource power consumption with increasing load in the current load range.

[0045] In this embodiment, the forward slope is obtained by subtracting the target power load integral value from the first power load integral value and dividing by the load difference between the corresponding reference load point and the previous measured load point. The calculation formula is as follows: ,in, Forward slope The target power load integral value for the m-th sampling period. This is the integral value of the first power consumption load corresponding to the equivalent load. To provide an equivalent load for heterogeneous resources, This represents the load value at the previous measured load point corresponding to the equivalent load.

[0046] Next, the difference between the second power load integral value and the target power load integral value is divided by the load difference between the next measured load point and the reference load point to obtain the backward slope. The calculation formula is as follows: ,in, The backward slope, This is the integral value of the second power consumption load corresponding to the equivalent load. The load value is the load value at the next measured load point corresponding to the equivalent load. Finally, the difference between the backward slope and the forward slope is used to obtain the energy consumption sensitivity of the heterogeneous resource. The larger the absolute value of the energy consumption sensitivity, the more severe the bending of the power consumption load integral curve at the load point, and the more significant the nonlinear increase in power consumption when the resource is loaded.

[0047] This application extracts energy consumption sensitivity by performing second-order difference at the equivalent load, quantifying the degree of nonlinear change in power consumption of resources at the current load point as the load increases, thereby providing fine-grained energy consumption characteristic indicators for identifying high-risk resources where additional tasks will lead to a sharp increase in power consumption.

[0048] S104. Calculate the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within the preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource. Determine the tasks to be assigned and the corresponding heterogeneous resources whose ratio of the target period number to the total number of historical periods is greater than the preset ratio threshold as candidate matching pairs. In one specific implementation, such as Figure 3 As shown, step S104 includes: Step 1041: By calculating the positive and negative values ​​of the difference between the instruction transmission queue depths of adjacent sampling periods in the queue depth sequence, the first change direction sequence of each task to be assigned is obtained; In this sub-step, the first change direction sequence is used to characterize the dynamic changing trend of the task's computational requirements.

[0049] In this embodiment, the queue depth sequence of each task to be assigned is traversed cycle by cycle, and the difference in instruction issuance queue depth between adjacent sampling cycles is calculated. Specifically, for the first cycle... The sampling period and the first Each sampling period has an instruction issue queue depth of 1,000,000, and the depths of the two are respectively 1,0 ... and Calculate the difference Then, determine the direction of change based on the sign of the difference. When the difference is positive, record the direction of change as upward; when the difference is negative, record the direction of change as downward; and when the difference is zero, record it as unchanged.

[0050] Then, the change direction markers of all sampling periods are arranged in chronological order to obtain the first change direction sequence of the task to be assigned. For example, the command issuance queue depth of a task to be assigned in 8 consecutive sampling periods is as follows: After calculating the difference between adjacent periods, 7 differences are obtained. If the difference sequence is positive, positive, negative, positive, negative, negative, positive, then the corresponding first change direction sequence can be represented as rising, rising, falling, rising, falling, falling, rising.

[0051] Step 1042: By calculating the positive and negative values ​​of the difference in smooth idle rates between adjacent sampling periods of each heterogeneous resource, the second change direction sequence of each heterogeneous resource is obtained; In this sub-step, the second change direction sequence is used to characterize the dynamic change trend of resource idle state.

[0052] In this embodiment of the application, the smoothed idle rate calculated for each heterogeneous resource in different sampling periods is traversed period by period, and the difference in smoothed idle rate between adjacent sampling periods is calculated. Specifically, for the first sampling period... The sampling period and the first For each sampling period, the smoothed idle rates of both are respectively and Calculate the difference Then, determine the direction of change based on the sign of the difference. When the difference is positive, record the direction of change as upward, indicating that the resource idleness has increased. When the difference is negative, record the direction of change as downward, indicating that the resource idleness has decreased. When the difference is zero, it can be recorded as unchanged.

[0053] Arrange the change direction markers of all sampling periods in chronological order to obtain the second change direction sequence of this heterogeneous resource. For example, the smoothed idle rate of a GPU stream processor in 8 consecutive sampling periods is as follows: After calculating the difference between adjacent periods, 7 differences are obtained. If the difference sequence is negative, negative, positive, negative, positive, positive, negative, then the corresponding second change direction sequence can be represented as decreasing, decreasing, increasing, decreasing, increasing, increasing, decreasing.

[0054] Step 1043: Within a preset historical period, accumulate the number of sampling periods in which the first change direction sequence and the second change direction sequence exhibit the same change direction, and obtain the target number of periods for each task to be assigned and each heterogeneous resource combination. In this sub-step, the preset historical period refers to the time window used to statistically analyze the synchronization between the direction of changes in task calculation demand and resource idle status.

[0055] In this embodiment of the application, a number of sampling periods is set within a preset historical period. This number can be pre-calibrated based on the load fluctuation period of typical tasks in the server cluster. Then, within the preset historical period, the first change direction sequence of each task to be assigned and the second change direction sequence of each heterogeneous resource are aligned according to a unified timestamp. The first change direction sequence of each task to be assigned and the second change direction sequence of each heterogeneous resource are compared period by period. Specifically, for the g-th sampling period, the g-th direction marker in the first change direction sequence of the task to be assigned and the g-th direction marker in the second change direction sequence of the heterogeneous resource are extracted, and it is determined whether the two are synchronous.

[0056] When the first change direction sequence is upward and the second change direction sequence is upward, or the first change direction sequence is downward and the second change direction sequence is downward, the sampling period is recorded as the period with the same change direction, and all sampling periods that meet the above conditions within the preset historical period are accumulated and counted to obtain the target number of the combination of the task to be assigned and the heterogeneous resource.

[0057] Step 1044: The combination of the task to be assigned and the corresponding heterogeneous resources that has a ratio of the target number of cycles to the preset total number of historical cycles greater than a preset ratio threshold is determined as a candidate fit pair.

[0058] In this sub-step, the preset total number of historical periods refers to the number of difference pairs obtained by subtracting one from the total number of sampling periods included in the preset historical periods. The preset ratio threshold is a ratio threshold used to filter candidate fit pairs, which is preset according to the scheduling accuracy requirements. A candidate fit pair indicates that there is a structural match in time between the computational demand rhythm of the task and the idle rhythm of the resource.

[0059] In this embodiment, the target number of cycles calculated by combining each task to be assigned with each heterogeneous resource is divided by the preset total number of historical cycles to obtain the synchronization cycle ratio. The calculation formula is as follows: ,in, The proportion of synchronization period, The target number of periods for this combination. The total number of preset historical periods corresponding to this combination is set, and then a preset proportion threshold is pre-set according to the requirements for the strictness of the candidate adaptation screening. It is usually set to a value between 0.6 and 0.8, indicating that the task and resource change directions should be synchronous for at least 60% to 80% of the sampling periods; then, the proportion of synchronization periods is... Compared with a preset ratio threshold, when When the ratio exceeds a preset threshold, the combination of the task to be assigned and the corresponding heterogeneous resource is marked as a candidate fit pair.

[0060] This application identifies the structural matching relationship between the task computation demand rhythm and the resource idle rhythm in time sequence from the perspective of dynamic matching. This can avoid assigning tasks to resources with conflicting running rhythms, thereby narrowing the range of allocation candidates and improving the accuracy of task and resource matching.

[0061] S105. Calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate fitting pair relative to the previous scheduling cycle, assign the tasks to be assigned in the candidate fitting pair with the smallest rate of change to the corresponding target heterogeneous resources, and remove the candidate fitting pair associated with the assigned tasks.

[0062] Before calculating the rate of change of the energy sensitivity of the heterogeneous resources of the candidate matching pair relative to the previous scheduling period, S105 also includes: Step 1051: Mark heterogeneous resources with energy consumption sensitivity greater than a preset rising threshold as prohibited from allocation, and remove the candidate matching associated with the heterogeneous resources marked as prohibited from allocation.

[0063] In this sub-step, the preset rise threshold is a critical value used to determine whether the energy consumption sensitivity of heterogeneous resources is too high. When the energy consumption sensitivity of a resource exceeds this threshold, it indicates that adding tasks to the resource at the current load point will cause a sharp, non-linear increase in power consumption. This threshold is preset based on the energy consumption control requirements of the server cluster and the power consumption characteristic curves of each heterogeneous resource. The prohibited allocation state is a status flag indicating that a heterogeneous resource is temporarily prohibited from accepting new task allocations due to its energy consumption sensitivity exceeding the preset rise threshold. Resources in this state do not participate in the subsequent candidate matching sorting and allocation decisions.

[0064] In this embodiment of the application, the current energy consumption sensitivity of each candidate adapter involved in the screening is extracted and compared with a preset rise threshold. The preset rise threshold can be pre-calibrated based on the power consumption mutation points observed in the historical operation of each heterogeneous resource. It is usually set as the sensitivity value corresponding to the position where the second derivative of the load power consumption curve of the resource shows a significant jump.

[0065] When the energy consumption sensitivity of a heterogeneous resource exceeds a preset threshold, the resource is marked as prohibited from allocation. Then, all candidate pairs are traversed, and candidate pairs containing heterogeneous resources marked as prohibited from allocation are removed from the candidate set.

[0066] In one specific implementation, S105 includes: Step 1052: Read the preceding energy consumption sensitivity of each heterogeneous resource from the historical cache in the previous scheduling cycle, calculate the absolute value of the difference between the current energy consumption sensitivity of each heterogeneous resource in the candidate adaptation and the corresponding preceding energy consumption sensitivity, and obtain the change rate of each candidate adaptation. In this sub-step, the historical cache refers to a storage area used to store the energy sensitivity values ​​calculated for each heterogeneous resource in previous scheduling cycles, which are then read by subsequent scheduling cycles to calculate the rate of change. A scheduling cycle refers to the time period within which a task allocation decision is made based on data from multiple sampling cycles within a preset historical period. At the end of each scheduling cycle, the current energy sensitivity is stored in the historical cache. The previous scheduling cycle refers to the scheduling cycle preceding the current one.

[0067] In this embodiment, the preceding energy consumption sensitivity of each heterogeneous resource in the candidate adaptation pair stored in the previous scheduling cycle is read from the historical cache. Then, the difference between the current energy consumption sensitivity and the corresponding preceding energy consumption sensitivity is calculated, and the absolute value is taken to obtain the change rate of the candidate adaptation pair. The calculation formula is as follows: ,in, For the rate of change, For the current energy consumption sensitivity of heterogeneous resources, The preceding energy consumption sensitivity of the corresponding heterogeneous resource is read from the historical cache. The smaller the rate of change, the smaller the change in the energy consumption sensitivity of the resource during adjacent scheduling cycles, the more stable the energy consumption behavior, and the lower the risk of power consumption oscillation after allocating a new task.

[0068] Step 1053: Sort all candidate adaptors in ascending order of change rate, assign the tasks to be assigned in the candidate adaptor with the smallest change rate to the corresponding target heterogeneous resources, and remove the candidate adaptors associated with the assigned tasks.

[0069] In this sub-step, the target heterogeneous resource refers to the heterogeneous resource corresponding to the candidate fit with the smallest rate of change in the current allocation round, which serves as the target resource for receiving the task to be allocated.

[0070] In this embodiment, all candidate adapters are sorted in ascending order of their rate of change. After sorting, the candidate adapter at the top of the list has the smallest rate of change, indicating that the heterogeneous resource energy consumption behavior in this candidate adapter is the most stable. Then, the tasks to be assigned in this candidate adapter are assigned to the corresponding target heterogeneous resources.

[0071] After the task allocation is completed, the remaining candidate adaptation pairs are traversed, and all candidate adaptation pairs containing the assigned task are removed from the candidate set. For example, after sorting, the candidate adaptation pair consisting of task A and the GPU stream processor has the smallest rate of change, so task A is assigned to the GPU stream processor, and the GPU stream processor becomes the target heterogeneous resource for task A. After the allocation is completed, all candidate adaptation pairs containing task A are removed.

[0072] After assigning the tasks to be assigned in the candidate fitting pairs with the smallest rate of change to the corresponding target heterogeneous resources and removing the candidate fitting pairs associated with the assigned tasks, S105 further includes: Step 1054: Calculate the ratio of the estimated number of clock cycles consumed by the assigned task to the total number of clock cycles in the corresponding sliding window. Subtract the ratio from the current smooth idle rate of the target heterogeneous resource to obtain the recalculated smooth idle rate of the target heterogeneous resource. Based on the recalculated smooth idle rate, re-determine the candidate matching and perform heterogeneous resource allocation on other tasks to be assigned until all tasks to be assigned have completed the heterogeneous resource allocation.

[0073] In this sub-step, the estimated number of clock cycles consumed refers to the number of clock cycles that the assigned task is expected to occupy in the next sampling period of the target heterogeneous resources. This value can be estimated in advance based on the task's instruction issuance queue depth and task execution rate.

[0074] In this embodiment, after a task allocation is completed, the resource status of the target heterogeneous resource is updated. Specifically, the estimated number of clock cycles consumed by the task is estimated by dividing the current instruction issuance queue depth of the allocated task by the average instruction execution rate of the resource. Then, the ratio of the estimated number of clock cycles consumed to the total number of clock cycles in the corresponding sliding window is calculated. Finally, the updated smooth idle rate is obtained by subtracting the ratio from the current smooth idle rate of the target heterogeneous resource. The average instruction execution rate refers to the average number of retired instructions that the heterogeneous resource can complete per clock cycle in the current sliding window. It is dynamically calculated by statistically analyzing the ratio of the total number of retired instructions to the total number of clock cycles in real time within the sliding window, thereby reflecting the real-time efficiency of the resource in processing the current type of task.

[0075] Based on the updated smooth idle rate, the process of equivalent load conversion and energy sensitivity calculation in step S103, and the process of re-determining candidate fit in step S104 are executed in sequence to update the candidate fit containing the target heterogeneous resources and their corresponding change rates.

[0076] Then, repeat the filtering, sorting and allocation process of steps 1051 to 1053 for all updated candidate adapters, and assign the next task to be assigned to the resource corresponding to the candidate adapter with the smallest change rate. Continue to iterate the above update and allocation process until all tasks to be assigned have completed heterogeneous resource allocation.

[0077] This application calculates the rate of change of energy consumption sensitivity during adjacent scheduling cycles and allocates tasks according to the rate of change. It then prioritizes allocating tasks to resources with the most stable energy consumption behavior, which can reduce the risk of power consumption fluctuations after allocation. After each allocation, the smooth idle rate of the target resource is updated and the energy consumption sensitivity and candidate suitability are recalculated to form a closed-loop iteration. This ensures that subsequent allocation decisions are based on the updated resource status, further achieving the goal of reducing the overall energy consumption of the server cluster while ensuring reasonable task execution.

[0078] Figure 4 This is a schematic diagram illustrating a specific implementation of a server energy consumption optimization system based on dynamic allocation of heterogeneous resources, as provided in this application embodiment. (Refer to...) Figure 4 The system may include: The acquisition module 41 is used to acquire the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned for multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource for multiple sampling cycles. The calculation module 42 is used to accumulate the number of idle cycles in the idle cycle sequence within the sliding window and calculate the ratio to the total number of clock cycles in the sliding window, so as to obtain the smooth idle rate of each heterogeneous resource in different sampling periods. The integration module 43 is used to numerically integrate the power consumption value of the load power consumption curve from no load to each load point to obtain the power consumption load integration curve. After converting the smooth idle rate into the equivalent load, the power consumption load integration curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. The comparison module 44 is used to calculate the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource. Tasks to be assigned with a target period ratio greater than a preset ratio threshold and their corresponding heterogeneous resources are identified as candidate matching pairs. The allocation module 45 is used to calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate adaptation pair relative to the previous scheduling cycle, allocate the task to be allocated in the candidate adaptation pair with the smallest rate of change to the corresponding target heterogeneous resource, and remove the candidate adaptation pair associated with the already allocated task.

[0079] The server energy consumption optimization system based on dynamic allocation of heterogeneous resources in this application embodiment is used to implement the aforementioned server energy consumption optimization method based on dynamic allocation of heterogeneous resources. Therefore, the specific implementation of the server energy consumption optimization system based on dynamic allocation of heterogeneous resources can be found in the embodiment section of the server energy consumption optimization method based on dynamic allocation of heterogeneous resources above. The specific implementation can be referred to the description of the corresponding embodiments, which will not be repeated here.

[0080] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application is shown.

[0081] The electronic device may include a processor 510 and a memory 520 storing computer program instructions.

[0082] Specifically, the processor 510 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0083] Memory 520 may include mass storage for data or instructions. For example, and not limitingly, memory 520 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 520 may include removable or non-removable (or fixed) media. Where appropriate, memory 520 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 520 is non-volatile solid-state memory.

[0084] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this disclosure.

[0085] The processor 510 reads and executes computer program instructions stored in the memory 520 to implement any of the server energy consumption optimization methods based on dynamic allocation of heterogeneous resources in the above embodiments.

[0086] In one example, the electronic device may also include a communication interface 530 and a bus 540. Wherein, such as Figure 5 As shown, the processor 510, memory 520, and communication interface 530 are connected through bus 540 and complete communication with each other.

[0087] The communication interface 530 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0088] Bus 540 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 540 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0089] The electronic device can execute the server energy consumption optimization method based on dynamic allocation of heterogeneous resources in the embodiments of this application, thereby realizing the server energy consumption optimization method based on dynamic allocation of heterogeneous resources described in conjunction with the accompanying drawings.

[0090] Furthermore, in conjunction with the server energy consumption optimization method based on dynamic allocation of heterogeneous resources in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the server energy consumption optimization methods based on dynamic allocation of heterogeneous resources in the above embodiments.

[0091] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0092] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the assigned tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0093] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0094] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block and combination of blocks in the flowchart illustrations and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block and combination of blocks in the block diagrams and / or flowchart illustrations can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0095] The above provides a detailed description of a server energy consumption optimization method and system based on dynamic allocation of heterogeneous resources provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A server energy consumption optimization method based on dynamic allocation of heterogeneous resources, characterized in that, include: Collect the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned over multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource over multiple sampling cycles. The idle rate of each heterogeneous resource at different sampling periods is obtained by accumulating the number of idle cycles in the idle cycle sequence within the sliding window and then calculating the ratio to the total number of clock cycles in the sliding window. The power consumption curve of the load power consumption curve is numerically integrated from the no-load to each load point to obtain the power consumption load integral curve. After converting the smooth idle rate into the equivalent load, the power consumption load integral curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. Calculate the number of target periods in which the direction of change of the queue depth sequence of each task to be assigned within a preset historical period is the same as the direction of change of the smooth idle rate of each heterogeneous resource. Determine the tasks to be assigned and their corresponding heterogeneous resources whose ratio of the target period number to the total number of historical periods is greater than a preset ratio threshold as candidate matching pairs. Calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate adaptation pair relative to the previous scheduling cycle, assign the task to be assigned in the candidate adaptation pair with the smallest rate of change to the corresponding target heterogeneous resource, and remove the candidate adaptation pair associated with the assigned task.

2. The method according to claim 1, characterized in that, Before calculating the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate matching pair relative to the previous scheduling period, the method further includes: Heterogeneous resources whose energy consumption sensitivity is greater than a preset rising threshold are marked as prohibited from allocation, and the candidate matching associated with the heterogeneous resources marked as prohibited from allocation is removed.

3. The method according to claim 1, characterized in that, After assigning the tasks to be assigned in the candidate adaptation pair with the smallest rate of change to the corresponding target heterogeneous resources and unassociating the assigned tasks with the candidate adaptation pair, the method further includes: Calculate the ratio of the estimated number of clock cycles consumed by the assigned task to the total number of clock cycles of the corresponding sliding window. Subtract the ratio from the current smooth idle rate of the target heterogeneous resource to obtain the recalculated smooth idle rate of the target heterogeneous resource. Based on the recalculated smooth idle rate, redetermine the candidate matching and perform heterogeneous resource allocation on other tasks to be assigned until all tasks to be assigned have completed heterogeneous resource allocation.

4. The method according to claim 1, characterized in that, The step of accumulating the number of idle cycles in the idle cycle sequence within the sliding window and calculating the ratio to the total number of clock cycles in the sliding window to obtain the smoothed idle rate of each heterogeneous resource in different sampling periods includes: The window length of the corresponding sliding window is set according to the parallelism of each heterogeneous resource, and the total number of clock cycles is determined according to the clock cycle of the sampling period included in the window length. By calculating the ratio of the total number of idle cycles within the sliding window corresponding to each sampling cycle to the total number of clock cycles, the smooth idle rate of each heterogeneous resource in different sampling cycles is obtained.

5. The method according to claim 1, characterized in that, The power consumption curve is numerically integrated from no-load to each load point to obtain a power consumption load integral curve. After converting the smoothed idle rate into an equivalent load, the power consumption load integral curve is subjected to second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource, including: Calculate the product of the average power consumption value of adjacent load points in the load power consumption curve and the load difference between adjacent load points to obtain the power load increment between each adjacent load point. Then, sequentially accumulate each of the power load increments starting from no load to obtain the power load integral value from no load to each load point. Construct a power load integral curve based on all the power load integral values. The difference between the value 1 and the smooth idle rate is used to obtain the equivalent load of each heterogeneous resource. The reference load point corresponding to the equivalent load is determined on the power load integral curve. The target power load integral value of the reference load point, the first power load integral value of the previous measured load point and the second power load integral value of the next measured load point are extracted. The forward slope is obtained by calculating the ratio of the difference between the target power load integral value and the first power load integral value to the corresponding load difference. The backward slope is obtained by calculating the ratio of the difference between the second power load integral value and the target power load integral value to the corresponding load difference. The energy sensitivity of each heterogeneous resource is obtained by calculating the difference between the backward slope and the forward slope.

6. The method according to claim 1, characterized in that, The calculation of the target number of periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource, and the determination of the tasks to be assigned and their corresponding heterogeneous resources whose ratio of the target number of periods to the total number of historical periods is greater than a preset ratio threshold as candidate matching, includes: The first change direction sequence of each task to be assigned is obtained by calculating the positive and negative values ​​of the difference between the instruction transmission queue depths of adjacent sampling periods in the queue depth sequence. By calculating the positive and negative values ​​of the difference in the smoothed idle rate between adjacent sampling periods of each heterogeneous resource, the second change direction sequence of each heterogeneous resource is obtained; Within a preset historical period, the number of sampling periods in which the first change direction sequence and the second change direction sequence exhibit the same change direction is accumulated to obtain the target number of each task to be assigned and each heterogeneous resource combination; The combination of the task to be assigned and the corresponding heterogeneous resource that has a ratio of the target number of cycles to the preset total number of historical cycles greater than a preset ratio threshold is determined as a candidate fit.

7. The method according to claim 6, characterized in that, The step of calculating the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate matching pairs relative to the previous scheduling cycle, assigning the tasks to be assigned in the candidate matching pairs with the smallest rate of change to the corresponding target heterogeneous resources, and removing the candidate matching pairs associated with the assigned tasks includes: Read the preceding energy consumption sensitivity of each heterogeneous resource in the previous scheduling cycle from the historical cache, calculate the absolute value of the difference between the current energy consumption sensitivity of each heterogeneous resource in the candidate adaptation and the corresponding preceding energy consumption sensitivity, and obtain the change rate of each candidate adaptation. All candidate adaptation pairs are sorted from smallest to largest according to the rate of change. The task to be assigned in the candidate adaptation pair with the smallest rate of change is assigned to the corresponding target heterogeneous resource, and the candidate adaptation pair associated with the assigned task is removed.

8. A server energy consumption optimization system based on dynamic allocation of heterogeneous resources, characterized in that, include: The acquisition module is used to acquire the queue depth sequence of each task to be assigned, the idle cycle sequence of each heterogeneous resource, and the load power consumption curve of each heterogeneous resource. The queue depth sequence includes the instruction issuance queue depth of the task to be assigned for multiple sampling cycles, and the idle cycle sequence includes the number of idle cycles of the heterogeneous resource for multiple sampling cycles. The calculation module is used to accumulate the number of idle cycles in the idle cycle sequence within the sliding window and calculate the ratio to the total number of clock cycles in the sliding window to obtain the smooth idle rate of each heterogeneous resource in different sampling periods. An integration module is used to numerically integrate the power consumption value of the load power consumption curve from no load to each load point to obtain a power consumption load integration curve. After converting the smooth idle rate into an equivalent load, the power consumption load integration curve is subjected to a second-order difference at the equivalent load to obtain the energy consumption sensitivity of each heterogeneous resource. The comparison module is used to calculate the number of target periods in which the numerical change direction of the queue depth sequence of each task to be assigned within a preset historical period is the same as the numerical change direction of the smooth idle rate of each heterogeneous resource. Tasks to be assigned with a ratio of the target period number to the total number of historical periods greater than a preset ratio threshold and their corresponding heterogeneous resources are identified as candidate matching pairs. The allocation module is used to calculate the rate of change of the energy consumption sensitivity of the heterogeneous resources of the candidate adaptation pair relative to the previous scheduling cycle, allocate the task to be allocated in the candidate adaptation pair with the smallest rate of change to the corresponding target heterogeneous resource, and remove the candidate adaptation pair associated with the already allocated task.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the server energy consumption optimization method based on dynamic allocation of heterogeneous resources as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, enables the server energy consumption optimization method based on dynamic allocation of heterogeneous resources as described in any one of claims 1 to 7.