Power consumption control method and device, chip, electronic equipment and storage medium

By employing a machine learning-based power control method, which uses a classification model to predict hardware task types and dynamically adjust frequency and voltage, the power optimization problem of traditional methods under complex loads and variable environments is solved, achieving precise power management.

CN120951069APending Publication Date: 2025-11-14NANJING ILUVATAR COREX TECH CO LTD (DBA ILUVATAR COREX INC NANJING)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510825441.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Traditional hardware power consumption control methods are ill-suited to handling complex workloads and changing operating environments, and cannot achieve precise power consumption optimization.

Method used

By acquiring power consumption data during hardware operation, power consumption prediction is performed using machine learning classification models. Combined with the correspondence between task type and frequency/voltage, frequency and voltage are dynamically adjusted to achieve precise power consumption control.

Benefits of technology

It adapts to different hardware platforms and application scenarios, achieving more precise power consumption control and providing new ideas for power consumption optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120951069A_ABST
    Figure CN120951069A_ABST
Patent Text Reader

Abstract

The invention relates to a power consumption control method and device, a chip, electronic equipment and a storage medium, and belongs to the field of power consumption control. The power consumption control method is characterized by comprising the following steps: acquiring current power consumption related data of an object to be controlled; a classification device is utilized to obtain the current work task type of the to-be-controlled object according to the power consumption related data, and a classification model is deployed in the classification device or a hardware circuit corresponding to the classification model is contained in the classification device; obtaining an optimal frequency and an optimal voltage corresponding to the work task type according to a preset corresponding relationship between the work task type and the frequency voltage; and adjusting the current frequency and voltage of the to-be-controlled object based on the optimal frequency and the optimal voltage. The power consumption control method provided by the invention can adapt to different hardware platforms and application scenes, can also realize more accurate power consumption control, and provides a new idea for power consumption optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of power consumption control, specifically relating to a power consumption control method, device, chip, electronic device, and storage medium. Background Technology

[0002] In the field of hardware power consumption control, with the increasing complexity and performance requirements of hardware systems, power consumption optimization and control have become key design issues. Traditional hardware power consumption control methods typically rely on predefined power consumption strategies, mainly achieved through the application of techniques such as Dynamic Voltage Scaling (DVS) and Dynamic Frequency Scaling (DFS). However, with the increasing integration of chips and the widespread use of multi-core processors, traditional methods face challenges and struggle to cope with complex workloads and changing operating environments. Summary of the Invention

[0003] Therefore, the purpose of this application is to provide a power consumption control method, device, chip, electronic device and storage medium to improve the problem that traditional power consumption management methods are difficult to cope with complex workloads and changing operating environments.

[0004] The embodiments of this application are implemented as follows: In a first aspect, embodiments of this application provide a power consumption control method, comprising: acquiring current power consumption-related data of an object to be controlled; using a classification device to obtain the current working task type of the object to be controlled based on the power consumption-related data, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; obtaining the optimal frequency and optimal voltage corresponding to the current working task type according to a preset correspondence between working task type and frequency-voltage; and adjusting the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

[0005] In the above embodiments, a power consumption control method based on machine learning is provided. By acquiring various power consumption-related data (such as load, voltage, temperature, frequency, and power consumption) during hardware operation, a classification model or a hardware circuit containing the classification model is used to predict the current task type based on the power consumption-related data. Then, by combining the correspondence between the task type and frequency and voltage, the optimal frequency and optimal voltage corresponding to the current task type can be obtained, and the current frequency and voltage of the object to be controlled can be adjusted accordingly. In this way, it can adapt to different hardware platforms and application scenarios, and can also achieve more accurate power consumption control, providing a new approach to power consumption optimization.

[0006] In one possible implementation of the first aspect embodiment, the classification device is equipped with a classification model. Before using the classification device to obtain the current task type of the object to be controlled based on the power consumption related data, the method further includes: acquiring a sample dataset, wherein the sample dataset contains multiple sets of power consumption related data with labels for various task types, each set of power consumption related data has the same parameter dimension, and at least two or more parameters are different in different sets of power consumption related data; and training the classification model using the sample dataset to obtain the trained classification model.

[0007] In the above embodiments, if a classification model is deployed in the classification device, multiple sets of power consumption-related data with various task type labels can be used to train the classification model, so that the trained classification model can learn the correspondence between different power consumption-related data and task types, so as to make task type predictions using the classification model in order to cope with complex workloads and changing operating environments.

