Power Consumption Allocation Method, Device, Storage Medium, and Program Product
By dividing the time slot interval in the server system, combining load prediction and task priority, and dynamically adjusting the power consumption quota, the problem of poor power consumption allocation flexibility is solved, efficient resource utilization and task guarantee is achieved, and system stability and performance are improved.
Patent Information
- Application Number
- CN202510447364.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-10
AI Technical Summary
In the prior art, the power consumption distribution method is poorly flexible and cannot cope with load fluctuations, resulting in waste of resources and affecting the stability and efficiency of the server system.
By dividing multiple time slot intervals, combining load demand prediction and task priority weights, the power consumption quota of each node is dynamically adjusted, and a deep learning model is used to predict load demand to achieve flexible power consumption allocation.
Flexible adaptation to load requirements and prioritization tasks within different time periods, avoid resource waste, improve system stability and task execution efficiency, and promote breakthroughs in data centers in energy conservation and performance optimization.
Smart Images

Figure CN119988035B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of servers, and in particular, to a power consumption allocation method, device, storage medium, and program product. Background Art
[0002] In a data center, server cluster, or multi-node server, power consumption management is a key technology to break through the power supply bottleneck and hardware stability constraints of the data center. With the increasing power of hardware devices, if power consumption is not controlled, excessive use of power consumption will lead to low system operation efficiency and even affect the stability of the hardware.
[0003] In related technologies, static power consumption budget allocation can be used for power consumption allocation. However, it cannot cope with load fluctuations and is prone to resource waste. Summary of the Invention
[0004] This application provides a power consumption allocation method, device, storage medium, and program product to at least solve the problem of poor flexibility in power consumption allocation and easy resource waste in related technologies.
[0005] This application provides a power consumption allocation method, including:
[0006] Determine the resource budget provided for multiple nodes within the current time slot interval; the time slot interval is determined according to time slots of a preset granularity;
[0007] According to the predicted load demand values corresponding to multiple nodes and the task priority weights of the tasks executed by multiple nodes respectively within the current time slot interval, determine the dynamic priority weights corresponding to multiple nodes respectively within the current time slot interval;
[0008] According to the resource budget and the dynamic priority weights corresponding to multiple nodes respectively, determine the power consumption quotas corresponding to multiple nodes respectively within the current time slot interval.
[0009] This application also provides a power consumption allocation device, including:
[0010] A resource budget determination module, configured to determine the resource budget provided for multiple nodes within the current time slot interval; the time slot interval is determined according to time slots of a preset granularity;
[0011] A priority weight determination module, configured to determine the dynamic priority weights corresponding to multiple nodes respectively within the current time slot interval according to the predicted load demand values corresponding to multiple nodes and the task priority weights of the tasks executed by multiple nodes respectively within the current time slot interval;
[0012] A power consumption allocation module, configured to determine the power consumption quotas corresponding to multiple nodes respectively within the current time slot interval according to the resource budget and the dynamic priority weights corresponding to multiple nodes respectively.
[0013] The present application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any of the above power consumption allocation methods when executing the computer program.
[0014] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any of the above power consumption allocation methods when executed by a processor.
[0015] The present application also provides a computer program product including a computer program, and the computer program implements the steps of any of the above power consumption allocation methods when executed by a processor.
[0016] Through the present application, multiple time slots are divided, and within each time slot interval, the dynamic priorities of each node are determined according to the predicted load requirements of each node and the task priority weights of the tasks executed by each node within the corresponding time slot. Furthermore, based on the dynamic priorities and the resource budgets of each node within each time slot interval, power consumption allocation for each node is performed, which can flexibly adapt to different load requirements and the execution of different priority tasks at different time periods, ensuring that tasks with higher priorities are allocated more resources, avoiding resource waste, providing reliable decision support for the power consumption management of the server, effectively balancing system stability and task execution efficiency, and promoting double breakthroughs in energy conservation and performance optimization of the data center. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required for the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 Schematic diagram of the application scenario of the power consumption allocation method provided by the embodiment of the present application;
[0019] Figure 2 Schematic diagram of the flow of the power consumption allocation method provided by the embodiment of the present application;
[0020] Figure 3 Schematic diagram of the flow of time slot synchronization of the power consumption allocation method provided by the embodiment of the present application;
[0021] Figure 4 Schematic diagram of the structure of the prediction model of the power consumption allocation method provided by the embodiment of the present application;
[0022] Figure 5 Schematic diagram of the working principle of the power consumption arbiter provided by the embodiment of the present application;
[0023] Figure 6 Schematic structural diagram of the power consumption allocation device provided by the embodiment of the present application;
[0024] Figure 7 Schematic structural diagram of the electronic device provided by the present application. Specific embodiments
[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0027] Glossary:
[0028] Last-Level Cache (LLC) hit rate: The hit rate of the last-level cache, which refers to the proportion of data found in the last-level cache of the Central Processing Unit (CPU) when accessing data. A high hit rate indicates that the CPU can obtain more data from the cache when accessing data, reducing the frequency of accessing the main memory; a low hit rate means that the cache fails to hit, and the main memory needs to be accessed frequently, which will increase latency and power consumption.
[0029] Instructions Per Cycle (IPC): It refers to the number of instructions executed by the CPU in each clock cycle and is an important indicator for measuring the performance of the CPU.
[0030] Power Distribution Unit (PDU): It refers to a device used to provide power distribution and management for data centers, computer rooms or large equipment.
[0031] Dynamic Voltage and Frequency Scaling (DVFS): It refers to a technology used to dynamically adjust the voltage and frequency of a processor according to computing requirements to improve energy efficiency, reduce power consumption, and extend battery life.
[0032] Thermal Design Power (TDP): It refers to the maximum power requirement for heat dissipation of a system or component when the device is running at full load.
[0033] In data centers, server clusters, and multi-node servers, power consumption management problems are usually encountered. As hardware devices become more and more powerful, power consumption has gradually become an important bottleneck. If not controlled, excessive power consumption will lead to low system operation efficiency and even affect the stability of the hardware.
[0034] Due to power consumption wall limitations, modern server clusters are restricted by the power supply infrastructure (such as the capacity of the PDU) and cannot meet the peak power consumption requirements of each node simultaneously. Coupled with resource contention, high-priority tasks (such as artificial intelligence training) compete with low-priority tasks (such as data backup) for the power consumption budget, resulting in performance fluctuations. Moreover, lacking effective dynamic load methods, the server load changes over time, and traditional static power consumption allocation strategies are inefficient.
[0035] In related technologies, a static allocation method can be adopted, where a fixed power consumption budget is allocated to each node and subsystem at system startup and does not change during system operation. Regardless of how the system load changes, the power consumption budget remains unchanged. However, this method mainly relies on the static configuration of the system, such as the maximum power consumption limit of the hardware, the performance requirements of the nodes, etc. It is not sensitive to load changes and is prone to resource waste.
[0036] To solve the above technical problems, the inventors of the present application have found through research that the main drawback of static power consumption budget allocation is that it does not take into account the load fluctuations during actual operation, thus being unable to respond to the dynamic changes of the system load. Moreover, when the system load is low, static power consumption allocation may allocate excessive power to some nodes, and these nodes do not fully utilize these resources, resulting in power waste. The inventors of the present application have also found that even by dynamically adjusting power consumption allocation through real-time monitoring of the workload of system nodes, due to the complexity of the actual system, the load changes cannot be instantaneously reflected in the power consumption management system, the response time is relatively lagged, the power consumption allocation effect is not ideal, and the adaptability to different tasks is also poor. Therefore, the inventors of the present application innovatively consider the load demand prediction value and task priority comprehensively, and divide the time axis into multiple time slots, determine the time slot interval according to the time slots, use the time slot interval as the adjustment period, and synchronously calculate and adjust the function allocation of each node at each time slot interval, which can not only adapt to load changes but also take into account the requirements of different tasks. Based on this, the embodiments of the present application provide a power consumption allocation method.
[0037] To enable those skilled in the art of the present technology to better understand the solution of the present application, the following further elaborates on the present application in conjunction with the accompanying drawings and specific embodiments.
[0038] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the power consumption allocation method depends, the specific application environment architecture or specific hardware architecture is described herein. Refer to Figure 1 , Figure 1 is a schematic diagram of the application scenario of the power consumption allocation method provided by the embodiments of the present application. As Figure 1 shown, taking a server cluster as an example, the server cluster includes multiple server nodes (primary node 101 and multiple slave nodes 102).
[0039] In the specific implementation process, a power consumption arbiter can be set at the master node 101, and a High Precision Event Timer (HPET) is used to implement the time slot boundaries of each node. For example, the HPET of the master node 101 can be used as the reference clock, and each slave node 102 is synchronized with this reference clock. One or more time slots can be used as the time slot interval. Furthermore, the power consumption allocation method provided in this application is executed at the beginning of each time slot interval. Specifically, the resource budget provided for multiple nodes within the current time slot interval can be determined first, and then, based on the predicted load demand values corresponding to multiple nodes within the current time slot interval and the task priority weights of the tasks executed by multiple nodes within the current time slot interval, the dynamic priority weights corresponding to multiple nodes within the current time slot interval are determined. Thus, based on the resource budget corresponding to the current time slot interval and the dynamic priority weights corresponding to multiple nodes, the power consumption quotas corresponding to multiple nodes within the current time slot interval are determined, realizing power consumption allocation. The power consumption allocation method provided in the embodiments of this application divides multiple time slots, and within each time slot interval, based on the predicted load demands of each node and the task priority weights of the tasks executed by each node within the corresponding time slot, the dynamic priorities of each node are determined. Furthermore, based on this dynamic priority and the resource budget of each node within each time slot interval, the power consumption of each node is allocated, which can flexibly adapt to different load demands and the execution of different priority tasks in different time periods, ensuring that tasks with higher priorities are provided with more resources, avoiding resource waste, providing reliable decision-making support for the power consumption management of the server, effectively balancing system stability and task execution efficiency, and promoting double breakthroughs in energy conservation and performance optimization of the data center.
[0040] Figure 2 It is a schematic flowchart of the power consumption allocation method provided in the embodiments of this application. As Figure 2 shown, the embodiments of this application provide a power consumption allocation method, and a detailed description of the method is as follows:
[0041] 201. Determine the resource budget provided for multiple nodes within the current time slot interval; the time slot interval is determined according to time slots of a preset granularity.
[0042] The execution subject of this embodiment can be a power consumption allocation device, and this power consumption allocation device can be a terminal device or a server. For example, it can be Figure 1 the master node 101 shown.
[0043] In this embodiment, a node refers to a physical / virtual computing unit that operates independently in a network or distributed system, having independent hardware resources (CPU, memory, storage) and network interfaces, for executing specific services (such as data processing, application hosting), and can cooperate with other nodes through a cluster protocol to achieve load balancing or high availability. The preset granularity can be less than or equal to 120 microseconds (μs), for example, 100 μs. The time slot interval can be one or more time slots. To save computing resources, during a period with large load changes (for example, the transition period between the evening period before 10 o'clock with large load demand and the early morning period after 2 o'clock with small load demand, between 10 o'clock and 2 o'clock), the time slot interval can be determined as a single time slot, and during a stage with stable load demand changes (for example, the working period from 8 o'clock to 12 o'clock), the time slot interval can be determined as multiple time slots. The definition of specific periods can be determined based on the analysis of historical load demand data. The method provided in this embodiment is to solve the limitations such as being unable to adapt to dynamic load demands under fixed TDP restrictions, unable to make full use of microsecond-level power consumption fluctuations for minute-level or second-level power consumption adjustment, and single-node optimization unable to solve the power consumption contention problem of multi-node clusters. Through dynamic allocation of time-slot-based power consumption budgets, appropriate power consumption budgets are allocated to each node and each time slice (i.e., time slot interval) to cope with load fluctuations and resource demand changes.
[0044] Exemplarily, assuming the time slot is 100 μs and the time slot interval is a single time slot, that is, 100 μs, the resource budget provided for multiple nodes in the current time slot interval is 100 watts (W), and 100 W is allocated to multiple nodes within the current time slot interval.
[0045] In some embodiments, with the master node as the execution entity, this embodiment details the synchronization of the time slot interval for the master-slave nodes. Before step 201, it may further include: in the current time slot interval, sending synchronization data packets to multiple slave nodes respectively through a preset bus; the synchronization data packet is used to instruct the corresponding slave node to perform time slot interval synchronization with the master node according to the synchronization data packet; if the synchronization data packet is not sent to the first slave node among the multiple slave nodes, then in response to receiving the negative acknowledgment signal sent by the first slave node, resend the synchronization data packet in the next time slot interval; if the synchronization data packet is not sent to the second slave node among the multiple slave nodes for a preset number of consecutive times, then control the second slave node to enable the local time slot counter to divide the time slot interval. The power consumption allocation method provided in this embodiment can dynamically adjust the power consumption requirements of multiple nodes synchronously in each time period by dividing the running time of the server into multiple independent time periods and synchronizing the boundaries, providing flexibility for power consumption management and resource scheduling, so that different load demands and execution requirements of tasks with different priorities can be adapted in different time periods.
[0046] In this embodiment, the synchronization data packet is used for clock synchronization among multiple nodes. The synchronization data packet may include a master node identifier field, the current value of the global time slot counter, the encoding of the time slot period length, the current absolute timestamp of the master node's HPET, a cyclic redundancy check code, etc. The preset bus may be a Peripheral Component Interconnect Express (PCIe) bus.
[0047] In the specific implementation process, as Figure 3 shown, the HPET can be initialized first, and then the granularity of the time slot and the number of time slots included in the time slot interval can be set. For example, the granularity of the time slot can be set to 100 microseconds, and the time slot interval can be set to a single time slot. After the setting is completed, a broadcast signal is used for hardware-level signal synchronization. For example, the synchronization data packet can be broadcast through the broadcast signal to achieve the synchronization of the time slot interval.
[0048] Exemplarily, taking the time slot interval as a single time slot as an example. The master node can send a synchronization data packet to each slave node through the PCIe bus at the beginning of each time slot. Taking the third slave node among multiple slave nodes as an example, after receiving the synchronization data packet, the third slave node can perform a time slot alignment operation. Specifically, it can parse the time slot counter value and update the local time slot counter register, calibrate the local HPET clock phase so that its deviation from the master node's HPET absolute timestamp is less than the preset deviation value. Verify the validity of the check code, and discard the current synchronization packet if the check fails. If the third slave node does not receive a valid synchronization data packet within the time slot window, it can send a Negative Acknowledgment (NAK) signal to the master node through the sideband channel. After receiving the NAK signal, the master node performs unicast retransmission on the third slave node in the next time slot. When the local time slot counter of the third slave node detects that effective synchronization has not been completed for a continuous preset number of times (greater than 2 times, such as 3 times), it switches to the autonomous clock mode. In this mode, the update of the full time slot counter is disabled, and the time slot division is maintained based on the local HPET clock.
[0049] 202. Determine the dynamic priority weights corresponding to multiple nodes in the current time slot interval according to the predicted load demand values corresponding to multiple nodes in the current time slot interval and the task priority weights of the tasks executed by multiple nodes respectively.
[0050] Specifically, after determining the resource budget corresponding to the current time slot interval, the predicted load demand values of each node in the current time slot interval and the task priority weights of the tasks executed by each node in the current time slot interval can be obtained. Then, for each node, the dynamic priority weight of the node is calculated respectively according to the predicted load demand value of the corresponding node and the task priority weight of the executed task.
[0051] In this embodiment, the predicted value of the load demand refers to the predicted value of the required load of the corresponding node within the current time slot interval. It can be inferred based on the load demands in historical periods. For example, it can be inferred based on the load demands in multiple historical time slot intervals. The task priority weight can be the priority weight set in advance for different tasks. For example, the priority of the artificial intelligence training task can be set to the first level, and the priority of the data backup task can be set to the second level. The first level is higher than the second level. The task priority weight of the first level is set to 1, and the task priority weight of the second level is set to 0.3.
[0052] In some embodiments, to improve the prediction accuracy, a prediction model can be used to predict the load demand. Before step 202, it can also include: obtaining the input data corresponding to the current time slot interval; the input data includes the feature data corresponding to multiple nodes in multiple historical time slot intervals; the multiple historical time slot intervals are the time slot intervals before the current time slot interval; the feature data includes at least one of the following for the corresponding node: workload feature data, hardware characteristic data, temperature data; inputting the input data into the prediction model to obtain the predicted values of the load demands corresponding to multiple nodes within the current time slot interval. The power consumption allocation method provided in this embodiment determines the predicted values of the load demands of each node by comprehensively considering factors such as workload, hardware characteristics, and temperature limits in each time slot interval. Since the above factors are highly sensitive to the load, it can improve the accuracy of the predicted values of the load demands, and then determine the power consumption quotas of each node based on the predicted values of the load demands, which can improve the accuracy of the power consumption allocation.
[0053] In this embodiment, the workload feature data refers to the parameter features related to the processor of the node and the workload. For example, it can include at least one of the processor utilization rate (such as the utilization rate of the Central Processing Unit (CPU), the utilization rate of the Graphics Processing Unit (GPU)) and the LLC hit rate; the hardware characteristic data refers to the data of the node and can include at least one of the memory bandwidth and the IPC.
[0054] In some embodiments, the prediction model is based on the bidirectional long short-term memory network architecture. In the power consumption allocation method provided in this embodiment, by using the prediction model based on the bidirectional long short-term memory network architecture to predict the predicted values of the load demands of each node, it can enhance the feature capture ability and generalization ability on the time series feature data, thereby improving the prediction accuracy of the prediction model, and then obtaining more accurate predicted values of the load demands, so as to improve the accuracy of the power consumption allocation. The long short-term memory network is a special recurrent neural network that can handle and predict time series data well.
[0055] In some embodiments, the prediction model may include a bidirectional long short-term memory network layer, a dropout layer, a unidirectional long short-term memory network layer, and a fully connected layer; the bidirectional long short-term memory network layer is used to fuse the forward and reverse dependencies of the input data to obtain first feature data; the dropout layer is used to process the first feature data through multiple neurons and randomly discard the outputs of some neurons among the multiple neurons to obtain second feature data; the unidirectional long short-term memory network layer is used to extract key features from the second feature data to obtain third feature data; the fully connected layer is used to map the third feature data to obtain a predicted value of the load demand. In the power consumption allocation method provided in this embodiment, by constructing a prediction model based on the bidirectional long short-term memory network layer, the dropout layer, the unidirectional long short-term memory network layer, and the fully connected layer, it is possible to simultaneously capture the forward and reverse context information of the time series feature data through the bidirectional long short-term memory network layer, improve the accuracy, randomly discard some neurons through the dropout layer to prevent overfitting, perform in-depth feature extraction through the unidirectional long short-term memory network layer, and map the output of the unidirectional long short-term memory network layer to the target prediction space through the fully connected layer to obtain the predicted value of the load demand, which can improve the accuracy and generalization ability of the model. Through innovative deep learning architecture design, significant advantages are demonstrated in multi-dimensional time series feature fusion, long-range dependence modeling, and computational efficiency optimization.
[0056] Exemplarily, as Figure 4 shown, the prediction model includes an input layer, a bidirectional long short-term memory network layer, a dropout layer, a unidirectional long short-term memory network layer, and a fully connected layer connected in sequence.
[0057] Among them, the input layer, as the starting point of the model, is responsible for receiving the input data. The shape of the input data can be (None, 10, 6), where None represents the batch size, which is dynamically changing; 10 represents the time step, meaning that the data of 10 historical time slots is used; 6 represents the feature dimension, and the specific features include CPU / GPU utilization rate, LLC hit rate, memory bandwidth, IPC, and temperature.
[0058] The main function of the bidirectional long short-term memory network layer is to capture the bidirectional dependencies of the time series data, that is, to consider both forward (from the past to the future) and backward (from the future to the past) information and extract high-dimensional features. The output shape of this layer can be (None, 10, 256), where 256 refers to the output dimension of the bidirectional long short-term memory network layer, which is obtained by multiplying 128 units by 2 directions.
[0059] The dropout layer is used to prevent the model from overfitting and enhance the generalization ability of the model. During the training process, this layer will randomly discard the outputs of some neurons. Its output shape is the same as the input shape, which is (None, 10, 256).
[0060] The unidirectional long short-term memory network layer is used to further extract key temporal features and reduce the feature dimension, for example, reduce it to 64 dimensions, providing a suitable input for the subsequent fully connected layer. The output shape of this layer is (None, 64), where 64 is the output dimension of the unidirectional long short-term memory network layer, that is, 64 units.
[0061] The fully connected layer is used to map the output of the unidirectional long short-term memory network layer to the final prediction value, and can output the power consumption prediction for the next N (for example, 3) time slots. Its output shape is (None, 3), where 3 represents the power consumption prediction values for the next 3 time slots.
[0062] Among them, the long short-term memory network cell consists of 4 key parts, namely the input gate, forget gate, output gate, and candidate memory cell. Each part has its own weights and biases. The number of parameters of the long short-term memory network cell is closely related to the input dimension (id) and the hidden state dimension (hd).
[0063] The number of parameters of the long short-term memory network cell is calculated by the formula: number of parameters = 4×(hd×(id + hd)+hd), where id is the dimension of the input feature, hd is the dimension of the hidden state, that is, the output dimension of the long short-term memory network cell, and hd×(id + hd)+hd is the number of parameters of the weight matrix.
[0064] For example, for the bidirectional long short-term memory network layer, assume the input dimension id = 6; the hidden state dimension hd = 128. Then the number of parameters of the unidirectional long short-term memory network = 4×(128×(6 + 128)+128)= 69120. Since the bidirectional long short-term memory network consists of two independent unidirectional long short-term memory network cells, one processes the forward temporal data (from past to future), and the other processes the reverse temporal data (from future to past), so the number of parameters of the bidirectional long short-term memory network is twice the number of parameters of a single long short-term memory network: 69120×2 = 138260.
[0065] For the unidirectional long short-term memory network layer, assume the input dimension id = 256 (from the output of the bidirectional long short-term memory network layer), and the hidden state dimension hd = 64. Then the number of parameters of this layer is: 4×(64×(256 + 64)+64)= 82176.
[0066] In some embodiments, before step 202, it may further include: obtaining historical feature data; the historical feature data includes the feature data of multiple processors of a target node within a historical time period; preprocessing the historical feature data to obtain a training sample set; training a model to be trained based on the training sample set according to a preset loss function to obtain a prediction model; the preset loss function includes: a mean absolute error term and a gradient penalty term; the mean absolute error term represents the absolute error between the predicted value and the true value; the gradient penalty term is used to constrain the sensitivity of the model to be trained to the features of the input training samples. The power consumption allocation method provided in this embodiment can fuse multi-dimensional time series features, improve the sensitivity to the load demand of the node, and improve the prediction accuracy by using the multi-source feature data of multiple processors within a historical time period to train a preset model. At the same time, the prediction accuracy is guaranteed by setting the mean absolute error term, and double optimization is achieved by introducing the gradient penalty term, improving the generalization ability.
[0067] In the specific training process, model compilation can be performed first. For example, the Nesterov accelerated adaptive moment estimation (Nadam) optimizer can be used, and the learning rate can be set to 0.001. A custom mixed loss model is adopted, and the mean absolute error (MAE) and the mean squared error (MSE) are tracked simultaneously during the training process. Furthermore, a callback function can be set. The early stopping mechanism can be adopted, and the training can be stopped when there is no improvement in the validation loss for a continuous preset number of rounds (for example, 5 rounds) to avoid overfitting of the model. Then, the model saving setting can be performed, and the best model can be saved at the end of each training round for subsequent use. Finally, the training execution strategy can be set to perform at most a preset number of rounds (for example, 70 rounds) of training, and a preset number (for example, 512) of samples are drawn from the dataset for training at each iteration.
[0068] In some embodiments, the expression of the preset loss function is:
[0069] (1)
[0070] Wherein, is the true value of the i-th time slot, that is, the actual power consumption; is the predicted value of the i-th time slot output by the model; N is the number of samples; is the penalty coefficient; is the gradient of the predicted value of the i-th time slot with respect to the input features. The power consumption allocation method provided in this embodiment constrains the input feature sensitivity by setting the gradient penalty term, suppresses the weight oscillation caused by noise disturbance, enhances the anti-overfitting ability, forces the model to learn a smooth mapping that conforms to the hardware characteristics, avoids misjudgment caused by abnormal feature mutations, and the λ coefficient adjusts the precision and robustness weights, improving the generalization ability.
[0071] Specifically, the first term in formula (1) ( is the mean absolute error term (MAE), and the second term ( ) is the gradient penalty term. Exemplarily, assume the true values: = [700, 520, 560], and the predicted values: = [510, 530, 570]. Then, after calculation: MAE = (|700 - 510| + |520 - 530| + |560 - 570|) / 3 = 10. Assume the input features = [0.3, 0.4, 0.5], and the model output = [510, 530, 570]. Then the gradient can be calculated as: = [2.0, 1.5, 1.0]. The penalty coefficient is λ. λ can be set to 0.1. Then the gradient penalty term is 0.1×(4 + 2.25 + 1) / 3, resulting in 0.24167. Furthermore, the preset value of the loss function is Loss = 10 + 0.24167 = 10.24167.
[0072] In some embodiments, preprocessing the historical feature data to obtain a training sample set may include: based on a high-precision event timer, performing time alignment on the feature data of multiple processors in the historical feature data to obtain aligned data; performing normalization processing on the aligned data to obtain normalized data; based on a preset time slot interval, performing window slicing on the normalized data to obtain multiple training samples; and determining a training sample set according to the multiple training samples. The power consumption allocation method provided in this embodiment eliminates feature deviations caused by timing misalignment by aligning multi-source data streams of processors such as CPUs / GPUs, ensures cross-hardware state synchronization, accelerates model convergence and improves the stability of gradient optimization by using dimension-wise standardization to eliminate feature scale differences, constructs time-series samples through window slicing, completely captures the periodic characteristics of hardware load fluctuations, realizes the collaborative prediction of power consumption change trends and instantaneous peaks, reduces the model training error, and shortens the inference response delay.
[0073] Exemplarily, in order to make the historical feature data more suitable for model training, at least one preprocessing such as time alignment, normalization, window slicing, etc. needs to be performed. For time alignment, due to the difference in the sampling periods of the CPU and GPU, the HPET timestamp is used to align the multi-source data in time to ensure the time consistency of the data. For normalization processing, standard deviation normalization can be performed on the 6D features respectively to make the data have zero mean and unit variance, which helps the convergence of the model and the training effect. For window slicing, the data of n (n can be greater than 8, such as 10) historical time slots (each time slot can have the same duration as the time slot interval, such as 0.1 ms) can be used as input to predict the power consumption of the future m (m can be greater than 2, such as 3) time slots (each time slot is 0.1 ms, a total of 0.3 ms).
[0074] In some embodiments, determining the dynamic priority weights corresponding to multiple nodes in the current time slot interval according to the predicted load demand values corresponding to the multiple nodes and the task priority weights of the tasks executed by the multiple nodes respectively may include: for each node among the multiple nodes, determining the dynamic priority weight corresponding to the node in the current time slot interval according to the product of the predicted load demand value corresponding to the node in the current time slot interval and the task priority weight of the task executed by the node. The power consumption allocation method provided in this embodiment can dynamically couple the predicted node load demand value with the task priority through product operation, and can adaptively adjust the resource allocation weight according to the demand fluctuation and task urgency, ensuring that high-priority tasks obtain sufficient computing power while avoiding node overload.
[0075] Specifically, by communicating with the node, the task currently being processed by the node can be learned, and then the task priority weight corresponding to the task currently being processed can be learned from the pre-set task priority weight data. The predicted load demand value can be obtained through a prediction model, and then the product of the predicted load demand value and the task priority weight is determined as the dynamic priority weight of the corresponding node, which can not only respond to the sudden increase in load predicted by the LSTM, but also consider the preset task level. Taking the task priority weight of the data backup task as 0.3 and the predicted load demand value of the node as 100 watts, then the dynamic priority weight is 100 × 0.3 = 30.
[0076] 203. Determine the power consumption quotas corresponding to multiple nodes in the current time slot interval according to the resource budget and the dynamic priority weights corresponding to the multiple nodes respectively.
[0077] Specifically, the larger the dynamic priority weight is, the greater the importance of the corresponding node is after comprehensively considering the task priority and load requirements. Therefore, after determining the resource budget within the current time slot interval and the dynamic priority weights of each node, the power consumption can be allocated according to the magnitudes of the dynamic priority weights of each node, ensuring that nodes with larger dynamic priority weights can obtain more power consumption resources.
[0078] In some embodiments, determining the power consumption quotas corresponding to multiple nodes within the current time slot interval according to the resource budget and the dynamic priority weights respectively corresponding to the multiple nodes may include: performing normalization processing on the dynamic priority weights respectively corresponding to the multiple nodes to obtain the normalized priority weights respectively corresponding to the multiple nodes; for each node, determining the power consumption quota corresponding to the node within the current time slot interval according to the resource budget and the normalized priority weight corresponding to the node. The power consumption allocation method provided in this embodiment can achieve precise on-demand allocation of node power consumption quotas by normalizing the dynamic priority weights and collaboratively allocating the global resource budget, giving priority to ensuring the resource supply of high-weight tasks under the total power consumption constraint, and at the same time avoiding performance degradation caused by low-priority tasks occupying resources.
[0079] Specifically, the normalization processing can be performed by calculating the proportion of the dynamic priority weights of each node. For example, assume that the dynamic priority weights of 4 nodes are 0.8, 0.42, 0.2, and 0.06. Summing them up gives 1.48. The calculated proportions of the dynamic priority weights of each node after normalization are 0.8 / 1.48, 0.42 / 1.48, 0.2 / 1.48, 0.06 / 1.48, which are approximately equal to 0.54, 0.28, 0.14, and 0.04. Furthermore, the power consumption can be directly allocated according to the normalized priority weights of each node within the current time slot interval. For example, assume that the resource budget is 8000 watts. Then the power consumption quotas of each node are 8000×0.54 = 4320W, 8000×0.28 = 2260W, 8000×0.14 = 1120W, and 8000×0.04 = 320W.
[0080] As can be seen from the above description, the power consumption allocation method provided in this embodiment divides multiple time slots, and determines the dynamic priorities of each node according to the predicted load requirements of each node and the task priority weights of the tasks executed by each node within the corresponding time slot interval. Then, based on the dynamic priorities and the resource budgets of each node within each time slot interval, the power consumption of each node is allocated. This can flexibly adapt to different load requirements and the execution of different priority tasks in different time periods, ensure that higher-priority tasks are allocated more resources, avoid resource waste, provide reliable decision-making support for the power consumption management of the server, effectively balance the system stability and task execution efficiency, and promote double breakthroughs in energy conservation and performance optimization of the data center.
[0081] In some embodiments, considering that the predicted value of the load requirement may deviate from the actual load requirement, therefore, the actual power consumption requirement may be more or less than the power consumption quota. To allocate the power consumption within each time slot interval more flexibly, a preset control period can be set, and the resource budget for each time slot interval is determined based on the power consumption resources corresponding to the preset control period. Specifically, determining the resource budget provided for multiple nodes within the current time slot interval may include: dividing the preset control period into multiple time slot intervals based on time slots of a preset granularity; and determining the resource budget provided for multiple nodes within the current time slot interval based on the power consumption resources corresponding to the preset control period and the multiple time slot intervals. The power consumption allocation method provided in this embodiment can achieve dynamic adjustment of the subsequent time slot budget allocation according to the actual power consumption deviation of historical time slots under the premise of meeting the upper limit of the total power consumption of the period by introducing the global resource constraint of the preset control period and the time slot-level dynamic budget decomposition mechanism, forming a closed-loop control of "overlimit compensation - balance reuse", improving the system resource utilization rate while reducing the probability of overload risk.
[0082] Exemplarily, assume that the preset control period is 2 milliseconds and the single time slot interval is 0.1 millisecond. Then the preset control period includes 20 time slot intervals. Assume that the power consumption resource is 10 kilowatts. Then the resource budget provided for multiple nodes in each time slot interval is 10 / 20 = 0.5 kilowatts.
[0083] In some embodiments, after step 203, the following steps may further be included: If the power consumption quota of the first node among multiple nodes within the current time slot interval is greater than the actual power consumption of the first node, record the remaining quota to obtain a credit record; if the power consumption quota of the second node among multiple nodes within the current time slot interval is less than the actual power consumption of the second node, call the remaining quota from the credit record, record the deficit quota of the second node to obtain a deficit record; within a preset control period, the total amount of the remaining quota in the credit record is greater than or equal to the total amount of the deficit quota in the deficit record. The power consumption allocation method provided in this embodiment realizes the redistribution of power consumption margin across time slots through a credit-deficit dynamic balance mechanism. Under the hard constraint of the total cycle budget, it allows high-load nodes to call the unused quotas of low-load nodes, improves the system resource utilization rate, and at the same time, through the conservation design of credit total amount ≥ deficit, ensures that the cycle-level global power consumption capping is not breached and reduces the overload risk.
[0084] Specifically, a power consumption credit register can be used for credit recording to obtain a credit table, and a power consumption deficit register can be used for deficit recording to obtain a deficit table. If the actual power consumption of a node is less than the corresponding power consumption quota of the node, record the remaining quota in the credit table; if the actual power consumption of a node is greater than the corresponding power consumption quota of the node, record the part exceeding the budget, that is, the deficit quota, in the deficit table. By establishing a dual-register coupling mechanism, the dynamic redistribution of power budget is realized, while ensuring the service quality of high-priority tasks and maintaining the global conservation of the system-level power consumption budget.
[0085] Exemplarily, a Power Arbiter (PA) can be set up, which can be used to execute the power consumption allocation method provided in this embodiment. The timing for the power arbiter to execute the power consumption allocation method is: start executing the allocation strategy when the clock rising edge of the current time slot interval arrives. Because in digital circuits, the clock rising edge is used as the trigger point for state update, and at this time the circuit is in a stable state, which is suitable for executing key operations. Allocate high quotas immediately at the rising edge at the start of the time slot interval to ensure that high-priority tasks obtain resources first. In the specific implementation process, as Figure 5 shown, in response to the power consumption allocation requests of each node, the dynamic priority weight of each node can be calculated according to the predicted load demand value output by the prediction model and the task priority weight. It can not only respond to the sudden increase in load predicted by the prediction model but also consider the preset task levels. After determining the dynamic priority weight, the power consumption quota can be allocated based on this dynamic priority weight, and the total power consumption budget can be allocated to each node using an algorithm to ensure that tasks with higher priorities obtain more resources. After determining the power consumption quota of each node, the actual power consumption of each node in the current time slot interval can be detected, and then the credit table and the deficit table can be updated to achieve the credit-deficit balance of power consumption.
[0086] In some embodiments, considering that when multiple nodes execute tasks with different task priority levels, the nodes with higher task priority levels will monopolize resources, while the nodes executing tasks with lower task priority levels may continuously be assigned insufficient power consumption quotas and cannot maintain basic functions. Therefore, step 203 may include: setting a minimum quota for tasks with task priority weights less than a preset weight. If the quotas obtained by the target node executing a preset task within a continuous preset number of time slot intervals are all less than the actual power consumption of the target node, then assign a preset quota to the target node within the current time slot interval; the preset quota is greater than or equal to the actual power consumption of the target node within the current time slot interval. The power consumption allocation method provided in this embodiment, by introducing a dynamic minimum quota guarantee mechanism and a flexible resource allocation strategy, can ensure that high-priority tasks monopolize resources while allocating a preset quota not lower than the actual demand for continuously restricted low-priority tasks, maintaining the stable operation of the system's basic functions; combined with the reuse of redundant quotas in the credit pool and the dynamic calculation of preset thresholds, effectively isolating the risk of malicious resource preemption, and achieving the coordinated optimization of a 28% increase in resource utilization rate and a system service availability rate of 99.9%.
[0087] Specifically, at the rising edge of the clock cycle, that is, at the beginning of the time slot interval, a higher power consumption quota can be assigned to the node executing a task with a higher task priority level. For nodes with a lower task priority level, a minimum power consumption quota can be guaranteed at specific time slots to avoid uneven instantaneous system loads caused by high-priority tasks monopolizing resources, thereby ensuring that tasks with a lower task priority level can obtain the minimum resources and maintain basic functions.
[0088] Exemplarily, assume that the tasks include an artificial intelligence training task and a data backup task. Among them, the task priority level of the artificial intelligence training task is greater than that of the data backup task. Then, a higher power consumption quota is provided for the artificial intelligence training task at the rising edge of the clock cycle. In the case where the power consumption quotas of the data backup task are always less than the actual power consumption within a continuous plurality of time slot intervals, a power consumption quota greater than the actual power consumption, that is, a sufficient power consumption amount, is provided for the data backup quota to ensure the stable operation of the data backup task.
[0089] To more clearly illustrate the implementation principle of the power consumption allocation method provided in the embodiments of the present application, the following is an example description in combination with actual data.
[0090] In this embodiment, the power consumption allocation device can be deployed on the main node of the server cluster, HPET can be enabled, and the time slot interval can be set to a single time slot, and a single time slot is 0.1 millisecond. Then, when the interruption signals of each time slot interval are received, the power consumption allocation method will be executed.
[0091] Assume that the power consumption resource of the current server cluster is 8000W. Assume that the task priority weights of 4 nodes are 0.4, 0.2, 0.1, and 0.3, and the predicted load demand values obtained by the prediction model for each node are 0.8, 0.6, 0.4, and 0.2. Then, considering the task priority weights and the predicted load demand values, the dynamic priority weights can be obtained. After normalization, the normalized priority weights are 0.64, 0.24, 0.08, and 0.12. Furthermore, the power consumption quota is allocated, and the power consumption quotas for the 4 nodes are 5120W, 1920W, 660W, and 960W. Assume that the actual task power consumption requests triggered by the 4 nodes are 7000W, 3000W, 2000W, and 1000W. Each node adjusts the power consumption based on the credit-deficit dynamic balance mechanism. For example, Node 1: Request 7000W < 5120W, deposit 120W into the credit table; Node 2: Request 3000W > 1920W, borrow 1080W and deposit it into the deficit table (the credit table must have sufficient balance).
[0092] After the power consumption allocation is completed, the power consumption arbiter in the power consumption allocation device will send dynamic voltage and frequency scaling (DVFS) instructions to each node's CPU through the PCIe interface to adjust the voltage and frequency of each node. For example, if Node 1 is allocated 7000W, the frequency of Node 1 is adjusted to 2.5GHz and the voltage is 1.41V.
[0093] The power consumption allocation method provided in this embodiment accurately predicts the power consumption demand of the server by innovatively combining deep time series modeling and hardware-level optimization, ensuring the efficiency and accuracy of power consumption allocation. Specifically, the load prediction model uses time series data for deep learning and can provide high-precision power consumption predictions (average error less than 70W) under dynamically changing workloads. The core advantage of this technology is that by accurately grasping the power consumption demand of each node, the system can intelligently allocate resources and avoid over-limit events caused by excessive or insufficient power consumption scheduling. In practical applications, after combining with the dynamic bus arbitration mechanism, the system can effectively reduce the occurrence rate of over-limit events. In addition, tasks with higher priorities are guaranteed more resources, thereby improving the performance of these tasks. This technical solution based on time-slot power consumption scheduling provides reliable decision-making support for the power consumption management of the server, effectively balancing system stability and task execution efficiency, and promoting double breakthroughs in energy conservation and performance optimization of the data center.
[0094] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0095] Figure 6 This is a schematic structural diagram of the power consumption allocation device provided by the embodiment of the present application. As Figure 6 shown, the embodiment of the present application also provides a power consumption allocation device. The device 60 includes: a resource budget determination module 601, a priority weight determination module 602, and a power consumption allocation module 603.
[0096] Among them, the resource budget determination module 601 is used to determine the resource budget provided for multiple nodes within the current time slot interval; the time slot interval is determined according to time slots of a preset granularity.
[0097] The priority weight determination module 602 is used to determine the dynamic priority weights corresponding to multiple nodes within the current time slot interval according to the predicted load demand values corresponding to multiple nodes respectively within the current time slot interval and the task priority weights of the tasks executed by multiple nodes respectively.
[0098] The power consumption allocation module 603 is used to determine the power consumption quotas corresponding to multiple nodes respectively within the current time slot interval according to the resource budget and the dynamic priority weights corresponding to multiple nodes respectively.
[0099] In some embodiments, the priority weight determination module 602 is further used to obtain input data corresponding to the current time slot interval; the input data includes the feature data corresponding to multiple nodes respectively within multiple historical time slot intervals; the multiple historical time slot intervals are the time slot intervals before the current time slot interval; the feature data includes at least one of the following for the corresponding node: workload feature data, hardware characteristic data, temperature data; input the input data into a prediction model to obtain the predicted load demand values corresponding to multiple nodes respectively within the current time slot interval.
[0100] In some embodiments, the priority weight determination module 602 is further used to obtain historical feature data; the historical feature data includes the feature data of multiple processors of a target node within a historical time period; preprocess the historical feature data to obtain a training sample set; based on a preset loss function, train a model to be trained according to the training sample set to obtain a prediction model; the preset loss function includes: a mean absolute error term and a gradient penalty term; the mean absolute error term represents the absolute error between the predicted value and the true value; the gradient penalty term is used to constrain the sensitivity of the model to be trained to the features of the input training samples.
[0101] In some embodiments, the priority weight determination module 602 specifically is used to: based on a high-precision event timer, perform time alignment on the feature data of multiple processors in the historical feature data to obtain aligned data; perform normalization processing on the aligned data to obtain normalized data; based on a preset time slot interval, perform window slicing on the normalized data to obtain multiple training samples; determine a training sample set according to the multiple training samples.
[0102] In some embodiments, the expression of the preset loss function is as follows:
[0103]
[0104] where Loss is the loss value; is the true value of the i-th time slot interval, i.e., the actual power consumption; is the predicted value of the i-th time slot interval output by the model; N is the number of samples; is the penalty coefficient; is the gradient of the predicted value of the i-th time slot interval with respect to the input features.
[0105] In some embodiments, the prediction model is based on a bidirectional long short-term memory network architecture.
[0106] In some embodiments, the prediction model includes a bidirectional long short-term memory network layer, a dropout layer, a unidirectional long short-term memory network layer, and a fully connected layer; the bidirectional long short-term memory network layer is used to fuse the forward and backward dependencies of the input data to obtain first feature data; the dropout layer is used to process the first feature data through multiple neurons and randomly discard the outputs of some neurons among the multiple neurons to obtain second feature data; the unidirectional long short-term memory network layer is used to extract key features from the second feature data to obtain third feature data; the fully connected layer is used to map the third feature data to obtain the predicted load demand value.
[0107] In some embodiments, the priority weight determination module 602 is specifically configured to: for each node among multiple nodes, determine the dynamic priority weight corresponding to the node in the current time slot interval according to the product of the predicted load demand value corresponding to the node in the current time slot interval and the task priority weight of the task executed by the node.
[0108] In some embodiments, the power consumption allocation module 603 is specifically configured to: perform normalization processing on the dynamic priority weights corresponding to multiple nodes respectively to obtain the normalized priority weights corresponding to multiple nodes respectively; for each node, determine the power consumption quota corresponding to the node in the current time slot interval according to the resource budget and the normalized priority weight corresponding to the node.
[0109] In some embodiments, the resource budget determination module 601 is specifically configured to: divide the preset control period into multiple time slot intervals based on time slots with a preset granularity; determine the resource budget provided for multiple nodes in the current time slot interval based on the power consumption resources corresponding to the preset control period and the multiple time slot intervals.
[0110] In some embodiments, the power consumption allocation module 603 is further configured to: if the power consumption quota of the first node among multiple nodes within the current time slot interval is greater than the actual power consumption of the first node, record the remaining quota to obtain a credit record; if the power consumption quota of the second node among multiple nodes within the current time slot interval is less than the actual power consumption of the second node, call the remaining quota from the credit record and record the deficit quota of the second node to obtain a deficit record; within a preset control period, the total amount of the remaining quota in the credit record is greater than or equal to the total amount of the deficit quota in the deficit record.
[0111] In some embodiments, when applied to the master node, the resource budget determination module 601 is further configured to: within the current time slot interval, send synchronization data packets to multiple slave nodes respectively through a preset bus; the synchronization data packets are used to instruct the corresponding slave nodes to synchronize the time slot interval with the master node; if the synchronization data packet is not sent to the first slave node among the multiple slave nodes, in response to receiving a negative acknowledgment signal sent by the first slave node, re-send the synchronization data packet in the next time slot interval; if the synchronization data packet is not sent to the second slave node among the multiple slave nodes for a preset number of consecutive times, control the second slave node to enable a local time slot counter to divide the time slot interval.
[0112] For the description of the features in the corresponding embodiments of the power consumption allocation device, reference can be made to the relevant descriptions in the corresponding embodiments of the power consumption allocation method, which will not be elaborated here one by one.
[0113] Figure 7 It is a schematic structural diagram of the electronic device provided by this application. As Figure 7 shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 70 further includes a communication component 703. Among them, the processor 701, the memory 702, and the communication component 703 are connected through a bus.
[0114] In a specific implementation process, at least one processor 701 executes the computer execution instructions stored in the memory 702, so that at least one processor 701 executes the above-mentioned power consumption allocation method embodiment.
[0115] For the specific implementation process of the processor 701, reference can be made to the above method embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here in this embodiment.
[0116] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in combination with the application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0117] The memory may include a random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory.
[0118] The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0119] The embodiments of the present application further provide a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any of the above embodiments of the power consumption allocation method when running.
[0120] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other media that can store computer programs.
[0121] The embodiments of the present application further provide a computer program product, the above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the power consumption allocation method are implemented.
[0122] Embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps in any of the above-described embodiments of the power consumption allocation method.
[0123] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0124] The above has introduced in detail a power consumption allocation provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. A power consumption allocation method, characterized in that, Including: Determine the resource budget provided for multiple nodes within the current time slot interval; The time slot interval is determined according to time slots of a preset granularity; the resource budget is determined based on the power consumption resources corresponding to a preset control period and the number of time slot intervals within the preset control period; According to the predicted load demand values respectively corresponding to multiple nodes within the current time slot interval and the task priority weights of the tasks respectively executed by multiple nodes, determine the dynamic priority weights respectively corresponding to multiple nodes within the current time slot interval; Perform normalization processing on the dynamic priority weights respectively corresponding to multiple nodes to obtain the normalized priority weights respectively corresponding to multiple nodes; For each node, according to the resource budget and the normalized priority weight corresponding to the node, determine the power consumption quota corresponding to the node within the current time slot interval.
2. The power consumption allocation method according to claim 1, wherein Before determining the dynamic priority weights respectively corresponding to multiple nodes within the current time slot interval according to the predicted load demand values respectively corresponding to multiple nodes within the current time slot interval and the task priority weights of the tasks respectively executed by multiple nodes, it further includes: Obtain the input data corresponding to the current time slot interval; the input data includes the feature data respectively corresponding to multiple nodes within multiple historical time slot intervals; the multiple historical time slot intervals are the time slot intervals before the current time slot interval; the feature data includes at least one of the following data corresponding to the node: workload feature data, hardware characteristic data, temperature data; Input the input data into a prediction model to obtain the predicted load demand values respectively corresponding to multiple nodes within the current time slot interval.
3. The power consumption allocation method according to claim 2, wherein Before inputting the input data into the prediction model, it further includes: Obtain historical feature data; the historical feature data includes the feature data of multiple processors of a target node within a historical time period; Perform preprocessing on the historical feature data to obtain a training sample set; Based on a preset loss function, train a model to be trained according to the training sample set to obtain the prediction model; the preset loss function includes: a mean absolute error term and a gradient penalty term; the mean absolute error term represents the absolute error between the predicted value and the true value; the gradient penalty term is used to constrain the sensitivity of the model to be trained to the features of the input training samples.
4. The power consumption allocation method according to claim 3, wherein The performing preprocessing on the historical feature data to obtain a training sample set includes: Based on a high-precision event timer, perform time alignment on the feature data of multiple processors in the historical feature data to obtain aligned data; Perform normalization processing on the aligned data to obtain normalized data; Based on a preset time slot interval, perform window slicing on the normalized data to obtain multiple training samples; According to multiple training samples, determine the training sample set.
5. The power consumption allocation method according to claim 3, wherein The expression of the preset loss function is: Among them, Loss is the loss value; is the true value of the i-th time slot interval, that is, the actual power consumption; is the predicted value of the i-th time slot interval output by the model; N is the number of samples; is the penalty coefficient; is the gradient of the predicted value of the i-th time slot interval with respect to the input features.
6. The power consumption allocation method according to claim 2, wherein The prediction model is based on a bidirectional long short-term memory network architecture.
7. The power consumption allocation method according to claim 2, wherein The prediction model includes a bidirectional long short-term memory network layer, a dropout layer, a unidirectional long short-term memory network layer, and a fully connected layer; The bidirectional long short-term memory network layer is used to fuse the forward and backward dependencies of the input data to obtain first feature data; The dropout layer is used to process the first feature data through multiple neurons and randomly discard the outputs of some of the multiple neurons to obtain second feature data; The unidirectional long short-term memory network layer is used to extract key features from the second feature data to obtain third feature data; The fully connected layer is used to map the third feature data to obtain the load demand prediction value.
8. The power consumption allocation method according to any one of claims 1-7, characterized in that The determining the dynamic priority weights corresponding to the multiple nodes in the current time slot interval according to the load demand prediction values corresponding to the multiple nodes and the task priority weights of the tasks executed by the multiple nodes in the current time slot interval respectively includes: For each of the multiple nodes, according to the product of the load demand prediction value corresponding to the node and the task priority weight of the task executed by the node in the current time slot interval, determine the dynamic priority weight corresponding to the node in the current time slot interval.
9. The power consumption allocation method according to any one of claims 1-7, characterized in that The determining the resource budget provided for the multiple nodes in the current time slot interval includes: Based on time slots with a preset granularity, divide a preset control period into multiple time slot intervals; Based on the power consumption resources corresponding to the preset control period and the multiple time slot intervals, determine the resource budget provided for the multiple nodes in the current time slot interval.
10. The power consumption allocation method according to claim 9, wherein The method further includes: If the power consumption quota of the first node among the multiple nodes in the current time slot interval is greater than the actual power consumption of the first node, record the remaining quota to obtain a credit record; If the power consumption quota of the second node among the multiple nodes in the current time slot interval is less than the actual power consumption of the second node, call the remaining quota from the credit record and record the deficit quota of the second node to obtain a deficit record; within the preset control period, the total amount of the remaining quota in the credit record is greater than or equal to the total amount of the deficit quota in the deficit record.
11. The power consumption allocation method according to any one of claims 1-7, characterized in that Among the multiple nodes, there are a master node and multiple slave nodes, and the method further includes: In the current time slot interval, send synchronization data packets to the multiple slave nodes respectively through a preset bus; the synchronization data packets are used to instruct the corresponding slave nodes to perform time slot interval synchronization with the master node; If the synchronization data packet is not sent to the first slave node among the multiple slave nodes, in response to receiving a negative acknowledgment signal sent by the first slave node, resend the synchronization data packet in the next time slot interval; If the synchronization data packet is not sent to the second slave node among the multiple slave nodes for a preset number of consecutive times, control the second slave node to enable a local time slot counter to divide the time slot interval.
12. An electronic device, characterized in that, Includes: A memory for storing a computer program; A processor for implementing the steps of the power consumption allocation method according to any one of claims 1 to 11 when executing the computer program.
13. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the steps of the power consumption allocation method according to any one of claims 1 to 11 are implemented when the computer program is executed by a processor.
14. A computer program product, comprising a computer program, characterized in that, The steps of the power consumption allocation method according to any one of claims 1 to 11 are implemented when the computer program is executed by a processor.
Citation Information
Patent Citations
Intelligent computing cluster management system for intelligent scheduling
CN118760527A
Task allocation method and device, electronic equipment and computer program
CN118796441A