[go: up one dir, main page]

WO2025222978A1 - Power consumption control method, electronic device, storage medium, and program product - Google Patents

Power consumption control method, electronic device, storage medium, and program product

Info

Publication number
WO2025222978A1
WO2025222978A1 PCT/CN2025/074406 CN2025074406W WO2025222978A1 WO 2025222978 A1 WO2025222978 A1 WO 2025222978A1 CN 2025074406 W CN2025074406 W CN 2025074406W WO 2025222978 A1 WO2025222978 A1 WO 2025222978A1
Authority
WO
WIPO (PCT)
Prior art keywords
power consumption
chip
parameter
expected value
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/074406
Other languages
French (fr)
Chinese (zh)
Inventor
聂琳杰
戴华亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Publication of WO2025222978A1 publication Critical patent/WO2025222978A1/en
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • 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.
  • chip components such as central processing unit (CPU), graphics processing unit (GPU), etc.
  • chip power consumption control has become particularly important.
  • Common power consumption control methods typically include, but are not limited to, Dynamic Voltage and Frequency Scaling (DVFS) and task migration techniques.
  • DVFS Dynamic Voltage and Frequency Scaling
  • Task migration controls power consumption by scheduling the workload of each core within the chip.
  • This power consumption control method includes:
  • 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, which is used to represent the chip's microarchitecture state.
  • the power consumption control device includes: a processing unit;
  • the processing unit is used to determine the chip's power consumption at the current moment
  • 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, which is used to represent the chip's microarchitecture state.
  • an electronic device in another aspect, includes a processor; when the processor executes a computer program, it implements the power consumption control method described above.
  • a computer-readable storage medium includes computer instructions that, when executed, implement the power consumption control method described above.
  • a computer program product includes a computer program or instructions that, when executed on a computer, implement the power consumption control method described above.
  • Figure 1 is a power consumption control system architecture diagram according to some embodiments of the present disclosure.
  • Figure 2 is a flowchart illustrating a power consumption control method according to some embodiments of the present disclosure.
  • Figure 3 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 4 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 5 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 6 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 7 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 8 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 9 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 10 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.
  • Figure 11 is a schematic diagram of the structure of an electronic device according to some embodiments of the present disclosure.
  • Figure 12 is a schematic diagram of the structure of another electronic device according to some embodiments of the present disclosure.
  • first,” “second,” etc. are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with terms such as “first,” “second,” etc., may explicitly or implicitly include one or more of that feature.
  • the symbol “/” means “or”, for example, A/B can mean A or B.
  • the term “and/or” in this document merely represents a description of the relationship between related objects, indicating that three relationships can exist; for example, A and/or B can mean: only A, only B, and A and B.
  • “at least one” means one or more, and “more than one” means two or more.
  • 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.
  • 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. The power consumption of the chip differs under different microarchitecture mode levels (i.e., under different microarchitecture state parameters). Therefore, this disclosure allows for power consumption control of the chip by adjusting the microarchitecture mode level.
  • the microarchitecture mode level can be adjusted to a preset level.
  • the chip can adjust at least one of the following microarchitecture state parameters to reduce chip power consumption:
  • 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 also known as reducing the chip's window depth
  • reducing the chip's number of parallel instructions also known as weakening the chip's transaction strength
  • 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.
  • DVFS technology achieves power consumption control by adjusting the chip's operating frequency and voltage.
  • the adjustment step size of the operating frequency and voltage is not precise enough, it will cause a loss of system performance.
  • frequent adjustments to the operating frequency also greatly reduce the stability of the chip.
  • Task migration technology achieves power consumption control by scheduling the workload tasks of various cores in a chip; that is, it rationally distributes the workload tasks across all cores, thereby improving the overall utilization of the chip.
  • task migration technology has a certain latency, which cannot meet the needs of chips with high real-time requirements.
  • 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.
  • Operating parameters include the microarchitecture mode level, which represents the microarchitecture state of the chip.
  • this disclosure can determine the target value of the chip's operating parameters so that the chip's power consumption under the target value of the operating parameters is within a preset power consumption range.
  • the 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 disclosure can ensure chip stability while also meeting the chip's real-time requirements.
  • this disclosure improves chip stability by adjusting the microarchitecture mode level, ensuring that the chip's power consumption remains within a preset range at the target operating parameters, without requiring adjustments to the chip's operating frequency.
  • the power consumption control method provided in this disclosure can be applied to the power consumption control system shown in FIG1.
  • This power consumption control system can be applied to any electronic device requiring power consumption control, and can be used to control the power consumption of chips within the electronic device.
  • 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.
  • 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.
  • 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.
  • the aforementioned operating parameters may include microarchitecture mode level and operating frequency.
  • 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 (directly or indirectly) to the microarchitecture calculation module 1012, the power consumption calculation module 1013, and the frequency calculation module 1014, respectively.
  • the power consumption calculation module 1013 is connected to the microarchitecture calculation module 1012 and the frequency calculation module 1014, respectively.
  • the configuration monitoring module 1011 is used to obtain the chip's operating status parameters at the current moment.
  • 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.
  • 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.
  • 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.
  • the power control system can also be divided into different subsystems based on different operating parameters.
  • 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.
  • the microarchitecture pattern hierarchy tuning subsystem is used to determine the target value of the microarchitecture pattern hierarchy.
  • the configuration monitoring module 1011, power consumption calculation module 1013 and microarchitecture calculation module 1012 can form a microarchitecture mode level adjustment subsystem.
  • the frequency conditioning subsystem is used to determine the target value of the operating frequency.
  • the configuration monitoring module 1011, the power consumption calculation module 1013 and the frequency calculation module 1014 can form a frequency regulation subsystem.
  • 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 disclosure does not limit this.
  • the aforementioned power control system can be applied to chips based on the Advanced RISC Machine (ARM) architecture, as well as chips based on the x86 architecture.
  • ARM Advanced RISC Machine
  • the power consumption control method provided in this disclosure can be applied to electronic devices (which may be the electronic device to which the power consumption control system shown in Figure 1 belongs, or an external electronic device to which the power consumption control system shown in Figure 1 belongs) to achieve power consumption control of the chip to which the power consumption control system belongs. That is to say, the execution subject of this disclosure 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 calculation. This disclosure does not limit this aspect.
  • FIG. 2 shows a flowchart of a power consumption control method. As shown in Figure 2, the power consumption control method includes S201-S202.
  • the electronic device determines the power consumption of the chip at the current moment.
  • 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.
  • the electronic device needs to determine the chip's power consumption at the current moment.
  • the chip's power consumption is typically determined by its operating state parameters at that moment. Therefore, the electronic device can obtain the chip's operating state parameters at the current moment and determine its power consumption based on those parameters.
  • 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.
  • users can also 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 respond to the user's operation, trigger a power control command, and obtain the chip's operating status parameters at the current moment in response to the power control command.
  • 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.
  • the aforementioned microarchitecture state parameters may 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.
  • 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.
  • the electronic device may also acquire other unlisted operating status parameters and determine the power consumption of the chip at the current moment based on the operating status parameters. This disclosure does not limit this.
  • 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.
  • Operating parameters include microarchitecture mode level; the microarchitecture mode level is used to represent the microarchitecture state of the chip.
  • different system architectures of the chip correspond to different microarchitecture patterns, and the microarchitecture pattern levels of these different patterns may also differ.
  • the microarchitecture state of the chip differs under different microarchitecture pattern levels.
  • the microarchitectural state of a chip can be reflected through its microarchitectural state parameters.
  • the microarchitectural state parameter is memory access rate
  • a higher memory access rate results in higher microarchitectural performance, but also higher power consumption.
  • a lower memory access rate results in lower microarchitectural performance, but also lower power consumption.
  • the microarchitecture mode is Performance-Defined Power (PDP) mode.
  • PDP Performance-Defined Power
  • different PDP level levels can represent different microarchitecture states of the chip.
  • PDP mode levels can include: Level 1, Level 2, Level 3, Level 4, and Level 5.
  • the chip's memory access rate is A1
  • data transfer rate is B1
  • buffer size is C1
  • number of pending task instructions is D1
  • number of parallel task instructions is E1.
  • the chip's memory access rate is A2
  • data transfer rate is B2
  • buffer size is C2
  • number of pending task instructions is D2
  • number of parallel task instructions is E2.
  • the chip's memory access rate is A3
  • data transfer rate is B3
  • buffer size is C3
  • number of pending task instructions is D3
  • number of parallel task instructions is E3.
  • the chip's memory access rate is A4
  • data transfer rate is B4
  • buffer size is C4
  • number of pending task instructions is D4
  • number of parallel task instructions is E4.
  • the chip's memory access rate is A5
  • data transfer rate is B5
  • buffer size is C5
  • number of pending task instructions is D5
  • number of parallel task instructions is E5.
  • 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.
  • a lower PDP mode level results in higher microarchitecture state parameters and thus higher power consumption.
  • the microarchitecture mode is core hibernation mode.
  • the microarchitecture mode levels can include: level 1, level 2, and level 3.
  • 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.
  • the aforementioned preset power consumption range (also known as the expected power consumption range, i.e., the power consumption range to be achieved) can be set based on meeting the chip's stability and operating performance.
  • the preset power consumption range can be 140W-160W. This preset power consumption range can be reasonably set according to different chip requirements, and the embodiments disclosed herein do not limit this.
  • 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 to be achieved, such as 150W), so that the chip's power consumption under the target value of the operating parameters is the preset power consumption value.
  • the preset power consumption value also known as the expected power consumption value, i.e., the power consumption value to be achieved, such as 150W
  • the electronic device can increase the chip's microarchitecture mode level and determine the increased microarchitecture mode level as the target value of the microarchitecture mode level.
  • 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.
  • 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.
  • the electronic device can directly issue an adjustment to the operating parameters through the configuration issuing module.
  • directly issuing an adjustment to the operating parameters through the configuration issuing module may not ensure that the chip's power consumption is within the preset power consumption range.
  • the electronic device can determine the target value of the chip's operating parameters by determining the expected value of the operating parameters and the estimated power consumption of the chip under the expected value of the operating parameters. Referring to Figure 2 and Figure 3, the method in S202 above for the electronic device 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 includes S301-S303.
  • 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.
  • electronic devices can determine the expected values of operating parameters based on preset step sizes.
  • the operating parameter is the microarchitecture mode level
  • the chip's current microarchitecture mode level is level 2
  • 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.
  • Electronic device determines the estimated power consumption of a chip under expected operating parameters.
  • the power consumption calculation module in the electronic device can not only determine the power consumption of the chip at the current moment based on the operating status parameters at the current moment, but also replace the working parameters in the operating status parameters at the current moment with the expected values of the working parameters, and determine the estimated power consumption of the chip at the expected values of the working parameters based on the replaced operating status parameters.
  • the electronic device determines the expected value of the operating parameter as the target value of the operating parameter.
  • 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.
  • the electronic device can determine the expected value of the working parameter as its target value.
  • 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.
  • the operating parameters include not only the microarchitecture mode level but also the operating frequency.
  • the method described in S202 above for the electronic device to determine the target values of the chip's operating parameters based on the chip's current power consumption and a preset power consumption range includes S401-S403.
  • 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.
  • the first parameter can be either the microarchitecture mode level or the operating frequency.
  • S401 please refer to the description of S301; it will not be repeated here.
  • Electronic device determines the power consumption estimate of the chip under the expected value of the first parameter.
  • 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.
  • One of the first and second parameters is the operating frequency, and the other is the microarchitecture pattern level.
  • adjusting the operating frequency may affect the chip's stability, but it can improve the chip's energy efficiency ratio.
  • 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.
  • 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.
  • this disclosure 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 disclosure can realize personalized customization of power control in various scenarios to meet different power control needs.
  • electronic devices can first determine the expected value of a parameter (i.e., the first parameter) and the estimated power consumption of the chip at the expected value of the first parameter.
  • 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.
  • the electronic device can determine the target value of the operating parameter by adjusting the second parameter.
  • 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 in S403 includes S501-S503.
  • 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.
  • the electronic device can determine the expected value of the operating frequency.
  • the electronic device can determine the expected value of the operating frequency based on a preset step size of the operating frequency.
  • the electronic device can determine that the expected value of the operating frequency is 2900MHz.
  • Electronic device determines the estimated power consumption of the chip under the expected value 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.
  • 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.
  • 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.
  • the electronic device when the 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 disclosure does not limit this approach.
  • the electronic device may also determine the expected value of the second parameter after determining the expected value of the first parameter, and if 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 disclosure does not limit this aspect.
  • this disclosure 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.
  • 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
  • this disclosure can not only respond quickly and improve power consumption control accuracy, but also ensure chip stability and improve chip energy efficiency ratio.
  • the chip may include multiple cores. Referring to Figure 3 and as shown in Figure 6, the method in S301 above 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 includes 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.
  • 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.
  • the method for determining the power consumption estimate of the chip under the expected value of the first parameter in S402 above includes:
  • 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.
  • the method for determining the expected value of the second parameter based on the power consumption estimate of the chip under the expected value of the first parameter includes:
  • the expected value of the second parameter of each of the multiple cores is determined sequentially.
  • 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 disclosure does not limit this.
  • the working parameters 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.
  • the method for determining the power consumption of the chip at the current moment in S201 above includes S701-S703.
  • 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.
  • P is the static 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.
  • 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.
  • 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
  • C3-C5 are any three of the microarchitecture state parameters of the chip at the current moment.
  • C3-C5 can be three parameters related to the chip's cache in the microarchitecture state parameters.
  • 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.
  • 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 disclosure will now be described from the perspective of each module in the electronic device.
  • Figure 8 shows another power consumption control method provided by an embodiment of this disclosure. As shown in Figure 8, the power consumption control method includes:
  • the configuration monitoring module sends the chip's operating status parameters at the current moment to the power consumption calculation module.
  • 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.
  • 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.
  • the power consumption calculation module determines the target value of the operating parameters according to the power consumption adjustment strategy.
  • the power consumption control method provided in this disclosure includes:
  • the power consumption calculation module sends an instruction to the microarchitecture calculation module to determine the target value of the microarchitecture mode level.
  • 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.
  • 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.
  • 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.
  • 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.
  • Figure 9 describes the instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level as a continuation instruction.
  • the power consumption calculation module 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.
  • 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.
  • 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.
  • the frequency calculation module sends the power consumption estimate under the expected value of the operating frequency to the power consumption calculation module.
  • 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.
  • 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.
  • Figure 9 describes the instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency as a continuation instruction.
  • the power consumption control method includes:
  • the power consumption calculation module sends an instruction to the frequency calculation module to determine the target value of the operating frequency.
  • 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.
  • 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.
  • 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.
  • 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.
  • Figure 10 describes the instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency as a continuation instruction.
  • 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.
  • the second piece of information indicates that the chip's power consumption estimate at the expected operating frequency is not within the preset power consumption range, and the expected operating frequency is either the upper limit or the lower limit of the operating frequency.
  • 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.
  • the microarchitecture computing module sends the power consumption estimate under the expected value of the microarchitecture mode level to the power consumption computing module.
  • 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.
  • 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.
  • Figure 10 describes the instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level as a continuation instruction.
  • electronic devices include hardware structures and/or software modules corresponding to the execution of each function.
  • 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.
  • This disclosure embodiment can divide an electronic device into functional modules according to the above method embodiment.
  • 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.
  • FIG 11 is a schematic diagram 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 embodiment.
  • the electronic device includes a processing unit 1101.
  • Processing unit 1101 is used to determine the power consumption of the chip at the current moment.
  • 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.
  • processing unit 1101 is used for:
  • the expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range.
  • the expected value of the operating parameter is determined as the target value of the operating parameter.
  • the chip includes multiple cores; the processing unit 1101 is used for:
  • the expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range, including:
  • the preset power consumption range, and the preset order 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.
  • the operating parameters also include the operating frequency; the processing unit 1101 is used for:
  • 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;
  • 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.
  • processing unit 1101 is used for:
  • 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.
  • 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.
  • the chip includes multiple cores; the processing unit 1101 is used for:
  • 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;
  • the expected value of the second parameter of each of the multiple cores is determined sequentially.
  • processing unit 1101 is used for:
  • 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, 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.
  • the sum of static power consumption and dynamic power consumption is determined as the power consumption of the chip at the current moment.
  • 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.
  • the microarchitecture mode level corresponds to the microarchitecture mode, which includes: the PDP mode in the ARM architecture or the core hibernation mode in the x86 architecture.
  • the electronic device 120 includes: a memory 1201, a processor 1202, a communication interface 1203, and a bus 1204.
  • the memory 1201 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions; it may be random access memory (RAM) or other type of dynamic storage device capable of dynamically storing information and instructions; it may also be electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices; 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.
  • ROM read-only memory
  • RAM random access memory
  • EEPROM electrically erasable programmable read-only memory
  • disk storage media or other magnetic storage devices
  • Processor 1202 may be a logic block, module, or circuit that implements or performs the various exemplary methods 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.
  • ASIC application-specific integrated circuit
  • FPGA field-programmable gate array
  • Processor 1202 may implement or perform the various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure.
  • Processor 1202 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP (digital signal processor) and a microprocessor, etc.
  • DSP digital signal processor
  • 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.
  • 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.
  • 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.
  • the memory 1201 can also be integrated with the processor 1202.
  • 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, only one thick line is used to represent bus 1204 in Figure 12, but this does not mean that there is only one bus or only one type of bus.
  • EISA extended industry standard architecture
  • 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.
  • 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.
  • a computer-readable storage medium e.g., a non-transitory computer-readable storage medium
  • Exemplary examples show that the aforementioned computer-readable storage media 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.
  • 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Power Sources (AREA)