[0008] In one possible implementation of the first aspect embodiment, the classification device includes a hardware circuit corresponding to the classification model. Before obtaining the current task type of the object to be controlled based on the power consumption related data using the classification device, the method further includes: acquiring a sample dataset, wherein the sample dataset contains multiple sets of power consumption related data with labels for various task types, each set of power consumption related data has the same parameter dimension, and at least two or more parameters differ between different sets of power consumption related data; training the classification model using the sample dataset to obtain the trained classification model; and obtaining the hardware circuit corresponding to the classification model based on the weight parameters and bias parameters of the classification model, wherein the function of the hardware circuit is consistent with the function of the classification model.

[0009] In the above embodiments, if the classification device includes a hardware circuit corresponding to the classification model, it can use multiple sets of power consumption-related data with various task type labels to train the classification model, so that the trained classification model can learn the correspondence between different power consumption-related data and task types. Then, based on the weight parameters and bias parameters of the classification model, the hardware circuit corresponding to the classification model can be obtained, which is convenient for subsequent use of the hardware circuit corresponding to the classification model to predict the task type, so as to cope with complex workloads and changing operating environments.

[0010] In one possible implementation of the first aspect embodiment, obtaining a sample dataset includes: obtaining multiple sets of power consumption-related data; clustering the multiple sets of power consumption-related data according to specified multiple work task types to obtain clustering results; and adding a work task type label corresponding to the cluster to the data groups belonging to the same cluster in the clustering results to obtain the sample dataset.

[0011] In the above embodiments, by clustering multiple sets of power consumption-related data according to multiple specified work task types, and adding corresponding work task type labels to the data groups within the same cluster based on the clustering results, multiple sets of power consumption-related data with multiple work task type labels can be accurately obtained.

[0012] In one possible implementation of the first aspect embodiment, the classification model is an optimal classification model, which is the classification model with the smallest loss error among multiple classification models with different activation functions.

[0013] In the above embodiments, by selecting the classification model with the smallest loss error from multiple classification models with different activation functions, and by identifying the advantages and disadvantages of different algorithms, the best algorithm selection can be provided for hardware design, which is conducive to achieving more accurate power consumption control.

[0014] In one possible implementation of the first aspect embodiment, the optimal classification model is obtained through the following steps: training multiple first classification models under different activation functions using a sample dataset with a first data precision; training multiple second classification models under different activation functions using a sample dataset with a second data precision, wherein the second data precision is less than the first data precision; inputting target power consumption related data with the first data precision into the multiple first classification models for classification prediction, and inputting target power consumption related data with the second data precision into the multiple second classification models for classification prediction; obtaining the loss error between the classification results of the first classification model and the classification results of the second classification model under the same activation function, thus obtaining the loss error under different activations; selecting the classification model corresponding to the activation function with the smallest loss error from the loss errors under different activations as the optimal classification model.

[0015] In the above embodiments, multiple first-classification models under different activation functions are trained as references, and multiple second-classification models under different activation functions are trained as targets. Then, target power consumption-related data are input into the reference and target models respectively. The differences in classification results between the reference and target models under the same activation function (such as Sigmoid) are compared to obtain the loss error under Sigmoid. For other activation functions, the same processing method is used to obtain the loss error under different activations. Finally, from the loss errors under different activations, the classification model corresponding to the activation function with the smallest loss error (which can be either a first-classification model or a second-classification model) is selected as the optimal classification model. This allows for the accurate selection of the optimal classification model with the highest accuracy. By identifying the advantages and disadvantages of different algorithms, the best algorithm selection is provided for hardware design, which is beneficial for achieving more precise power consumption control.

[0016] Secondly, embodiments of this application also provide a power consumption control device, including: an acquisition module, a prediction module, and an adjustment module; the acquisition module is used to acquire current power consumption-related data of the object to be controlled; the prediction module is used to use a classification device to obtain the current working task type of the object to be controlled based on the power consumption-related data, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; and to obtain the optimal frequency and optimal voltage corresponding to the working task type based on a preset correspondence between the working task type and frequency and voltage; the adjustment module is used to adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

[0017] Thirdly, embodiments of this application also provide a chip, including: a data acquisition module, a classification device, and a power management module; the data acquisition module is used to acquire current power consumption-related data of the object to be controlled; the classification device is used to obtain the current working task type of the object to be controlled based on the power consumption-related data, wherein the classification device is equipped with a classification model or includes hardware circuitry corresponding to the classification model; and the optimal frequency and optimal voltage corresponding to the current working task type are obtained according to a preset correspondence between working task type and frequency-voltage; the power management module is used to adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

