Power adjustment method and related device

By dynamically adjusting the maximum available power of the CPU, based on scenario requirements and performance feedback mechanisms, the problem of excessive power consumption in terminal devices has been solved, resulting in reduced power consumption, extended usage time, and improved user experience.

CN121934700APending Publication Date: 2026-04-28HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-10-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Terminal devices such as laptops may automatically shut down due to rapid power consumption when used without charging, affecting the user experience.

Method used

By dynamically adjusting the maximum available power of the CPU, based on scenario requirements and performance feedback mechanisms, it can sensitively detect insufficient performance supply, adjust the power in a timely manner to avoid excessive power consumption, and extend the device's usage time.

Benefits of technology

It effectively reduces the power consumption of terminal devices, extends usage time, avoids interface lag, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121934700A_ABST
    Figure CN121934700A_ABST
Patent Text Reader

Abstract

The invention provides a power adjustment method and a related device. By implementing the method, the electronic equipment can dynamically adjust the maximum available power of the CPU of the electronic equipment according to the scene where the electronic equipment is located in combination with a performance feedback mechanism, the power consumption of the electronic equipment is reduced as much as possible on the premise of ensuring the user experience, and the service life of the electronic equipment is effectively prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to power adjustment methods and related devices. Background Technology

[0002] With the development of technology, devices such as desktop computers and laptops have become indispensable items in people's lives, work, and entertainment. However, because these devices often need to process large amounts of data, they consume power particularly quickly. This is especially true for portable devices like laptops, which users may need to use in environments without charging facilities. If the device's power is consumed too quickly, it may automatically shut down due to depleted power during use, causing inconvenience to the user.

[0003] Therefore, how to reduce the power consumption of such terminal devices is an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this application is to provide a power adjustment method and related apparatus. By implementing this method, an electronic device can dynamically adjust the maximum power that its CPU can supply based on the scenario in which the electronic device operates, combined with a performance feedback mechanism. This minimizes the power consumption of the electronic device while ensuring a good user experience, effectively extending the device's operating time.

[0005] The aforementioned and other objectives will be achieved through the features described in the independent claims. Further implementations are illustrated in the dependent claims, the specification, and the drawings.

[0006] In a first aspect, this application provides a power adjustment method, which includes: determining that an electronic device operates at a first power with the maximum power supplied by the central processing unit (CPU) for a first duration and no negative feedback is detected; adjusting the maximum power supplied by the CPU to a second power, wherein the second power is less than the first power, and the absence of negative feedback includes: the number of messages written per second to a target message queue by multiple target threads respectively bound to multiple CPU cores of the electronic device is a first value.

[0007] In this method, when an electronic device is running in the same operating scenario, the electronic device can adjust the maximum power that the CPU can supply to adapt the performance provided by the electronic device to the current operating scenario based on the performance requirements of the operating scenario. For example, when the device is running at a first power for a first time and no negative feedback is detected, the maximum power that the CPU can supply is adjusted from the first power to the second power to avoid the electronic device's performance being excessive and causing additional power consumption. In this way, the power consumption of the electronic device can be effectively reduced and the usage time of the electronic device can be extended.

[0008] In this method, an electronic device can bind a thread / process to each of its CPU cores (or logical processors). These threads / processes act as producers, sending messages to the same message queue. Each CPU core is required to write a first numerical value of messages to this message queue. Furthermore, the electronic device can also construct a thread / process (which may not be bound to a CPU core) as a message receiver. This receiver can act as a consumer, counting the number of messages sent per second by each thread / process bound to a CPU core from the message queue. Understandably, by determining the number of messages written to the message queue by each CPU core, the electronic device can promptly determine whether its performance supply meets its needs. Alternatively, the electronic device can also detect insufficient performance supply through interface stuttering. However, determining the performance supply level by counting the number of messages written to the message queue by each CPU core allows for a more sensitive detection of insufficient performance in electronic devices. Specifically, if the number of messages written to the message queue by any CPU core within one second falls below a certain threshold, the electronic device's current performance is considered insufficient to meet performance requirements. While the electronic device can detect when one or more CPU cores write fewer messages to the message queue within one second than the threshold, it may not necessarily experience interface lag (i.e., the user may not perceive the insufficient performance supply). This allows the electronic device to detect performance insufficiency before the user perceives it and adjust its performance accordingly, effectively preventing interface lag during performance adjustments and minimizing disruption to the user experience.

[0009] Optionally, the first value can be 20 or 30, and this application does not limit it.

[0010] Optionally, the first power is less than or equal to the maximum power that the electronic device can provide to the CPU.

[0011] Optionally, the first duration can be 3 seconds.

[0012] In conjunction with the first aspect, in one possible implementation, the electronic device is in a first scenario, the first scenario including a scenario where the electronic device detects an interaction event, the first power being the maximum power that the CPU can supply, and before the determination that the electronic device operates at the maximum power that the CPU can supply for a first duration reaches a first duration and no negative feedback is detected, the method further includes: detecting a first-level event, the first-level event being an interaction event between the user and the electronic device; and determining that the electronic device enters the first scenario when the interval between the start time of the first-level event and the start time of the second-level event is greater than a first threshold, and the start time of the first-level event and the start time of the third-level event are greater than a second threshold, the second-level event being the most recently detected interaction event between the user and the electronic device before the first-level event, and the third-level event being the event in which the maximum power that the CPU can supply is maintained at the maximum power.

[0013] In this embodiment, the first scenario can be referred to as a general level-one scenario, meaning that the electronic device can switch from other non-general level-one scenarios to the general level-one scenario. Correspondingly, the first and second events can also be referred to as general level-one events, and the third event can be referred to as an emergency level-one event. Both general level-one events and emergency level-one events have time limits, where the time limit of a general level-one event corresponds to the first threshold, and the time limit of an emergency level-one event corresponds to the second threshold. Before the time limit of an emergency level-one event ends, the electronic device is in the emergency level-one scenario. When the electronic device detects a general level-one event after the time limit of an emergency level-one event ends, it indicates that the electronic device has entered the general level-one scenario. Furthermore, in a general level-one scenario, if the electronic device also detects another general level-one event before the time limit of one general level-one event ends, the time limit of the general level-one scenario can be extended; otherwise, the general level-one scenario ends.

[0014] Optionally, the electronic device can detect a general level 1 event (i.e., the first level 1 event) after the last emergency level 1 event detected in an emergency level 1 scenario (i.e., the end of the aforementioned third level 1 event), at which point the electronic device can determine whether to enter the aforementioned first scenario. Alternatively, the electronic device can enter a level 2 scenario after the last general level 1 event detected in another general level 1 scenario (i.e., the end of the aforementioned second level 1 event), and determine whether to enter the aforementioned first scenario when the first level 1 event is detected in that level 2 scenario.

[0015] Optionally, the third-level event can be any one of the following: CPU / GPU high load event, screen lag event of electronic device, or application switching event of electronic device.

[0016] When switching from a non-standard Level 1 scenario to a standard Level 1 scenario, the electronic device adjusts the CPU's maximum power supply to the maximum. Upon entering the first scenario, based on the higher performance demands of the standard Level 1 scenario, the electronic device can adjust the CPU's maximum power supply to the maximum. However, operating the CPU at the maximum power level in the standard Level 1 scenario may still result in performance overkill. Therefore, before the end of the first scenario, if no negative feedback is received, the electronic device can lower the CPU's maximum power supply level (not exceeding a preset lower limit) after each first duration to reduce power consumption. Conversely, once negative feedback is received, the electronic device can adaptively raise the CPU's maximum power supply level (not exceeding the upper limit) to avoid noticeable interface stuttering during subsequent operation, which could negatively impact the user experience.

[0017] Optionally, the first threshold is equal to the second threshold, and both the first and second thresholds can be 5s.

[0018] In conjunction with the first aspect, in one possible implementation, in the first scenario described above, the electronic device operates at a third power, which is less than or equal to the maximum power supplied by the CPU. The method further includes: if the operation at the third power, which is the maximum power supplied by the CPU, does not reach the first duration and negative feedback is detected, adjusting the maximum power supplied by the CPU to a fourth power, which is greater than the third power and less than or equal to the maximum power. The detection of negative feedback includes: the number of messages written per second to the target message queue by any one of the multiple target threads that are respectively bound to the multiple CPU cores of the electronic device is less than the first value.

[0019] In this embodiment, if the first duration is not reached when the third power is used and negative feedback is detected, the electronic device can determine that the performance provided by the CPU may be insufficient when the third power is used when the CPU is running at its maximum available power in the first scenario. In order to ensure user experience, the electronic device can adaptively increase the available power of the CPU, that is, adjust it to the fourth power.

[0020] Furthermore, since all CPU cores of an electronic device are bound to threads responsible for writing messages to the message queue, the electronic device can simultaneously monitor whether the performance of all CPU cores that supply the electronic device's performance is sufficient. When any CPU core writes fewer messages per second than the first value mentioned above, the electronic device can sensitively sense that the performance supply may be insufficient for the current operating scenario. Therefore, the electronic device can promptly increase the performance supply, effectively avoiding significant lag in the electronic device.

[0021] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum available power of the CPU to the fourth power, the method further includes: maintaining the maximum available power of the CPU at the third power for the duration of the first duration and without detecting negative feedback.

[0022] In this embodiment, when the first scenario is a general level 1 scenario, without detecting negative feedback, the electronic device can gradually reduce the maximum CPU power from high to low, starting from the maximum power. Until a certain power is reached and negative feedback is detected, the electronic device records this fourth power as the lower limit for adjusting the maximum CPU power in the first scenario and then increases the maximum CPU power. Since negative feedback occurs when the maximum CPU power is the fourth power during subsequent adjustments, the electronic device can determine that running at the fourth power or a lower power in the first scenario is highly likely to cause stuttering. Therefore, even if the electronic device subsequently lowers the maximum CPU power without detecting negative feedback, it will not lower it to the fourth power or a lower power. This further reduces the probability of stuttering in the general level 1 scenario scene_n1.

[0023] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum available power of the CPU to the fourth power, the method further includes: increasing the value of the number of negative feedbacks corresponding to the fourth power, where the number of negative feedbacks corresponding to the fourth power represents the total number of times the electronic device detects negative feedback during the total duration of operation at the fourth power in the first scenario; if the duration of operation at the third power with the maximum available power of the CPU reaches the first duration and no negative feedback is detected, determining whether to adjust the maximum available power of the CPU to the fourth power or maintain it at the third power based on the number of negative feedbacks corresponding to the fourth power; wherein, the larger the value of the number of negative feedbacks corresponding to the fourth power, the lower the probability of adjusting the maximum available power of the CPU to the second power.

[0024] In this embodiment, when the first scenario is a general level one scenario, if no negative feedback is detected, the electronic device can gradually reduce the maximum CPU power supply from high to low, starting from the maximum power. Until a certain power is reached and negative feedback is detected, the electronic device records this power as the lower limit for adjusting the maximum CPU power supply in the first scenario and then increases the maximum CPU power supply. However, although negative feedback occurred historically when the CPU's maximum power supply was at the fourth power level, considering that the electronic device may run for a long time in the first scenario, and that the negative feedback that occurred historically when running at the fourth power level may be accidental, subsequent operation at the fourth power level or a lower power value may not result in any stuttering. Therefore, during subsequent adjustments, the electronic device can, with a certain probability, ignore the negative feedback that occurred when running at the fourth power level in the past (i.e., cancel the setting of the fourth power level as the lower limit of the maximum power that the CPU can supply in the first scenario). If the negative feedback that occurred when running at the fourth power level is ignored when running at the third power level again for the first time, the electronic device can lower the level of the maximum power that the CPU can supply to the fourth power level. Conversely, if the negative feedback that occurred when running at the fourth power level is not ignored when running at the third power level again for the first time, the electronic device will not lower the level of the maximum power that the CPU can supply to the fourth power level, but will continue to run at the third power level, which is the maximum power that the CPU can supply.

[0025] Optionally, the electronic device can determine whether to ignore negative feedback that occurred in the past when running at the fourth power by the following method: First, set a reset threshold r1 (the reset threshold r1 is any real number greater than 0 and less than 0). Each time the maximum available power of the CPU needs to be reduced, generate a random number in the range of (0,1). If the generated random number is less than the preset reset threshold r1, ignore the negative feedback that occurred in the past when running at the fourth power. Otherwise, still set the fourth power as the lower limit of the adjustment of the maximum available power of the CPU in the first scenario.

[0026] In conjunction with the first aspect, in one possible implementation, adjusting the maximum available power of the CPU to the fourth power includes: adjusting the maximum available power of the CPU to the fourth power when the time interval between the start time of the negative feedback detected when the CPU is running at the third power and the start time of the first level event is greater than a third threshold.

[0027] In this embodiment, when operating at the third power in the first scenario and detecting negative feedback, the electronic device needs to determine whether the time interval between the current moment and the start time of the most recently detected first scenario, i.e., the start time of the first level event, is greater than the third threshold. This is because during the short period of time immediately following each switch from a non-level-one scenario to a level-one scenario (i.e., the duration of the third threshold), the performance requirements of the electronic device may be significantly enhanced. Therefore, the electronic device can easily detect negative feedback during this short period of time immediately following the start of a level-one event in a normal level-one scenario. This negative feedback is uncontrollable and therefore has no reference value. Therefore, in order to eliminate the interference of meaningless negative feedback, after each negative feedback is detected, if the electronic device determines whether the time interval between the current moment and the start moment of the most recently detected first-level event in a typical first-level scenario is less than or equal to the third threshold, then the electronic device ignores the detected negative feedback and does not adjust the maximum available power of the CPU. However, if the time interval between the current moment and the start moment of the first scenario is greater than the third threshold, the electronic device can determine that the negative feedback is not caused by the instantaneous high-performance demand of the electronic device when the first-level event occurs. In this case, the electronic device can determine that the current maximum available power of the CPU (i.e., the third power) cannot meet the performance requirements, and the electronic device can adjust the maximum available power of the CPU to the fourth power.

[0028] In conjunction with the first aspect, in one possible implementation, the method further includes: detecting a fourth level event after entering the first scene, determining that the electronic device has entered the second scene, and adjusting the maximum available power of the CPU to the maximum power, wherein the fourth level event is an event that requires maintaining the maximum available power of the CPU at the maximum power.

[0029] In this embodiment, the fourth level-one event can also be referred to as an emergency level-one event, and the second scenario can be referred to as an emergency level-one scenario. In any scenario, as long as an emergency level-one event occurs, the scenario in which the electronic device is located until the emergency level-one event ends is an emergency level-one scenario. Optionally, the third level-one event can be any one of the following: a CPU / GPU high load event, an event where the electronic device experiences screen lag, or an event where the electronic device switches the focus application.

[0030] After a Level 1 emergency occurs, due to the extremely high performance requirements of such an event, electronic devices can adjust the maximum available CPU power to the aforementioned maximum power to ensure a reduction in the probability of lag.

[0031] In conjunction with the first aspect, in one possible implementation, the method further includes: after entering the first scenario, if no sixth-level event is detected within a second time period after the detection of the fifth-level event, but a first-level event is detected, determining that the electronic device has entered a third scenario, and adjusting the maximum available CPU power to the fifth power; the sixth-level event is an interaction event between the user and the electronic device or an event requiring the maximum available CPU power to be maintained at the maximum power; the first-level events are events where the electronic device runs a focused application; wherein, when the total runtime of the electronic device in the third scenario is 0, the fifth power is the maximum power; when the total runtime of the electronic device in the third scenario is greater than 0 and less than the third time period, the sixth-level event is adjusted to the fifth power. The fifth power is the power value last used by the electronic device when it was in the third scenario. If the total runtime of the electronic device in the third scenario is greater than the third duration, the fifth power is the optimal power of the electronic device in the third scenario. The optimal power of the electronic device in the third scenario is determined by the minimum power that meets the first condition in the scenario data of the third scenario. The first condition is that the average negative feedback period is greater than the fourth duration. The scenario data of the third scenario includes the maximum available power of multiple CPUs and the average negative feedback period corresponding to the electronic device running at the maximum available power of the multiple CPUs in the third scenario. The average negative feedback period is the ratio of the total runtime of running at the maximum available power of the CPU to the number of negative feedbacks.

[0032] In this embodiment, the aforementioned fifth level-one event is the last level-one event detected in the first scenario. The end of this event indicates the end of the level-one event phase. If the electronic device does not subsequently detect any level-one event (i.e., the sixth level-one event), and the electronic device is currently running a focused application, it indicates that the operating scenario of the electronic device has switched from the first scenario to the second scenario. The third scenario can also be referred to as the second-level scenario.

[0033] In this application, when the electronic device enters any secondary scenario, it explores multiple maximum CPU power values. Specifically, within that secondary scenario, the electronic device sequentially adjusts the maximum CPU power to different values. During operation at each power value, the electronic device records the total runtime and the total number of negative feedback occurrences at each power value. When the runtime in the secondary scenario reaches a third duration, the electronic device determines the optimal power for that secondary scenario based on the negative feedback cycle corresponding to each power value (i.e., the ratio of the total runtime to the total number of negative feedback occurrences at each power level, representing the average duration of one negative feedback occurrence at that power level).

[0034] In this embodiment, the electronic device may be entering the second scene for the first time. At this point, the electronic device's runtime in the second scene is 0, so it can adjust the CPU's maximum available power to operate at maximum power, and then sequentially reduce the CPU's maximum available power in subsequent processes. Alternatively, if the electronic device is not entering the second scene for the first time, but its runtime in that scene has not yet reached the third duration, then the electronic device needs to start from the power last used in the second scene and continue exploring the power value. Or, if the electronic device's historical runtime in the second scene has already reached the third duration, and the scene data for the second scene already records the optimal power for that scene, then the electronic device can directly adjust the CPU's maximum available power to the optimal power for the second scene upon entering the second scene this time.

[0035] For a Level 2 scenario, the power value with the lowest power consumption among all power values ​​without affecting user experience is the optimal power for that Level 2 scenario. Specifically, whether a certain power value affects user experience can be determined by the average duration (i.e., average negative feedback cycle) of generating one negative feedback loop when operating at that power value in that Level 2 scenario. When the average duration of generating one negative feedback loop is less than a fourth threshold, it can be considered that that power level has a negative impact on user experience in that Level 2 scenario. Therefore, electronic devices can determine the minimum maximum CPU power supply with an average negative feedback cycle greater than the aforementioned fourth threshold as the optimal power for the Level 2 scenario.

[0036] Optionally, the third threshold is 600s and the fourth threshold is 300ms.

[0037] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum available CPU power to four power levels, the method further includes: in the third scenario, if the CPU operates at the fifth power level without reaching the first duration and negative feedback is detected, adjusting the maximum available CPU power to a sixth power level and increasing the value of the number of negative feedback events corresponding to the fifth power level; the sixth power level is greater than the fifth power level and less than or equal to the maximum power level, and the number of negative feedback events corresponding to the fifth power level represents the total number of times the electronic device detects negative feedback within the total duration of operation at the fifth power level in the third scenario.

[0038] Understandably, during the exploration of gear levels in a secondary scenario, if an electronic device detects negative feedback while operating at a certain gear level, but this negative feedback is somewhat accidental, it may indicate that the electronic device might experience stuttering when operating at that gear level in the aforementioned secondary scenario. However, if it occurs accidentally, the electronic device may not experience stuttering when operating at that gear level in the same secondary scenario subsequently. What is certain, however, is that the more times negative feedback is detected when operating at a certain gear level, the greater the probability of stuttering when operating at that gear level in the future.

[0039] Therefore, in this embodiment, when operating at the fifth power and experiencing negative feedback in the second scenario, the electronic device can increase the maximum available CPU power to the sixth power to reduce the probability of lag. Furthermore, the number of negative feedback events at the fifth power level is increased to reduce the probability of the electronic device subsequently reducing the maximum available CPU power back to the fifth power. This allows for a better balance between electronic device performance and power consumption during scenario power exploration, further enhancing the user experience.

[0040] Optionally, when operating at the fifth power and negative feedback occurs, the increment of the number of negative feedback events at the fifth power can be 1.

[0041] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum available CPU power to the fifth power, the method further includes: in the third scenario, if the CPU operates at the fifth power for the first duration without detecting negative feedback, and if the number of negative feedbacks corresponding to the fifth power is not zero, reducing the value of the number of negative feedbacks corresponding to the fifth power; and determining whether to adjust the maximum available CPU power to the seventh power or maintain it at the fifth power based on the number of negative feedbacks corresponding to the seventh power; wherein the seventh power is less than the fifth power, and the more negative feedbacks corresponding to the seventh power, the lower the probability of adjusting the maximum available CPU power to the seventh power.

[0042] Similarly, in this embodiment, when the electronic device operates at the fifth power in the second scenario and no negative feedback occurs, the electronic device can reduce the maximum power that the CPU can supply to the seventh power to reduce the power consumption of the electronic device and reduce the number of negative feedbacks at the fifth power, thereby increasing the probability that the electronic device will subsequently reduce the maximum power that the CPU can supply to the fifth power, further balancing the performance and power consumption of the electronic device and further improving the user experience.

[0043] Optionally, when operating at the fifth power and without negative feedback, the increment of the number of negative feedback events at the fifth power can be -0.2.

[0044] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum available CPU power to the eighth power, the method further includes: detecting a second or secondary event while running at the eighth power in the third scenario, determining that the scenario in which the electronic device is located has switched from the third scenario to the fourth scenario; saving the exploration progress of the third scenario as the eighth power, wherein the exploration progress is the maximum available CPU power used by the electronic device when it enters the corresponding running scenario next time; determining the exploration progress of the fourth scenario, and adjusting the maximum available CPU power of the electronic device to the power corresponding to the exploration progress of the fourth scenario.

[0045] Understandably, the operating environment of an electronic device may change constantly during its actual operation. Therefore, while operating at the eighth power level in a third-level scenario, the electronic device's environment may change from the third to the fourth scenario. Thus, in this embodiment, when the operating environment changes from the third to the fourth scenario, the electronic device can record its exploration progress (i.e., the eighth power) in the third-level scenario. This allows the electronic device to gradually reduce the maximum CPU power from the eighth power level when the environment changes back to the third scenario, and to collect the number of negative feedback events for each power level in the third scenario to refine the scenario data. Similarly, when the electronic device enters the fourth scenario, it will also gradually reduce the maximum CPU power from the fourth scenario's exploration progress (or the maximum power the CPU can supply if it's the first time entering the fourth scenario), and collect the number of negative feedback events for each power level in the fourth scenario to refine the scenario data.

[0046] In a second aspect, this application provides an electronic device comprising: one or more processors and a memory; the memory being coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, wherein the one or more processors invoke the computer instructions to cause the electronic device to perform the method of the first aspect or any possible implementation thereof.

[0047] Thirdly, this application provides a chip system applied to an electronic device, the chip system including one or more processors, wherein the processors are configured to invoke computer instructions to cause the electronic device to perform the methods as described in the first aspect or any possible implementation thereof.

[0048] Fourthly, this application provides a computer program product containing instructions that, when the computer program product is run on an electronic device, cause the electronic device to perform the method as described in the first aspect or any possible implementation thereof.

[0049] Fifthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in the first aspect or any possible implementation thereof. Attached Figure Description

[0050] Figure 1 A schematic diagram of a scenario architecture for a performance feedback mechanism provided in an embodiment of this application;

[0051] Figure 2 A user interface diagram of an electronic device operating in an emergency level 1 scenario is provided as an embodiment of this application;

[0052] Figure 3 User interface diagrams for a general first-level scenario and a second-level scenario of an electronic device provided in this application embodiment;

[0053] Figure 4 A logical diagram illustrating the adjustment of device performance under different operating scenarios, provided as an embodiment of this application;

[0054] Figure 5 A flowchart illustrating a power adjustment method provided in an embodiment of this application;

[0055] Figure 6 A schematic diagram illustrating a scenario switching operation, provided as an embodiment of this application;

[0056] Figure 7 This is a schematic diagram illustrating the process of adjusting the performance of an electronic device in a typical Class I scenario, as provided in an embodiment of this application.

[0057] Figure 8 This is a schematic diagram illustrating the process of adjusting the performance of an electronic device in a typical Class I scenario, as provided in an embodiment of this application.

[0058] Figure 9 A flowchart illustrating a power adjustment method provided in an embodiment of this application;

[0059] Figure 10 This is a schematic diagram illustrating the process of adjusting the performance of an electronic device in a secondary scenario, as provided in an embodiment of this application.

[0060] Figure 11 This is a schematic diagram of scene data provided in an embodiment of this application;

[0061] Figure 12This is a schematic diagram illustrating the division of a data range as provided in an embodiment of this application;

[0062] Figure 13 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0063] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0064] To facilitate understanding, the relevant terms involved in the embodiments of this application will be introduced below.

[0065] (1) Performance and power consumption of electronic devices

[0066] Performance refers to the properties and functions of a substance. For electronic devices such as computers and tablets, the most important evaluation indicator is the processing speed, that is, the number of instructions that the electronic device can execute per second, usually described as "millions of instructions per second". Understandably, the processing speed of an electronic device is further reflected in whether the device runs smoothly and whether there are any noticeable lags. Therefore, in this application, the performance of an electronic device can be evaluated based on the frequency of lag during its operation (i.e., the percentage of time during which the electronic device lags within a certain period). The lower the lag frequency, the better the performance of the electronic device, and vice versa.

[0067] Power consumption refers to the amount of energy consumed by an electronic device per unit of time. Specifically, for electronic devices, power consumption refers to the electrical energy consumed per unit of time, measured in watts (W). Even in standby mode, electronic devices still consume a certain amount of electrical energy (unless the power is cut off).

[0068] For electronic devices such as desktop computers and laptops, the CPU, as the core of the system's computation and control, has a closely related power consumption, specifically its maximum power supply (PowerLimit-1) and maximum operating frequency (MaxFrequency). It's important to note that "maximum power supply" and "maximum operating frequency" refer to the maximum values ​​that the CPU can provide, respectively. During operation, the CPU typically doesn't operate at these maximum values ​​continuously. Its actual power and frequency depend on the device's operating environment. The more applications running simultaneously, the higher the CPU's actual power and frequency will be, but they will not exceed the maximum values ​​corresponding to its maximum power supply and maximum operating frequency.

[0069] Taking the maximum CPU power supply as an example, when the maximum CPU power supply is set to 45W, the actual operating power of the CPU might be 20W in one operating scenario and reach the upper limit of 45W in another, but it will not exceed 45W. Furthermore, both the maximum CPU power supply and the maximum CPU operating frequency are adjustable, but there is an upper limit to this adjustment range. This upper limit is set at the factory and is related to the performance of hardware such as the CPU and CPU cooler. Again, using the maximum CPU power supply as an example, when the adjustable upper limit of the maximum CPU power supply of an electronic device is 45W, the electronic device can set the maximum CPU power supply to 45W, 40W, 30W, etc., but it cannot be set to 50W.

[0070] Furthermore, the maximum power supply and maximum operating frequency of a CPU also determine the performance ceiling of an electronic device to some extent. Taking the maximum power supply as an example, generally speaking, for microprocessors of the same series, the higher the maximum power supply, the higher the maximum operating speed the electronic device can support. In some scenarios, reducing the maximum power supply can reduce the power consumption of the electronic device by sacrificing performance. For example, in a certain operating scenario, the maximum power supply of the CPU is 45W, while the actual power supply is 25W. However, the difference between the actual power supply and the maximum power supply is still very large, meaning that the CPU is unlikely to reach the upper limit of 45W in the current scenario. Therefore, the maximum power supply does not limit the actual power supply. It's important to understand that when the actual power supply is 25W, the performance provided by the CPU is the maximum performance required for that operating scenario. If the actual power supply is adjusted to 15W, the performance provided by the CPU may not meet the maximum performance requirements of that operating scenario, but it can still provide sufficient performance to ensure that the user experience is not compromised. For example, suppose that when the actual power of the CPU is 25W, the response time of an electronic device to a certain instruction in this operating scenario is 50ms. When the actual power of the CPU is 15W, the response time of the electronic device to the same instruction in this operating scenario is extended to 100ms. Although the response speed of the electronic device to the instruction is indeed slower, the difference between 100ms and 50ms is difficult for the user to perceive.

[0071] Therefore, in some scenarios, if the actual power consumption of the CPU can be limited to a suitable range or value by adjusting the maximum available power supply, electronic devices can reduce power consumption at the expense of some performance without affecting the user experience. However, as explained above, performance and power consumption of electronic devices cannot be simultaneously optimized. Therefore, if too much performance is sacrificed, the electronic device will frequently lag, severely impairing the user experience. Thus, how to adjust the maximum available power supply of the CPU to a suitable value to minimize the power consumption of electronic devices while ensuring performance meets user needs is the key problem addressed in this application.

[0072] In this application, electronic devices can reduce power consumption without compromising user experience by adjusting the maximum available power of the CPU or the maximum operating frequency of the CPU. For ease of explanation, the adjustment of the maximum available power of the CPU will be used as an example in the following embodiments.

[0073] (2) Focused applications and background applications

[0074] For electronic devices like computers, users may open multiple applications simultaneously, and the screen may display multiple application interfaces (some may be minimized in the status bar). However, users typically only operate one application using the mouse and keyboard. Of course, even if the user doesn't operate the electronic device with a mouse or keyboard, one application interface (application window) will always be displayed on top of the screen. For example, while watching a video on an electronic device, the user may not interact with the device itself, but the application used to play the video will generally be displayed on top.

[0075] In this embodiment, the application that the user is operating with a mouse or keyboard, or the application whose interface is displayed on top of the screen, can be called a "focused application"; other applications opened on the electronic device besides the focus application can be called "background applications". It is understood that focus applications and background applications can be switched. For example, a user can click on the interface of a background application to bring it to the top of the screen, at which point the background application is switched to the focus application, and the original focus application becomes a background application.

[0076] (3) Performance feedback mechanism

[0077] To determine whether the performance currently provided by an electronic device meets the requirements, this application provides a performance feedback mechanism, details of which can be found in the attached document. Figure 1 .

[0078] First, the electronic device can bind a thread / process to each of its CPU cores (or logical processors). These threads / processes act as producers, sending messages to the same message queue, and each CPU core is required to write M messages to this message queue. In addition, the electronic device also needs to construct a thread / process (this thread / process does not necessarily need to be bound to a CPU core) as a message receiver. This message receiver can act as a consumer, counting the number of messages sent per second by each thread / process bound to a CPU core from the message queue. Understandably, if any CPU core writes fewer than M messages to the message queue in one second, it can be considered a negative feedback loop, indicating that the current performance of the electronic device is insufficient to meet performance requirements. Conversely, if all CPU cores consistently write M messages to the message queue in one second, it can be considered a positive feedback loop, indicating that the current performance of the electronic device meets performance requirements.

