Power consumption control module and method

By designing a power consumption control module in electronic equipment, and using the prediction unit and the control unit to periodically detect and control the event parameters of the target event, the problem of poor power consumption control timeliness in the prior art is solved, and real-time and precise control of the power consumption of each module is achieved.

CN120085740APending Publication Date: 2025-06-03SMARTER SILICON (SHANGHAI) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510264743.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

When power consumption control in electronic devices in prior art, software needs to regulate power consumption according to the use scenarios within a long time window, resulting in poor timeliness and inability to control power consumption according to the needs of each module in real time.

Method used

A power consumption control module is designed, including a prediction unit and a control unit. The prediction unit detects event parameters of the target event according to the prediction period and stores the predicted value. The control unit obtains the predicted value according to the control period and controls the power consumption parameters of the target module.

Benefits of technology

Real-time control of the power consumption of each module in electronic equipment is achieved, timeliness is improved, power consumption parameters are more in line with actual operation requirements, and the risk of too low or too high configuration is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120085740A_ABST
    Figure CN120085740A_ABST
Patent Text Reader

Abstract

The invention discloses a power consumption control module and method, and the module comprises a prediction unit which is used for periodically detecting an event parameter of a target event according to a prediction period, and storing a predicted value of the corresponding event parameter in a next prediction period according to the event parameter, and the target event is related to a to-be-controlled target module; the prediction value represents a possible numerical value of the event parameter in the next prediction period, the prediction value is determined according to the event parameters of at least two continuous prediction periods, and the at least two continuous prediction periods comprise the current prediction period; and the control unit is used for periodically obtaining the prediction value currently stored by the prediction unit according to a control period, and controlling the power consumption parameter of the target module according to the prediction value in the current control period.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application based on the application with the application number 202411186583.1, the application date of August 27, 2024, and the invention title of "A Power Consumption Control Module and Method". The entire content of the original application is incorporated herein by reference. Technical Field

[0002] This application relates to the technical field of power consumption control, and particularly to a power consumption control module and method. Background Art

[0003] Generally, various modules with different functions are configured in electronic devices, such as a cache module for providing cache.

[0004] In order to reduce power consumption, some electronic devices are configured with specific power consumption control software, which identifies the usage scenarios of the devices through the power consumption control software, and then regulates the power consumption of the corresponding modules based on the usage scenarios.

[0005] The problem with this method is that the software needs to regulate power consumption according to the usage scenarios of the electronic device within a relatively long time window (such as 5 minutes, 10 minutes), which results in a long time window for software regulation, poor timeliness, and inability to control power consumption in real time according to the requirements of each module in the electronic device. Summary of the Invention

[0006] Therefore, the present application discloses the following technical solutions:

[0007] In the first aspect of the present application, a power consumption control module is provided, including:

[0008] A prediction unit, configured to periodically detect event parameters of a target event according to a prediction period, and store prediction values corresponding to the event parameters in the next prediction period according to the event parameters, where the target event is related to a target module to be controlled;

[0009] A control unit, configured to periodically obtain the prediction value currently stored by the prediction unit according to a control period, and control the power consumption parameters of the target module according to the prediction value within the current control period.

[0010] Optionally, the number of the target modules is multiple, and each target module corresponds to a prediction unit and a control unit;

[0011] The target event detected by each prediction unit is related to the target module corresponding to the prediction unit;

[0012] Each control unit controls the power consumption parameters of the corresponding target module according to the prediction value output by the prediction unit corresponding to the same target module.

[0013] Optionally, controlling the power consumption parameter of the target module according to the predicted value in the current control period includes:

[0014] Determine the power consumption parameter level corresponding to the predicted value;

[0015] In the current control period, set the value of the power consumption parameter of the target module to the value corresponding to the power consumption parameter level.

[0016] Optionally, the prediction unit includes:

[0017] A filtering unit, configured to determine the exponentially weighted moving average of the current prediction period according to the event parameter;

[0018] A storage unit, configured to store the predicted value of the next prediction period according to the exponentially weighted moving average of the current prediction period and the exponentially weighted moving average of the previous prediction period.

[0019] Optionally, the filtering unit determines the exponentially weighted moving average of the current prediction period according to the event parameter, including:

[0020] Determine the exponentially weighted moving average of the current prediction period according to the event parameter detected in the current prediction period and the exponentially weighted moving average of the previous prediction period.

[0021] Optionally, the filtering unit determines the exponentially weighted moving average of the current prediction period according to the event parameter detected in the current prediction period and the exponentially weighted moving average of the previous prediction period, including:

[0022] Perform a shift processing on the event parameter detected in the current prediction period according to a first weight coefficient to obtain a first processing result;