Abstract

Embodiments of the present disclosure provide a power consumption control method, an electronic device, a storage medium, and a program product. The power consumption control method comprises: determining the power consumption of a chip at the current moment; and determining a target value of a working parameter of the chip on the basis of the power consumption of the chip at the current moment and a preset power consumption range, so that the power consumption of the chip under the target value of the working parameter is within the preset power consumption range, wherein the working parameter comprises a micro-architecture mode level, and the micro-architecture mode level is used for representing a micro-architecture state of the chip.

Description

功耗控制方法、电子设备、存储介质、及程序产品Power consumption control methods, electronic devices, storage media, and software products

本公开要求于2024年04月25日提交的、申请号为202410508758.X的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This disclosure claims priority to Chinese patent application No. 202410508758.X, filed on April 25, 2024, the entire contents of which are incorporated herein by reference.

技术领域Technical Field

本公开涉及计算机技术领域,尤其涉及一种功耗控制方法、电子设备、存储介质、及程序产品。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

随着芯片(例如,中央处理单元(central processing unit,CPU)、图形处理单元(graphics processing unit,GPU)等)组件集成度的大幅提高,芯片的功耗控制变得尤为重要。With the significant increase in the integration of chip components (such as central processing unit (CPU), graphics processing unit (GPU), etc.), chip power consumption control has become particularly important.

通用的功耗控制方法通常包括但不限于动态电压频率调整(Dynamic voltage and frequency scaling,DVFS)技术和任务迁移技术。DVFS技术是通过调整芯片的工作频率和电压实现功耗控制。任务迁移技术是通过调度芯片中各个内核的负载任务实现功耗控制。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.

发明内容Summary of the Invention

一方面,提供一种功耗控制方法。该功耗控制方法包括:On the one hand, a power consumption control method is provided. This power consumption control method includes:

确定芯片在当前时刻下的功耗;Determine the chip's power consumption at the current moment;

根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内;工作参数包括微架构模式等级,微架构模式等级用于表示芯片的微架构状态。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, which is used to represent the chip's microarchitecture state.

另一方面,提供一种功耗控制装置。该功耗控制装置包括:处理单元;On the other hand, a power consumption control device is provided. The power consumption control device includes: a processing unit;

处理单元,用于确定芯片在当前时刻下的功耗;The processing unit is used to determine the chip's power consumption at the current moment;