[0079] It should be noted that each CPU core in an electronic device is used to supply the device's performance. Therefore, if only a single thread / process is built that is not bound to a CPU core and is allowed to freely schedule CPU cores as message producers, even if the scheduled CPU core can write M messages per second, the electronic device still cannot determine whether other CPU cores can maintain the same performance. In other words, the electronic device can only confirm that the CPU core scheduled by the aforementioned thread / process has sufficient performance, but cannot determine whether the performance of other CPU cores is sufficient. Therefore, it is necessary to bind a thread / process as a consumer to each CPU core to simultaneously write messages to the aforementioned message queue.

[0080] Furthermore, the performance feedback mechanism provided in this application can promptly determine whether the performance supply of the electronic device meets the demand by measuring the number of messages written to the message queue by the CPU core. Alternatively, the electronic device can also perceive insufficient performance supply through interface stuttering. However, the performance feedback mechanism provided in this application can more sensitively detect insufficient performance supply. Specifically, if the number of messages written to the aforementioned message queue by any CPU core within one second is less than M, it can be considered that the current performance of the electronic device is insufficient to meet the performance requirements. When the number of messages written to the aforementioned message queue by one or more CPU cores within one second is less than M, the electronic device can detect this in a timely manner, but the electronic device may not necessarily experience interface stuttering (i.e., the user may not perceive the current insufficient performance supply). Using the performance feedback mechanism provided in this application, the electronic device can perceive insufficient performance supply before the user perceives it and adjust its performance in a timely manner to meet the performance requirements. This effectively avoids interface stuttering during performance adjustment and minimizes damage to the user experience.

[0081] (4) Level 1 scenario, Level 2 scenario

[0082] Level 1 scenarios include operating scenarios that place high demands on the performance of electronic devices. When an electronic device detects a Level 1 event, it is considered to have entered a Level 1 scenario.

[0083] Level 1 scenes can be divided into the following two categories:

[0084] 1. Emergency Level 1 Scenario

[0085] When an electronic device detects a Level 1 Emergency event, it is considered to have entered a Level 1 Emergency scenario. A Level 1 Emergency event can be an event that reflects extremely high performance demands on the electronic device, and may include, but is not limited to: 1) high CPU / GPU load events, such as the electronic device entering game mode; 2) screen stuttering events; 3) the electronic device switching the focus application.

[0086] 2. Typical Level 1 Scene

[0087] Level 1 events can include user interaction events with electronic devices. Examples include user actions such as clicking mouse buttons, scrolling the mouse wheel (but excluding moving the mouse cursor), and using keyboard shortcuts (shortcut keys can include the Ctrl key, Win key, Shift key, Alt key, Esc key, F1-F12 keys, Fn key, Enter key, PrtSc key, PgUp key, PgDn key, etc., and can also include other shortcut keys, as well as combinations of multiple shortcut keys).

[0088] Level 2 scenarios include operating scenarios with lower performance requirements for electronic devices. When an electronic device does not detect a Level 1 event, it is considered to have entered a Level 2 scenario. When an electronic device detects a Level 2 event, it is also considered to have entered a Level 2 scenario. A Level 2 event is an event where the electronic device is running a focused application even when a Level 1 event is not detected.

[0089] In a secondary scenario, the parameters reflecting the performance requirements of an electronic device in that current secondary scenario (hereinafter referred to as secondary scenario parameters) may include any one or more of the following: the focus application, the size of the focus application window, the memory usage of the focus application, whether video is being watched, the download speed, whether a camera is being used, whether audio is being played, the type of external device, whether a keyboard is being used, the device screen brightness, the device's available RAM, the integrated graphics card load rate, the discrete graphics card load rate, and the hard drive write speed.

[0090] Based on the above definitions, it is impossible for a primary scene and a secondary scene to occur simultaneously. Furthermore, in this application, a primary scene is not divided into multiple different primary scenes based on different scene parameters. That is, in this application, regardless of the type of emergency primary event, it is considered to be within the same emergency primary scene; similarly, regardless of the type of general primary event, it is considered to be within the same general primary scene. However, for secondary scenes, the electronic device can divide the secondary scene into multiple different secondary scenes based on the corresponding parameters. In some embodiments, when no primary event is detected, a change in any one or more of the secondary scene parameters indicates a switch from one secondary scene to another. In other embodiments, since parameters such as the size of the focused application window, the memory usage of the focused application, download speed, screen brightness, RAM, integrated graphics card load rate, discrete graphics card load rate, and hard disk write speed may frequently change during the operation of the electronic device, a switch from one secondary scene to another can only be considered when the change of any one or more parameters reaches a certain magnitude. In other words, when the secondary scene parameters of the electronic device change within a certain range, the electronic device can be considered to be in the same secondary scene.

[0091] Furthermore, in terms of performance requirements, the performance requirements of emergency level 1 scenarios are greater than those of general level 1 scenarios, while the performance requirements of general level 1 scenarios are greater than those of level 2 scenarios.

