CN117270670B - Power consumption control method and electronic equipment - Google Patents

Power consumption control method and electronic equipment Download PDF

Info

Publication number
CN117270670B
CN117270670B CN202311558614.7A CN202311558614A CN117270670B CN 117270670 B CN117270670 B CN 117270670B CN 202311558614 A CN202311558614 A CN 202311558614A CN 117270670 B CN117270670 B CN 117270670B
Authority
CN
China
Prior art keywords
power consumption
consumption parameter
cpu
thread
electronic device
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.)
Active
Application number
CN202311558614.7A
Other languages
Chinese (zh)
Other versions
CN117270670A (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311558614.7A priority Critical patent/CN117270670B/en
Publication of CN117270670A publication Critical patent/CN117270670A/en
Application granted granted Critical
Publication of CN117270670B publication Critical patent/CN117270670B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F1/3243Power saving in microcontroller unit

Landscapes

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

Abstract

The embodiment of the application discloses a power consumption control method and electronic equipment, relates to the field of electronic equipment, and can timely adjust the power consumption of a CPU (central processing unit) of the electronic equipment, so that the electronic equipment is prevented from generating a clamping phenomenon, and the use experience of a user is improved. The specific scheme is as follows: when the use scene of the electronic equipment is the first use scene, adjusting the power consumption parameter of a Central Processing Unit (CPU) of the electronic equipment into a first power consumption parameter; the first power consumption parameter is the power consumption parameter of the CPU corresponding to the first use scene; under the condition that the use scene of the electronic equipment is switched from a first use scene to a second use scene, the power consumption parameter of a CPU of the electronic equipment is adjusted from the first power consumption parameter to a preset power consumption parameter; the preset power consumption parameter is larger than the first power consumption parameter and the second power consumption parameter, and the first power consumption parameter is smaller than the second power consumption parameter; and after the first time period, adjusting the power consumption parameter of the CPU of the electronic equipment from the preset power consumption parameter to a second power consumption parameter.

Description

Power consumption control method and electronic equipment
Technical Field
The present disclosure relates to the field of electronic devices, and in particular, to a power consumption control method and an electronic device.
Background
At present, the power consumption optimization technology is widely applied to electronic equipment such as notebook computers and the like. Power consumption optimization is a technique for optimizing the system power consumption of an electronic device, and the power consumption of a central processing unit (central processing unit, CPU) of the electronic device can be dynamically adjusted according to different usage scenarios.
When the use scene of the electronic equipment (such as a notebook computer) is switched from a low-load use scene to a high-load use scene, the power consumption of the CPU of the electronic equipment can be increased from the power consumption corresponding to the low-load use scene to the power consumption corresponding to the high-load use scene through a power consumption optimization technology, so that the power consumption of the CPU of the electronic equipment can be ensured to meet the power consumption requirement corresponding to the high-load use scene.
However, when the use scene of the electronic device is switched from a low-load use scene to a high-load use scene, the power consumption of the CPU of the electronic device cannot be timely adjusted through the power consumption optimization technology, so that the electronic device can generate a clamping phenomenon, and the use experience of a user is reduced.
Disclosure of Invention
The embodiment of the application provides a power consumption control method and electronic equipment, which can timely adjust the power consumption of a CPU of the electronic equipment, avoid the electronic equipment from generating a clamping phenomenon, and further improve the use experience of a user.
In order to achieve the above purpose, the embodiment of the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a power consumption control method, applied to an electronic device, where the power consumption control method may include: when the use scene of the electronic equipment is the first use scene, adjusting the power consumption parameter of a Central Processing Unit (CPU) of the electronic equipment into a first power consumption parameter; the first power consumption parameter is the power consumption parameter of the CPU corresponding to the first use scene; under the condition that the use scene of the electronic equipment is switched from a first use scene to a second use scene, the power consumption parameter of a CPU of the electronic equipment is adjusted from the first power consumption parameter to a preset power consumption parameter; the preset power consumption parameter is larger than the first power consumption parameter and the second power consumption parameter, the second power consumption parameter is the power consumption parameter of the CPU corresponding to the second use scene, and the first power consumption parameter is smaller than the second power consumption parameter; and after the first time period, adjusting the power consumption parameter of the CPU of the electronic equipment from the preset power consumption parameter to a second power consumption parameter.
Based on the method of the first aspect, when the usage scenario of the electronic device is switched from the first usage scenario (i.e. low-load usage scenario) to the second usage scenario (i.e. high-load usage scenario), the electronic device may adjust the power consumption of the CPU from the power consumption corresponding to the low-load usage scenario to the maximum value of the power consumption parameters of the CPU (i.e. preset power consumption parameters), and adjust the power consumption parameters of the CPU from the preset power consumption parameters to the power consumption parameters corresponding to the second usage scenario after the first period of time. And in the first duration, the power consumption of the CPU can be ensured to be adjusted to be effective by the preset power consumption parameter according to the power consumption parameter corresponding to the first use scene. Therefore, when the power consumption parameter of the CPU is adjusted to be the preset power consumption parameter and is not effective, but the power consumption parameter of the CPU is adjusted to be the power consumption parameter corresponding to the second use scene is effective, the phenomenon that the CPU has not enough high power consumption support and is blocked when the electronic equipment is switched from the first use scene to the second use scene can be avoided.
With reference to the first aspect, in another possible implementation manner, the electronic device may include a first thread, a second thread, and a scheduling engine, where in a case where a usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, adjusting a power consumption parameter of a CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter may include: in the event that the first thread determines that the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, the first thread Cheng Queding second power consumption parameter; the first thread sends a second power consumption parameter to the scheduling engine; the scheduling engine receives the second power consumption parameter and sends a scene switching notification to the second thread; the scene switching notification is used for indicating the use scene of the electronic device to be switched from the first use scene to the second use scene; the second thread receives the scene switching notification and sends a first power consumption parameter request to the scheduling engine; the scheduling engine receives the first power consumption parameter request and sends a first power consumption parameter response to the second thread; the second thread receives the first power consumption parameter response, and adjusts the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter under the condition that the first power consumption parameter response comprises the second power consumption parameter.
Based on the possible implementation manner, since the second thread can determine whether the first power consumption parameter response includes the second power consumption parameter when receiving the first power consumption parameter response sent by the scheduling engine, the second thread can adjust the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter when determining that the first power consumption parameter response includes the second power consumption parameter. Thereby the accuracy of the switching of the use scene of the electronic equipment can be improved.
With reference to the first aspect, in another possible implementation manner, the adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter may include: the second thread sends preset power consumption parameters to a power consumption parameter adjustment drive of the electronic equipment; the power consumption parameter adjustment drive receives preset power consumption parameters and adjusts the power consumption parameters of the CPU of the electronic equipment from the first power consumption parameters to the preset power consumption parameters.
Based on this possible implementation manner, since the maximum value of the power consumption parameter of the CPU (i.e., the preset power consumption parameter) is the power consumption parameter adjustment drive directly issued to the electronic device when the usage scenario of the electronic device is switched from the first usage scenario (i.e., the low-load usage scenario) to the second usage scenario (i.e., the high-load usage scenario), the power consumption parameter adjustment drive can adjust the power consumption parameter of the CPU to the maximum value of the power consumption parameter. Therefore, the phenomenon that the CPU has not enough high power consumption support and is blocked when the electronic equipment is switched from the first use scene to the second use scene due to the fact that the maximum value of the power consumption parameters of the CPU takes effect slowly can be avoided.
With reference to the first aspect, in another possible implementation manner, the electronic device may further include a third thread, and after the first period, the adjusting, by the preset power consumption parameter, the power consumption parameter of the CPU of the electronic device to the second power consumption parameter may include: after the first duration, the second thread sends a second power consumption parameter to the third thread; and the third line Cheng Jieshou is a second power consumption parameter, and the power consumption parameter of the CPU of the electronic device is adjusted from the preset power consumption parameter to the second power consumption parameter.
Based on the possible implementation manner, when the usage scenario of the electronic device is switched from the first usage scenario (i.e., the low-load usage scenario) to the second usage scenario (i.e., the high-load usage scenario), the electronic device executes the issuing and validating processes of the power consumption parameters corresponding to the second usage scenario through different threads (i.e., the second thread and the third thread) respectively. The issuing and validating process of the power consumption parameter corresponding to the second use scene can be executed asynchronously, so that the phenomenon of blocking caused by switching of the use scene due to the blocking problem is avoided.
With reference to the first aspect, in another possible implementation manner, the power consumption control method may further include: in the case that the first power consumption parameter response includes no second power consumption parameter, after a second duration, the second thread resends the first power consumption parameter request to the scheduling engine; the scheduling engine receives the new first power consumption parameter request and sends a new first power consumption parameter response to the second thread; the second thread receives the new first power consumption parameter response, and adjusts the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter under the condition that the new first power consumption parameter response comprises the second power consumption parameter.
Based on the possible implementation manner, since the second thread may send the power consumption parameter request to the scheduling engine again when the received first power consumption parameter response does not include the power consumption parameter corresponding to the second usage scenario, when the new power consumption parameter response includes the power consumption parameter corresponding to the second usage scenario, it is determined whether the first power consumption parameter response includes the second power consumption parameter, and when it is determined that the first power consumption parameter response includes the second power consumption parameter, the second thread may adjust the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter. Thereby the accuracy of the switching of the use scene of the electronic equipment can be improved.
With reference to the first aspect, in another possible implementation manner, before the second thread sends the second power consumption parameter to the third thread, the power consumption control method may further include, during a first period: the second thread sends a second power consumption parameter request to the scheduling engine; the scheduling engine receives a second power consumption parameter request and sends a second power consumption parameter response to the second thread; the second thread receives the second power consumption parameter response and sends the second power consumption parameter to the third thread if the second power consumption parameter response does not include the third power consumption parameter.
Based on this possible implementation, the second thread may also obtain a second power consumption parameter response by the scheduling engine, since the second thread may also obtain the second power consumption parameter before the second thread sends the second power consumption parameter to the third thread. When the second power consumption parameter response does not include the third power consumption parameter, namely, the use scene of the electronic device is switched to the second use scene, and is not switched to other use scenes, the second thread can send the second power consumption parameter to the third thread, so that the third thread can adjust the power consumption parameter of the CPU to the second power consumption parameter, and the accuracy of the use scene switching of the electronic device can be improved.
With reference to the first aspect, in another possible implementation manner, the preset power consumption parameter is a maximum value of power consumption parameters of a CPU of the electronic device.
Based on the possible implementation manner, because the preset power consumption parameter is the maximum value of the power consumption parameter of the CPU of the electronic device, when the electronic device is switched from the first use scene to the second use scene, the power consumption parameter of the CPU of the electronic device is adjusted to the preset power consumption parameter, so that the CPU has high enough power consumption support, and the electronic device is prevented from generating a clamping phenomenon.
With reference to the first aspect, in another possible implementation manner, the first power consumption parameter is a value of a CPU power limit PL1 corresponding to the first usage scenario, the second power consumption parameter is a value of a CPU power limit PL1 corresponding to the second usage scenario, and the preset power consumption parameter is a maximum value of the CPU power limit PL1 of the electronic device.
Based on the possible implementation manner, since the first power consumption parameter is the value of the CPU power limit PL1 corresponding to the first usage scenario, the second power consumption parameter is the value of the CPU power limit PL1 corresponding to the second usage scenario, and the preset power consumption parameter is the maximum value of the CPU power limit PL1 of the electronic device, when the electronic device is switched from the first usage scenario to the second usage scenario, the power consumption parameter of the CPU of the electronic device is adjusted to the maximum value of the CPU power limit PL1, so that the CPU can have high enough power consumption support, and the electronic device is prevented from generating a clamping phenomenon.
In a second aspect, an embodiment of the present application provides a power consumption control apparatus, which may be applied to an electronic device, for implementing the method in the first aspect. The function of the power consumption control device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above, for example, an adjustment module, etc.
The adjusting module can be used for adjusting the power consumption parameter of the CPU of the electronic equipment into a first power consumption parameter under the condition that the use scene of the electronic equipment is a first use scene; the first power consumption parameter is a power consumption parameter of the CPU corresponding to the first use scene.
The adjusting module is further configured to adjust a power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter when the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario; the preset power consumption parameter is larger than the first power consumption parameter and the second power consumption parameter, the second power consumption parameter is the power consumption parameter of the CPU corresponding to the second use scene, and the first power consumption parameter is smaller than the second power consumption parameter.
The adjusting module is further configured to adjust the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to a second power consumption parameter after the first period.
In a third aspect, there is provided a power consumption control apparatus having a function of implementing the method of the first aspect described above. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
In a fourth aspect, there is provided a power consumption control apparatus including: a processor and a memory; the memory is configured to store computer-executable instructions that, when executed by the power consumption control apparatus, cause the power consumption control apparatus to perform the power consumption control method according to any one of the first aspect.
In a fifth aspect, there is provided a power consumption control apparatus including: a processor; the processor is configured to execute the power consumption control method according to any one of the first aspect above according to an instruction in the memory after being coupled to the memory and reading the instruction.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium having computer program instructions stored thereon. The computer program instructions, when executed by an electronic device, cause the electronic device to implement the power consumption control method as claimed in the first aspect or any one of the possible implementations of the first aspect.
In a seventh aspect, embodiments of the present application provide a computer program product comprising computer readable code which, when run in an electronic device, causes the electronic device to implement the power consumption control method according to the first aspect or any one of the possible implementations of the first aspect.
In an eighth aspect, there is provided an apparatus (e.g. the apparatus may be a system-on-a-chip) comprising a processor for supporting an electronic device to implement the functions referred to in the first aspect above. In one possible design, the apparatus further includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, the device can be formed by a chip, and can also comprise the chip and other discrete devices.
It should be appreciated that the advantages of the second to eighth aspects may be referred to in the description of the first aspect, and are not described herein.
Drawings
FIG. 1 is a schematic diagram of a related art flow chart of switching usage scenarios of an electronic device;
FIG. 2 is a second schematic flow chart of switching the usage scenario of the electronic device in the related art;
fig. 3 is a schematic flow chart of a power consumption control method according to an embodiment of the present application;
fig. 4 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 5 is a schematic software structure of an electronic device according to an embodiment of the present application;
fig. 6 is a second flowchart of a power consumption control method according to an embodiment of the present application;
fig. 7 is a flowchart illustrating a power consumption control method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a power consumption control device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that "/" means or, e.g., A/B may represent A or B; the text "and/or" is merely an association relationship describing the associated person, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist together, and B exists alone.
At present, the power consumption optimization technology is widely applied to electronic equipment such as notebook computers and the like. The power consumption optimization is a technology for optimizing the system power consumption of the electronic equipment, and the power consumption of the CPU of the electronic equipment can be dynamically adjusted according to different use scenes, so that the power consumption of the CPU of the electronic equipment can meet the power consumption requirements corresponding to different use scenes.
When the use scene of the electronic equipment (such as a notebook computer) is switched from a low-load use scene to a high-load use scene, the power consumption of the CPU of the electronic equipment can be increased from the power consumption corresponding to the low-load use scene to the power consumption corresponding to the high-load use scene through a power consumption optimization technology, so that the power consumption of the CPU of the electronic equipment can be ensured to meet the power consumption requirement corresponding to the high-load use scene.
The power consumption of the CPU can be represented by a power limit 1 (pl 1) of the CPU. PL1 may represent the maximum sustained power consumption level allowed by the CPU in watts (watts, W). PL1 limits the power consumption of the CPU in the continuous operation state and can also be regarded as a soft limitation of the thermal design power of the CPU. When the processor exceeds the power consumption limit of PL1, it may cause a temperature rise and thus trigger a thermal protection mechanism, thereby degrading the performance of the processor.
That is, when the usage scenario of the electronic device is a low-load usage scenario (e.g., the electronic device opens an application program with low power consumption requirement on the CPU), the electronic device may set PL1 of the CPU to a low value, e.g., PL1 is 7W, through the power consumption optimization technology, so that the usage performance of the electronic device may not be affected, and meanwhile, the power consumption of the CPU may be reduced. When the usage scenario of the electronic device is a high-load usage scenario (for example, the electronic device opens an application program with higher power consumption requirement on the CPU), the electronic device can set PL1 of the CPU to a higher value, for example, PL1 is 11W, through a power consumption optimization technology, so that the usage performance of the electronic device can not be affected.
For example, taking an electronic device as a notebook computer, when the notebook computer is powered by a battery, that is, direct Current (DC) power is supplied, or the notebook computer is opened with more application programs (that is, the background of the notebook computer is heavy), or the notebook computer is opened with application programs with higher power consumption requirements on the CPU, such as application programs like games, the notebook computer can dynamically adjust the power consumption of the CPU of the notebook computer according to different usage scenarios through a power consumption optimization technology, so as to meet the power consumption requirements corresponding to different usage scenarios.
When the use scene of the notebook computer is a low-load use scene, such as when a user uses an application program with lower power consumption requirement on the CPU, such as a communication application program, or uses the communication application program to conference and share the desktop, the notebook computer can set PL1 of the CPU to 7W through a power consumption optimization technology, so that the use performance of the electronic equipment is not affected, and meanwhile, the power consumption of the CPU can be reduced.
When the use scene of the notebook computer is switched from the low-load use scene to the high-load use scene, the power consumption of the CPU of the electronic equipment can be increased from the power consumption corresponding to the low-load use scene (namely PL1 is 7W) to the power consumption corresponding to the high-load use scene (namely PL1 is 11W) through a power consumption optimization technology, so that the power consumption of the CPU of the notebook computer can be ensured to meet the power consumption requirement corresponding to the high-load use scene.
However, when the use scene of the electronic device is switched from a low-load use scene to a high-load use scene, the power consumption of the CPU of the electronic device cannot be timely adjusted through the power consumption optimization technology, so that the electronic device can generate a clamping phenomenon, and the use experience of a user is reduced.
In the following, taking an electronic device as a notebook computer as an example, a principle of switching a use scene of the notebook computer from a low-load use scene to a high-load use scene is schematically described.
As shown in fig. 1, when the usage scenario of the notebook computer is a low-load usage scenario, i.e., scenario a, the notebook computer may set the power consumption of the CPU to a lower value, such as setting PL1 of the CPU to 7W, by using a power consumption optimization technique, so that the usage performance of the notebook computer may not be affected, and the power consumption of the CPU may be reduced.
When the use scene of the notebook computer is switched from the low-load use scene to the high-load use scene, namely scene B, the notebook computer can firstly set the power consumption of the CPU to a higher value through a power consumption optimization technology, such as setting the PL1 of the CPU to the maximum value of PL1, such as 35W, so that the notebook computer can be ensured to have high enough power consumption support when the use scene of the notebook computer is switched from the low-load use scene to the high-load use scene.
The stage in which the notebook computer sets PL1 to the maximum value (e.g., 35W) of PL1 by the power consumption optimization technique CPU may be referred to as a transition stage (i.e., a Smooth stage in scene change).
After the notebook computer sets the PL1 of the CPU to the maximum value (e.g., 35W) of the PL1 by the power consumption optimization technique, the notebook computer may set the power consumption of the CPU to the power consumption corresponding to the high load usage scenario by the power consumption optimization technique, e.g., set the PL1 of the CPU to 11W, so as to ensure that the power consumption of the CPU of the notebook computer can meet the power consumption requirement corresponding to the high load usage scenario.
That is, when the usage scenario of the electronic device (such as a notebook computer) is switched from the low-load usage scenario to the high-load usage scenario, the power consumption of the CPU of the electronic device is first adjusted from the power consumption corresponding to the low-load usage scenario to the maximum power consumption of the CPU by the power consumption optimization technique, and then the power consumption of the CPU of the electronic device is first adjusted from the maximum power consumption of the CPU to the power consumption corresponding to the high-load usage scenario by the power consumption optimization technique.
Therefore, when the use scene of the electronic equipment is switched from a low-load use scene to a high-load use scene, if the power consumption of the CPU of the electronic equipment cannot be adjusted in time through the power consumption optimization technology, the electronic equipment can generate a clamping phenomenon, and the use experience of a user is reduced.
For example, when the power consumption of the CPU is adjusted to the maximum power consumption of the CPU, if the maximum power consumption of the CPU is not yet in effect, the power consumption of the CPU is adjusted to the power consumption corresponding to the high load use scenario. Because the power consumption corresponding to the high-load use scene is smaller than the maximum power consumption of the CPU, namely, when the electronic equipment is switched from the low-load use scene to the high-load use scene, the CPU does not have high enough power consumption support, and a clamping phenomenon can be generated in the switching process of the use scene. For another example, when the power consumption of the CPU is adjusted to the maximum power consumption of the CPU, if the effective process of the maximum power consumption of the CPU is slower, the actual power consumption of the CPU is still 7W in the switching of the usage scenario, that is, the electronic device is switched from the low-load usage scenario to the high-load usage scenario Jing Shi, and the CPU also has not high enough power consumption support, which may cause a stuck phenomenon in the switching process of the usage scenario.
In the following, the electronic device is taken as a notebook computer as an example, and the process of causing the electronic device to generate a clamping phenomenon is schematically illustrated if the power consumption of the CPU of the electronic device cannot be timely adjusted through the power consumption optimization technology in the process of switching the use scene of the notebook computer from the low-load use scene to the high-load use scene.
As shown in FIG. 2, a notebook computer may include thread 1, thread 2, a dispatch engine, and a dispatch executor. Thread 1 may include a scene recognition module. As shown in fig. 2, switching the usage scenario of the notebook computer from a low-load usage scenario to a high-load usage scenario may include the following process.
When the usage scene of the notebook computer is switched from the low-load usage scene to the high-load usage scene Jing Shi, the scene recognition module included in the thread 1 of the notebook computer can perform scene deduplication, that is, the scene recognition module can determine whether the usage scene after switching is the same as the usage scene before switching.
When the scene recognition module determines that the usage scene after the switching is different from the usage scene before the switching, that is, determines that the usage scene after the switching is a high-load usage scene, the usage scene before the switching is a low-load usage scene, the scene recognition module may send a policy to the scheduling engine, that is, the policy may include power consumption of the CPU corresponding to the high-load usage scene, for example, PL1 of the CPU is 11W.
After the scheduling engine receives the policy sent by the scene recognition module, the scheduling engine can add the policy to the message queue, i.e. can store the policy. Thereafter, the scheduling engine may send a notification to thread 2, which may be used to instruct the usage scenario to switch from a low load usage scenario to a high load usage scenario.
After thread 2 receives the notification value sent by the scheduler engine, thread 2 may take the policy from the scheduler engine. The scheduler engine may return a policy to thread 2, i.e. the power consumption of the CPU corresponding to the high load usage scenario, e.g. PL1 of the CPU is 11W. Thereafter, the scheduling engine may send a return notification to thread 1, which may be used to indicate that the scheduling engine has sent the power consumption of the CPU corresponding to the switched high load usage scenario to thread 2.
Then, the thread 2 may determine whether the policy obtained from the scheduling engine is empty, that is, whether the policy includes power consumption of the CPU corresponding to the switched high load usage scenario. When the policy is empty, the thread 2 can determine to wait for 1 second, and continue to fetch the policy from the scheduling engine in the waiting process, and determine whether the fetched policy includes the power consumption of the CPU corresponding to the switched high-load usage scenario.
When the policy is not null, thread 2 may set PL1 of the CPU to a maximum value of PL1 (e.g., 35W) by the scheduling engine and scheduling executor using the power consumption optimization technique, i.e., thread 2 may make a transition phase without waiting. In this process thread 2 is passed throughThe dynamic adjustment technique (dynamic tuning technology, DTT) of (a) issues 35, so that the PL1 of the CPU is adjusted to 35W from PL1 (e.g. 7W) corresponding to the low load usage scenario.
Thereafter, thread 2 may send the policy, i.e., the power consumption of the CPU corresponding to the high load usage scenario, e.g., PL1 of the CPU is 11W. That is, thread 2 may issue the policy and click through the dispatch engine as well as the dispatch executor. That is, the thread 2 can adjust the PL1 of the CPU from 35W to PL1 (e.g., 11W) corresponding to the high load usage scenario by using the power consumption optimization technique through the scheduling engine and the scheduling executor.
According to the process of switching the use scene of the notebook computer from the low-load use scene to the high-load use scene, if the power consumption of the CPU is adjusted to be the maximum value of the power consumption of the CPU and is not effective, the power consumption of the CPU is adjusted to be the power consumption corresponding to the high-load use scene and is effective. That is, when the PL1 of the CPU is set to the maximum value (e.g., 35W) of the PL1 by the thread 2 using the power consumption optimization technique, the PL1 of the CPU is not yet validated, but the PL1 of the CPU is adjusted to the PL1 corresponding to the high load usage scenario by the thread 2 and the PL1 of the CPU is set to 11W by the power consumption optimization technique, that is, the PL1 is validated, and since 11W is smaller than 35W, the CPU does not have high enough power consumption support when the notebook computer is switched from the low load usage scenario to the high load usage scenario, and a click phenomenon may occur during the switching of the usage scenario.
If the effective process of adjusting the power consumption of the CPU to the maximum value of the power consumption of the CPU is slow, the actual power consumption of the CPU is 7W in the switching of the use scene. I.e. thread 2 passesDTT issues 35W, so that when PL1 of CPU is adjusted to 35W from PL1 (such as 7W) corresponding to low load use scene, 35W strategy and ++are needed>And after the DTT is fused or converted, a 35W strategy is issued to a driver of the notebook computer, and the PL1 of the CPU is adjusted to 35W by the driver of the notebook computer, so that the PL1 of the CPU takes effect slowly when the PL1 of the CPU is 35W. In this process, PL1 of the CPU is always PL1 (i.e. 7W) corresponding to the low-load scenario, that is, when the notebook computer is switched from the low-load scenario to the high-load scenario, the CPU does not have high enough power consumption support, which may cause a stuck phenomenon during the switching process of the use scenario.
In addition, as can be seen from the above process of switching the usage scenario of the notebook computer from the low-load usage scenario to the high-load usage scenario, when the usage scenario of the notebook computer is switched from the low-load usage scenario to the high-load usage scenario, the issuing and validating of the policy (i.e., the power consumption of the CPU corresponding to the high-load usage scenario) in the process are performed in the same thread (i.e., thread 2), and if the policy of the last usage scenario is not validated, the policy of the new usage scenario is issued, thus resulting in a delay in validating the new policy in the switching of the usage scenario, and also resulting in a click phenomenon of the notebook computer.
In view of the above problems, the embodiments of the present application provide a power consumption control method, which is applied to an electronic device, where the electronic device has a power consumption optimization function, that is, the electronic device may dynamically adjust the power consumption of a CPU of the electronic device according to different usage scenarios. When the use scene of the electronic equipment is switched from the low-load use scene to the high-load use scene, the electronic equipment can firstly adjust the power consumption of the CPU from the power consumption corresponding to the low-load use scene to the maximum power consumption of the CPU, and after the preset duration, the electronic equipment adjusts the power consumption of the CPU from the maximum power consumption of the CPU to the power consumption corresponding to the high-load use scene.
According to the scheme, when the power consumption of the CPU is adjusted to the maximum value of the power consumption of the CPU from the power consumption corresponding to the low-load use scene, the power consumption of the CPU is adjusted to the power consumption corresponding to the high-load use scene from the maximum value of the power consumption of the CPU after the preset time. Within the preset time, the power consumption of the CPU can be ensured to be adjusted from the power consumption corresponding to the low-load use scene to the maximum value of the power consumption of the CPU, namely, the power consumption of the CPU can be ensured to be successfully adjusted to the maximum value of the power consumption of the CPU. Therefore, when the power consumption of the CPU is adjusted to be the maximum value of the power consumption of the CPU and is not effective, but the power consumption of the CPU is adjusted to be the power consumption corresponding to the high-load use scene and is effective, the phenomenon that the CPU has not enough high power consumption to support and is blocked when the electronic equipment is switched from the low-load use scene to the high-load use scene can be avoided.
Meanwhile, according to the scheme, when the use scene of the electronic equipment is switched from the low-load use scene to the high-load use scene, the electronic equipment directly transmits the maximum power consumption of the CPU to the drive of the electronic equipment, and the drive of the electronic equipment can adjust the power consumption of the CPU to the maximum power consumption according to the maximum power consumption of the CPU. Therefore, the phenomenon of clamping caused by insufficient high power consumption support of the CPU when the electronic equipment is switched from a low-load use scene to a high-load use scene due to slower effective process of the maximum power consumption of the CPU can be avoided.
In addition, according to the scheme, when the use scene of the electronic equipment is switched from a low-load use scene to a high-load use scene, the electronic equipment respectively executes the issuing and validating processes of the power consumption corresponding to the high-load use scene through different threads. The issuing and effective processes of the power consumption corresponding to the high-load use scene can be executed asynchronously, so that the phenomenon of blocking caused by the use scene switching is avoided. That is, since the issuing and validating processes of the power consumption corresponding to the high-load use scenario can be executed asynchronously, the situation that the strategy of the last use scenario is not validated, the strategy of the new use scenario is issued, and the delay exists in validating the new strategy in the switching of the use scenario, which is caused by the phenomenon of blocking of the electronic equipment.
In the following, the electronic device is taken as a notebook computer as an example, and when the use scene of the notebook computer is switched from a low-load use scene to a high-load use scene, the principle of the power consumption control method provided by the embodiment of the application is schematically described. As shown in FIG. 3, the notebook computer may include thread 1, thread 2, thread 3, a dispatch engine, and a dispatch executor. Thread 1 may include a scene recognition module.
The scheduling engine is mainly responsible for task scheduling and task management, can perform task setting and management, realizes automatic starting and processing of tasks, and provides automatic calculation, export and pushing functions of reports for users. The scheduler engine is typically a stand-alone tool or service for coordinating and managing task operations throughout the system.
And the scheduling executor is used for determining the working process for actually executing each task plan. Which may be a process, thread, or other executing entity, for performing tasks managed by the scheduler engine. The scheduling executor is responsible for the execution of specific tasks and the allocation of resources according to the instructions of the scheduling engine and the task scheduling policy.
Scheduling engines are more focused on macroscopic task scheduling and management of system resources, while scheduling executors are more focused on microscopic task execution and resource allocation. The two complement each other to jointly realize task scheduling and execution management of the system.
As shown in fig. 3, the power consumption control method provided in the embodiment of the present application may include the following procedure.
When the usage scene of the notebook computer is switched from the low-load usage scene to the high-load usage scene Jing Shi, the scene recognition module included in the thread 1 of the notebook computer can perform scene deduplication, that is, the scene recognition module can determine whether the usage scene after switching is the same as the usage scene before switching.
When the scene recognition module determines that the usage scene after the switching is different from the usage scene before the switching, that is, determines that the usage scene after the switching is a high-load usage scene, the usage scene before the switching is a low-load usage scene, the scene recognition module may send a policy to the scheduling engine, that is, the policy may include power consumption of the CPU corresponding to the high-load usage scene, for example, PL1 of the CPU is 11W.
After the scheduling engine receives the policy sent by the scene recognition module, the scheduling engine can add the policy to the message queue, i.e. can store the policy. Thereafter, the scheduling engine may send a notification to thread 2, which may be used to instruct the usage scenario to switch from a low load usage scenario to a high load usage scenario.
After thread 2 receives the notification value sent by the scheduler engine, thread 2 may take the policy from the scheduler engine. The scheduling engine may return policy 1, i.e. the power consumption of the CPU corresponding to the high load usage scenario, to thread 2, e.g. PL1 of the CPU is 11W. Thereafter, the scheduling engine may send a return notification to thread 1, which may be used to indicate that the scheduling engine has sent the power consumption of the CPU corresponding to the switched high load usage scenario to thread 2.
Then, the thread 2 may determine whether the policy 1 acquired from the scheduling engine is empty, that is, determine whether the policy 1 includes power consumption of the CPU corresponding to the switched high load usage scenario. When the policy 1 is empty, the thread 2 may determine to wait for 1 second, and continue to fetch the policy 1 from the scheduling engine during the waiting process, and determine whether the re-fetched policy 1 includes power consumption of the CPU corresponding to the switched high-load usage scenario.
When this policy 1 is not empty, thread 2 may set PL1 of the CPU to the maximum value of PL1 (e.g., 35W) by the scheduling engine and scheduling executor using the power consumption optimization technique, i.e., thread 2 may make a transition phase and wait 2 seconds (i.e., wait for a preset period of time). In this process, the thread 2 issues 35 to the notebook computer, so that the PL1 of the CPU is adjusted to 35W from the PL1 (e.g. 7W) of the CPU corresponding to the low load usage scenario by the notebook computer.
When the power consumption of the CPU is adjusted from the power consumption corresponding to the low-load use scenario to the maximum power consumption of the CPU (that is, PL1 of the CPU is 35W), the maximum power consumption of the CPU is adjusted from the maximum power consumption of the CPU to the power consumption corresponding to the high-load use scenario after a preset period (that is, 2 seconds), and within the preset period (that is, 2 seconds), the power consumption of the CPU can be ensured to be adjusted from the maximum power consumption of the CPU to be effective, that is, the power consumption of the CPU can be ensured to be successfully adjusted to the maximum power consumption of the CPU. Therefore, when the power consumption of the CPU is adjusted to be the maximum value of the power consumption of the CPU and is not effective, but the power consumption of the CPU is adjusted to be the power consumption corresponding to the high-load use scene is effective, the phenomenon that the CPU has not enough high power consumption to support and is blocked when the notebook computer is switched from the low-load use scene to the high-load use scene can be avoided.
And when the use scene of the notebook computer is switched from the low-load use scene to the high-load use scene Jing Shi, the notebook computer directly transmits the maximum power consumption of the CPU (namely the PL1 of the CPU is 35W) to the drive of the notebook computer, and the drive of the notebook computer can adjust the power consumption of the CPU to the maximum power consumption according to the maximum power consumption of the CPU. Therefore, the phenomenon that the CPU has not enough high power consumption support and is blocked when the notebook computer is switched from a low-load use scene to a high-load use scene due to the fact that the maximum power consumption of the CPU takes effect slowly can be avoided.
Thread 2 may then continue to fetch policies from the scheduler engine for the waiting 2 seconds. The scheduling engine may return policy 2 to thread 2. The power consumption of the CPU corresponding to the usage scenario included in the policy 2 (i.e., PL1 of the CPU) may be the same as or different from the power consumption of the CPU corresponding to the usage scenario included in the policy 1 (i.e., PL1 of the CPU).
When the thread 2 determines that the power consumption of the CPU corresponding to the usage scenario included in the policy 2 is the same as the power consumption of the CPU corresponding to the usage scenario included in the policy 1, that is, the notebook computer is frequently switched to the same high-load usage scenario. Thread 2 may continue through the dispatch engine and dispatch executor to maintain the PL1 of the CPU at a maximum value (i.e., 35W) using power consumption optimization techniques.
When the thread 2 determines that the power consumption of the CPU corresponding to the use scenario included in the policy 2 is not null, and the power consumption of the CPU corresponding to the use scenario included in the policy 2 is different from the power consumption of the CPU corresponding to the use scenario included in the policy 1, namely the notebook computer is switched to different high-load use scenarios. The thread 2 may assign the policy 2 to the policy 1, that is, the power consumption of the CPU corresponding to the usage scenario included in the policy 2 is assigned to the power consumption of the CPU corresponding to the usage scenario included in the policy 1. Thereafter, thread 2 may continue through the dispatch engine and dispatch executor, maintaining the CPU PL1 at a maximum value (i.e., 35W) using power consumption optimization techniques.
When the thread 2 determines that the power consumption of the CPU corresponding to the usage scenario included in the policy 2 is empty, the thread 2 may send the policy 1 (i.e., the power consumption of the CPU corresponding to the high-load usage scenario, for example, PL1 of the CPU is 11W) to the thread 3 after a preset duration, i.e., 2 seconds.
After receiving the policy 1 sent by the thread 2, the thread 3 may issue and point the policy 1 (i.e. the power consumption of the CPU corresponding to the high load usage scenario, for example, PL1 of the CPU is 11W). That is, the thread 3 may issue the policy 1 (i.e., the power consumption of the CPU corresponding to the high-load usage scenario, for example, PL1 of the CPU is 11W) to the driver of the notebook, so that the driver of the notebook adjusts the PL1 of the CPU from 35W to the PL1 (i.e., 11W) of the CPU corresponding to the high-load usage scenario.
When the use scene of the notebook computer is switched from the low-load use scene to the high-load use scene Jing Shi, the notebook computer respectively executes the issuing and validating processes of the power consumption corresponding to the high-load use scene through different threads, namely, issues the power consumption corresponding to the high-load use scene through the thread 2 (namely, PL1 of the CPU is 11W), and adjusts PL1 of the CPU from 35W to the power consumption corresponding to the high-load use scene through the thread 3 (namely, PL1 of the CPU is 11W). The issuing and validating processes of the power consumption corresponding to the high-load use scene can be executed asynchronously, so that the phenomenon that the electronic equipment is blocked due to the fact that the strategy of the last use scene is not validated and the strategy of the new use scene is issued, and delay exists in validating the new strategy in the switching of the use scene.
The power consumption control method provided in the embodiment of the present application is described below.
The power consumption control method provided by the embodiment of the application can be applied to electronic equipment. In some examples, the electronic device may be a handheld computer, a personal computer (personal computer, PC) (e.g., notebook computer), a personal digital assistant (personal digital assistant, PDA), or the like, which has a power consumption optimization function, i.e., the electronic device may dynamically adjust the power consumption of the CPU (i.e., the value of PL1 of the CPU) of the electronic device according to different usage scenarios. The embodiment of the present application does not limit the specific form of the electronic device herein. In the embodiment of the application, the electronic device is taken as a notebook computer as an example for schematic description.
By way of example, taking an electronic device as a notebook computer, fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 4, the notebook computer may include: processor 410, fan 411, external memory interface 420, internal memory 421, universal serial bus (universal serial bus, USB) interface 430, charge management module 440, power management module 441, battery 442, display 450, antenna, wireless communication module 460, audio module 470, speaker (i.e., speaker) 470A, microphone 470C, headset interface 470B, touch pad 480, keyboard 490, and camera 491, among others.
The other devices except the display 450 (such as the processor 410, the fan 411, the external memory interface 420, the internal memory 421, the usb interface 430, the charge management module 440, the power management module 441, the battery 442, the antenna, the wireless communication module 460, the audio module 470, the touch pad 480, the speaker 470A, the microphone 470C, the earphone interface 470B, the keyboard 490, the camera 491, etc.) may be disposed on the base of the notebook computer. The camera 491 may also be disposed on a frame of the display 450 of the notebook computer.
It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the notebook computer. In other embodiments, the notebook computer may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 410 may include one or more processing units, such as: the processor 410 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can be a neural hub and a command center of the notebook computer. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 410 for storing instructions and data. In some embodiments, the memory in the processor 410 is a cache memory. The memory may hold instructions or data that the processor 410 has just used or recycled. If the processor 410 needs to reuse the instruction or data, it may be called directly from the memory. Repeated accesses are avoided, reducing the latency of the processor 410 and thus improving the efficiency of the system.
In some embodiments, processor 410 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the connection relationship between the modules illustrated in this embodiment is only illustrative, and does not limit the structure of the notebook computer. In other embodiments, the notebook computer may also use different interfacing modes, or a combination of multiple interfacing modes in the above embodiments.
The charge management module 440 is configured to receive a charge input from a charger (e.g., a wireless charger or a wired charger) to charge the battery 442. The power management module 441 is configured to connect the battery 442, the charge management module 440 and the processor 410. The power management module 441 receives input from the battery 442 and/or the charge management module 440 to power the various devices of the notebook computer.
The wireless communication function of the notebook computer can be realized by an antenna and wireless communication module 460, a modem processor, a baseband processor and the like.
The antenna is used for transmitting and receiving electromagnetic wave signals. Each antenna in a notebook computer may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas.
In some embodiments, the antenna of the notebook computer and the wireless communication module 460 are coupled such that the notebook computer can communicate with a network and other devices through wireless communication technology. The wireless communication module 460 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wi-Fi network, wireless fidelity), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to a notebook computer.
The notebook computer may implement display functions through a GPU, a display screen 450, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 450 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 410 may include one or more GPUs that execute program instructions to generate or change display information. The display 450 is used to display images, videos, and the like.
The touch panel 480 has a touch sensor integrated therein. The notebook computer may receive control commands from a user to the notebook computer via the touch pad 480 and the keyboard 490.
The notebook computer may implement photographing functions through an ISP, a camera 491, a video codec, a GPU, a display screen 450, an application processor, and the like. The ISP is used to process the data fed back by the camera 491. In some embodiments, the ISP may be provided in the camera 491. The camera 491 is used to capture still images or video. In some embodiments, the notebook computer may include 1 or N cameras 491, N being a positive integer greater than 1.
The external memory interface 420 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capabilities of a notebook computer. The internal memory 421 may be used to store computer-executable program code that includes instructions. The processor 410 executes various functional applications of the notebook computer and data processing by executing instructions stored in the internal memory 421. For example, in the present embodiment, the processor 410 may include a storage program area and a storage data area by executing instructions stored in the internal memory 421.
The notebook computer may implement audio functions through an audio module 470, a speaker 470A, a microphone 470C, an earphone interface 470B, an application processor, and the like. Such as music playing, recording, etc.
The audio module 470 is used to convert digital audio signals to analog audio signal outputs and also to convert analog audio inputs to digital audio signals. The audio module 470 may also be used to encode and decode audio signals. In some embodiments, the audio module 470 may be disposed in the processor 410, or some functional modules of the audio module 470 may be disposed in the processor 410. Speaker 470A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. Microphone 470C, also referred to as a "microphone" or "microphone," is used to convert sound signals into electrical signals. The headphone interface 470B is for connecting a wired headphone. Earphone interface 470B may be a USB interface 430 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The notebook computer described in embodiments of the present application may include one or more speakers 470A, and one or more microphones 470C.
The fan 412 is used for heat dissipation of the notebook computer. The processor 410 may control the fan 412 to operate at different speeds to dissipate heat from the notebook computer.
It will be understood, of course, that the above illustration of fig. 4 is merely exemplary of the case where the electronic device is in the form of a notebook computer. If the electronic device is in the form of a handheld computer, PDA, or other device, the electronic device may include fewer structures than those shown in fig. 4, or may include more structures than those shown in fig. 4, and is not limited thereto.
It will be appreciated that in general, implementation of electronic device functions requires software in addition to hardware support.
The software system of the electronic device may be divided into different layers according to different functions. As shown in fig. 5, in the embodiment of the present application, software of the electronic device is divided into three layers, namely, an application layer (i.e., an application program layer), an Operating System (OS) layer and a driver layer from top to bottom.
The application layer may include various applications used by the user, such as browser applications, office applications, media applications, and the like. These applications may be provided directly for use by the user to interact with the user through a user interface.
In the embodiment of the present application, the application layer may further include a PC manager Application (APP). The PC manager APP can determine that the scene A of the power consumption optimization service of the electronic equipment (such as a notebook computer) is switched to the scene B. I.e., PC manager APP, can determine that the power consumption optimization traffic of the electronic device is switched from a low load usage scenario (i.e., scenario a) to a high load usage scenario (i.e., scenario B).
The OS layer refers to an operating system, which is mainly responsible for managing and controlling the hardware and software resources of a computer. The operating system provides an operating environment for applications including task management, file systems, memory management, network functions, and the like. Common operating systems are Windows, macOS and Linux, etc.
In the embodiment of the present application, the OS layer may further include thread 1, thread 2, and thread 3. The PC manager application may determine, via thread 1, a usage scenario for power consumption optimization services for the electronic device.
When the PC manager application program determines that the use scene of the power consumption optimization service of the electronic device is a low-load use scene (namely scene A) through the thread 1, the PC manager application program can send the power consumption of the CPU corresponding to the scene A to the thread 3 of the OS layer in a DTT mode, and if the PL1 of the CPU is 7W. Thread 3 can adjust the PL1 of the CPU to the value of PL1 corresponding to the low load usage scenario (i.e., scenario a), i.e., 7W, by driving in the driver layer.
When the PC manager application program determines that the use scene of the power consumption optimization service of the electronic device is switched from the low-load use scene (namely scene A) to the high-load use scene (namely scene B) through the thread 1, the PC manager application program can issue the maximum value of the power consumption of the CPU to the thread 2 of the OS layer in a DTT mode, for example, the PL1 of the CPU is 35W. That is, thread 2 may perform the transition phase issue, adjust PL1 of the CPU from PL1 corresponding to the low load usage scenario (i.e., 7W) to 35W by driving in the driving layer, and wait for a preset period of time, such as 2 seconds.
After the preset duration, the PC manager application program can issue the power consumption of the CPU corresponding to the scene B to the thread 3 in a DTT mode through the thread 2, for example, the PL1 of the CPU is 11W. Thread 3 can adjust the PL1 of the CPU from 35W to the value of PL1 corresponding to the high load usage scenario (i.e., scenario B), i.e., 11W, by driving in the driver layer.
It should be noted that, in the prior art, when the PC manager application determines, through the thread 1, that the usage scenario of the power consumption optimization service of the electronic device is switched from the low-load usage scenario (i.e., scenario a) to the high-load usage scenario (i.e., scenario B), the PC manager application issues, through the DTT method, the maximum value of the power consumption of the CPU to the thread 2 of the OS layer, for example, PL1 of the CPU is 35W. I.e. thread 2 may perform the transition phase issue without waiting for a preset period of time. That is, thread 2 adjusts PL1 of the CPU from PL1 (i.e., 7W) corresponding to the low load use scenario to 35W by driving in the driving layer.
The driver layer may include drivers for various hardware devices, such as display drivers, sound card drivers, network card drivers, and the like. These drivers communicate with the hardware devices through interfaces provided by the operating system so that applications can interact with the hardware devices indirectly through the operating system.
In the embodiment of the present application, the driving layer may include a drive that adjusts the power consumption of the CPU (i.e., a power consumption parameter adjustment drive), that is, a drive that adjusts the value of PL1 of the CPU, such as a power management drive or a CPU drive (CPU Driver).
The power management driver is mainly responsible for controlling the power consumption and heat dissipation of the CPU to optimize the performance and battery life of the system. The power management driver can control the performance and heat dissipation of the CPU by adjusting the value of PL 1.
CPU drivers are drivers specific to CPU hardware that are responsible for managing and controlling the various functions and operations of the CPU in an operating system. The CPU driver can also control the performance and heat dissipation of the CPU by adjusting the value of PL 1.
The methods in the following embodiments may be implemented in an electronic device having the above-described hardware structure or software structure.
In the embodiment of the application, the electronic device is taken as a notebook computer as an example for schematic description. The notebook may include thread 1 (thread 1 may also be referred to as a first thread in embodiments of the present application), thread 2 (thread 2 may also be referred to as a second thread in embodiments of the present application), and thread 3 (thread 3 may also be referred to as a third thread in embodiments of the present application).
Thread 1 may be used to determine whether the laptop's usage scenario is switched from a low-load usage scenario (i.e., a first usage scenario) to a high-load usage scenario (i.e., a second usage scenario).
The scheduling engine may be configured to receive and store the power consumption parameter corresponding to the second usage scenario (i.e., the value of PL1 of the CPU corresponding to the high-load usage scenario) sent by the thread 1 when the thread 1 determines that the usage scenario of the notebook computer is switched from the low-load usage scenario (i.e., the first usage scenario) to the high-load usage scenario (i.e., the second usage scenario).
The scheduling engine may also be used to send a switch scenario notification to thread 2.
The thread 2 may be configured to, when receiving the notification of the switching scenario sent by the scheduling engine, obtain a power consumption parameter corresponding to the second usage scenario from the scheduling engine, set the power consumption parameter of the CPU to a preset power consumption parameter (e.g. a maximum value of PL1 of the CPU), and wait for a second preset duration (e.g. 2 seconds).
Thread 2 may also be configured to send a power consumption parameter corresponding to the second usage scenario (i.e., a value of PL1 of the CPU corresponding to the high load usage scenario) to thread 3 after the second preset time period (in the embodiment of the present application, the second preset time period may also be referred to as the first time period).
Thread 3 may be configured to adjust the power consumption parameter of the CPU to the power consumption parameter corresponding to the second usage scenario according to the power consumption parameter corresponding to the second usage scenario (i.e., the value of PL1 of the CPU corresponding to the high load usage scenario) sent by thread 2.
The power consumption control method provided in the embodiment of the present application is described in detail below with reference to fig. 6. As shown in fig. 6, the power consumption control method may include S601 to S618 described below.
S601, determining that a use scene is switched from a first use scene to a second use scene by a thread 1 included in the notebook computer.
The usage scenarios of the notebook computer may include a high load usage scenario and a low load usage scenario. When the use scene is a high-load use scene, the power consumption of the CPU of the notebook computer is higher than or equal to a power consumption threshold. When the use scene is a low-load use scene, the power consumption of the CPU of the notebook computer is lower than a power consumption threshold. That is, the power consumption of the CPU corresponding to the high-load use scenario is larger than that of the CPU corresponding to the low-load use scenario.
It should be noted that, the specific value of the power consumption threshold may be determined according to the actual situation, which is not limited in the embodiment of the present application.
In some examples, the high load usage scenario may include a notebook computer launching an application requiring higher power consumption from the CPU, such as a game-like application, a video-like application, or my computer application or folder application included in the notebook computer, etc. In the embodiment of the present application, the specific type of the high-load usage scenario is not limited, and the scenario when the power consumption of the CPU of the notebook computer is higher than or equal to the power consumption threshold is the high-load usage scenario. For example, the high-load use scenario may also include a scenario where there are more applications started by the notebook computer.
In some examples, a low load usage scenario may include a notebook computer launching an application requiring less power consumption from the CPU, such as a text-based application, a communication-based application, and so forth. In the embodiment of the present application, the specific type of the low-load usage scenario is not limited, and the scenario when the power consumption of the CPU of the notebook computer is lower than the power consumption threshold is the low-load usage scenario. For example, the low-load use scenario may also include a scenario in which fewer applications are started by the notebook computer, or a scenario in which a user performs a meeting through a communication application included in the notebook computer to share a desktop.
In some examples, the power consumption of the CPU may be represented by a power limit 1 of the CPU, i.e., PL 1. When the usage scenario of the notebook computer is a high-load usage scenario, the value of PL1 of the CPU is large. When the usage scenario of the notebook computer is a low-load usage scenario, the value of PL1 of the CPU is small. That is, the value of PL1 of the CPU corresponding to the high load use scenario is larger than the value of PL1 of the CPU corresponding to the low load use scenario.
For example, the value of PL1 of the CPU may be 7W when the usage scenario of the notebook computer is a low-load usage scenario, and the value of PL1 of the CPU may be 11W when the usage scenario of the notebook computer is a high-load usage scenario.
When a user uses the notebook computer, the thread 1 included in the notebook computer can determine the use scene of the notebook computer, and the thread 1 included in the notebook computer can also determine whether the use scene of the notebook computer is switched from the first use scene to the second use scene. The first usage scenario may be a low load usage scenario and the second usage scenario may be a high load usage scenario.
When the thread 1 included in the notebook computer determines that the usage scenario of the notebook computer is switched from the low-load usage scenario (i.e., the first usage scenario) to the high-load usage scenario (i.e., the second usage scenario), the thread 1 may send a power consumption parameter corresponding to the second usage scenario (in the embodiment of the present application, the power consumption parameter corresponding to the second usage scenario may also be referred to as a second power consumption parameter) to a scheduling engine included in the notebook computer.
In some examples, when the thread 1 included in the notebook computer determines that the usage scenario of the notebook computer is a low-load usage scenario, the thread 1 may send the power consumption parameter of the CPU corresponding to the low-load usage scenario, that is, the value (e.g., 7W) of PL1 of the CPU corresponding to the low-load usage scenario, to the thread 3 included in the notebook computer. Thus, the thread 3 can set the value of the PL1 of the CPU to the value (such as 7W) of the PL1 of the CPU corresponding to the low-load use scene through the related drive (such as a power management drive) of the notebook computer, so that the power consumption of the CPU can be reduced while the use performance of the notebook computer is not influenced. The relevant driver (e.g., power management driver) in the embodiments of the present application may also be referred to as a power consumption parameter adjustment driver.
In some examples, when the thread 1 included in the notebook computer determines that the usage scenario of the notebook computer is a high-load usage scenario, the thread 1 may send the power consumption parameter of the CPU corresponding to the high-load usage scenario, that is, the value (e.g., 11W) of PL1 of the CPU corresponding to the high-load usage scenario, to the thread 3 included in the notebook computer. Thus, the thread 3 can set the value of the PL1 of the CPU to the value (11W, for example) of the PL1 of the CPU corresponding to the high-load use situation through the related drive (such as a power management drive) of the notebook computer, so that the use performance of the notebook computer can not be influenced.
In some examples, when the thread 1 included in the notebook computer determines that the usage scenario of the notebook computer is switched from the high-load usage scenario to the low-load usage scenario, the thread 1 may send the power consumption parameter of the CPU corresponding to the low-load usage scenario, that is, the value (e.g., 7W) of PL1 of the CPU corresponding to the low-load usage scenario, to the thread 3 included in the notebook computer. Therefore, the thread 3 can adjust the value of the PL1 of the CPU from the value (such as 11W) of the PL1 of the CPU corresponding to the low-load use scene to the value (such as 7W) of the PL1 of the CPU corresponding to the low-load use scene through the related drive (such as a power management drive) of the notebook computer, so that the use performance of the notebook computer is not influenced, and the power consumption of the CPU can be reduced.
It should be noted that, before the thread 1 included in the notebook computer determines that the usage scenario is switched from the first usage scenario to the second usage scenario, the thread 1 included in the notebook computer may determine that the usage scenario is the first usage scenario. Then, the thread 1 included in the notebook computer may determine a power consumption parameter corresponding to the first usage scenario (in the embodiment of the present application, the power consumption parameter corresponding to the first usage scenario may also be referred to as a first power consumption parameter). Then, the thread 1 included in the notebook computer can send the power consumption parameter corresponding to the first use scenario to the thread 3 included in the notebook computer, so that the thread 3 included in the notebook computer can adjust the power consumption parameter of the CPU to the power consumption parameter corresponding to the first use scenario.
S602, the thread 1 included in the notebook computer transmits power consumption parameters corresponding to a second use scene of a scheduling engine included in the notebook computer.
When the thread 1 included in the notebook computer determines that the usage scenario of the notebook computer is switched from the low-load usage scenario (i.e. the first usage scenario) to the high-load usage scenario (i.e. the second usage scenario), the thread 1 can send the power consumption parameter corresponding to the second usage scenario to the scheduling engine included in the notebook computer, so that the scheduling engine included in the notebook computer can store the power consumption parameter corresponding to the second usage scenario.
The power consumption parameter corresponding to the second usage scenario may be a value of PL1 of the CPU corresponding to the second usage scenario. I.e. the power consumption parameter corresponding to the second usage scenario, may be the value of PL1 of the CPU corresponding to the high load usage scenario, e.g. 11W.
It should be noted that, the notebook computer may store the corresponding relation between different usage scenarios and power consumption parameters in advance. Therefore, when the thread 1 included in the notebook computer determines that the use scene of the notebook computer is switched from the low-load use scene (namely the first use scene) to the high-load use scene (namely the second use scene), the thread 1 can determine the power consumption parameter corresponding to the second use scene according to the stored corresponding relation between different use scenes and the power consumption parameter.
S603, a scheduling engine included in the notebook computer receives and stores the power consumption parameters corresponding to the second use scene.
After the scheduling engine included in the notebook computer receives the power consumption parameter corresponding to the second use scenario sent by the thread 1, the power consumption parameter corresponding to the second use scenario is stored, so that the thread 2 can acquire the power consumption parameter corresponding to the second use scenario from the scheduling engine.
In some examples, the scheduling engine included in the notebook computer stores the power consumption parameter corresponding to the second usage scenario, and the power consumption parameter corresponding to the second usage scenario may be added to the message queue for the scheduling engine.
S604, a scheduling engine included in the notebook computer sends a scene switching notification to a thread 2 included in the notebook computer.
After the scheduling engine included in the notebook computer receives and stores the power consumption parameter corresponding to the second usage scenario, the scheduling engine included in the notebook computer may send a notification of switching the scenario to the thread 2 included in the notebook computer. The scene switching notification may be used to instruct the notebook computer to switch from the first usage scene to the second usage scene. I.e. a scene change notification, may be used to instruct the notebook computer to change from a low load usage scene to a high load usage scene.
S605, the thread 2 included in the notebook computer receives the switching scene notification.
S606, a thread 2 included in the notebook computer sends a first power consumption parameter request to a scheduling engine included in the notebook computer.
After the thread 2 included in the notebook computer receives the scene switching notification sent by the scheduling engine included in the notebook computer, the thread 2 included in the notebook computer can send a first power consumption parameter request to the scheduling engine included in the notebook computer. The first power consumption parameter request may be used to instruct a scheduling engine included in the notebook computer to send a power consumption parameter corresponding to the second usage scenario, that is, a value of PL1 of the CPU corresponding to the high load usage scenario, to a thread 2 included in the notebook computer.
S607, a scheduling engine included in the notebook computer receives the first power consumption parameter request.
S608, a dispatching engine included in the notebook computer sends a first power consumption parameter response to a thread 2 included in the notebook computer.
After the scheduling engine included in the notebook computer receives the first power consumption parameter request sent by the thread 2 included in the notebook computer, the scheduling engine included in the notebook computer may send a first power consumption parameter response to the thread 2 included in the notebook computer.
In some examples, the first power consumption parameter response may include a power consumption parameter corresponding to the second usage scenario, i.e., a value of PL1 of the CPU corresponding to the high load usage scenario. The first power consumption parameter response in this embodiment of the present application may also be referred to as policy 1.
In other examples, the first power consumption parameter response may also be null, that is, the first power consumption parameter response does not include the power consumption parameter corresponding to the second usage scenario.
S609, determining whether the first power consumption parameter response comprises a power consumption parameter corresponding to the second use scene by the thread 2 included in the notebook computer.
After the thread 2 included in the notebook computer receives the first power consumption parameter response sent by the scheduling engine included in the notebook computer, the thread 2 included in the notebook computer can determine whether the first power consumption parameter response includes the power consumption parameter corresponding to the second use scenario.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario is not included in the first power consumption parameter response (i.e., the value of PL1 of the CPU corresponding to the high load usage scenario), the notebook computer may continue to send the first power consumption parameter request to the scheduling engine included in the notebook computer after the first preset duration, that is, the thread 2 included in the notebook computer may continue to acquire the policy 1 from the scheduling engine, that is, may continue to execute S610 described below.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario is included in the first power consumption parameter response (i.e., the value of PL1 of the CPU corresponding to the high load usage scenario), the thread 2 included in the notebook computer may set the power consumption parameter of the CPU to a preset power consumption parameter (e.g., the maximum value of the power consumption parameter of the CPU), and wait for a second preset period of time, that is, may continue to execute S611 described below.
S610, after a first preset time period, a thread 2 included in the notebook computer sends a first power consumption parameter request to a scheduling engine included in the notebook computer.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario is not included in the first power consumption parameter response (that is, the value of PL1 of the CPU corresponding to the high load usage scenario), the notebook computer may continue to send the first power consumption parameter request to the scheduling engine included in the notebook computer after the first preset duration, that is, the thread 2 included in the notebook computer may continue to acquire the policy 1 from the scheduling engine.
The specific duration of the first preset duration (the first preset duration may also be referred to as the second duration in the embodiment of the present application) may be set according to actual situations, and the specific duration of the first preset duration is not limited in the embodiment of the present application. For example, the first preset duration may be 1 second.
After the first preset duration, the thread 2 included in the notebook computer sends a first power consumption parameter request to the scheduling engine included in the notebook computer, and the scheduling engine included in the notebook computer can continue to send a first power consumption parameter response to the thread 2 included in the notebook computer. After the thread 2 included in the notebook computer receives the first power consumption parameter response sent to the scheduling engine included in the notebook computer, the thread 2 included in the notebook computer can continuously determine whether the first power consumption parameter response includes the power consumption parameter corresponding to the second usage scenario, that is, determine whether the first power consumption parameter response includes the power consumption parameter corresponding to the high-load usage scenario.
In some examples, after the first preset duration, the thread 2 included in the notebook computer sends a first power consumption parameter request to a scheduling engine included in the notebook computer, and may be that when the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario (that is, the value of PL1 of the CPU corresponding to the high load usage scenario) is not included in the first power consumption parameter response, the notebook computer starts a first timer, where the duration corresponding to the first timer is the first preset duration. When the duration corresponding to the first timer arrives (i.e., the first preset duration arrives), the thread 2 included in the notebook computer may send a first power consumption parameter request to a scheduling engine included in the notebook computer.
S611, setting the power consumption parameter of the CPU as a preset power consumption parameter by a thread 2 included in the notebook computer, and waiting for a second preset time period.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario is included in the first power consumption parameter response (i.e., the value of PL1 of the CPU corresponding to the high load usage scenario), the thread 2 included in the notebook computer may set the power consumption parameter of the CPU to a preset power consumption parameter (e.g., a maximum value of the power consumption parameters of the CPU), and wait for a second preset duration. That is, the thread 2 included in the notebook computer may adjust the power consumption parameter of the CPU from the power consumption parameter corresponding to the first usage scenario (in this embodiment, the power consumption parameter corresponding to the first usage scenario may also be referred to as the first power consumption parameter) to a preset power consumption parameter, and wait for a second preset duration (in this embodiment, the second preset duration may also be referred to as the first duration).
The specific duration of the second preset duration may be set according to practical situations, and in this embodiment of the present application, the specific duration of the second preset duration is not limited. For example, the second preset duration may be 2 seconds.
In some examples, the specific duration of the second preset duration may also be a duration in which the setting of the power consumption parameter of the CPU to the preset power consumption parameter is successful according to the thread 2 included in the notebook computer, i.e., the power consumption parameter of the CPU is set to the preset power consumption parameter to be effective. Therefore, the power consumption parameter of the CPU can be ensured to be set to be effective within the second preset time period.
In other examples, the specific duration of the second preset duration may also be determined according to the first usage scenario. For example, the specific duration of the second preset duration may be determined according to the power consumption parameter of the CPU of the first usage scenario, where the specific duration of the second preset duration may be relatively shorter when the power consumption parameter of the CPU of the first usage scenario is larger, and where the power consumption parameter of the CPU of the first usage scenario is smaller, the specific duration of the second preset duration may be relatively longer, so that it may be ensured that the power consumption parameter of the CPU can be switched from the power consumption parameter corresponding to the first usage scenario to the preset power consumption parameter within the relatively longer second preset duration.
In some examples, the preset power consumption parameter may be a maximum value of the power consumption parameter of the CPU, i.e., when the power consumption parameter of the CPU is a value of PL1 of the CPU, the preset power consumption parameter may be a maximum value of the value of PL1 of the CPU, such as 35W.
The preset power consumption parameter may also be a larger power consumption parameter of the power consumption parameters of the CPU, that is, the value of the preset power consumption parameter may be larger than the power consumption parameter corresponding to the first usage scenario and the power consumption parameter corresponding to the second usage scenario. For example, when the power consumption parameter of the CPU is the value of PL1 of the CPU, the value of PL1 of the CPU corresponding to the first usage scenario is 7W, the value of PL1 of the CPU corresponding to the second usage scenario is 11W, and the preset power consumption parameter may be the value of PL1 of the CPU greater than 7W and greater than 11W.
In some examples, the thread 2 included in the notebook computer sets the power consumption parameter of the CPU to a preset power consumption parameter, and waits for a second preset duration, and when the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the second usage scenario is included in the first power consumption parameter response, the notebook computer may start a second timer, where the duration corresponding to the second timer is the second preset duration. While starting the second timer, the thread 2 included in the notebook computer may set the power consumption parameter of the CPU to a preset power consumption parameter.
When the duration corresponding to the second timer arrives (i.e. the second preset duration arrives), the thread 2 included in the notebook computer sends the power consumption parameter corresponding to the second use scene to the thread 3 included in the notebook computer. Therefore, the thread 3 included in the notebook computer can adjust the power consumption parameter of the CPU from the preset power consumption parameter to the power consumption parameter corresponding to the second use scene.
In some examples, the thread 2 included in the notebook computer sets the power consumption parameter of the CPU to a preset power consumption parameter, which may be that the thread 2 included in the notebook computer may send the preset power consumption parameter to a corresponding driver (such as a power management driver) included in the notebook computer, for example, the thread 2 included in the notebook computer may send the preset power consumption parameter to a relevant driver (such as a power management driver) included in the notebook computer through a scheduling engine and a scheduling. After the relevant driver receives the preset power consumption parameter, the relevant driver can adjust the power consumption parameter of the CPU corresponding to the first use scene to the preset power consumption parameter.
S612, the thread 2 included in the notebook computer sends a second power consumption parameter request to a dispatching engine included in the notebook computer.
After the thread 2 included in the notebook computer sets the power consumption parameter of the CPU to a preset power consumption parameter and waits for a second preset time period, the thread 2 included in the notebook computer may send a second power consumption parameter request to the scheduling engine included in the notebook computer. The second power consumption parameter request may be used to instruct a scheduling engine included in the notebook computer to send a power consumption parameter corresponding to the third usage scenario (in the embodiment of the present application, the power consumption parameter corresponding to the third usage scenario may also be referred to as a third power consumption parameter) to a thread 2 included in the notebook computer, that is, a value of PL1 of the CPU corresponding to the third usage scenario.
S613, a scheduling engine included in the notebook computer receives a second power consumption parameter request.
S614, the dispatching engine of the notebook computer sends a second power consumption parameter response to the thread 2 of the notebook computer.
After the scheduling engine included in the notebook computer receives the second power consumption parameter request sent by the thread 2 included in the notebook computer, the scheduling engine included in the notebook computer may send a second power consumption parameter response to the thread 2 included in the notebook computer.
In some examples, the second power consumption parameter response may include a power consumption parameter corresponding to the third usage scenario, i.e., a value of PL1 of the CPU corresponding to the third usage scenario. The second power consumption parameter response in this embodiment of the present application may also be referred to as policy 2.
In other examples, the second power consumption parameter response may also be null, that is, the second power consumption parameter response does not include the power consumption parameter corresponding to the third usage scenario.
The third usage scenario may be the same as the second usage scenario Jing Xiangtong, and the third usage scenario may also be the same as the second usage scenario, which is not limited in this embodiment of the present application. That is, the power consumption parameter corresponding to the third use scenario may be the same as the power consumption parameter corresponding to the second use scenario, or may be different from the power consumption parameter corresponding to the second use scenario.
S615, determining whether the second power consumption parameter response comprises a power consumption parameter corresponding to the third use scene by the thread 2 included in the notebook computer.
After the thread 2 included in the notebook computer receives the second power consumption parameter response sent by the scheduling engine included in the notebook computer, the thread 2 included in the notebook computer can determine whether the second power consumption parameter response includes the power consumption parameter corresponding to the third use scenario.
When the thread 2 included in the notebook computer determines that the second power consumption parameter response does not include the power consumption parameter corresponding to the third usage scenario, the thread 2 included in the notebook computer may send the power consumption parameter corresponding to the second usage scenario to the thread 3 included in the notebook computer after the second preset duration arrives, and then S617 described below may be continuously executed.
When the thread 2 included in the notebook computer determines that the first power consumption parameter response includes the power consumption parameter corresponding to the third use scenario, the thread 2 included in the notebook computer may continuously determine whether the power consumption parameter corresponding to the third use scenario is the same as the power consumption parameter corresponding to the second use scenario.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the third usage scenario is the same as the power consumption parameter corresponding to the second usage scenario, that is, the notebook computer is frequently switched to the second usage scenario within the second preset duration, the thread 2 included in the notebook computer may keep the power consumption parameter of the CPU as the preset power consumption parameter, that is, the following S616 may be continuously executed.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the third use scenario is different from the power consumption parameter corresponding to the second use scenario, that is, the notebook computer switches to other use scenarios (such as other high-load use scenarios) within the second preset time period, the thread 2 included in the notebook computer can keep the power consumption parameter of the CPU as the preset power consumption parameter, and wait for the second preset time period again. S616, when the power consumption parameter corresponding to the third use scenario is the same as the power consumption parameter corresponding to the second use scenario, the thread 2 included in the notebook computer keeps the power consumption parameter of the CPU as a preset power consumption parameter.
When the thread 2 included in the notebook computer determines that the power consumption parameter corresponding to the third use scenario is the same as the power consumption parameter corresponding to the second use scenario, that is, the notebook computer is frequently switched to the second use scenario within the second preset duration, the thread 2 included in the notebook computer can keep the power consumption parameter of the CPU as the preset power consumption parameter
In some examples, in a case where the power consumption parameter corresponding to the third usage scenario is the same as the power consumption parameter corresponding to the second usage scenario, the thread 2 included in the notebook computer may maintain the power consumption parameter of the CPU as the preset power consumption parameter, and wait for the second preset time period again.
S617, after a second preset time period, the thread 2 included in the notebook computer sends power consumption parameters corresponding to a second use scene to the thread 3 included in the notebook computer.
When the thread 2 included in the notebook computer determines that the second power consumption parameter response does not include the power consumption parameter corresponding to the third use scenario, the thread 2 included in the notebook computer may send the power consumption parameter corresponding to the second use scenario to the thread 3 included in the notebook computer after the second preset duration arrives.
In some examples, the thread 2 included in the notebook computer sends the power consumption parameter corresponding to the second usage scenario to the thread 3 included in the notebook computer, and may be that the thread 2 included in the notebook computer sends the power consumption parameter corresponding to the second usage scenario to the thread 3 included in the notebook computer by way of inter-process communication (inter process communication, IPC).
S618, the thread 3 included in the notebook computer receives the power consumption parameter corresponding to the second use scene, and sets the power consumption parameter of the CPU as the power consumption parameter corresponding to the second use scene.
After the thread 3 included in the notebook computer receives the power consumption parameter corresponding to the second use scenario sent by the thread 2 included in the notebook computer, the thread 3 included in the notebook computer can set the power consumption parameter of the CPU to the power consumption parameter corresponding to the second use scenario. That is, the thread 3 included in the notebook computer may set the power consumption parameter of the CPU to the power consumption parameter corresponding to the second usage scenario.
In some examples, the thread 3 included in the notebook computer sets the power consumption parameter of the CPU to a preset power consumption parameter, which may be that the thread 3 included in the notebook computer may send the power consumption parameter corresponding to the second usage scenario to a corresponding driver (such as a power management driver) included in the notebook computer, for example, the thread 3 included in the notebook computer may send the power consumption parameter corresponding to the second usage scenario to a relevant driver (such as a power management driver) included in the notebook computer through a scheduling engine and a scheduling. After the relevant driver receives the power consumption parameter corresponding to the second use scenario, the relevant driver can adjust the preset power consumption parameter of the CPU to the power consumption parameter corresponding to the second use scenario.
By adopting the scheme, when the notebook computer determines that the use scene is switched from the first use scene (namely the low-load use scene) to the second use scene (namely the high-load use scene), the notebook computer can adjust the power consumption of the CPU from the power consumption corresponding to the low-load use scene to the maximum value of the power consumption parameter of the CPU, and adjust the power consumption parameter of the CPU from the maximum value of the power consumption parameter of the CPU to the power consumption parameter corresponding to the second use scene after the second preset time period. Within the second preset duration, the fact that the power consumption of the CPU is adjusted from the power consumption parameter corresponding to the first use scene to the maximum value of the power consumption parameter of the CPU takes effect can be ensured, namely that the fact that the power consumption parameter of the CPU is adjusted to the maximum value of the power consumption parameter of the CPU is successful can be ensured. Therefore, when the power consumption parameter of the CPU is adjusted to be the maximum value of the power consumption parameter of the CPU and is not effective, but the power consumption parameter of the CPU is adjusted to be the power consumption parameter corresponding to the second use scene is effective, the phenomenon that the CPU has not enough high power consumption support and is blocked when the notebook computer is switched from the first use scene to the second use scene can be avoided.
Meanwhile, when the use scene of the notebook computer is switched from a first use scene (namely a low-load use scene) to a second use scene (namely a high-load use scene), the notebook computer directly issues the maximum value of the power consumption parameter of the CPU to the relevant drive of the notebook computer, and the relevant drive can adjust the power consumption parameter of the CPU to the maximum value of the power consumption parameter according to the maximum value of the power consumption parameter of the CPU. Therefore, the phenomenon that the CPU has not enough high power consumption support and is blocked when the notebook computer is switched from the first use scene to the second use scene due to the fact that the maximum value of the power consumption parameters of the CPU takes effect slowly can be avoided.
In addition, when the usage scenario of the notebook computer is switched from the first usage scenario (i.e., low-load usage scenario) to the second usage scenario (i.e., high-load usage scenario), the notebook computer executes the issuing and validating process of the power consumption parameters corresponding to the second usage scenario through different threads (i.e., thread 2 and thread 3) respectively. The issuing and validating process of the power consumption parameter corresponding to the second use scene can be executed asynchronously, so that the phenomenon of blocking caused by switching of the use scene due to the blocking problem is avoided. That is, since the issuing and validating process of the power consumption corresponding to the second usage scenario can be executed asynchronously, the situation that the policy of the last usage scenario is not validated, the policy of the new usage scenario is issued, and the new policy is validated in the switching of the usage scenario, which results in a delayed time, and the phenomenon of jamming occurs in the notebook computer.
For easy understanding, the power consumption control method provided in the embodiment of the present application is described below with reference to fig. 7. As shown in fig. 7, the power consumption control method may include the following S701-S703.
S701, when the usage scenario of the electronic device is the first usage scenario, adjusting a power consumption parameter of a central processing unit CPU of the electronic device to a first power consumption parameter.
The first power consumption parameter is a power consumption parameter of the CPU corresponding to the first use scene. The first usage scenario may be a low-load usage scenario of the electronic device. I.e. the first power consumption parameter may be a lower power consumption parameter.
S702, when the use scene of the electronic equipment is switched from the first use scene to the second use scene, the power consumption parameter of the CPU of the electronic equipment is adjusted from the first power consumption parameter to a preset power consumption parameter.
The second power consumption parameter is the power consumption parameter of the CPU corresponding to the second use scene. The second usage scenario may be a high-load usage scenario of the electronic device. The second power consumption parameter may be a higher power consumption parameter, i.e. the value of the first power consumption parameter is smaller than the value of the second power consumption parameter.
The preset power consumption parameter may be a maximum value of power consumption parameters of a CPU of the electronic device. I.e. the preset power consumption parameter may be larger than the first power consumption parameter and the second power consumption parameter.
In some examples, the first power consumption parameter may be a value of a CPU power limit PL1 corresponding to the first usage scenario, the second power consumption parameter may be a value of a CPU power limit PL1 corresponding to the second usage scenario, and the preset power consumption parameter may be a maximum value of the CPU power limit PL1 of the electronic device.
In some examples, an electronic device may include a first thread, a second thread, and a scheduling engine. Under the condition that the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, the adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter may include: in the event that the first thread determines that the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, the first thread may determine a second power consumption parameter. Thereafter, the first thread may send a second power consumption parameter to the scheduling engine. Then, the scheduling engine can receive the second power consumption parameter and send a scene switching notification to the second thread; the scene-switch notification is to instruct the electronic device to switch the usage scene from the first usage scene to the second usage scene. Thereafter, the second thread may receive the scene change notification and send a first power consumption parameter request to the scheduling engine. Thereafter, the scheduling engine may receive the first power consumption parameter request and send a first power consumption parameter response to the second thread. The second thread may then receive the first power consumption parameter response and adjust the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter if the first power consumption parameter response includes the second power consumption parameter.
In some examples, the adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter may include: the second thread sends preset power consumption parameters to a power consumption parameter adjustment driver of the electronic equipment. Then, the power consumption parameter adjustment driver may receive a preset power consumption parameter, and adjust the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter.
In some examples, the second thread resends the first power consumption parameter request to the scheduling engine after a second duration of time, in the event that the first power consumption parameter response includes no said second power consumption parameter. Thereafter, the scheduling engine may receive the new first power consumption parameter request and send a new first power consumption parameter response to the second thread. The second thread may then receive a new first power consumption parameter response and adjust the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter if the new first power consumption parameter response includes the second power consumption parameter.
Specifically, in the embodiment of the present application, when the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, the specific implementation manner of adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter may refer to the specific implementation manner in S601-S611, which is not repeated in the embodiment of the present application.
S703, after the first time, adjusting the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to a second power consumption parameter.
In some examples, the electronic device may further include a third thread, and after the first period, adjusting the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to the second power consumption parameter may include: after the first duration, the second thread sends a second power consumption parameter to the third thread. And then, the third thread can receive the second power consumption parameter and adjust the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to the second power consumption parameter.
In some examples, before the second thread sends the second power consumption parameter to the third thread, the power consumption control method may further include, for a first time period: the second thread sends a second power consumption parameter request to the scheduling engine. Thereafter, the scheduling engine may receive the second power consumption parameter request and send a second power consumption parameter response to the second thread. The second thread may then receive the second power consumption parameter response and send the second power consumption parameter to the third thread if the second power consumption parameter response does not include the third power consumption parameter.
The third power consumption parameter may be the same as the second power consumption parameter or may be different from the second power consumption parameter. This is not limiting in the embodiments of the present application.
In the case that the second power consumption parameter response includes a third power consumption parameter, and the third power consumption parameter is the same as the second power consumption parameter, the second thread may maintain the power consumption parameter of the CPU of the electronic device as a preset power consumption parameter.
When the second power consumption parameter response includes the third power consumption parameter, and the third power consumption parameter is different from the second power consumption parameter, that is, the electronic device is switched to a new use scenario, the second thread may keep the power consumption parameter of the CPU of the electronic device as the preset power consumption parameter, and wait for the first duration again, that is, after the first duration, send the third power consumption parameter to the third thread.
Specifically, in the embodiment of the present application, after the first period, the specific implementation manner of adjusting the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to the second power consumption parameter may refer to the specific implementation manner in S612 to S618, which is not described in detail in the embodiment of the present application.
According to the scheme, when the use scene of the electronic device is switched from a first use scene (namely a low-load use scene) to a second use scene (namely a high-load use scene), the electronic device can adjust the power consumption of the CPU from the power consumption corresponding to the low-load use scene to the maximum value of the power consumption parameter of the CPU (namely a preset power consumption parameter), and adjust the power consumption parameter of the CPU from the preset power consumption parameter to the power consumption parameter corresponding to the second use scene after a first time period. And in the first duration, the power consumption of the CPU can be ensured to be adjusted to be effective by the preset power consumption parameter according to the power consumption parameter corresponding to the first use scene. Therefore, when the power consumption parameter of the CPU is adjusted to be the preset power consumption parameter and is not effective, but the power consumption parameter of the CPU is adjusted to be the power consumption parameter corresponding to the second use scene is effective, the phenomenon that the CPU has not enough high power consumption support and is blocked when the electronic equipment is switched from the first use scene to the second use scene can be avoided.
In addition, according to the scheme, when the use scene of the electronic device is switched from the first use scene (namely the low-load use scene) to the second use scene (namely the high-load use scene), the electronic device can directly send the maximum value of the power consumption parameters of the CPU (namely the preset power consumption parameters) to the power consumption parameter adjustment drive of the electronic device, and the power consumption parameter adjustment drive can adjust the power consumption parameters of the CPU to the maximum value of the power consumption parameters. Therefore, the phenomenon that the CPU has not enough high power consumption support and is blocked when the electronic equipment is switched from the first use scene to the second use scene due to the fact that the maximum value of the power consumption parameters of the CPU takes effect slowly can be avoided.
In addition, according to the scheme, when the use scene of the electronic device is switched from the first use scene (namely the low-load use scene) to the second use scene (namely the high-load use scene), the electronic device can respectively execute the issuing and validating processes of the power consumption parameters corresponding to the second use scene through different threads (namely the second thread and the third thread). The issuing and validating process of the power consumption parameter corresponding to the second use scene can be executed asynchronously, so that the phenomenon of blocking caused by switching of the use scene due to the blocking problem is avoided.
Corresponding to the method in the foregoing embodiment, the embodiment of the present application further provides a power consumption processing device. The power consumption processing apparatus may be applied to an electronic device for implementing the method in the foregoing embodiment. The functions of the power consumption processing device can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above.
For example, fig. 8 shows a schematic structural diagram of a power consumption processing apparatus 800, and as shown in fig. 8, the power consumption processing apparatus 800 may include: an adjustment module 801, etc.
The adjustment module 801 may be configured to adjust a power consumption parameter of a central processing unit CPU of the electronic device to a first power consumption parameter when a usage scenario of the electronic device is a first usage scenario; the first power consumption parameter is a power consumption parameter of the CPU corresponding to the first use scene.
The adjustment module 801 is further configured to adjust a power consumption parameter of a CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter when the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario; the preset power consumption parameter is larger than the first power consumption parameter and the second power consumption parameter, the second power consumption parameter is the power consumption parameter of the CPU corresponding to the second use scene, and the first power consumption parameter is smaller than the second power consumption parameter.
The adjusting module 801 may be further configured to adjust, after the first period of time, a power consumption parameter of a CPU of the electronic device from a preset power consumption parameter to a second power consumption parameter.
In another possible implementation manner, the power consumption processing apparatus 800 may further include a determining module 802, a transmitting module 803, and a receiving module 804.
The determining module 802 may be configured to determine the second power consumption parameter in a case where the first thread determines that the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario.
A sending module 803 may be used to send the second power consumption parameter to the scheduling engine.
The receiving module 804 may be configured to receive the second power consumption parameter.
The sending module 803 is further configured to send a scene switching notification to the second thread; the scene-switch notification is to instruct the electronic device to switch the usage scene from the first usage scene to the second usage scene.
The receiving module 804 may be further configured to receive a scene change notification.
The sending module 803 may be further configured to send a first power consumption parameter request to the scheduling engine.
The receiving module 804 may be further configured to receive a first power consumption parameter request.
The sending module 803 may be further configured to send the first power consumption parameter response to the second thread.
The receiving module 804 may be further configured to receive a first power consumption parameter response.
The adjusting module 801 may be further configured to adjust, when the first power consumption parameter response includes the second power consumption parameter, the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter.
In another possible implementation, the sending module 803 may be further configured to send the preset power consumption parameter to a power consumption parameter adjustment driver of the electronic device.
The receiving module 804 may be further configured to receive a preset power consumption parameter.
The adjustment module 801 may be further configured to adjust a power consumption parameter of a CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter.
In another possible implementation, the sending module 803 may be further configured to send the second power consumption parameter to the third thread after the first duration.
The receiving module 804 may be further configured to receive a second power consumption parameter.
The adjusting module 801 may be further configured to adjust a power consumption parameter of a CPU of the electronic device from a preset power consumption parameter to a second power consumption parameter.
In another possible implementation, the sending module 803 may be further configured to resend the first power consumption parameter request to the scheduling engine after the second duration in case the first power consumption parameter response includes no second power consumption parameter.
The receiving module 804 may be further configured to receive a new first power consumption parameter request and send a new first power consumption parameter response to the second thread.
The receiving module 804 may be further configured to receive a new first power consumption parameter response.
The adjusting module 801 may be further configured to adjust, when the new first power consumption parameter response includes the second power consumption parameter, the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter.
In another possible implementation, the sending module 803 may be further configured to send a second power consumption parameter request to the scheduling engine.
The receiving module 804 may be further configured to receive a second power consumption parameter request.
The sending module 803 may be further configured to send a second power consumption parameter response to the second thread.
The receiving module 804 may be further configured to receive a second power consumption parameter response.
The adjustment module 801 may be further configured to send the second power consumption parameter to the third thread if the second power consumption parameter response does not include the third power consumption parameter.
In another possible implementation, the preset power consumption parameter is a maximum value of power consumption parameters of a CPU of the electronic device.
In another possible implementation manner, the first power consumption parameter is a value of a CPU power limit PL1 corresponding to the first usage scenario, the second power consumption parameter is a value of a CPU power limit PL1 corresponding to the second usage scenario, and the preset power consumption parameter is a maximum value of the CPU power limit PL1 of the electronic device.
It should be understood that the division of units or modules (hereinafter referred to as units) in the above apparatus is merely a division of logic functions, and may be fully or partially integrated into one physical entity or may be physically separated. And the units in the device can be all realized in the form of software calls through the processing element; or can be realized in hardware; it is also possible that part of the units are implemented in the form of software, which is called by the processing element, and part of the units are implemented in the form of hardware.
For example, each unit may be a processing element that is set up separately, may be implemented as integrated in a certain chip of the apparatus, or may be stored in a memory in the form of a program, and the functions of the unit may be called and executed by a certain processing element of the apparatus. Furthermore, all or part of these units may be integrated together or may be implemented independently. The processing element described herein, which may also be referred to as a processor, may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each unit above may be implemented by an integrated logic circuit of hardware in a processor element or in the form of software called by a processing element.
In one example, the units in the above apparatus may be one or more integrated circuits configured to implement the above method, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of at least two of these integrated circuit forms.
For another example, when the units in the apparatus may be implemented in the form of a scheduler of processing elements, the processing elements may be general-purpose processors, such as CPUs or other processors that may invoke programs. For another example, the units may be integrated together and implemented in the form of a system on chip SOC.
In one implementation, the above means for implementing each corresponding step in the above method may be implemented in the form of a processing element scheduler. For example, the apparatus may comprise a processing element and a storage element, the processing element invoking a program stored in the storage element to perform the method described in the above method embodiments. The memory element may be a memory element on the same chip as the processing element, i.e. an on-chip memory element.
In another implementation, the program for performing the above method may be on a memory element on a different chip than the processing element, i.e. an off-chip memory element. At this point, the processing element invokes or displays a program on the on-chip storage element from the off-chip storage element to invoke and execute the method described in the method embodiments above.
For example, embodiments of the present application may also provide an apparatus, such as: an electronic device may include: a processor, a memory for storing instructions executable by the processor. The processor is configured to execute the above instructions, causing the electronic device to implement the power consumption control method as described in the previous embodiment. The memory may be located within the electronic device or may be located external to the electronic device. And the processor includes one or more.
In yet another implementation, the unit implementing each step in the above method may be configured as one or more processing elements, where the processing elements may be disposed on the electronic device corresponding to the above, and the processing elements may be integrated circuits, for example: one or more ASICs, or one or more DSPs, or one or more FPGAs, or a combination of these types of integrated circuits. These integrated circuits may be integrated together to form a chip.
For example, the embodiment of the application also provides a chip, and the chip can be applied to the electronic equipment. The chip includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a circuit; the processor receives and executes computer instructions from the memory of the electronic device through the interface circuit to implement the methods described in the method embodiments above.
Embodiments of the present application also provide a computer program product comprising computer instructions for operating an electronic device as described above.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the related art or all or part of the technical solution may be embodied in the form of a software product, for example: and (5) program. The software product is stored in a program product, such as a computer readable storage medium, comprising instructions for causing a device (which may be a single-chip microcomputer, chip or the like) or processor (processor) to perform all or part of the steps of the methods described in the various embodiments of the application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
For example, embodiments of the present application may also provide a computer-readable storage medium having computer program instructions stored thereon. The computer program instructions, when executed by an electronic device, cause the electronic device to implement the power consumption control method as described in the foregoing method embodiments.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A power consumption control method, applied to an electronic device, the electronic device including a first thread, a second thread, and a scheduling engine, the method comprising:
when the use scene of the electronic equipment is a first use scene, adjusting the power consumption parameter of a Central Processing Unit (CPU) of the electronic equipment into a first power consumption parameter; the first power consumption parameter is a power consumption parameter of the CPU corresponding to the first use scene;
under the condition that the use scene of the electronic equipment is switched from the first use scene to the second use scene, the power consumption parameter of the CPU of the electronic equipment is adjusted from the first power consumption parameter to a preset power consumption parameter; the preset power consumption parameter is larger than the first power consumption parameter and the second power consumption parameter, the second power consumption parameter is the power consumption parameter of the CPU corresponding to the second use scene, and the first power consumption parameter is smaller than the second power consumption parameter;
After a first duration, adjusting the power consumption parameter of the CPU of the electronic equipment from the preset power consumption parameter to the second power consumption parameter;
the adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to a preset power consumption parameter when the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario includes:
in the event that the first thread determines that the usage scenario of the electronic device is switched from the first usage scenario to the second usage scenario, the first thread determines the second power consumption parameter;
the first thread sends the second power consumption parameter to the scheduling engine;
the scheduling engine receives the second power consumption parameter and sends a scene switching notification to the second thread; the scene switching notification is used for indicating that the use scene of the electronic device is switched from the first use scene to the second use scene;
the second thread receives the scene switching notification and sends a first power consumption parameter request to the scheduling engine;
the scheduling engine receives the first power consumption parameter request and sends a first power consumption parameter response to the second thread;
The second thread receives the first power consumption parameter response, and adjusts the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter under the condition that the first power consumption parameter response comprises the second power consumption parameter.
2. The method of claim 1, wherein the adjusting the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter comprises:
the second thread sends the preset power consumption parameters to a power consumption parameter adjustment drive of the electronic equipment;
the power consumption parameter adjustment driver receives the preset power consumption parameter and adjusts the power consumption parameter of the CPU of the electronic equipment from the first power consumption parameter to the preset power consumption parameter.
3. The method of claim 1, wherein the electronic device further comprises a third thread, and wherein adjusting the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to the second power consumption parameter after the first time period comprises:
after the first duration, the second thread sends the second power consumption parameter to the third thread;
The third line Cheng Jieshou is configured to adjust the power consumption parameter of the CPU of the electronic device from the preset power consumption parameter to the second power consumption parameter.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
in the case that the first power consumption parameter response includes no second power consumption parameter, after a second duration, the second thread resends the first power consumption parameter request to the scheduling engine;
the scheduling engine receives the new first power consumption parameter request and sends a new first power consumption parameter response to the second thread;
the second thread receives the new first power consumption parameter response, and adjusts the power consumption parameter of the CPU of the electronic device from the first power consumption parameter to the preset power consumption parameter under the condition that the new first power consumption parameter response comprises the second power consumption parameter.
5. The method of claim 3, wherein prior to the second thread sending the second power consumption parameter to the third thread, the method further comprises, for the first duration:
the second thread sends a second power consumption parameter request to the scheduling engine;
The scheduling engine receives the second power consumption parameter request and sends a second power consumption parameter response to the second thread;
the second thread receives the second power consumption parameter response and sends the second power consumption parameter to the third thread if the second power consumption parameter response does not include a third power consumption parameter.
6. The method of claim 1, wherein the preset power consumption parameter is a maximum value of power consumption parameters of a CPU of the electronic device.
7. The method of claim 1, wherein the first power consumption parameter is a value of a CPU power limit PL1 corresponding to the first usage scenario, the second power consumption parameter is a value of a CPU power limit PL1 corresponding to the second usage scenario, and the preset power consumption parameter is a maximum value of the CPU power limit PL1 of the electronic device.
8. An electronic device comprising a processor, a memory for storing instructions executable by the processor; the processor is configured to, when executing the instructions, cause the electronic device to implement the method of any one of claims 1 to 7.
9. A computer readable storage medium having stored thereon computer program instructions; it is characterized in that the method comprises the steps of,
the computer program instructions, when executed by an electronic device, cause the electronic device to implement the method of any one of claims 1 to 7.
CN202311558614.7A 2023-11-22 2023-11-22 Power consumption control method and electronic equipment Active CN117270670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311558614.7A CN117270670B (en) 2023-11-22 2023-11-22 Power consumption control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311558614.7A CN117270670B (en) 2023-11-22 2023-11-22 Power consumption control method and electronic equipment