处理单元,还用于根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内;工作参数包括微架构模式等级,微架构模式等级用于表示芯片的微架构状态。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, which is used to represent the chip's microarchitecture state.

又一方面,提供一种电子设备。该电子设备包括:处理器;该处理器执行计算机程序时,实现上述方面所述的功耗控制方法。In another aspect, an electronic device is provided. This electronic device includes a processor; when the processor executes a computer program, it implements the power consumption control method described above.

又一方面,提供一种计算机可读存储介质。该计算机可读存储介质包括计算机指令,当该计算机指令被执行时,实现上述方面所述的功耗控制方法。In another aspect, a computer-readable storage medium is provided. This computer-readable storage medium includes computer instructions that, when executed, implement the power consumption control method described above.

又一方面,提供一种计算机程序产品。该计算机程序产品包括计算机程序或指令,当该计算机程序或指令在计算机上运行时,实现上述方面所述的功耗控制方法。In another aspect, a computer program product is provided. This computer program product includes a computer program or instructions that, when executed on a computer, implement the power consumption control method described above.

附图说明Attached Figure Description

为了更清楚地说明本公开中的技术方案,下面将对本公开一些实施例中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是本公开的一些实施例的附图,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。To more clearly illustrate the technical solutions in this disclosure, the accompanying drawings used in some embodiments of this disclosure will be briefly described below. Obviously, the drawings described below are merely drawings of some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings.

图1为根据本公开一些实施例的一种功耗控制系统架构图。Figure 1 is a power consumption control system architecture diagram according to some embodiments of the present disclosure.

图2为根据本公开一些实施例的一种功耗控制方法的流程示意图。Figure 2 is a flowchart illustrating a power consumption control method according to some embodiments of the present disclosure.

图3为根据本公开一些实施例的另一种功耗控制方法的流程示意图。Figure 3 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图4为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 4 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图5为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 5 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图6为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 6 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图7为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 7 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图8为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 8 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图9为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 9 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图10为根据本公开一些实施例的又一种功耗控制方法的流程示意图。Figure 10 is a flowchart illustrating another power consumption control method according to some embodiments of the present disclosure.

图11为根据本公开一些实施例的一种电子设备的结构示意图。Figure 11 is a schematic diagram of the structure of an electronic device according to some embodiments of the present disclosure.

图12为根据本公开一些实施例的另一种电子设备的结构示意图。Figure 12 is a schematic diagram of the structure of another electronic device according to some embodiments of the present disclosure.

具体实施方式Detailed Implementation

为使本领域的技术人员更好地理解本公开实施例的技术方案,下面将结合本公开中的附图,对本公开中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。To enable those skilled in the art to better understand the technical solutions of the embodiments of this disclosure, the technical solutions of this disclosure will be clearly and completely described below 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.

需要说明的是,在本公开中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本公开中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that, in this disclosure, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" 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 the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

以下,术语“第一”、“第二”等表述仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含地指明所指示的技术特征的数量。由此,限定有“第一”、“第二”等表述的特征可以明示或者隐含地包括一个或多个该特征。In the following text, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with terms such as "first," "second," etc., may explicitly or implicitly include one or more of that feature.

在本公开的描述中,除非另有说明,符号“/”表示“或”的意思,例如,A/B可以表示A或B。本文中的“和/或”仅仅代表一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:仅A,仅B,以及A和B。此外,“至少一个”是指一个或多个,“多个”是指两个或两个以上。In the description of this disclosure, unless otherwise stated, the symbol “/” means “or”, for example, A/B can mean A or B. The term “and/or” in this document merely represents a description of the relationship between related objects, indicating that three relationships can exist; for example, A and/or B can mean: only A, only B, and A and B. Furthermore, “at least one” means one or more, and “more than one” means two or more.

在对本公开进行详细介绍之前,先对本公开涉及的相关要素进行简单介绍。Before providing a detailed introduction to this disclosure, let me briefly introduce the relevant elements involved in this disclosure.

微架构:微架构是芯片的重要组成部分,包括了芯片在任务处理过程中,各个任务的流水线执行机制、指令发射和调度机制、片上高速缓存、存储器管理机制等。这些设计元素共同协作,以实现芯片的高效运行。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.

芯片的功耗可以基于微架构模式等级的调整实现。不同的微架构模式等级对应的不同的微架构状态参数。在不同的微架构模式等级下(即,不同的微架构状态参数下),芯片的功耗是不同的。因此,本公开可以通过调整微架构模式等级实现芯片的功耗控制。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. The power consumption of the chip differs under different microarchitecture mode levels (i.e., under different microarchitecture state parameters). Therefore, this disclosure allows for power consumption control of the chip by adjusting the microarchitecture mode level.

示例性地,为了降低芯片的功耗,可以将微架构模式等级调整为预设等级。在预设等级下,芯片可以实现以下至少一项微架构状态参数的调整,以降低芯片的功耗: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:

关闭芯片中多余的浮点运算单元和执行单元(也可以称为降低芯片的带宽)、减少芯片的内存访问速率和/或数据传输速率(也可以称为减小芯片的窗口深度)、降低芯片的并行指令数、指令调度复杂度、乱序执行范围(也可以称为削弱芯片的交易强度)。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).

接着,对本公开的应用场景进行介绍。Next, the application scenarios of this disclosure will be introduced.

随着芯片组件集成度的大幅提高,芯片的功耗控制变得尤为重要。通过对芯片提供实时、高效、可靠的功耗控制,可以使得芯片更好地适应负载变化,有效解决芯片的热平衡问题,延长芯片的使用寿命。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.

目前,多种功耗控制技术被广泛应用,包括但不限于DVFS技术和任务迁移技术。DVFS技术是通过调整芯片的工作频率和电压实现功耗控制。但是,基于DVFS技术进行功耗控制过程中,若工作频率和电压的调整步幅精确度不足,则会造成系统性能的损失。而且,工作频率的频繁调节也使芯片的稳定性大大降低。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.

任务迁移技术是通过调度芯片中各个内核的负载任务实现功耗控制,即,将所有内核中的负载任务进行合理分配,从而提高芯片的整体利用率。但是,任务迁移技术具有一定的时延,无法满足实时性需求较高的芯片。Task migration technology achieves power consumption control by scheduling the workload tasks of various cores in a chip; that is, it rationally distributes the workload tasks across all cores, thereby improving 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.

为解决上述技术问题,本公开实施例提供了一种功耗控制方法,可以确定芯片在当前时刻下的功耗。接着,可以根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内。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.

工作参数包括微架构模式等级,该微架构模式等级用于表示芯片的微架构状态。Operating parameters include the microarchitecture mode level, which represents the microarchitecture state of the chip.

由上可知,本公开在功耗控制过程中,可以通过确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内。而工作参数包括了微架构模式等级。由于微架构模式等级的调整粒度较小,并且无需调度芯片中各个内核的负载任务,因此,本公开可以在保证芯片稳定性的同时,也可以满足芯片实时性的需求。As can be seen from the above, in the power consumption control process, this disclosure can determine the target value of the chip's operating parameters so that the chip's power consumption under the target value of the operating parameters is within a preset power consumption range. The 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 disclosure can ensure chip stability while also meeting the chip's real-time requirements.

其次,由于通用的功耗控制方法中,芯片的工作频率的频繁调节也会使芯片的稳定性大大降低。而本公开在通过调整微架构模式等级可以使得芯片在工作参数的目标值下的功耗在预设功耗范围内的情况下,无需调整芯片的的工作频率,进一步提高了芯片的稳定性。Secondly, in common power consumption control methods, frequent adjustments to the chip's operating frequency can significantly reduce chip stability. However, this disclosure improves chip stability by adjusting the microarchitecture mode level, ensuring that the chip's power consumption remains within a preset range at the target operating parameters, without requiring adjustments to the chip's operating frequency.

本公开实施例提供的功耗控制方法可以应用于如图1所述的功耗控制系统中,该功耗控制系统可以应用于任意需要功耗控制的电子设备,该功耗控制系统可以用于控制该电子设备内芯片的功耗。如图1所示,该功耗控制系统可以包括:功耗控制模块101和配置下发模块102。功耗控制模块101与配置下发模块102之间连接。The power consumption control method provided in this disclosure can be applied to the power consumption control system shown in FIG1. This power consumption control system can be applied to any electronic device requiring power consumption control, and can be used to control the power consumption of chips within the electronic device. As shown in FIG1, 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.

功耗控制模块101用于确定芯片在当前时刻下的功耗,以及根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值。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.

配置下发模块102可以根据功耗控制模块101确定的芯片的工作参数的目标值,向工作参数对应的单元发送其对应的目标值,以完成芯片的功耗控制。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.

在一些实现方式中,上述工作参数可以包括微架构模式等级和工作频率。在这种情况下,功耗控制模块101可以包括:配置监测模块1011、微架构计算模块1012、功耗计算模块1013和频率计算模块1014。配置监测模块1011分别与微架构计算模块1012、功耗计算模块1013和频率计算模块1014(直接或间接)连接。功耗计算模块1013分别与微架构计算模块1012和频率计算模块1014连接。In some implementations, the aforementioned operating parameters may include microarchitecture mode level and 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 (directly or indirectly) to the microarchitecture calculation module 1012, the power consumption calculation module 1013, and the frequency calculation module 1014, respectively. The power consumption calculation module 1013 is connected to the microarchitecture calculation module 1012 and the frequency calculation module 1014, respectively.

配置监测模块1011用于获取芯片在当前时刻下的运行状态参数。The configuration monitoring module 1011 is used to obtain the chip's operating status parameters at the current moment.

功耗计算模块1013用于根据配置监测模块1011获取的芯片在当前时刻下的运行状态参数,确定芯片在当前时刻下的功耗。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.

微架构计算模块1012用于根据功耗计算模块1013确定的芯片在当前时刻下的功耗,确定微架构模式等级的目标值。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.

频率计算模块1014用于根据功耗计算模块1013确定的芯片在当前时刻下的功耗,确定工作频率的目标值。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.

在一些实现方式中,功耗控制系统还可以根据不同的工作参数划分不同的子系统。例如,在工作参数包括微架构模式等级和工作频率的情况下,功耗控制系统可以包括微架构模式等级的调节子系统和频率调节子系统。In some implementations, 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.

微架构模式等级的调节子系统用于确定微架构模式等级的目标值。The microarchitecture pattern hierarchy tuning subsystem is used to determine the target value of the microarchitecture pattern hierarchy.

示例性地,如图1所示,上述配置监测模块1011、功耗计算模块1013和微架构计算模块1012可以组成微架构模式等级的调节子系统。For example, as shown in FIG1, the configuration monitoring module 1011, power consumption calculation module 1013 and microarchitecture calculation module 1012 can form a microarchitecture mode level adjustment subsystem.

相应地,频率调节子系统用于确定工作频率的目标值。Accordingly, the frequency conditioning subsystem is used to determine the target value of the operating frequency.

示例性地,如图1所示,配置监测模块1011、功耗计算模块1013和频率计算模块1014可以组成频率调节子系统。For example, as shown in FIG1, the configuration monitoring module 1011, the power consumption calculation module 1013 and the frequency calculation module 1014 can form a frequency regulation subsystem.

需要说明的是,上述芯片中的各个模块仅为功能概念,在实际应用中,可以将芯片中的各个模块进行合并或拆分,形成一个或多个模块使用,或者将各模块集成到其他模块中提供给其他模块使用,本公开实施例对此不作限定。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 disclosure does not limit this.

需要说明的,本公开实施例描述的系统架构以及应用场景是为了更加清楚地说明本公开实施例的技术方案,并不构成对于本公开实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本公开实施例提供的技术方案对于类似的技术问题,同样适用。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.

例如,上述功耗控制系统可以应用于基于进阶RISC(Reduced Instruction Set Computer,精简指令集计算机)机器(Advanced RISC Machine,ARM)架构的芯片,也可以应用于基于X86架构的芯片等。For example, the aforementioned power control system can be applied to chips based on the Advanced RISC Machine (ARM) architecture, as well as chips based on the x86 architecture.

下面将结合附图对本公开实施例提供的功耗控制方法进行详细介绍。The power consumption control method provided in the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

本公开实施例提供的功耗控制方法可以应用于电子设备(该电子设备可以是图1所示的功耗控制系统归属的电子设备,也可以是图1所示的功耗控制系统归属的电子设备外接的电子设备),以实现对功耗控制系统归属的芯片进行功耗控制。也就是说,本公开的执行主体可以应用于待功耗控制的芯片归属的电子设备上,也可以应用于通过远程访问的方式访问芯片,进行配置下发、数据采集和功能计算的电子设备,本公开实施例对此不作限定。The power consumption control method provided in this disclosure can be applied to electronic devices (which may be the electronic device to which the power consumption control system shown in Figure 1 belongs, or an external electronic device to which the power consumption control system shown in Figure 1 belongs) to achieve power consumption control of the chip to which the power consumption control system belongs. That is to say, the execution subject of this disclosure 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 calculation. This disclosure does not limit this aspect.

图2示出了一种功耗控制方法的流程示意图,如图2所示,该功耗控制方法包括S201-S202。Figure 2 shows a flowchart of a power consumption control method. As shown in Figure 2, the power consumption control method includes S201-S202.

S201、电子设备确定芯片在当前时刻下的功耗。S201. The electronic device determines the power consumption of the chip at the current moment.

在一些实现方式中,上述芯片可以任意电子设备中的是CPU芯片、GPU芯片等需要功耗控制的芯片。In some implementations, 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.

在一些实现方式中,为了实时地对芯片的功耗进行控制,电子设备需要实时地确定芯片在当前时刻下的功耗,而芯片的功耗通常是由芯片在当前时刻下的运行状态参数确定的。因此,电子设备可以获取芯片在当前时刻下的运行状态参数,并根据芯片在当前时刻下的运行状态参数确定芯片在当前时刻下的功耗。In some implementations, to control chip power consumption in real time, the electronic device needs to determine the chip's power consumption at the current moment. The chip's power consumption is typically determined by its operating state parameters at that moment. Therefore, the electronic device can obtain the chip's operating state parameters at the current moment and determine its power consumption based on those parameters.

在一些实现方式中,电子设备可以在芯片上电后触发功耗控制指令,并响应于该功耗控制指令,获取芯片在当前时刻下的运行状态参数。In some implementations, 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.

在一些实现方式中,用户还可以根据自身的需求,通过芯片所属设备的外接模块,在设备上执行功耗控制操作。电子设备可以响应于用户执行的操作,触发功耗控制指令,并响应于该功耗控制指令,获取芯片在当前时刻下的运行状态参数。In some implementations, users can also 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 respond to the user's operation, trigger a power control command, and obtain the chip's operating status parameters at the current moment in response to the power control command.

在一些实现方式中,运行状态参数可以包括以下至少一项:温度、工作频率、电压、微架构状态参数、预设周期内的执行指令数和预设周期内的访存数据读取量。In some implementations, 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.

在一些实现方式中,上述微架构状态参数可以包括内存访问速率、数据传输速率、缓存区大小、待执行任务指令数、并行任务指令数中的至少一项。In some implementations, the aforementioned microarchitecture state parameters may 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.

示例性地,电子设备中的配置监测模块可以通过芯片的温度控制单元获取芯片的温度,通过芯片的频率控制单元获取芯片的工作频率,通过芯片的电源控制单元获取芯片的电压,通过微架构控制单元获取芯片的微架构状态参数,通过性能事件监控单元获取芯片的预设周期内的执行指令数和预设周期内的访存数据读取量。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.

除上述列举的运行状态参数以外,电子设备还可以获取其他未列举的运行状态参数,并根据运行状态参数确定芯片在当前时刻下的功耗,本公开实施例对此不作限定。In addition to the operating status parameters listed above, the electronic device may also acquire other unlisted operating status parameters and determine the power consumption of the chip at the current moment based on the operating status parameters. This disclosure does not limit this.

S202、电子设备根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内。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.

工作参数包括微架构模式等级;微架构模式等级用于表示芯片的微架构状态。Operating parameters include microarchitecture mode level; the microarchitecture mode level is used to represent the microarchitecture state of the chip.

在一些实现方式中,芯片不同的系统架构对应不同的微架构模式,不同的微架构模式的微架构模式等级也可能不同。相应地,不同的微架构模式等级下,芯片的微架构状态也不同。In some implementations, different system architectures of the chip correspond to different microarchitecture patterns, and the microarchitecture pattern levels of these different patterns may also differ. Correspondingly, the microarchitecture state of the chip differs under different microarchitecture pattern levels.

可以理解的是,芯片的微架构状态可以通过芯片的微架构状态参数体现。例如,当芯片的微架构状态参数为内存访问速率时,内存访问速率越高,则芯片的微架构状态性能越高,但功耗也高。相应地,内存访问速率越低,则芯片的微架构状态性能越低,但功耗也低。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.

示例性地,当芯片的系统架构为ARM架构时,微架构模式为性能定义功率(Performance Defined Power,PDP)模式。而在PDP模式下,不同的PDP模式等级可以表示芯片不同的微架构状态。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.

例如,PDP模式等级可以包括:一级、二级、三级、四级和五级。For example, PDP mode levels can include: Level 1, Level 2, Level 3, Level 4, and Level 5.

当芯片的PDP模式等级为一级时,芯片的内存访问速率为A1、数据传输速率为B1、缓存区大小为C1、待执行任务指令数为D1、并行任务指令数为E1。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.

当芯片的PDP模式等级为二级时,芯片的内存访问速率为A2、数据传输速率为B2、缓存区大小为C2、待执行任务指令数为D2、并行任务指令数为E2。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.

当芯片的PDP模式等级为三级时,芯片的内存访问速率为A3、数据传输速率为B3、缓存区大小为C3、待执行任务指令数为D3、并行任务指令数为E3。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.

当芯片的PDP模式等级为四级时,芯片的内存访问速率为A4、数据传输速率为B4、缓存区大小为C4、待执行任务指令数为D4、并行任务指令数为E4。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.

当芯片的PDP模式等级为五级时,芯片的内存访问速率为A5、数据传输速率为B5、缓存区大小为C5、待执行任务指令数为D5、并行任务指令数为E5。When the chip's PDP mode level is five, 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.

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。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.

也就是说,在PDP模式下,芯片的微架构模式等级与芯片的功耗成反比。PDP模式等级越高,芯片的各类微架构状态参数越低。在这种情况下,芯片的功耗越低。相应地,PDP模式等级越低,芯片的各类微架构状态参数越高。在这种情况下,芯片的功耗越高。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.

又一示例性地,当芯片的系统架构为X86架构时,微架构模式为核休眠模式。核休眠模式下,微架构模式等级可以包括:一级、二级和三级。As another example, 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.

当芯片的核休眠模式等级为一级时,芯片的全部内核进行工作。When the chip's core sleep mode level is level one, all of the chip's cores are working.

当芯片的核休眠模式等级为二级时,芯片的部分内核进行工作,部分内核进行休眠。When the chip's core sleep mode level is level 2, some cores of the chip are working while others are in sleep mode.

当芯片的核休眠模式等级为三级时,芯片的全部内核进行休眠。When the chip's core sleep mode level is three, all cores of the chip will go into sleep mode.

应理解,芯片工作的内核数量越多,能耗越高,因此,在核休眠模式下,芯片的微架构模式等级与芯片的功耗也成反比。核休眠模式等级越高,芯片的功耗越低。相应地,核休眠模式等级越低,芯片的功耗越高。It should be understood that the more cores a chip has in operation, 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.

由上可知,在芯片的工作参数包括芯片的微架构模式等级的情况下,芯片的微架构模式等级可以影响芯片的功耗,因此,电子设备可以根据芯片在当前时刻下的功耗和预设功耗范围,调整芯片的微架构模式等级,以确定芯片的工作参数的目标值。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.

在一些实现方式中,上述预设功耗范围(也可以称为预期功耗范围,即,期望要达到的功耗范围)可以是在满足芯片稳定性和工作性能的基础上设置的。例如,预设功耗范围可以是140W-160W。该预设功耗范围可以根据芯片不同的需求进行合理的设定,本公开实施例对此不作限定。In some implementations, the aforementioned preset power consumption range (also known as the expected power consumption range, i.e., the power consumption range to be achieved) can be set based on meeting the chip's stability and operating performance. For example, the preset power consumption range can be 140W-160W. This preset power consumption range can be reasonably set according to different chip requirements, and the embodiments disclosed herein do not limit this.

在一些实现方式中,在芯片的功耗控制精确度需求较高的情况下,电子设备还可以根据芯片在当前时刻下的功耗和预设功耗值(也可以称为预期功耗值,即,期望要达到的功耗值,例如150W),确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗为预设功耗值。In some implementations, when the chip's power consumption control accuracy 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 to be achieved, such as 150W), so that the chip's power consumption under the target value of the operating parameters is the preset power consumption value.

结合上述示例,当芯片的微架构模式为PDP模式或者核休眠模式时,由于芯片的微架构模式等级与芯片的功耗成反比,因此,在芯片在当前时刻下的功耗较高(例如,高于预设功耗范围的最大值)的情况下,电子设备可以调高芯片的微架构模式等级,并将调高后的微架构模式等级确定为微架构模式等级的目标值。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 determine the increased microarchitecture mode level as the target value of the microarchitecture mode level.

相应地,在芯片在当前时刻下的功耗较低(例如,低于预设功耗范围的最小值)的情况下,电子设备可以调低芯片的微架构模式等级,并将调低后的微架构模式等级确定为微架构模式等级的目标值。Accordingly, 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.

后续,电子设备可以通过配置下发模块将微架构模式等级的目标值下发给调整微架构模式等级的调整模块,以使得芯片在微架构模式等级的目标值下的功耗在预设功耗范围内。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.

在一些实现方式中,电子设备在确定工作参数的目标值后,可以直接通过配置下发模块下发调整工作参数。但是,由于芯片的功耗处于实时变化的过程中,并且电子设备确定的工作参数的目标值也可能会影响芯片的功耗,如果直接通过配置下发模块下发调整工作参数,可能无法使得芯片的功耗处于预设功耗范围内。在这种情况下,电子设备可以通过确定工作参数的预期值,以及芯片在工作参数的预期值下的功耗预估值确定芯片的工作参数的目标值。结合图2,如图3所示,上述S202中,电子设备根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值的方法,包括S301-S303。In some implementations, after determining the target value of the operating parameters, the electronic device can directly issue an adjustment to the operating parameters through the configuration issuing module. However, since the chip's power consumption is constantly changing, and the target value of the operating parameters determined by the electronic device may also affect the chip's power consumption, directly issuing an adjustment to the operating parameters through the configuration issuing module may not ensure that the chip's power consumption is within the preset power consumption range. In this case, the electronic device can determine the target value of the chip's operating parameters by determining the expected value of the operating parameters and the estimated power consumption of the chip under the expected value of the operating parameters. Referring to Figure 2 and Figure 3, the method in S202 above for the electronic device 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 includes S301-S303.

S301、电子设备根据芯片在当前时刻下的功耗和预设功耗范围确定工作参数的预期值。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.

在一些实现方式中,电子设备可以根据预设步长,确定工作参数的预期值。In some implementations, electronic devices can determine the expected values of operating parameters based on preset step sizes.

示例性地,假设工作参数为微架构模式等级,且芯片在当前时刻下的微架构模式等级为2级,微架构模式等级调节的预设步长为1。在芯片在当前时刻下的功耗大于预设功耗范围的最大值的情况下,电子设备可以将微架构模式等级上调1级,得到微架构模式等级的预期值为3级。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.

S302、电子设备确定芯片在工作参数的预期值下的功耗预估值。S302, Electronic device determines the estimated power consumption of a chip under expected operating parameters.

示例性地,结合图1,电子设备中的功耗计算模块不仅可以根据当前时刻下的运行状态参数,确定芯片在当前时刻下的功耗,还可以将当前时刻下的运行状态参数中的工作参数,替换为工作参数的预期值,并根据替换后的运行状态参数确定芯片在工作参数的预期值下的功耗预估值。For example, referring to Figure 1, the power consumption calculation module in the electronic device can not only determine the power consumption of the chip at the current moment based on the operating status parameters at the current moment, but also replace the working parameters in the operating status parameters at the current moment with the expected values of the working parameters, and determine the estimated power consumption of the chip at the expected values of the working parameters based on the replaced operating status parameters.

S303、在功耗预估值处于预设功耗范围内,或者,工作参数的预期值为工作参数的上限值或者工作参数的下限值的情况下,电子设备将工作参数的预期值确定为工作参数的目标值。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.

功耗预估值处于预设功耗范围内,则说明工作参数的预期值可以使得芯片的功耗达到预期。因此,电子设备可以将工作参数的预期值确定为工作参数的目标值。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.

工作参数的预期值为工作参数的上限值或者工作参数的下限值,则说明该工作参数的预期值已调整至上限或者下限(即,硬件限制),无法继续调整。因此,电子设备可以将工作参数的预期值确定为工作参数的目标值。If the expected value of a working parameter is either its upper or lower limit, it means that the expected value 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.

在工作参数的数量为多个的情况下,若一个工作参数的预期值为工作参数的上限值或者工作参数的下限值,但功耗预估值未处于预设功耗范围内的情况下,电子设备还可以通过确定其他工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内。When there are multiple operating parameters, if the expected value of one 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.

在一些实现方式中,工作参数除了微架构模式等级以外,还包括工作频率。结合图2,如图4所示,上述S202中,电子设备根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值的方法,包括S401-S403。In some implementations, the operating parameters include not only the microarchitecture mode level but also the operating frequency. Referring to Figure 2 and as shown in Figure 4, the method described in S202 above for the electronic device to determine the target values of the chip's operating parameters based on the chip's current power consumption and a preset power consumption range includes S401-S403.

S401、电子设备根据芯片在当前时刻下的功耗和预设功耗范围确定第一参数的预期值。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.

第一参数可以是微架构模式等级,也可以是工作频率。关于S401的描述,可以参考S301的描述,在此不再赘述。The first parameter can be either the microarchitecture mode level or the operating frequency. For a description of S401, please refer to the description of S301; it will not be repeated here.

S402、电子设备确定芯片在第一参数的预期值下的功耗预估值。S402, Electronic device determines the power consumption estimate of the chip under the expected value of the first parameter.

关于S402的描述,可以参考S302的描述,在此不再赘述。For a description of S402, please refer to the description of S302; it will not be repeated here.

S403、电子设备根据第一参数的预期值和芯片在第一参数的预期值下的功耗预估值,确定第一参数的目标值和第二参数的目标值。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.

第一参数和第二参数中的一个为工作频率,另一个为微架构模式等级。One of the first and second parameters is the operating frequency, and the other is the microarchitecture pattern level.

需要说明的是,调整工作频率可能影响芯片的稳定性,但是可以提高芯片的能效比,而调整微架构模式等级可能影响芯片的能效比,但是可以提高芯片的稳定性,因此,电子设备可以根据不同功耗控制需求,确定工作参数的先后调节顺序。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.

若功耗控制需求下对芯片的稳定性需求较高,能效比需求较低,则第一参数为微架构模式等级,第二参数为工作频率。相应地,若功耗控制需求下对芯片的能效比需求较高,稳定性需求较低,则第一参数为工作频率,第二参数为微架构模式等级。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.

也就是说,本公开可以在任何功耗控制需求的场景下使用,可以仅调节微架构模式等级,也可以同时调节微架构模式等级和工作频率,以实现功耗控制,即本公开可以实现多种场景下功耗控制的个性化定制,以满足不同功耗控制的需求。In other words, this disclosure 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 disclosure can realize personalized customization of power control in various scenarios to meet different power control needs.

在工作参数包括工作频率和微架构模式等级的情况下,电子设备可以先确定一个参数(即,第一参数)的预期值和芯片在第一参数的预期值下的功耗预估值。Given operating parameters including operating frequency and microarchitecture mode level, electronic devices can first determine the expected value of a parameter (i.e., the first parameter) and the estimated power consumption of the chip at the expected value of the first parameter.

若芯片在第一参数的预期值下的功耗预估值处于预设功耗范围内,说明仅调整第一参数已经可以满足芯片的功耗需求。在这种情况下,电子设备可以直接将第一参数的预期值确定为工作参数的目标值,无需调整第二参数。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.

相应地,若芯片在第一参数的预期值下的功耗预估值未处于预设功耗范围内,且第一参数的预期值为第一参数的上限值或者第一参数的下限值,说明该工作参数的预期值已调整至上限或者下限,无法继续调整。因此,电子设备可以通过调整第二参数,确定工作参数的目标值。Accordingly, 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.

在一些实现方式中,结合图4,如图5所示,上述S403中,电子设备根据第一参数的预期值和芯片在第一参数的预期值下的功耗预估值,确定第一参数的目标值和第二参数的目标值的方法,包括S501-S503。In some implementations, as shown in Figure 5 in conjunction with Figure 4, 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 in S403 includes S501-S503.

S501、在芯片在第一参数的预期值下的功耗预估值未处于预设功耗范围内,且第一参数的预期值为第一参数的上限值或者第一参数的下限值的情况下,电子设备根据芯片在第一参数的预期值下的功耗预估值确定第二参数的预期值。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.

示例性地,以第一参数为PDP模式等级,第二参数为工作频率为例,假设芯片在PDP模式等级的预期值为五级的情况下,芯片的功耗预估值依旧大于预设功耗范围的最大值,则已无法继续调整PDP模式等级的预期值。在这种情况下,电子设备可以确定工作频率的预期值。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.

在一些实现方式中,电子设备可以根据工作频率的预设步长确定工作频率的预期值。In some implementations, the electronic device can determine the expected value of the operating frequency based on a preset step size of the operating frequency.

示例性地,假设芯片在当前时刻下的工作频率为3000MHZ,预设步长为100MHZ。在芯片在PDP模式等级的预期值为五级的情况下,芯片的功耗预估值依旧大于预设功耗范围的最大值的情况下,电子设备可以确定工作频率的预期值为2900MHZ。For example, suppose the chip is operating at a frequency of 3000MHz at the current moment, 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.