[0092] Therefore, in this application, since Level 1 scenarios place high performance requirements on electronic devices, when an electronic device first enters a Level 1 scenario (whether it's an emergency Level 1 scenario or a general Level 1 scenario), i.e., when a Level 1 event occurs, the electronic device can adjust the maximum available CPU power to a certain power value. The difference between this power value and the maximum available CPU power that the electronic device can provide is less than a threshold. Preferably, when the electronic device is in a Level 1 scenario, the electronic device can adjust the maximum available CPU power to the maximum available CPU power that the electronic device can provide.

[0093] Specifically, when an electronic device enters an emergency level 1 scenario, that is, when an emergency level 1 event occurs, the electronic device has extremely high performance requirements due to the emergency level 1 scenario. Therefore, before the emergency level 1 scenario ends, the electronic device can maintain the maximum CPU power supply at a high value, for example, at the maximum value of the maximum CPU power supply that the electronic device can provide, until the emergency level 1 scenario ends.

[0094] When an electronic device first enters a typical Level 1 scenario, it can adjust the maximum available CPU power to a relatively large value, such as the maximum value of the CPU power it can provide. Since the performance requirements of a typical Level 1 scenario are relatively lower, the device can strategically adjust the maximum available CPU power (generally increasing the maximum available CPU power when negative feedback is detected and decreasing it when positive feedback is detected) until the typical Level 1 scenario ends. The next time the device enters a typical Level 1 scenario, it will again adjust the maximum available CPU power to a relatively large value, such as the maximum value, and begin a new round of performance adjustments. In other words, each time a typical Level 1 scenario is entered, the device will adjust the maximum available CPU power to a relatively large value and strategically adjust it based on detected positive / negative feedback until the typical Level 1 scenario ends. Understandably, the end of a typical Level 1 scenario can be marked by the detection of an emergency Level 1 event by the electronic device, or by the end of a typical Level 1 event (in this application, a Level 1 event can be considered to last for N seconds. If no other typical Level 1 event is detected within N seconds after a typical Level 1 event occurs, or if another emergency Level 1 event is detected within N seconds after a typical Level 1 event occurs, then the typical Level 1 scenario is considered to have ended).

[0095] When an electronic device is in a secondary scenario, it can adjust the maximum available CPU power while balancing performance and power consumption. Unlike a typical primary scenario, in any secondary scenario, the device can record the scenario parameters and can enter and run in that scenario multiple times. When the total runtime in that secondary scenario reaches a certain threshold, the device can determine its optimal power level for that secondary scenario based on the CPU's maximum available power at each stage. Subsequently, if the device re-enters that secondary scenario, it can adjust the CPU's maximum available power to the optimal power level for that scenario. Until the scenario changes from that secondary scenario to another (e.g., a primary scenario or another secondary scenario), the device can maintain the CPU's maximum available power at the optimal power level for that secondary scenario until the secondary scenario ends.

[0096] The specific methods for adjusting the maximum power supply of the CPU in emergency level 1 scenarios, general level 1 scenarios, and level 2 scenarios can be found in the relevant descriptions in the subsequent embodiments, and will not be elaborated here.

[0097] (5) The maximum power level that the CPU can supply

[0098] In this application, the maximum power that the CPU of the electronic device can supply can be discretized into different levels.

[0099] As explained above, the maximum power that an electronic device's CPU can supply has an adjustable upper limit, which is determined at the time of manufacture. Here, we assume that this upper limit corresponds to a power value of PL1. max Therefore, based on this power value PL1 max Set the appropriate power level for the CPU's maximum available power. See the example in the table below for details:

[0100] Table 1

[0101]

[0102] As shown in Table 1, Pm corresponds to the maximum power level that the CPU can supply. Correspondingly, different percentages of Pm can be set to different power levels that the CPU can supply. Higher power levels correspond to higher power outputs; for example, level 9 corresponds to a higher maximum power output than level 8. To ensure the normal operation of electronic devices, the maximum power level that the CPU can supply is generally not adjustable to level 1, and can only be adjusted to level 2 at the lowest (for some specific low-performance scenarios). Table 1 is only an example; in actual implementations, power levels can be set in other ways, such as setting more or fewer power levels than those in Table 1.

[0103] (6) Optimal power

[0104] Different CPUs have different maximum power outputs to provide performance to electronic devices, and therefore consume different amounts of electrical energy.

[0105] In this application, for a given secondary scenario, the power value with the lowest power consumption among all power values ​​without affecting the user experience is considered the optimal power for that secondary scenario. Specifically, whether a certain power value affects the user experience can be determined based on the probability (or the average duration of a single negative feedback event) of the electronic device generating negative feedback when operating at that power value in that secondary scenario. When the probability of stuttering is greater than a certain threshold (e.g., 3%), or the average duration of a single negative feedback event is less than a certain threshold (e.g., 300s), it can be considered that the power setting negatively impacts the user experience in that secondary scenario.

[0106] In some implementations, the maximum power that the CPU can supply can be discretized into different power levels. Without affecting the user experience, the power level with the lowest power consumption among all power levels is the optimal power level for that secondary scenario. Adjusting the power to the optimal level for the secondary scenario according to these power levels makes the adjustment process of electronic devices more convenient and faster.

[0107] The following embodiments all use power levels as an example to illustrate the process of adjusting the power of electronic devices to the optimal power. For how to determine the optimal power in a secondary scenario, please refer to the following method embodiments.

[0108] The power regulation method provided in this application will now be described with reference to an exemplary user interface.

[0109] Figure 2 This application provides a user interface for an electronic device operating in an emergency level 1 scenario. Figure 2 In this context, electronic device 10 can be a laptop computer.

[0110] like Figure 2 As shown, the user has opened the "Mini Game" application through electronic device 10 and is controlling the game character using input devices such as keyboard 101. Application window 102 is the application window of the "Mini Game" application. At this time, electronic device 10 is in game mode, which is a typical high CPU / GPU load mode. Therefore, based on the above description, it can be concluded that the electronic device is in an emergency level 1 scenario.

[0111] exist Figure 2 In the emergency level 1 scenario shown, if a user opens a hardware detection application through electronic device 10, the application window 103 of the hardware detection application can display the hardware information and performance of the electronic device at this moment. From the hardware information displayed within the dashed box in application window 103, it can be seen that the maximum power supply level of the CPU of electronic device 10 at this time (i.e., the PL1 power displayed in application window 103, the same below) is 45W, corresponding to the maximum power level. The actual total system power of the electronic device is 44.145W, and the average total system power is 44.495W; where the actual total system power is the total system power of the electronic device at the current moment, and the average total system power is the average of the total system power of the electronic device over a fixed period of time. At this time, the maximum power supply of the CPU is 45W, while the actual CPU power has reached 44.145W; and in addition to the CPU, there may be other hardware in electronic device 10, such as the GPU, that also consumes power, so the total system power will be greater than 44.145W.

[0112] Understandably, in Level 1 emergency scenarios, the performance demands on electronic devices are extremely high. Therefore, the total system power of these devices is almost always very close to the maximum power limit of the CPU (45W); in some cases, the actual power the CPU can supply may even reach this limit. Thus, in such situations, electronic devices must maintain the CPU's maximum available power at its maximum capacity to minimize any impact on the user experience.

[0113] Figure 3 This application provides a user interface for an electronic device to operate in a general first-level scenario and a second-level scenario. The electronic device 10 may be a laptop computer.

[0114] like Figure 3 As shown in (A), the user has opened the "Office-Word" application on electronic device 10 and is editing a Word document using keyboard 101. Application window 104 is the application window of the "Office-Word" application. When editing a Word document, the user is likely to frequently use keyboard shortcuts, such as using UP or PgDn to switch pages, or Shift+F5 to move to the previous revision. Based on the foregoing explanation, the user's operation on the Word document using keyboard shortcut 101 is a general level one event. Therefore, in Figure 3 In (A), the operating scenario of electronic device 10 is a general level one scenario.

[0115] exist Figure 3 In the typical Level 1 scenario shown in (A), if a user opens a hardware detection application through electronic device 10, the application window 105 of the hardware detection application can display the hardware information and performance of the electronic device at this moment. From the hardware information displayed within the dashed box in application window 104, it can be seen that the maximum power supply level of the CPU of electronic device 10 at this time (i.e., the PL1 power displayed in application window 105, the same below) is 45W, which corresponds to the maximum power level. The actual total system power of the electronic device is 40.545W, and the average total system power is 41.795W; where the actual total system power is the total system power of the electronic device at the current moment, and the average total system power is the average of the total system power of the electronic device over a fixed period of time.

[0116] like Figure 3As shown in (B), at a certain moment, the user closes the "Office-Word" application and opens the "Video" application to start watching a video. Application window 106 is the application window of the "Video" application. It is assumed that during the entire video viewing process, the electronic device 10 does not trigger any Level 1 events. Therefore, based on the foregoing explanation, in... Figure 3 In (B), the operating scenario of electronic device 10 is a secondary scenario. In this secondary scenario, if the user also opens the hardware detection application, it can be seen from the hardware information displayed in the dashed box in the application window 107 that the maximum power that the CPU of electronic device 10 can supply is still 45W, the actual total system power is 25.375W, and the average total system power is 28.550W.

[0117] from Figure 3 The hardware information shown in (A) and (B) indicates that the maximum power supply level of the CPU in electronic device 10 is set to the maximum level in both the general Level 1 and Level 2 scenarios, corresponding to a power value of 45W. However, in both scenarios, the actual operating power of the CPU in electronic device 10 does not reach 45W. This means that when the maximum power supply level of the CPU is set to the maximum level (45W), the actual operating power of the CPU in electronic device 10 may never reach 45W. Therefore, for... Figure 3 As shown in (A) and (B), for general first-level and second-level scenarios, without affecting the user experience, if the actual working power of the CPU can be limited by reducing the maximum power supply level of the CPU, that is, by lowering the maximum power supply level of the CPU to reduce the actual working power of the CPU, the total system power of the electronic device will also decrease, thus effectively reducing the power consumption of the electronic device.

[0118] Therefore, this application provides a power regulation method that can dynamically adjust the maximum power that the CPU of the electronic device can supply based on the scenario in which the electronic device is located and in combination with a performance feedback mechanism, thereby minimizing the power consumption of the electronic device while ensuring user experience and effectively extending the usage time of the electronic device.

[0119] First, combine Figure 4 This application describes the specific strategies for adjusting the maximum power supply level of the CPU in various operating scenarios of the electronic device.

[0120] like Figure 4 As shown, the operating scenario of the electronic device provided in this application can include a primary scenario and a secondary scenario. The primary scenario can be further divided into an emergency primary scenario and a general primary scenario, specifically:

[0121] Emergency Level 1 scenarios refer to scenarios where the electronic device detects an emergency level 1 event. Emergency level 1 events include, but are not limited to, high CPU / GPU load events, screen lag events, and applications being switched on the electronic device. Optionally, the electronic device can check whether the application being switched on, obtain the CPU load status, and log the screen lag events through corresponding interfaces.

[0122] It should be noted that in this application, the timeliness of an emergency level 1 event can be set to S1 seconds. Optionally, the value of S1 can be 5. That is to say, once any emergency level 1 event is detected, the electronic device is in an emergency level 1 scenario, and the electronic device will operate in the emergency level 1 scenario for at least S1 seconds. Understandably, if the electronic device does not detect a new emergency level 1 event within S1 seconds, the emergency level 1 scenario ends; if the electronic device does not detect a new emergency level 1 event within S1 seconds, the emergency level 1 scenario in which the electronic device is located can continue until S1 seconds after the new emergency level 1 event, and so on.

[0123] When an emergency level 1 event is detected, the electronic device can determine that the current operating scenario is an emergency level 1 scenario. Based on the high-performance requirements of the emergency level 1 scenario, the electronic device will directly adjust the maximum available power of the CPU to the maximum power level to ensure 100% performance. For the next S1 seconds, the electronic device will maintain the maximum available power level at the maximum power level. If the electronic device detects an emergency level 1 event again within S1 seconds, it will restart the timer from the trigger time of the second emergency level 1 event. For the next S1 seconds, the electronic device will maintain the maximum available power level at the maximum power level, and so on, until the electronic device does not detect an emergency level 1 event for consecutive S1 seconds. At this point, the electronic device will determine that the emergency level 1 scenario has ended, and the operating scenario is now a normal level 1 or level 2 scenario. The electronic device can then adjust the maximum available power of the CPU according to the positive / negative feedback obtained based on the performance feedback mechanism.

[0124] A typical Level 1 scenario refers to a scenario where an electronic device detects a Level 1 event. A Level 1 event can include user interaction events with the electronic device. Examples include user actions such as clicking a mouse button, scrolling the mouse wheel (but not moving the mouse cursor), and using keyboard shortcuts (shortcut keys can include Ctrl, Win, Shift, Alt, Esc, F1-F12, Fn, Enter, PrtSc, PgUp, PgDn, etc., and can also include other shortcuts, as well as combinations of multiple shortcuts).

[0125] Similarly, in this application, the timeliness of a general Level 1 event can be set to S2 seconds. That is, if no emergency Level 1 event is detected within a consecutive S1 seconds, once any general Level 1 event is detected, the electronic device is in a general Level 1 scenario, and the electronic device will run in the emergency Level 1 scenario for at least S2 seconds. Optionally, the value of S2 can be 5, that is, S2 = S1 (for ease of explanation, subsequent embodiments will be described using S1 = S2 as an example, that is, assuming that the duration of emergency Level 1 events and general Level 1 events is the same). It can be understood that in a Level 1 scenario, if the electronic device does not detect a new general Level 1 event or detects any emergency Level 1 event within S2 seconds after a Level 1 event is triggered, it indicates that the general Level 1 scenario ends; if the electronic device does not detect a new emergency Level 1 event within S2 seconds, and the electronic device detects a new general Level 1 event, then the general Level 1 scenario in which the electronic device is located can continue until S2 seconds after the new general Level 1 event, and so on.

[0126] If no emergency level 1 event is detected within a continuous duration of S1 seconds, but a general level 1 event is detected, the electronic device can determine that the current operating scenario is a general level 1 scenario. Based on the higher performance requirements of the electronic device in a general level 1 scenario, the electronic device can directly adjust the CPU's maximum available power level to the maximum power level to ensure 100% performance supply. However, unlike in an emergency level 1 scenario, adjusting the CPU's maximum available power level to the maximum power level in a general level 1 scenario may result in overkill performance. Therefore, before the end of a general level 1 scenario, if no negative feedback is obtained, the electronic device can lower the CPU's maximum available power level every S3 seconds (not exceeding a preset lower limit) to reduce power consumption. Conversely, once negative feedback is obtained, the electronic device can adaptively raise the CPU's maximum available power level (not exceeding the CPU's maximum available power upper limit) to avoid significant interface lag during subsequent operation, which could negatively impact the user experience.

[0127] Optionally, the value of S3 above can be 3.

[0128] Optionally, the electronic device can lower the maximum power supply level of the CPU by 1 level every S3 seconds if no negative feedback is obtained; correspondingly, once the electronic device can obtain negative feedback, it can adaptively raise the maximum power supply level of the CPU by 2 levels.

[0129] Optionally, after each entry into a general Level 1 scenario, the electronic device can determine the level of maximum CPU power supplied used each time negative feedback is generated, and record the highest level of maximum CPU power supplied among these levels (assuming this highest level is PL_lv1Neg). If the Level 1 scenario fails to end, even if the electronic device does not receive negative feedback for a long period of time in subsequent processes, the electronic device will maintain the level of maximum CPU power supplied at a level greater than PL_lv1Neg.

[0130] In a normal Level 1 scenario, if no emergency Level 1 event is detected, and the electronic device fails to detect a new normal Level 1 event within S2 seconds after detecting the latest normal Level 1 event, the electronic device will determine that the normal Level 1 scenario has ended, and the running scenario will enter the Level 2 scenario. If a normal Level 1 event is subsequently triggered again, the electronic device will re-enter the normal Level 1 scenario. At this time, the electronic device can adjust the maximum available CPU power level back to the maximum power level, and, as described above, adjust the maximum available CPU power level based on the positive / negative feedback obtained from the performance feedback mechanism before the normal Level 1 scenario ends, until the normal Level 1 scenario ends.

[0131] Level 2 scenarios include operating scenarios with lower performance requirements for electronic devices. When an electronic device fails to detect a Level 1 event (or when the last Level 1 event detected by the electronic device ends), it is considered to have entered a Level 2 scenario.

[0132] When an electronic device is in a secondary scenario, it can adjust the maximum available CPU power while balancing performance and power consumption. Unlike in a primary scenario, in any secondary scenario, the electronic device can record the scenario parameters and can enter and run in that secondary scenario multiple times. When the total runtime of the electronic device in a secondary scenario reaches a certain threshold, it can determine the optimal power level for that secondary scenario based on the operating conditions at each maximum available CPU power. Subsequently, if the electronic device enters that secondary scenario again, it can adjust the maximum available CPU power to the optimal power level corresponding to that secondary scenario. Until the next event occurs (i.e., the running scenario switches from that secondary scenario to a primary scenario or another secondary scenario), the electronic device can maintain the maximum available CPU power at the optimal power level corresponding to that secondary scenario until the secondary scenario ends.

[0133] Next, combine Figures 5-8 This provides a more detailed explanation of how electronic devices adjust the maximum power supply level of the CPU in typical Level 1 scenarios.

[0134] Figure 5 The flowchart of a power adjustment method provided in this application illustrates how to adjust the maximum power supply to the CPU of an electronic device under normal operating conditions. This method aims to reduce power consumption by compressing excess power while ensuring the device's performance meets its requirements. Figure 5 As shown, the method may include the following steps:

[0135] S101. After leaving the factory, the electronic equipment is powered on and running.

[0136] The electronic devices illustrated in this application can be mobile phones, in-vehicle devices (such as on-board units, OBUs), tablets, computers with data transceiver capabilities (such as laptops, PDAs, etc.), mobile internet devices (MIDs), terminals in smart cities, terminals in smart homes, terminal devices in 5G networks, or terminal devices in future evolved public land mobile networks (PLMNs), etc. It is understood that this application does not limit the specific form of the aforementioned electronic devices.

[0137] After electronic devices leave the factory, they can be powered on and operated by the user.

[0138] S102. When the operating scenario changes from a non-normal level 1 scenario to a normal level 1 scenario, the electronic device adjusts the maximum power supply level of the CPU to the maximum power level.

[0139] In the embodiments of this application, the aforementioned non-general level one scenario may include emergency level one scenario and / or level two scenario.

[0140] In the case of an emergency level 1 scenario instead of a normal level 1 scenario, the electronic device can detect a normal level 1 event when the last emergency level 1 event detected in the emergency level 1 scenario ends. The start time of this normal level 1 event is the moment when the electronic device switches the operating scenario to the normal level 1 scenario.

[0141] When the aforementioned non-general Level 1 scenario is a Level 2 scenario, the electronic device can detect a general Level 1 event within that Level 2 scenario. Similarly, the start time of this general Level 1 event is the moment when the electronic device switches its operating scenario to the aforementioned general Level 1 scenario.

[0142] by Figure 6 For example, in Figure 6In the process, the electronic device operates in a non-normal first-level scenario during the time interval from time t60 to time t61, operates in a normal first-level scenario during the time interval from time t61 to time t62, and continues to operate in a non-normal first-level scenario after time t62.

[0143] Assuming in Figure 6 In the diagram, the electronic device is in an emergency level 1 scenario during the time interval t60-t61, and the start time of the last emergency level 1 event 601 detected during this interval is t61'. During the time interval t61-t62, the electronic device is in a normal level 1 scenario, and the start time of the first normal level 1 event 602 detected during this interval is t62'. Therefore, it can be understood that the time interval between t61 and t61' when the electronic device enters the normal level 1 scenario during the time interval t61-t621 needs to be greater than or equal to the duration of the emergency level 1 event (i.e., the aforementioned S1 seconds). It can also be understood that if the time interval t61'-t61 is exactly equal to the duration of the emergency level 1 event, i.e., t61 is the end time of emergency level 1 event 601, then t61 is both the end time of the emergency level 1 scenario and the end time of the normal level 1 scenario. If the duration of time t61' to time t61 is longer than the duration of an emergency level 1 event, and no general level 1 event is detected during the duration of time t61' to time t61, then the electronic device will first be in the emergency level 1 scenario during the duration of time t61' to time t61, until the emergency level 1 event 601 ends, then it will enter the level 2 scenario and remain in the level 2 scenario until a general level 1 event 602 is detected at time t61, at which point the electronic device will enter the general level 1 scenario.

[0144] Upon initial entry into a general Level 1 scenario, the electronic device adjusts the maximum available CPU power to the highest level, i.e., level 10. Subsequently, the electronic device starts operating with the maximum available CPU power at level 10 and continues to execute subsequent steps S103 to adaptively adjust the level of the maximum available CPU power.

[0145] S103. When the operating scenario is a general level 1 scenario and no negative feedback is obtained, the electronic device will lower the level of the maximum power supplied by the CPU; when the operating scenario is a general level 1 scenario and negative feedback is obtained, the electronic device will raise the level of the maximum power supplied by the CPU.

[0146] Before the end of the general Level 1 scenario in this round, the electronic device can adjust the maximum power that the CPU of the electronic device can supply based on the performance feedback mechanism provided in this application, so as to minimize the power consumption of the electronic device while ensuring user experience.

[0147] In general, under typical Level 1 scenarios, if an electronic device does not receive negative feedback within a certain period of time (e.g., 3 seconds), it indicates that the device's performance is sufficient. Therefore, the device can adaptively lower the maximum power supply of the CPU to reduce power consumption. Conversely, if the electronic device receives negative feedback at any time, it indicates that the device's performance may be insufficient. Therefore, the device can adaptively increase the maximum power supply of the CPU to reduce power consumption.

[0148] Let's take a typical level-one scene, scene_n1, as an example. For any typical scene_n1, before scene_n1 ends, the electronic device can adjust the maximum CPU power supply under scene_n1 according to the following rules:

[0149] 1) The electronic device detected a general Level 1 event, event_1;

[0150] Determine if we are currently in a general level 1 scenario:

[0151] If not, it indicates that the electronic device has just entered a general level 1 scene_n1. At this time, the electronic device can adjust the maximum available CPU power to the maximum level 10 and record the currently used level PL_now as level 10. Simultaneously, to determine whether the electronic device's running time at the current level has reached a fixed threshold and whether the latest detected level 1 event has ended, the electronic device can set a timer1 with a duration of Tn and a timer2 with a duration of Tm. Timer1 is used to determine whether the electronic device has run at the current maximum available CPU power for a duration of Tn. If timer1 ends, it means that the electronic device has not detected negative feedback within Tn, and the electronic device can then reduce the maximum available CPU power. Timer2 is used to determine whether the effective event of the latest detected level 1 event has ended. If timer2 ends, it means that the latest detected level 1 event has ended, and also that the general level 1 scene_n1 has ended.

[0152] If so, it means that a new first-level event has been detected again when the scene is already in a normal first-level scene_n1. This first-level event can continue for the duration of the normal first-level scene_n1. Therefore, the timer needs to be reset (e.g., deleted and then set, the same below).

[0153] In this embodiment, the general first-level scene_n1 can be referred to as the "first scene," the maximum gear 10 can be referred to as the "maximum power," the duration Tn can be referred to as the "first duration," and the duration Tm can be referred to as the "first threshold" or the "second threshold." If the general first-level event event_1 is not detected within the general first-level scene_n1, then the general first-level event event_1 can be referred to as the "first-level event."

[0154] 2) The electronic device detected an emergency level 1 event, event_2;

[0155] The electronic device adjusts the maximum available CPU power to the highest level, level 10. At this point, the normal level 1 scene (scene_xn1) ends, and the electronic device enters the emergency level 1 scene (scene_e1). Simultaneously, the electronic device updates the start time (t_emergency) of the most recently detected emergency level 1 event to the start time (t_1) of emergency level 1 event_2. This is primarily to determine when the emergency level 1 scene (scene_e1) ends, preventing the electronic device from detecting a normal level 1 event before the emergency level 1 scene ends and mistakenly determining that it has already entered the normal level 1 scene.

[0156] Understandably, when the electronic device detects the latest emergency level 1 event event_3 at any subsequent time, the electronic device will update the above t_emergency to the start time of the latest detected emergency event event_3, and so on.

[0157] In this embodiment of the application, the emergency level 1 event event_2 can be referred to as the "fourth level 1 event", and the emergency level 1 scene_e1 can be referred to as the "second scene".

[0158] 3) In a typical first-level scene (scene_n1), when running at the maximum CPU power supply level (PL_n1), negative feedback was detected.

[0159] The electronic device needs to determine whether the time interval between the current time t_now and the start time t_start1 of the general first-level scene scene_n1 is greater than the duration Tp. This is because the performance requirements of the electronic device may be significantly enhanced within a short period of time (i.e., the duration Tp) after each switch from other non-first-level scenes to first-level scenes. Therefore, the electronic device can easily detect negative feedback within a short period of time after entering the general first-level scene. This negative feedback is uncontrollable and therefore has no reference value. Therefore, to eliminate interference from meaningless negative feedback, after detecting negative feedback, if the electronic device determines whether the time interval between the current time t_now and the start time t_start1 of a typical first-level scene _n1 is less than or equal to the duration Tp, then the electronic device ignores the detected negative feedback and does not adjust the maximum available CPU power level. However, if the time interval between the current time t_now and the start time t_start1 of a typical first-level scene _n1 is greater than the duration Tp, the electronic device can determine that the negative feedback is not caused by the instantaneous high-performance demand on the electronic device during the first-level event. The electronic device can then determine that the currently used maximum available CPU power level PL_now cannot meet the performance requirements, and the electronic device can update PL_n1Neg to PL_now and re-enable the CPU. Set timer1, and simultaneously adjust the maximum CPU power supply level to min[(PL_now+2), PL_max] and update PL_now to min[(PL_now+2), PL_max]; where PL_n1Neg represents the largest level among all detectable negative feedback levels when the electronic device is running at the maximum CPU power supply level during the operation of the general first-level scene_n1, and PL_n1Neg can be set to 0 when initially entering the general first-level scene_n1; PL_max represents the maximum CPU power supply level (i.e., level 10), and min[] represents the minimum value operation, that is, min[(PL_now+2), PL_max] represents the minimum level between (PL_now+2) and PL_max.