[0023] Perform a shift processing on the exponentially weighted moving average of the previous prediction period according to a second weight coefficient to obtain a second processing result;

[0024] Determine the exponentially weighted moving average of the current prediction period according to the first processing result and the second processing result.

[0025] Optionally, the storage unit stores the predicted value of the next prediction period according to the exponentially weighted moving average of the current prediction period and the exponentially weighted moving average of the previous prediction period, including:

[0026] Perform a fixed-point operation according to the exponentially weighted moving average of the current prediction period and the exponentially weighted moving average of the previous prediction period to store the predicted value of the next prediction period.

[0027] Optionally, the prediction unit includes a statistical subunit;

[0028] The statistical subunit is configured to perform statistics in each of the prediction cycles in response to the target event generated by the target module, and obtain the event parameter of the target event;

[0029] The statistical subunit is further configured to restore the event parameter of the target event to the initial value at the end of each of the prediction cycles.

[0030] A second aspect of the present application provides a power consumption control method, including:

[0031] Periodically detecting the event parameter of the target event according to the prediction cycle, and storing the predicted value corresponding to the event parameter in the subsequent prediction cycle according to the event parameter, where the target event is related to the target module to be controlled;

[0032] Periodically obtaining the predicted value currently stored in the prediction unit according to the control cycle, and controlling the power consumption parameter of the target module according to the predicted value in the current control cycle.

[0033] Optionally, it further includes:

[0034] Configuring the prediction cycle and the control cycle according to the target module. Description of the Drawings

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0036] Figure 1 It is a schematic structural diagram of a power consumption control module provided by an embodiment of the present application;

[0037] Figure 2 It is a schematic structural diagram of another power consumption control module provided by an embodiment of the present application;

[0038] Figure 3 It is a schematic structural diagram of yet another power consumption control module provided by an embodiment of the present application;

[0039] Figure 4 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application;

[0040] Figure 5 It is a flowchart of a power consumption control method provided by an embodiment of the present application. Detailed Embodiments

[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0042] An embodiment of the present application provides a power consumption control module. Please refer to Figure 1 This module may include the following units.

[0043] A prediction unit 101, configured to periodically detect event parameters of a target event according to a prediction period, and store prediction values of corresponding event parameters in a next prediction period according to the event parameters. The target event is related to a target module to be controlled.

[0044] A control unit 102, configured to periodically obtain the prediction value currently stored by the prediction unit according to a control period, and control power consumption parameters of the target module according to the prediction value in the current control period.

[0045] The target module may be any module that needs to perform power consumption control during the operation of the electronic device. For example, it may be a processor module, a cache (cache) module for providing a cache, a network module for connecting to a network, etc.

[0046] The target event may be any event related to the target module generated during the operation of the target module. Different events may be determined as the target event according to different target modules.

[0047] As an example, when the target module is a cache module, the target event may be an event that other modules of the electronic device access the cache module. That is to say, each time the cache module is accessed, a target event may be triggered. The event triggered by the cache module may be a performance monitor unit (PMU) event.

[0048] The target event may be reported by the target module to the prediction unit. Taking the cache module as an example, each time the cache module is accessed, it may report a target event to the prediction unit.

[0049] The manner in which the target module reports an event may be that the target module sends a signal representing the target event to the prediction unit. Each time the prediction unit detects the signal, it is equivalent to detecting a target event.

[0050] The event parameters of the target event can be the number of times the detected target event occurs, the occurrence frequency of the detected target event, or other parameters related to the target event, without limitation.

[0051] The prediction period is used to control the frequency at which the prediction unit predicts the event parameters. In this embodiment, the prediction period can be represented by S1, and the specific duration of the prediction period can be set according to the actual situation, without limitation. For example, it can be set to 1 second, 100 milliseconds, etc.

[0052] Optionally, the prediction period can be set according to the required prediction accuracy. The shorter the set prediction period, the higher the prediction accuracy, and the closer the prediction value obtained by the prediction unit is to the actual event parameters of the target event in the next prediction period.

[0053] According to the different data to be processed by the electronic device, the event parameters of the target event can have different values in different prediction periods. Taking the event parameter of the target event as the number of times of the target event as an example, in the i-th prediction period after the power consumption control module is started, the number of times of the detected target event can be 20 times, in the (i + 1)-th prediction period, the detected number can be 30 times, and in the (i + 2)-th prediction period, the detected number can be 15 times, where i is any positive integer.

[0054] The number of times of the target event can be counted by a counter, and the prediction unit can directly read the counter value to obtain this parameter; the counter can be cleared at the end of each prediction period and start counting the number of times of the target event again.

[0055] The predicted value of the corresponding event parameter in the next prediction period is equivalent to the possible value of the event parameter predicted by the prediction unit in the next prediction period. Taking the event parameter of the target event as the number of times of the target event as an example, the predicted value of the corresponding event parameter in the next prediction period being 40 means that the prediction unit predicts that 40 times of the target event may be detected in the next prediction period.

[0056] After the power consumption control module is started, the prediction unit 101 can continuously detect the event parameters of the target event, and at the end of each prediction period, within a time much shorter than the prediction period (for example, within 100 clock cycles), determine the predicted value of the corresponding event parameter in the next prediction period based on the detected event parameters, and save the determined predicted value, for example, store it in a specific register.

[0057] For example, at the end of the 1st prediction period, the prediction unit determines and stores the predicted value of the 2nd prediction period based on the event parameters detected in the 1st prediction period. At the end of the 2nd prediction period, the prediction unit determines and stores the predicted value of the 3rd prediction period based on the event parameters detected in the 2nd prediction period, and so on.

[0058] The control period is used to indicate the frequency at which the control unit performs power consumption control. In this embodiment, the control period can be denoted as S2. The control period and the prediction period can be two independent periods, that is, the lengths of the control period and the prediction period are not related to each other. The specific duration of the control period can also be set according to the actual situation without limitation. For example, it can be set to 200 seconds, 500 milliseconds, etc.

[0059] The prediction period and the control period can be two independent periods. The prediction period can be adjusted according to the required prediction accuracy, and the control period can be adjusted according to the required control accuracy.

[0060] The shorter the control period, the more frequently the control unit 102 can control the power consumption parameters of the target module, thereby obtaining a better effect of reducing the power consumption of the target module.

[0061] The shorter the prediction period, the more accurate the prediction value obtained by the prediction unit 101.

[0062] Therefore, setting a shorter prediction period and a shorter control period is beneficial for the power consumption control module to timely detect changes in the working state of the target module and timely adjust the power consumption parameters according to the changes in the working state.

[0063] At the beginning of each control period, the control unit can read the prediction value currently stored in the register of the prediction unit within a time much shorter than the control period (for example, within 100 clock cycles), and then configure the power consumption parameters of the target module in this control period according to the read prediction value, so that the target module operates according to the configured power consumption parameters in this control period.

[0064] Among them, if the control unit does not read the prediction value from the register of the prediction unit, it can not configure the power consumption parameters according to the prediction value. At this time, the target module continues to operate with the power consumption parameters of the previous control period.

[0065] Exemplarily, at the beginning of the first control period, the control unit reads the prediction value currently stored in the prediction unit and configures the value of the power consumption parameter of the target module to x1 accordingly. Then, in the first control period, the target module operates with the power consumption parameter x1. At the beginning of the second control period, the control unit reads the prediction value currently stored in the prediction unit and configures the value of the power consumption parameter of the target module to x2 accordingly. Then, in the second control period, the target module operates with the power consumption parameter x2, and so on.

[0066] The power consumption control module of this embodiment can be composed of physical elements in an electronic device, such as registers, adders, multipliers, processors, etc.

[0067] The beneficial effects of this solution are as follows:

[0068] The power consumption control module directly predicts the predicted value of the event parameter within a future period according to the event parameter of the detected target event, and then periodically controls the power consumption parameter of the target module with the predicted value. Compared with the scheme of detecting the usage scenario in the related art, the event parameter of the target event can be obtained through the hardware circuits. Therefore, the event parameter of the target event can have a shorter time window, for example, the event parameter within 1 second or within 100 milliseconds can be detected. Moreover, the power consumption control module can control the power consumption parameter of the target module through the hardware circuits. Therefore, this scheme has better timeliness when regulating the power consumption of the target module and can dynamically control the power consumption parameter of the target module in real time according to the fluctuations of the operating conditions of the electronic device.

[0069] On the other hand, compared with the device usage scenario detected by software, the target event related to the target module can more directly reflect the usage demand of the electronic device for the target module. Therefore, by controlling the power consumption according to the event parameter of the target event, the power consumption parameter of the target module can better meet the actual operating demand and reduce the situation where the configured power consumption parameter is too low or too high.

[0070] In some alternative embodiments, the number of target modules can be multiple, and each target module corresponds to a prediction unit and a control unit.

[0071] That is to say, the power consumption control module of this embodiment can be used to control the power consumption parameters of multiple target modules.

[0072] In the case of multiple target modules, the power consumption control module includes multiple prediction units and multiple control units corresponding to the number. Each target module corresponds to a dedicated prediction unit and a dedicated control unit, and the power consumption parameter of the target module is independently controlled by the corresponding prediction unit and control unit.

[0073] The target event detected by each prediction unit is related to the target module corresponding to the prediction unit.

[0074] Each control unit controls the power consumption parameter of the corresponding target module according to the predicted value output by the prediction unit corresponding to the same target module.

[0075] As an example, please refer to Figure 2 , in this embodiment, the target modules to be controlled may include the index storage module (Tag RAM), data storage module (Data RAM), and cache control module (CacheController) that constitute the cache.

[0076] Among them, the cache control module corresponds to the first prediction unit and the first control unit.

[0077] The index storage module corresponds to the second prediction unit and the second control unit.

[0078] The data storage module corresponds to the third prediction unit and the third control unit.

[0079] When the power consumption control module operates, the first prediction unit detects a first target event related to the cache control module, stores the predicted value of the event parameter of the first target event in the next prediction cycle, and the first control unit controls the power consumption parameter of the cache control module in the current control cycle according to the predicted value corresponding to the first target event.

[0080] The second prediction unit detects a second target event related to the index storage module, stores the predicted value of the event parameter of the second target event in the next prediction cycle, and the second control unit controls the power consumption parameter of the index storage module in the current control cycle according to the predicted value corresponding to the second target event.

[0081] The third prediction unit detects a third target event related to the data storage module, stores the predicted value of the event parameter of the third target event in the next prediction cycle, and the third control unit controls the power consumption parameter of the data storage module in the current control cycle according to the predicted value corresponding to the third target event.

[0082] As an example, the first target event may be an event that other modules of the electronic device access the cache control module, the second target event may be an event that other modules of the electronic device access the index storage module, and the third target event may be an event that other modules of the electronic device read or write data from the data storage module.

[0083] The beneficial effect of this embodiment is that by independently controlling the power consumption parameters of each target module through multiple prediction units and control units, on the one hand, the timeliness of regulating the power consumption parameters of the target module can be improved, avoiding excessive delay caused by the need to regulate the parameters of multiple target modules, and on the other hand, it can avoid the interference between the regulation processes of different target modules, resulting in too large a deviation between the regulation result and the actual situation.

[0084] In some alternative embodiments, the control unit may control the power consumption parameter of the target module in the following manner:

[0085] Determine the power consumption parameter level corresponding to the predicted value;

[0086] In the current control cycle, set the value of the power consumption parameter of the target module to the value corresponding to the power consumption parameter level.

[0087] In this embodiment, the control unit 102 may include one or more memories, and the memories may store a threshold table for determining the power consumption parameter level and a configuration table for setting the value of the power consumption parameter.

[0088] Among them, the threshold table may include multiple power consumption parameter levels and the thresholds corresponding to each power consumption parameter level. The higher the power consumption parameter level, the larger the corresponding threshold. For example, the threshold table may include n power consumption parameter levels, and level 1 corresponds to threshold T 1 , level 2 corresponds to threshold T 2 , level 3 corresponds to threshold T 3 , …… level n corresponds to threshold T n , T 1 to T n is monotonically increasing.

[0089] When determining the power consumption parameter level corresponding to the predicted value, the control unit can traverse each power consumption parameter level in the threshold table starting from level 1. For each power consumption parameter level traversed, the control unit compares the threshold corresponding to this level, the threshold corresponding to the next level of this level, and the currently obtained predicted value. For any level x between 1 and n, if the currently obtained predicted value satisfies that the predicted value is greater than or equal to the threshold T x corresponding to this level, and less than the threshold T x+1 corresponding to the next level, then it can be determined that the power consumption parameter level corresponding to this predicted value is level x.

[0090] Exemplarily, if the predicted value is greater than or equal to the threshold T 2 corresponding to level 2, and less than the threshold corresponding to the next level, that is, less than T 3 , then it is determined that the power consumption parameter level corresponding to this predicted value is level 2.

[0091] The configuration table can record the values of the power consumption parameters corresponding to each power consumption parameter level. The higher the level, the larger the corresponding value. After determining the level corresponding to the predicted value, the control unit can find out the value corresponding to this level from the configuration table and set the value of the power consumption parameter of the target module to the found value, thereby completing the control of the power consumption parameter in the current control cycle.

[0092] For different target modules, the control unit corresponding to the target module can control one or more different power consumption parameters of the target module.

[0093] Combined with Figure 2 the example, if the target module is a cache control module, then the power consumption parameter of the target module controlled by the first control unit can be the operating frequency of the cache control module.