[0018] Fourthly, embodiments of this application also provide an electronic device, including: a memory and a processor, the processor being connected to the memory; the memory being used to store a program; the processor being used to invoke the program stored in the memory to perform a method provided as described in the first aspect embodiments and / or in combination with any possible implementation of the first aspect embodiments.

[0019] Fifthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the method provided by any possible implementation of the first aspect embodiments and / or in combination with the first aspect embodiments.

[0020] Other features and advantages of this application will be set forth in the following description. The objectives and other advantages of this application can be realized and obtained through the structures specifically pointed out in the written description and the accompanying drawings. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings. The above and other objects, features, and advantages of this application will become clearer through the accompanying drawings.

[0022] Figure 1 A flowchart illustrating a power consumption control method provided in an embodiment of this application is shown.

[0023] Figure 2 A schematic diagram of the structure of a chip provided in an embodiment of this application is shown.

[0024] Figure 3 A schematic diagram of a power consumption control device provided in an embodiment of this application is shown.

[0025] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The following embodiments are provided as examples to more clearly illustrate the technical solutions of this application, and should not be used to limit the scope of protection of this application. Those skilled in the art will understand that, without conflict, the following embodiments and features can be combined with each other.

[0027] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0028] Furthermore, the term "and / or" in this application is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0029] In the description of the embodiments of this application, unless otherwise expressly specified and limited, the technical term "connection" can be a direct connection or an indirect connection through an intermediate medium.

[0030] Given that traditional power management methods struggle to cope with complex workloads and changing operating environments, this application provides a machine learning-based power control method and apparatus. By acquiring various power-related data during hardware operation, such as load, voltage, temperature, frequency, and power consumption, it uses classification models such as Neural Network (NN) or Logistic Regression (LR) to predict power consumption. This not only adapts to different hardware platforms and application scenarios but also enables more precise power control, providing a new approach to power optimization.

[0031] The following is combined Figure 1 The power consumption control method provided in the embodiments of this application will be described. This power consumption control method can be applied to the object to be controlled itself, or to a third-party device or equipment outside the object to be controlled. The power consumption control method includes the following steps.

[0032] S1: Obtain the current power consumption data of the object to be controlled.

[0033] When performing power consumption control on an object, it is necessary to obtain the current power consumption-related data of the object. This power consumption-related data refers to data related to power consumption, including but not limited to load, voltage, temperature, frequency, and power consumption. These parameters are all related to power consumption. In addition, power consumption-related data may also include parameters such as power limits.

[0034] The object to be controlled can be any object that has power consumption control requirements, including but not limited to chips, circuits, hardware devices, platforms, electronic devices, etc.

[0035] The data precision of the power consumption data of the controlled object obtained above can be FP16 precision. Since the choice of precision affects computational efficiency, and FP16 precision can reduce memory usage and computational cost, it is suitable for fast inference tasks supported by hardware. In addition, in some scenarios, other data precisions can also be used, such as FP32, FP64, etc.

[0036] S2: Using a classification device, the current task type of the object to be controlled is obtained based on power consumption data.

[0037] After obtaining the current power consumption data of the object to be controlled, a classification device can determine the current task type of the object based on this data. The classification device contains a classification model or corresponding hardware circuitry. Alternatively, the power consumption data can be input into the classification model or its corresponding hardware circuitry for classification prediction to obtain the current task type of the object.

[0038] Understandably, when inputting power consumption-related data into the classification model or the corresponding hardware circuit for classification prediction, it is necessary to perform alignment and normalization preprocessing on these data to obtain relevant features, and then input the preprocessed data into the classification model or the corresponding hardware circuit for classification prediction.

[0039] If a classification model is deployed in the classification device, in one implementation, this classification model can be a pre-trained model trained by a third party. In other implementations, before S2, the power consumption control method further includes: acquiring a sample dataset, training the classification model using the sample dataset, and obtaining a trained classification model. This allows the trained classification model to learn the correspondence between different power consumption-related data and task types, facilitating subsequent task type prediction using the classification model. The specific process of training the classification model using the sample dataset will not be described here; existing training methods can be used.

[0040] The sample dataset contains multiple sets of power consumption-related data labeled with various work task types. Each set of power consumption-related data has the same parameter dimensions, and at least two or more parameters differ between different sets of power consumption-related data. For example, each set of power consumption-related data includes the aforementioned parameters such as load, voltage, temperature, frequency, and power consumption, and at least two or more parameters differ between different sets of power consumption-related data.