[0160] In other words, after detecting negative feedback, if the negative feedback is of reference significance, the electronic device can increase the level of the maximum power that the CPU can supply by 2 levels, but it cannot exceed the maximum level of 10 levels of the maximum power that the electronic device can supply to the CPU.

[0161] In this embodiment, the maximum power level that the CPU can supply, PL_n1, can be referred to as the "third power", min[(PL_now+2), PL_max] can be referred to as the "fourth power", and the duration T slice can be referred to as the "third threshold".

[0162] 4) When running at the maximum CPU power supply level of PL_n1, timer1 is triggered if no negative feedback is detected;

[0163] The electronic device runs for a duration of Tn without detecting negative feedback. Timer1 is then triggered. At this point, the electronic device determines that, for a typical Level 1 scene_n1, the performance provided by the current CPU's maximum power supply setting PL_now = PL1 is sufficient, and it can attempt to reduce the power supply. After timer1 is triggered, the electronic device can determine whether the time interval between the current time t_now and the start time t_emergency of the most recently detected Level 1 emergency event (in this embodiment, this Level 1 emergency event can be referred to as a "Level 3 event") is greater than the duration of Tn, to ensure that timer1 is not triggered in a Level 1 emergency scene. If it is determined that the time interval between the current time t_now and the start time t_emergency of the most recently detected Level 1 emergency event is greater than the duration of Tn, the electronic device can adjust the CPU power supply in any of the following three ways:

[0164] ① The electronic device lowers the maximum power supply level of the CPU by one level, i.e., adjusts it to level (PL_n1-1). At the same time, the electronic device updates the currently used level PL_now to level (PL_n1-1) and resets timer1.

[0165] In other words, as long as the runtime of the gear PL_n1-1 reaches Tn and no negative feedback is detected, the gear at which the CPU can supply the maximum power will be lowered by one level.

[0166] ② The electronic device adjusts the maximum power supply level of the CPU to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)]; at the same time, the electronic device updates the currently used level PL_now to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] and resets timer1.

[0167] Wherein, PL_n1min represents the lower limit of the maximum CPU power supply level that the electronic device can adjust under normal level 1 scenarios (for most normal scenarios, after adjusting the maximum CPU power supply level of the electronic device to a certain level, the electronic device will frequently lag or even fail to operate normally, so it is necessary to set a lower limit value PL_n1min for the maximum CPU power supply level under normal level 1 scenarios, and the specific value of PL_n1min can be 4 levels); max[] represents the maximum value operation, that is, max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] represents the maximum level among the three levels (PL_n1-1), PL_n1min, and (PL_n1Neg+1).

[0168] In other words, when in a typical Level 1 scene (scene_n1), without detecting negative feedback, the electronic device can gradually decrease the maximum CPU power level from level 10 until it detects negative feedback while running at a certain level. At this point, the electronic device can update PL_n1Neg to that level and increase the maximum CPU power level. During subsequent adjustments, since negative feedback occurred while running at the maximum CPU power level of PL_n1Neg, the electronic device can determine that running at PL_n1Neg or a lower level in a typical Level 1 scene (scene_n1) is highly likely to cause stuttering. Therefore, even if the electronic device subsequently decreases the maximum CPU power level without detecting negative feedback, it will not decrease it to PL_n1Neg or a level lower than PL_n1Neg, nor will it decrease it to a level lower than PL_n1min. For example, assuming the subsequent electronic device runs at (PL_n1Neg+1) power level for duration Tn, and no negative feedback is detected during this period while timer1 is triggered, then max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] = (PL_n1Neg+1). Therefore, the electronic device can maintain the maximum CPU power supply level at (PL_n1Neg+1) without downgrading to the PL_n1Neg level where negative feedback occurred. This further reduces the probability of the electronic device stuttering in a typical first-level scene (scene_n1).

[0169] Figure 7 An example is shown of an electronic device following the rules shown in method ②. Figure 6The diagram shows the specific process of adjusting the maximum CPU power supply level starting at time t61. Here, it is assumed that the electronic device's maximum CPU power supply level PL_max is 10 levels, and the lower limit of the adjustable maximum CPU power supply level PL_n1min under typical Level 1 scenarios is 4 levels. Figure 7 The time interval t61-t68 is included in the time interval t61-t62 (during the time interval t61-t68, the timer2 set by the electronic device is not triggered, and the electronic device continues to operate under normal level one scenario). Therefore... Figure 7 As shown:

[0170] At time t61, the electronic device ends the non-normal level 1 scene, detects the first normal level 1 event, and enters the normal level 1 scene_n1 to start running. According to the aforementioned rules, when it first enters the normal level 1 scene_n1, the electronic device will adjust the maximum power supply level of the CPU to the highest level 10 and start running. At this time, the electronic device will set the level value of PL_n1Neg to "0", update PL_now to level 10, and set timer1.

[0171] Starting from time t61, after a duration of T1, at time t63, the electronic device detects negative feedback. However, the time interval between time t63 and the start time t61 of the latest detected general level 1 event, namely general level 1 event 602, is less than the duration Tp. Therefore, the electronic device can determine that the feedback is caused by the instantaneous high-performance demand of the electronic device when general level 1 event 602 is triggered. Thus, this negative feedback is not meaningful and the electronic device can ignore this negative feedback and continue to operate with the maximum power supply level of the CPU at level 10. At this time, PL_now is still level 10 and PL_n1Neg is still level 0.

[0172] From time t61 to time t64, the electronic device operates at the maximum CPU power supply level of 10 for a duration of Tn. No negative feedback is detected during this period. At time t64, timer1 is triggered, and the time interval between time t64 and time t61' (the start time of the most recent emergency level 1 event) is greater than the duration Tn. Therefore, the electronic device can determine that it is currently in a normal level 1 scenario, and the CPU performance supply is sufficient. Thus, the electronic device can adjust the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Based on the previous explanation, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[10-1, 0+1, 4] = 9, meaning the electronic device will lower the maximum CPU power supply level by one level, from level 10 to level 9. Simultaneously, the electronic device will reset timer1 and update PL_now to level 9.

[0173] Starting from time t64, over a period of time Tn to time t65, the electronic device operates at the CPU's maximum power supply level of 9. No negative feedback is detected during this period. At time t65, timer1 is triggered again, and the time interval between time t65 and time t61' is greater than the duration Tn. Therefore, the electronic device can determine that it is currently in a normal first-level scenario, and the CPU's performance supply is sufficient. Thus, the electronic device can adjust the CPU's maximum power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Based on the previous explanation, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[9-1, 0+1, 4] = 8, meaning the electronic device will lower the CPU's maximum power supply level by one level, from level 9 to level 8. Simultaneously, the electronic device will reset timer1 and update PL_now to level 8.

[0174] Next, starting from time t65, after a duration of T2 (T2 duration < Tn duration) to time t66, the electronic device detects negative feedback at time t66. Here, it is assumed that the latest general level 1 event detected by the electronic device at time t66 is general level 1 event 603. Figure 6 and Figure 7If the time interval between time t66 and the start time of general level 1 event 603 is greater than the duration Tp, then the electronic device can determine that the CPU performance supply of the electronic device is insufficient. Therefore, the electronic device can adjust the maximum power supply level of the CPU to min[(PL_now+2), PL_max]. As explained above, min[(PL_now+2), PL_max] = max[8+2, 10] = 10, meaning the electronic device will increase the maximum power supply level of the CPU by 2 levels, from level 8 to level 10. At the same time, the electronic device will reset timer1 and update PL_now to level 10 and PL_n1Neg to level 8.

[0175] Subsequently, starting from time t66 and continuing for duration Tn to time t67, the electronic device operates at the maximum CPU power supply level of 10. No negative feedback is detected during this period. At time t67, timer1 is triggered again, and the time interval between time t67 and time t61' is greater than Tn. Therefore, the electronic device can determine that it is currently in a normal first-level scenario, and the CPU's performance supply is sufficient. Thus, the electronic device can adjust the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Based on the previous explanation, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[10-1, 8+1, 4] = 9, meaning the electronic device will lower the maximum CPU power supply level by one level, from 10 to 9. Simultaneously, the electronic device will reset timer1 and update PL_now to 9.

[0176] From time t67 to time t68, the electronic device operates at the CPU's maximum available power level of 9 for a duration of Tn. No negative feedback is detected during this period. At time t68, timer1 is triggered again, and the time interval between time t68 and time t61' is greater than Tn. Therefore, the electronic device can determine that it is currently in a normal first-level scenario, and the CPU's performance supply is sufficient. Thus, the electronic device can adjust the CPU's maximum available power level to max[PL_now-1, PL_n1Neg+1, PL_min]. As explained above, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[9-1, 8+1, 4] = 9. This means the electronic device will maintain the CPU's maximum available power at level 9 and will not lower it back to level 8, where negative feedback has already occurred. Simultaneously, the electronic device will reset timer1 and keep PL_now at level 9.

[0177] Similarly, starting from time t68 and continuing for duration Tn to time t69, the electronic device operates at the CPU's maximum power supply level of 9 from time t67 to time t69, during which no negative feedback is detected. At time t69, timer1 is triggered again, and the electronic device adjusts the CPU's maximum power supply level to max[PL_now-1, PL_n1Neg+1, PL_min] = max[9-1, 8+1, 4] = 9. That is, the electronic device maintains the CPU's maximum power supply at level 9 and will not lower it back to level 8, where negative feedback has already occurred. Simultaneously, the electronic device resets timer1 and keeps PL_now at level 9.

[0178] Understandably, if the electronic device remains at power level 9 until the end of the typical first-level scene (scene_n1), and no meaningful negative feedback is detected, it will maintain the maximum CPU power at power level 9 until the scene ends. However, if at some point the electronic device detects meaningful negative feedback while running at power level 9, it will increase the power level to min[(PL_now+2), PL_max] = min[(9+2), 10] = power level 10 and run at power level 10. Even if the electronic device subsequently runs at power level 10 for a duration Tn without detecting negative feedback, since max[PL_now-1, PL_n1Neg+1, PL_min] = max[10-1, 9+1, 4] = 10, the electronic device will not again reduce the maximum CPU power to power level 9, where negative feedback has already occurred. Instead, it will maintain power level 10 until the scene ends.

[0179] Afterward, the electronic device can continue to adjust the maximum power supply level of the CPU according to the above rules until the general first-level scene scene_n1 ends, which will not be elaborated here.

[0180] ③ The electronic device checks if the value of PL_n1Neg is 0. If the value of PL_n1Neg is 0, the maximum power supply level of the CPU is adjusted to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)], and the currently used level PL_now is updated to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] and timer1 is reset. If the value of PL_n1Neg is not 0, a random number in the range (0,1) is generated. If the generated random number is less than the preset reset threshold r1 (which is any real number greater than 0 and less than 0), the value of PL_n1Neg is reset to 0, and the maximum power supply of the CPU is increased. The available power supply level is adjusted to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)], and the currently used level PL_now is updated to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] and timer1 is reset. If the generated random number is greater than or equal to the preset reset threshold r1, the maximum available power supply level of the CPU is adjusted to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)], and the currently used level PL_now is updated to max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] and timer1 is reset.

[0181] In this embodiment of the application, the maximum power level that the CPU can supply, PL_n1, can be referred to as the "first power", and max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] can be referred to as the "second power".

[0182] The specific meanings of PL_n1min, PL_n1Neg, and max[] can be found in the previous explanation and will not be repeated here.

[0183] In other words, when in a typical Level 1 scene (scene_n1), without detecting negative feedback, the electronic device can gradually decrease the maximum CPU power level from level 10 until negative feedback is detected at a certain level. At this point, the electronic device can update PL_n1Neg to that level and increase the maximum CPU power level. However, although negative feedback occurred historically when running at the maximum CPU power level of PL_n1Neg, considering that the electronic device may run for extended periods in a typical Level 1 scene (scene_n1), and that the negative feedback that occurred historically at PL_n1Neg may be accidental, subsequent runs at PL_n1Neg or lower levels may not experience stuttering. Therefore, during subsequent adjustments, the electronic device can reset PL_n1Neg to 0 with a certain probability after each trigger of timer1, attempting to ignore negative feedback that occurred during previous runs at gear PL_n1Neg. If, subsequently, the device runs at (PL_n1Neg+1) gear for a duration of Tn and timer1 is triggered again, PL_n1Neg has already been reset to 0 or has been reset to 0 after the current trigger of timer1. Then, the value of max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] is (PL_n1-1), meaning the electronic device can adjust C... The maximum power supply level of the PU is lowered to the level where negative feedback has occurred in the past. Correspondingly, if it runs at (PL_n1Neg+1) again for a duration of Tn and timer1 is triggered, and PL_n1Neg is not reset to 0 and is not reset to 0 after the triggering of timer1, then the value of max[(PL_n1-1), PL_n1min, (PL_n1Neg+1)] is (PL_n1Neg+1). That is, the electronic device will not lower the maximum power supply level of the CPU, but will continue to run at the maximum power supply level of the CPU (PL_n1Neg+1).

[0184] Understandably, after each trigger of timer1, the probability value Pro_reset of the electronic device resetting PL_n1Neg to 0 is related to the specific value of the aforementioned reset threshold r1. This probability value Pro_reset can be expressed as r1 × 100%. Specifically, the value of r1 can be set to 0.05, in which case the probability of the electronic device resetting PL_n1Neg to 0 is 5%. Of course, the electronic device can also set the reset threshold r1 to any other real number greater than 0 and less than 1, and this application does not limit this.

[0185] Optionally, the electronic device can use the random number function random() to obtain the random number in the interval (0,1).

[0186] exist Figure 6 On this basis, Figure 8 This example illustrates the specific process by which an electronic device adjusts the maximum CPU power supply level according to the rule shown in method ③ after detecting negative feedback in a typical Level 1 scene (scene_n1). Here, it is also assumed that the maximum CPU power supply level (PL_max) of the electronic device is 10 levels, and the lower limit of the adjustable maximum CPU power supply level (PL_n1min) in a typical Level 1 scene is 4 levels. Figure 8 The time interval t61-t71 is included in the time interval t61-t62 (during the time interval t61-t68, the timer2 set by the electronic device has not been triggered, and the electronic device continues to operate under normal level one scenario). Therefore... Figure 8 As shown:

[0187] At time t61, the electronic device ends the non-normal level 1 scene, detects the first normal level 1 event, and enters the normal level 1 scene_n1 to start running. According to the aforementioned rules, when it first enters the normal level 1 scene_n1, the electronic device will adjust the maximum power supply level of the CPU to the highest level 10 and start running. At this time, the electronic device will set the level value of PL_n1Neg to "0", update PL_now to level 10, and set timer1.