[0094] In this case, the configuration table of the first control unit can record multiple power consumption parameter levels and the frequency values (which can also be called frequency points) corresponding to each level. The higher the level, the larger the corresponding frequency value. For example, level 1 corresponds to frequency point 1, level 2 corresponds to frequency point 2, level 3 corresponds to frequency point 3, frequency point 1 is less than frequency point 2, and frequency point 2 is less than frequency point 3.

[0095] Assume that at the beginning of the current control cycle, the first control unit determines that the predicted value read at this time corresponds to level 2. Then the first control unit sets the operating frequency of the cache control module to frequency point 2. Thus, within the current control cycle, the cache control module operates based on the operating frequency of frequency point 2.

[0096] Still in combination with Figure 2 the example, if the target module is a data storage module, then the power consumption parameters of the target module controlled by the third control unit may include the operating frequency and the number of working partitions of the data storage module.

[0097] The data storage module may include a continuous plurality of partitions for storage (also known as ways), for example Figure 3 the data storage module in may include partition 0, partition 1, partition 2, partition 3, and so on.

[0098] When the third control unit controls the power consumption parameters of the data storage module, on the one hand, it can set the operating frequency of the data storage module to the frequency point corresponding to the power consumption parameter level, and on the other hand, it can control how many partitions of the data storage module are enabled within the current control cycle according to the power consumption parameter level.

[0099] Taking Figure 3 as an example, after the third control unit determines that the predicted value read currently corresponds to power consumption parameter level 2, it finds the corresponding frequency point 2 and partition 2 in the configuration table. Then it sets the operating frequency of the data storage module to frequency point 2, and controls the partitions up to and including partition 2 of the data storage module to be in the enabled state (power-on state), and the partitions after partition 2 to be in the disabled state (power-off state). That is, it controls partitions 0, 1, and 2 of the data storage module to be in the power-on state, and partitions 3 and subsequent partitions such as partition 4 and partition 5 to be in the power-off state.

[0100] Correspondingly, if at the beginning of the next control cycle, the predicted value read by the third control unit corresponds to level 3, then the third control unit can control the data storage module to operate at the frequency point 3 corresponding to level 3 within the next control cycle, and control partitions 0 to 3 of the data storage module to be powered on, and partitions 4 and subsequent partitions to be powered off.

[0101] If the target module is an index storage module, then the power consumption parameters of the target module controlled by the second control unit may include the operating frequency and the number of working partitions of the index storage module. The control method of the second control unit may be the same as that of the third control unit and will not be elaborated here.

[0102] By setting the power consumption parameter levels corresponding to different prediction values and the values of the power consumption parameters corresponding to different levels, the control unit can quickly configure the power consumption parameters of the target module according to the obtained prediction value at the beginning of each control cycle, improving the timeliness of power consumption control.

[0103] The prediction unit can determine the prediction value for the next prediction cycle in various ways.

[0104] In some embodiments, the prediction unit can determine the change trend of the event parameters based on the event parameters detected in the most recent two or more prediction cycles, and determine the prediction value for the next prediction cycle based on the change trend and the event parameters detected in the current prediction cycle.

[0105] In some other embodiments, the prediction unit may also include a filtering unit 111 and a storage unit 112, and determine the prediction value for the next prediction cycle based on the filtering unit 111 and the storage unit 112 in the following manner:

[0106] The filtering unit 111 is used to determine the exponential moving average of the current prediction cycle according to the event parameters;

[0107] The storage unit 112 is used to store the prediction value for the next prediction cycle according to the exponential moving average of the current prediction cycle and the exponential moving average of the previous prediction cycle.

[0108] Among them, the exponential moving average (EMA) of the current prediction cycle can be determined in the following manner.

[0109] Determine the exponential moving average of the current prediction cycle according to the event parameters detected in the current prediction cycle and the exponential moving average of the previous prediction cycle.

[0110] Please refer to Figure 3 , taking the current prediction cycle as the t-th prediction cycle (t is greater than or equal to 2) after the power consumption control module is started as an example, the way for the prediction unit to determine the prediction value for the next prediction cycle is as follows.

[0111] At the end of the t-th prediction cycle, the filtering unit 111 reads the event parameter V(t) of the target event detected in the t-th prediction cycle from the counter for counting the event parameters, and the filtering unit 111 obtains the exponential moving average EMA(t - 1) of the previous prediction cycle (i.e., the (t - 1)-th prediction cycle) stored at the end of the previous prediction cycle from a register.

[0112] Then the filtering unit 111 calculates the exponential moving average EMA(t) of the current prediction cycle (the t-th prediction cycle) according to the above two values, and the calculation method can be expressed by the following formula (1).

[0113] V(t) * K(t) + EMA(t - 1) * K(t - 1) = EMA(t), (1).