S502、电子设备确定芯片在第二参数的预期值下的功耗预估值。S502, Electronic device determines the estimated power consumption of the chip under the expected value of the second parameter.

关于S502的描述,可以参考S302的描述,在此不再赘述。For a description of S502, please refer to the description of S302, which will not be repeated here.

S503、在芯片在第二参数的预期值下的功耗预估值处于预设功耗范围内,或者,第二参数的预期值为第二参数的上限值或者第二参数的下限值的情况下,电子设备将第一参数的预期值确定为第一参数的目标值,且将第二参数的预期值确定为第二参数的目标值。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.

继续结合上述示例,在芯片在PDP模式等级的预期值为五级,工作频率的预期值为2900MHZ的情况下,若芯片的功耗预估值已经处于预设功耗范围内,则电子设备将五级确定为PDP模式等级的目标值,2900MHZ确定为工作频率的目标值。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.

在芯片在PDP模式等级的预期值为五级,工作频率的预期值为2900MHZ的情况下,若芯片的功耗预估值依旧未处于预设功耗范围内,则电子设备继续确定工作频率的预期值,直到芯片在工作频率的预期值下的功耗预估值处于预设功耗范围内,或者,工作频率的预期值为工作频率的上限值或者工作频率的下限值。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.

在一些实现方式中,在电子设备需要同时根据第一参数的目标值和第二参数的目标值进行功耗控制的情况下,电子设备可以先确定微架构模式等级的目标值,再确定工作频率的目标值(即,第一参数为微架构模式等级,第二参数为工作频率),也可以先确定工作频率的目标值,再确定微架构模式等级的目标值(即,第一参数为工作频率,第二参数为微架构模式等级),本公开实施例对此不作限定。In some implementations, when the 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 disclosure does not limit this approach.

在一些实现方式中,电子设备也可以在确定第一参数预期值,并且第一参数的预期值不是第一参数的上限值或者第一参数的下限值的情况下,先确定第二参数的预期值,以使得芯片的功耗预估值处于预设功耗范围内,本公开实施例对此不作限定。In some implementations, the electronic device may also determine the expected value of the second parameter after determining the expected value of the first parameter, and if 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 disclosure does not limit this aspect.

由上可知,本公开可以通过调整微架构模式等级(其本质是关闭或开启部分微架构设计,或者,减少或增加部分微架构状态参数对应的资源使用以换取功耗的控制)和工作频率,能够达到控制功耗的同时提升芯片能效比的效果。与通用的功耗控制方法相比,本公开不仅能够快速响应、提高功耗控制精度,还能保证芯片的稳定性,同时提升芯片的能效比。As can be seen from the above, this disclosure 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 disclosure can not only respond quickly and improve power consumption control accuracy, but also ensure chip stability and improve chip energy efficiency ratio.

在一些实现方式中,芯片可以包括多个内核。结合图3,如图6所示,上述S301中,电子设备根据芯片在当前时刻下的功耗和预设功耗范围确定工作参数的预期值的方法,包括S601。In some implementations, the chip may include multiple cores. Referring to Figure 3 and as shown in Figure 6, the method in S301 above 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 includes S601.

S601、电子设备根据芯片在当前时刻下的功耗、预设功耗范围和预设顺序,依次确定多个内核中每个内核的工作参数的预期值。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.

预设顺序包括以下任意一项:多个内核的核序号顺序、每个内核的功耗大小顺序、随机顺序。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.

在一些实现方式中,在工作参数包括第一参数和第二参数的情况下,上述S402中,电子设备确定芯片在第一参数的预期值下的功耗预估值的方法,包括:In some implementations, 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 above includes:

电子设备根据芯片在当前时刻下的功耗、预设功耗范围和预设顺序,依次确定多个内核中每个内核的第一参数的预期值。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.

相应地,上述S501中,电子设备根据芯片在第一参数的预期值下的功耗预估值确定第二参数的预期值的方法,包括:Accordingly, in S501 above, the method for determining the expected value of the second parameter based on the power consumption estimate of the chip under the expected value of the first parameter includes:

根据芯片在第一参数的预期值下的功耗预估值和预设顺序,依次确定多个内核中每个内核的第二参数的预期值。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.

示例性地,在第一参数为微架构模式等级,第二参数为工作频率的情况下,电子设备可以先确定芯片中所有内核的工作频率的预期值,再确定所有内核的微架构模式等级的预期值;也可以先确定芯片中所有内核的微架构模式等级的预期值,再确定所有内核的工作频率的预期值;还可以先确定芯片中一部分的内核的微架构模式等级的预期值,再确定另一部分的内核的工作频率的预期值;还可以先针对芯片中的某一个内核分别确定其微架构模式等级的预期值和工作频率的预期值,再依次确定其他内核的微架构模式等级的预期值和工作频率的预期值,本公开实施例对此不作限定。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 disclosure does not limit this.

在一些实施例中,各个工作参数对应的单元根据工作参数的目标值调整工作参数时,也可以参考上述顺序进行工作参数的调整,在此不再赘述。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.

在一些实现方式中,结合图2,如图7所示,上述S201中,电子设备确定芯片在当前时刻下的功耗的方法,包括S701-S703。In some implementations, as shown in Figure 7 in conjunction with Figure 2, the method for determining the power consumption of the chip at the current moment in S201 above includes S701-S703.

S701、电子设备根据芯片在当前时刻下的温度和芯片在当前时刻下的电压确定芯片在当前时刻下的静态功耗。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.

在一些实现方式中,芯片在当前时刻下的温度、芯片在当前时刻下的电压和芯片在当前时刻下的静态功耗满足下述公式:
P=(a*V+b)ec*T;
In some implementations, the chip's temperature, voltage, and static power consumption at the current moment satisfy the following formula:
P = (a*V + b)ec*T;

其中,a、b、c、e为常数参数,P为芯片在当前时刻下的静态功耗,V为芯片在当前时刻下的电压,T为芯片在当前时刻下的温度。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.

S702、电子设备根据芯片在当前时刻下的微架构状态参数、芯片在当前时刻下的工作频率、芯片在当前时刻下的电压、芯片在的预设周期内的执行指令数和芯片在当前时刻下的预设周期内的访存数据读取量确定芯片在当前时刻下的动态功耗。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.

在一些实现方式中,芯片在当前时刻下的微架构状态参数、芯片在当前时刻下的工作频率、芯片在当前时刻下的电压、芯片在预设周期内的执行指令数、芯片在预设周期内的访存数据读取量和芯片在当前时刻下的动态功耗满足下述公式:
P=a*C1+b*C2+c*C3+d*C4+e*C5+f*F*V2+g;
In some implementations, 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 within a preset period, the amount of memory data read by the chip within a preset period, and the chip's dynamic power consumption at the current moment satisfy the following formula:
P=a*C1+b*C2+c*C3+d*C4+e*C5+f*F*V2+g;

其中,a、b、c、d、e、f、g为常数参数,P为芯片在当前时刻下的动态功耗,V为芯片在当前时刻下的电压,T为芯片在当前时刻下的温度,F为芯片在当前时刻下的工作频率,C1为芯片在预设周期内的执行指令数,C2为芯片在预设周期内的访存数据读取量,C3-C5为芯片在当前时刻下的微架构状态参数中的任意三种参数。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.

在一些实现方式中,C3-C5可以是微架构状态参数中,与芯片的缓存相关的三种参数。In some implementations, C3-C5 can be three parameters related to the chip's cache in the microarchitecture state parameters.

S703、电子设备将静态功耗与动态功耗之和确定为芯片在当前时刻下的功耗。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.

上述主要从电子设备的角度对本公开实施例提供的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的模块,例如配置监测模块、功耗计算模块等。下面从电子设备中各个模块的角度,对本公开实施例进行说明。图8示出了本公开实施例提供的又一种功耗控制方法。如图8所示,该功耗控制方法包括:The above 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 disclosure will now be described from the perspective of each module in the electronic device. Figure 8 shows another power consumption control method provided by an embodiment of this disclosure. As shown in Figure 8, the power consumption control method includes:

S801、配置监测模块获取芯片在当前时刻下的运行状态参数。S801, Configure the monitoring module to obtain the chip's operating status parameters at the current moment.

S802、配置监测模块向功耗计算模块发送芯片在当前时刻下的运行状态参数。S802, The configuration monitoring module sends the chip's operating status parameters at the current moment to the power consumption calculation module.

S803、功耗计算模块根据芯片在当前时刻下的运行状态参数,确定芯片在当前时刻下的功耗。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.

S804、功耗计算模块根据芯片在当前时刻下的功耗和预设功耗范围确定功耗调整策略为升功耗或者降功耗。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.

S805、功耗计算模块根据功耗调整策略确定工作参数的目标值。S805, the power consumption calculation module determines the target value of the operating parameters according to the power consumption adjustment strategy.

在一些实现方式中,如图9所示,在确定功耗调整策略为升功耗或者降功耗,且功耗控制需求为稳定性需求较高,能效比需求较低的情况下,本公开提供的功耗控制方法包括:In some implementations, as shown in Figure 9, 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 disclosure includes:

S901、功耗计算模块向微架构计算模块发送确定微架构模式等级的目标值的指令。S901, the power consumption calculation module sends an instruction to the microarchitecture calculation module to determine the target value of the microarchitecture mode level.

S902、微架构计算模块确定微架构模式等级的预期值,以及芯片在微架构模式等级的预期值下的功耗预估值。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.

S903、微架构计算模块向功耗计算模块发送芯片在微架构模式等级的预期值下的功耗预估值。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.

S904、功耗计算模块判断芯片在微架构模式等级的预期值下的功耗预估值是否达到预设功耗范围。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.

若是,则将微架构模式等级的预期值确定为微架构模式等级的目标值。若否,则继续向微架构计算模块发送确定微架构模式等级的目标值的指令,直到芯片在微架构模式等级的预期值下的功耗预估值处于预设功耗范围内,或者,微架构模式等级的预期值为微架构模式等级的上限值或者微架构模式等级的下限值。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.