[0041] Each set of power consumption-related data carries a task type label. Multiple sets of power consumption-related data can share the same task type label. For example, assuming there are 1000 (configurable) sets of power consumption-related data and 6 (configurable) task type labels: Label 1, Label 2, Label 3, Label 4, Label 5, and Label 6, then 100 sets of power consumption-related data correspond to Label 1, 200 sets to Label 2, 300 sets to Label 3, 100 sets to Label 4, 200 sets to Label 5, and 100 sets to Label 6. This example is merely illustrative and serves to illustrate that each set of power consumption-related data carries a task type label, and multiple sets of power consumption-related data can share the same task type label.

[0042] The various work task types mentioned above can be: 1. Computation-intensive: The system is highly dependent on computing resources at this stage, requiring an increase in computing frequency; computation-intensive systems need high frequencies. 2. Memory-intensive: The system has high memory bandwidth utilization at this time. Memory-intensive systems require stable power supply and need to reduce frequency. 3. High-temperature safety type: The reaction system is in a state of thermal risk, and it is necessary to limit the voltage and frequency. For example, if it is in an overheating state, the voltage and frequency need to be reduced to ensure temperature safety. 4. Low-temperature adjustable type: When the reaction system is in a cold or normal temperature state, the voltage and frequency can be increased to accelerate the operation; 5. High-performance sensitive type: The current system's tasks are sensitive to latency or throughput, requiring locking in high frequency and operating at high frequency as much as possible; 6. Low power consumption type: The current system's task objective is to minimize power consumption, which can be achieved by sacrificing performance to keep power consumption at a stable low value.

[0043] In one possible implementation, the sample dataset can be obtained directly from a database or storage device. In this implementation, the required sample dataset needs to be obtained in advance and stored in the database or storage device for later use.

[0044] In another possible implementation, when obtaining the sample dataset, the following steps can be taken: obtain multiple sets of power consumption-related data (initial sample dataset); cluster the multiple sets of power consumption-related data according to multiple specified work task types to obtain clustering results; add the work task type label corresponding to the cluster to the data groups belonging to the same cluster in the clustering results to obtain the required sample dataset.

[0045] For example, the K-means algorithm can be used to cluster multiple sets of power-related data containing voltage, frequency, load, power consumption, and temperature, with the aim of classifying the data into the aforementioned six categories. The specific process is as follows: First, six representative initial samples (each corresponding to a set of power consumption-related data) are selected from the initial sample dataset as initial cluster centers. The selection of these initial samples can be flexibly determined based on data characteristics; for example, typical samples reflecting different combinations of data features can be chosen to ensure coverage of different regions of the data distribution. Next, for each sample in the initial sample dataset, its distance to the six initial cluster centers is calculated, and the sample is assigned to the category of the nearest center. Subsequently, for each category, the average value is recalculated based on the feature data of all samples in that category, thereby updating the cluster center of that category to make the center more closely reflect the overall characteristics of the samples within the category. This process of "distance calculation - sample classification - cluster center update" is repeated until the change in cluster centers is sufficiently small or the error reaches the expected effect. At this point, the clustering result is considered stable, and the iteration stops. Through this process, the samples in the initial sample dataset will be effectively divided into six categories. Samples within each category have high similarity in characteristics such as voltage, frequency, load, power consumption, and temperature, forming a clear distinction between categories, thus achieving cluster analysis of multi-dimensional data. After dividing the multiple power consumption-related data in the initial sample dataset into 6 categories, the data groups belonging to the same cluster in the clustering results are labeled with the corresponding work task type to obtain the required sample dataset.

[0046] The initial sample dataset is relative to the final sample dataset. The initial sample dataset contains multiple sets of power consumption-related data, while the final sample dataset contains multiple sets of power consumption-related data with labels for various task types.

[0047] In one possible implementation, the classification model described above can be the optimal classification model, where the optimal classification model is the one with the smallest loss error among various classification models using different activation functions. It is understood that in some implementations, the classification model described above may not be the optimal one; therefore, the classification model should not be interpreted as only being the optimal one.

[0048] Multiple classification models with different activation functions can be pre-trained. Then, the classification model with the smallest loss error among the multiple classification models with different activation functions is selected as the optimal classification model.

[0049] In one possible implementation, the optimal classification model can be obtained from a third party. In another possible implementation, the optimal classification model is obtained through the following steps: using a sample dataset with a first data precision, train multiple first classification models under different activation functions; using a sample dataset with a second data precision, train multiple second classification models under different activation functions, where the second data precision is less than the first data precision, and the only difference between the sample datasets used to train the first and second classification models is the data precision; input the target power consumption related data with the first data precision into multiple first classification models for classification prediction, and input the target power consumption related data with the second data precision into multiple second classification models for classification prediction; obtain the loss error between the classification results of the first and second classification models under the same activation function, thus obtaining the loss error under different activations; finally, select the classification model corresponding to the activation function with the smallest loss error from the loss errors under different activations as the optimal classification model.

[0050] Different activation functions correspond to different loss values. The activation functions for a classification model can be: 1. Sigmoid: Suitable for probability output or normalization scenarios. The formula is:

[0051] 2. ReLU: Solves the vanishing gradient problem, commonly used in deep learning. The formula is:

[0052] 3. Tanh: Normalizes the output to [-1, 1], suitable for balanced input distributions.

[0053] 4. Hard Sigmoid: Approximates Sigmoid, improving computational efficiency. The formula is:

[0054] 5. User-defined function: y = x / (1 + x), providing controllable nonlinear characteristics.

[0055] For a classification model that includes a hidden layer and an output layer, x above represents the input data of the hidden layer or the input data of the output layer.

[0056] The first and second classification models have the same structure and the same types, for example, there can be 5 types. The activation functions of the first or second classification models of different types are different. For example, the activation functions of the 5 first classification models correspond one-to-one with the 5 activation functions mentioned above. Similarly, the activation functions of the 5 second classification models correspond one-to-one with the 5 activation functions mentioned above.

[0057] Using a sample dataset with the highest data precision (e.g., FP64), multiple primary classification models under different activation functions can be trained as references, resulting in the aforementioned five primary classification models with different activation functions. Similarly, using a sample dataset with the second highest data precision (e.g., FP32 or FP16), multiple secondary classification models under different activation functions can be trained as targets, resulting in the aforementioned five secondary classification models with different activation functions. Then, the target power consumption data with the second highest data precision is input into the five trained primary classification models for classification prediction, yielding the classification results for the task type. Similarly, the target power consumption data with the first highest data precision is input into the five trained secondary classification models for classification prediction, yielding the classification results for the task type. Next, the loss error between the classification results of the primary and secondary classification models under the same activation function (e.g., Sigmoid) is obtained, yielding the loss error under Sigmoid. For the other activation functions, the same processing method is used to obtain the loss errors under different activations. Finally, among the loss errors under different activations, the classification model corresponding to the activation function with the smallest loss error (which can be the first classification model or the second classification model) is selected as the optimal classification model. For example, among the activation functions, ReLU has the smallest loss error, so the second classification model with ReLU activation function is the optimal classification model.

[0058] Furthermore, after obtaining the classification results of different types of primary classification models and different types of secondary classification models, and / or the loss errors under different activations, these results can be exported in formats such as CSV (Comma-Separated Values) files for subsequent analysis and optimization. This function ensures data traceability, identifies the advantages and disadvantages of different algorithms at different levels of accuracy, thereby providing optimal algorithm selection and parameter configuration for hardware design, and offering a solid data foundation for further optimization of hardware power consumption control algorithms.

[0059] The various precision levels mentioned above (such as FP16, FP32, and FP64) can adapt to the needs of different computing scenarios. For example, FP16 reduces memory usage and computational cost, making it suitable for hardware-supported fast inference tasks. FP32 is commonly used in deep learning, balancing computational precision and efficiency. FP64 is used for research scenarios with extremely high numerical precision requirements.

[0060] The classification model described above can be a neural network model. A simple fully connected neural network model (SimpleNN) can be built using the PyTorch architecture, containing an input layer, hidden layers, and an output layer. The network model supports inputs with different data precisions (e.g., FP16, FP32, FP64). By changing the precision parameter, the impact of different computational precisions on the neural network's prediction performance can be simulated. The input data for SimpleNN can be power-related data with a specified batch size of 1000 and a dimension of 5. The input data is processed through linear transformations and activation functions in the hidden layers to generate hidden layer output data. The hidden layer output data is then processed through linear transformations and activation functions in the output layer to generate classification results. The classification results are transformed into a probability distribution using the Softmax function and then encoded using One-Hot encoding to generate the final prediction results. The activation functions for the hidden and output layers can be switched between various options such as Sigmoid, ReLU, and Tanh.