[0114] That is, the product of V(t) and K(t), plus the product of EMA(t - 1) and K(t - 1), the resulting sum is used as the exponentially weighted moving average EMA(t) for the current prediction period.

[0115] Both K(t) and K(t - 1) are preset weight coefficients stored in the filtering unit 111, where K(t) is the first weight coefficient and K(t - 1) is the second weight coefficient, and the sum of the two can be equal to 1. The values of these two parameters affect the proportion of the current value and the historical value contributing to the exponentially weighted moving average for the current prediction period. If it is desired that the predicted value reflects as much as possible the requirements of the target module within the current prediction period, a larger K(t) can be set. If it is desired that the predicted value reflects as much as possible the requirements of the target module in the previous prediction period, a larger K(t - 1) can be set.

[0116] After obtaining EMA(t), the storage unit 112 can determine the change amplitude of the exponentially weighted moving average based on EMA(t - 1) of the previous prediction period and EMA(t) of the current prediction period, and then determine the predicted value for the next prediction period based on the change amplitude and the exponentially weighted moving average for the current prediction period.

[0117] Optionally, if the current prediction period is the first prediction period after the power consumption control module is started, the filtering unit 111 can directly determine the event parameter for the current prediction period as the exponentially weighted moving average for the current prediction period, that is, EMA(1) = V(1).

[0118] Among them, the predicted value for the next prediction period can be determined by the following formula (2).

[0119] P(t + 1) = L0 * EMA(t) + L1 * Dx, (2).

[0120] That is to say, the storage unit 112 can multiply L0 by EMA(t) and multiply L1 by Dx, and the sum of the two resulting products is used as the predicted value for the next prediction period.

[0121] Dx represents the change amplitude of the exponentially weighted moving average and can be determined by the following formula (3).

[0122] Dx = EMA(t) - EMA(t - 1), (3).

[0123] In formula (2), L0 and L1 are preset parameters, and their values affect the contribution ratio of the exponentially weighted moving average and the change amplitude of the current prediction period to the predicted value. The larger L0 is, the larger the proportion of the exponentially weighted moving average of the current prediction period in the predicted value. The larger L1 is, the greater the influence of the change amplitude on the predicted value. In some embodiments, both L0 and L1 can be set to 1.

[0124] Among them, if t = 1, that is, the current prediction period is the first prediction period after the power consumption control module is started, when the storage unit 112 determines the predicted value of the next prediction period, EMA(0) can be set to 0, or EMA(0) can be set to be equal to EMA(1).

[0125] It can be seen that when determining the predicted value in the above manner, the predicted value of the next prediction period is related to the EMA value of the current prediction period and the EMA value of the previous prediction period. And the EMA value of each prediction period is related to the event parameter of this prediction period and the EMA value of the previous prediction period. Therefore, the above method for determining the predicted value can comprehensively consider the event parameters of the current prediction period and multiple past prediction periods to determine the predicted value of the next prediction period, which helps to determine a predicted value that more conforms to the actual usage of the target module in the next prediction period.

[0126] The filtering unit 111 and the storage unit 112 can include a number of interconnected multipliers and adders, and the above process of determining the predicted value is implemented through these multipliers and adders. Compared with the method determined by software, determining the predicted value through multipliers and adders can obtain a faster calculation speed.

[0127] In some alternative embodiments, in order to reduce the hardware complexity of the filtering unit 111, the multiplication operation when determining EMA(t) can be replaced by a shift operation, that is, a shifter is used to implement the multiplication operation when determining EMA(t). In this case, the way for the filtering unit 111 to determine EMA(t) can be:

[0128] Perform a shift process on the event parameter detected in the current prediction period according to the first weight coefficient to obtain a first processing result;

[0129] Perform a shift process on the exponentially weighted moving average of the previous prediction period according to the second weight coefficient to obtain a second processing result;

[0130] Determine the exponentially weighted moving average of the current prediction period according to the first processing result and the second processing result.

[0131] The above first processing result is equivalent to the product of V(t)*K(t) in formula (1), and the second processing result is equivalent to the product of EMA(t - 1)*K(t - 1) in formula (1).

[0132] The advantage of determining EMA(t) in the above manner is that:

[0133] The filtering unit 111 only needs to perform a shift operation on V(t) and EMA(t - 1) stored in the corresponding registers to obtain the exponentially weighted moving average of the current prediction period, without the need to set a multiplier for processing multiplication operations. Thus, the hardware structure of the filtering unit 111 can be simplified, and the hardware complexity of the filtering unit 111 can be reduced.

[0134] Optionally, when L0 and L1 are not equal to 1, the storage unit 112 can also determine the predicted value of the next prediction period in the above manner through a shift operation.