Publications (2)

Publication Number Publication Date
CN117270670A CN117270670A (en) 2023-12-22
CN117270670B true CN117270670B (en) 2024-04-12

Family

ID=89218139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311558614.7A Active CN117270670B (en) 2023-11-22 2023-11-22 Power consumption control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN117270670B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114924637A (en) * 2022-04-02 2022-08-19 联想(北京)有限公司 Control method and electronic equipment
CN116028210A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method, electronic equipment and storage medium
CN116028205A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114924637A (en) * 2022-04-02 2022-08-19 联想(北京)有限公司 Control method and electronic equipment
CN116028210A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method, electronic equipment and storage medium
CN116028205A (en) * 2022-05-16 2023-04-28 荣耀终端有限公司 Resource scheduling method and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
一种面向异构并行系统的最大功耗管理方法;王桂彬;杜静;唐滔;;软件学报(第10期);第2460-2472页 *

Also Published As

Publication number Publication date
CN117270670A (en) 2023-12-22

Similar Documents

Publication Publication Date Title
CN114443256B (en) Resource scheduling method and electronic equipment
KR101798369B1 (en) System and method for synchronous task dispatch in a portable device
CN111182614B (en) Method and device for establishing network connection and electronic equipment
WO2021052415A1 (en) Resource scheduling method and electronic device
WO2023279820A9 (en) Method for adjusting touch panel sampling rate, and electronic device
WO2022143077A1 (en) Photographing method, system, and electronic device
CN115016885B (en) Virtual machine garbage recycling operation method and electronic equipment
US11392474B2 (en) Electronic device for controlling interface between a plurality of integrated circuits and operation method thereof
CN116028205B (en) Resource scheduling method and electronic equipment
WO2022262434A1 (en) Power optimization method and electronic device
CN110413383B (en) Event processing method, device, terminal and storage medium
KR20180138351A (en) Apparatus and method for controlling power of cpu
CN117270670B (en) Power consumption control method and electronic equipment
CN117130454A (en) Power consumption adjustment method and electronic equipment
CN116028210B (en) Resource scheduling method, electronic equipment and storage medium
CN117112191A (en) Information processing method and electronic device
CN116027880B (en) Resource scheduling method and electronic equipment
CN116055443B (en) Method for identifying social scene, electronic equipment and computer readable storage medium
CN116028005B (en) Audio session acquisition method, device, equipment and storage medium
WO2024027544A1 (en) Memory management method and electronic device
WO2024041006A1 (en) Method for controlling frame rate of camera, and electronic device
WO2023116415A1 (en) Application program suppression method and electronic device
EP4113276A1 (en) Sound playback method and device
CN117130462A (en) Equipment control method and electronic equipment
CN117666753A (en) Processor frequency modulation method, device, chip system, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant