Power consumption control method, electronic device, storage medium and program product
By adjusting the chip's microarchitecture mode level to control power consumption, the problem that existing power control methods cannot simultaneously meet real-time and stability requirements is solved, achieving a balance between stability and real-time performance within a preset power consumption range.
Patent Information
- Application Number
- CN202410508758.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-10-28
AI Technical Summary
Existing power consumption control methods cannot simultaneously meet the real-time and stability requirements of chips. DVFS technology leads to low chip stability, while task migration technology has latency and cannot meet real-time requirements.
Power consumption is controlled by adjusting the chip's microarchitecture mode level, determining the chip's power consumption at the current moment, and determining the target values of operating parameters based on the preset power consumption range, including the microarchitecture mode level, to avoid frequent adjustments to the operating frequency.
While ensuring chip stability, it meets real-time requirements, improves chip stability, and reduces the impact of operating frequency adjustments on stability.
Smart Images

Figure CN120848710A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a power consumption control method, electronic device, storage medium, and program product. Background Technology
[0002] With the significant increase in the integration of chip components (such as central processing units (CPUs) and graphics processing units (GPUs), chip power consumption control has become particularly important. By providing real-time, efficient, and reliable power consumption control, chips can better adapt to load changes, effectively solve thermal balance problems, and extend their lifespan.
[0003] Common power consumption control methods typically include, but are not limited to, Dynamic Voltage and Frequency Scaling (DVFS) and task migration techniques. DVFS controls power consumption by adjusting the chip's operating frequency and voltage. Task migration controls power consumption by scheduling the workload of each core within the chip.
[0004] However, DVFS technology, which adjusts the chip's operating frequency and voltage, may result in lower chip stability, while task migration technology has a certain time delay and cannot meet the needs of chips with high real-time requirements. Summary of the Invention
[0005] This disclosure provides a power consumption control method, an electronic device, a storage medium, and a program product, which can solve the problem that related power consumption control methods cannot simultaneously meet the real-time and stability requirements of chips.
[0006] On the one hand, a power consumption control method is provided, including:
[0007] Determine the chip's power consumption at the current moment;
[0008] Based on the chip's power consumption at the current moment and the preset power consumption range, the target values of the chip's operating parameters are determined so that the chip's power consumption at the target values of the operating parameters is within the preset power consumption range; the operating parameters include the microarchitecture mode level; the microarchitecture mode level is used to represent the chip's microarchitecture state.
[0009] In another aspect, a power consumption control device is provided, comprising: a processing unit;
[0010] The processing unit is used to determine the chip's power consumption at the current moment;
[0011] The processing unit is also used to determine the target value of the chip's operating parameters based on the chip's power consumption at the current moment and the preset power consumption range, so that the chip's power consumption at the target value of the operating parameters is within the preset power consumption range; the operating parameters include the microarchitecture mode level; the microarchitecture mode level is used to represent the chip's microarchitecture state.
[0012] In another aspect, an electronic device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store a computer program; and the processor, when executing the computer program, implements the power consumption control method of any of the above embodiments.
[0013] In another aspect, a computer-readable storage medium is provided, on which computer program instructions are stored, which, when executed by a processor, implement the power consumption control method of any of the above embodiments.
[0014] In another aspect, a computer program product is provided, which includes computer program instructions that, when executed by a processor, implement the power consumption control method described in any of the above embodiments.
[0015] This disclosure provides a power consumption control method. During power consumption control, target values for the chip's operating parameters are determined to ensure that the chip's power consumption remains within a preset range at these target values. The operating parameters include the microarchitecture mode level. Because the microarchitecture mode level can be adjusted with small granularity and does not require scheduling the workload of each core in the chip, this application can meet the chip's real-time requirements while ensuring chip stability.
[0016] Secondly, in common power consumption control methods, frequent adjustments to the chip's operating frequency can significantly reduce chip stability. However, this application, by adjusting the microarchitecture mode level, ensures that the chip's power consumption remains within a preset range at the target operating parameters, thus eliminating the need to adjust the chip's operating frequency and further improving chip stability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this disclosure, the accompanying drawings used in some embodiments of this disclosure will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 A power consumption control system architecture diagram provided for some embodiments of this disclosure;
[0019] Figure 2A flowchart illustrating a power consumption control method provided in some embodiments of this disclosure;
[0020] Figure 3 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0021] Figure 4 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0022] Figure 5 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0023] Figure 6 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0024] Figure 7 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0025] Figure 8 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0026] Figure 9 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0027] Figure 10 A flowchart illustrating yet another power consumption control method provided in some embodiments of this disclosure;
[0028] Figure 11 This is a schematic diagram of the structure of an electronic device provided in some embodiments of this disclosure;
[0029] Figure 12 This is a schematic diagram of the structure of another electronic device provided in some embodiments of this disclosure. Detailed Implementation
[0030] The technical solutions of this disclosure will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0031] It should be noted that, in this disclosure, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in this disclosure should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0032] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0033] In the description of this disclosure, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "more than one" means two or more.
[0034] Before providing a detailed introduction to this application, let's first discuss the relevant elements involved in this application.
[0035] First, a brief introduction to the relevant elements involved in this application will be given.
[0036] Microarchitecture: Microarchitecture is a crucial component of a chip, encompassing the pipeline execution mechanisms for various tasks during chip processing, instruction issuance and scheduling mechanisms, on-chip caches, memory management mechanisms, and more. These design elements work together to achieve efficient chip operation.
[0037] The power consumption of a chip can be controlled by adjusting the microarchitecture mode level. Different microarchitecture mode levels correspond to different microarchitecture state parameters. Under different microarchitecture mode levels, i.e., under different microarchitecture state parameters, the chip's power consumption is different. Therefore, this application can achieve chip power consumption control by adjusting the microarchitecture mode level.
[0038] For example, to reduce chip power consumption, the microarchitecture mode level can be adjusted to a preset level. At the preset level, the chip can adjust at least one of the following microarchitecture state parameters to reduce chip power consumption:
[0039] Disabling unnecessary floating-point units and execution units in the chip (also known as reducing chip bandwidth), reducing the chip's memory access rate and / or data transfer rate (also known as reducing the chip's window depth), reducing the chip's number of parallel instructions, instruction scheduling complexity, and out-of-order execution range (also known as weakening the chip's transaction strength).
[0040] Next, the application scenarios of this application will be introduced.
[0041] With the significant increase in chip component integration, chip power consumption control has become particularly important. By providing real-time, efficient, and reliable power consumption control, chips can better adapt to load changes, effectively solve thermal balance issues, and extend their lifespan.
[0042] Currently, various power consumption control technologies are widely used, including but not limited to DVFS technology and task migration technology. DVFS technology achieves power consumption control by adjusting the chip's operating frequency and voltage. However, in the process of power consumption control based on DVFS technology, if the adjustment step size of the operating frequency and voltage is not precise enough, it will cause a loss of system performance. Moreover, frequent adjustments to the operating frequency also greatly reduce the stability of the chip.
[0043] Task migration technology achieves power control by scheduling the workload of each core in the chip, that is, rationally distributing the workload across all cores to improve the overall utilization of the chip. However, task migration technology has a certain latency, which cannot meet the needs of chips with high real-time requirements.
[0044] To address the aforementioned technical problems, this disclosure provides a power consumption control method that can determine the power consumption of a chip at the current moment. Then, based on the chip's power consumption at the current moment and a preset power consumption range, a target value for the chip's operating parameters can be determined, ensuring that the chip's power consumption at the target value of the operating parameters remains within the preset power consumption range.
[0045] Among the operating parameters is the microarchitecture mode level, which is used to represent the microarchitecture state of the chip.
[0046] As can be seen from the above, in the power consumption control process, this application can determine the target values of the chip's operating parameters to ensure that the chip's power consumption is within a preset range under the target values of the operating parameters. These operating parameters include the microarchitecture mode level. Because the adjustment granularity of the microarchitecture mode level is small and there is no need to schedule the load tasks of each core in the chip, this application can meet the chip's real-time requirements while ensuring chip stability.
[0047] Secondly, in common power consumption control methods, frequent adjustments to the chip's operating frequency can significantly reduce chip stability. However, this application, by adjusting the microarchitecture mode level, ensures that the chip's power consumption remains within a preset range at the target operating parameters, thus eliminating the need to adjust the chip's operating frequency and further improving chip stability.
[0048] The power consumption control method provided in this disclosure can be applied to, for example, Figure 1 The power consumption control system described herein can be applied to any electronic device that requires power consumption control, and can be used to control the power consumption of chips within the electronic device. For example... Figure 1 As shown, the power consumption control system may include a power consumption control module 101 and a configuration distribution module 102. The power consumption control module 101 and the configuration distribution module 102 are connected.
[0049] The power consumption control module 101 is used to determine the power consumption of the chip at the current moment, and to determine the target value of the chip's operating parameters based on the chip's power consumption at the current moment and the preset power consumption range.
[0050] The configuration sending module 102 can send the target value of the chip's operating parameters to the corresponding unit based on the target value of the chip's operating parameters determined by the power consumption control module 101, so as to complete the power consumption control of the chip.
[0051] In one possible implementation, the aforementioned operating parameters may include a microarchitecture mode level and an operating frequency. In this case, the power control module 101 may include a configuration monitoring module 1011, a microarchitecture calculation module 1012, a power consumption calculation module 1013, and a frequency calculation module 1014. The configuration monitoring module 1011 is connected to the microarchitecture calculation module 1012, the power consumption calculation module 1013, and the frequency calculation module 1014. The power consumption calculation module 1013 is connected to both the microarchitecture calculation module 1012 and the frequency calculation module 1014.
[0052] The configuration monitoring module 1011 is used to obtain the chip's operating status parameters at the current moment.
[0053] The power consumption calculation module 1013 is used to determine the power consumption of the chip at the current moment based on the chip's operating status parameters obtained by the configuration monitoring module 1011 at the current moment.
[0054] The microarchitecture calculation module 1012 is used to determine the target value of the microarchitecture mode level based on the power consumption of the chip at the current moment determined by the power consumption calculation module 1013.
[0055] The frequency calculation module 1014 is used to determine the target value of the operating frequency based on the power consumption of the chip at the current moment determined by the power consumption calculation module 1013.
[0056] In one feasible approach, the power control system can also be divided into different subsystems based on different operating parameters. For example, when the operating parameters include microarchitecture mode level and operating frequency, the power control system can include a microarchitecture mode level regulation subsystem and a frequency regulation subsystem.
[0057] Among them, the microarchitecture pattern level adjustment subsystem is used to determine the target value of the microarchitecture pattern level.
[0058] For example, such as Figure 1 As shown, the configuration monitoring module 1011, power consumption calculation module 1013 and microarchitecture calculation module 1012 can form a microarchitecture mode level adjustment subsystem.
[0059] Correspondingly, the frequency regulation subsystem is used to determine the target value of the operating frequency.
[0060] For example, such as Figure 1 As shown, the configuration monitoring module 1011, power consumption calculation module 1013 and frequency calculation module 1014 can form a frequency regulation subsystem.
[0061] It should be noted that the modules in the chip described above are only functional concepts. In practical applications, the modules in the chip can be merged or split to form one or more modules for use, or the modules can be integrated into other modules for use by other modules. This application does not limit this.
[0062] It should be noted that the system architecture and application scenarios described in the embodiments of this disclosure are for the purpose of more clearly illustrating the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions provided in the embodiments of this disclosure. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this disclosure are also applicable to similar technical problems.
[0063] For example, the power control system described above can be applied to chips based on the Advanced Reduced Instruction Set Machine (ARM) architecture, as well as chips based on the x86 architecture.
[0064] The power consumption control method provided in the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0065] The power consumption control method provided in this disclosure can be applied to electronic devices, which may be... Figure 1The electronic device to which the power consumption control system shown belongs can also be Figure 1 The power consumption control system shown is connected to an external electronic device to achieve power consumption control of the chip to which the power consumption control system belongs. In other words, the execution subject of this application can be applied to the electronic device to which the chip to be power-controlled belongs, or it can be applied to an electronic device that accesses the chip remotely to perform configuration distribution, data acquisition, and functional calculations. The embodiments of this application do not limit this.
[0066] Figure 2 A flowchart of a power consumption control method is shown, as follows: Figure 2 As shown, the power consumption control method includes:
[0067] S201. The electronic device determines the power consumption of the chip at the current moment.
[0068] In one feasible approach, the aforementioned chip can be any chip in an electronic device that requires power consumption control, such as a CPU chip or a GPU chip.
[0069] In one feasible approach, in order to control the power consumption of a chip in real time, the electronic device needs to determine the power consumption of the chip at the current moment. The power consumption of the chip is usually determined by the chip's operating state parameters at the current moment. Therefore, the electronic device can obtain the chip's operating state parameters at the current moment and determine the chip's power consumption at the current moment based on the chip's operating state parameters at the current moment.
[0070] In one possible approach, the electronic device can trigger a power control command after the chip is powered on, and in response to the power control command, obtain the chip's operating status parameters at the current moment.
[0071] In another possible approach, users can perform power control operations on the device itself via an external module connected to the chip, according to their own needs. The electronic device can then respond to the user's operation by triggering a power control command and, in response to that command, obtain the chip's current operating status parameters.
[0072] In one possible implementation, the operating status parameters may include at least one of the following: temperature, operating frequency, voltage, microarchitecture status parameters, number of instructions executed within a preset period, and amount of memory data read within a preset period.
[0073] In one possible implementation, the aforementioned microarchitecture state parameters may include at least one of memory access rate, data transfer rate, cache size, number of pending task instructions, and number of parallel task instructions.
[0074] For example, the configuration monitoring module in an electronic device can obtain the chip's temperature through the chip's temperature control unit, the chip's operating frequency through the chip's frequency control unit, the chip's voltage through the chip's power control unit, the chip's microarchitecture status parameters through the microarchitecture control unit, and the number of instructions executed and the amount of memory access data read within a preset period through the performance event monitoring unit.
[0075] Of course, in addition to the operating status parameters listed above, the electronic device can also obtain other unlisted operating status parameters and determine the power consumption of the chip at the current moment based on the operating status parameters. This application embodiment does not limit this.
[0076] S202. The electronic device determines the target value of the chip's operating parameters based on the chip's power consumption at the current moment and the preset power consumption range, so that the chip's power consumption at the target value of the operating parameters is within the preset power consumption range.
[0077] Among them, the operating parameters include the microarchitecture mode level; the microarchitecture mode level is used to represent the microarchitecture state of the chip.
[0078] In one feasible approach, different system architectures of a chip correspond to different microarchitectural patterns, and the microarchitectural pattern levels of these different patterns may also differ. Consequently, the microarchitectural state of the chip also differs under different microarchitectural pattern levels.
[0079] Understandably, the microarchitectural state of a chip can be reflected through its microarchitectural state parameters. For example, when the microarchitectural state parameter is memory access rate, a higher memory access rate results in higher microarchitectural performance, but also higher power consumption. Conversely, a lower memory access rate results in lower microarchitectural performance, but also lower power consumption.
[0080] For example, when the chip's system architecture is ARM, the microarchitecture mode is Performance Defined Power (PDP) mode. Within PDP mode, different PDP level levels can represent different microarchitecture states of the chip.
[0081] For example, PDP mode levels can include: Level 1, Level 2, Level 3, Level 4, and Level 5.
[0082] When the chip's PDP mode level is Level 1, the chip's memory access rate is A1, data transfer rate is B1, buffer size is C1, number of pending task instructions is D1, and number of parallel task instructions is E1.
[0083] When the chip's PDP mode level is level 2, the chip's memory access rate is A2, data transfer rate is B2, buffer size is C2, number of pending task instructions is D2, and number of parallel task instructions is E2.
[0084] When the chip's PDP mode level is three, the chip's memory access rate is A3, data transfer rate is B3, buffer size is C3, number of pending task instructions is D3, and number of parallel task instructions is E3.
[0085] When the chip's PDP mode level is four, the chip's memory access rate is A4, data transfer rate is B4, buffer size is C4, number of pending task instructions is D4, and number of parallel task instructions is E4.
[0086] When the chip's PDP mode level is level 5, the chip's memory access rate is A5, data transfer rate is B5, buffer size is C5, number of pending task instructions is D5, and number of parallel task instructions is E5.
[0087] Among them, A5<A4<A3<A2<A1, B5<B4<B3<B2<B1, C5<C4<C3<C2<C1, D5<D4<D3<D2<D1, E5<E4<E3<E2<E1.
[0088] In other words, in PDP mode, the chip's microarchitecture mode level is inversely proportional to its power consumption. A higher PDP mode level results in lower microarchitecture state parameters and thus lower power consumption. Conversely, a lower PDP mode level results in higher microarchitecture state parameters and thus higher power consumption.
[0089] Another example is when the chip's system architecture is x86, the microarchitecture mode is core hibernation mode. In core hibernation mode, the microarchitecture mode levels can include: level 1, level 2, and level 3.
[0090] When the chip's core sleep mode level is level one, all of the chip's cores are working.
[0091] When the chip's core sleep mode level is level 2, some cores of the chip are working while others are in sleep mode.
[0092] When the chip's core sleep mode level is three, all cores of the chip will go into sleep mode.
[0093] It should be understood that the more cores a chip has that are actively operating, the higher its power consumption. Therefore, in core hibernation mode, the chip's microarchitecture level is inversely proportional to its power consumption. A higher core hibernation level results in lower power consumption, and vice versa.
[0094] As can be seen from the above, when the chip's operating parameters include the chip's microarchitecture mode level, the chip's microarchitecture mode level can affect the chip's power consumption. Therefore, electronic devices can adjust the chip's microarchitecture mode level according to the chip's power consumption at the current moment and the preset power consumption range to determine the target value of the chip's operating parameters.
[0095] In one possible implementation, the aforementioned preset power consumption range (also known as the expected power consumption range, i.e., the desired power consumption range) can be set based on meeting the chip's stability and operating performance requirements. For example, the preset power consumption range could be 140W-160W. Of course, this preset power consumption range can be reasonably set according to different chip requirements, and this application embodiment does not limit this.
[0096] In one feasible approach, when the chip's power consumption control accuracy requirement is high, the electronic device can also determine the target value of the chip's operating parameters based on the chip's power consumption at the current moment and the preset power consumption value (also known as the expected power consumption value, i.e. the power consumption value that is desired to be achieved, such as 150W), so that the chip's power consumption at the target value of the operating parameters is the preset power consumption value.
[0097] Based on the above examples, when the chip's microarchitecture mode is PDP mode or core hibernation mode, since the chip's microarchitecture mode level is inversely proportional to the chip's power consumption, when the chip's power consumption is high at the current moment (e.g., higher than the maximum value of the preset power consumption range), the electronic device can increase the chip's microarchitecture mode level and set the increased microarchitecture mode level as the target value of the microarchitecture mode level.
[0098] Correspondingly, when the chip's power consumption is low at the current moment (e.g., below the minimum value of the preset power consumption range), the electronic device can lower the chip's microarchitecture mode level and set the lowered microarchitecture mode level as the target value of the microarchitecture mode level.
[0099] Subsequently, the electronic device can send the target value of the microarchitecture mode level to the adjustment module that adjusts the microarchitecture mode level through the configuration distribution module, so that the power consumption of the chip at the target value of the microarchitecture mode level is within the preset power consumption range.
[0100] In one feasible approach, after determining the target values of the operating parameters, the electronic device can directly adjust the operating parameters via a configuration distribution module. However, since the chip's power consumption changes in real time, and the target values of the operating parameters determined by the electronic device may also affect the chip's power consumption, directly adjusting the operating parameters via the configuration distribution module may not ensure that the chip's power consumption remains within the preset range. In this case, the electronic device can determine the target values of the chip's operating parameters by determining the expected values of the operating parameters and the estimated power consumption of the chip under those expected values. Figure 2 ,like Figure 3 As shown, in S202 above, the method by which the electronic device determines the target value of the chip's operating parameters based on the chip's power consumption at the current moment and a preset power consumption range specifically includes:
[0101] S301. The electronic device determines the expected value of the operating parameters based on the chip's power consumption at the current moment and the preset power consumption range.
[0102] In one feasible approach, the electronic device can determine the expected values of operating parameters based on a preset step size.
[0103] For example, suppose the operating parameter is the microarchitecture mode level, and the chip's current microarchitecture mode level is level 2, with a preset step size of 1 for adjusting the microarchitecture mode level. If the chip's power consumption at the current moment exceeds the maximum value of the preset power consumption range, the electronic device can increase the microarchitecture mode level by 1, resulting in an expected value of level 3.
[0104] S302, Electronic device determines the estimated power consumption of the chip under the expected values of operating parameters.
[0105] For example, in combination Figure 1 In electronic devices, the power consumption calculation module can not only determine the chip's power consumption at the current moment based on the operating status parameters at the current moment, but also replace the operating parameters in the operating status parameters at the current moment with the expected values of the operating parameters, and determine the estimated power consumption of the chip under the expected values of the operating parameters based on the replaced operating status parameters.
[0106] S303. When the power consumption estimate is within the preset power consumption range, or when the expected value of the operating parameter is the upper limit or lower limit of the operating parameter, the electronic device determines the expected value of the operating parameter as the target value of the operating parameter.
[0107] Specifically, if the estimated power consumption is within the preset power consumption range, it means that the expected values of the operating parameters can make the chip's power consumption reach the expected level. Therefore, electronic devices can determine the expected values of the operating parameters as the target values of the operating parameters.
[0108] If the expected value of a working parameter is either its upper or lower limit, it means that the expected value of that working parameter has been adjusted to its upper or lower limit (i.e., hardware limitation) and cannot be adjusted further. Therefore, the electronic device can determine the expected value of the working parameter as its target value.
[0109] Of course, when there are multiple operating parameters, if the expected value of an operating parameter is the upper limit or lower limit of the operating parameter, but the power consumption estimate is not within the preset power consumption range, the electronic device can also determine the target values of other operating parameters so that the power consumption of the chip at the target value of the operating parameter is within the preset power consumption range.
[0110] In one feasible approach, the operating parameters include not only the microarchitectural pattern level but also the operating frequency. (Combined) Figure 2 ,like Figure 4 As shown, in S202 above, the method by which the electronic device determines the target value of the chip's operating parameters based on the chip's power consumption at the current moment and a preset power consumption range specifically includes:
[0111] S401. The electronic device determines the expected value of the first parameter based on the chip's power consumption at the current moment and the preset power consumption range.
[0112] The first parameter can be either the microarchitecture mode level or the operating frequency. For a description of S401, please refer to the detailed description of S301; it will not be repeated here.
[0113] S402, Electronic device determines the estimated power consumption of the chip under the expected value of the first parameter.
[0114] For a description of S402, please refer to the detailed description of S302, which will not be repeated here.
[0115] S403. The electronic device determines the target value of the first parameter and the target value of the second parameter based on the expected value of the first parameter and the estimated power consumption of the chip under the expected value of the first parameter.
[0116] Among them, one of the first and second parameters is the operating frequency, and the other is the microarchitecture mode level.
[0117] It should be noted that adjusting the operating frequency may affect the chip's stability, but it can improve the chip's energy efficiency ratio. Similarly, adjusting the microarchitecture mode level may affect the chip's energy efficiency ratio, but it can improve the chip's stability. Therefore, electronic devices can determine the order in which to adjust the operating parameters based on different power consumption control requirements.
[0118] If power consumption control demands high chip stability but low energy efficiency, then the first parameter is the microarchitecture mode level, and the second parameter is the operating frequency. Conversely, if power consumption control demands high chip energy efficiency but low stability, then the first parameter is the operating frequency, and the second parameter is the microarchitecture mode level.
[0119] In other words, this application can be used in any scenario with power control requirements. It can adjust only the microarchitecture mode level or adjust both the microarchitecture mode level and the operating frequency to achieve power control. That is, this application can realize personalized customization of power control in various scenarios to meet different power control needs.
[0120] Specifically, when the operating parameters include operating frequency and microarchitecture mode level, the electronic device can first determine the expected value of a parameter (i.e., the first parameter) and the estimated power consumption of the chip under the expected value of the first parameter.
[0121] If the chip's power consumption estimate under the expected value of the first parameter is within the preset power consumption range, it means that adjusting only the first parameter is sufficient to meet the chip's power consumption requirements. In this case, the electronic device can directly determine the expected value of the first parameter as the target value of the operating parameters without adjusting the second parameter.
[0122] Correspondingly, if the chip's power consumption estimate under the expected value of the first parameter is not within the preset power consumption range, and the expected value of the first parameter is either the upper or lower limit of the first parameter, it indicates that the expected value of the operating parameter has been adjusted to the upper or lower limit and cannot be further adjusted. Therefore, the electronic device can determine the target value of the operating parameter by adjusting the second parameter.
[0123] In one feasible way, combining Figure 4 ,like Figure 5 As shown, in S403 above, the method by which the electronic device determines the target value of the first parameter and the target value of the second parameter based on the expected value of the first parameter and the estimated power consumption of the chip under the expected value of the first parameter specifically includes:
[0124] S501. If the estimated power consumption of the chip under the expected value of the first parameter is not within the preset power consumption range, and the expected value of the first parameter is the upper limit or lower limit of the first parameter, the electronic device determines the expected value of the second parameter based on the estimated power consumption of the chip under the expected value of the first parameter.
[0125] For example, taking the first parameter as the PDP mode level and the second parameter as the operating frequency, if the expected power consumption of the chip is still greater than the maximum value of the preset power consumption range when the expected value of the PDP mode level is level five, then it is impossible to continue adjusting the expected value of the PDP mode level. In this case, the electronic device can determine the expected value of the operating frequency.
[0126] In one feasible approach, the electronic device can determine the expected value of the operating frequency based on a preset step size of the operating frequency.
[0127] For example, suppose the chip is currently operating at a frequency of 3000MHz with a preset step size of 100MHz. If the expected power consumption of the chip is still greater than the maximum value of the preset power consumption range when the expected value of the chip in PDP mode is level five, the electronic device can determine that the expected value of the operating frequency is 2900MHz.
[0128] S502, Electronic device determines the estimated power consumption of the chip under the expected value of the second parameter.
[0129] For a description of S502, please refer to the detailed description of S302, which will not be repeated here.
[0130] S503. If the estimated power consumption of the chip under the expected value of the second parameter is within the preset power consumption range, or if the expected value of the second parameter is the upper limit or lower limit of the second parameter, the electronic device determines the expected value of the first parameter as the target value of the first parameter, and determines the expected value of the second parameter as the target value of the second parameter.
[0131] Continuing with the example above, if the expected value of the chip in PDP mode is level 5 and the expected value of the operating frequency is 2900MHz, and if the estimated power consumption of the chip is already within the preset power consumption range, then the electronic device will determine level 5 as the target value of the PDP mode level and 2900MHz as the target value of the operating frequency.
[0132] If the expected value of the chip in PDP mode is level 5 and the expected value of the operating frequency is 2900MHz, and the estimated power consumption of the chip is still not within the preset power consumption range, the electronic device continues to determine the expected value of the operating frequency until the expected power consumption of the chip at the expected value of the operating frequency is within the preset power consumption range, or the expected value of the operating frequency is the upper limit or lower limit of the operating frequency.
[0133] In one feasible approach, when an electronic device needs to control power consumption based on the target values of the first parameter and the second parameter simultaneously, the electronic device can first determine the target value of the microarchitecture mode level and then determine the target value of the operating frequency (i.e., the first parameter is the microarchitecture mode level and the second parameter is the operating frequency), or it can first determine the target value of the operating frequency and then determine the target value of the microarchitecture mode level (i.e., the first parameter is the operating frequency and the second parameter is the microarchitecture mode level). This application embodiment does not limit this approach.
[0134] In one possible implementation, the electronic device may also determine the expected value of the second parameter after determining the expected value of the first parameter, and the expected value of the first parameter is not the upper limit or lower limit of the first parameter, so that the estimated power consumption of the chip is within the preset power consumption range. This application embodiment does not limit this.
[0135] As can be seen from the above, this application can achieve the effect of controlling power consumption while improving the chip's energy efficiency ratio by adjusting the microarchitecture mode level (which essentially means turning off or on some microarchitecture designs, or reducing or increasing the resource usage corresponding to some microarchitecture state parameters in exchange for power consumption control) and operating frequency. Compared with general power consumption control methods, this application can not only respond quickly and improve power consumption control accuracy, but also ensure chip stability and improve chip energy efficiency ratio.
[0136] In one feasible approach, a chip can include multiple cores. (Combined) Figure 3 ,like Figure 6 As shown, in S301 above, the method for the electronic device to determine the expected value of the operating parameters based on the chip's power consumption at the current moment and a preset power consumption range specifically includes:
[0137] S601. The electronic device determines the expected value of the operating parameters of each of the multiple cores in turn based on the power consumption of the chip at the current moment, the preset power consumption range, and the preset order.
[0138] The preset order includes any of the following: the order of core numbers of multiple cores, the order of power consumption of each core, or a random order.
[0139] In one feasible manner, when the operating parameters include a first parameter and a second parameter, the method for determining the power consumption estimate of the chip under the expected value of the first parameter in S402 specifically includes:
[0140] The electronic device determines the expected value of the first parameter of each of the multiple cores in turn based on the chip's power consumption at the current moment, the preset power consumption range, and the preset order.
[0141] Accordingly, in S501 above, the method by which the electronic device determines the expected value of the second parameter based on the expected power consumption of the chip under the expected value of the first parameter specifically includes:
[0142] Based on the expected power consumption of the chip under the expected value of the first parameter and the preset order, the expected value of the second parameter of each of the multiple cores is determined sequentially.
[0143] For example, when the first parameter is the microarchitecture mode level and the second parameter is the operating frequency, the electronic device can first determine the expected value of the operating frequency of all cores in the chip, and then determine the expected value of the microarchitecture mode level of all cores; it can also first determine the expected value of the microarchitecture mode level of all cores in the chip, and then determine the expected value of the operating frequency of all cores; it can also first determine the expected value of the microarchitecture mode level of a portion of the cores in the chip, and then determine the expected value of the operating frequency of another portion of the cores; it can also first determine the expected value of the microarchitecture mode level and the expected value of the operating frequency of a certain core in the chip, and then determine the expected value of the microarchitecture mode level and the expected value of the operating frequency of the other cores in sequence. This application embodiment does not limit this.
[0144] In some embodiments, when the units corresponding to each working parameter adjust the working parameters according to the target value of the working parameters, the working parameters can also be adjusted in the order described above, which will not be repeated here.
[0145] In one feasible way, combining Figure 2 ,like Figure 7 As shown, in S201 above, the method by which the electronic device determines the power consumption of the chip at the current moment specifically includes:
[0146] S701. The electronic device determines the static power consumption of the chip at the current moment based on the chip's temperature and voltage at the current moment.
[0147] In one feasible approach, the chip's temperature, voltage, and static power consumption at the current moment satisfy the following formula:
[0148] P = (a*V + b)ec*T;
[0149] Where a, b, c, and e are constant parameters, P is the static power consumption of the chip at the current moment, V is the voltage of the chip at the current moment, and T is the temperature of the chip at the current moment.
[0150] S702. The electronic device determines the dynamic power consumption of the chip at the current moment based on the chip's microarchitecture state parameters at the current moment, the chip's operating frequency at the current moment, the chip's voltage at the current moment, the number of instructions executed by the chip in a preset cycle, and the amount of memory data read by the chip in a preset cycle at the current moment.
[0151] In one feasible implementation, the chip's microarchitecture state parameters at the current moment, the chip's operating frequency at the current moment, the chip's voltage at the current moment, the number of instructions executed by the chip in a preset period, the amount of memory data read by the chip in the preset period, and the chip's dynamic power consumption at the current moment satisfy the following formula:
[0152] P=a*C1+b*C2+c*C3+d*C4+e*C5+f*F*V2+g;
[0153] Where a, b, c, d, e, f, and g are constant parameters, P is the dynamic power consumption of the chip at the current moment, V is the voltage of the chip at the current moment, T is the temperature of the chip at the current moment, F is the operating frequency of the chip at the current moment, C1 is the number of instructions executed by the chip in a preset period, C2 is the amount of memory data read by the chip in a preset period, and C3-C5 are any three of the microarchitecture state parameters of the chip at the current moment.
[0154] In one possible implementation, C3-C5 can be three parameters related to the chip's cache in the microarchitecture state parameters.
[0155] S703: Electronic devices determine the sum of static power consumption and dynamic power consumption as the power consumption of the chip at the current moment.
[0156] The foregoing mainly describes the solutions provided by the embodiments of this disclosure from the perspective of an electronic device. It is understood that, in order to achieve the above functions, the electronic device includes modules that perform each function, such as a configuration monitoring module and a power consumption calculation module. The embodiments of this application will now be described from the perspective of each module in the electronic device. Figure 8 This illustrates yet another power consumption control method provided by an embodiment of this application. For example... Figure 8 As shown, the power consumption control method includes:
[0157] S801, Configure the monitoring module to obtain the chip's operating status parameters at the current moment.
[0158] S802, The configuration monitoring module sends the chip's operating status parameters at the current moment to the power consumption calculation module.
[0159] S803, the power consumption calculation module determines the power consumption of the chip at the current moment based on the chip's operating status parameters at the current moment.
[0160] S804, the power consumption calculation module determines the power consumption adjustment strategy as either increasing or decreasing power consumption based on the chip's power consumption at the current moment and the preset power consumption range.
[0161] S805, the power consumption calculation module determines the target value of the operating parameters according to the power consumption adjustment strategy.
[0162] In one feasible way, such as Figure 9 As shown, when the power consumption adjustment strategy is determined to be either increasing or decreasing power consumption, and the power consumption control requirement is high stability and low energy efficiency, the power consumption control method provided in this application includes:
[0163] S901, the power consumption calculation module sends an instruction to the microarchitecture calculation module to determine the target value of the microarchitecture mode level.
[0164] S902, the microarchitecture computing module determines the expected value of the microarchitecture mode level, and the estimated power consumption of the chip at the expected value of the microarchitecture mode level.
[0165] S903, the microarchitecture computing module sends the power consumption estimate of the chip at the expected value of the microarchitecture mode level to the power consumption computing module.
[0166] S904, the power consumption calculation module determines whether the estimated power consumption of the chip at the expected value of the microarchitecture mode level reaches the preset power consumption range.
[0167] If yes, then the expected value of the microarchitecture mode level is determined as the target value of the microarchitecture mode level. If not, then continue to send instructions to the microarchitecture computing module to determine the target value of the microarchitecture mode level until the chip's power consumption estimate under the expected value of the microarchitecture mode level is within the preset power consumption range, or the expected value of the microarchitecture mode level is the upper limit or lower limit of the microarchitecture mode level.
[0168] For ease of understanding, Figure 9 The instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level is described as a continue instruction.
[0169] S905. Upon receiving the first message from the microarchitecture calculation module, the power consumption calculation module sends an instruction to the frequency calculation module to determine the target value of the operating frequency.
[0170] The first piece of information indicates that the estimated power consumption of the chip at the expected value of the microarchitecture mode level is not within the preset power consumption range, and the expected value of the microarchitecture mode level is the upper limit or the lower limit of the microarchitecture mode level.
[0171] S906, the frequency calculation module determines the expected value of the operating frequency and the estimated power consumption of the chip at the expected operating frequency.
[0172] S907, the frequency calculation module sends the power consumption estimate under the expected value of the operating frequency to the power consumption calculation module.
[0173] The S908 power consumption calculation module determines whether the estimated power consumption under the expected value of the operating frequency reaches the preset power consumption range.
[0174] If yes, then the expected value of the operating frequency is determined as the target value of the operating frequency. If not, then continue sending instructions to the frequency calculation module to determine the target value of the operating frequency until the estimated power consumption of the chip at the expected value of the operating frequency is within the preset power consumption range, and then determine the expected value of the operating frequency as the target value of the operating frequency.
[0175] For ease of understanding, Figure 9 The instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency is described as a continue instruction.
[0176] In one feasible way, such as Figure 10 As shown, when the power consumption adjustment strategy is determined to be either increasing or decreasing power consumption, and the power consumption control requirement is a high energy efficiency ratio and a low stability requirement, the power consumption control method provided in this application includes:
[0177] S1001, The power consumption calculation module sends an instruction to the frequency calculation module to determine the target value of the operating frequency.
[0178] S1002, the frequency calculation module determines the expected value of the operating frequency and the estimated power consumption of the chip at the expected operating frequency.
[0179] S1003, the frequency calculation module sends the power consumption estimate of the chip at the expected value of the operating frequency to the power consumption calculation module.
[0180] S1004 The power consumption calculation module determines whether the estimated power consumption of the chip at the expected operating frequency reaches the preset power consumption range.
[0181] If yes, then the expected value of the operating frequency is determined as the target value of the operating frequency. If not, then continue to send instructions to the frequency calculation module to determine the target value of the operating frequency until the estimated power consumption of the chip at the expected value of the operating frequency is within the preset power consumption range, or the expected value of the operating frequency is the upper limit or lower limit of the operating frequency.
[0182] For ease of understanding, Figure 10 The instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency is described as a continue instruction.
[0183] S1005. When the power consumption calculation module receives the second message sent by the frequency calculation module, it sends an instruction to the microarchitecture calculation module to determine the target value of the microarchitecture mode level.
[0184] The second piece of information indicates that the estimated power consumption of the chip at the expected value of the operating frequency is not within the preset power consumption range, and the expected value of the operating frequency is the upper limit or the lower limit of the operating frequency.
[0185] S1006, the microarchitecture computing module determines the expected value of the microarchitecture mode level, and the estimated power consumption of the chip at the expected value of the microarchitecture mode level.
[0186] S1007, The microarchitecture computing module sends the power consumption estimate under the expected value of the microarchitecture mode level to the power consumption computing module.
[0187] S1008, the power consumption calculation module determines whether the power consumption estimate under the expected value of the microarchitecture mode level reaches the preset power consumption range.
[0188] If yes, then the expected value of the microarchitecture mode level is determined as the target value of the microarchitecture mode level. If not, then continue sending instructions to the microarchitecture computing module to determine the target value of the microarchitecture mode level until the chip's power consumption estimate under the expected value of the microarchitecture mode level is within the preset power consumption range, and then determine the expected value of the operating frequency as the target value of the operating frequency.
[0189] For ease of understanding, Figure 10 The instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level is described as a continue instruction.
[0190] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the algorithmic steps of the examples described in conjunction with the embodiments of this disclosure, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0191] This disclosure embodiment can divide an electronic device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one functional module. The integrated module can be implemented in hardware or software. It should be noted that the module division in this disclosure embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. The following description uses the example of dividing each functional module according to each function.
[0192] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. The electronic device can execute the power consumption control method provided in the above-described method embodiments. Figure 11 As shown, the electronic device includes: a processing unit 1101.
[0193] Processing unit 1101 is used to determine the power consumption of the chip at the current moment.
[0194] The processing unit 1101 is further configured to determine the target value of the chip's operating parameters based on the chip's power consumption at the current moment and a preset power consumption range, so that the chip's power consumption at the target value of the operating parameters is within the preset power consumption range; the operating parameters include the microarchitecture mode level; the microarchitecture mode level is used to represent the chip's microarchitecture state.
[0195] In one possible implementation, the processing unit 1101 is specifically used for:
[0196] The expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range.
[0197] Determine the estimated power consumption of the chip under the expected values of its operating parameters;
[0198] If the power consumption estimate is within the preset power consumption range, or if the expected value of the operating parameter is the upper limit or lower limit of the operating parameter, the expected value of the operating parameter is determined as the target value of the operating parameter.
[0199] In one possible implementation, the chip includes multiple cores; the processing unit 1101 is specifically used for:
[0200] The expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range, including:
[0201] Based on the chip's power consumption at the current moment, the preset power consumption range, and the preset order, the expected values of the operating parameters of each core in the multiple cores are determined sequentially; the preset order includes any one of the following: the core number order of the multiple cores, the power consumption order of each core, or a random order.
[0202] In one possible implementation, the operating parameters also include the operating frequency; the processing unit 1101 is specifically used for:
[0203] The expected value of the first parameter is determined based on the chip's power consumption at the current moment and the preset power consumption range;
[0204] Determine the estimated power consumption of the chip under the expected value of the first parameter;
[0205] Based on the expected value of the first parameter and the estimated power consumption of the chip under the expected value of the first parameter, the target values of the first parameter and the second parameter are determined; wherein, one of the first parameter and the second parameter is the operating frequency, and the other is the microarchitecture mode level.
[0206] In one possible implementation, the processing unit 1101 is specifically used for:
[0207] If the estimated power consumption of the chip under the expected value of the first parameter is not within the preset power consumption range, and the expected value of the first parameter is the upper limit or lower limit of the first parameter, the expected value of the second parameter shall be determined based on the estimated power consumption of the chip under the expected value of the first parameter.
[0208] Determine the estimated power consumption of the chip under the expected value of the second parameter;
[0209] If the estimated power consumption of the chip under the expected value of the second parameter is within the preset power consumption range, or if the expected value of the second parameter is the upper limit or lower limit of the second parameter, the expected value of the first parameter is determined as the target value of the first parameter, and the expected value of the second parameter is also determined as the target value of the second parameter.
[0210] In one possible implementation, the chip includes multiple cores; the processing unit 1101 is specifically used for:
[0211] Based on the chip's power consumption at the current moment, the preset power consumption range, and the preset order, the expected value of the first parameter of each of the multiple cores is determined sequentially; the preset order includes any one of the following: the core number order of the multiple cores, the power consumption order of each core, or a random order;
[0212] Based on the expected power consumption of the chip under the expected value of the first parameter and the preset order, the expected value of the second parameter of each of the multiple cores is determined sequentially.
[0213] In one possible implementation, the processing unit 1101 is specifically used for:
[0214] The static power consumption of the chip at the current moment is determined based on the chip's temperature and voltage at the current moment.
[0215] The dynamic power consumption of the chip at the current moment is determined based on the chip's microarchitecture state parameters, chip's operating frequency, chip's voltage, the number of instructions executed by the chip in a preset period, and the amount of memory data read by the chip in a preset period.
[0216] The sum of static power consumption and dynamic power consumption is determined as the power consumption of the chip at the current moment.
[0217] In one possible implementation, the microarchitecture state parameters include at least one of the following: memory access rate, data transfer rate, cache size, number of pending task instructions, and number of parallel task instructions.
[0218] In one possible approach, the microarchitectural modes corresponding to the microarchitectural mode level include: the PDP mode in the ARM architecture or the core hibernation mode in the x86 architecture.
[0219] In implementing the functionality of the integrated modules described above using hardware, this disclosure provides another possible structure for the electronic device described in the above embodiments. For example... Figure 12 As shown, the electronic device 120 includes a processor 1202 and a bus 1204. In one possible implementation, the electronic device may further include a memory 1201; optionally, the electronic device may further include a communication interface 1203.
[0220] Processor 1202 may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1202 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1202 may also be a combination of functions implementing computational capabilities, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0221] The communication interface 1203 is used to connect with other devices via a communication network. This communication network can be Ethernet, wireless access network, wireless local area network (WLAN), etc.
[0222] The memory 1201 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0223] As one possible implementation, the memory 1201 can exist independently of the processor 1202. The memory 1201 can be connected to the processor 1202 via a bus 1204 and is used to store instructions or program code. When the processor 1202 calls and executes the instructions or program code stored in the memory 1201, it can implement the power consumption control method provided in the embodiments of this disclosure.
[0224] In another possible implementation, the memory 1201 can also be integrated with the processor 1202.
[0225] Bus 1204 can be an extended industry standard architecture (EISA) bus, etc. Bus 1204 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0226] Some embodiments of this disclosure provide an electronic device that can perform the power consumption control method as described in any of the above embodiments.
[0227] Some embodiments of this disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) storing computer program instructions that, when executed on a computer, cause the computer to perform a power consumption control method as described in any of the above embodiments.
[0228] For example, the computer-readable storage media described above may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure may represent one or more devices for storing information and / or other machine-readable storage media. The term "machine-readable storage media" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.
[0229] This disclosure provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the power consumption control method described in any of the above embodiments.
[0230] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any changes or substitutions within the technical scope disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A power consumption control method, characterized in that, include: Determine the chip's power consumption at the current moment; Based on the chip's power consumption at the current moment and a preset power consumption range, a target value for the chip's operating parameters is determined so that the chip's power consumption at the target value of the operating parameters is within the preset power consumption range; the operating parameters include the microarchitecture mode level; The microarchitecture mode level is used to represent the microarchitecture state of the chip.
2. The power consumption control method according to claim 1, characterized in that, The step of determining the target values of the chip's operating parameters based on the chip's power consumption at the current moment and a preset power consumption range includes: The expected value of the operating parameters is determined based on the power consumption of the chip at the current moment and the preset power consumption range; Determine the estimated power consumption of the chip under the expected values of the operating parameters; If the estimated power consumption is within the preset power consumption range, or if the expected value of the operating parameter is the upper limit or lower limit of the operating parameter, the expected value of the operating parameter is determined as the target value of the operating parameter.
3. The power consumption control method according to claim 2, characterized in that, The chip includes multiple cores; The step of determining the expected value of the operating parameters based on the chip's power consumption at the current moment and the preset power consumption range includes: Based on the chip's power consumption at the current moment, the preset power consumption range, and the preset order, the expected values of the operating parameters of each of the plurality of cores are determined sequentially; the preset order includes any one of the following: the core number order of the plurality of cores, the power consumption order of each core, or a random order.
4. The power consumption control method according to claim 1, characterized in that, The operating parameters also include the operating frequency; The step of determining the target values of the chip's operating parameters based on the chip's power consumption at the current moment and a preset power consumption range includes: The expected value of the first parameter is determined based on the power consumption of the chip at the current moment and the preset power consumption range; Determine the estimated power consumption of the chip under the expected value of the first parameter; Based on the expected value of the first parameter and the estimated power consumption of the chip under the expected value of the first parameter, the target value of the first parameter and the target value of the second parameter are determined; wherein, one of the first parameter and the second parameter is the operating frequency, and the other is the microarchitecture mode level.
5. The power consumption control method according to claim 4, characterized in that, The step of determining the target value of the first parameter and the target value of the second parameter based on the expected value of the first parameter and the estimated power consumption of the chip under the expected value of the first parameter includes: If the estimated power consumption of the chip under the expected value of the first parameter is not within the preset power consumption range, and the expected value of the first parameter is the upper limit or the lower limit of the first parameter, the expected value of the second parameter is determined based on the estimated power consumption of the chip under the expected value of the first parameter. Determine the estimated power consumption of the chip under the expected value of the second parameter; If the estimated power consumption of the chip at the expected value of the second parameter is within the preset power consumption range, or if the expected value of the second parameter is the upper limit or lower limit of the second parameter, then the expected value of the first parameter is determined as the target value of the first parameter, and the expected value of the second parameter is also determined as the target value of the second parameter.
6. The power consumption control method according to claim 5, characterized in that, The chip includes multiple cores; Determining the expected value of the first parameter based on the chip's power consumption at the current moment and the preset power consumption range includes: Based on the chip's power consumption at the current moment, the preset power consumption range, and the preset order, the expected value of the first parameter of each of the plurality of cores is determined sequentially; the preset order includes any one of the following: the core number order of the plurality of cores, the power consumption order of each core, or a random order; Determining the expected value of the second parameter based on the estimated power consumption of the chip under the expected value of the first parameter includes: Based on the estimated power consumption of the chip under the expected value of the first parameter and the preset order, the expected value of the second parameter of each of the plurality of cores is determined sequentially.
7. The power consumption control method according to claim 1, characterized in that, Determine the chip's power consumption at the current moment, including: The static power consumption of the chip at the current moment is determined based on the chip's temperature and voltage at the current moment. The dynamic power consumption of the chip at the current moment is determined based on the chip's microarchitecture state parameters at the current moment, the chip's operating frequency at the current moment, the chip's voltage at the current moment, the number of instructions executed by the chip in a preset period, and the amount of memory data read by the chip in a preset period. The sum of the static power consumption and the dynamic power consumption is determined as the power consumption of the chip at the current moment.
8. The power consumption control method according to claim 7, characterized in that, The microarchitecture state parameters include at least one of the following: memory access rate, data transfer rate, cache size, number of pending task instructions, and number of parallel task instructions.
9. The power consumption control method according to any one of claims 1-8, characterized in that, The microarchitecture modes corresponding to the microarchitecture mode level include: Performance Defined Power (PDP) mode in the Advanced Reduced Instruction Set Machine (ARM) architecture or Core Sleep mode in the x86 architecture.
10. An electronic device, characterized in that, Includes a processor, which, when executing a computer program, implements the method as described in any one of claims 1-9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions; wherein, when the computer instructions are executed, they implement the method as described in any one of claims 1-9.
12. A computer program product, characterized in that, The computer program product includes: a computer program or instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-9.