[0135] Optionally, when performing the above operations, both the storage unit 112 and the filtering unit 111 can use fixed-point operations instead of floating-point operations to further reduce the hardware complexity of the storage unit 112 and the filtering unit 111. For example, when the storage unit 112 determines the predicted value of the next prediction period, it can perform fixed-point operations on the exponentially weighted moving average of the current prediction period and the exponentially weighted moving average of the previous prediction period based on the foregoing formulas (2) and (3) to obtain the predicted value of the next prediction period.

[0136] In some alternative embodiments, the prediction unit may include a statistical subunit, and the statistical subunit can be used for:

[0137] The statistical subunit is used to perform statistics in each prediction period in response to a target event generated by the target module to obtain the event parameter of the target event;

[0138] The statistical subunit is further used to restore the event parameter of the target event to the initial value at the end of each prediction period.

[0139] The statistical subunit may include a counter.

[0140] The counter can be configured to increment its count by 1 every time it receives a signal representing the target event, and perform an initialization operation at the end of each prediction period to restore its count to the initial value. The initial value can be configured as 0.

[0141] In this case, the filtering unit 111 can read the current count value of the statistical subunit before the statistical subunit performs the initialization operation at the end of each prediction period, and determine the read value as the event parameter of the target event in the current prediction period. The event parameter of the target event obtained in this way is equivalent to the number of times the target event has occurred cumulatively in the target module in the current prediction period.

[0142] Exemplarily, at the end of the (t - 1)-th prediction period, the filtering unit 111 obtains the event parameter of the (t - 1)-th prediction period from the counter, and then the counter performs an initialization operation, and the count value of the counter is reset to 0.

[0143] After entering the t-th prediction period, every time the target event occurs in the target module, a signal representing the target event is reported to the prediction unit. Every time the counter receives such a signal, it increments its own count value by 1. That is, after the initialization operation, when receiving the signal for the first time, the count value is incremented from 0 to 1, and when receiving the signal for the second time, the count value is incremented from 1 to 2, and so on.

[0144] At the end of the t-th prediction period, the filtering unit 111 reads the current count value of the counter, and determines the read value as the event parameter V(t) of the t-th prediction period, indicating that the target event has occurred V(t) times in total in the target module during the t-th prediction period. After that, the counter performs the initialization operation again and continues to count in the (t + 1)-th prediction period.

[0145] This embodiment also provides an electronic device, as Figure 4 shown, the electronic device may include a target module 401, a power consumption control module 402, and a processor 403.

[0146] Among them, the target module 401 can be used to cache the data required for the operation of the processor 403 and the data output by the processor 403;

[0147] The processor 403 can read and write data from and to the target module 401 as needed;

[0148] The power consumption control module 402 can control the power consumption parameters of the target module 401 according to the control principle of the foregoing embodiment, so that the power consumption parameters of the target module 401 match the frequency at which the target module 401 is read and written.

[0149] This application embodiment also provides a power consumption control method, please refer to Figure 5 and the method may include the following steps.

[0150] S501, detect the event parameter of the target event periodically according to the prediction period, and store the predicted value of the corresponding event parameter in the next prediction period according to the event parameter. The target event is related to the target module to be controlled.

[0151] S502, obtain the predicted value currently stored in the prediction unit periodically according to the control period, and control the power consumption parameters of the target module according to the predicted value in the current control period.

[0152] For the implementation manners of the above control method, please refer to the working principle of the power consumption control module in the foregoing embodiment, and details are not described herein again.

[0153] Optionally, the power consumption control method of this embodiment further includes the following steps:

[0154] Configure the prediction period and the control period according to the target module.

[0155] In some embodiments, the prediction period and the control period can be configured according to the change situation of the event parameters of the target module in multiple past prediction periods. For example, if the event parameters of the target module fluctuate significantly in the past 10 prediction periods, such as the event parameters in two consecutive prediction periods are very large, and the event parameters in the following two prediction periods are very small, then a shorter prediction period and control period can be set, so as to efficiently configure appropriate power consumption parameters for the target module as the event parameters fluctuate rapidly;

[0156] If the event parameters of the target module do not fluctuate significantly in the past 10 prediction periods, such as the event parameters in 5 consecutive prediction periods are basically the same, then a longer prediction period and control period can be set, so as to reduce the number of times the power consumption control module determines the predicted value and configures the power consumption parameters according to the foregoing working principle, thereby reducing the power consumption of the power consumption control module itself.

[0157] In some embodiments, the prediction period and the control period can also be configured according to the power consumption of the target module itself. For example, if the average power of the target module is relatively large in the past period of time, then a shorter prediction period and control period can be configured, so that the unnecessary power consumption during the operation of the target module can be minimized by frequently controlling the power consumption parameters of the target module;