[0061] The classification model described above can be a logistic regression model. A logistic regression model can be built using the PyTorch architecture. The logistic regression part uses a similar approach, but unlike neural network models, it has no hidden layers. The input data undergoes linear transformation and activation function processing directly in the output layer to generate classification results. These results are then transformed into a probability distribution using the Softmax function and finally generated using One-Hot encoding to produce the final prediction result. The input data for the logistic regression model is similar to that of the SimpleNN part, using power-related data with a batch size of 1000 and a dimension of 5 as input, and supporting input data of different precisions. The activation function can be switched between various options such as Sigmoid, ReLU, and Tanh.

[0062] In one possible implementation, the classification device includes a hardware circuit corresponding to the classification model. Before S2, the power consumption control method described above may further include: acquiring a sample dataset, training the classification model using the sample dataset to obtain a trained classification model, and obtaining the hardware circuit corresponding to the classification model based on the weight parameters and bias parameters of the classification model. The function of the hardware circuit is consistent with the function of the classification model. In this implementation, the classification model can be trained first, and then the hardware circuit corresponding to the classification model can be obtained based on the weight parameters and bias parameters of the classification model. The function of this hardware circuit is consistent with the function of the classification model. It is understood that when the classification model is the optimal classification model, the classification device includes the hardware circuit corresponding to the optimal classification model.

[0063] When obtaining the hardware circuit corresponding to the classification model based on its weight and bias parameters, a custom simulation model (which can include hidden and output layers) can be created using the NumPy architecture (implemented based on the PyTorch architecture). This model uses the weight and bias parameters of the classification model to perform the simulation model calculations. For example: for the hidden layer calculation of the simulation model: perform matrix multiplication between the input data and the hidden layer weights of the classification model, and add the hidden layer bias of the classification model, i.e., input data * hidden layer weights + hidden layer bias. The activation function processing for the hidden and output layers of the simulation model is consistent with the activation function of the PyTorch model. For the output layer calculation of the simulation model: perform matrix multiplication between the hidden layer output of the simulation model and the output layer weights of the classification model, add the output layer bias of the classification model, and then generate the classification result. The classification result uses the Softmax function to calculate the classification probability, and then uses One-Hot encoding to generate the final prediction result. Next, the prediction results obtained from the classification model (implemented using PyTorch architecture) and the simulation model (implemented using NumPy architecture) are compared. If the results are inconsistent, the structural parameters of the simulation model are adjusted to make the prediction results obtained by the classification model and the simulation model consistent. Then, the simulation model based on the NumPy architecture is designed in hardware to obtain the corresponding hardware circuit.

[0064] S3: Based on the preset correspondence between task type and frequency voltage, obtain the optimal frequency and optimal voltage corresponding to the current task type.

[0065] After obtaining the current task type, the optimal frequency and optimal voltage corresponding to the current task type are obtained according to the preset correspondence between task type and frequency voltage. The current task type can be one of the six task types mentioned above.

[0066] It is necessary to obtain the correspondence between different operating task types and frequencies and voltages beforehand. Understandably, different operating task types have corresponding optimal frequencies and voltages. For example, the optimal frequency and voltage for low-power operation differ from those for high-temperature safety operation, and similarly, they differ from those for low-temperature adjustment operation. This correspondence can be obtained through prior experimentation and then stored in a database or storage device for later use.

[0067] In one possible implementation, after clustering multiple sets of power consumption-related data according to various specified task types, Pareto optimization is used for each data set within a cluster to find the optimal combination of frequency and voltage for each cluster. S4: Adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and optimal voltage.

[0068] After obtaining the optimal frequency and optimal voltage, the current frequency and voltage of the object to be controlled are adjusted based on the optimal frequency and optimal voltage. For example, the current frequency of the object to be controlled is adjusted to the optimal frequency, and the current voltage of the object to be controlled is adjusted to the optimal voltage.

[0069] This application also provides a chip, such as... Figure 2 As shown, it includes: a data acquisition module, a classification device, and a power management module. The data acquisition module is connected to the classification device and the power management module, and the classification device is connected to the power management module.

[0070] The acquisition module is used to obtain current power consumption-related data of the object under control. This data can include load, voltage, temperature, frequency, and power consumption. The acquisition module can include current sensors for current acquisition, voltage sensors for voltage acquisition, and temperature sensors for temperature acquisition. Based on the acquired current and voltage, the acquisition module can derive the load and power consumption. In addition to acquiring power consumption-related data in real time, the acquisition module can also obtain power consumption-related data from other devices or modules within the chip, such as obtaining the frequency from the phase-locked loop and the power consumption from the power management module.