[0188] Starting from time t61, after a duration of T1, at time t63', the electronic device detects negative feedback. However, the time interval between time t63' and the start time t61 of the latest detected general level 1 event, namely general level 1 event 602, is less than the duration Tp. Therefore, the electronic device can determine that the feedback is caused by the instantaneous high-performance demand of the electronic device when general level 1 event 602 is triggered. Thus, this negative feedback is not meaningful, and the electronic device can ignore this negative feedback and continue to operate with the maximum power supply level of the CPU at level 10. At this time, PL_now is still level 10, and PL_n1Neg is still level 0.

[0189] Starting from time t61, over time Tn until time t64, the electronic device operates at the maximum CPU power supply level of 10 from time t61 to time t64'. At this point, timer1 triggers, and the time interval between time t64' and time t61' (the start time of the most recent emergency level 1 event) is greater than time Tn. Therefore, the electronic device can determine that it is currently in a normal level 1 scenario, and that the CPU's performance supply is sufficient. Since PL_n1Neg is still at level 0, the electronic device can directly adjust the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Combining this with the previous explanation, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[10-1, 0+1, 4] = 9, meaning the electronic device will lower the maximum CPU power supply level by one level, from level 10 to level 9. At the same time, the electronic device will reset timer1 and update PL_now to level 9.

[0190] Similarly, starting from time t64', over time Tn until time t65', the electronic device operates at the CPU's maximum power supply level of 9. At this point, timer1 triggers, and the time interval between t65' and t61' is greater than Tn. Since PL_n1Neg is still at level 0, the electronic device can directly adjust the CPU's maximum power supply level to max[PL_now-1, PL_n1Neg+1, PL_min], which equals max[9-1, 0+1, 4] = level 8. That is, the electronic device will lower the CPU's maximum power supply level by one level, from level 9 to level 8. Simultaneously, the electronic device will reset timer1 and update PL_now to level 8.

[0191] Next, starting from time t65', after a duration of T2 (T2 duration < Tn duration) to time t66', the electronic device detects negative feedback at time t66'. Here, it is assumed that the latest general level 1 event detected by the electronic device at time t66' is general level 1 event 603. Figure 6 and Figure 7If the time interval between time t66' and the start time of general level 1 event 603 is greater than the duration Tp, then the electronic device can determine that the CPU's performance supply is insufficient. Therefore, the electronic device can adjust the maximum power supply level of the CPU to min[(PL_now+2), PL_max]. As explained above, min[(PL_now+2), PL_max] = max[8+2, 10] = 10, meaning the electronic device will increase the maximum power supply level of the CPU by 2 levels, from level 8 to level 10. At the same time, the electronic device will reset timer1 and update PL_now to level 10 and PL_n1Neg to level 8.

[0192] Afterwards, starting from time t66', and continuing for a duration of Tn until time t67', the electronic device operates at the maximum CPU power supply level of 10 from time t66' to time t67'. No negative feedback is detected during this period. At time t67', timer1 is triggered again, and the time interval between time t67' and time t61' is greater than the duration of Tn. Therefore, the electronic device can randomly generate a random number belonging to the interval [0, 1]. If the random number is less than the preset reset threshold r1 (i.e., random() < r1), the electronic device can reset PL_n1Neg to 0 and adjust the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Otherwise, the electronic device directly adjusts the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]. Here, it is assumed that the random number obtained by the electronic device in this round is greater than the above reset threshold r1. Then, according to the above explanation, at this time, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[10-1, 8+1, 4] = 9, that is, the electronic device will reduce the maximum power supply level of the CPU by 1 level, from the original 10 levels to 9 levels. At the same time, the electronic device will reset timer1 and update PL_now to level 9 (in fact, even if the random number obtained by the electronic device in this round is greater than the above-mentioned reset threshold r1, then max[(PL_now-1), (PL_n1Neg+1), PL_n1min]=max[10-1, 0+1,4]=9, that is, whether the above-mentioned random number in this round is less than the reset threshold r1, the electronic device will lower the level of the maximum power that the CPU can supply to to level 9; that is to say, whether or not PL_n1Neg is reset only affects whether the level of the maximum power that the CPU can supply to be lowered to the current PL_n1Neg or a level smaller than PL_n1Neg in the future).

[0193] Similarly, starting from time t67', and continuing for a duration of Tn until time t68', the electronic device operates at the maximum CPU power level of 9 from time t67' to time t68', during which no negative feedback is detected. At time t68', timer1 is triggered again, and the time interval between time t68' and time t61' is greater than the duration of Tn. Therefore, the electronic device can generate a random number in the interval [0, 1] again. If the random number is less than the preset reset threshold r1, the electronic device can reset PL_n1Neg to 0 and adjust the maximum CPU power level to max[PL_now-1, PL_n1Neg+1, PL_min]. Otherwise, the electronic device will directly adjust the maximum CPU power level to max[PL_now-1, PL_n1Neg+1, PL_min]. Here, it is assumed that the random number obtained by the electronic device in this round is still greater than the aforementioned reset threshold r1. Based on the previous explanation, PL_n1Neg is still 8. Therefore, max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[9-1, 8+1, 4] = 8. This means the electronic device will maintain the maximum CPU power supply at level 9 and will not lower it to level 8 again. Simultaneously, the electronic device will reset timer1 and keep PL_now at level 8.

[0194] Understandably, without negative feedback, if the random number generated by the electronic device is greater than or equal to the preset reset threshold r1 every time timer1 is triggered, PL_n1Neg will remain at 8, and the electronic device will maintain the maximum CPU power supply at level 9 without lowering it to level 8. Until one timer1 is triggered and the random number generated by the electronic device is less than the reset threshold r1, the electronic device can reset PL_n1Neg to 0, and adjust the maximum CPU power supply to max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[9-1, 0+1, 4] = level 8.

[0195] like Figure 8As shown, starting from time t68', and continuing for a duration of Tn until time t69', the electronic device operates at the CPU's maximum power supply level of 9 throughout this period, without detecting any negative feedback. At time t69', timer1 is triggered again, and the time interval between t69' and t61' is greater than Tn. Therefore, the electronic device can generate another random number within the interval [0, 1]. Assuming the random number generated in this round is less than the aforementioned reset threshold r1, and considering the previous explanation, PL_n1Neg is reset to 0, and max[(PL_now-1), (PL_n1Neg+1), PL_n1min] = max[9-1, 0+1, 4] = 8. This means that although negative feedback occurred previously when operating at level 8, the electronic device can still lower the CPU's maximum power supply level by one level, from level 9 to level 8. Simultaneously, the electronic device resets timer1 and updates PL_now to level 8.

[0196] Next, starting from time t69', over a duration of Tn until time t70, the electronic device operates at the maximum CPU power supply level of 8. No negative feedback is detected during this period. At time t70, timer1 is triggered again, and the time interval between t70 and t61' is greater than Tn. Because the value of PL_n1Neg is 0 at this time, the electronic device can directly adjust the maximum CPU power supply level to max[PL_now-1, PL_n1Neg+1, PL_min]==max[8-1, 0+1,4]=7. That is, the electronic device will continue to lower the maximum CPU power supply level by one level, from level 8 to level 7. Simultaneously, the electronic device will reset timer1 and update PL_now to level 7.

[0197] Afterward, the electronic device can continue to adjust the maximum power supply level of the CPU according to the above rules until the general first-level scene scene_n1 ends, which will not be elaborated here.

[0198] 5) Timer2 is triggered;

[0199] When timer2 is triggered, it indicates that the effective time of the most recently detected general level-one event (in this embodiment, this most recently detected general level-one event can be referred to as the "fifth level-one event") has ended, and the electronic device has failed to detect any new level-one event (in this embodiment, the failure to detect any new level-one event can be referred to as the "sixth level-one event"). At this time, the general level-one scene_n1 has ended. If the electronic device is running a focused application at this time, the electronic device enters the level-two scene (in this embodiment, the electronic device running a focused application can be referred to as the "first level-two event," and this level-two scene can be referred to as the "third scene"). The electronic device needs to delete timer1 and reset PL_n1Neg to 0. After that, the electronic device begins to adjust the maximum available power of the CPU according to the performance adjustment method corresponding to the level-two scene (for details, please refer to the relevant descriptions in the subsequent embodiments, which will not be repeated here).

[0200] S104. When the operating scenario changes from a general level 1 scenario to a non-general level 1 scenario, the electronic device adjusts the maximum power supply level of the CPU to the optimal power level of the non-general level 1 scenario.

[0201] Similarly, the above-mentioned non-general Level 1 scenarios may include emergency Level 1 scenarios and / or Level 2 scenarios.

[0202] In the case of an emergency level 1 scenario instead of the aforementioned normal level 1 scenario, the electronic device can detect an emergency level 1 event before the last normal level 1 event detected in the normal level 1 scenario ends. The start time of this emergency level 1 event is the moment when the electronic device switches the operating scenario to the normal level 1 scenario (emergency level 1 scenario). In this case, the aforementioned optimal power level is the maximum power level that the CPU can supply, i.e., level 10.

[0203] When the aforementioned non-general primary scenario is a secondary scenario, the electronic device can detect the secondary event (in this embodiment, this secondary event can be referred to as the "first secondary event") at the end of the last general primary event detected in the aforementioned general primary scenario. Similarly, the moment when the last general primary event ends is the moment when the electronic device switches the operating scenario to the aforementioned general primary scenario (secondary scenario). In this case, the aforementioned optimal power level needs to be determined based on the electronic device's exploration of the secondary scenario; please refer to the relevant descriptions in subsequent embodiments for details.

[0204] As explained above, there are numerous parameters corresponding to secondary scenarios. A change in any one of these parameters indicates that the secondary scenario has transformed into a new one. These parameters collectively reflect the performance requirements of the electronic device within that scenario. Therefore, it's easy to understand that different secondary scenarios have different performance requirements. During user operation, an electronic device may encounter tens or even hundreds of thousands of secondary scenarios. Therefore, for any given secondary scenario, the key problem this application addresses is how to adjust the maximum CPU power supply of the electronic device to the most suitable power level (power setting) for that specific scenario while ensuring a good user experience, thereby minimizing the device's power consumption.

[0205] The following details the specific method by which the electronic device provided in this application adjusts the maximum power supply level of the CPU in a secondary scenario.

[0206] Figure 9 The flowchart of the power adjustment method provided in this application embodiment is illustrated. Since the focus application is the application with the highest user attention, in the power adjustment method provided in this application embodiment, the electronic device can determine only the optimal power level of the secondary scene within the secondary scene, and adjust the maximum available CPU power level to the optimal power level of the secondary scene, prioritizing the performance requirements of the focus application. (Reference) Figure 9 The method may include the following steps:

[0207] S201. After leaving the factory, the electronic equipment is powered on and running.

[0208] The electronic devices illustrated in this application can be mobile phones, in-vehicle devices (such as on-board units, OBUs), tablets, computers with data transceiver capabilities (such as laptops, PDAs, etc.), mobile internet devices (MIDs), terminals in smart cities, terminals in smart homes, terminal devices in 5G networks, or terminal devices in future evolved public land mobile networks (PLMNs), etc. It is understood that this application does not limit the specific form of the aforementioned electronic devices.

[0209] After electronic devices leave the factory, they can be powered on and operated by the user.

[0210] S202. When in a Level 2 scenario, the electronic device adjusts the maximum power level that the CPU can supply based on the scenario data of the current Level 2 scenario.

[0211] The scenario data described above represents the runtime of an electronic device operating at various maximum CPU power levels within a secondary scenario, recording the duration of each power level and the number of negative feedback events recorded at each power level. The scenario data for this secondary scenario includes: the parameters of the secondary scenario, the multiple power levels explored, and the corresponding negative feedback flat period at each power level.

[0212] When an electronic device enters any secondary scene (scene_x), it explores multiple maximum CPU power levels. Specifically, within that secondary scene, the device sequentially adjusts the maximum CPU power level to different levels. During operation at each level, the device records the total runtime and the total number of negative feedback events at each level. Based on the negative feedback cycle for each level (the ratio of total runtime to the total number of negative feedback events, representing the average duration of one negative feedback event at that level), the device determines the optimal power level for that secondary scene.

[0213] Specifically, for any secondary scene_x in which the electronic device is located, when the electronic device first enters this secondary scene, it can adjust the maximum CPU power supply level to the maximum level 10. Then, within this secondary scene, the maximum CPU power supply level can be adjusted to multiple different levels. For each power level, the electronic device can set the same runtime Tq, for example, Tq can be 3 seconds. If the electronic device does not detect negative feedback within the specified time Tq while running at a certain level, it lowers the maximum CPU power supply level by one level and continues exploration. If negative feedback is detected within the specified time Tq, it immediately raises the maximum CPU power supply level by one level and continues exploration. In the secondary scene_x, after each run at a new level PL1_x, the electronic device updates the total runtime duration_ttl for level PL1_x and the total number of negative feedback instances (Neg_num) obtained while running at level PL1_x. Understandably, in the second-level scene scene_x, the negative feedback period corresponding to gear PL1_x is duration_ttl / Neg_num.

[0214] In actual exploration, under the same secondary scene scene_x, the electronic device may run the exploration in the same gear PL1_x multiple times. For example, when the electronic device receives negative feedback while running at gear PL1_x, it shifts up one gear to PL1_x+1. After running at gear PL1_x+1 for a duration of Tq without receiving negative feedback, it shifts down one gear back to PL1_x. Alternatively, when the electronic device is running at gear PL1_x, if the secondary scene scene_x changes to another secondary scene scene_y, the electronic device will record the gear exploration progress (i.e., PL1_x) under scene_x. If the secondary scene of the electronic device changes back to scene_x, the electronic device will start exploring each gear again from gear PL1_x. Correspondingly, when the electronic device switches from the secondary scene scene_y to another scene, it will record the gear exploration progress under scene_y (if it is the first time entering scene_y, the default gear exploration progress is the maximum gear 10). Therefore, after entering scene_y, the electronic device will start exploring each gear again from the gear exploration progress recorded in scene_y according to the above gear exploration rules.

[0215] For a secondary scenario, when the total runtime of the electronic device in that secondary scenario reaches Ta (the value of Ta can be set to 600s), it indicates that the electronic device has completed its exploration of that secondary scenario. The electronic device can then determine the optimal power level for that secondary scenario based on the negative feedback cycle corresponding to each power level. Specifically, the optimal power level for that secondary scenario can be the smallest power level among all power levels recorded in the scenario data whose corresponding negative feedback cycle is greater than Tb. Optionally, the value of Tb can be set to 300s.

[0216] Understandably, when an electronic device enters a secondary scene, if the device has already completed its exploration of that secondary scene, and the scene data for that secondary scene already records the optimal power level, the device can adjust the maximum power level that the CPU can supply to match the optimal power level for that secondary scene. During subsequent operation, the device can maintain the maximum power level that the CPU can supply to match the optimal power level for that secondary scene until the secondary scene switches to another secondary scene or a non-secondary scene. If the device has not yet completed its exploration of the secondary scene, and the scene data for that secondary scene has not yet recorded the optimal power level, the device can adjust the maximum power level that the CPU can supply to match the power level exploration progress recorded in the scene data and continue exploring the power level. In this embodiment, the rules for exploring secondary scene power levels can be set as follows:

[0217] 1) The electronic device first enters the secondary scene scene_x;

[0218] If the electronic device already stores scene data for the secondary scene (scene_x), then it checks whether the scene data records the optimal power level (PL_xbest) for scene_x. If so, the maximum available CPU power level is directly adjusted to PL_xbest, and the power level exploration progress (PL_xnow) is updated to PL_xbest. Simultaneously, timer3 is set. Otherwise, the maximum available CPU power level is adjusted to the currently recorded power level exploration progress (PL_xnow) (i.e., the power level last used when the secondary scene (scene_x) ended), and timer3 is set. Timer3 can be used to determine whether the electronic device has run at the same power level for a duration of Tq.

[0219] If the scene data for the secondary scene is not stored in the electronic device, a new scene_x scene data entry will be added. At the same time, the maximum power supply level of the CPU will be adjusted to the maximum level 10, and PL_xnow will be updated to level 10.

[0220] When an electronic device first enters the secondary scene scene_x, the maximum power level 10 can be referred to as the "fifth power".

[0221] 2) In the secondary scene scene_x, when the electronic device runs at power level PL1_x for a duration of T3 (T3≤Tq), the running scene changes to the primary scene;

[0222] The electronic device saves the current exploration progress PL_xnow as PL1_x, adjusts the power level to the highest power level PL1_max, and updates duration_ttl(x) and Neg_num(x) based on the duration of the current run at power level PL1_x under scene_x and the number of negative feedbacks (the number of negative feedbacks in this round is 0). That is, for the tuple (scene_x, PL1_x), the total runtime duration_ttl(x) and the total number of negative feedbacks Neg_num(x) are updated, and timer3 is deleted.

[0223] 3) The secondary scene scene_x has not changed to another scene, and the electronic device has been running at power level PL1_x for the specified duration Tq without obtaining negative feedback;

[0224] The electronic device resets timer3 and updates duration_ttl(x) and Neg_num(x) based on the duration of the current run at power level PL1_x under scene_x (the duration of this round is Tq) and the number of negative feedbacks. That is, for the tuple (scene_x, PL1_x), it updates the total runtime duration_ttl(x) and the total number of negative feedbacks Neg_num(x). Specifically, when Neg_num(x) is 0, the electronic device can keep the value of Neg_num(x) at 0. When Neg_num(x) is greater than 0, the electronic device can set the number of negative feedbacks in this round to a negative value Npos (for example, the value of Nposd can be set to -0.2) to reduce the value of Neg_num(x) when updating it in this round.

[0225] In addition, the electronic device will also generate a random number falling within the interval (0,1) using the random number function random(), and obtain the number of negative feedback iterations Neg_num(x-1) for the next gear PL1_x-1. If the generated random number is less than 1 / 2 Neg _ num(x-1) The electronic device will then adjust the gear to the next gear PL1_x-1 and update the current gear exploration progress PL_xnow to PL1_x; if this random number is greater than or equal to 1 / 2 n If the electronic device continues to operate at the current speed PL1_x, it will maintain the current exploration progress PL_xnow.

[0226] In this embodiment, gear PL1_x can be referred to as "the fifth power" and gear PL1_x-1 can be referred to as "the seventh power".

[0227] Understandably, during the exploration of gear levels in a secondary scenario, if an electronic device detects negative feedback while operating at a certain gear level, but this negative feedback is somewhat accidental, it may indicate that the electronic device might experience stuttering when operating at that gear level in the aforementioned secondary scenario. However, if it occurs accidentally, the electronic device may not experience stuttering when operating at that gear level in the same secondary scenario subsequently. What is certain, however, is that the more times negative feedback is detected when operating at a certain gear level, the greater the probability of stuttering when operating at that gear level in the future.

[0228] Based on the aforementioned gear-level exploration rules, if an electronic device runs at a certain gear level for a duration of Tq without experiencing any lag, it will then lower the gear level and continue exploring. If the gear level to be lowered has already been explored by the electronic device, and the device received negative feedback during the previous exploration process, and if the device still chooses to directly lower the gear level, then the electronic device is highly likely to experience lag during subsequent operation, at which point the user may be unable to use the electronic device normally.

[0229] Therefore, the significance of setting a negative value Npos and using random numbers to select whether to downshift is as follows: When downshifting, the electronic device can decide whether to downshift to a given gear based on the number of negative feedbacks corresponding to each gear. Specifically, when using gear PL1_x, Npos can reduce the resistance caused by negative feedback acquired during previous runs at gear PL1_x to subsequent downshifts to PL1_x. Using random numbers to select whether to downshift also considers the impact of negative feedback acquired during previous runs at gear PL1_x-1. Thus, the more times a gear corresponds to a total number of negative feedbacks, the lower the probability of the electronic device downshifting from the previous gear (minimum not less than 0). Similarly, the more times the electronic device triggers timer3 at a given gear, the higher the probability of downshifting from the previous gear (maximum not exceeding 100%). This allows for a better balance between electronic device performance and power consumption during gear exploration, further improving the user experience.

[0230] 4) When running at power level PL1_x for a duration of T4 (T4≤Tq), the running scene changes from the secondary scene scene_x to the secondary scene scene_y;

[0231] The electronic device saves the current gear exploration progress PL_xnow as PL1_x, and updates duration_ttl(x) and Neg_num(x) based on the duration of the current run at power level PL1_x in scene_x (the duration of this round is T4) and the number of negative feedbacks (the number of negative feedbacks in this round is 0). That is, for the tuple (scene_x, PL1_x), it updates the total runtime duration_ttl(x) and the total number of negative feedbacks Neg_num(x), and deletes timer3. Correspondingly, the electronic device will also continue to explore lower gears based on the new secondary scene scene_y, with the gear exploration progress PL1_ynow saved in scene_y.

[0232] In this embodiment, the secondary scene scene_y can be referred to as the "fourth scene", and the gear PL1_x can be referred to as the "eighth power".

[0233] 5) Negative feedback was detected after running at power level PL1_x for a duration of T5 (T5≤Tq);

[0234] The electronic device saves the exploration progress PL1_xnow as PL1_x, adjusts the gear to the previous gear PL1_x+1, and updates duration_ttl(x) and Neg_num(x) based on the duration of the current run at power level PL1_x under scene_x (the duration of this round is T5) and the number of negative feedbacks (the number of negative feedbacks in this round is 1). That is, for the tuple (scene_x, PL1_x), the total runtime duration_ttl(x) is updated and the value of the total number of negative feedbacks Neg_num(x) is incremented by 1, and the timer3 is reset.

[0235] In this embodiment, gear PL1_x can be referred to as "the fifth power" and gear PL1_x+1 can be referred to as "the sixth power".

[0236] 6) The electronic device runs for a duration of Ta in the secondary scene_x;

[0237] The electronic device ends its power level exploration process for scene_x and saves the secondary scene feature value corresponding to scene_x and the negative feedback cycle of the electronic device at different power levels as scene_x scene data.

[0238] Figure 10 This example illustrates the process by which an electronic device explores a secondary scene according to the aforementioned gear exploration rules.

[0239] This explanation uses an example where Tq is 3s. Figure 10 As shown, data table 900 is used to record the information obtained by the electronic device in exploring each power level in each secondary scenario. This information includes the secondary scenario parameters, the running time of the electronic device in each secondary scenario at each power level, and the total number of negative feedbacks.

[0240] Assuming scene 90 is an electronic device in t 90 A secondary scene at any given moment. For example... Figure 10 As shown in (A), scene data 9001 will be stored as a new data entry in data table 900. At this time, the electronic device will store the secondary scene parameters of scene 90 in scene data 9001. In addition, the electronic device will also record all the levels of the maximum power that the CPU can supply in scene data 9001 (100% is level 10, 90% is level 9, and so on).

[0241] In t90 At time t, scene data 9001 already stores the runtime and total number of negative feedbacks collected during the exploration of some gears. Scene data 9001 shows that the electronic device did not experience any negative feedback when running at gears 10-7 in scene 90. 90 At that moment, the electronic device switches the CPU's maximum power supply level from level 7 to level 6.

[0242] Assume from t 90 At the start of the moment, the electronic device runs continuously at speed 6 for 2 seconds in scene 90, until t. 91 At this moment, the electronic device detects a negative feedback. Following the aforementioned gear-based exploration rules, the electronic device will save the exploration progress of scene 90 at gear 6, update the total runtime of running at gear 6 in scene 90 to 2 seconds, and the total number of negative feedbacks to 1. Furthermore, the electronic device will increase the gear by one to gear 7 to continue exploration.

[0243] like Figure 10 As shown in (B) in the figure, at t 91 At this point, the data area corresponding to the 6th level of scene data 9001 has already stored periodic information (2s, negative feedback 1), which means that up to t... 91 At that moment, the electronic device ran at level 6 in scene 90 for a total of 2 seconds, and received negative feedback once.

[0244] From t 91 At time t, after running for 3 seconds, the time is reached. 92 At any given moment, if the electronic device detects no negative feedback during the entire operation, according to the aforementioned gear exploration rules, it will update the current gear exploration progress to gear 7, update the total runtime for the exploration process at gear 7 to 6 seconds, and update the total number of negative feedback events to 0. Furthermore, the electronic device will use the random number function `random()` to obtain a random number falling within the interval (0,1), and then obtain the negative feedback count `n` for the next gear, gear 6 (where `n` equals 1). If the above random number is less than or equal to 1 / 2... n If the result is positive, the electronic device will adjust to gear 6; otherwise, it will continue operating at the current gear 7. Here, we assume that when n=1, the random number obtained by the electronic device is less than 1 / 2. n If the electronic device adjusts the gear to 6th gear to continue exploring.

[0245] like Figure 10 As shown in (C) in t 92At this moment, the data area corresponding to level 7 of scene data 9001 has already stored duration information (6s, negative feedback 0), and the data area corresponding to level 6 has already stored duration information (2s, negative feedback 1), indicating that up to t 92 At any given moment, the electronic device ran at scene 90 at level 7 for a total of 6 seconds, receiving 0 negative feedbacks; it ran at level 6 for a total of 2 seconds, receiving 1 negative feedback.

[0246] Assume from t 92 At the start of the moment, the electronic device runs continuously at speed 6 for 2.5 seconds under scene 90, reaching t. 93 If a negative feedback is received at a certain moment, then according to the above-mentioned gear exploration rules, the electronic device will save the gear exploration progress of scene 90 at gear 6, update the runtime of scene 90 at gear 6 to 4.5 seconds, and the number of negative feedbacks to 2. In addition, the electronic device will also increase the gear by one level to gear 7 to continue exploration.

[0247] like Figure 10 As shown in (D) in t 93 At this moment, the data area corresponding to the 6th level of scene data 9001 has already stored the duration information (4.5s, negative feedback 2), which means that up to t 93 At that moment, the electronic device ran at level 6 in scene 90 for a total of 4.5 seconds, and received negative feedback a total of 2 times.

[0248] From t 93 At the start of the moment, after running in 7th gear for 3 seconds, it reaches t. 94 At any given moment, if the electronic device detects no negative feedback during the entire operation, according to the gear exploration rules described above, the electronic device will save the current gear exploration progress as gear 7, update the total runtime of the exploration process for gear 7 to 9 seconds, and set the total number of negative feedbacks to 0. Similarly, the electronic device will use the random number function `random()` to obtain a random number falling within the interval (0,1), and then obtain the total number of negative feedbacks `n` for the next gear, gear 6 (where `n` equals 2). If the above random number is less than 1 / 2... n If the electronic device adjusts to gear 6, it will do so; otherwise, it will continue to operate at the current gear 7.

[0249] Here we assume that when n=2, the random number obtained by the electronic device is less than 1 / 2. n The electronic device will then adjust the gear to level 6 to continue exploring. For example... Figure 10 As shown in (E) in t 94At this moment, the data area corresponding to level 7 of scene data 9001 has already stored duration information (9s, negative feedback 0), and the data area corresponding to level 6 has already stored duration information (4.5, negative feedback 2), which means that up to t 94 At any given moment, the electronic device ran at scene 90 at level 7 for a total duration of 9 seconds, receiving 0 negative feedbacks; it ran at level 6 for a total duration of 4.5 seconds, receiving 2 negative feedbacks.

[0250] Assume from t 94 At the start of the moment, the electronic device runs continuously at speed 6 for 3 seconds under scene 90, until t. 95 At any given moment, no negative feedback was detected. Following the aforementioned gear-based exploration rules, the electronic device will save the exploration progress of scene 90 at gear 6, update the total runtime of running at gear 6 in scene 90 to 7.5 seconds, and the total number of negative feedback events to (2-0.2) = 1.8 times. Furthermore, the electronic device will downgrade the gear by one level to gear 6 and continue exploring.

[0251] like Figure 10 As shown in (F), at t 95 At this moment, the data area corresponding to the 6th level of scene data 9001 has already stored the duration information (7.5s, negative feedback 1.8), which means that up to t 95 At that time, the electronic device ran at level 6 in scene 90 for a total of 7.5 seconds, and received a total of 1.8 negative feedbacks.

[0252] From t 95 At time t, after running for 3 seconds, the time is reached. 96 time( Figure 10 (Not shown in the image). If the electronic device does not detect any negative feedback during the entire operation, according to the gear exploration rules described above, the electronic device will save the current gear exploration progress as gear 5, record the total running time of 3 seconds for the exploration process of gear 5, and the number of negative feedbacks as 0. In addition, the electronic device will obtain a random number falling within the interval (0,1) based on the random number function random(), and obtain the total number of negative feedbacks n for the next gear, gear 4 (at this time n equals 0). Understandably, at this point, 1 / 2... n The value of is 1, therefore the above random number must be less than 1 / 2. n If the electronic device detects negative feedback while running at 5th gear, it will record the total duration of operation at 5th gear and the total number of negative feedback events (1 event), and then adjust the gear to 6th gear.

[0253] During the subsequent gear exploration process, for any given gear, if the electronic device operates at that gear for 3 seconds without detecting negative feedback, it will determine whether to downgrade by one gear based on the random number function `random()` and the total number of negative feedback events for the next gear. The total number of negative feedback events for that gear (if not zero) will be reduced by 0.2 until scene90 exploration is complete. Similarly, for other secondary scenes, the electronic device can follow the same gear exploration rules to complete the gear exploration process for those scenes, which will not be elaborated upon here.

[0254] Understandably, applications (APPs) in electronic devices are constantly updated, and their performance requirements may change with each update. Therefore, in some embodiments, even after exploring the power levels of a secondary scene, the electronic device can reset the total runtime and total negative feedback counts recorded in the scene data of each secondary scene at a certain period (e.g., daily or weekly) (i.e., reset the negative feedback cycle for each power level). Before the start of each cycle, starting from the power level exploration progress recorded in the scene data for that secondary scene (the exploration progress for the first cycle is the maximum power level 10), the device continues to explore the power levels of the secondary scene again according to the aforementioned power level exploration rules 1)-5), and redetermines the negative feedback cycle for each power level. In this way, even with continuous APP updates, the electronic device can still accurately determine the optimal power level for each secondary scene.

[0255] Figure 11 The scene data obtained after the electronic device completed its exploration of the secondary scene is shown.

[0256] like Figure 11 As shown, Data Table 11 includes multiple valid data entries, which can be tens of thousands or hundreds of thousands of entries. Each valid data entry records the secondary scene parameters of a secondary scene, as well as the percentage of stuttering time when the electronic device is running at different power levels in that secondary scene.