为了便于理解,图9将功耗计算模块向微架构计算模块发送确定微架构模式等级的目标值的指令描述为继续指令。For ease of understanding, Figure 9 describes the instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level as a continuation instruction.

S905、在功耗计算模块接收到微架构计算模块发送的第一消息的情况下,向频率计算模块发送确定工作频率的目标值的指令。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.

第一信息用于表示芯片在微架构模式等级的预期值下的功耗预估值未处于预设功耗范围内,且微架构模式等级的预期值为微架构模式等级的上限值或者微架构模式等级的下限值。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.

S906、频率计算模块确定工作频率的预期值,以及芯片在工作频率的预期值下的功耗预估值。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.

S907、频率计算模块向功耗计算模块发送工作频率的预期值下的功耗预估值。S907, the frequency calculation module sends the power consumption estimate under the expected value of the operating frequency to the power consumption calculation module.

S908、功耗计算模块判断工作频率的预期值下的功耗预估值是否达到预设功耗范围。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.

若是,则将工作频率的预期值确定为工作频率的目标值。若否,则继续向频率计算模块发送确定工作频率的目标值的指令,直到芯片在工作频率的预期值下的功耗预估值处于预设功耗范围内,将工作频率的预期值确定为工作频率的目标值。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.

为了便于理解,图9将功耗计算模块向频率计算模块发送确定工作频率的目标值的指令描述为继续指令。For ease of understanding, Figure 9 describes the instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency as a continuation instruction.

在一些实现方式中,如图10所示,在确定功耗调整策略为升功耗或者降功耗,且功耗控制需求为能效比需求较高,稳定性需求较低的情况下,本公开提供的功耗控制方法包括:In some implementations, as shown in Figure 10, 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 disclosure includes:

S1001、功耗计算模块向频率计算模块发送确定工作频率的目标值的指令。S1001, The power consumption calculation module sends an instruction to the frequency calculation module to determine the target value of the operating frequency.

S1002、频率计算模块确定工作频率的预期值,以及芯片在工作频率的预期值下的功耗预估值。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.

S1003、频率计算模块向功耗计算模块发送芯片在工作频率的预期值下的功耗预估值。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.

S1004、功耗计算模块判断芯片在工作频率的预期值下的功耗预估值是否达到预设功耗范围。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.

若是,则将工作频率的预期值确定为工作频率的目标值。若否,则继续向频率计算模块发送确定工作频率的目标值的指令,直到芯片在工作频率的预期值下的功耗预估值处于预设功耗范围内,或者,工作频率的预期值为工作频率的上限值或者工作频率的下限值。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.

为了便于理解,图10将功耗计算模块向向频率计算模块发送确定工作频率的目标值的指令描述为继续指令。For ease of understanding, Figure 10 describes the instruction sent by the power consumption calculation module to the frequency calculation module to determine the target value of the operating frequency as a continuation instruction.

S1005、在功耗计算模块接收到频率计算模块发送的第二消息的情况下,向微架构计算模块发送确定微架构模式等级的目标值的指令。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.

第二信息用于表示芯片在工作频率的预期值下的功耗预估值未处于预设功耗范围内,且工作频率的预期值为工作频率的上限值或者工作频率的下限值。The second piece of information indicates that the chip's power consumption estimate at the expected operating frequency is not within the preset power consumption range, and the expected operating frequency is either the upper limit or the lower limit of the operating frequency.

S1006、微架构计算模块确定微架构模式等级的预期值,以及芯片在微架构模式等级的预期值下的功耗预估值。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.

S1007、微架构计算模块向功耗计算模块发送微架构模式等级的预期值下的功耗预估值。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.

S1008、功耗计算模块判断微架构模式等级的预期值下的功耗预估值是否达到预设功耗范围。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.

若是,则将微架构模式等级的预期值确定为微架构模式等级的目标值。若否,则继续向微架构计算模块发送确定微架构模式等级的目标值的指令,直到芯片在微架构模式等级的预期值下的功耗预估值处于预设功耗范围内,将工作频率的预期值确定为工作频率的目标值。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.

为了便于理解,图10将功耗计算模块向微架构计算模块发送确定微架构模式等级的目标值的指令描述为继续指令。For ease of understanding, Figure 10 describes the instruction sent by the power consumption calculation module to the microarchitecture calculation module to determine the target value of the microarchitecture mode level as a continuation instruction.

可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本公开实施例描述的各示例的算法步骤,本公开能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。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.

本公开实施例可以根据上述方法实施例对电子设备进行功能模块的划分,例如,可以对应每一个功能划分每一个功能模块,也可以将两个或两个以上的功能集成在一个功能模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件的形式实现。需要说明的是,本公开实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。下面以采用对应每一个功能划分每一个功能模块为例进行说明。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.

图11是本公开实施例提供的一种电子设备的结构示意图,电子设备可以执行上述方法实施例提供的功耗控制方法。如图11所示,电子设备包括:处理单元1101。Figure 11 is a schematic diagram 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 embodiment. As shown in Figure 11, the electronic device includes a processing unit 1101.

处理单元1101,用于确定芯片在当前时刻下的功耗。Processing unit 1101 is used to determine the power consumption of the chip at the current moment.

处理单元1101,还用于根据芯片在当前时刻下的功耗和预设功耗范围,确定芯片的工作参数的目标值,以使得芯片在工作参数的目标值下的功耗在预设功耗范围内;工作参数包括微架构模式等级;微架构模式等级用于表示芯片的微架构状态。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.

在一些实现方式中,处理单元1101,用于:In some implementations, the processing unit 1101 is used for:

根据芯片在当前时刻下的功耗和预设功耗范围确定工作参数的预期值;The expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range.

确定芯片在工作参数的预期值下的功耗预估值;Determine the estimated power consumption of the chip under the expected values of its operating parameters;

在功耗预估值处于预设功耗范围内,或者,工作参数的预期值为工作参数的上限值或者工作参数的下限值的情况下,将工作参数的预期值确定为工作参数的目标值。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.

在一些实现方式中,芯片包括多个内核;处理单元1101,用于:In some implementations, the chip includes multiple cores; the processing unit 1101 is used for:

根据芯片在当前时刻下的功耗和预设功耗范围确定工作参数的预期值,包括:The expected values of the operating parameters are determined based on the chip's current power consumption and the preset power consumption range, including:

根据芯片在当前时刻下的功耗、预设功耗范围和预设顺序,依次确定多个内核中每个内核的工作参数的预期值;预设顺序包括以下任意一项:多个内核的核序号顺序、每个内核的功耗大小顺序、随机顺序。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.

在一些实现方式中,工作参数还包括工作频率;处理单元1101,用于:In some implementations, the operating parameters also include the operating frequency; the processing unit 1101 is used for:

根据芯片在当前时刻下的功耗和预设功耗范围确定第一参数的预期值;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;

确定芯片在第一参数的预期值下的功耗预估值;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 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.

在一些实现方式中,处理单元1101,用于:In some implementations, the processing unit 1101 is used for:

在芯片在第一参数的预期值下的功耗预估值未处于预设功耗范围内,且第一参数的预期值为第一参数的上限值或者第一参数的下限值的情况下,根据芯片在第一参数的预期值下的功耗预估值确定第二参数的预期值;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.

确定芯片在第二参数的预期值下的功耗预估值;Determine the estimated power consumption of the chip under the expected value of the second parameter;

在芯片在第二参数的预期值下的功耗预估值处于预设功耗范围内,或者,第二参数的预期值为第二参数的上限值或者第二参数的下限值的情况下,将第一参数的预期值确定为第一参数的目标值,且将第二参数的预期值确定为第二参数的目标值。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.

在一些实现方式中,芯片包括多个内核;处理单元1101,用于:In some implementations, the chip includes multiple cores; the processing unit 1101 is used for:

根据芯片在当前时刻下的功耗、预设功耗范围和预设顺序,依次确定多个内核中每个内核的第一参数的预期值;预设顺序包括以下任意一项:多个内核的核序号顺序、每个内核的功耗大小顺序、随机顺序;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;

根据芯片在第一参数的预期值下的功耗预估值和预设顺序,依次确定多个内核中每个内核的第二参数的预期值。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.

在一些实现方式中,处理单元1101,用于:In some implementations, the processing unit 1101 is used for:

根据芯片在当前时刻下的温度和芯片在当前时刻下的电压确定芯片在当前时刻下的静态功耗;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, 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.

将静态功耗与动态功耗之和确定为芯片在当前时刻下的功耗。The sum of static power consumption and dynamic power consumption is determined as the power consumption of the chip at the current moment.

在一些实现方式中,微架构状态参数包括:内存访问速率、数据传输速率、缓存区大小、待执行任务指令数、并行任务指令数中的至少一项。In some implementations, 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.

在一些实现方式中,微架构模式等级对应的微架构模式包括:ARM架构中的PDP模式或者X86架构中的核休眠模式。In some implementations, the microarchitecture mode level corresponds to the microarchitecture mode, which includes: the PDP mode in the ARM architecture or the core hibernation mode in the x86 architecture.

在采用硬件的形式实现上述集成的模块的功能的情况下,本公开实施例提供了上述实施例中所涉及的电子设备的另一种结构。如图12所示,该电子设备120包括:存储器1201、处理器1202、通信接口1203、总线1204。In the case of implementing the functions of the integrated modules described above in hardware, this disclosure provides another structure of the electronic device involved in the above embodiments. As shown in FIG12, the electronic device 120 includes: a memory 1201, a processor 1202, a communication interface 1203, and a bus 1204.

存储器1201,可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,可以是随机存取存储器(random access memory,RAM)或者可动态存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 1201 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions; it may be random access memory (RAM) or other type of dynamic storage device capable of dynamically storing information and instructions; it may also be electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices; 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.

处理器1202,可以是实现或执行结合本公开实施例所描述的各种示例性方法的逻辑方框、模块和电路。该处理器1202可以是中央处理器、通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。该处理器1202可以实现或执行结合本公开实施例所描述的各种示例性的逻辑方框、模块和电路。处理器1202也可以是实现计算功能的组合,例如,包含一个或多个微处理器的组合、DSP(digital signal processor,数字信号处理器)和微处理器的组合等。Processor 1202 may be a logic block, module, or circuit that implements or performs the various exemplary methods 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. Processor 1202 may implement or perform the various exemplary logic blocks, modules, and circuits described in conjunction with embodiments of this disclosure. Processor 1202 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP (digital signal processor) and a microprocessor, etc.