[0071] A classification device is used to obtain the current working task type of the object to be controlled based on the power consumption related data, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; and obtains the optimal frequency and optimal voltage corresponding to the current working task type based on a preset correspondence between working task type and frequency voltage.

[0072] The power management module is used to adjust the current frequency and voltage of the controlled object based on the optimal frequency and the optimal voltage. When adjusting the frequency, the power management module can adjust the chip's operating frequency through a phase-locked loop; when adjusting the voltage, it can adjust the chip's operating voltage through the power management module.

[0073] In one possible implementation, the power management module, the power supply management module, and the phase-locked loop can be integrated together or partially integrated together.

[0074] The aforementioned chips include, but are not limited to, processors. These processors can be general-purpose processors, including Central Processing Units (CPUs), Network Processors (NPs), Graphics Processing Units (GPUs), Accelerated Processing Units (ACCUs), Multimedia Application Processors (MAPs), microprocessors, etc.; they can also be Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Alternatively, the processor can be any conventional processor.

[0075] This application embodiment also provides a power consumption control device 100, such as... Figure 3 As shown, the power consumption control device 100 includes: an acquisition module 110, a prediction module 120, and an adjustment module 130.

[0076] The acquisition module 110 is used to acquire the current power consumption related data of the object to be controlled.

[0077] The prediction module 120 is used to obtain the current working task type of the object to be controlled based on the power consumption related data using a classification device, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; and to obtain the optimal frequency and optimal voltage corresponding to the working task type based on a preset correspondence between working task type and frequency voltage.

[0078] The adjustment module 130 is used to adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

[0079] If the classification device is equipped with a classification model, the power consumption control device 100 further includes a processing module for acquiring a sample dataset, training the classification model using the sample dataset, and obtaining the trained classification model. The sample dataset contains multiple sets of power consumption-related data with labels for various work task types. Each set of power consumption-related data has the same parameter dimension, and at least two or more parameters are different in different sets of power consumption-related data.

[0080] If the classification device includes a hardware circuit corresponding to the classification model, the power consumption control device 100 further includes: a processing module, used to acquire a sample dataset, and use the sample dataset to train the classification model to obtain the trained classification model; wherein, the weight parameters and bias parameters of the classification model are used to obtain the hardware circuit corresponding to the classification model.

[0081] Specifically, the processing module is used to acquire multiple sets of power consumption-related data; cluster the multiple sets of power consumption-related data according to multiple specified work task types to obtain clustering results; and add the work task type label corresponding to the cluster to the data groups belonging to the same cluster in the clustering results to obtain the sample dataset.

[0082] The processing module obtains the optimal classification model through the following steps: Using a sample dataset with a first data precision, multiple first classification models under different activation functions are trained; using a sample dataset with a second data precision, multiple second classification models under different activation functions are trained, where the second data precision is less than the first data precision. Target power consumption related data with the first data precision are input into the multiple first classification models for classification prediction, and target power consumption related data with the second data precision are input into the multiple second classification models for classification prediction. The loss error between the classification results of the first classification model and the classification results of the second classification model under the same activation function is obtained, thus obtaining the loss error under different activations. From the loss errors under different activations, the classification model corresponding to the activation function with the smallest loss error is selected as the optimal classification model. The power consumption control device 100 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment. like Figure 4 As shown, Figure 4 This diagram illustrates a structural block diagram of an electronic device 200 provided in an embodiment of this application. The electronic device 200 includes: a transceiver 210, a memory 220, a communication bus 230, and a processor 240. The transceiver 210, memory 220, and processor 240 are electrically connected directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 230 or signal lines. The transceiver 210 is used to send and receive data. The memory 220 is used to store computer programs, such as... Figure 3The software functional module shown is the power consumption control device 100. The power consumption control device 100 includes at least one software functional module that can be stored as software or firmware in the memory 220 or embedded in the operating system (OS) of the electronic device 200. The processor 240 is used to execute the software functional module or computer program stored in the memory 220. For example, the processor 240 is used to execute the power consumption control method described above.

[0083] The memory 220 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0084] Processor 240 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), Network Processor (NP), Graphics Processing Unit (GPU), Accelerated Processing Unit (ACCU), Multimedia Application Processor (MAP), microprocessor, etc.; it can also be a Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. Alternatively, processor 240 can also be any conventional processor.