[0257] As shown in scenario data 1101 in Table 11, this is valid data corresponding to a secondary scenario. The secondary scenario parameters include: focus application name - APP1 (APP is just a pronoun; in the actual scenario, it can be the specific application name, such as "Excel.exe"), focus application window size - 8 levels, electronic device download speed - 1 level, whether the camera is used - 0 (a camera parameter value of "1" indicates the camera is used, and "0" indicates the camera is not used), screen brightness - 10 levels...; Under this secondary scenario, the negative feedback cycle of the electronic device at each power level from level 10 to level 2 are: / , / , / , / , / , 900, 865, 24, 2 (the percentage of lag time corresponding to levels 6, 4, and 3 is not included due to space limitations). Figure 4 As shown in the figure, “ / ” indicates that the electronic device never detected negative feedback when running at this power level in the secondary scenario. From the percentage of stuttering time corresponding to each power level, it can be seen that as the maximum power that the CPU can supply decreases, the negative feedback cycle of the electronic device when running in the secondary scenario is also shortened accordingly, which means that the electronic device detects negative feedback more and more frequently.

[0258] It should be noted that none of the valid data entries in Valid Data Table 40 record the negative feedback cycle during electronic device operation when the power level is set to 1. This is because extensive experimental data shows that for most secondary scenarios, adjusting the maximum CPU power supply level of the electronic device to 1 causes frequent stuttering or even malfunction. Therefore, in step S202, when the electronic device explores the power levels of the secondary scenarios, to ensure normal user operation, the electronic device does not need to adjust the power level to 1 for any given secondary scenario. That is, the electronic device does not need to collect the stuttering duration percentage when operating at 1 power level; for a given secondary scenario, it only needs to explore the power level down to at least 2.

[0259] As explained above, for a completed secondary scenario, the electronic device can determine the minimum power level among all power levels with negative feedback cycles greater than the duration threshold Tb as the optimal power level for the secondary scenario. Taking a duration threshold Tb of 300s as an example, it can be seen from scenario data 1101 in Table 11 that the optimal power level for the secondary scenario to which scenario data 1101 belongs is level 4. Therefore, after determining the optimal power level for this secondary scenario, the electronic device can adjust the maximum power supply level of the CPU to level 4 and maintain operation at level 4 each time it enters this secondary scenario from other scenarios.

[0260] S203. When the running scenario changes from the current secondary scenario to a new secondary scenario, the electronic device adjusts the level of the maximum power that the CPU can supply according to the scenario data of the new secondary scenario. When the running scenario changes from the current secondary scenario to a primary scenario, the electronic device adjusts the level of the maximum power that the CPU can supply to the maximum level.

[0261] When the operating scenario changes from the current secondary scenario to a new secondary scenario, the electronic device can adjust the level of the maximum power that the CPU can supply in the new secondary scenario in the same way as in step S201. This will not be explained in detail here.

[0262] It is important to note that parameters in the secondary scene, such as the size of the focused application window, the memory usage of the focused application, download speed, screen brightness, RAM, integrated graphics card load rate, dedicated graphics card load rate, and hard drive write speed, may change frequently during the operation of the electronic device. To avoid the electronic device frequently adjusting the maximum CPU power supply level due to the influence of these parameters, in one optional implementation, the electronic device can discretize the values ​​of these parameters into different levels. When determining whether a change has occurred in the secondary scene, for these parameters, only a change in the level corresponding to their value is considered a change in the secondary scene.

[0263] Taking the download speed of electronic devices as an example, and combining it with... Figure 12 The specific meaning of the above discretization process will be explained. For ease of understanding, it is assumed here that the download speed of the electronic device is a minimum of 0 kb / s and a maximum of 2028 kb / s. Then, as follows... Figure 12 As shown, the download speed range of the electronic device is [0, 2028]. This range can be divided into four sub-ranges: sub-range 1201, sub-range 1202, sub-range 1203, and sub-range 1204, with corresponding ranges of [0, 500], [400, 1024], [900, 1500], and [1400, 2028], respectively. The corresponding download speed levels are 1, 2, 3, and 4.

[0264] When determining the level of a secondary scene, a switch is only considered to have occurred when the download speed value changes to a certain level. Furthermore, to prevent the download speed value from fluctuating between adjacent intervals and causing the corresponding level to change, each pair of adjacent levels has a partially overlapping area. During level determination, if the current download speed falls within this overlapping area, the level corresponding to that download speed is considered the same as the level corresponding to the previous download speed. For example, suppose at a certain moment, the download speed of an electronic device is 250kb / s, which falls within the interval [0, 500], so its corresponding speed level is 1. At the next moment, the download speed changes to 450kb / s, falling into both the intervals [0, 500] and [400, 1024]. However, since the previous download speed fell within the interval [0, 500], the electronic device will still classify 450 as belonging to the interval [0, 500], meaning the corresponding download speed level remains 1. If, at the next moment, the download speed changes to 600kb / s, this value only falls within the interval [400, 1024], and its corresponding download speed level is 2. Only then will the electronic device recognize that the secondary scene feature of download speed has changed, indicating a change in the secondary scene.

[0265] Similarly, for parameters such as the size of the focused application window, the memory usage of the focused application, and the screen brightness, electronic devices can also discretize them to obtain multiple levels. Only when the levels corresponding to these parameters change is it determined that a change in the secondary scene has occurred. Furthermore, Figure 12 The division of gear intervals in this paper is only for ease of understanding. In actual application scenarios, the endpoint values ​​of the sub-intervals obtained by dividing the secondary feature intervals by electronic devices may be different, and the number of sub-intervals may also be different. This application does not limit this.

[0266] When the operating scenario changes from the current level 2 scenario to a level 1 scenario (including emergency level 1 scenario and general level 1 scenario), the electronic device can adjust the maximum power supply level of the CPU to the maximum level. If it is an emergency level 1 scenario, the electronic device can keep the maximum power supply level of the CPU at the maximum level 10 until the emergency level 1 scenario ends. If it is a general level 1 scenario, after adjusting the maximum power supply level of the CPU to the maximum level 10, the electronic device can dynamically adjust the maximum power supply level of the CPU in the general level 1 scenario in the same way as the aforementioned step S103 until the general level 1 scenario ends. This will not be elaborated further here.

[0267] The electronic device provided in this application will now be described.

[0268] The electronic device may be a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or dedicated camera (such as SLR camera, point-and-shoot camera), etc. This application does not limit the specific type of the electronic device.

[0269] Figure 13 The structure of the electronic device is shown as an example.

[0270] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, audio module 170, speaker 170A, microphone 170C, headphone jack 170D, button 190, indicator 192, camera 193, display screen 194, etc.

[0271] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0272] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0273] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0274] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0275] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0276] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be housed in the same device.

[0277] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel.

[0278] Camera 193 is used to capture still images or videos.

[0279] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0280] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.

[0281] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0282] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0283] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0284] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0285] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0286] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0287] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0288] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0289] Processor 110 implements a performance feedback mechanism. Specifically, processor 110 can bind each of its CUU cores (or logical processors) to a thread / process. These threads / processes act as producers, sending messages to the same message queue. Each CPU core is required to write M messages to the message queue per second. Furthermore, processor 110 can also construct a thread / process (which may not be bound to a CPU core) as a message receiver. This message receiver can act as a consumer, counting the number of messages sent per second by each thread / process bound to a CPU core from the message queue. When the number of messages written to the message queue by any CPU core in one second is less than M, processor 110 determines that a negative feedback has been detected, indicating that the current performance is insufficient to meet performance requirements. Conversely, when the number of messages written to the message queue by all CPU cores in one second remains at M, processor 110 determines that a positive feedback has been detected, indicating that the current performance meets performance requirements.

[0290] The processor 110 is used to adaptively reduce the maximum power supply level of the CPU to reduce the power consumption of electronic devices when the performance is sufficient in general Level 1 and Level 2 scenarios; correspondingly, when the performance may be insufficient, it adaptively increases the maximum power supply level of the CPU to reduce the power consumption of electronic devices.

[0291] The processor 110 is also used to acquire scene data of the secondary scene in the secondary scene, and adjust the maximum available power of the CPU in the secondary scene according to the acquired scene data. The electronic device 100 can store the acquired scene data in the memory of the processor 110 or in an external memory connected through the external memory interface 120.

[0292] During the operation of electronic device 100, if electronic device 100 is in a charging state, charging management module 140 can send a prompt message to processor 110. This prompt message is used to notify processor 110 that electronic device 100 is currently in a charging state, so that processor 110 can maintain the maximum power supply level of the CPU at the maximum power level. That is, when electronic device 100 is in a charging state, electronic device 100 has a source of power supply, so electronic device 100 can always maintain the performance supply at the maximum value, ensuring sufficient performance supply.

[0293] If the electronic device 100 is in a power-off state, the processor 110 can determine the operating scenario characteristics of the electronic device 100 and determine the required power value or power level that the processor 110 can supply based on the operating scenario category. For specific determination methods, please refer to the aforementioned related descriptions.

[0294] This application also provides an electronic device, which includes one or more processors and a memory; wherein the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the methods shown in the foregoing embodiments.

[0295] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

[0296] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0297] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A power adjustment method, characterized in that, The method includes: The electronic device is determined to operate at the maximum power supplied by the central processing unit (CPU) for a period of time until a first duration is reached and no negative feedback is detected. The maximum available power of the CPU is adjusted to a second power, which is less than the first power. The absence of detected negative feedback includes the following: the number of messages written per second to the target message queue by multiple target threads that are respectively bound to multiple CPU cores of the electronic device is a first value.

2. The method according to claim 1, characterized in that, The electronic device is in a first scenario, which includes a scenario where the electronic device detects an interactive event. The first power is the maximum power that the CPU can supply. Before the duration of the electronic device operating at the maximum power that the CPU can supply reaches the first power reaches a first duration and no negative feedback is detected, the method further includes: A first-level event was detected; the first-level event is an interaction event between the user and the electronic device. If the interval between the start time of the first level event and the start time of the second level event is greater than a first threshold, and the start time of the first level event and the start time of the third level event are greater than a second threshold, it is determined that the electronic device has entered the first scenario. The second level event is the most recently detected user-electronic device interaction event before the first level event, and the third level event is the event in which the maximum available power of the CPU needs to be maintained at the maximum power.

3. The method according to claim 1 or 2, characterized in that, In the first scenario, the electronic device operates at a third power, which is the maximum power supplied by the CPU, and the third power is less than or equal to the maximum power. The method further includes: If the CPU operates at the third power (maximum available power) for less than the first duration and negative feedback is detected, the CPU's maximum available power is adjusted to a fourth power, which is greater than the third power and less than or equal to the maximum power. The detection of negative feedback includes: any one of the multiple target threads that are respectively bound to the multiple CPU cores of the electronic device writes less than the first value per second to the target message queue.

4. The method according to claim 3, characterized in that, After adjusting the maximum available power of the CPU to the fourth power, the method further includes: If the CPU operates at the third power at its maximum available power for a duration equal to the first duration and no negative feedback is detected, the CPU's maximum available power will be maintained at the third power.

5. The method according to claim 3, characterized in that, After adjusting the maximum available power of the CPU to the fourth power, the method further includes: Increase the value of the number of negative feedbacks corresponding to the fourth power. The number of negative feedbacks corresponding to the fourth power represents the total number of times the electronic device detects negative feedback during the total duration of operation at the fourth power in the first scenario. If the CPU operates at the third power at its maximum available power for a duration equal to the first duration and no negative feedback is detected, the maximum available power of the CPU is adjusted to the fourth power or kept at the third power based on the number of negative feedbacks corresponding to the fourth power; wherein, the larger the number of negative feedbacks corresponding to the fourth power, the lower the probability of adjusting the maximum available power of the CPU to the second power.

6. The method according to any one of claims 3-5, characterized in that, The step of adjusting the maximum available power of the CPU to the fourth power includes: If the time interval between the start time of the detected negative feedback and the start time of the first-level event when the CPU is running at the third power with the maximum available power is greater than a third threshold, the maximum available power of the CPU will be adjusted to the fourth power.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Upon entering the first scene, a fourth level event is detected, determining that the electronic device has entered the second scene, and the maximum available power of the CPU is adjusted to the maximum power. The fourth level event is an event that requires the maximum available power of the CPU to be maintained at the maximum power.

8. The method according to any one of claims 1-6, characterized in that, The method further includes: After entering the first scene, if no sixth level event is detected within the second time period after the fifth level event is detected, but a first level event is detected, the electronic device is determined to enter the third scene, and the maximum available power of the CPU is adjusted to the fifth power. The sixth level event is an interaction event between the user and the electronic device or an event that requires the maximum available power of the CPU to be maintained at the maximum power. The first level event is an event in which the electronic device runs the focused application. Wherein, when the total runtime of the electronic device in the third scenario is 0, the fifth power is the maximum power; when the total runtime of the electronic device in the third scenario is greater than 0 and less than the third duration, the fifth power is the power value last used by the electronic device when it was in the third scenario; when the total runtime of the electronic device in the third scenario is greater than the third duration, the fifth power is the optimal power corresponding to the electronic device in the third scenario. The optimal power corresponding to the electronic device in the third scenario is determined by the minimum power that meets the first condition in the scenario data of the third scenario. The first condition is that the average negative feedback period is greater than the fourth duration. The scenario data of the third scenario includes multiple maximum CPU supply power and the average negative feedback period corresponding to the electronic device running in the third scenario at the multiple maximum CPU supply power respectively. The average negative feedback period is the ratio of the total runtime of running at the maximum CPU supply power to the number of negative feedbacks.

9. The method according to claim 8, characterized in that, After adjusting the maximum power supply to the CPU to four power levels, the method further includes: In the third scenario, if the first duration is not reached when the CPU operates at the fifth power (maximum available power), and negative feedback is detected, the maximum available power of the CPU is adjusted to the sixth power, and the number of negative feedback events corresponding to the fifth power is increased. The sixth power is greater than the fifth power and less than or equal to the maximum power, and the number of negative feedback events corresponding to the fifth power represents the total number of times the electronic device detects negative feedback within the total duration of operation at the fifth power in the third scenario.

10. The method according to claim 8, characterized in that, After adjusting the maximum power supply to the CPU to five, the method further includes: In the third scenario, if the CPU operates at the fifth power with the maximum available power for the CPU for the first duration and no negative feedback is detected, and if the number of negative feedbacks corresponding to the fifth power is not 0, the value of the number of negative feedbacks corresponding to the fifth power is reduced. The maximum available power of the CPU is adjusted to the seventh power or kept at the fifth power based on the number of negative feedbacks corresponding to the seventh power. The seventh power is less than the fifth power, and the more negative feedbacks corresponding to the seventh power, the lower the probability of adjusting the maximum available power of the CPU to the seventh power.

11. The method according to claim 8, characterized in that, After adjusting the maximum power supply of the CPU to a certain value, the method further includes: If a second or secondary event is detected when the electronic device is running at the eighth power in the third scenario, it is determined that the scenario in which the electronic device is located has switched from the third scenario to the fourth scenario. The exploration progress of the third scene is saved as the eighth power, and the exploration progress is the maximum CPU power that the electronic device can supply when it enters the corresponding running scene next time. Determine the exploration progress of the fourth scenario, and adjust the maximum available CPU power of the electronic device to the power corresponding to the exploration progress of the fourth scenario.

12. An electronic device, characterized in that, The electronic device includes: one or more processors, memory, and a display screen; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11.

13. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-11.

14. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-11.