Power adjustment method and related apparatus
By detecting the operating scenario in the terminal device and using a power prediction model to adjust the maximum power that the CPU can supply, the problem of excessive power consumption of the terminal device under non-charging conditions is solved, and the effect of extending the device's usage time and reducing power consumption is achieved while ensuring user experience.
Patent Information
- Application Number
- CN202310963633.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2043-07-31
AI Technical Summary
Terminal devices such as laptops consume too much power when not being charged, causing the device to shut down automatically and affecting the user experience.
By detecting different operating scenarios, the maximum power that the CPU can supply is adjusted using a power prediction model to reduce power consumption without compromising user experience. This includes determining the optimal power in the primary and secondary scenarios and adjusting it to the maximum power in the primary scenario.
It effectively extends the usage time of terminal devices, reduces power consumption, and ensures the continuity of user experience and device performance.
Smart Images

Figure CN119440219B_ABST
Abstract
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 very quickly. Especially for portable devices like laptops, users may need to use them in environments without charging facilities. If the device's power is consumed too quickly, it may automatically shut down due to depletion of 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 determine the optimal power that the CPU can supply under the current primary / secondary level scenario, thereby minimizing the power consumption of the electronic device while ensuring a good user experience and effectively extending the device's lifespan.
[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, the method comprising: detecting a first primary secondary event and determining that an electronic device is in a first primary secondary scenario, the first primary secondary event including an event in which the electronic device runs a focused application when no primary event is detected; predicting the first primary secondary scenario based on a power prediction model to obtain a first prediction result, the first prediction result including multiple maximum available power supplies for CPUs and the probability of user experience impairment corresponding to running at the multiple maximum available power supplies for CPUs in the first primary secondary scenario, the probability of user experience impairment being the probability that the proportion of stuttering time when running at the maximum available power supplies for CPUs is greater than a first threshold; adjusting the maximum available power supplies for CPUs of the electronic device according to a first optimal power, the first optimal power being determined by the minimum power in the first prediction result that meets a first condition, the first condition being that the probability of user experience impairment is less than or equal to a second threshold.
[0007] In this method, the first primary secondary scene can be any primary secondary scene, and the primary secondary scene includes events where the electronic device runs the focused application when no primary event is detected. The first optimal power can be the minimum power in the first prediction result that meets the first condition.
[0008] In this method, the electronic device can adjust the maximum available CPU power to different values for different operating scenarios. It should be understood that different operating scenarios have different performance requirements for the electronic device. For example, all other things being equal, the performance requirements of the electronic device may be higher when the user is watching a video than when the user is not watching a video; similarly, the performance requirements of the electronic device may be higher when multiple external devices are connected than when no external devices are connected.
[0009] In these scenarios, secondary scenarios are operating scenarios with lower performance requirements for electronic devices. When an electronic device does not detect a primary event, it is considered to have entered a secondary scenario. Since the focus application is the scenario with the highest user attention, this method allows the electronic device to prioritize the performance requirements of the primary secondary scenario related to the focus application within the secondary scenario. In this method, the electronic device can uniquely determine a primary secondary scenario using these performance requirement-related parameters (hereinafter referred to as primary secondary scenario parameters). These parameters may include one or more of the following: focus application, focus application window size, focus application memory usage, whether video is being watched, download speed, whether a camera is being used, whether audio is being played, external device type, whether a keyboard is being used, device screen brightness, available device RAM, integrated graphics card load rate, discrete graphics card load rate, and hard drive write speed. Other parameters may also be included, which are not limited in this application.
[0010] When an electronic device is in any primary secondary scenario (e.g., the first primary secondary scenario), it can use the aforementioned power prediction model to predict the primary secondary scenario and obtain a prediction result. Specifically, the electronic device can obtain the primary secondary scenario parameters as input to the power prediction model, which then outputs a prediction result. This prediction result includes the probability that the percentage of stuttering time corresponding to the maximum available power of each CPU is greater than the first threshold when the electronic device is running at the maximum available power of the multiple CPUs (i.e., the probability that the user experience will be affected when running at the maximum available power of each CPU in the primary secondary scenario). Afterward, the electronic device can further determine the optimal power for the primary secondary scenario based on this prediction result. This optimal power is determined by the minimum power among the maximum available CPU powers that meet the first condition in the prediction result, where the probability of user experience impairment is less than or equal to the second threshold.
[0011] Understandably, the higher the percentage of stuttering time when running at the maximum available CPU power in a given scenario, the less the performance provided by that CPU's maximum available power can meet the performance requirements of that scenario. When the percentage of stuttering time exceeds a threshold (i.e., the first threshold), the user experience will be compromised. Therefore, after obtaining the first prediction result, the electronic device can use the second threshold to determine the maximum available CPU power that will harm the user experience (i.e., meets the first condition) in the first prediction result. The first optimal power is the smallest maximum available CPU power among those that meet the first condition. Since a lower maximum available CPU power results in a lower CPU performance supply and correspondingly lower power consumption for the electronic device, the first optimal power is the maximum available CPU power that will not harm the user experience and has the lowest power consumption for the electronic device among the multiple maximum available CPU power options. (Probability of User Experience Degradation)
[0012] Optionally, the first threshold can be 0.03, and the second threshold can be 0.5.
[0013] Optionally, the power prediction model can be a binary classification model, specifically a logistic regression model, a decision tree model, a random forest model, a neural network model, a GBDT model, an XGboost model, a LightGBM model, or other types of models. This application does not limit the specific type of model.
[0014] Optionally, the electronic device can execute this method only when it is not charging. That is, the electronic device will adjust the maximum available CPU power based on the power prediction model in the primary and secondary scenarios only when it is not charging. Since the electronic device has sufficient power supply when charging, it does not need to adjust the maximum available CPU power based on the operating scenario. Instead, it will always maintain the maximum available CPU power at its maximum, prioritizing the performance requirements of the electronic device.
[0015] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum CPU supply power of the electronic device according to the first optimal power, the method further includes: detecting a primary event, determining that the scene in which the electronic device is located has switched from the first primary secondary scene to a primary scene, the primary scene including the running scene in which the electronic device detects an interactive event; and adjusting the maximum available CPU supply power of the electronic device to the maximum power.
[0016] In this embodiment, the first-level events may include: 1. User interaction events with the electronic device. For example, user actions such as clicking a mouse button, scrolling the mouse wheel (but not moving the mouse cursor), using keyboard shortcuts (shortcut keys may 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 may also include other shortcut keys, as well as combinations of multiple shortcut keys), and switching the focus application. 2. High-load events of the electronic device. For example, events where the electronic device's CPU is under high load, events where the electronic device enters game mode, etc.
[0017] When a Level 1 event occurs, the electronic device is in a Level 1 scenario. Because Level 1 events place high performance demands on electronic devices, in a Level 1 scenario, the electronic device will directly adjust the CPU's maximum available power to the maximum power to ensure 100% performance.
[0018] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum CPU supply power of the electronic device according to the first optimal power, the method further includes: detecting a second primary secondary event, determining that the scenario in which the electronic device is located has switched from the first primary secondary scenario to a second primary secondary scenario, the second primary secondary scenario being different from the first primary secondary scenario; predicting the second primary secondary scenario based on the power prediction model to obtain a second prediction result, the second prediction result including the maximum available power of the plurality of CPUs, and the probability of user experience impairment corresponding to running at the maximum available power of the plurality of CPUs respectively in the second primary secondary scenario; adjusting the maximum available CPU supply power of the electronic device according to the second optimal power, the second optimal power being determined by the minimum power in the second prediction result that meets the first condition.
[0019] Optionally, the second optimal power may be the minimum power in the second prediction result that meets the first condition.
[0020] As explained above, an electronic device can uniquely identify a primary secondary scene using primary secondary scene parameters. If any parameter in the primary secondary scene parameters changes, the electronic device can determine to switch from the current primary secondary scene (i.e., the first primary secondary scene) to a new primary secondary scene (i.e., the second primary secondary scene). At this point, the electronic device can determine the optimal power of the new primary secondary scene based on the aforementioned power prediction model and adjust the maximum available CPU power to match the optimal power of the new primary secondary scene.
[0021] In conjunction with the first aspect, in one possible implementation, before adjusting the maximum available CPU power of the electronic device according to the first optimal power, the method further includes: detecting a first secondary event, determining that the electronic device is in a first secondary scenario, the first secondary event including a running scenario related to a background application when no interaction event is detected; predicting the first secondary scenario based on the power prediction model to obtain a second prediction result, the second prediction result including the maximum available CPU power of the plurality of CPUs, and the probability of user experience impairment corresponding to running at the maximum available CPU power of the plurality of CPUs respectively in the first secondary scenario; adjusting the maximum available CPU power of the electronic device according to the first optimal power includes: adjusting the maximum available CPU power of the electronic device to the largest power among the first optimal power and the first optimal power, the first optimal power being determined by the minimum power in the third prediction result that meets the first condition.
[0022] Optionally, the first optimal power can be the minimum power in the third prediction result that meets the first condition.
[0023] Understandably, for electronic devices like computers, users may open multiple applications simultaneously, including the main application and background applications. Therefore, during operation, electronic devices need to meet the performance requirements of both the main application and background applications. In some cases, the performance requirements of background applications are even higher than those of the main application.
[0024] Understandably, a primary secondary scene and an auxiliary secondary scene can coexist within a secondary scene. In this embodiment, within the same secondary scene, the auxiliary secondary scene parameters differ from the primary secondary scene parameters only in three parameters: application, application window size, and application memory usage. All other parameters are identical, and the focused application and background application can be interchanged. Therefore, the auxiliary secondary scene parameters can also serve as input to the aforementioned power prediction model, which outputs the probability of user experience impairment corresponding to each power level in the auxiliary secondary scene. This allows the electronic device to further determine the suboptimal power level of the auxiliary secondary scene.
[0025] Therefore, in this embodiment, the electronic device can also determine an optimal power corresponding to the first primary secondary scenario in the current secondary scenario based on the power prediction model, and determine the first optimal power of the first secondary auxiliary scenario in the current secondary scenario based on the power prediction model. The maximum power among the first optimal power and the first optimal power of the first secondary auxiliary scenario is determined as the optimal power of the secondary scenario, thereby satisfying the performance requirements of the background application while meeting the performance requirements of the focus application.
[0026] Optionally, the background application corresponding to the first secondary scenario is an application with a high CPU load other than the focus application.
[0027] Optionally, the electronic device can have multiple background applications, and therefore, the electronic device can also have multiple secondary scenarios. Thus, the electronic device can obtain the suboptimal power of multiple secondary scenarios, including the first secondary scenario, based on the power prediction model, and determine the maximum CPU supply power among the first optimal power and the multiple suboptimal powers of the multiple secondary scenarios as the power of the secondary scenario.
[0028] In conjunction with the first aspect, in one possible implementation, before detecting that the electronic device is in a first primary secondary scene, the method further includes: obtaining a training dataset based on a valid dataset; the training dataset includes training data for multiple primary secondary scenes, the primary secondary scenes including scenes related to the focused application when the electronic device does not detect interactive events, the training data including label values corresponding to the maximum available power of each CPU in the primary secondary scene, the label values including a first label value and a second label value, the first label value indicating that the probability of the electronic device running at the corresponding power is less than or equal to a first threshold, and the second label value indicating that the probability of the electronic device running at the corresponding power is greater than the first threshold; and training the power prediction model based on the training dataset.
[0029] In this embodiment, the valid data in the valid data set actually records the runtime and lag duration of the electronic device running at the maximum power supplied by the multiple CPUs in each primary and secondary scenario. It should be understood that lag may occur even when the electronic device is running at its highest power level in some primary and secondary scenarios. Therefore, for any primary and secondary scenario, when the electronic device is running at a certain power, lag does not necessarily mean a compromised user experience. The specific determination depends on the probability of lag occurring at that power level, which can be reflected by the percentage of lag duration at that power level. Therefore, in this embodiment, the electronic device needs to first determine whether the user experience is compromised based on the percentage of lag duration at each power level for each primary and secondary scenario. Specifically, the electronic device can set a damage threshold (i.e., the first threshold), and compare the percentage of stuttering time corresponding to each power level in each primary and secondary scenario in the valid data with the damage threshold. If the percentage of stuttering time corresponding to a certain power level is less than or equal to the damage threshold, it means that the user experience is not damaged when running at that power level, and the electronic device can update the value corresponding to that power level (i.e., the percentage of stuttering time, the same below) to the second label value; conversely, if the percentage of stuttering time corresponding to a certain power level is greater than the damage threshold, it means that the user experience is damaged when running at that power level, and the electronic device can update the value corresponding to that power level to the first label value.
[0030] In conjunction with the first aspect, in one possible implementation, the effective dataset includes multiple sets of effective data from primary and secondary scenarios. The effective data includes the runtime and lag duration of the electronic device operating at multiple different maximum CPU power supplies in the primary and secondary scenarios. Obtaining the training dataset based on the effective dataset includes: determining the proportion of lag duration in the effective data where the electronic device operates at multiple different maximum CPU power supplies, where the lag duration proportion is the ratio of lag duration to runtime; if the lag duration proportion is less than or equal to the first threshold, then the label value of the corresponding maximum CPU power supply in the effective data is determined as the first label value; if the lag duration proportion is greater than the first threshold, then the label value of the corresponding maximum CPU power supply in the effective data is determined as the second label value.
[0031] Therefore, in this embodiment, the electronic device can perform an encoding operation that maps non-numerical data in the valid data to numerical values, that is, create a mapping table to store the mapping relationship between discrete feature values and custom numerical values, so as to ensure that the electronic device can correctly read the features of discrete values recorded in the valid data.
[0032] In conjunction with the first aspect, in one possible implementation, before obtaining the training dataset based on the effective dataset, the method further includes: operating at a first power with the maximum available CPU power in a first primary-secondary scenario; adjusting the maximum available CPU power to a second power after the duration of operation at the first power reaches a first duration without any stuttering; the first power and the second power are included in the plurality of different maximum available CPU power, the second power being less than the first power, and the effective dataset including effective data from the first primary-secondary scenario, the effective data from the first primary-secondary scenario including the runtime and stuttering duration of operation at the first power.
[0033] It should be understood that when an electronic device operates at the maximum CPU power in a primary / secondary scenario, the smoother the operation (i.e., the fewer stutters), the better the performance provided by the maximum CPU power meets the performance requirements of the primary / secondary scenario. This also indicates that the performance provided by the electronic device may have a significant amount of performance remaining after meeting the performance requirements of the primary / secondary scenario. In this case, the electronic device can appropriately reduce the maximum CPU power to reduce performance and further reduce power consumption. Therefore, in this embodiment, when the electronic device operates at the first power (the maximum CPU power), if the duration of operation at the first power reaches a first duration without stuttering, the electronic device can first save the total duration of operation at the first power (i.e., the first duration) and the stuttering duration (i.e., the stuttering duration of 0), and then reduce the maximum CPU power to the second power. Optionally, the electronic device can gradually reduce the maximum CPU power from high to low.
[0034] In this way, the maximum available power of the CPU of the electronic device can be quickly adjusted to the optimal power of the first primary and secondary scenarios, and it can operate at as many different maximum available power of the CPU as possible within a limited time, so that the effective data of the first primary and secondary scenarios is richer, and the optimal power of the first primary and secondary scenarios determined based on the effective data of the first primary and secondary scenarios is more accurate.
[0035] In conjunction with the first aspect, in one possible implementation, the method further includes: if the duration of operation at the first power does not reach the first duration and a stutter occurs, adjusting the maximum available power of the CPU to a third power; the third power is included in the plurality of different maximum available power of the CPU, the third power is greater than the first power, and the effective data of the first primary and secondary scenarios includes the duration of operation at the first power and the duration of stuttering.
[0036] In this embodiment, when a lag occurs, the electronic device will increase its power level by one level. This effectively avoids the impact of data randomness on the accuracy of the results. Taking the aforementioned first duration of 30 seconds as an example, assuming that the probability of a lag occurring when the electronic device is running at the first power level in the first master-secondary scenario is very small, actually 0.05, but the electronic device runs for 30 seconds at the first power level and lags for 3 seconds (a low-probability event). If the power is simply continued to decrease, the total running time and total lag time corresponding to the first power level will not be updated. Therefore, the proportion of lag time corresponding to the first power level calculated by the electronic device is 3 / 30 = 0.1, which is twice the actual probability of a lag. However, if the power is increased to the third power level, the probability of a lag occurring when the electronic device is running at the third power level in the first master-secondary scenario is even smaller, and there is a very high probability that a lag will not occur within 30 seconds. Therefore, after 30 seconds, the electronic device will decrease its power back to the first power level. Since the probability of lag occurring when the electronic device operates at the first power in the first primary-secondary scenario is extremely small, it is highly likely that the electronic device will not lag within 30 seconds when operating at the first power again. Therefore, the total operating time and total lag time corresponding to the first power will be updated to 60 seconds and 3 seconds, respectively. Thus, the lag time percentage corresponding to the first power is calculated to be 3 / 60 = 0.05. This value is closer to the actual lag probability corresponding to the first power, thereby reducing or even avoiding the impact of data randomness on the accuracy of the results.
[0037] In conjunction with the first aspect, in one possible implementation, the method further includes: detecting a third primary secondary event while running at the first power in the first primary secondary scenario; determining that the scenario in which the electronic device is located has switched from the first primary secondary scenario to the third primary secondary scenario, the third primary secondary scenario being different from the first primary secondary scenario; saving the exploration progress of the first primary secondary scenario as the first power, the exploration progress being the maximum CPU power that the electronic device will use when it enters the corresponding running scenario next time; determining the exploration progress of the third primary secondary scenario; adjusting the maximum CPU power that the electronic device can supply to be adjusted to the power corresponding to the exploration progress of the third primary secondary scenario; the effective dataset further includes effective data of the third primary secondary scenario.
[0038] Understandably, the operating environment of an electronic device may change constantly during its actual operation. Therefore, if the electronic device operates at the first power in the first primary secondary scenario, and if it has not yet run for a sufficient period of time (i.e., has not yet reached a point where it can operate at a sufficient amount of maximum CPU power), and the primary secondary scenario changes to another primary secondary scenario, the electronic device will save the runtime and stuttering duration of this operation at the first power, and record the power exploration progress (i.e., the first power) in the first primary secondary scenario. This allows the electronic device to start from the first power and gradually reduce the maximum CPU power from high to low when the primary secondary scenario changes back to the first primary secondary scenario, and to collect the runtime and stuttering duration corresponding to each power level in the first primary secondary scenario. Correspondingly, when the electronic device switches from the second primary secondary scene to other scenes, the power exploration progress in the second primary secondary scene is also recorded (if it is the first time entering the second primary secondary scene, the power exploration progress is the maximum power by default). Therefore, after the electronic device enters the second primary secondary scene, it will gradually reduce the maximum power that the CPU can supply from high to low based on the power exploration progress of the second primary secondary scene, and collect the runtime and lag time corresponding to each power in the second primary secondary scene.
[0039] In conjunction with the first aspect, in one possible implementation, the effective data of the first primary secondary scenario includes the runtime and lag duration of the electronic device running at the maximum available power of the plurality of different CPUs during the second duration, when the total running time of the electronic device in the first primary secondary scenario reaches the second duration.
[0040] The valid data for the first primary secondary scenario includes the runtime and stuttering duration of the electronic device operating at the multiple different maximum CPU power supplies during the second runtime, assuming the total runtime of the electronic device in the first primary secondary scenario reaches the second runtime. To avoid endless adjustments to the maximum CPU power supply for a single primary secondary scenario, in this embodiment, for any given primary secondary scenario, when the total runtime of the electronic device in that scenario reaches the second runtime, it can be considered that the electronic device has essentially determined the optimal power for that primary secondary scenario based on the data obtained. At this point, the original data corresponding to that primary secondary scenario is considered valid data, and that primary secondary scenario can be referred to as a valid primary secondary scenario.
[0041] Understandably, for a valid primary / secondary scenario where valid data has been acquired, the electronic device does not necessarily need to operate at the maximum available CPU power in that scenario. For example, suppose that in the first primary / secondary scenario, the electronic device experiences lag every time it runs at the first power. In some embodiments, the electronic device needs to increase its power due to lag. Therefore, it is very likely that even after the total runtime of the electronic device in the first primary / secondary scenario reaches the second duration, the electronic device may not be operating at a lower maximum available CPU power than the first power. However, since the electronic device experiences stuttering every time it runs at the first power level in the first master-secondary scenario, it is highly probable that it will also frequently stutter when running at a lower maximum CPU power in the same scenario. In other words, running at the first power or a lower maximum CPU power in the first master-secondary scenario will severely damage the user experience. The first power or a lower maximum CPU power is highly likely not the optimal power for the first master-secondary scenario. Therefore, whether the device has run at the first power or a lower maximum CPU power in the first master-secondary scenario and obtained the corresponding runtime and stuttering duration is irrelevant. During model training, the electronic device can set the label value of gears with empty information in the valid data to "0", indicating that running at these gears will cause a degraded user experience.
[0042] In conjunction with the first aspect, in one possible implementation, the first duration is 30 seconds, and / or the second duration is 600 seconds.
[0043] In conjunction with the first aspect, in one possible implementation, the amount of running data in the training dataset is greater than a third threshold.
[0044] It should be understood that the amount of data required for model training is enormous. Therefore, in this embodiment, the electronic device will only train the power prediction model based on the collected valid data if the number of valid data in the valid dataset is greater than or equal to X. Specifically, X can be set to 50,000, 100,000, or other values, depending on the performance requirements of the power prediction model, and this application does not limit this setting.
[0045] Optionally, since model training places significant demands on device performance and power consumption, the electronic device can train the power prediction model while charging and with the screen off (but the device still powered on), once the training dataset is available. Understandably, charging ensures the device has sufficient power for training. With the screen off, other processes and applications minimize their power consumption, allowing the device to provide more power and performance for training. Furthermore, a screen-off screen indicates the user is not using the device, so even if training consumes a significant portion of the device's performance, it won't negatively impact the user experience.
[0046] In conjunction with the first aspect, in one possible implementation, adjusting the maximum CPU supply power of the electronic device according to the optimal power includes: adjusting the maximum CPU supply power of the electronic device to the optimal power; or, adjusting the maximum CPU supply power of the electronic device to a target power, wherein the target power is any one of the optimal power, the fourth power, and the fifth power as the maximum CPU supply power, the fourth power is less than the target power, the fifth power is greater than the target power, the fourth power and the fifth power belong to the plurality of different maximum CPU supply power, and the difference between the optimal power and the fourth power, and the difference between the optimal power and the fifth power are both less than a fourth threshold.
[0047] Understandably, applications (APPs) on electronic devices are constantly updated, and their performance requirements may change with each update. However, these changes in performance requirements are generally not drastic at once. Therefore, in this embodiment, after determining the first optimal power for the first primary and secondary scenarios based on the prediction model, the electronic device can adjust the maximum CPU power supply level to any one of the following: the first optimal power, a power slightly higher than the first optimal power (i.e., the fifth power), or a power slightly lower than the first optimal power (i.e., the fourth power), to adapt to changes in performance requirements caused by application updates.
[0048] In conjunction with the first aspect, in one possible implementation, after adjusting the maximum CPU supply power of the electronic device according to the optimal power, the method further includes: collecting feedback data, the feedback data including the runtime and lag duration of operation at the adjusted maximum CPU supply power; and updating the power prediction model based on the feedback data.
[0049] In this embodiment, the feedback data may include the operating time and lag time of the electronic device under the last power adjustment. The electronic device can update the effective data corresponding to the first primary and secondary scenarios based on the acquired feedback data, and update the power prediction model based on the updated effective data. That is, it can train a new prediction model using the updated effective data so that the power prediction model can maintain the accuracy of the prediction results even when the application APP is constantly updated.
[0050] In a second aspect, embodiments of this application provide an electronic device, the electronic device comprising: one or more processors and a memory; 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, and the one or more processors invoking the computer instructions to cause the electronic device to perform the method in the first aspect or any possible implementation of the first aspect.
[0051] Thirdly, a chip system is provided, the chip system being 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 a method as described in the first aspect or any possible implementation thereof.
[0052] Fourthly, a computer program product containing instructions, when run on an electronic device, causes the electronic device to perform the method as described in the first aspect or any possible implementation thereof.
[0053] Fifthly, a computer-readable storage medium is provided, 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
[0054] Figure 1 User interface diagrams for a primary and secondary scenario of an electronic device provided in this application embodiment;
[0055] Figure 2 A flowchart illustrating a power adjustment method provided in an embodiment of this application;
[0056] Figure 3 A schematic diagram illustrating the training process of a prediction model provided in an embodiment of this application;
[0057] Figure 4 This is a schematic diagram illustrating the process of an electronic device preprocessing valid data, as provided in an embodiment of this application.
[0058] Figure 5A logic diagram illustrating the adjustment of device performance in a primary scenario, provided as an embodiment of this application;
[0059] Figure 6 A logic diagram illustrating the adjustment of device performance in a secondary scenario, provided as an embodiment of this application;
[0060] Figure 7 This is a schematic diagram illustrating the data change process during the prediction process of a power prediction model, as provided in an embodiment of this application.
[0061] Figure 8 A user interface diagram illustrating an electronic device operating scenario provided in an embodiment of this application;
[0062] Figure 9 This is a schematic diagram illustrating the division of a data range as provided in an embodiment of this application;
[0063] Figure 10 A flowchart illustrating a power adjustment method provided in an embodiment of this application;
[0064] Figure 11 A schematic diagram illustrating the determination of the optimal power of a secondary scene based on primary and secondary secondary scenes, provided in an embodiment of this application;
[0065] Figure 12 A logic diagram of a power adjustment method provided in an embodiment of this application;
[0066] Figure 13 A schematic diagram illustrating the process of an electronic device exploring the primary and secondary scenes during the cold start phase, as provided in an embodiment of this application;
[0067] Figure 14 This application provides an embodiment of a representation of raw data in an electronic device during the statistical phase.
[0068] Figure 15 A logical architecture diagram of a power prediction method provided in an embodiment of this application;
[0069] Figure 16 A system architecture diagram provided for an embodiment of this application;
[0070] Figure 17 This application provides a structural diagram of an electronic device. Detailed Implementation
[0071] 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.
[0072] To facilitate understanding, the relevant terms involved in the embodiments of this application will be introduced below.
[0073] (1) Performance and power consumption of electronic devices
[0074] 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, generally described as "millions of instructions per second". Understandably, the processing speed of an electronic device is further reflected in dimensions such as whether the electronic device runs smoothly and whether there are obvious 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 of time). The lower the lag frequency, the better the performance of the electronic device, and vice versa.
[0075] 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).
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] (2) Focused applications and background applications
[0082] 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.
[0083] 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.
[0084] (3) Level 1 scenario, Level 2 scenario
[0085] Level 1 scenarios include operating scenarios with high performance requirements for electronic devices. When an electronic device detects a Level 1 event, it is considered to have entered a Level 1 scenario. Level 1 events can include any one or more of the following: 1. User interaction events with the electronic device. For example, user actions such as clicking a mouse button, scrolling the mouse wheel (but not moving the mouse cursor), using keyboard shortcuts (shortcuts 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 shortcuts, as well as combinations of these shortcuts), switching the focus application, etc. 2. High-load events for the electronic device. For example, events where the electronic device's CPU is under high load, events where the electronic device enters game mode, etc.
[0086] Level 2 scenarios include operating scenarios with lower performance requirements for electronic devices. When an electronic device fails to detect a Level 1 event, it is considered to have entered a Level 2 scenario.
[0087] Secondary scenarios can include the following two categories:
[0088] 1. Primary and secondary scenarios.
[0089] When an electronic device detects a primary secondary event, it is considered to have entered a primary secondary scene. A primary secondary event is an event in which the electronic device is running a focused application when no primary event is detected.
[0090] In the primary secondary scenario, the parameters reflecting the performance requirements of the electronic device in the current primary secondary scenario (hereinafter referred to as primary 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.
[0091] In some implementations, a switch from one primary secondary scene to another is considered when any one or more of the primary secondary scene parameters change, even if no primary event is detected.
[0092] In other implementations, 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 drive write speed may change frequently during the operation of the electronic device, a switch from one primary secondary scene to another can be considered only when the change of any one or more parameters reaches a certain magnitude. That is, when the primary secondary scene parameters of the electronic device change within a certain range, the electronic device can be considered to be in the same primary secondary scene.
[0093] 2. Secondary scenario.
[0094] When an electronic device detects a secondary level event, it is considered to have entered a secondary level scenario. A secondary level event is an event in which a background application is running on the electronic device when a primary level event is not detected.
[0095] Similarly, in the secondary secondary scenario, the parameters reflecting the performance requirements of electronic devices in the current secondary secondary scenario (hereinafter referred to as secondary secondary scenario parameters) may include any one or more of the following: background applications, the size of background application windows, the memory usage rate of background applications, whether video is being watched, 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 RAM, the integrated graphics card load rate, the discrete graphics card load rate, and the hard drive write speed.
[0096] Based on the above definition, it is impossible for a primary scenario and a secondary scenario to coexist at the same time, but a primary secondary scenario and a secondary secondary scenario can coexist. Typically, since there is usually only one focused application at a time, but multiple background applications can exist, there can be one primary secondary scenario and multiple secondary secondary scenarios at the same time.
[0097] In this application, since the performance requirements of the electronic device are high in the primary scenario, when the electronic device is in the primary scenario, i.e., when a primary 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 the primary scenario, the electronic device can adjust the maximum available CPU power to the maximum available CPU power that the electronic device can provide. When the electronic device is in the secondary scenario, the electronic device can adjust the maximum available CPU power while considering both performance and power consumption. Specific adjustment methods are described in subsequent method embodiments.
[0098] (4) The maximum power level that the CPU can supply
[0099] In this application, the maximum power that the CPU of the electronic device can supply can be discretized into different levels.
[0100] 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:
[0101] Table 1
[0102]
[0103] 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.
[0104] (5) Optimal power
[0105] Different CPUs have different maximum power outputs to provide performance to electronic devices, and therefore consume different amounts of electrical energy.
[0106] 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 of stuttering when the electronic device is running at that power value in that secondary scenario. When the probability of stuttering exceeds a certain threshold (e.g., 3%), it can be considered that the power level affects the user experience in that secondary scenario.
[0107] 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. When adjusting the power, adjusting it to the optimal power level for the secondary scenario according to the power levels makes the adjustment process of electronic devices more convenient and faster.
[0108] 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.
[0109] (6) Lightweight Gradient Boosting Machine Model
[0110] The Light Gradient Boosting Machine (LightGBM) can be viewed as a gradient boosting framework that uses decision trees as base learners and is an optimized version of the XGBoost model.
[0111] For most binary classification models, the datasets required for training are typically extremely large, and each sample may contain a large number of features. For example, in this application, the features corresponding to the secondary scene can be as many as a dozen, and the number of valid training data points may be as high as 100,000. Understandably, the complexity of the algorithm used by the model is positively correlated with the number of features and the number of samples in the training set (generally, the number of features × the number of feature split points × the number of samples). Therefore, an excessively large number of samples and features can severely impact the model's performance.
[0112] The LightGBM model reduces a large number of data instances with only small gradients by employing gradient-based one-side sampling (GOSS). When calculating information gain, it only utilizes the remaining data with high gradients, saving significant time and space overhead. Furthermore, LightGBM achieves dimensionality reduction by binding many mutually exclusive features into a single feature using exclusive feature bundling (EFB), accelerating model training without compromising accuracy. Therefore, LightGBM effectively avoids the negative impact of a large number of samples and features on the model and can be used as a prediction model in subsequent method implementations.
[0113] The power regulation method provided in this application will be described below with reference to an exemplary user interface.
[0114] Figure 1 This application provides a user interface for an electronic device to run a primary scene and a secondary scene. The electronic device 10 may be a laptop computer.
[0115] like Figure 1As 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 102 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 Level 1 event. Therefore, in Figure 1 In (A), the operating scenario of electronic device 10 is a level one scenario.
[0116] exist Figure 1 In the first-level scenario shown in (A), 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, and its corresponding power level is the maximum 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. It is understandable that although the maximum power supply of the CPU is 45W at this time, the actual power of the CPU may be 40W. In addition to the CPU, there may be other hardware in electronic device 10, such as the GPU, that will also generate power consumption, so the total system power will be greater than 45W.
[0117] like Figure 1 As 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 104 is the application window of the "Video" application. It is assumed that during the entire video viewing process, no Level 1 event is triggered on the electronic device 10. Therefore, based on the aforementioned explanation, in... Figure 1 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 105 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.
[0118] from Figure 1The 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 first-level and second-level 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. That is, when the maximum power supply level of the CPU is set to the maximum level, the actual operating power of the CPU in electronic device 10 may never reach 45W.
[0119] for Figure 1 In the first-level scenario shown in (A), since the first-level scenario has high performance requirements for electronic devices, the difference between the actual power of the CPU and the maximum power that the CPU can supply is already very small. In some cases, the actual power that the CPU can supply may even reach the current maximum power that the CPU can supply, i.e., 45W.
[0120] But for Figure 1 In the secondary scenario shown in (B), there is a significant gap between the actual total system power of the electronic device and the maximum power supplied by the CPU (45W). This means that the actual CPU power of the electronic device 10 will not reach 45W during operation in this secondary scenario. Because the secondary scenario has lower performance requirements for the electronic device, therefore... Figure 1 In the secondary scenario shown in (B), 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 to a power value lower than 25W, the total system power of the electronic device will also decrease, thus effectively reducing the power consumption of the electronic device.
[0121] Therefore, this application provides a power adjustment method that can determine the optimal power level of the CPU's maximum power supply in the secondary scenario based on the primary and secondary scenarios in which the electronic device is located, thereby minimizing the power consumption of the electronic device while ensuring user experience and effectively extending the usage time of the electronic device.
[0122] As explained above, there are numerous parameters corresponding to primary secondary scenarios. A change in any one of these parameters indicates that the primary secondary scenario has changed to a new one. These parameters collectively reflect the performance requirements of the secondary scenario for the electronic device. Therefore, it's easy to understand that different primary secondary scenarios have different performance requirements. During user operation, an electronic device may encounter tens or even hundreds of thousands of primary secondary scenarios. Therefore, for any given primary 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.
[0123] The following details the power adjustment method provided in this application and the specific strategies for electronic devices to determine the optimal power level for different secondary scenarios.
[0124] Figure 2 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 primary secondary scene within the secondary scene, and adjust the maximum available CPU power level to the optimal power level of the primary secondary scene, prioritizing the performance requirements of the focus application. (Reference) Figure 2 The method may include the following steps:
[0125] S101. After leaving the factory, the electronic equipment is powered on and running.
[0126] 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.
[0127] After electronic devices leave the factory, they can be powered on and operated by the user.
[0128] S102. When in a primary secondary scenario, the electronic device collects valid data.
[0129] During the operation of an electronic device, the operating environment in which the electronic device operates will constantly change under the user's operation. The operating environment includes primary environment and secondary environment.
[0130] When an electronic device enters a primary scene, due to the high performance demands of this scene, it adjusts the CPU's maximum power supply level to the maximum power level. When entering any primary secondary scene, the device explores multiple maximum CPU power supply levels. Specifically, within that primary secondary scene, the device sequentially adjusts the CPU's maximum power supply level to different power levels. During operation at each power level, the device records the percentage of stuttering time at each level and determines the optimal power level for that primary secondary scene based on this percentage.
[0131] Specifically, for any primary secondary scene_x in which the electronic device is located, when the electronic device first enters this primary secondary scene, it can explore the advantages and disadvantages of each power level. That is, in this primary secondary scene, it can successively adjust the power level at which the CPU can supply the maximum power to multiple power levels. Preferably, these multiple power levels can include all power levels that the electronic device can provide. For each power level, the electronic device can set the same runtime T, for example, T can be 30s. In the primary secondary scene_x, when the electronic device starts running with a new power level PL1_x, it will record the start time t_start of running with power level PL1_x. After the runtime reaches the specified runtime T, the electronic device will record the runtime duration ttl of running with power level PL1_x, and the duration t_delay of the electronic device stuttering when running with power level PL1_x, and adjust the power level at which the CPU can supply the maximum power from PL1_x to another power level PL1_y. Understandably, in the main secondary scene scene_x, the percentage of stuttering time corresponding to gear PL1_x is duration_delay / duration_ttl.
[0132] Preferably, for a primary / secondary scenario, the electronic device can explore various power levels from high to low. If the electronic device does not experience any stuttering within a specified time T while operating at a certain power level, the maximum CPU power level is lowered by one level to continue exploring. If a stuttering occurs within the specified time T, the maximum CPU power level is raised by one level to continue exploring. In other words, for a primary / secondary scenario, if the electronic device experiences stuttering at a certain power level, that power level and any lower power levels are highly unlikely to be the optimal power level for that primary / secondary scenario. Therefore, the electronic device will not continue exploring to lower power levels, but rather to higher power levels. Based on this, when the total operating time of the electronic device in a primary / secondary scenario reaches Ts (Ts can be set to 600s), the electronic device can determine the optimal power level for that primary / secondary scenario.
[0133] In actual exploration, under the same primary secondary scene scene_x, electronic devices may run the exploration in the same gear PL1_x multiple times. For example, if an electronic device experiences a lag while running at gear PL1_x and shifts up to PL1_x+1, then runs at PL1_x+1 for a duration of T before shifting down to PL1_x again; or if the electronic device is running at gear PL1_x and the primary secondary scene scene_x changes to another primary secondary scene scene_y, the electronic device will record the gear exploration progress (i.e., PL1_x) under scene_x. If the primary secondary scene of the electronic device changes back to scene_x, the electronic device will start exploring each gear again from gear PL1_x. Similarly, when the electronic device switched from the primary secondary scene scene_y to another scene, it recorded 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). 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. In these cases, for electronic devices that repeatedly explore power levels, multiple duration_delays and multiple duration_ttls will be recorded accordingly. The stuttering time ratio corresponding to power level PL1_x can be calculated as DURATION_DELAY / DURATION_TTL. Where DURATION_TTL is the sum of the running time of the electronic device each time it runs at power level PL1_x, and DURATION_DELAY is the sum of the stuttering time of the electronic device each time it runs scene_x at power level PL1_x.
[0134] For a primary secondary scenario, once the optimal power level for that primary secondary scenario is determined (or the total runtime of the electronic device in that primary secondary scenario is long enough), the electronic device can record a valid data point corresponding to that primary secondary scenario. The primary secondary scenario for which valid data has been acquired is called a "valid primary secondary scenario". This valid data includes: the parameters of the primary secondary scenario, the multiple power levels explored, and the percentage of stuttering time corresponding to each power level.
[0135] S103, Electronic Equipment Training Power Prediction Model.
[0136] The aforementioned power prediction model is a model trained by electronic devices using collected effective data, which can be used to determine the optimal power level for primary and secondary scenarios. This power prediction model can be a binary classification model, specifically a logistic regression model, decision tree model, random forest model, neural network model, GBDT model, XGboost model, LightGBM model, or other types of models; this application does not limit its scope.
[0137] When using the aforementioned power prediction model, the input to the model is the primary secondary scenario parameters, and the output is the probability of user experience degradation when the electronic device operates at various power levels within that primary secondary scenario. (Exploration follows.)
[0138] It should be understood that the amount of data required for model training is enormous. Therefore, the electronic device will only train the aforementioned power prediction model based on the collected valid data if the number of valid primary and secondary scenes collected by the electronic device is greater than or equal to X, i.e., if the number of valid primary and secondary scenes is greater than or equal to X. Specifically, X can be set to 50,000, 100,000, or other values, depending on the performance requirements of the aforementioned power prediction model, and this application does not impose any limitations on this.
[0139] Figure 3 A schematic diagram illustrating the training process of the aforementioned prediction model is shown. For example... Figure 3 As shown, the training process of the power prediction model described above can specifically include: data transformation 301 and model training 302. Wherein:
[0140] Since the power prediction model provided in this application outputs the probability of user experience impairment for each gear level in a secondary scenario, data conversion 301 mainly includes converting the proportion of stuttering time corresponding to each gear level in the valid data into a binary label indicating whether it impairs user experience, and splitting one valid data point into multiple data points according to the gear level. Furthermore, to ensure that the electronic device can correctly read the features of the discrete values recorded in the valid data (such as the name of the focused application recorded in the valid data), data conversion 301 may also include an encoding operation that maps non-numerical data in the valid data to numerical values, i.e., creating a mapping table to store the mapping relationship between discrete feature values and custom numerical values.
[0141] Figure 4 This demonstrates the process by which an electronic device numbers, marks, and reconstructs the collected valid data according to gear positions.
[0142] like Figure 4 As shown, the valid data table 40 includes multiple valid data entries, which can be tens of thousands or hundreds of thousands of entries. Each valid data entry records the parameters of a primary secondary scene and the percentage of stuttering time when the electronic device is running at different power levels under that primary secondary scene.
[0143] As shown in valid data 401 in valid data table 40, this is valid data corresponding to a primary secondary scene. The parameters of this primary secondary scene include: focus application name - APP1 (APP is 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 it is not used), screen brightness - 10 levels...; Under this primary secondary scene, the percentage of lag time for the electronic device at each power level from level 10 to level 2 are: 0, 0, 0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.01 (the percentage of lag time corresponding to levels 6, 4, and 3 is not included due to space limitations). Figure 5 (As shown in the figure); 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 probability of stuttering when the electronic device is running this secondary scenario also increases accordingly.
[0144] It should be noted that each valid data entry in the valid data table 40 does not record the percentage of stuttering time when the electronic device is running at power level 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 level 1 causes frequent stuttering or even malfunction. Therefore, in step S102, when the electronic device collects valid data, to ensure normal user operation, the electronic device does not need to be set to power level 1 when exploring power levels for any primary secondary scenario. That is, the electronic device does not need to collect the percentage of stuttering time when running at power level 1; for a primary secondary scenario, it is sufficient to explore the power level down to at least level 2.
[0145] After collecting multiple valid data entries and obtaining the aforementioned valid data table 40, the electronic device will further convert the focus application name in each valid data entry into a numerical code, resulting in, for example: Figure 4 The mapping table 41 is shown below. Taking mapping data 411 in mapping table 41 as an example, mapping data 411 corresponds to valid data 401 in the valid data table. The difference between mapping data 411 and valid data 401 is that the focus application name in the primary secondary scene parameters recorded in mapping data 411 has been converted to the numeric code "0". Except for the focus application name, the content recorded in mapping data 411 is the same as that recorded in valid data 401. It is understandable that among all the valid data recorded in valid data table 40, there may be multiple valid data entries, and the focus application name recorded in these valid data entries is the same. When converting valid data table 40 to mapping data table 41, the numeric codes obtained by converting the focus application names recorded in these valid data entries are also the same.
[0146] After obtaining the mapping table 41 above, the electronic device will determine whether the user experience is impaired based on the percentage of stuttering time at each power level for each primary and secondary scenario. It should be understood that stuttering may occur even when the electronic device is running at its highest power level in some secondary scenarios. Therefore, for any primary or secondary scenario, when the electronic device is running at a certain power level, stuttering does not necessarily mean a poor user experience. The specific impact depends on the probability of stuttering at that power level, which can be reflected by the percentage of stuttering time at that power level. Therefore, for any primary or secondary scene mapping data in mapping table 41, the electronic device can set a damage threshold. The electronic device can compare the percentage of stuttering time corresponding to each power level with this damage threshold. If the percentage of stuttering time corresponding to a certain power level is less than or equal to the damage threshold, it indicates that the user experience is not impaired when running at that power level, and the electronic device can update the value corresponding to that power level (i.e., the percentage of stuttering time, hereinafter the same) to the label value "1". Conversely, if the percentage of stuttering time corresponding to a certain power level is greater than the damage threshold, it indicates that the user experience is impaired when running at that power level, and the electronic device can update the value corresponding to that power level to the label value "0". The specific value of the damage threshold can be set according to specific needs. Specifically, the damage threshold can be 0.05, 0.03, or other values; this application does not limit this. In this application, the aforementioned "damage threshold" can also be referred to as the "first threshold".
[0147] The following explanation uses mapping data 411 from mapping table 41, with a damage threshold of 0.03 as an example. (Reference) Figure 4 The gear marking table 42 shown is a data table where the gear marking data 421 is the data obtained after the electronic device marks each gear in the mapping data 411 according to a threshold of 0.03. As can be seen from the foregoing explanation, the percentage of lag time for gears such as power gear 10, power gear 9, power gear 8, and power gear 7 in the mapping data 411 is less than or equal to 0.03, so these power gears are marked as "0"; while the percentage of lag time for power gear 3 and power gear 2 is greater than 0.03, so these power gears will be marked as "1".
[0148] After obtaining the gear position label table 42, the electronic device needs to perform a secondary reconstruction of the gear position label table 42, that is, split each gear position label data in the gear position label table 42 into multiple sub-data according to the gear position, to obtain the training set 43. In the training set 43, each gear position in the same gear position label data corresponds to a sub-data, and each sub-data, in addition to recording its corresponding gear position and the label value corresponding to the gear position, also records all the main and secondary scene parameters of the main and secondary scenes recorded in the original gear position label data. In the embodiments of this application, the data contained in the "valid data table 40" can also be called the "valid dataset", the above-mentioned training set 43 can also be called the "training dataset", and the data in the training set 43 can be called the "training data". The above-mentioned label value "1" can be called the "second label value", and the above-mentioned label value "0" can be called the "first label value".
[0149] Let's take gear position marker data 421 in gear position marker 42 as an example. After splitting gear position marker data 421, we can obtain 9 training data points in training set 43, including sub-data points 431, 432, 433, 434, and 435 (some sub-data points are not included due to space limitations). Figure 4 (As shown in the diagram). Each sub-data item, besides recording its corresponding gear and its corresponding label value, also records the primary and secondary scene parameters recorded in the gear label data 421, such as the focus application number - "0", window size - 8, download speed - 1, etc. It can be understood that in training set 43, the information recorded in the 9 sub-data items obtained from the same gear label data is identical, except for the gear and gear label value.
[0150] After obtaining the training set 43, the electronic device can begin to perform the relevant operations included in the model training 302, that is, to train based on the training set 43 to obtain the power prediction model and deploy the power prediction model in the electronic device.
[0151] It should be noted that the model training process places significant demands on both device performance and power consumption. Therefore, in an optional implementation, after obtaining the training set 43, the electronic device can train the power prediction model while charging and with the screen off (but the electronic device still powered on). Understandably, while charging, the electronic device maintains sufficient power to support the model training process. Furthermore, when the screen is off, the electronic device minimizes the power consumption of other processes and applications, allowing it to provide more power and performance for the model training process. Since a screen-off state indicates that the user is not using the electronic device at that moment, even if the model training process consumes a significant portion of the electronic device's performance, it will not negatively impact the user experience.
[0152] S104. The electronic device determines the current operating scenario.
[0153] The electronic device determines its current operating scenario by detecting whether a Level 1 event has occurred. If a Level 1 event occurs, it indicates that the electronic device is in a Level 1 scenario, and the electronic device can execute step S105; otherwise, it indicates that the electronic device is in a Level 2 scenario, and the electronic device can execute step S106.
[0154] S105. When the operating scenario is a Level 1 scenario, the electronic device adjusts the CPU's maximum power supply level to the maximum power level.
[0155] like Figure 5 As shown, electronic devices can determine whether mouse buttons have been clicked, keyboard shortcuts have been activated, and focus applications have switched through corresponding interfaces. In addition, electronic devices can also obtain CPU load status and whether the electronic device is in game mode through corresponding interfaces.
[0156] When a primary event such as a "mouse click" or "keyboard shortcut key input" is triggered, the electronic device determines that the current operating scenario is a primary scenario. Based on the high-performance requirements of the primary scenario, the electronic device will directly adjust the CPU's maximum available power level to the maximum power level to ensure 100% performance of the electronic device.
[0157] For the next N seconds, the electronic device will maintain the maximum available power setting at the maximum power level. If the electronic device triggers a Level 1 event again within N seconds, it will restart the timer from the trigger time of the second Level 1 event. For the next N seconds, the electronic device will maintain the maximum available power setting at the maximum power level, and so on, until the electronic device does not trigger a Level 1 event for N consecutive seconds. At this point, the electronic device will determine that the Level 1 scenario has ended, and the running scenario is now the Level 2 scenario. The electronic device can then execute step S106. Specifically, N can be 5 or other values, which are not limited in this application.
[0158] S106. When the operating scenario is a secondary scenario, the electronic device determines the optimal power level of the current primary secondary scenario based on the above power prediction model, and adjusts the maximum power supply level of the CPU to the optimal power level of the current primary secondary scenario.
[0159] like Figure 6 As shown, when the electronic device is in a secondary scene, it can obtain all parameters of the current primary secondary scene, including the focus application and the size of the focus application window. Then, the electronic device can input all these parameters into the aforementioned power prediction model, which can then output the probability of user experience degradation at various power levels in the current primary secondary scene.
[0160] Furthermore, the electronic device can compare power levels from highest to lowest, starting with the highest power setting, and select the lowest power setting where the probability of user damage is less than or equal to a certain threshold (e.g., 0.5) as the optimal power setting. The electronic device can then adjust the maximum power supply available to the CPU to this optimal power setting.
[0161] Figure 7 The process of processing the collected data is shown when the electronic device determines the optimal power level for the current primary and secondary scenarios based on the power prediction model described above.
[0162] like Figure 7As shown in the primary secondary scene feature table 70, assuming scene 701 is the primary secondary scene currently running on the electronic device, the electronic device can collect all primary secondary scene parameters, including the name of the focus application, the size of the focus application window, and the download speed, for the currently running primary secondary scene 701. It should be noted that when acquiring the focus application, the mapping relationship between the focus application and its ID has already been saved in the electronic device during the aforementioned data conversion process (refer to the aforementioned mapping relationship table 411). The electronic device can directly obtain the ID corresponding to the focus application under primary secondary scene 701 and input it into the power prediction model along with other primary secondary scene parameters. In this embodiment, primary secondary scene 701 can also be referred to as the "first primary secondary scene".
[0163] After obtaining all primary and secondary scene parameters for scene 701, the power prediction model described above can construct a prediction sample table for scene 701 based on these parameters. This prediction sample table stores multiple prediction samples composed of the primary and secondary scene parameters of scene 701 and each candidate power level (power level 9 to power level 2). For details, please refer to [reference needed]. Figure 7 The prediction sample table 71 is shown below. In the prediction sample table 71, the power prediction model described above can determine a prediction sample for each candidate power level that the electronic device can provide, so as to save the prediction results of the probability of user experience impairment corresponding to each subsequent candidate power level.
[0164] Next, the power prediction model described above can predict the prediction samples in prediction sample table 71. Its output is the probability that the user experience will be impaired when the electronic device runs scene 701 at each candidate power level. For details, please refer to [reference needed]. Figure 7 The prediction output table 72 is shown. As can be seen from the prediction output table 72, it records the prediction results of the power prediction model for each prediction sample in the prediction sample table. Under scene 701, when the electronic device operates at various power levels (10 levels - 2 levels), the probabilities of impaired user experience are 0, 0, 0.01, 0.06, 0.23, 0.48, 0.59, 0.67, and 0.71, respectively. In this embodiment, the "prediction result" recorded in the prediction output table 72 can be referred to as the first prediction result, and the "power level 9 - power level 2" can also be referred to as "multiple different CPU maximum supply power".
[0165] The electronic device can then search from the highest power level (level 10) down to the next highest level based on the prediction output table 72, and select the power level with a user experience impairment probability less than or equal to 0.5 (in this application, "user experience impairment probability less than or equal to 0.5" can be referred to as the "first condition") as the optimal power level. As shown in the prediction output table 72, for the current scene 701, the last power level with a user impairment probability less than or equal to 0.5 is level 5. Therefore, the electronic device ultimately determines level 5 as the optimal power level for scene 701. The electronic device can then adjust the maximum power supply level of the CPU to level 5 and continue operating under scene 701. In this embodiment, the aforementioned optimal power level "level 5" can also be referred to as the first optimal power, and the aforementioned value "0.05" can also be referred to as the "second threshold".
[0166] Understandable Figure 4 , Figure 7 The specific format of the datasets involved in the model training and prediction process shown is for the reader's understanding only and does not represent their format in actual scenarios. For example, in actual application scenarios, the data recorded in the aforementioned effective data table 40, mapping relationship table 41, and gear mark table 42 may not exist in the electronic device in the form of tables, but may be stored in the electronic device in the form of program code. This application does not limit the specific format of this data in the electronic device.
[0167] During subsequent operation, when the operating scenario of the electronic device changes, the electronic device can readjust the maximum available power level of the CPU. Changes in the operating scenario include: 1. The operating scenario of the electronic device changes from the current secondary scenario to a primary scenario. In this case, the electronic device adjusts the maximum available power level of the CPU to the maximum level. For details, please refer to the aforementioned explanation of step S105, which will not be repeated here. 2. The primary secondary scenario of the electronic device changes from the current primary secondary scenario to a new primary secondary scenario. In this case, the electronic device can execute the subsequent step S107.
[0168] S107. When the primary secondary scene of the electronic device changes from the current primary secondary scene to a new primary secondary scene, the electronic device determines the optimal power level of the new primary secondary scene based on the power prediction model mentioned above, and adjusts the maximum power supply level of the CPU to the optimal power level of the new primary secondary scene.
[0169] As explained above, if any parameter in the primary secondary scene parameters changes, the electronic device can determine whether to switch from the current primary secondary scene to a new primary secondary scene. At this point, the electronic device can determine the optimal power level of the new primary secondary scene based on the aforementioned power prediction model, and adjust the maximum power supply level of the CPU to match the optimal power level of the new primary secondary scene. For specific details on step S106, please refer to the aforementioned explanation; further elaboration is not provided here.
[0170] Figure 8 The diagram shows the effect of adjusting the maximum power available to the CPU after the electronic device changes from the current primary secondary scene to the new primary secondary scene. Figure 8 The electronic device shown can be an electronic device that has the above power prediction model deployed in this method. Here, it is also assumed that the maximum power level that its CPU can supply corresponds to a power value of 45W.
[0171] exist Figure 8 In (A), the electronic device opens the "Video" application and begins watching a video that has been downloaded to the device. Application window 801 is the application window of the "Video" application. At this time, the electronic device has not triggered a primary event, meaning the electronic device is in the primary secondary scene 81. Specifically, the primary secondary scene 81 and the primary secondary scene 701 described above can be the same primary secondary scene.
[0172] To reduce power consumption, the electronic device will collect all primary and secondary scene parameters of scene 81 as input to the aforementioned power prediction model. This model will then output the probability of user experience degradation for scene 81 at each maximum CPU power level. The electronic device can then determine the optimal power level for scene 81 based on this probability. Here, we assume the optimal power level for scene 81 corresponds to a power value of 15W. Figure 8 As shown in (A), the hardware information displayed in application window 802 indicates that the maximum power available to the CPU of the electronic device has been adjusted to 15W. Correspondingly, the total system power of the electronic device is 15.411W, and the average system power is 16.305W. Although the CPU performance decreases as the maximum available power decreases, the electronic device can still play videos smoothly, and the screen display, mouse cursor, etc., do not experience any stuttering, thus the user experience is not compromised.
[0173] During subsequent operation, the user operates the electronic device to play music through the music application. The electronic device is currently listening to a song through the "Music" application, and application window 803 is the application window of the "Music" application. After switching the focus application from the video application to the music application, if the electronic device does not trigger a primary event while playing music, then the electronic device is currently in the primary secondary scene 82. Since the electronic device's operating scene has switched from the primary secondary scene 81 to the new primary secondary scene 82, and the performance requirements of the primary secondary scene 82 and scene 81 are likely different. Therefore, the electronic device will obtain the optimal power level of the new primary secondary scene 82. Specifically, the electronic device will also collect all primary and secondary scene parameters of scene 82 as input to the aforementioned power prediction model. The aforementioned power prediction model will output the probability of user experience impairment of scene 82 under each maximum CPU power level (in this embodiment, the probability of user experience impairment of scene 82 under each maximum CPU power level can be referred to as the "second prediction result"). The electronic device can then determine the optimal power level of scene 82 based on the probability of user experience impairment at each level and adaptively adjust the level of maximum CPU power. Here, it is assumed that the power value corresponding to the optimal power level of scene 82 is 10W. Figure 8 As shown in (B), the hardware information displayed in application window 804 indicates that the maximum power available to the CPU of electronic device 10 has been adjusted to 10W. Correspondingly, the total system power decreases to 10.411W, and the average system power also decreases to 11.305W. Similarly, although the CPU performance decreases due to the reduced maximum power available to the CPU, the electronic device can still play music smoothly, and the screen display and mouse cursor do not experience any lag, thus the user experience remains unaffected.
[0174] As can be seen, since the primary secondary scene 82 and the primary secondary scene 81 are different primary secondary scenes, their performance requirements for electronic devices may also be different. Therefore, the maximum power that the electronic device can supply for scene 82 is different from the maximum CPU power that it can supply for scene 81. It should be noted that parameters such as the size of the focused application window, the memory usage of the focused application, the download speed, the screen brightness, the RAM, the integrated graphics card load rate, the discrete graphics card load rate, and the hard disk 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 under the influence of these parameters, in an optional implementation, the electronic device can discretize the values of these parameters into different levels. When determining whether the primary secondary scene has changed, for these parameters, only when the level corresponding to their value changes is it considered that the primary secondary scene has changed. In the embodiments of this application, the above-mentioned "primary secondary scene 81" can also be referred to as the "first primary secondary scene", and the above-mentioned "primary secondary scene 82" can also be referred to as the "secondary primary secondary scene".
[0175] Taking the download speed of electronic devices as an example, and combining it with... Figure 9 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 9 As shown, the download speed range of the electronic device is [0, 2028]. This range can be divided into four sub-ranges: sub-range 901, sub-range 902, sub-range 903, and sub-range 904, 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.
[0176] When determining the secondary scene, a switch from one primary secondary scene to another is only considered 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 the overlapping area of two sub-intervals, the level corresponding to that download speed will be determined to be 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, i.e., the primary secondary scene has changed.
[0177] 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 the primary and secondary scenes have changed. Furthermore, Figure 9 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.
[0178] Since the electronic device has sufficient power supply when charging, it does not need to adjust the maximum power level of the CPU based on the operating scenario. Instead, it keeps the maximum power level of the CPU at the highest level to prioritize the performance requirements of the electronic device. Therefore, in some embodiments, the electronic device may only execute steps S101, S102, and steps S104-S107 when it is not charging.
[0179] In this application, the electronic device can also reduce power consumption without compromising user experience by adjusting the maximum operating frequency of the CPU. Correspondingly, when collecting valid data for any secondary scenario, the electronic device can also collect the percentage of stuttering time at different maximum operating frequency levels by adjusting the CPU's maximum operating frequency. After collecting sufficient valid data, the electronic device can also train a power prediction model (see the relevant explanations for steps S102-S103), and in subsequent operation, output the optimal frequency level for the primary secondary scenario based on this power prediction model (i.e., for the primary secondary scenario, the power level with the lowest power consumption among all maximum operating frequency levels without affecting user experience), and adjust the maximum operating frequency level of the CPU to the aforementioned optimal frequency level.
[0180] In some embodiments, the power prediction model can be deployed in the electronic device by the manufacturer before the electronic device leaves the factory. For example, the manufacturer can use an electronic device A (which may include one or more devices of the same model as the electronic device) to collect the effective data for training the power prediction model, and use an electronic device B (which may be the same device as or different from electronic device A) to train the effective data collected by electronic device A to obtain the power prediction model. Then, the manufacturer can uniformly deploy the power prediction model to multiple terminal devices of the same model, including the aforementioned electronic device. In this case, the electronic device may not need to execute steps S102 and S103.
[0181] Furthermore, in some embodiments, the model training involved in step S103 is performed by a server provided by the electronic device manufacturer. In this case, the aforementioned electronic device can collect valid data together with other electronic devices of the same model. That is, the number of valid data collected by the aforementioned electronic device may be less than X, and it can send the collected valid data to the server provided by the electronic device manufacturer along with other electronic devices of the same model. When the server receives more than X valid data, the server can use this valid data for model training to obtain the aforementioned power prediction model. Afterward, the server can uniformly distribute the aforementioned power prediction model to multiple electronic devices of the same model, including the aforementioned electronic device, thus avoiding the time and storage resources consumed by the electronic devices in training the model. Of course, the number of valid data collected by the aforementioned electronic device may also be greater than or equal to X. In this case, the server can train the aforementioned power prediction model separately for the valid data collected by the aforementioned electronic device (greater than or equal to X) and distribute the power prediction model to the aforementioned electronic device. In this way, the power prediction model in the electronic device can be more adapted to the user's personalized needs and usage habits, and its prediction performance will be better.
[0182] In some embodiments, under certain primary scenarios, the electronic device can also adjust the maximum available CPU power. Specifically, when the triggering event of a primary scenario is an event such as the electronic device being in game mode or the CPU being under high load, the performance requirements of the electronic device are very high. Therefore, for primary scenarios triggered by such events, the electronic device can still maintain the maximum available CPU power at its maximum level. However, when the triggering event of a primary scenario is an event such as clicking a mouse button or using a keyboard shortcut, the performance requirements of the electronic device are relatively lower. Therefore, for primary scenarios triggered by such events, the electronic device can also collect relevant effective data under such primary scenarios and train a prediction model suitable for such primary scenarios based on the effective data. When the electronic device is subsequently in a primary scenario with relatively low performance requirements, the electronic device can also determine the optimal power level for such primary scenarios based on the above prediction model. The specific process of collecting training data for the prediction model and training the model can be referred to the aforementioned explanations of steps S102-S103, and will not be repeated here.
[0183] Understandably, for electronic devices like computers, users may open multiple applications simultaneously, including the main application and background applications. Therefore, during operation, electronic devices need to meet the performance requirements of both the main application and background applications. In some cases, the performance requirements of background applications are even higher than those of the main application.
[0184] Therefore, in some embodiments, after the power prediction model is successfully trained, the electronic device can determine an optimal power level corresponding to the main secondary scene in the secondary scene based on the power prediction model, and determine N optimal power levels corresponding to N auxiliary secondary scenes in the secondary scene based on the power prediction model. The largest power level among the (N+1) optimal power levels in the main secondary scene and auxiliary secondary scenes is determined as the optimal power level of the secondary scene, thereby satisfying the performance requirements of background applications while meeting the performance requirements of the focus application.
[0185] Based on the above explanation, the following will be combined with Figure 10 This application provides a flowchart of another power adjustment method according to an embodiment. (Reference) Figure 10 The method may include the following steps:
[0186] S201. When the operating scenario is a secondary scenario, the electronic device determines the optimal power level of the current primary secondary scenario based on the power prediction model.
[0187] The electronic device shown in the embodiments of this application can be the aforementioned Figure 2 Electronic devices in [the context]. The power prediction model in the embodiments of this application can be the aforementioned [model / model / model]. Figure 2 The power prediction model in the text, its specific training process and application process can be found in the aforementioned section. Figure 2 The relevant explanations of steps S101-S103 are not repeated here.
[0188] The specific operation process of step S201 can be referred to the aforementioned explanation of step S106, and will not be repeated here.
[0189] S202. Based on the above power prediction model, the electronic equipment determines the M optimal power levels for the M auxiliary secondary scenarios.
[0190] As explained above, a primary secondary scene and an auxiliary secondary scene can coexist within a secondary scene. Typically, there is one primary secondary scene at any given time, while there can be multiple auxiliary secondary scenes. Within the same secondary scene, the auxiliary secondary scene parameters differ from the primary secondary scene parameters only in three parameters: application, application window size, and application memory usage. All other parameters are identical, and the focused application and background application can be interchanged. Therefore, the auxiliary secondary scene parameters can also be used as input to the aforementioned power prediction model, which outputs the probability of user experience impairment corresponding to each power level in the auxiliary secondary scene (in this embodiment, the probability of user experience impairment corresponding to each power level in the auxiliary secondary scene can also be referred to as the "third prediction result"). The electronic device then further determines the optimal power level for the auxiliary secondary scene. The specific operation process is similar to the process of determining the optimal power level for the primary secondary scene, and will not be repeated here.
[0191] Preferably, the background applications corresponding to the aforementioned M secondary scenarios can be the M background applications that consume the most CPU performance among the background applications. Specifically, the value of M can be 3 or other values, and this application does not limit this.
[0192] When the N background applications that consume the most CPU performance include the main application, one of the M secondary secondary scenarios will have parameters identical to the main secondary scenario. Therefore, the prediction model's prediction result for this secondary secondary scenario will be identical to its prediction result for the main secondary scenario. Thus, in an optional implementation, when the M background applications that consume the most CPU performance include the main application, after obtaining the M sets of secondary secondary scenario parameters from the M secondary scenarios, the electronic device can remove the set of secondary secondary scenario parameters that are identical to the main secondary scenario parameters. In subsequent predictions using the power prediction model, it is only necessary to determine the optimal power level for the main secondary scenario and the remaining two secondary secondary scenarios.
[0193] S203. The electronic device determines the optimal power level of the current secondary scene as the maximum power level among the optimal power levels of the main secondary scene and the M optimal power levels of the M auxiliary secondary scenes, and adjusts the maximum power level that the CPU can supply to the optimal power level of the current secondary scene.
[0194] To ensure that the final power setting can meet the needs of both background and focused applications, the electronic device selects the largest power setting from the optimal power setting of the main secondary scene and the M optimal power settings of the M auxiliary secondary scenes to determine the optimal power setting of the current secondary scene, and adjusts the setting of the maximum power that the CPU can supply to be the optimal power setting of the current secondary scene.
[0195] Figure 11 The process of determining the common optimal power level for the main secondary scenario and the auxiliary secondary scenario of the electronic device is shown.
[0196] like Figure 11 As shown, assuming that the focused application in the electronic device is numbered 0, and the three background applications that consume the most CPU resources are numbered 1, 2, and 3 respectively. Scene 01 is the primary secondary scene currently running on the electronic device, and scenes 02, 03, and 04 are the three secondary scenes currently running on the electronic device. In this embodiment, scene 01 can also be referred to as the "first primary secondary scene", and any one of the secondary scenes 02, 03, and 04 can be referred to as the "first secondary secondary scene".
[0197] For the currently running primary secondary scene 01, the electronic device can collect the primary secondary scene parameters of scene 01, as shown in data 0101 in the primary secondary scene parameter table 010. Similarly, for the three currently running secondary secondary scenes scene02, scene03, and scene04, the electronic device can also collect the secondary secondary scene parameters of these three secondary secondary scenes, as shown in data 0111, data 0112, and data 0113 in the secondary secondary scene parameter table 011.
[0198] After obtaining the parameters of the primary secondary scene 01, the electronic device can determine the optimal power level PL11 for scene 01 based on the primary secondary scene and the prediction model. For details of this process, please refer to the aforementioned... Figure 2 The relevant explanations will not be repeated here or in subsequent embodiments. In the embodiments of this application, the above-mentioned optimal power level PL11 can also be referred to as the "first optimal power".
[0199] Similarly, after obtaining the respective secondary scene parameters of the three secondary scenes, scene 02, scene 03, and scene 04, the electronic device can also determine the optimal power level PL12 for scene 02, the optimal power level PL13 for scene 03, and the optimal power level PL14 for scene 04 based on the respective secondary scene parameters of scene 02, scene 03, and scene 04 and the prediction model. In the embodiments of this application, any one of the above power levels PL12, PL13, and PL14 can also be referred to as the "first optimal power".
[0200] After obtaining the optimal power levels PL11, PL12, PL13, and PL14 for the four scenarios mentioned above, the electronic device can determine the highest power level among these four as the optimal power level for the current scenario. For example, assuming PL11>PL12>PL13>PL14, the electronic device will ultimately determine PL11 as the optimal power level for the current secondary scenario and adjust the maximum power supply level available to the CPU to PL11.
[0201] S204. When the current secondary scenario changes to a new secondary scenario, the electronic device determines the optimal power level of the new secondary scenario based on the above power prediction model, and adjusts the maximum power supply level of the CPU to the optimal power level of the new secondary scenario.
[0202] The current secondary scene changes to a new secondary scene in one or more of the following two situations: 1. The current primary secondary scene changes to a new primary secondary scene. 2. If the background applications corresponding to the above M secondary scenes are the three background applications that consume the most CPU performance, and the M background applications running on the electronic device that consume the most CPU performance change, causing the M secondary scenes to also change.
[0203] Understandably, changes in the primary secondary scene and the secondary secondary scene can occur simultaneously or asynchronously. Specifically, for the primary secondary scene, the electronic device can detect in real time whether the parameters of the primary secondary scene have changed; if any parameter of the primary secondary scene changes, the current primary secondary scene is determined to be a new primary secondary scene. For the secondary secondary scene, the electronic device can periodically detect the M background applications that consume the most performance. If these M background applications are different from the previously determined M background applications, it indicates that the M secondary secondary scenes have changed (as long as the newly determined M background applications are not completely identical to the previously determined M background applications, it means that the M secondary secondary scenes have changed). Optionally, the duration of the above period can be set to 30 seconds or other durations; this application does not limit this.
[0204] When the primary secondary scene and / or M auxiliary secondary scenes undergo changes, it indicates that the current secondary scene has changed to a new secondary scene. The electronic device can redetermine the optimal power level of the new secondary scene based on the relevant operations in steps S201-S203, and adjust the level of the CPU's maximum available power to the optimal power level of the new secondary scene.
[0205] Understandably, applications (APPs) in electronic devices are constantly updated, and their performance requirements may change with each version update, although the degree of change is generally not significant. Therefore, in some embodiments, after the power prediction model is trained, for any primary / secondary scenario, after determining the optimal power level based on the prediction model, the electronic device can adjust the maximum CPU power level to any one of the following: the optimal power level, the next higher power level adjacent to the optimal power level, or the next lower power level adjacent to the optimal power level. Correspondingly, during subsequent operation, the electronic device will also collect feedback data, which may include the runtime and lag duration of the electronic device at the last adjusted power level. Finally, the electronic device can update the effective data corresponding to the primary / secondary scenario based on the acquired feedback data, and update the power prediction model based on the updated effective data. That is, it can train a new prediction model using the updated effective data, so that the power prediction model can maintain the accuracy of the prediction results even when applications (APPs) are constantly updated. Figure 12 An example is shown of the update process for the above-described prediction model.
[0206] like Figure 12 As shown, in Figure 12 In this context, the power prediction model can be a model trained by the electronic device based on multiple valid data points in the valid data table 12A. Here, 12A1 represents the valid data from the primary secondary scene 12 collected by the electronic device.
[0207] After the power prediction model is trained, when the electronic device is in scene 12 again, it can determine the optimal power level PL1 for scene 12 based on the power prediction model and the primary and secondary scene parameters of scene 12. x .
[0208] Here it is assumed that the power setting PL1 is the same. x The next higher power setting is PL1. (x+1) With power setting PL1 x The next lower power setting is PL1. (x-1)In this embodiment, the electronic device can obtain a random number falling within the main interval [1, 100] based on a random number function. If this random number falls within the sub-interval [1, 5], then the final power level PL1 to be adjusted will be determined. y It was identified as PL1. (x-1) If this random number falls within the sub-interval [96, 100], then the final power setting PL1 will be adjusted. y It was identified as PL1. (x+1) If this random number falls within the sub-interval [5, 95], then the final power setting PL1 to be adjusted will be... y It was identified as PL1. x Understandably, PL1y was identified as PL1. (x-1) PL1 x and PL1 (x+1) The probabilities are 5%, 90%, and 5%, respectively. In the application embodiment, the primary secondary scene 12 can be referred to as the "first primary secondary scene," PL1 x This can be referred to as optimal power, PL1 x-1 It can be referred to as the fourth power, PL1 x-1 It can be called the fifth power.
[0209] Regardless of PL1 y It was identified as PL1 (x-1) PL1 x and PL1 (x+1) The electronic device records the runtime and stuttering duration at each power setting. Here, we'll use PL1 as an example. x It has 7 gears, PL1 y For PL1 (x+1) Let's take power level 8 as an example. Assume the electronic device runs for 100 seconds at power level 8, with a 1-second pause. The electronic device will use this 100-second runtime and 1-second pause as feedback data for scene 12 running at power level 8. Then, the electronic device can update the valid data 12A1 of scene 12 using this feedback data. As shown in valid data 12A2 in valid data table 12A, the percentage of pause time at power level 8 in the valid data for scene 12 has been updated from 0 to 0.01.
[0210] Understandably, when the electronic device is running in other primary and secondary scenarios, it can also use the above method to update the valid data of those scenarios; that is, the valid data in valid data table 12A can be continuously updated. During subsequent operation, the electronic device can periodically use the valid data in the valid data table to retrain a new power prediction model to update the previously trained power prediction model. Furthermore, in some embodiments, PL1... (x-1) PL1 x and PL1 (x+1) It was identified as PL1 y The probability can be set to other probability values by adjusting the proportion of each sub-interval in the main interval, and this application does not limit this.
[0211] It should be noted that when an application on an electronic device is updated, the device may not be able to detect whether the application's performance requirements have increased, decreased, or remained unchanged. Therefore, after determining the optimal power level for the primary and secondary scenarios based on this predictive model, the electronic device may adjust the final power level to PL1 if the performance requirements of the focus application increase. (x-1) It is also possible that the final adjustment level will be adjusted to PL1 when the performance requirements of the focus application decrease. (x+1) Although in both cases the electronic device cannot determine the final power level as the truly optimal power level for the current primary and secondary scenes, the feedback data obtained during the final power level adjustment process, which records the percentage of stuttering time at that level, is objective and can still reflect whether the final power level adjustment harms the user experience for the current primary and secondary scenes. For example, suppose the optimal power level determined by the prediction model for scene 12 is level 7, and the focused application for scene 12 has been updated, making level 7 the actual optimal power level for scene 12. However, the electronic device ultimately adjusts the final power level PL1 using the method described above. yThe power level is determined to be 6. In this case, although the electronic device might experience more frequent stuttering when running at power level 6 in scene 12, the collected feedback data is still specifically for power level 6. After updating the valid data with the feedback data, the proportion of stuttering duration recorded in the valid data increases, reflecting that power level 6 is less suitable for the current scene 12 than before. This reflection is accurate and reliable for the current scene 12. Therefore, regardless of whether the electronic device can ultimately determine the power level that is truly most suitable for the current primary and secondary scenes, the feedback data acquired in the subsequent process is real and objective. After updating the corresponding valid data with the feedback data, the prediction performance of the new power prediction model retrained by the electronic device using the updated valid data will be improved.
[0212] In the foregoing Figure 2 and Figure 10 In the illustrated method embodiment, the entire operation process of the electronic device after it leaves the factory can be divided into three stages: the cold start stage, the statistical stage, and the prediction stage. The amount of valid data (i.e., the number of valid secondary scenarios) acquired by the electronic device in these three stages differs, leading to different methods by which the electronic device determines the desired power level for the primary secondary scenario. Specifically:
[0213] ①
Cold Start Phase
[0214] The cold start phase can be considered the phase in which the electronic device is first started and runs the primary and secondary scenarios after leaving the factory. During this phase, for any given primary and secondary scenario, the electronic device can run at multiple power levels sequentially within that scenario, and obtain the stuttering probability of each scenario at different frequency levels. Preferably, these multiple power levels can include all power levels available to the electronic device. For each power level, the electronic device can be set to the same runtime T, specifically, T can be 30 seconds.
[0215] Let's take the primary secondary scene `scene_x` as an example. In the primary secondary scene `scene_x`, when the electronic device starts running at a new power level `PL1_x`, it records the start time `t_start`. After the runtime reaches the specified runtime `T`, the electronic device records the runtime `duration_ttl` at power level `PL1_x`, and the duration `duration_delay` during which the electronic device experiences a stutter while running at power level `PL1_x`. It then adjusts the maximum CPU power supply level from `PL1_x` to another level, `PL1_y`. Understandably, in the primary secondary scene `scene_x`, the stuttering duration corresponding to power level `PL1_x` is `duration_delay` / `duration_ttl`.
[0216] Preferably, for a primary secondary scene `scene_x`, the electronic device can sequentially adjust the maximum CPU power supplied by the exploration electronic device to all available levels, from high to low. If the electronic device does not experience any stuttering within a specified time `T` while running at a certain power level, the maximum CPU power supplied level is lowered by one level to continue exploration; if a stuttering occurs within the specified time `T`, the maximum CPU power supplied level is immediately increased by one level after the stuttering occurs before continuing exploration. The specific exploration rules can be set as follows:
[0217] 1) When the electronic device runs at power level PL1_x for a duration of T1 (T1≤T), the running scenario changes to a first-level scenario;
[0218] The electronic device saves the current exploration progress PL1_x, adjusts the power level to the highest power level PL1_max, and saves the running time and stuttering time (the stuttering time is 0s) under scene_x; that is, for the tuple (scene_x, PL1_x), it saves the running time T1 and the stuttering time (0s).
[0219] 2) The main secondary scene scene_x has not changed to other scenes, and the electronic device has been running at power level PL1_x for the specified duration T without any lag;
[0220] The electronic device saves the current exploration progress PL1_x, lowers the power level by one level to level PL1_x-1, and saves the duration of the run at power level PL1_x under scene_x and the duration of the stutter (the stutter duration is 0s at this time); that is, for the tuple (scene_x, PL1_x), it saves the corresponding runtime T and the stutter duration (0s). In the embodiments of this application, the main secondary scene scene_x can be referred to as the "first main secondary scene", the power level PL1_x can be referred to as the "first power", and the power level PL1_x-1 can be referred to as the "second power".
[0221] 3) When running at power setting PL1_x for a duration of T2 (T2≤T), the main secondary scene changes from scene_x to scene_y;
[0222] The electronic device saves the duration of operation at power level PL1_x under scene_x and the duration of any stuttering (the stuttering duration is 0 seconds), and also saves the gear exploration progress PL1_x under scene_x; that is, for the tuple (scene_x, PL1_x), it saves the corresponding runtime T2 and stuttering duration (0 seconds); in addition, the electronic device will continue to explore to a lower gear based on the new primary secondary scene scene_y, using the gear exploration progress PL1_y saved under scene_y. In this embodiment, the primary secondary scene scene_y can be referred to as the "third primary secondary scene".
[0223] 4) Running at power setting PL1_x for a duration of T3 (T3≤T), the game stalled for a duration of T4 (T4≤T3) within the duration of T3;
[0224] The electronic device saves the exploration progress PL1_x, increases the power level by one level to PL1_x+1, and saves the runtime T3 of running at power level PL1_x under scene_x and the duration T4 of the stutter; that is, for the tuple (scene_x, PL1_x), it saves the corresponding runtime T3 and the corresponding stutter duration T4. In this embodiment, the power level PL1_x+1 can be referred to as the "third power".
[0225] 5) Switch back to scene_x from other running scenarios;
[0226] The electronic device restarts the gear exploration process in the secondary scene_x, and continues to explore to lower gears based on the gear exploration progress saved in scene_x.
[0227] 6) The total exploration time of the secondary scene_x reaches Ts;
[0228] Once the electronic device finishes its power level exploration process for scene_x, it saves the secondary scene feature value corresponding to scene_x and the proportion of stuttering time of the electronic device under different power levels for scene_x as valid data for scene_x.
[0229] Where Ts is greater than or equal to n×T, and n is the number of all adjustable power levels of the CPU's maximum adjustable power. Preferably, Ts = 2n×T. In the embodiments of this application, the duration T can be referred to as the "first duration" and Ts can be referred to as the "second duration".
[0230] As can be seen from the power level exploration rules above, for a primary and secondary scenario, electronic devices may repeatedly explore a certain power level, and may explore the same power level multiple times. In this case, for the repeatedly explored power level, the electronic device will also record multiple runtime durations (duration_delay) and multiple stutter durations (duration_ttl). The stutter duration ratio corresponding to that power level can be calculated as DURATION_DELAY / DURATION_TTL; where DURATION_TTL is the sum of the runtimes of the electronic device running at that power level each time, and DURATION_DELAY is the sum of the stutter durations of the electronic device running at that power level each time.
[0231] Furthermore, based on the aforementioned gear-level exploration rules, it can be seen that the electronic device's gradual reduction of the CPU's maximum power supply level from high to low is only a general adjustment trend. In the actual process of exploring the gear levels for secondary scenarios, the electronic device may not completely follow the adjustment direction from high to low to lower the CPU's maximum power supply level—when a stutter occurs, the electronic device will increase the power level by one gear. This can effectively avoid the impact of data randomness on the accuracy of the results.
[0232] For example, suppose the probability of an electronic device lagging at power level PL1_x in the main secondary scene scene_x is very small, actually 0.05. However, while exploring at power level PL1_x, the electronic device ran for 30 seconds and lagged for 3 seconds (a low-probability event). If the power level is simply lowered further, the total running time and total lag time corresponding to power level PL1_x will not be updated. Therefore, the electronic device calculates the lag time percentage corresponding to power level PL1_x as 3 / 30 = 0.1, which is twice the actual lag probability. However, if the power level is increased by one level to PL1_x+1, the probability of the electronic device lagging at power level PL1_x+1 in the main secondary scene scene_x is even smaller, with a very high probability that it will not lag within 30 seconds. Therefore, after 30 seconds, the electronic device will lower the power level by one level back to power level PL1_x. Since the probability of an electronic device experiencing lag when running the secondary scene_x at power level PL1_x is extremely low, it is highly likely that the electronic device will not lag within 30 seconds when running at power level PL1_x again. Therefore, the total running time and total lag time corresponding to power level PL1_x will be updated to 60 seconds and 3 seconds, respectively. The calculated lag time percentage corresponding to power level PL1_x is 3 / 60 = 0.05. This value is closer to the actual lag probability corresponding to power level PL1_x, thus reducing or even avoiding the impact of data randomness on the accuracy of the results.
[0233] Figure 13 An example is shown of the process by which an electronic device explores the primary and secondary scenes according to the aforementioned gear exploration rules during the cold start phase.
[0234] Here, it is assumed that T is 30s, Ts is 600s, and the CPU has 10 adjustable power levels (since the lowest level, 1, is highly likely to cause user experience issues, the power level exploration only goes as far as level 2 and then stops). Figure 13 As shown, the raw data table 1300 records the information obtained by the electronic device in exploring various power levels under each primary and secondary scenario. This information includes the primary and secondary scenario parameters, as well as the running time and lag time of the electronic device at each power level. In the raw data table 1300, each primary and secondary scenario corresponds to a separate raw data entry. It is understandable that the raw data table 1300 is empty when the electronic device is first started after leaving the factory.
[0235] Assume scene 131 is the first primary secondary scene entered at time t1 after the electronic device is powered on from the factory. Then, as follows... Figure 13 As shown in (A), raw data 1301 will be stored as the first raw data in raw data table 1300. From this point onward, although... Figure 13 As not shown in the diagram, the electronic device stores the primary and secondary scene parameters of scene 131 in the raw data 1301. Additionally, the electronic device records all power levels the CPU can supply at (100% is level 10, 90% is level 9, and so on) in the raw data 1301. Each power level forms a tuple with scene 131, which records the runtime and stuttering duration (percentage of stuttering duration) of the electronic device at its corresponding power level. Since the electronic device has not explored scene 131 before time t1, therefore... Figure 13 The information corresponding to each gear in the original data 1301 shown in (A) is empty.
[0236] At time t1, the electronic device begins a power level exploration process for scene 131. According to the aforementioned power level exploration rules, at the start of the exploration, the electronic device will adjust the CPU's maximum available power level to the highest level, 10, and run it. After running for 30 seconds, at time t2, if the electronic device does not experience any stuttering during the entire process, the exploration of power level 10 will end. Following the power level exploration rules, the electronic device will save the current power level exploration progress (10), record the total runtime of 30 seconds and the stuttering duration (0 seconds) corresponding to the exploration process at power level 10, and then lower the power level by one level to 9, continuing the exploration.
[0237] like Figure 13 As shown in (B), at time t2, the data area corresponding to gear 10 in the original data 1301 has already saved the duration information (30,0), indicating that up to time t2, the electronic device has been running at gear 10 in scene 131 for a total of 30 seconds, with a total lag of 0 seconds. Furthermore, the electronic device can mark gears to save the gear exploration progress. For example, in... Figure 13 In the original data 1301 shown in (B), there is an exploration progress marker at level 10, indicating that the electronic device's current exploration progress for scene 1 is at level 10. This is understandable, as... Figure 13 The exploration progress marker shown in (B) is for illustrative purposes only. In actual application scenarios, it may exist in electronic devices in the form of code or in a form that can be perceived by other electronic devices. This application does not limit this.
[0238] At time t2, the electronic device starts operating at power level 9. After 10 seconds, at time t3, if the electronic device did not experience any lag during the entire operation, but a level 1 event is triggered, the electronic device's operating scene changes from scene 131 to the level 1 scene. According to the exploration rules, the electronic device saves the current exploration progress at power level 9, records the total runtime of 10 seconds and the lag duration of 0 seconds for the exploration process at power level 9, and directly adjusts the power level to the maximum power level 10.
[0239] like Figure 13 As shown in (C), at time t3, the data area corresponding to the 9th gear of the original data 1301 has already saved the duration information (10,0), which means that up to time t3, the total duration of the electronic device running scene 131 at the 9th gear is 10s, and the total lag time is 0s.
[0240] Assuming the electronic device does not trigger the first-level event again within 5 seconds after time t3, the first-level scene ends. The electronic device re-enters the second-level scene. Let's assume the main second-level scene the electronic device is in after the first-level scene ends is scene131. Then, 5 seconds after time t3, at time t4, the electronic device re-enters the main second-level scene, scene 131. At this point, the electronic device will continue exploring scene 131 at the level 9 progress saved in the original data 1301.
[0241] like Figure 13 As shown in (D), at time t4, the data in the original data 1301 remained unchanged compared to time t3, and the electronic device continued to operate at level 9 in scene 131. After running for 30 seconds, at time t5, the electronic device did not experience any lag during the entire operation. According to the gear exploration rules, the electronic device will save the gear exploration progress as level 9, record the running time of level 9 as 30 seconds and the lag duration as 0 seconds, and then downgrade the power level by one gear to level 8 to continue gear exploration.
[0242] like Figure 13 As shown in (E), at time t5, the data area corresponding to gear 9 of the original data 1301 already contains duration information (40,0), indicating that up to time t5, the electronic device ran at gear 9 for a total of 40 seconds under scene 131, with a total stutter of 0 seconds. It should be noted that the duration information (40,0) contains two duration information sets: the duration information (10,0) obtained from the first run at gear 9, and the duration information (30,0) obtained from the second run at gear 9. The electronic device can fuse these two duration information sets to obtain the following... Figure 13The duration information (40,0) shown in (E) is recorded in the original data 1301. Alternatively, the two duration information (40,0) and (10,0) can be recorded in the original data 1301 respectively. This application does not limit this.
[0243] At time t5, the electronic device begins operating at power level 8 in scene 131. After running for 20 seconds, at time t6, the electronic device experiences a 0.3-second pause during its operation (this 0.3 seconds is the period from 19.7 seconds to 20 seconds after time t5). According to the exploration rules, the electronic device will save its current exploration progress at power level 8, record the total running time of 20 seconds for exploring at power level 8 and the 0.3-second pause, and then increase the power level by one level to power level 9 before continuing the exploration.
[0244] like Figure 13 As shown in (F), at time t6, the data area corresponding to the 8th gear of the original data 1301 has already saved the duration information (20, 0.3), which means that up to time t6, the total duration of the electronic device running scene 131 at the 8th gear is 20s, and the total lag is 0.3s.
[0245] At time t6, the electronic device restarts at speed 9 in scene 131. After running for 10 seconds, at time t7, the electronic device has not experienced any lag during the entire operation, but the primary secondary scene it was running in has changed from scene 131 to primary scene 132 (assuming the electronic device is entering primary scene 132 for the first time). According to the exploration rules, the electronic device will save the speed exploration progress of scene 131 at speed 9, record the runtime of 10 seconds at speed 9 in scene 131, and the lag duration of 0 seconds. Furthermore, the electronic device will begin speed exploration in the new primary secondary scene 132 and create a new raw data entry 1302 in raw data table 1300 to store the information obtained during speed exploration of scene 132.
[0246] like Figure 13As shown in (G), at time t7, the data area corresponding to gear 9 of the original data 1301 already contains duration information (50,0), indicating that up to time t7, the electronic device ran at gear 10 in scene 131 for a total duration of 50 seconds, with a total 0 seconds of lag. Similarly, the duration information (50,0) is obtained by fusing three duration information, namely (10,0), (30,0), and (10,0). For details, please refer to the foregoing explanation; it will not be repeated here or in subsequent embodiments. In addition, a new original data 1302 was added to the original data table 1300, but since the electronic device had not yet explored the gears of scene 132 before time t7, therefore... Figure 13 In the original data 1302 shown in (G), the information corresponding to each gear position is empty.
[0247] At time t7, the electronic device begins exploring scene 132 at different power levels. Similarly, it adjusts the CPU's maximum available power level to the highest level, 10, and runs the scene. After 30 seconds of operation, at time t8, the electronic device operates without any lag throughout the entire process. It saves the current exploration progress at level 10, records the total runtime of 30 seconds for exploring at level 10, and the lag duration of 0 seconds. It then lowers the power level by one level to 9 and continues the exploration.
[0248] like Figure 13 As shown in (H), at time t8, the data area corresponding to gear 10 of the original data 1302 has already stored the duration information (30,0), which means that up to time t8, the electronic device has been running at gear 10 in scene 132 for a total of 30 seconds, with a total stutter of 0 seconds. In addition, the electronic device can mark gear 10 to save the progress of gear exploration in scene 132.
[0249] During subsequent operation, the electronic device will encounter more and more primary and secondary scenes under user operation, and the amount of raw data stored in the original data table 1300 will also increase. Similarly, during subsequent operation, the electronic device will be in the same secondary scene multiple times. For example, the primary secondary scene may switch back to scene 131 during subsequent operation. For any primary secondary scene, when the total running time of the electronic device in that primary secondary scene reaches 600 seconds, it can be considered that the electronic device has completed the exploration process of the power level of that primary secondary scene, that is, the electronic device has basically been able to determine the optimal power level of that primary secondary scene through the acquired data. At this time, the raw data corresponding to that primary secondary scene is valid data, and that primary secondary scene can be called a valid primary secondary scene. After obtaining the corresponding valid data for any primary secondary scene, the cold start phase ends accordingly, and the electronic device enters the statistical phase.
[0250] It's important to note that for a valid primary / secondary scene with acquired data, the electronic device doesn't necessarily need to explore all power levels within that scene. For example, suppose there's a secondary scene 133. The electronic device explores a new secondary scene 132 using an optimal power exploration strategy. If the device experiences a stutter each time it runs scene 133 at power level 4, and this stuttering necessitates increasing the power level from 1 to 5, then it's possible that after a total runtime of 600 seconds in scene 133, the device hasn't actually run at power levels 3 and 2. Therefore, the valid data for scene 133 would be empty for these power levels. However, since the electronic device experiences stuttering every time it runs at power level 4 in scene 133, it's highly likely that stuttering will also occur frequently at power levels below 4 in scene 133. This means that running at power levels 3 or 2 in scene 133 will severely degrade the user experience. Therefore, power levels 3 and 2 are highly unlikely to be the optimal power levels for scene 133, making it irrelevant to explore power levels 3 and 2 in scene 133. During subsequent model training, when processing the valid data to obtain power level label data, the electronic device can set the label value of power levels with empty information in the valid data to "0", indicating that running at these power levels will cause a degraded user experience.
[0251] ②
Statistical Stage
[0252] Unlike the cold start phase, the statistical phase already stores some valid data from the primary and secondary scenarios in the electronic device (the number of valid data is less than X, where X is the minimum number of valid data required for model training). In this phase, there are also some ineffective primary and secondary scenarios, including those the electronic device has not yet encountered, and those it has encountered but whose total runtime has not yet reached 600 seconds.
[0253] In this stage, when the electronic device is in the primary secondary scene or the effective secondary scene, the electronic device can determine the optimal power level corresponding to the secondary scene based on the proportion of stuttering time under different power levels recorded in the effective data corresponding to the effective secondary scene, and adjust the maximum power level that the CPU can supply to be the optimal power level.
[0254] However, when the current primary secondary scenario is an ineffective primary secondary scenario, the electronic device cannot determine the optimal power level for that ineffective primary secondary scenario. Therefore, the electronic device will continue to explore the power level for that ineffective primary secondary scenario according to the aforementioned optimal exploration strategy, that is, it will run according to the power level saved in the power level exploration progress; for secondary scenarios that have never been encountered before, the exploration will start from the highest power level that the maximum power that the CPU can supply provided by the electronic device.
[0255] Figure 14 This shows the specific contents of the raw data table stored in the electronic device at a certain point in the statistical phase. For example... Figure 14 As shown, raw data table 1400 contains raw data from multiple secondary scenarios. Among them:
[0256] Scene 141 is a valid primary secondary scene, and the original data 1401 recorded in the original data table 1400 is the valid data of scene 141.
[0257] Scene 142 is a non-effective primary secondary scene that the electronic device has already encountered, but the total runtime has not yet reached 600 seconds. Furthermore, as can be seen from the original data table 1400, the electronic device's gear exploration progress in scene 142 is 6 gears.
[0258] Scene 143 is a non-effective primary secondary scene that electronic devices have never encountered before.
[0259] It should be noted that the runtime and lag duration information recorded for each gear in the original data table 1400 have been converted into lag duration percentages (the probability of lag). Furthermore, the original data 1403 shown in the original data table 1400 is for illustrative purposes only; in reality, if scene 143 has not yet been encountered, the original data 1403 may not actually exist in the original data table 1400.
[0260] Suppose the operating environment of the current electronic device changes:
[0261] 1) If the changed operating scenario is a level one scenario.
[0262] The electronic device directly adjusts the CPU's maximum power supply level to the maximum level until the first-level scene changes to the second-level scene.
[0263] 2) If the changed running scene is a secondary scene, and the main secondary scene is scene 141.
[0264] The electronic device can query the original data table 1400 based on the parameters of the primary secondary scene (scene 141). After obtaining the valid data 1401 for scene 14, it determines the optimal power level for scene 141 based on the valid data 1401. Taking 0.03 as a threshold as an example, assuming that in the valid data of a primary secondary scene, if the percentage of stuttering time corresponding to a power level is less than or equal to 0.03, it means that running at that power level in that primary secondary scene will not harm the user experience; otherwise, it will. Therefore, for scene 141, the electronic device can search from the highest power level in the valid data 1401 down to the lowest, finally determining the smallest power level (i.e., level 5) with a probability value less than or equal to 0.03 as the optimal power level. Afterwards, under scene 141, the electronic device will adjust the maximum power level that the CPU can supply to to level 5.
[0265] 3) If the changed running scene is a secondary scene, and the main secondary scene is scene 142.
[0266] The electronic device can query the original data table 1400 based on the parameters of the primary secondary scene 142 to determine the original data 1402 corresponding to scene 142. After determining that the original data 1402 is invalid data, the electronic device will obtain the saved gear exploration progress (6 gears) of scene 142, adjust the gear of the maximum power that the CPU can supply to to 6, and continue to complete the gear exploration process of scene 142 according to the gear exploration rules described above.
[0267] 4) If the changed running scene is a secondary scene, and the main secondary scene is scene 143.
[0268] The electronic device can query the original data table 1400 based on the parameters of the primary secondary scene 143. After confirming that scene 143 is a scene that has never been encountered before, the electronic device can create a new original data record 1403 in the original data table 1400. At this time, the data areas corresponding to all gears in the original data record 1403 are empty. Then, the electronic device can explore the gears of scene 143 starting from the highest CPU maximum power supply gear 10 according to the gear exploration rules described above, and record the percentage of stuttering time under each gear.
[0269] ③
Prediction Phase
[0270] During the prediction phase, the electronic device acquires a sufficient number (≥X) of valid data points and trains a corresponding power prediction model based on this data. In other words, at this stage, the electronic device has already trained the model based on the stored valid data, obtaining the aforementioned power prediction model and deploying it within the device. Therefore, at this stage, when the electronic device is in a primary secondary scenario, regardless of whether the primary secondary scenario is valid or invalid, the electronic device can determine the optimal power level for that primary secondary scenario using the aforementioned power prediction model. Specifically, the electronic device can input the primary secondary scenario parameters into the power prediction model, which will then output the probability of a degraded user experience at each power level within that primary secondary scenario. Afterward, the electronic device can use a certain threshold (e.g., 0.5) as a benchmark, determining the minimum power level with a probability value less than or equal to that threshold as the optimal power level for that primary secondary scenario, and adjusting the maximum CPU power supply level to that optimal power level.
[0271] It should be noted that, in the three stages mentioned above, the operation of adjusting the CPU's maximum power level for different primary and secondary scenarios can only occur when the electronic device is unplugged (i.e., not charging). When the electronic device is charging, since the power supply is sufficient, the electronic device does not need to adjust the CPU's maximum available power level based on the operating scenario. Instead, it keeps the CPU's maximum available power level at the maximum level to prioritize the performance requirements of the electronic device.
[0272] Figure 15 This is a logical architecture diagram of a power prediction method provided in an embodiment of this application. It illustrates the specific logic of an electronic device determining the desired power level for a secondary scenario, determining the user experience after adjusting the power level, and updating the power adjustment algorithm based on the user experience. Figure 15 As shown, the logical architecture includes: runtime environment, runtime scenario, AI algorithm, adjustment strategy, and result feedback. Among them:
[0273] The operating environment specifically refers to all relevant data that the electronic device can currently collect, such as the usage of the mouse and keyboard, the specific performance parameters of the CPU and GPU, the brightness of the electronic device's screen, whether the electronic device is using a camera, whether the electronic device is playing audio, and so on.
[0274] An operating scenario can be considered an operational state reflecting the current performance requirements of an electronic device. It is determined by selecting relevant data affecting the device's performance from all data collected from the operating environment. This data, when combined, results in a uniquely defined operating scenario. Specifically, a first-level scenario occurs when data in the operating environment indicates a primary event such as a mouse click or keyboard shortcut activation. A second-level scenario occurs when data in the operating environment indicates no primary event has occurred. In this case, the electronic device can also obtain all the parameters corresponding to the second-level scenario based on the data from the operating environment.
[0275] The AI algorithm can include the method described above for determining the maximum CPU power level to be adjusted in a primary scenario (hereinafter referred to as the adjustable power level), and the method for determining the adjustable power level in a secondary scenario. For details, please refer to the aforementioned descriptions; they will not be repeated here. When determining the maximum CPU power level to be adjusted based on the AI algorithm in a secondary scenario, the AI algorithm takes the scenario parameters of the secondary scenario (including primary secondary scenario parameters and possibly secondary secondary scenario parameters) as input, and the output is the adjustable power level.
[0276] The adjustment strategy is used to send and execute the desired power level output by the AI. It can correspond to a CPU performance adjustment module in an electronic device. This module can exist in the electronic device as program code and may contain a storage address that records the current maximum power level that the electronic device's CPU can supply. After obtaining the desired power level, the CPU performance adjustment module can change the current maximum power level of the electronic device's CPU based on the aforementioned storage address to complete the adjustment of the CPU's maximum power supply level.
[0277] Feedback results refer to the impact of adjusting the CPU's maximum available power level to the desired power level on the operating environment. This feedback can be categorized as positive or negative based on the smoothness of the electronic device's operation. Positive feedback indicates that the desired power level set by the AI brings positive benefits (i.e., the electronic device does not experience stuttering when operating at the desired power level), while negative feedback indicates negative benefits (i.e., the electronic device stutters when operating at the desired power level).
[0278] AI will further iterate and optimize its algorithm through positive and negative feedback in the results feedback. It's understandable that results feedback exists throughout the entire operation of the electronic device. For example, in the cold start phase, when the electronic device runs at a certain speed and reaches a duration T without any lag, the electronic device considers the feedback generated by running at that speed as positive feedback and will lower the speed by one level. If the electronic device lags before reaching time T while running at that speed, it considers the feedback generated by running at that speed as negative feedback and will raise the speed by one level. Similarly, in the prediction phase, after the electronic device determines the desired speed based on the power prediction model and adjusts the maximum power supply of the CPU to the desired speed, the electronic device will also collect feedback data (if the lag duration recorded in the feedback data is 0, the feedback is positive; otherwise, it is negative feedback), and update the power prediction model based on the acquired feedback data.
[0279] Figure 16 An embodiment of this application provides a system architecture that can be used to train and run the aforementioned prediction model. Figure 16 As shown, electronic device 100 can be the electronic device provided in this application as described above. Electronic device 100 can be connected to multiple input devices 200, such as a mouse and keyboard. Figure 16 (Not shown) Communication or electrical connection. Specifically, some devices in input device 200 are integrated on electronic device 100; for example, when electronic device 100 is a laptop, the keyboard included in input device 200 can be integrated with electronic device 100 on the same device body.
[0280] Specifically, the electronic device 100 may include a data acquisition module 1001, a data processing module 1002, a data storage module 1003, a training module 1004, an execution module 1005, and a charging module 1010; wherein:
[0281] The data acquisition module 1001 is used to acquire valid data. For specific acquisition methods, please refer to the relevant description of step S101 in the foregoing method embodiments; it will not be repeated here.
[0282] When the amount of valid data exceeds a certain threshold, the data processing module 1002 preprocesses all valid data collected by the data acquisition module 1001. For specific processing methods, please refer to the aforementioned... Figure 4 The relevant explanations will not be repeated here.
[0283] The data storage module 1003 is used to store the valid data collected by the data acquisition module 1001. In addition, the data storage module is also used to store data obtained by the data processing module 1002 during the preprocessing of the valid data, such as a mapping table recording the mapping relationship between the focus application name and the focus application number, a gear marking table recording whether the power level affects the user experience, and the training set finally used for inputting into the prediction model for training, etc. (For details, please refer to the aforementioned...) Figure 4 (Related instructions).
[0284] After the effective data is converted into a training set, the training module 1004 uses the training set stored in the data storage module 1003 to train the model, obtain the power prediction model 1007, and integrate the power prediction model 1007 into the calculation module 1006.
[0285] Optionally, before training the power prediction model 1007, the charging module 1010 can first identify whether the user is in a charging state; if in a charging state, the charging module 1010 will send an execution instruction to the training module 1004. Only after receiving the execution instruction will the training module 1004 start training to ensure that the electronic device can provide sufficient power for the model training process.
[0286] The power prediction model 1007 can predict the probability of user experience impairment at each power level under the current primary and secondary scenarios of the electronic device. Further, the calculation module 1006 can determine the optimal power level for the secondary scenario based on the probability of user experience impairment at each power level under the secondary scenario output by the power prediction model, identifying the lowest power level with an impairment probability less than or equal to 0.5, and then send this optimal power level to the CPU performance adjustment module 1009.
[0287] After receiving the above-mentioned optimal power level, the CPU performance adjustment module 1009 can adjust the maximum power supply level of the CPU of the electronic device 100 to the above-mentioned optimal power level.
[0288] Furthermore, when a user operates through the interface provided by the I / O interface 1008, such as clicking a mouse button or inputting data via keyboard shortcuts, this can be considered as the electronic device 100 triggering a Level 1 event, and the scenario in which the electronic device 100 is operating is a Level 1 scenario. In this case, the I / O interface 1008 can send corresponding instructions or information to the CPU performance adjustment module 1009, which can directly adjust the maximum available power level of the CPU to the maximum level. Specifically, the CPU performance adjustment module 1009 can exist in the electronic device 100 in the form of program code, and it can contain a storage address used to record the current maximum available power level value of the CPU. When the CPU performance adjustment module 1009 receives instructions or information for adjusting the maximum available power level of the CPU, it can change the current maximum available power level value of the CPU based on the aforementioned storage address to complete the adjustment of the maximum available power level of the CPU.
[0289] Optionally, the CPU performance adjustment module 1009 can also receive control commands from the charging module 1010, which indicate whether the electronic device 100 is currently charging. When the control command indicates that the electronic device 100 is currently charging, the CPU performance adjustment module 1009 no longer needs to adjust the maximum available power level of the CPU based on the optimal power level issued by the calculation module 1006. That is, when the electronic device 100 is charging, the power supply is sufficient, the prediction model 1007 no longer needs to be effective, and the CPU performance adjustment module 1009 can directly adjust the maximum available power level of the CPU to the maximum power level and maintain the maximum power level operation to prioritize the performance requirements of the electronic device. When the control command indicates that the electronic device 100 is currently not charging, the CPU performance adjustment module 1009 will again use the optimal power level issued by the calculation module 1006 as the benchmark to adjust the maximum available power level of the CPU of the electronic device 100 to the optimal power level, ensuring the balance between the performance and power consumption of the electronic device 100.
[0290] Understandable. Figure 15 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 16 In this context, the data storage module 1003 is the internal memory of the electronic device 100. In other cases, the data storage module 1003 may be placed outside the electronic device 100.
[0291] The electronic device provided in this application will now be described.
[0292] 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.
[0293] Figure 17 The structure of the electronic device is shown as an example.
[0294] 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.
[0295] 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.
[0296] 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.
[0297] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0298] 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.
[0299] 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.
[0300] 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.
[0301] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel.
[0302] Camera 193 is used to capture still images or videos.
[0303] 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.
[0304] 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.
[0305] 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.
[0306] 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.
[0307] 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.
[0308] 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.
[0309] 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.
[0310] 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.
[0311] 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.
[0312] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0313] The processor 110 is used to collect valid data from the primary secondary scene and train a power prediction model based on the collected valid data. The electronic device 100 can store the collected valid data in the memory of the processor 110 or in an external memory connected via the external memory interface 120.
[0314] Specifically, when there is a sufficient amount of effective training data, the charging management module 140 can send a first message to the processor 110, and the display screen 194 can send a second message to the processor 110 through the corresponding interface. The processor 110 will only trigger the process of training the power prediction model when the first message indicates that the electronic device 100 is currently charging and the second message indicates that the display screen of the electronic device is off (the electronic device 100 is still powered on).
[0315] During the operation of the electronic device 100, if the electronic device 100 is in a charging state, the charging management module 140 can send a third message to the processor 110. The third message is used to notify the processor 110 that the electronic device 100 is currently in a charging state, so that the processor 110 can keep the maximum available power level at the maximum power level.
[0316] 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, based on the operating scenario category, determine the required adjustment value or power level of the maximum power that the processor 110 can supply. For specific determination methods, please refer to the aforementioned... Figure 2 , Figure 12 as well as Figure 13 Related explanations.
[0317] 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.
[0318] 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)".
[0319] 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.
[0320] 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: Upon detecting a first primary-secondary event, it is determined that the electronic device is in a first primary-secondary scenario. The first primary-secondary event includes events in which the electronic device runs the focused application when no primary event is detected. Based on the power prediction model, the first primary secondary scenario is predicted to obtain a first prediction result. The first prediction result includes the maximum available power of multiple CPUs and the probability of user experience impairment when running at the maximum available power of the multiple CPUs in the first primary secondary scenario. The probability of user experience impairment is the probability that the proportion of lag time when running at the maximum available power of the CPU is greater than a first threshold. The maximum power that the CPU of the electronic device can supply is adjusted according to a first optimal power, wherein the first optimal power is determined by the minimum power that meets a first condition in the first prediction result, and the first condition is that the probability of user experience impairment is less than or equal to a second threshold.
2. The method according to claim 1, characterized in that, After adjusting the maximum CPU supply power of the electronic device according to the first optimal power, the method further includes: Upon detecting a Level 1 event, it is determined that the scene in which the electronic device is located has switched from the first primary / secondary scene to a Level 1 scene. The Level 1 scene includes the running scene in which the electronic device detects an interaction event. Adjust the maximum available power of the CPU of the electronic device to the maximum power.
3. The method according to claim 1 or 2, characterized in that, After adjusting the maximum CPU supply power of the electronic device according to the first optimal power, the method further includes: Upon detecting a second primary-secondary event, it is determined that the scene in which the electronic device is located has switched from the first primary-secondary scene to the second primary-secondary scene, and the second primary-secondary scene is different from the first primary-secondary scene. Based on the power prediction model, the second primary and secondary scenarios are predicted to obtain a second prediction result. The second prediction result includes the maximum power that the multiple CPUs can supply, and the probability of user experience impairment when the multiple CPUs are running at their maximum power supply in the second primary and secondary scenarios. The maximum power that the CPU of the electronic device can supply is adjusted according to the second optimal power, which is determined by the minimum power that meets the first condition in the second prediction result.
4. The method according to any one of claims 1 to 3, characterized in that, Before adjusting the maximum available power of the electronic device's CPU according to the first optimal power, the method further includes: Upon detecting a first secondary event, it is determined that the electronic device is in a first secondary scenario. The first secondary event includes running scenarios related to background applications when no interaction events are detected. Based on the power prediction model, the first secondary scenario is predicted to obtain a third prediction result. The third prediction result includes the maximum power that the multiple CPUs can supply, and the probability of user experience impairment when the multiple CPUs are running at their maximum power in the first secondary scenario. The step of adjusting the maximum available power of the CPU of the electronic device according to the first optimal power includes: The maximum available power of the CPU of the electronic device is adjusted to the largest of the first optimal power and the first optimal power, wherein the first optimal power is determined by the minimum power that meets the first condition in the third prediction result.
5. The method according to any one of claims 1 to 4, characterized in that, Before detecting that the electronic device is in the first primary / secondary scene, the method further includes: The training dataset is obtained based on the valid dataset. The training dataset includes training data for multiple primary and secondary scenarios. The primary and secondary scenarios include scenarios related to the focused application when the electronic device does not detect interactive events. The training data includes label values corresponding to the maximum power that each CPU can supply under the primary and secondary scenarios. The label values include a first label value and a second label value. The first label value indicates that the probability of the electronic device running at the corresponding power is less than or equal to the first threshold. The second label value indicates that the probability of the electronic device running at the corresponding power is greater than the first threshold. The power prediction model is trained based on the training dataset.
6. The method according to claim 5, characterized in that, The effective dataset includes multiple pieces of effective data from primary and secondary scenarios. The effective data includes the runtime and lag duration of the electronic device running at multiple different maximum CPU power supplies under the primary and secondary scenarios. The step of obtaining the training dataset based on the valid dataset includes: Determine the percentage of lag time in the valid data when the electronic device is running at multiple different maximum CPU power supplies, wherein the percentage of lag time is the ratio of lag time to running time; If the percentage of stuttering time is less than or equal to the first threshold, then the tag value of the maximum CPU power that can be supplied in the valid data is determined as the first tag value; if the percentage of stuttering time is greater than the first threshold, then the tag value of the maximum CPU power that can be supplied in the valid data is determined as the second tag value.
7. The method according to claim 5 or 6, characterized in that, Before obtaining the training dataset based on the valid dataset, the method further includes: In the first primary-secondary scenario, the CPU operates at the maximum power it can supply. If the CPU operates at the first power for a duration of one time without any lag, the maximum CPU power is adjusted to the second power. The first power and the second power are included in the plurality of different maximum CPU power supplies, the second power is less than the first power, and the effective dataset includes the effective data of the first primary and secondary scenarios. The effective data of the first primary and secondary scenarios includes the runtime and lag duration when operating at the first power.
8. The method according to claim 7, characterized in that, The method further includes: If the duration of operation at the first power is less than the first duration and a stutter occurs, the maximum available power of the CPU is adjusted to the third power; the third power is included in the plurality of different maximum available power of the CPU, the third power is greater than the first power, and the effective data of the first primary and secondary scenarios include the runtime and stutter duration of operation at the first power and the third power.
9. The method according to claim 7 or 8, characterized in that, The method further includes: When a third primary secondary event is detected while the electronic device is running at the first power in the first primary secondary scenario, it is determined that the scenario in which the electronic device is located has switched from the first primary secondary scenario to the third primary secondary scenario, and the third primary secondary scenario is different from the first primary secondary scenario. The exploration progress of the first primary and secondary scenes is saved as the first 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. The exploration progress of the third primary and secondary scenarios is determined, and the maximum available power of the CPU of the electronic device is adjusted to the power corresponding to the exploration progress of the third primary and secondary scenarios. The effective dataset also includes effective data of the third primary and secondary scenarios.
10. The method according to any one of claims 7 to 9, characterized in that, The valid data of the first primary and secondary scenarios include the running time and lag time of the electronic device running at the maximum available power of the multiple CPUs during the second duration when the total running time of the electronic device in the first primary and secondary scenarios reaches the second duration.
11. The method according to claim 10, characterized in that, The first duration is 30 seconds, and / or the second duration is 600 seconds.
12. The method according to any one of claims 6 to 9, characterized in that, The number of running data in the training dataset is greater than the third threshold.
13. The method according to any one of claims 1 to 3, characterized in that, The step of adjusting the maximum CPU supply power of the electronic device according to the optimal power includes: Adjust the maximum CPU power supply of the electronic device to the optimal power; Alternatively, the maximum CPU power supplied by the electronic device can be adjusted to a target power, where the target power is any one of the optimal power, the fourth power, and the fifth power, where the fourth power is less than the target power, the fifth power is greater than the target power, the fourth power and the fifth power belong to the plurality of different maximum CPU power supplies, and the difference between the optimal power and the fourth power, and the difference between the optimal power and the fifth power are both less than the fourth threshold.
14. The method according to claim 4, characterized in that, The background application is an application that, apart from the focus application, has a high CPU load.
15. The method according to any one of claims 1 to 14, characterized in that, After adjusting the maximum CPU supply power of the electronic device according to the optimal power, the method further includes: Collect feedback data, including runtime and stuttering duration when running at the adjusted maximum available CPU power. The power prediction model is updated based on the feedback data.
16. 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-15.
17. 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-15.
18. 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-15.
Citation Information
Patent Citations
Method and device for switching central processing unit (CPU) working modes according to application scenarios
CN103529925A
Power supply power distribution method of electronic device, electronic device and readable storage medium
CN110442224A