[0085] Among them, the aforementioned electronic devices 200 include, but are not limited to, mobile phones, tablets, laptops, servers, etc.

[0086] This application embodiment also provides a non-volatile computer-readable storage medium (hereinafter referred to as the storage medium) storing a computer program, which, when run by a computer such as the electronic device 200 described above, executes the power consumption control method described above.

[0087] This application also provides a computer program product, which includes a computer program. When the computer program is executed by a computer, it performs the power consumption control method described above.

[0088] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0089] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0090] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0091] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, laptop, server, or electronic device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned computer-readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0092] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A power consumption control method, characterized in that, include: Obtain the current power consumption data of the object to be controlled; The current task type of the object to be controlled is obtained by using a classification device based on the power consumption related data, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model. Based on the preset correspondence between task type and frequency voltage, the optimal frequency and optimal voltage corresponding to the current task type are obtained; Based on the optimal frequency and the optimal voltage, adjust the current frequency and voltage of the object to be controlled.

2. The power consumption control method according to claim 1, characterized in that, The classification device is equipped with a classification model. Before using the classification device to determine the current task type of the object to be controlled based on the power consumption-related data, the method further includes: Obtain a sample dataset, wherein the sample dataset contains multiple sets of power consumption related data with labels for various work task types, each set of power consumption related data has the same parameter dimension, and at least two or more parameters are different in different sets of power consumption related data; The classification model is trained using the sample dataset to obtain the trained classification model.

3. The power consumption control method according to claim 1, characterized in that, The classification device includes hardware circuitry corresponding to the classification model. Before using the classification device to determine the current task type of the object to be controlled based on the power consumption-related data, the method further includes: Obtain a sample dataset, wherein the sample dataset contains multiple sets of power consumption related data with labels for various work task types, each set of power consumption related data has the same parameter dimension, and at least two or more parameters are different in different sets of power consumption related data; The classification model is trained using the sample dataset to obtain the trained classification model; Based on the weight parameters and bias parameters of the classification model, a hardware circuit corresponding to the classification model is obtained, wherein the function of the hardware circuit is consistent with the function of the classification model.

4. The power consumption control method according to claim 2 or 3, characterized in that, Obtain the sample dataset, including: Acquire multiple sets of power consumption related data; The multiple sets of power consumption-related data are clustered according to various specified work task types to obtain clustering results; For data groups belonging to the same cluster in the clustering results, add the corresponding task type label of the cluster to obtain the sample dataset.

5. The power consumption control method according to claim 2 or 3, characterized in that, The classification model is the optimal classification model, which is the classification model with the smallest loss error among multiple classification models with different activation functions.

6. The power consumption control method according to claim 5, characterized in that, The optimal classification model is obtained through the following steps: Using a sample dataset with the highest data precision, train multiple first-class classification models under different activation functions; Using a sample dataset with a second data precision, train multiple second classification models under different activation functions, wherein the second data precision is less than the first data precision; The target power consumption related data with the first data precision are input into multiple first classification models for classification prediction, and the target power consumption related data with the second data precision are input into multiple second classification models for classification prediction. Obtain the loss error of the classification results of the first classification model and the second classification model under the same activation function, and obtain the loss error under different activations; From the loss errors under different activations, the classification model corresponding to the activation function with the smallest loss error is selected as the optimal classification model.

7. A power consumption control device, characterized in that, include: The acquisition module is used to acquire the current power consumption data of the object to be controlled; The prediction module is used to obtain the current working task type of the object to be controlled based on the power consumption related data using a classification device, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; and to obtain the optimal frequency and optimal voltage corresponding to the working task type based on a preset correspondence between working task type and frequency voltage. The adjustment module is used to adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

8. A chip, characterized in that, include: The acquisition module is used to obtain the current power consumption data of the object to be controlled; A classification device is used to obtain the current working task type of the object to be controlled based on the power consumption related data, wherein the classification device is equipped with a classification model or contains hardware circuitry corresponding to the classification model; and obtains the optimal frequency and optimal voltage corresponding to the current working task type based on a preset correspondence between working task type and frequency voltage. The power management module is used to adjust the current frequency and voltage of the object to be controlled based on the optimal frequency and the optimal voltage.

9. An electronic device, characterized in that, include: A memory and a processor, wherein the processor is connected to the memory; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to execute the method as described in any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a processor, performs the method as described in any one of claims 1-6.