[0158] If the average power of the target module is relatively small in the past period of time, then a longer prediction period and control period can be configured, because a relatively small average power indicates that the target module is already in a state of relatively low overall power consumption. Even if the power consumption parameters are frequently controlled, the power consumption that the target module can reduce is limited, and it may even increase the overall power consumption of the electronic device due to the frequent control of the power consumption parameters by the power consumption control module. Therefore, a longer prediction period and control period can be configured to reduce the number of times the power consumption control module determines the predicted value and controls the power consumption parameters.

[0159] It should be noted that the various embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other.

[0160] For the convenience of description, when describing the above system or device, it is divided into various modules or units according to functions for description. Of course, when implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0161] From the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of this application, in essence or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0162] Finally, it should also be noted that in this text, relational terms such as first, second, third, and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is 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 also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.

[0163] The above are only the preferred embodiments of this application. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A power consumption control module, comprising: A prediction unit, configured to periodically detect event parameters of a target event according to a prediction cycle, and store a prediction value corresponding to the event parameter in a subsequent prediction cycle according to the event parameter, wherein the target event is related to a target module to be controlled, and the prediction value represents a possible value of the event parameter in the subsequent prediction cycle, and the prediction value is determined according to the event parameters of at least two consecutive prediction cycles, wherein the at least two consecutive prediction cycles include a current prediction cycle; The control unit is used to periodically obtain the prediction value currently stored in the prediction unit according to a control cycle, and control the power consumption parameter of the target module according to the prediction value during the current control cycle.

2. The control module according to claim 1, wherein the number of the target modules is multiple, and each of the target modules corresponds to one of the prediction units and one of the control units; The target event detected by each prediction unit is related to the target module corresponding to the prediction unit; Each of the control units controls the power consumption parameters of the corresponding target module according to the prediction value output by the prediction unit corresponding to the same target module.

3. The control module according to claim 1, wherein the controlling the power consumption parameter of the target module according to the predicted value in the current control cycle comprises: Determining a power consumption parameter level corresponding to the predicted value; In the current control cycle, the value of the power consumption parameter of the target module is set to a value corresponding to the power consumption parameter level.

4. The control module according to claim 1, wherein the prediction unit comprises: A filtering unit, configured to determine an exponential moving average of a current prediction period according to the event parameters; The storage unit is used to store the prediction value of the next prediction period according to the exponential moving average value of the current prediction period and the exponential moving average value of the previous prediction period.

5. The control module according to claim 4, wherein the filtering unit determines the exponential moving average of the current prediction period according to the event parameter, comprising: The exponential moving average value of the current prediction period is determined according to the event parameters detected in the current prediction period and the exponential moving average value of the previous prediction period.

6. The control module according to claim 5, wherein the filtering unit determines the exponential moving average value of the current prediction period according to the event parameter detected in the current prediction period and the exponential moving average value of the previous prediction period, comprising: Performing a shift process on the event parameter detected in the current prediction period according to the first weight coefficient to obtain a first processing result; Performing a shift process on the exponential moving average of the previous prediction period according to the second weight coefficient to obtain a second processing result; An exponential moving average of a current prediction period is determined according to the first processing result and the second processing result.

7. The control module according to claim 4, wherein the storage unit stores the prediction value of the next prediction period according to the exponential moving average value of the current prediction period and the exponential moving average value of the previous prediction period, comprising: Fixed-point operation is performed based on the exponential moving average value of the current prediction period and the exponential moving average value of the previous prediction period to store the prediction value of the next prediction period.

8. The control module according to claim 1, wherein the prediction unit comprises a statistical subunit; The statistical subunit is used for performing statistics in response to the target event generated by the target module in each prediction cycle to obtain event parameters of the target event; The statistical subunit is further configured to restore the event parameters of the target event to initial values ​​at the end of each prediction cycle.

9. A power consumption control method, comprising: According to the prediction cycle, the event parameters of the target event are periodically detected, and the prediction value corresponding to the event parameter in the next prediction cycle is stored according to the event parameter, the target event is related to the target module to be controlled, the prediction value represents the possible value of the event parameter in the next prediction cycle, and the prediction value is determined according to the event parameters of at least two consecutive prediction cycles, and the at least two consecutive prediction cycles include the current prediction cycle; According to the control cycle, the prediction value currently stored in the prediction unit is periodically obtained, and the power consumption parameter of the target module is controlled according to the prediction value during the current control cycle.

10. The method according to claim 9, further comprising: The prediction period and the control period are configured according to the target module.