通信接口1203,用于与其他设备通过通信网络连接。该通信网络可以是以太网、无线接入网、无线局域网(wireless local area networks,WLAN)等。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.

在一些实现方式中,存储器1201可以独立于处理器1202存在,存储器1201可以通过总线1204与处理器1202相连接,用于存储指令或者程序代码。处理器1202调用并执行存储器1201中存储的指令或程序代码时,能够实现本公开实施例提供的功耗控制方法。In some implementations, 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.

在一些实现方式中,存储器1201也可以和处理器1202集成在一起。In some implementations, the memory 1201 can also be integrated with the processor 1202.

总线1204,可以是扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线1204可以分为地址总线、数据总线、控制总线等。为便于表示,图12中仅用一条粗线表示总线1204,但并不表示仅有一根总线或一种类型的总线。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, only one thick line is used to represent bus 1204 in Figure 12, but this does not mean that there is only one bus or only one type of bus.

本公开的一些实施例提供了一种电子设备,可以执行如上述实施例中任一实施例所述的功耗控制方法。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.

本公开的一些实施例提供了一种计算机可读存储介质(例如,非暂态计算机可读存储介质),该计算机可读存储介质中存储有计算机程序指令,计算机程序指令在计算机上运行时,使得计算机执行如上述实施例中任一实施例所述的功耗控制方法。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.

示例性地,上述计算机可读存储介质可以包括,但不限于:磁存储器件(例如,硬盘、软盘或磁带等)、光盘(例如,压缩盘(Compact Disk,CD)、数字通用盘(Digital Versatile Disk,DVD)等)、智能卡和闪存器件(例如,可擦写可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、卡、棒或钥匙驱动器等)。本公开描述的各种计算机可读存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读存储介质。术语“机器可读存储介质”可包括但不限于,无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。Exemplary examples show that the aforementioned computer-readable storage media 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.

本公开实施例提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得该计算机执行上述实施例中任一实施例所述的功耗控制方法。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.

以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何在本公开揭露的技术范围内的变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应该以权利要求的保护范围为准。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 (12)

一种功耗控制方法,包括:A power consumption control method, comprising: 确定芯片在当前时刻下的功耗;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; wherein, the operating parameters include a microarchitecture mode level, which is used to represent the chip's microarchitecture state. 根据权利要求1所述的功耗控制方法,其中,所述根据所述芯片在所述当前时刻下的功耗和预设功耗范围,确定所述芯片的工作参数的目标值,包括:According to the power consumption control method of claim 1, the step of determining 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 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. 根据权利要求2所述的功耗控制方法,其中,所述芯片包括多个内核;According to claim 2, the power consumption control method, wherein the chip includes multiple cores; 所述根据所述芯片在所述当前时刻下的功耗和所述预设功耗范围确定所述工作参数的预期值,包括: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. 根据权利要求1所述的功耗控制方法,其中,所述工作参数还包括工作频率;According to claim 1, the power consumption control method further includes an operating frequency as the operating parameter; 所述根据所述芯片在所述当前时刻下的功耗和预设功耗范围,确定所述芯片的工作参数的目标值,包括: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. 根据权利要求4所述的功耗控制方法,其中,所述根据所述第一参数的预期值和所述芯片在所述第一参数的预期值下的功耗预估值,确定所述第一参数的目标值和第二参数的目标值,包括:According to the power consumption control method of claim 4, 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. 根据权利要求5所述的功耗控制方法,其中,所述芯片包括多个内核;According to claim 5, the power consumption control method, wherein 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. 根据权利要求1所述的功耗控制方法,其中,确定芯片在当前时刻下的功耗,包括:According to the power consumption control method of claim 1, determining the power consumption of the chip at the current moment includes: 根据所述芯片在所述当前时刻下的温度和所述芯片在所述当前时刻下的电压确定所述芯片在所述当前时刻下的静态功耗;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. 根据权利要求7所述的功耗控制方法,其中,所述微架构状态参数包括:内存访问速率、数据传输速率、缓存区大小、待执行任务指令数、并行任务指令数中的至少一项。According to the power consumption control method of claim 7, the microarchitecture state parameters include at least one of: memory access rate, data transfer rate, buffer size, number of pending task instructions, and number of parallel task instructions. 根据权利要求1-8任一项所述的功耗控制方法,其中,所述微架构模式等级对应的微架构模式包括:进阶精简指令集机器ARM架构中的性能定义功率PDP模式或者X86架构中的核休眠模式。The power consumption control method according to any one of claims 1-8, wherein the microarchitecture mode corresponding to the microarchitecture mode level includes: the performance-defined power (PDP) mode in the Advanced Reduced Instruction Set Machine (ARM) architecture or the core hibernation mode in the x86 architecture. 一种电子设备,包括处理器,其中,所述处理器执行计算机程序时,实现根据权利要求1-9任一项所述的功耗控制方法。An electronic device includes a processor, wherein, when the processor executes a computer program, it implements the power consumption control method according to any one of claims 1-9. 一种计算机可读存储介质,其中,所述计算机可读存储介质包括计算机指令;其中,当所述计算机指令被执行时,实现根据权利要求1-9任一项所述的功耗控制方法。A computer-readable storage medium comprising computer instructions; wherein, when the computer instructions are executed, the power consumption control method according to any one of claims 1-9 is implemented. 一种计算机程序产品,其中,所述计算机程序产品包括:计算机程序或指令,当所述计算机程序或指令在计算机上运行时,使得所述计算机执行根据权利要求1-9任一项所述的功耗控制方法。A computer program product comprising: a computer program or instructions that, when executed on a computer, cause the computer to perform the power consumption control method according to any one of claims 1-9.
PCT/CN2025/074406 2024-04-25 2025-01-23 Power consumption control method, electronic device, storage medium, and program product Pending WO2025222978A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410508758.XA CN120848710A (en) 2024-04-25 2024-04-25 Power consumption control method, electronic device, storage medium and program product
CN202410508758.X 2024-04-25

Publications (1)

Publication Number Publication Date
WO2025222978A1 true WO2025222978A1 (en) 2025-10-30

Family

ID=97423725

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/074406 Pending WO2025222978A1 (en) 2024-04-25 2025-01-23 Power consumption control method, electronic device, storage medium, and program product

Country Status (2)

Country Link
CN (1) CN120848710A (en)
WO (1) WO2025222978A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664367A (en) * 2017-03-28 2018-10-16 华为技术有限公司 A kind of processor-based power consumption control method and device
US20190325108A1 (en) * 2019-06-28 2019-10-24 Intel Corporation Systems and methods for determining a configuration for a microarchitecture
CN116225202A (en) * 2023-02-21 2023-06-06 摩尔线程智能科技(北京)有限责任公司 Power consumption control method and device for GPU, electronic equipment and storage medium
CN117608389A (en) * 2023-12-13 2024-02-27 摩尔线程智能科技(北京)有限责任公司 GPU power consumption control method, device and storage medium
CN117873690A (en) * 2024-03-11 2024-04-12 广东琴智科技研究院有限公司 Power consumption management method of arithmetic unit chip, computing subsystem and intelligent computing platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664367A (en) * 2017-03-28 2018-10-16 华为技术有限公司 A kind of processor-based power consumption control method and device
US20190325108A1 (en) * 2019-06-28 2019-10-24 Intel Corporation Systems and methods for determining a configuration for a microarchitecture
CN116225202A (en) * 2023-02-21 2023-06-06 摩尔线程智能科技(北京)有限责任公司 Power consumption control method and device for GPU, electronic equipment and storage medium
CN117608389A (en) * 2023-12-13 2024-02-27 摩尔线程智能科技(北京)有限责任公司 GPU power consumption control method, device and storage medium
CN117873690A (en) * 2024-03-11 2024-04-12 广东琴智科技研究院有限公司 Power consumption management method of arithmetic unit chip, computing subsystem and intelligent computing platform

Also Published As

Publication number Publication date
CN120848710A (en) 2025-10-28

Similar Documents

Publication Publication Date Title
US9557804B2 (en) Dynamic power limit sharing in a platform
US8924758B2 (en) Method for SOC performance and power optimization
JP5707321B2 (en) Sleep processor
US9110669B2 (en) Power management of a storage device including multiple processing cores
JP5154682B2 (en) Power management coordination in multi-core processors
US9026816B2 (en) Method and system for determining an energy-efficient operating point of a platform
EP3440531B1 (en) Enhanced dynamic clock and voltage scaling (dcvs) scheme
US20110213950A1 (en) System and Method for Power Optimization
CN105677000B (en) The system and method for dynamic voltage frequency adjustment
US20120331275A1 (en) System and method for power optimization
US20120331319A1 (en) System and method for power optimization
JP2024063149A (en) Power Management Advisor to support power management controls
CN110795238B (en) Load calculation method, device, storage medium and electronic equipment
US20250383701A1 (en) Dynamic voltage and frequency scaling system, related method, and storage medium
CN117348715A (en) Energy-saving management methods, devices, computing equipment and computer-readable storage media
US12425974B2 (en) Power and temperature driven bandwidth throttling using delay insertion
CN117546121A (en) System and method for controlling current supply in a multiprocessor core system by reducing the number of instructions per cycle
WO2025222978A1 (en) Power consumption control method, electronic device, storage medium, and program product
JP2009070389A (en) Controller for processing equipment
CN115237204A (en) Electronic device control method and electronic device
CN116610204B (en) Power management method, system, electronic equipment and medium for electric equipment
US20250173069A1 (en) Methods of voltage regulation, electronic apparatuses and storage media
JP2024546266A (en) Method and apparatus for managing power states - Patents.com
CN119292446A (en) SRAM wake-up method and device
CN120787337A (en) Method and apparatus for allowing adjustment of a core availability mask provided to system software

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25793176

Country of ref document: EP

Kind code of ref document: A1