Power adjustment method and related device
By recording the scene where the stuttering event occurs and the maximum power available for the CPU used, and adjusting the power according to the specific situation, the lag problem of electronic devices when capturing stuttering events is solved, achieving more reasonable performance optimization and user experience improvement .
Patent Information
- Application Number
- CN202310963625.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-14
AI Technical Summary
Existing electronic devices have lag when capturing stuttering events, resulting in the inability to optimize performance for stuttering events in real time, affecting the user experience.
Record the scene where the stuttering event occurs and the maximum power available for the CPU used, and adjust the maximum power available for the CPU according to the specific situation of the stuttering event to optimize performance more reasonably.
It achieves close connection between the stuttering event with the scene and power when it occurs, and can adjust performance more reasonably and improve user experience.
Smart Images

Figure CN119440218A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a power adjustment method and related devices. Background Art
[0002] During the operation of electronic devices such as mobile phones and computers, the electronic devices may experience freezes at any time, such as screen freezes, input freezes, and mouse freezes. These freezes will cause a sharp decline in user experience.
[0003] Currently, electronic devices capture freeze events during operation to optimize performance. When an electronic device freezes, there is usually a delay of several seconds or even tens of seconds between the time when the electronic device actually captures the freeze event and the time when the freeze actually occurs. Therefore, the electronic device cannot respond to the freeze event in real time, and the reporting of the freeze event loses its reference function.
[0004] Therefore, how to overcome the lag in reporting jam events and effectively use jam events to optimize performance is an urgent problem to be solved. Summary of the invention
[0005] The purpose of the present application is to provide a power adjustment method and related devices. By implementing the method, when a freeze event occurs in an electronic device, the electronic device can record the scene where the freeze occurs and the maximum power that can be supplied by the CPU used, and determine the target CPU maximum power that needs to be adjusted in the freeze event scenario based on the power used when the freeze occurs. In this way, the electronic device can closely link the freeze event with the scene where the electronic device is located when it occurs and the maximum power that can be supplied by the CPU used, and can make more reasonable adjustments to the performance of the electronic device according to the freeze event, thereby improving the user experience.
[0006] The above-mentioned and other objects are achieved by the features of the independent claims. Further implementations are presented in the dependent claims, the description and the drawings.
[0007] In a first aspect, the present application provides a power adjustment method, including: detecting at least one freeze event in a first main-secondary scenario, the at least one freeze event including at least one first freeze event, the at least one first freeze event occurring in the first main-secondary scenario, the first main-secondary scenario including a scenario related to a focus application when the electronic device does not detect an interaction event; adjusting the maximum power that can be supplied by the CPU of the electronic device to a first power, the first power being greater than the maximum power that can be supplied by the CPU used by the electronic device when each freeze event in the at least one first freeze event occurs.
[0008] In this method, the at least one first freeze event is a freeze event that occurs in the first primary-secondary scenario, that is, at the time when the first freeze event occurs, the electronic device is running in the first primary-secondary scenario.
[0009] In this method, when a freeze event occurs, the electronic device can record the time of occurrence of the freeze event, the freeze duration, the operating scenario of the electronic device when the freeze event occurs, and the maximum power that the CPU used can supply, etc. Therefore, after obtaining the at least one first freeze event, the electronic device can determine the operating scenario of the electronic device and the maximum power that the CPU used can supply at the time of occurrence according to the time of occurrence of each freeze event.
[0010] Assume that the at least one jamming event includes N1 (N1>0) first jamming events (the N1 first jamming events are the at least one jamming event). After obtaining the N1 first jamming events, the electronic device can sequentially obtain the maximum CPU power that the electronic device uses when these jamming events occur, and obtain a total of N1 CPU maximum power supplies. Since the occurrence of a jamming event indicates that the performance provided by the maximum CPU power supply is insufficient to meet the performance requirements of the first main and secondary scenarios, for the N1 CPU maximum power supplies obtained above (the N1 CPU maximum power supplies may have the same CPU maximum power supply), the electronic device can increase the N1 CPU maximum power supplies by the same value to obtain the updated N1 CPU maximum power supplies, and determine the maximum power of the updated N1 CPU maximum power supplies as the first power. Since the current electronic device is still in the first main and secondary scenarios, the electronic device can adjust the CPU maximum power supply to the first power after determining the first power, meet the performance requirements of the first main and secondary scenarios, and improve the user experience.
[0011] In some embodiments, in order to reduce the power consumption of electronic devices as much as possible while ensuring user experience and effectively extend the use time of electronic devices, when the electronic device enters any main secondary scene, the electronic device can use the optimal power exploration strategy to explore the maximum power that can be supplied by multiple different CPUs in the main secondary scene to obtain the optimal common power of the main secondary scene. That is, in the main secondary scene, the electronic device will adjust the gear of the maximum power that can be supplied by the CPU to power values of different sizes in turn. In the process of running at the maximum power that can be supplied by each CPU, the electronic device can record the proportion of the jamming duration at each power, and determine the optimal power of the main secondary scene based on the proportion of the jamming duration corresponding to each power. In the specific power exploration process, the electronic device can gradually lower the maximum power that can be supplied by the CPU from high to low. However, in order to avoid the influence of the contingency of the data on the accuracy of the results, the electronic device may not completely lower the maximum power that can be supplied by the CPU in the adjustment direction from high to low-when the electronic device runs at the maximum power that can be supplied by a certain CPU in the main secondary scene, if jamming occurs, the electronic device needs to adjust the maximum power that can be supplied by the CPU after the jamming occurs. Therefore, in the method, after obtaining the at least one lag event, the electronic device can adjust the maximum supply power of the CPU to the first power according to the maximum supply power of the CPU used by the electronic device when the lag event occurs. The first power actually also satisfies the power exploration rule that "the electronic device will increase the maximum supply power level of the CPU after a lag occurs."
[0012] In combination with the first aspect, in a possible implementation, the difference between the first power and the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one first freeze event occurs is less than a first threshold.
[0013] Since the performance and power consumption of electronic devices cannot be taken into account at the same time. Therefore, in this embodiment, when it is determined based on the at least one first freeze event that the maximum CPU power that can be supplied by the electronic device when the freeze occurs cannot meet the performance requirements of the electronic device, the electronic device can appropriately increase the maximum CPU power that can be supplied according to the maximum CPU power that the electronic device uses when each first freeze event occurs in the first main and secondary scenarios, so that the difference between the last adjusted first power and the maximum CPU power that can be supplied by the electronic device when each freeze event in the at least one first freeze event occurs is less than the first threshold. In this way, a greater performance supply can be provided for the first main and secondary scenarios, improving the user experience, without causing the power consumption of the electronic device to increase too much.
[0014] In combination with the first aspect, in a possible implementation, the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one first freeze event occurs is the same, or the maximum power that can be supplied by the CPU used by the electronic device when at least two of the at least one first freeze event occur is different.
[0015] In combination with the first aspect, in one possible implementation, the at least one freeze event also includes at least one second freeze event, each of the at least one second freeze event occurs in a second main-secondary scenario, the first main-secondary scenario includes a scenario related to the focus application when the electronic device does not detect an interaction event, and the method also includes: detecting entry into the second main-secondary scenario, adjusting the maximum power that can be supplied by the CPU to a second power, the second power being greater than the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one second freeze event occurs.
[0016] In this embodiment, the at least one second freeze event is a freeze event obtained in the first main-secondary scene, but not occurring in the first main-secondary scene. That is, when a freeze event in the at least one second freeze event occurs, the electronic device operates in the second main-secondary scene that is different from the first main-secondary scene. Similarly, the electronic device can determine the operating scene of the electronic device at the time of occurrence and the maximum power that can be supplied by the CPU used according to the time of occurrence of the freeze event.
[0017] Assume that the at least one jamming event mentioned above includes N2 (N2>0) second jamming events (the N2 second jamming events are the at least one jamming event). After obtaining the N2 second jamming events, the electronic device can sequentially obtain the maximum CPU power supply used by the electronic device when these jamming events occur, and obtain a total of N2 CPU maximum power supply (the same CPU maximum power supply may exist among the N2 CPU maximum power supply). Since the occurrence of a jamming event indicates that the performance provided by the power level is insufficient to meet the performance requirements of the second main-secondary scenario, for the N2 CPU maximum power supply obtained, the electronic device can increase the N2 CPU maximum power supply by the same value, obtain the updated N2 CPU maximum power supply, and determine the largest CPU maximum power supply among the updated N2 CPU maximum power supply as the second power.
[0018] However, since the current operating scenario of the electronic device is the first main-secondary scenario, not the second main-secondary scenario, the electronic device can adjust the maximum CPU supply power to the second power after entering the second main-secondary scenario again, so as to provide greater performance supply for the second main-secondary scenario and improve user experience.
[0019] In combination with the first aspect, in one possible implementation, after detecting at least one second freeze event in at least one freeze event in the first main-secondary scene, and before detecting entering the second main-secondary scene, the method also includes: updating the exploration progress of the second main-secondary scene to the second power; the exploration progress of the second main-secondary scene is used to adjust the maximum supplyable power of the CPU to the second power after entering the second main-secondary scene again.
[0020] In this embodiment, the electronic device can use the aforementioned power exploration strategy to obtain the optimal power of each of the first main-secondary scene and the second main-secondary scene. Therefore, after obtaining the above-mentioned second power, in order for the electronic device to be able to operate with the unused maximum available CPU power as much as possible when entering the main-secondary scene next time, the electronic device can update the exploration progress of the second main-secondary scene to the above-mentioned second power. When the electronic device is in the second main-secondary scene again subsequently, the electronic device can start running at the second power corresponding to the exploration progress of the second main-secondary scene, and continue to gradually reduce the maximum available CPU power from high to low from the second power, so as to obtain the operating time and freeze time corresponding to multiple powers in the main-secondary scene.
[0021] In combination with the first aspect, in a possible implementation, the difference between the second power and the maximum power that can be supplied by the CPU used by the electronic device when each of the at least two first freeze events occurs is less than the first threshold.
[0022] Similarly, in this embodiment, when it is determined based on the at least one second jamming event that the maximum CPU power that can be supplied by the electronic device when the jamming occurs cannot meet the performance requirements of the electronic device, the electronic device can appropriately increase the maximum CPU power that can be supplied according to the maximum CPU power that the electronic device uses when each second jamming event occurs in the second main and secondary scenarios, so that the difference between the last adjusted second power and the maximum CPU power that can be supplied by the electronic device when each jamming event in the at least one second jamming event occurs is less than the first threshold. In this way, a greater performance supply can be provided for the second main and secondary scenarios, improving the user experience, without causing the power consumption of the electronic device to increase too much.
[0023] In combination with the first aspect, in a possible implementation, the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one second freeze event occurs is the same, or the maximum power that can be supplied by the CPU used by the electronic device when at least two of the at least one second freeze event occur is different.
[0024] In combination with the first aspect, in one possible implementation, the at least one freeze event includes three freeze events, the third freeze event occurs in the first main-secondary scenario, and when the third freeze event occurs, the maximum power that can be supplied by the CPU used by the electronic device is the third power. The method also includes: updating operating data of the first main-secondary scenario, the operating data including the freeze duration when running at the third power in the first main-secondary scenario, and the freeze duration when running at the third power includes the freeze duration of the third freeze event.
[0025] In some embodiments, in order to reduce the power consumption of electronic devices as much as possible while ensuring the user experience, and effectively extend the use time of electronic devices, when the electronic device enters any main secondary scene, the electronic device can explore multiple different CPU maximum power supply gears. That is, in the main secondary scene, the electronic device will adjust the gears of the maximum power supply of the CPU to different power values in turn. In the process of running with the maximum power supply of each CPU, the electronic device can record the proportion of the jamming duration at each power, and determine the optimal power of the main secondary scene based on the proportion of the jamming duration corresponding to each power. In this case, the proportion of the jamming duration corresponding to each power plays a determining role in the optimal power. Therefore, in this embodiment, after obtaining the jamming event, the electronic device will also update the proportion of the jamming duration of the corresponding power in the corresponding scene according to the jamming duration corresponding to each jamming event. In this way, under the premise of improving the user experience, the proportion of the jamming duration corresponding to each power can be made more accurate, and the optimal power gear determined by the electronic device will also be more accurate.
[0026] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method in the first aspect or any possible implementation of the first aspect.
[0027] In a third aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processors are used to call computer instructions so that the electronic device executes a method as in the first aspect or any possible implementation of the first aspect.
[0028] According to a fourth aspect, a computer program product comprising instructions, when the computer program product is run on an electronic device, enables the electronic device to execute the method according to the first aspect or any possible implementation of the first aspect.
[0029] In a fifth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute a method in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a process for adjusting the performance of an electronic device according to a freeze event provided in an embodiment of the present application;
[0031] Figure 2 A flow chart of a power adjustment method provided in an embodiment of the present application;
[0032] Figure 3 A schematic diagram of a process for adjusting the performance of an electronic device according to a freeze event provided in an embodiment of the present application;
[0033] Figure 4 A schematic diagram of a process for updating exploration data according to a freeze event provided in an embodiment of the present application;
[0034] Figure 5 A schematic diagram of a process for adjusting the performance of an electronic device according to a freeze event provided in an embodiment of the present application;
[0035] Figure 6 A schematic diagram of a process for updating exploration data according to a freeze event provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of a process for adjusting the performance of an electronic device according to a freeze event provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of a process for adjusting the performance of an electronic device according to a freeze event provided in an embodiment of the present application;
[0038] Fig. 9 A system architecture diagram provided for an embodiment of the present application;
[0039] Fig.10 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0040] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0041] To facilitate understanding, the relevant terms involved in the embodiments of the present application are first introduced below.
[0042] (1) Performance and power consumption of electronic equipment
[0043] 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 computing speed of the electronic device, that is, the number of instructions that the electronic device can execute per second, which is generally described as "millions of instructions per second". Understandably, the computing speed of an electronic device will be further reflected in the dimensions of whether the electronic device runs smoothly and whether there is obvious lag. Therefore, in this application, the performance of an electronic device can be evaluated based on the lag frequency during its operation (that is, the proportion of the duration of the electronic device being stuck within a period of time). The smaller the lag frequency, the better the performance of the electronic device, and vice versa.
[0044] Power consumption refers to the amount of energy consumed by an electronic device per unit time. For electronic devices, power consumption specifically refers to the amount of electrical energy consumed by the electronic device per unit time, measured in W. Even in standby mode, an electronic device will still consume a certain amount of electrical energy (unless the power is turned off, it will not consume energy).
[0045] For electronic devices such as desktop computers and laptops, the CPU is the computing and control core of the system in the device. The maximum power that the CPU can supply (i.e., PowerLimit-1) and the maximum operating frequency of the CPU (i.e., MaxFrequency) are closely related to the power consumption of the electronic device. It should be noted that "the maximum power that the CPU can supply" and "the maximum operating frequency of the CPU" refer to the maximum values that the CPU power and operating frequency can provide, respectively. During the operation of the electronic device, the CPU generally does not always operate at the power or operating frequency corresponding to this maximum value. Its actual operating power and operating frequency are generally related to the current operating environment of the electronic device. When the electronic device runs more applications at the same time, the actual working power and operating frequency of the CPU will be greater, but it will not exceed the maximum values corresponding to the maximum power that the CPU can supply and the maximum operating frequency of the CPU.
[0046] Taking the maximum power supply of the CPU as an example, when the maximum power supply of the CPU is set to 45W, the actual working power of the CPU may be 20W in a certain operating scenario, and may reach the upper limit of 45W in another operating scenario, but will not exceed 45W. In addition, the maximum power supply of the CPU and the maximum operating frequency of the CPU can be adjusted, but there is also an upper limit to the adjustment range. This upper limit is set when the electronic device leaves the factory and is related to the hardware performance of the CPU, CPU heat sink, etc. Taking the maximum power supply of the CPU as an example, when the adjustable upper limit of the maximum power supply of the electronic device CPU is 45W, the electronic device can set the maximum power supply of the CPU to 45W, 40W, 30W and other values, but cannot set it to 50W.
[0047] In addition, the maximum power that can be supplied by the CPU and the maximum operating frequency of the CPU also determine the upper limit of the performance of the electronic device to a certain extent. Taking the maximum power that can be supplied by the CPU as an example, generally speaking, for the same series of microprocessors, the greater the maximum power that can be supplied by the CPU, the greater the maximum operating speed that the electronic device can support. In some scenarios, the power consumption of the electronic device can be reduced at the expense of performance by reducing the maximum power that can be supplied by the CPU. For example, in a certain operating scenario, the maximum power that can be supplied by the CPU is 45W, and the actual power of the CPU is 25W. However, at this time, the gap between the actual power of the CPU of the electronic device and the maximum power that can be supplied by the CPU is still very large, which also means that the power of the CPU in the current scenario is difficult to reach the upper limit of 45W, so the maximum power that can be supplied by the CPU does not limit the actual power of the CPU. It should be understood that when the actual power of the CPU is 25W, the performance provided by the CPU is the maximum performance required for the operating scenario. If the actual power of the CPU is adjusted to 15W, the performance provided by the CPU may not meet the maximum performance requirements of the operating scenario, but it can still provide sufficient performance for the operating scenario to ensure that the user experience is not impaired. For example, assuming that when the actual power of the CPU is 25W, the response time of the 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 has indeed slowed down, for the user, the difference between 100ms and 50ms is difficult to perceive.
[0048] That is to say, in some scenarios, if the actual power of the CPU can be limited to a suitable range or value by adjusting the maximum power supply of the CPU, then the electronic device can reduce power consumption at the expense of some performance without affecting the user experience. However, in combination with the above description, it can be seen that the performance and power consumption of electronic devices cannot be taken into account at the same time. If the performance is sacrificed too much, the electronic device will frequently freeze and the user experience will be seriously impaired. Therefore, how to adjust the maximum power supply of the CPU to a suitable value to minimize the power consumption of the electronic device while ensuring that the performance meets the user's needs is the problem that this application focuses on solving.
[0049] In the present application, the electronic device can achieve the purpose of reducing the power consumption of the device without compromising the user experience by adjusting the maximum power that the CPU can supply or the maximum operating frequency of the CPU. For the sake of convenience, in the subsequent embodiments, the adjustment of the maximum power that the CPU can supply is used as an example for explanation.
[0050] (2) Focus application and background application
[0051] For electronic devices such as computers, users may open multiple applications at the same time when using them, and the display screen of the electronic device may also display multiple application interfaces (some interfaces may be minimized in the information status bar), but the user generally only has one application that is operated by the mouse or keyboard. Of course, even if the user does not operate the electronic device through devices such as the mouse or keyboard, there will always be an application interface (application window) on the display screen that is displayed on the top of the display screen. For example, when the user is watching a video on the electronic device, he may not operate the electronic device, but the interface of the application used to play the video is generally displayed on the top of the interface.
[0052] In the embodiment of the present application, the application or application interface that the user is operating with the mouse or keyboard and is displayed on top of the display screen can be called a "focus application"; in addition to the focus application, other applications opened by the electronic device can be called "background applications". It can be understood that the focus application and the background application can be switched. For example, the user can click on the application interface of a background application to make the application interface of the background application displayed on top. At this time, the background application is switched to the focus application, and the original focus application becomes a background application.
[0053] (3) Primary scenario and secondary scenario
[0054] Level 1 scenarios include operating scenarios that have high requirements for electronic device performance. When an electronic device detects a level 1 event, it is considered that the electronic device has entered a level 1 scenario. Level 1 events may include any one or more of the following: 1. Interaction events between users and electronic devices. For example, operations such as users clicking mouse buttons and scrolling mouse wheels (but not including operations of moving the mouse cursor), users using keyboard shortcut keys (shortcut keys may include keyboard Ctrl keys, Win keys, Shift keys, Alt keys, Esc keys, F1-F12 keys, Fn keys, Enter keys, PrtSc keys, PgUp keys, PgDn keys, etc., and may also include other shortcut keys, as well as shortcut keys obtained by combining multiple shortcut keys in these shortcut keys), users switching focus applications, etc. 2. High-load events of electronic devices. For example, events in which the CPU of an electronic device is in a high-load state, events in which an electronic device enters game mode, etc.
[0055] The second-level scenario includes operating scenarios with lower requirements on the performance of electronic devices. When the electronic device does not detect a first-level event, it is considered that the electronic device has entered the second-level scenario.
[0056] Secondary scenarios can include the following two categories:
[0057] 1. Main secondary scene.
[0058] When the electronic device detects a primary secondary event, it is considered that the electronic device has entered the primary secondary scene. The primary secondary event is an event in which the electronic device runs a focus application without detecting a primary event.
[0059] In the main-secondary scenario, the parameters that reflect the performance requirements of the electronic device in the current main-secondary scenario (hereinafter referred to as the main-secondary scenario parameters) may include any one or more of the following: focus application, size of the focus application window, memory usage of the focus application, whether watching videos, download speed, whether using a camera, whether playing audio, type of external device, whether using a keyboard, device screen brightness, device available memory RAM, integrated graphics load rate, independent graphics load rate, and hard disk write speed.
[0060] In some embodiments, when no primary event is detected, when any one or more of the primary-secondary scene parameters change, it is considered that a switch is made from one primary-secondary scene to another primary-secondary scene.
[0061] In other embodiments, since parameters such as the focus application window size, the focus application memory usage, the download speed, the screen brightness, the memory RAM, the integrated graphics card load rate, the independent graphics card load rate, and the hard disk write speed may change frequently during the operation of the electronic device, for these parameters, it can be considered that one main secondary scene is switched to another main secondary scene only when the change of any one or more parameters reaches a certain range. That is, when the main secondary scene parameters of the electronic device change within a certain range, the electronic device can be considered to be in the same main secondary scene.
[0062] 2. Auxiliary secondary scene.
[0063] When the electronic device detects an auxiliary level 2 event, it is considered that the electronic device has entered an auxiliary level 2 scene. An auxiliary level 2 event is an event in which a background application is running on the electronic device without detecting a level 1 event.
[0064] Similarly, in the auxiliary secondary scenario, the parameters that reflect the performance requirements of the electronic device in the current auxiliary secondary scenario (hereinafter referred to as auxiliary secondary scenario parameters) may include any one or more of the following: background applications, the size of the background application window, the memory usage of the background application, whether to watch videos, download speed, whether to use the camera, whether to play audio, the type of external device, whether to use the keyboard, the device screen brightness, the device memory RAM, the integrated graphics load rate, the independent graphics load rate, and the hard disk write speed.
[0065] Based on the above definition, it is impossible for the primary scene and the secondary scene to appear at the same time, but the primary secondary scene and the auxiliary secondary scene can exist at the same time. Usually, since there is usually only one focus application at the same time, but there can be multiple background applications, the number of primary secondary scenes at the same time is one, and the number of auxiliary secondary scenes can be multiple.
[0066] In the present application, since the first-level scenario has high performance requirements for electronic devices, when the electronic device is in the first-level scenario, that is, when a first-level event occurs in the electronic device, the electronic device can adjust the maximum power supply of the CPU to a certain power value, and the difference between the power value and the maximum value of the maximum power supply of the CPU that the electronic device can provide is less than a threshold. Preferably, when the electronic device is in the first-level scenario, the electronic device can adjust the maximum power supply of the CPU to the maximum value of the maximum power supply of the CPU that the electronic device can provide. When the electronic device is in the second-level scenario, the electronic device can adjust the maximum power supply of the CPU by taking into account both performance and power consumption. For the specific adjustment method, refer to the subsequent method embodiments.
[0067] (4) The maximum power that the CPU can supply
[0068] In the present application, the maximum power that can be supplied by the CPU of the electronic device can be discretized into different levels.
[0069] Combined with the above description, it can be seen that the maximum power that the CPU of an electronic device can supply has an upper limit for adjustment, which is determined when the electronic device leaves the factory. Here, it is assumed that the power value corresponding to this upper limit is PL1 max , then based on the power value PL1 max Set the corresponding power level for the maximum power that the CPU can supply. For details, please refer to the example in the following table:
[0070] Table 1
[0071]
[0072] As can be seen from Table 1, Pm is the maximum gear corresponding to the maximum power that the CPU can supply; accordingly, the values corresponding to different percentages of Pm can be set as different gears of the maximum power that the CPU can supply, and the larger the value of the power gear, the greater the corresponding power. For example, the maximum power that the CPU can supply corresponding to gear 9 is greater than the maximum power that the CPU can supply corresponding to gear 8. In order to ensure the normal operation of electronic equipment, the gear of the maximum power that the CPU can supply (hereinafter referred to as "power gear") generally cannot be adjusted to gear 1, and can only be adjusted to gear 2 at the lowest (for some specific secondary scenarios with low performance requirements). Table 1 is only an example. In specific implementations, the power gear can also be set in other ways. For example, more or fewer power gears can be set compared to Table 1.
[0073] (5) Optimal power
[0074] Different CPUs have different maximum power supplies, providing different performance to electronic devices and consuming different amounts of electrical energy.
[0075] In this application, for a secondary scene, the power value with the lowest power consumption among all power values without affecting the user experience is the optimal power for the secondary scene. Specifically, whether a certain power value affects the user experience can be determined based on the probability of the electronic device freezing when running at the power value in the secondary scene. When the probability of freezing is greater than a certain threshold (for example, 3%), it can be considered that the gear has affected the user experience in the secondary scene.
[0076] In some implementations, the maximum power that the CPU can supply can be discretized into different gears. Without affecting the user experience, the power gear with the lowest power consumption among all power value gears is the optimal power gear for the secondary scenario. When adjusting the power, adjusting the power to the optimal power gear for the secondary scenario according to the gear can make the adjustment process of the electronic device more convenient and quick.
[0077] The following embodiments all use the power level as an example to illustrate the process of adjusting the power of the electronic device to the optimal power. For how to determine the optimal power in a secondary scenario, please refer to the following method embodiments.
[0078] (6) Lightweight Gradient Boosting Machine Model
[0079] The light gradient boosting machine model (LightGBM) can be regarded as a gradient boosting framework. It uses decision trees as base learners and is an optimized model based on the XGBoost model.
[0080] For most binary classification models, the data set required for training the model usually has a very large number of samples, and each sample may also include a large number of features. For example, in this application, the scene attributes corresponding to the secondary scene can be as many as more than ten, and the amount of data used for training may be as high as 100,000. It can be understood that 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 splitting points × the number of samples). Therefore, if the number of samples is too high and the number of features is too large, the performance of the model may be seriously affected.
[0081] The LightGBM model reduces a large number of data instances with only small gradients through the gradient-based one-side sampling algorithm (GOSS), and only uses the remaining data with high gradients when calculating information gain, saving a lot of time and space overhead. In addition, the LightGBM model further uses the exclusive feature bundling algorithm (EFB) to bundle many mutually exclusive features into one feature, achieving the purpose of dimensionality reduction, and can speed up the training of the model without compromising accuracy. Therefore, LightGBM can effectively avoid 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 embodiments.
[0082] (7) Stuttering
[0083] Stuttering is a phenomenon in which the screen freezes during the operation of an electronic device. This phenomenon occurs in electronic devices such as mobile phones and laptops. It can specifically include interface stuttering, mouse stuttering, and input stuttering.
[0084] The causes of lag are complicated, involving code, memory, drawing, IO, etc. Although there are many reasons for lag, they will ultimately be reflected in the efficiency of the central processing unit (CPU) in processing instructions, which is also the key to reflecting the performance of the CPU.
[0085] For the log files including the jam event information recorded by the electronic device during operation, the operating system of the electronic device provides a corresponding identification module and a capture module to save and read them. During the actual operation of the electronic device, when a jam event occurs, the identification module can generally only check the jam event after the jam ends, and store the relevant information of the jam event in the message queue (stack). After that, the capture module can read the relevant information of the jam event from the above message queue. After the reading is completed, it can be considered that the electronic device has successfully captured (or sensed) the jam event.
[0086] Therefore, there is usually a delay of several seconds or even tens of seconds between the moment when the electronic device actually captures the freeze event and the moment when the freeze actually occurs. For example, assuming that the electronic device freezes during the time period from t1 to t2, the time when the electronic device successfully captures the freeze event is most likely at time t3 after time t2. In addition, since the duration of each freeze event and the duration of the delayed capture are uncertain, even freeze events that do not occur at the same time may be captured by the electronic device at the same time. For example, a freeze event that occurs before time t1 may be captured by the electronic device at time t3 together with a freeze event that occurs during the time period from t1 to t2.
[0087] It should be understood that when a jamming event occurs, it means that the performance provided by the electronic device at this moment cannot meet the performance requirements of the current operating scenario, so the electronic device needs to determine a performance adjustment strategy (for example, increasing the maximum power that the CPU can supply by one level). However, since the jamming event currently captured by the electronic device is lagging, the jamming event captured at a certain moment cannot represent whether the performance requirements of the scene in which the electronic device is located at that moment and the performance provided by the electronic device are compatible, so the jamming event obtained by the electronic device loses its reference significance for the electronic device to determine the performance adjustment strategy.
[0088] Therefore, in the present application, when a freeze occurs in the main secondary scene, the electronic device can simultaneously record the freeze event and the freeze information corresponding to each freeze event, and the freeze information includes the maximum power supply level of the CPU used by the electronic device when the freeze event occurs and the main secondary scene parameters of the main secondary scene in which the electronic device is located. After successfully capturing the freeze event, for the freeze information of any freeze event, the electronic device can determine the performance adjustment strategy of the main secondary scene corresponding to the freeze information (for example, whether it is necessary to increase or decrease the maximum power supply of the CPU by one level). When the subsequent electronic device is in the main secondary scene, that is, when the parameters of the main secondary scene in which the subsequent electronic device is located are the same as the parameters of the main secondary scene, the electronic device can adjust the maximum power supply level of the CPU according to the above-mentioned performance adjustment strategy.
[0089] With the development of science and technology, devices such as desktop computers and laptops have become indispensable items in people's lives, work and entertainment. However, since such devices often need to process a large amount of data, they consume power very quickly; especially for portable devices such as laptops, users may need to use them in an environment without charging conditions. If the power consumption of the device is too fast, the device may automatically shut down due to power exhaustion during the user's use, causing inconvenience to the user.
[0090] In order to extend the use time of electronic devices, in one possible case, the electronic device can adjust the maximum power supply of the CPU to the optimal power level according to different operating scenarios, effectively saving the power of the electronic device without affecting the user experience.
[0091] Combined with the above description, it can be seen that the performance requirements of the first-level scenario are generally higher. Therefore, when the above-mentioned operating scenario is a first-level scenario, the electronic device can determine the optimal power level of each first-level scenario as the maximum power level of the CPU's maximum power supply based on the high performance requirements of the first-level scenario, ensuring 100% supply of the electronic device's performance.
[0092] When the above-mentioned operating scenario is a secondary scenario, since the focus application is the application that the user currently pays the most attention to, the electronic device can determine the optimal power level according to the main secondary scenario in the secondary scenario, giving priority to ensuring the performance requirements of the focus application.
[0093] Specifically, for any main-secondary scene scene_x, the electronic device can determine the optimal power gear of the main-secondary scene scene_x based on the optimal power exploration strategy - that is, in the main-secondary scene scene_x, the electronic device runs in all optional gears of the maximum power that the CPU can supply from high to low. When the electronic device starts to use a new power gear PL1_x to run, the electronic device will record the starting time t_start of running at the power gear PL1_x, the running time duration_ttl at the gear PL1_x, and the duration duration_delay of the electronic device being stuck when running at the gear PL1_x; after the duration of running at the gear PL1_x reaches T without being stuck, the electronic device can lower the power gear from PL1_x by one gear to continue exploring, but if the electronic device is stuck when running at the gear PL1_x before the duration T, the electronic device will immediately increase the CPU's maximum power supply gear by one gear after the stuck occurs (the duration of running at this gear when the stuck occurs may not reach T) and continue to explore to a lower gear. In addition, if the operating scene of the electronic device changes from scene_x to other scenes during the exploration process, the electronic device will record the gear exploration progress under scene_x, and if the electronic device re-enters scene_x later, it will continue to explore in the gear corresponding to the gear exploration progress. The specific gear exploration rules are set as follows:
[0094] 1) When the electronic device runs at the power level PL1_x for T1 (T1≤T), the operating scene changes to the first-level scene;
[0095] The electronic device saves the current gear exploration progress PL1_x, adjusts the power gear to the highest power gear PL1_max, and saves the running time and the freeze time at the power gear PL1_x under scene_x (the freeze time is 0s at this time); that is, for the tuple (scene_x, PL1_x), save the running time T1 and the freeze time (0s).
[0096] 2) The main secondary scene scene_x has not changed to another scene, and the electronic device has been running at the power level PL1_x for a specified time T without any freeze;
[0097] The electronic device saves the current gear exploration progress PL1_x, and lowers the power gear by one gear to gear PL1_(x-1); and saves the running time at the power gear PL1_x under scene_x and the duration of the freeze (the duration of the freeze is 0s at this time); that is, for the tuple (scene_x, PL1_x), save the corresponding running time T and freeze duration (0s).
[0098] 3) When running at power level PL1_x, the main secondary scene changes from scene_x to scene_y after T2 duration (T2≤T);
[0099] The electronic device saves the duration of operation at power level PL1_x and the duration of freeze under scene_x (the duration of freeze is 0s at this time), and saves the gear exploration progress PL1_x under scene_x; that is, for the tuple (scene_x, PL1_x), the corresponding operating duration and freeze duration (0s) are saved; in addition, the electronic device will continue to explore lower gears based on the new main secondary scene scene_y, starting from the gear exploration progress PL1_y saved under scene_y.
[0100] 4) The vehicle is operated at power level PL1_x for a duration of T3 (T3≤T), and is stuck for a duration of T4 (T4≤T3) within the duration of T3;
[0101] The electronic device saves the exploration progress PL1_x, and raises the power level by one level to level PL1_(x+1); and saves the running time T3 and the freezing time T4 at the power level PL1_x under scene_x; that is, for the tuple (scene_x, PL1_x), saves the corresponding running time T3 and the corresponding freezing time T4.
[0102] 5) Switch back to scene_x from other running scenes;
[0103] The electronic device restarts the exploration process of the main secondary scene scene_x, and starts to continue exploring towards a lower gear with the gear exploration progress saved under scene_x.
[0104] 6) The total exploration time of the main secondary scene scene_x reaches T total ;
[0105] The electronic device completes the gear exploration process for scene_x, and saves the main and secondary scene parameters corresponding to scene_x and the proportion of the freezing time of the electronic device at different power gears of scene_x as the original data of scene_x.
[0106] Among them, T total is greater than or equal to n×T, where n is the number of all adjustable power levels of the maximum adjustable power of the CPU. Preferably, T total =2n×T.
[0107] From the above gear exploration rules, it can be seen that for a main secondary scene scene_x, in the same main secondary scene scene_x, the electronic device may explore the same gear PL1_x multiple times, and the corresponding electronic device will also record multiple duration_delay and multiple duration_ttl. At this time, the proportion of the freezing duration corresponding to the power gear PL1_x can be calculated as DURATION_DELAY / DURATION_TTL; among which DURATION_TTL is the sum of the running duration of the electronic device each time it runs at the power gear PL1_x, and DURATION_DELAY is the sum of the freezing duration of the electronic device each time it runs scene_x at the power gear PL1_x.
[0108] It is understandable that the larger the percentage of the stall duration of a gear, the less the gear can meet the performance requirements of scene_x. Based on this, when the total operating time of the electronic device in the main secondary scene scene_x reaches T total In the case of , the electronic device can determine the optimal power gear of the main secondary scene based on the percentage of the freezing time corresponding to each gear in the main secondary scene scene_x. For example, the electronic device can start from the highest gear and search in order from the lower gears, and determine the lowest gear whose corresponding freezing time percentage is less than or equal to a certain threshold (for example, 0.03) as the optimal power gear of scene_x. Optionally, in the case of the above-mentioned duration T being 30s, the duration T total It can be set to 600s. At this time, when the total running time of the electronic device in the main secondary scene scene_x reaches T totalWhen the electronic device is in scene_x again, it can obtain valid data corresponding to the main-secondary scene. The main-secondary scene for which valid data has been obtained is called the "valid main-secondary scene". The valid data includes: the main-secondary scene parameters of scene_x of the main-secondary scene, the multiple power levels explored under the main-secondary scene scene_x, and the corresponding percentage of freezing time under each power level. In the subsequent operation process, when the electronic device is in scene_x again, the electronic device can obtain the valid data of scene_x according to the main-secondary scene parameters of scene_x obtained, and directly determine the optimal power level of scene_x based on the valid data.
[0109] After the electronic device leaves the factory, it can be turned on and run under the operation of the user. During the operation of the electronic device, the operating scenario of the electronic device will constantly change under the operation of the user, and the operating scenario includes the primary scenario and the secondary scenario. In the early operation process, due to the short operation time, the electronic device may not have obtained valid data for any main and secondary scenarios, and this stage can be called the "cold start stage". Afterwards, for any main and secondary scene, when the total operation time of the electronic device in the main and secondary scene reaches 600s, it can be regarded that the electronic device has completed the gear exploration process of the main and secondary scene, that is, the electronic device can basically determine the optimal power gear of the main and secondary scene through the valid data obtained by the gear exploration for the main and secondary scene. At this time, the cold start stage is also ended accordingly, and the electronic device enters the statistical stage.
[0110] In some embodiments, when the valid data collected by the electronic device is greater than or equal to X, that is, when the valid main secondary scenes are greater than or equal to X, the electronic device can also use the valid data of multiple valid main secondary scenes to train and obtain a power prediction model. After obtaining the above power prediction model, the electronic device can be regarded as entering the prediction stage. In the prediction stage, when the electronic device is in any main secondary scene, regardless of whether the main secondary scene is a main secondary scene that the electronic device has encountered before, the power prediction model can use the main secondary scene parameters of the main secondary scene as input, and output the probability of the electronic device experiencing impaired user experience when running at each power level in the main secondary scene. After that, the electronic device can start from the highest power level and search from high to low, and determine the lowest power level with a probability of user damage less than a certain threshold (for example, 0.5) as the optimal power level corresponding to the main secondary scene, and adjust the maximum power level that the CPU can supply to the optimal power level. Specifically, the above power prediction model can be 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, which are not limited in this application.
[0111] Combined with the above-mentioned gear exploration rules, it can be known that the electronic device gradually lowers the CPU's maximum power supply gear from high to low, which is only a general adjustment trend. In the actual gear exploration process of the main and secondary scenes, the electronic device may not completely lower the CPU's maximum power supply gear in the direction of adjustment from high to low - when a freeze occurs, the electronic device will increase the power gear by one gear. This feedback method for freeze events can reduce the probability of freezes in electronic devices during gear exploration, and try to ensure that users can use the device normally during the gear exploration process.
[0112] For example, assuming that the electronic device is exploring the main secondary scene scene_x using the optimal power exploration strategy, assuming that each time scene_x is run in gear 4, the electronic device freezes, then it is highly likely that freezing will occur frequently when running in gears below gear 4 under scene_x, so when freezing occurs during running in gear 4, the electronic device can increase the gear by one gear to gear 5, so the electronic device will not continue to explore lower power gears, but explore higher power gears, so that the operation of the electronic device will be smoother. Although in this case, even when the total running time under scene_x reaches 600s, the electronic device may never have explored in gears 3 and 2, and the information corresponding to these gears in the valid data corresponding to scene_x is also empty, but running in gears 3 or 2 under scene_x will seriously damage the user experience, then gears 3 and 2 are highly likely not the optimal power gears of scene_x, so it is not important whether to explore gears 3 and 2 under scene_x. When determining the optimal power gear of scene_x later, the electronic device can default the gear with empty information in the valid data as not the optimal power gear.
[0113] However, since there is a lag between the time when the freeze event is captured and the time when it occurs, the gear adjustment strategy made by the electronic device in response to the captured freeze event during the gear exploration process is not applicable to the current operating scenario. This may cause the electronic device to frequently freeze during the gear exploration process for the main and secondary scenarios, and the user will not be able to use the electronic device normally.
[0114] like Figure 1 As shown in (A), at time t1, the electronic device is performing gear exploration for the primary secondary scene scene11 according to the gear exploration rule, and is using the power gear PL1 1 Assume that a freeze occurs at time td1 between time t1 and time t2. In theory, the electronic device needs to change the power level from PL1 to PL2 at time td1. 1However, the electronic device successfully captured the freeze event at time t3 after time t2. Therefore, between time t1 and time t2, the electronic device will continue to operate at PL1 under scene 11. 1 At time t2, the operation scene of the electronic device changes from the main secondary scene scene11 to scene12, and starts to operate at power level PL1 2 Continue to explore the gear position of running scene12, and the electronic device does not freeze between time t2 and time t3. Here, it is assumed that the time from time t2 to time t3 is less than the T time in the above description. In theory, at time t3, the electronic device should continue to run at power gear PL1. 2 However, since the electronic device captures the freeze event that occurred at time td1 at time t3, the electronic device will think that the scene 12 is running at PL1. 2 If a freeze occurs during operation, the electronic device will actually increase the power level to PL1 at time t3. 3 , and the power level is always PL1 from time t3 to time t4. 3 However, the performance requirements of electronic devices are strongly related to the scene in which the electronic devices are currently located. It can be understood that the jamming event at time td1 reflects that the current performance of the electronic device cannot meet the performance requirements of scene11, but since the electronic device successfully captures the jamming event at time t3, the performance adjustment strategy finally determined by the electronic device (i.e., raising the power level by one level at time t3) may not actually be applicable to scene12.
[0115] In some cases, even if the electronic device is in the same scene at the time when the freeze occurs and the time when it is captured, the performance adjustment strategy determined by the electronic device based on the captured freeze event may not be applicable. Figure 1 As shown in (B), the electronic device performs gear exploration in the primary secondary scene scene11 at time t5 according to the gear exploration rule, and is operating at power gear PL1 3 Assume that a freeze event occurs at td2 between t5 and t6, but the electronic device successfully captures the freeze event at t7 after t6. Then, between t5 and t6, the electronic device will continue to operate at PL1 under scene11. 3 At time t6, assuming that the electronic device is running at power level PL1 3 When the running time reaches T, at time t6, the electronic device will reduce the power level to PL1. 2 Run. Understandably, the power level is PL12 Compared to power level PL1 3 It is more difficult to meet the performance requirements of scene 11. In this case, the electronic device may experience more frequent freeze events during the period from t6 to t7 (here, it is assumed that freeze events 103-105 occurring between t6 and t7 are captured by the electronic device at t8 after t7), and the user experience may be seriously impaired. In addition, since the electronic device captures the freeze event occurring at td1 at t7, the electronic device will consider that the freeze event occurred at t7 at PL1 under scene 11. 2 When a freeze occurs during operation, the electronic device will increase the power level to PL1 at t7. 3 But in theory, the electronic device needs to change the power level from PL1 to PL1 at td1. 3 Increase the power level to PL1 4 ( Figure 1 (not shown) and from time td2 to time t7, if the electronic device does not freeze, the electronic device is always powered at power level PL1 4 Otherwise, the electronic equipment needs to change the power level from PL1 4 Increase the power level to PL1 5 ( Figure 1 ) is run.
[0116] If the lag in capturing the jamming event cannot be overcome, then in the process of exploring the gear position of the scene, the jamming event will lose its reference significance for the direction of adjusting the performance of the electronic device, and the performance adjustment strategy made in the process of gear position exploration may bring a very poor user experience to the user. In addition, when the electronic device updates the jamming duration ratio of the gear position based on the acquired jamming event, it may directly update the duration ratio of the gear position currently used, and cannot update the duration ratio of the gear position used by the electronic device when the jamming event occurs. There is a deviation between the recorded jamming duration ratio of each gear and the actual jamming duration ratio, which will affect the accuracy of the optimal power gear position of the main and secondary scenes finally determined based on the valid data.
[0117] Therefore, in the present application, in the process of gear exploration for the main-secondary scene, when a freeze event occurs in an electronic device, the electronic device can simultaneously record the gear of the maximum power that can be supplied by the CPU used by the electronic device when the freeze occurs and the main-secondary scene parameters of the main-secondary scene at that time, and determine the target power gear according to the power gear used when the electronic device freezes. When the electronic device is in the above-mentioned main-secondary scene, the electronic device can adjust the gear of the maximum power that can be supplied by the CPU to the above-mentioned target power gear. In this way, the electronic device can closely link the freeze event with the scene in which the electronic device is located when it occurs and the gear used, so that the performance adjustment strategy determined according to the freeze event after the freeze event is obtained is more reasonable, thereby improving the user experience.
[0118] Figure 2 The flow chart of the power adjustment method provided in the embodiment of the present application is exemplified. Figure 2 , the method may include the following steps:
[0119] S201: The electronic device obtains at least one freeze event when performing gear exploration on the first primary and secondary scenes.
[0120] The electronic device shown in the embodiment of the present application may be a mobile phone, an on-board device (such as an on-board unit (OBU)), a tablet computer (pad), a computer with data transceiver function (such as a laptop, a PDA, etc.), a mobile Internet device (mobile internet device, MID), a terminal in a smart city, a terminal in a smart home, a terminal device in a 5G network, or a terminal device in a public land mobile network (PLMN) to be evolved in the future, etc. It is understandable that the present application does not limit the specific form of the above-mentioned electronic devices.
[0121] The first main and second-level scenes may be any non-valid main and second-level scenes, which may exist in the cold start phase and the statistical phase of the electronic device. When executing step S201, the electronic device may perform gear exploration in the first main and second-level scenes for the first time, or may switch back to the first main and second-level scenes from other scenes to continue gear exploration. The specific exploration method and exploration rules can refer to the above description, which will not be repeated here.
[0122] It should be noted that, among the at least one freeze event, the time of occurrence of any freeze event is different from the time captured by the electronic device. In addition, the time of occurrence and duration of each freeze event may be different.
[0123] S202: The electronic device obtains the freeze duration of each freeze event in the at least one freeze event, the operating scenario of the electronic device when the freeze event occurs, and the power level used.
[0124] When a freeze event occurs, the electronic device will record the freeze information corresponding to each freeze event in detail, and the freeze information may include the time of occurrence of the freeze event, the freeze duration, the operation scene of the electronic device when the freeze event occurs, and the power level, etc. Specifically, the operation scene of the electronic device and the power level used when the freeze event occurs can be obtained from the log file of the electronic device based on the time of occurrence of the freeze event.
[0125] Since there is a lag in the acquisition of freeze events by electronic devices, and the operating scenarios of electronic devices may change at any time, the freeze events acquired in the first primary and second secondary scenarios are not necessarily those that occur in the first primary and second secondary scenarios. In this application, the freeze events acquired in the first primary and second secondary scenarios can be divided into the following two categories according to the different scenarios in which the electronic devices are located when they occur:
[0126] ① When the freeze occurs, the operating scenario of the electronic device is the freeze event of the first main and second level scenarios mentioned above.
[0127] This part of the jamming events is the jamming events that occur in the above-mentioned first main and second-level scenarios. In this application, the jamming events that occur in the above-mentioned first main and second-level scenarios can be referred to as "at least one first jamming event". It reflects that the power level used when the electronic device is jammed may not meet the performance requirements of the electronic device. In this application, this part of the jamming events can be referred to as the first jamming event.
[0128] It is assumed here that the time when the electronic device acquires at least one of the above-mentioned jamming events is time ta, and the power level used by the electronic device at time ta is PL1_now, and the time when the electronic device starts to run at PL1_now this time is time t_start. Then, according to the sequence between the time when the first jamming event occurs and the time t_start, the first jamming event can be divided into a jamming event that is not captured in time and a jamming event that is captured in time. Among them:
[0129] 1) A non-timely captured jamming event refers to a jamming event that occurs before time t_start, that is, the jamming event occurs before the electronic device explores the power level PL1_now, but is captured by the electronic device during the electronic device's exploration of the power level PL1_now.
[0130] For example, it is assumed that before the moment ta, during this period of time, the electronic device also performs gear exploration in the first main and second scenes, but the power gear used by the electronic device during this period is the adjacent gear PL1_(now+1) which is one gear higher than PL1_now. At the moment td between the moment tb and the moment tc, the electronic device has a jam event delay1. However, since there is a hysteresis in the process of the electronic device obtaining the jam event delay1, the electronic device fails to obtain the jam event delay1 during the period of the moment td-tc, and at the moment tc, the electronic device runs at the power gear PL1_(now+1) in the first main and second scenes for a time period of T. Since the electronic device does not obtain the jam event delay1 that occurred at the moment tb at this time, according to the aforementioned gear exploration rule, at the moment tc (the moment tc is the moment t_start mentioned above), the electronic device will lower the power gear by one gear to PL1_now. In the subsequent process of running at the power gear PL1_now, the electronic device successfully obtains the jam event delay1 until the moment ta. Therefore, the occurrence time of the jam event delay1 (ie, time td) is before time t_start (ie, time tc), and the jam event delay1 is a jam event that is not captured in time.
[0131] 2) Timely capture of a jamming event refers to a jamming event that occurs after time t_start, that is, the jamming event occurs when the electronic device is exploring the power level PL1_now and is captured by the electronic device before the end of the exploration of the power level PL1_now.
[0132] For example, suppose that at the tc moment before the ta moment (the tc moment is the above-mentioned t_start moment), the electronic device begins to explore the power level PL1_now. Assuming that the duration from the tc moment to the ta moment is less than the above-mentioned T duration, then during the tc moment to the ta moment, the electronic device has been running at the power level PL1_now in the above-mentioned first main and second level scenarios. If at the te moment in the tc moment to the ta moment, the electronic device has a jam event delay2, and at the ta moment the electronic device successfully acquires the jam event delay2. Since the occurrence time of the jam event delay2 (i.e., the te moment) is after the t_start moment (i.e., the tc moment), the jam event delay2 is a timely capture of the jam event.
[0133] ② When the freeze occurs, the operating scenario of the electronic device is not a freeze event in the first primary and second secondary scenarios mentioned above.
[0134] Specifically, the operating scenario of the electronic device when this part of the freeze event occurs can be a primary scenario, or can be other main and secondary scenarios except the first main and secondary scenarios mentioned above.
[0135] When the operating scenario of the electronic device when the jamming event occurs is the first-level scenario, since the power gear used by the electronic device in the first-level scenario is the highest power gear, this part of the jamming event has no reference significance for the gear exploration process of the main and second-level scenarios.
[0136] When the running scene of the electronic device when the jamming event occurs is other main secondary scenes except the above-mentioned first main secondary scene, this part of the jamming event can be called the second jamming event, and the above-mentioned other main secondary scenes except the first main secondary scene can be called the second main secondary scene. For example, it is also assumed that the moment when at least one of the above-mentioned jamming events is acquired is the ta moment, the power gear used by the electronic device at the ta moment is PL1_now, and in the time period from the tf moment to the tg moment before the ta moment, the electronic device is in another main secondary scene different from the above-mentioned first main secondary scene, and the electronic device switches the running scene to the above-mentioned first main secondary scene at the tg moment. Assume that the jamming event delay3 occurs at the th moment within the time period from the tf moment to the tg moment. However, before the tg moment, the electronic device failed to successfully acquire the jamming event delay3, and the electronic device did not acquire the jamming event delay3 until the running scene of the electronic device was switched to the above-mentioned first main secondary scene at the ta moment. It can be understood that the freeze event delay3 obtained in the above-mentioned first main-secondary scene occurs when the operating scene of the electronic device is another main-secondary scene. Therefore, the freeze event delay2 is the above-mentioned second freeze event, and the above-mentioned other main-secondary scene is the second main-secondary scene.
[0137] S203. If there is at least one first freeze event among the at least one freeze event, the electronic device determines the first target power level of the first main-secondary scenario according to the power level used by the electronic device when each freeze event in the at least one first freeze event occurs, and adjusts the level of the maximum power that can be supplied by the CPU to the first target power level in the first main-secondary scenario.
[0138] The above-mentioned first freeze event is a freeze event that occurs in the above-mentioned first main-secondary scenario, that is, at the time when the first freeze event occurs, the electronic device is running in the above-mentioned first main-secondary scenario. In the present application, when a freeze event occurs, the electronic device can simultaneously record the time when the freeze event occurs, the freeze duration, the operating scenario in which the electronic device is located when the freeze event occurs, and the power gear used. Therefore, after obtaining the first freeze event, the electronic device can determine the operating scenario in which the electronic device is located and the power gear used at the time of the freeze event according to the time when the freeze event occurs. When the operating scenario in which the electronic device is located when the freeze event occurs is the above-mentioned first main-secondary scenario, the freeze event is the first freeze event.
[0139] Assume that at least one of the above-mentioned jamming events includes N1 (N1>0) first jamming events. Then, after obtaining the N1 first jamming events, the electronic device can sequentially obtain the power gears used by the electronic device when these jamming events occur, and obtain a total of N1 power gears. Since the occurrence of a jamming event indicates that the performance provided by the power gear is insufficient to meet the performance requirements of the first main and secondary scenarios, for the N1 power gears obtained above, the electronic device can increase the gear values of the N1 power gears by one gear to obtain the updated N1 power gears (that is, the maximum power supplyable by the CPU corresponding to the N1 power gears is increased by the same value, and the increased maximum power supplyable by the N1 CPUs corresponds to the above-mentioned updated N1 power gears, and optionally, the increased value can be less than the first threshold), and the largest power gear among the N1 power gears after the update is determined as the above-mentioned first target power gear. Since the current electronic device is still in the above-mentioned first main and second-level scenarios, the electronic device can adjust the CPU's maximum power supply level to the above-mentioned first target power level after determining the above-mentioned first target power level, and continue to perform level exploration for the above-mentioned first main and second-level scenarios according to the level exploration rules in the above-mentioned description starting from the above-mentioned first target power level. In addition, since it is necessary to determine the corresponding optimal power level for the valid data of the first main and second-level scenarios in the future, after obtaining the first jamming event, the electronic device will also update the jamming duration ratio of the corresponding level according to the jamming duration corresponding to each first jamming event. In this way, the gear adjustment strategy determined by the electronic device for the jamming event can be more in line with the above-mentioned gear exploration rules, and on the premise of improving the user experience, the data obtained during the gear exploration process can be more referenceable, and the optimal power level determined by the electronic device based on the valid data of the main and second-level scenarios will also be more accurate.
[0140] It can be understood that if the above N1 first jamming events are all timely captured jamming events, that is, the above N1 power gears are all the power gears PL1_now currently used by the electronic device, and the N1 power gears after the update are all PL1_now+1. This means that the above N1 timely captured jamming events reflect that the electronic device has experienced multiple jams when running at the currently used power gear PL1_now in the above first main and second-level scenarios, and the currently used power gear PL1_now cannot meet the performance requirements of the above first main and second-level scenarios. In the subsequent operation process, the electronic device needs to increase the gear by one gear to continue to meet the performance requirements of the above first main and second-level scenarios to a greater extent.
[0141] If there is a non-timely captured jam event among the N1 first jam events, the N1 power levels may be different, and the N1 power levels after the update are also different. The largest power level among the N1 power levels after the update is determined as the first target power level, which can ensure that the electronic device can make positive performance adjustments to the N1 first jam events when running at the first target power level.
[0142] Because the electronic device is currently in the first main-secondary scenario, after determining the above-mentioned first target power level, the electronic device can adjust the maximum power supply level of the CPU to the first target power level in the first main-secondary scenario, so that the electronic device can run more smoothly in the first main-secondary scenario and improve the user experience.
[0143] Figure 3 and Figure 4 The diagrams respectively show the process of the electronic device adjusting the gear position in response to the jamming event and the process of the electronic device feedback-updating the gear position exploration data in response to the jamming event when the first jamming event includes a jamming event that is not captured in time and a jamming event that is captured in time.
[0144] like Figure 3As shown, the electronic device is performing gear exploration in the main secondary scene scene 301 according to the gear exploration rules, and at this time scene 301 is the aforementioned first main secondary scene. At time t31, the electronic device starts to run at power gear PL1_(x+1). At time t32 after time t31, a jam event delay 01 occurs in the electronic device, but the electronic device does not capture the jam event delay 01 at time t32, so the electronic device will continue to run at power gear PL1_(x+1). Until time t33, the duration of the electronic device running at power gear PL1_(x+1) reaches T duration. According to the above gear exploration rules, at time t33, the electronic device lowers the power gear by one gear to run at power gear PL1_x. At time t34 after time t33, a jam event delay 02 occurs in the electronic device, but the electronic device does not capture the jam event delay 02 at time t34, so the electronic device will continue to run at power gear PL1_x. Until time t35, the electronic device is running at power level PL1_x in the main secondary scene scene 301, but the electronic device simultaneously obtains the jam event delay 01 and the jam event 02 at this time. Next, the electronic device will obtain the power level PL1_(x+1) used by the electronic device at that time according to the time when the jam event delay 01 occurs, and determine based on the power level PL1_(x+1) that the level needs to be adjusted to a level PL1_(x+2) that is one level higher than PL1_(x+1) in scene 301; the electronic device will obtain the power level PL1_(x+1) used by the electronic device at that time according to the time when the jam event delay 02 occurs, and determine based on the power level PL1_(x+1) that the level needs to be adjusted to a level PL1_(x+1) that is one level higher than PL1_(x+1) in scene 301. After comprehensively comparing and determining the two gears PL1_(x+2) and PL1_(x+1) that need to be adjusted based on the jam event delay 01 and the jam event delay 02, the electronic device will determine the largest power gear, i.e., PL1_(x+2), as the target power gear. Since the electronic device is still in scene 301 at time t35, the electronic device will adjust the power gear to PL1_(x+2) at time t35, and will continue to run at the power gear PL1_(x+2) in the subsequent process until the electronic device obtains an event that requires feedback update, such as any of the following events: the electronic device obtains a jam event again after time t35, the duration of operation at the power gear PL1_(x+2) reaches T duration, the operation scene of the electronic device is switched from scene 301 to other scenes, etc.
[0145] In the present application, the above-mentioned main-secondary scene scene 301 can be referred to as the "first main-secondary scene", and the above-mentioned freeze event delay 01 and freeze event delay 02 can be referred to as the "first freeze event", which can belong to the "at least one first freeze event" in the above description.
[0146] Figure 4 shows an electronic device for Figure 3 The process of feedback updating the gear exploration data based on the jamming event shown.
[0147] like Figure 4 As shown, the original data table 400 may include multiple original data, and the specific data volume may be tens of thousands or hundreds of thousands of data, wherein any original data records the main secondary scene parameters of a main secondary scene ( Figure 4 The main and secondary scenes are not shown in detail), all gears of the maximum power that the CPU can supply (100% is 10 gears, 90% is 9 gears, and so on, the same below), and the proportion of freezing time at different power gears during the gear exploration of the electronic device for the main and secondary scenes. Each power gear recorded in the original data forms a binary group with the main and secondary scene parameters recorded in the original data, and the binary group is used to record the running time and freezing time of the electronic device under its corresponding power gear, for example Figure 4 The (30,0) recorded in the 10th gear means that the electronic device ran at the 10th gear for 30 seconds in scene 301 and was stuck for 0 seconds. The data area corresponding to the power gear is empty, which means that the electronic device has not run at this gear in the main secondary scene. For ease of understanding, the original data table 400 only shows the original data 4001 of the above-mentioned main secondary scene 301.
[0148] It should be noted that each valid data contained in the original data table 400 does not record the percentage of the jamming duration when the electronic device is running when the power gear is gear 1. Because a large amount of experimental data shows that for most secondary scenarios, after the gear at which the CPU of the electronic device can supply the maximum power is adjusted to gear 1, the electronic device will frequently jam or even fail to operate normally. Therefore, in order to ensure that users can use the electronic device normally, when exploring the gear for any main secondary scenario, the electronic device does not need to adjust the power gear to gear 1, that is, the electronic device does not need to collect the percentage of jamming duration when running at gear 1, and only needs to explore the power gear to gear 2 for a main secondary scenario.
[0149] In addition, the original data corresponding to any primary and secondary scenes stores the gear exploration progress of the electronic device for the primary and secondary scenes. The electronic device can mark the gear to save the gear exploration progress. For details, please refer to Figure 4The exploration progress mark shown in the figure, the gear where the gear exploration mark is located is the gear exploration progress currently saved by the electronic device under scene 301. It can be understood that Figure 4 The exploration progress mark shown is only for the convenience of explanation and understanding. In actual application scenarios, it can exist in the electronic device in the form of code, or in the electronic device in a form perceptible to other electronic devices. This application does not limit this.
[0150] In this embodiment, it is assumed that the above T is 30s. Figure 4 As shown, at time t31, the gear exploration progress recorded in the original data 4001 is 6 gears, and the electronic device is running at gear 5. It can be understood that Figure 4 Medium, 5th gear is Figure 3 The power level PL1_(x+1) and level 4 are Figure 3 The power level PL1_x, level 6 is Figure 3 The power level PL1_(x+2) in.
[0151] The electronic device has been running at power level 5 under scene 301 since time t31. Until time t32, the electronic device has a freeze event delay01 when running at power level 5, but the electronic device does not capture the freeze event delay 01 at time t32, so the electronic device continues to run at power level 5. The electronic device will not feedback and update the data stored in the original data 4001 at time t32.
[0152] Until time t33, the electronic device has been running at power level 5 for 30 seconds. According to the gear exploration rules, at time t33, the electronic device lowers the power level by one level to power level 4. At this time, the electronic device saves the total running time of 30 seconds at power level 5 (these 30 seconds include the duration of the freeze event delay01) and the freeze duration 0 seconds in the original data 4001, and updates the gear exploration progress to power level 5.
[0153] After time t33, the electronic device has been running at power level 4 under scene 301. Until time t34, the electronic device has a freeze event delay 02, but the electronic device has not captured the freeze event delay 01 at time t34, so the electronic device continues to run at power level 4. The electronic device will not feedback and update the data stored in the original data 4001 at time t34.
[0154] Until time t35, the electronic device is running at gear 4 in the main secondary scene scene 301, but the electronic device simultaneously obtains the jam event delay 01 and the jam event 02 at this moment. Next, the electronic device will obtain the power gear 5 used by the electronic device at that time according to the time when the jam event delay01 occurs, and determine that the gear needs to be adjusted to gear 6 in scene 301; the electronic device will also obtain the power gear 4 used by the electronic device at that time according to the time when the jam event delay 02 occurs, and determine that the gear needs to be adjusted to gear 5 in scene 301. After comprehensive comparison, the electronic device will determine the largest power gear between gears 5 and 6, that is, gear 6, as the target power gear. Since the electronic device is still in scene 301 at time t35, the electronic device will adjust the power gear to gear 6 at time t35 and update the gear exploration progress to gear 4.
[0155] In addition, at time t35, after obtaining the jam event delay 01 and the jam event 02, the electronic device also obtains the jam duration T of the jam event delay 01. delay 01 And the duration of the freeze event 02 is T delay 02 , and based on the freeze duration T delay 01 Updated the lag time of level 5 to T delay 01 , based on the freeze duration T delay 02 Updated the lag time of gear 4 to T delay 02 .
[0156] In the subsequent process, the electronic device will continue to operate at power level 6 until the electronic device obtains an event that requires feedback update of the original data 400 .
[0157] S204. If there is at least one second freeze event among the at least one freeze event, the electronic device determines the second target power level of the second main-secondary scenario according to the power level used by the electronic device when each freeze event in the at least one second freeze event occurs, and if the electronic device enters the second main-secondary scenario again, the level of the maximum power that the CPU can supply is adjusted to the second target power level.
[0158] The at least one second freeze event is a freeze event that is acquired in the first main-secondary scene but does not occur in the first main-secondary scene. That is, at the time of occurrence of at least one second freeze event, the electronic device is running in a main-secondary scene different from the first main-secondary scene, and the main-secondary scene different from the first main-secondary scene is the second main-secondary scene. Similarly, the electronic device can determine the operating scene and the power level used by the electronic device at the time of occurrence according to the time of occurrence of the freeze event. When the operating scene of the electronic device is not the first main-secondary scene when the freeze event occurs, the freeze event belongs to the at least one second freeze event.
[0159] Assume that the at least one freeze event includes N2 (N2>0) second freeze events. When N2 is greater than 1, the second main-secondary scene in which the electronic device is located when any two freeze events in the N2 second freeze events occur can be the same main-secondary scene or different main-secondary scenes; in addition, the power gear used by the electronic device can be the same power gear or different power gears.
[0160] In the case where the scenes in which the electronic device is located when the N2 second jamming events occur are all the same second main secondary scene (hereinafter the second main secondary scene is referred to as scene_same), the electronic device can, after obtaining the N2 second jamming events, sequentially obtain the power gears used by the electronic device when these jamming events occur, and obtain a total of N2 power gears. Since the occurrence of a jamming event indicates that the performance provided by the power gear is insufficient to meet the performance requirements of the second main secondary scene, for the N2 power gears obtained above, the electronic device can increase the gear values of the N2 power gears by one gear (that is, the maximum power supplyable by the CPU corresponding to the N2 power gears is increased by the same value, and the increased maximum power supplyable by the N2 CPUs corresponds to the N2 power gears after the above update, and optionally, the increased value can be less than the first threshold value), obtain the N2 power gears after the update, and determine the largest power gear among the N2 power gears after the update as the above second target power gear. However, since the current operating scene of the electronic device is the above-mentioned first main-secondary scene, and it is not the second main-secondary scene scene_same, the electronic device can update the gear exploration progress recorded in the gear exploration data of scene_same to the above-mentioned second target power gear. When the electronic device is in scene_same again subsequently, the electronic device can start running at the above-mentioned second target power gear, and continue to complete the gear exploration process of scene_same from the second target gear according to the above-mentioned gear exploration rules. Similarly, after obtaining N2 second freeze events, the electronic device will also update the freeze duration ratio of the corresponding gear in the gear exploration data of scene_same according to the freeze duration corresponding to each second freeze event.
[0161] In the case where the scenes in which the electronic device is located when the N2 second jamming events occur all include multiple different second main-secondary scenes (for example, some main-secondary scenes with relatively short single operation durations), the electronic device can, after acquiring the N2 second jamming events, group the jamming events that occur in the same main-secondary scene according to the operation scenes in which the electronic device is located when the jamming events occur. For example, assuming that N3 (0<N3≤N2) jamming events of the above-mentioned N2 second jamming events all occur in the main-secondary scene scene_diff1, the electronic device can sequentially obtain a total of N3 power gears according to the power gears used by the electronic device when the above-mentioned N3 jamming events occur. The electronic device can also increase the gear values of these N3 power gears by one gear to obtain the updated N3 power gears, and determine the largest power gear among the updated N3 power gears as the second target power gear of the above-mentioned main-secondary scene scene_diff1. Afterwards, the electronic device can update the gear exploration progress recorded in the gear exploration data of scene_diff1 to the second target power gear of the above-mentioned scene_diff1. When the electronic device is in scene_diff1 again, the electronic device can be operated at the second target power gear, so that the electronic device can run more smoothly under scene_diff1, improving the user experience. In addition, the electronic device will continue to complete the gear exploration process of scene_diff1 according to the gear exploration rules from the second target gear of scene_diff1, and update the proportion of the corresponding gear in the gear exploration data of scene_diff1 according to the corresponding stall duration of N3 stall events.
[0162] Similarly, for the stuttering events that occur in other main secondary scenes (such as scene_diff2) among the above N2 second stuttering events, the electronic device can also determine the second target power gear of the main secondary scene scene_diff2 according to the above method. And update the gear exploration progress recorded in the gear exploration data of scene_diff2 to the second target power gear of scene_diff2, which will not be repeated here.
[0163] Figure 5 and Figure 6 It respectively shows that the electronic device is in different scenes when the second freeze event occurs, the process of the electronic device adjusting the gear position in response to the freeze event, and the process of the electronic device feedback updating the gear position exploration data in response to the freeze event.
[0164] like Figure 5As shown, the electronic device is performing gear exploration in the main secondary scene scene 501 according to the gear exploration rules, and at this time scene 501 is the aforementioned first main secondary scene. At time t51, the electronic device starts to run at power gear PL1_x. At time t52 after time t51, the electronic device has a jam event delay 03, but the electronic device does not capture the jam event delay 03 at time t52, so the electronic device will continue to run at power gear PL1_x. Until time t53, the operation scene of the electronic device is switched from the main secondary scene scene 501 to the main secondary scene 502, and starts to run with the gear exploration progress PL1_y recorded under the main secondary scene 502, and at this time scene 502 is the aforementioned second main secondary scene. From time t53 to time t54, the electronic device has been running at gear PL1_y under scene 502. Until time t54, the electronic device obtains the jam event delay 03. Next, the electronic device will obtain the operating scene scene 501 in which the electronic device is located at that time and the power gear PL1_(x+1) used by the electronic device at that time according to the occurrence time of the jam event delay 03, and determine based on the power gear PL1_x that the gear needs to be adjusted to a gear PL1_(x+1) one gear higher than PL1_x in scene 501, and the power gear PL1_(x+1) is the target power gear of scene 501. Since the electronic device is not in scene 501 at time t35, at time t54, the electronic device will update the gear exploration progress recorded in the gear exploration data of scene 501 to PL1_(x+1). Since no jam event occurs in scene 502, the electronic device will continue to operate at gear PL1_y in scene 502 for a period of time after time t54.
[0165] In the subsequent process, at time t55, when the operating scene of the electronic device switches back to scene 501, the electronic device will start to operate at the power gear PL1_(x+1) recorded in the gear exploration progress at time t55, and continue to complete the gear exploration process for scene 501 from this gear according to the aforementioned gear exploration rules.
[0166] In the present application, the main-secondary scene scene 502 may be referred to as the “first main-secondary scene”, the main-secondary scene scene 501 may be referred to as the “second main-secondary scene”, and the stall event delay 03 may be referred to as the “second stall event”, which may belong to the “at least one second stall event” in the above description.
[0167] Figure 6 shows an electronic device for Figure 5 The process of feedback updating the gear exploration data based on the jamming event shown.
[0168] like Figure 6 As shown, the original data table 600 may include multiple original data. The specific contents and functions thereof may refer to the aforementioned Figure 4 For ease of understanding, the original data table 400 only shows the original data 6001 of the main secondary scene scene 501 and the original data 6002 of the main secondary scene scene 502.
[0169] Here we also take the above T of 30s as an example. Figure 4 As shown, at time t51, the gear exploration progress recorded in the original data 6001 is gear 6, and the electronic device is running at gear 5 under scene 501. It can be understood that Figure 6 In the middle, 5th gear (i.e. 50% gear) is Figure 5 The power level PL1_x, level 6 (i.e. level 60%) is Figure 3 The power level PL1_(x+1) in.
[0170] The electronic device has been running at power level 5 under scene 501 since time t51. Until time t52, the electronic device has a freeze event delay 03 when running at power level 5, but the electronic device does not capture the freeze event delay01 at time t52, so the electronic device continues to run at power level 5. The electronic device will not feed back and update the data stored in the original data 6001 at time t52.
[0171] Until time t53, the operation scene of the electronic device is switched from the main secondary scene 501 to the main secondary scene 502, and begins to explore the progress of level 8 (i.e., level 8) recorded in the main secondary scene 502. Figure 5 At this time, the electronic device will update the total running time T corresponding to the 5th gear in the original data table 6001. 51-53 (T 51-53 Including the duration of the freeze event delay 03), as well as the freeze duration 0s, and updates the gear exploration progress to 5 gears.
[0172] Until time t54, the electronic device is running at gear 8 in the main secondary scene scene 502, but the electronic device obtains a freeze event delay 03 at this time. Next, the electronic device will obtain the power gear 5 used by the electronic device at that time according to the time when the freeze event delay 03 occurs, and determine that the gear needs to be adjusted to gear 6 in scene 301. Since the electronic device is not in scene 501 at time t35, the electronic device will feedback and update the data stored in the original data 6001 at time t35, that is, update the gear exploration progress recorded in the original data 6001 from gear 5 to gear 6. In addition, at time t35, after obtaining the freeze event delay 03, the electronic device will also update the freeze duration T of the freeze event delay 03. delay 03 Update the freeze duration of level 5 in the original data 6001 to T delay 03 Since no freeze event occurs in scene 502 , the electronic device will continue to operate at the gear position PL1_y in scene 502 for a period of time after time t54 , and the electronic device will not perform feedback update on the original data 6002 at time t54 .
[0173] In the subsequent process, at time t55, when the operation scene of the electronic device is switched back to scene 501, the electronic device will start to operate at power gear 6 recorded in the gear exploration progress at time t55, and continue to complete the gear exploration process for scene 501 according to the aforementioned gear exploration rules from this gear. It should be noted that, since the exploration progress of the electronic device for scene 502 and the update of data are uncertain during the period from time t54 to time t55, the original data 6002 is not shown in the original data table 600 at time t55.
[0174] In some embodiments, when N2 is greater than 1, the power levels used by the electronic device when any two of the second freeze events of N2 occur can be the same power level or different power levels. Figure 7 It shows the process of adjusting the gear of the electronic device in response to the second jamming event when the electronic device uses different power gears when multiple second jamming events occur.
[0175] like Figure 7As shown, the electronic device is performing gear exploration in the main secondary scene scene 701 according to the gear exploration rules, and scene 701 is the aforementioned first main secondary scene. At t71, the electronic device starts to run at power gear PL1_(x+1). At t72 after t71, a jam event delay 04 occurs in the electronic device, but the electronic device does not capture the jam event delay 04 at t72, so the electronic device continues to run at power gear PL1_(x+1). Until t73, the duration of the electronic device running at power gear PL1_(x+1) reaches 30s. According to the above gear exploration rules, at t33, the electronic device lowers the power gear by one gear to run at power gear PL1_x. Correspondingly, the electronic device will also update the original data of scene 701 to save the duration of 30s running at PL1_(x+1) (these 30s include the duration of jam event delay 03), and the jam duration 0s. At time t73, the electronic device starts to run at power level PL1_x. At time t74 after time t73, a freeze event delay 05 occurs in the electronic device, but the electronic device does not capture the freeze event delay 05 at time t74, so the electronic device continues to run at power level PL1_x under scene 701. Until time t75, the operation scene of the electronic device switches from the main secondary scene scene701 to the main secondary scene scene702, and starts to run at the gear exploration progress PL1_y recorded under the main secondary scene scene702. From time t75 to time t76, the electronic device has been running at gear PL1_y under scene702. Until time t76, the electronic device obtains freeze events delay 04 and freeze events delay 05. Next, the electronic device will obtain the running scene scene701 in which the electronic device is located at that time and the power gear PL1_(x+1) used by the electronic device at that time according to the occurrence time of the jam event delay 04, and determine based on the power gear PL1_x that the gear needs to be adjusted to a gear PL1_(x+2) one gear higher than PL1_(x+1) under scene 701; in addition, the electronic device will also obtain the running scene scene 701 in which the electronic device is located at that time and the power gear PL1_x used by the electronic device at that time according to the occurrence time of the jam event delay 05, and determine based on the power gear PL1_x that the gear needs to be adjusted to a gear PL1_(x+1) one gear higher than PL1_x under scene 701. Since the gear value of the power gear PL1_(x+1) is greater than the gear value of PL1_(x+2), the electronic device will determine the power gear PL1_(x+2) as the target power gear of scene 701.Since the electronic device is not in scene 501 at time t75, the electronic device will update the gear exploration progress recorded in the gear exploration data of scene 701 to PL1_(x+2) at time t75. Correspondingly, the electronic device will also update the stall duration of gear PL1_(x+1) in the original data of scene 701 according to the stall event delay04, and update the stall duration of gear PL1_x in the original data of scene701 according to the stall event 05. Since no stall event occurs in scene702, the electronic device will continue to operate in gear PL1_y in scene702 for a period of time after time t54.
[0176] In the subsequent process, at time t77, when the operating scene of the electronic device switches back to scene701, the electronic device will start to operate at the power level PL1_(x+2) recorded in the gear exploration progress at time t77, and continue to complete the gear exploration process for scene701 from this gear according to the aforementioned gear exploration rules.
[0177] In the present application, the above-mentioned main-secondary scene scene 701 can be called the "second main-secondary scene", the above-mentioned main-secondary scene scene 702 can be called the "first main-secondary scene", and the above-mentioned freeze event delay 04 and freeze event delay05 can be called the "second freeze event", which can belong to the "at least one second freeze event" in the above description.
[0178] In some embodiments, the at least one freeze event acquired by the electronic device may also include at least one first freeze event and at least one second freeze event. That is, step S203 and step S204 are not mutually exclusive, and the electronic device may simultaneously perform one or more of step S203 and step S204. Figure 8 The diagram shows a process in which the electronic device adjusts the gear position in response to a jam event when the at least one jam event includes both a first jam event and a second jam event.
[0179] like Figure 8As shown, the electronic device is performing gear exploration in accordance with the gear exploration rules under the main secondary scene scene 801, and at this time scene 801 is the aforementioned first main secondary scene. At time t81, the electronic device starts to run at power gear PL1_x. At time t82 after time t81, a jam event delay 06 occurs in the electronic device, but the electronic device does not capture the jam event delay 06 at time t82, so the electronic device will continue to run at power gear PL1_(x+1). Until time t83, the operation scene of the electronic device is switched from the main secondary scene scene 801 to the main secondary scene scene 802, and starts to run with the gear exploration progress PL1_y recorded under the main secondary scene scene 802, and at this time scene 802 is the aforementioned second main secondary scene. At time t83-t84, the electronic device has been running at gear PL1_y under scene 802. At time t84, the electronic device has a freeze event delay 07, but the electronic device has not captured the freeze event delay 07 at time t84, so the electronic device will continue to operate at the power level PL1_(x+1). Until time t85, the electronic device obtains freeze events delay 06 and freeze events delay 07. Next, the electronic device will obtain the running scene scene 801 in which the electronic device is located at that time and the power level PL1_x used by the electronic device at that time according to the occurrence time of the freeze event delay 06, and determine based on the power level PL1_x that the level needs to be adjusted to a level PL1_(x+1) higher than PL1_x under scene 801; in addition, the electronic device will also obtain the running scene scene 802 in which the electronic device is located at that time and the power level PL1_y used by the electronic device at that time according to the occurrence time of the freeze event delay 07, and determine based on the power level PL1_y that the level needs to be adjusted to a level PL1_(y+1) higher than PL1_y under scene 802. The electronic device will determine the power level PL1_(x+1) as the target power level for scene 801 , and determine the power level PL1_(y+1) as the target power level for scene 802 .Since the electronic device is in scene 802 but not in scene 501 at time t85, the electronic device will adjust the power to the target power level PL1_(y+1) in scene 802 at time t85, and will continue to operate at the power level PL1_(y+1) in scene 802 from time t85 to time t86. Time t86 is the time when the electronic device obtains an event that requires feedback update of the original data of scene 802 in scene 802; and the electronic device will also update the freeze duration of level PL1_y in the original data of scene 802 according to freeze event 07. In addition, the electronic device will update the gear exploration progress recorded in the gear exploration data of scene 801 to the target power level PL1_(x+1); similarly, the electronic device will also update the freeze duration of level PL1_x in the original data of scene 801 according to freeze event delay 06.
[0180] In the subsequent process, at time t87, when the operating scene of the electronic device switches back to scene 801, the electronic device will start to operate at the power gear PL1_(x+1) recorded in the gear exploration progress at time t77, and continue to complete the gear exploration process for scene 801 from this gear according to the aforementioned gear exploration rules.
[0181] In the present application, the above-mentioned main-secondary scene scene 802 can be called the "first main-secondary scene", the above-mentioned main-secondary scene scene 801 can be called the "second main-secondary scene", the above-mentioned jamming event delay 07 can be called the "first jamming event", which can belong to the "at least one jamming event" in the aforementioned description, and the above-mentioned jamming event delay 06 can be called the "second jamming event", which can belong to the "at least one second jamming event" in the aforementioned description.
[0182] It should be noted that, in some embodiments, the operation of adjusting the maximum power level of the CPU for different primary and secondary scenarios by the electronic device may only occur when the electronic device is in an uncharged state, that is, the electronic device may only perform steps S201 to S204 in the method in an uncharged state. When the electronic device is in a charging state, since the electronic device has sufficient power supply, the electronic device does not need to adjust the level of the maximum power supply of the CPU based on the operating scenario, but always keeps the level of the maximum power supply of the CPU at the maximum level, giving priority to ensuring the performance requirements of the electronic device.
[0183] In the present application, in the process of gear exploration for the main and secondary scenes, when a jamming event occurs in an electronic device, the electronic device can simultaneously record the gear of the maximum power that can be supplied by the CPU used by the electronic device when the jamming occurs and the main and secondary scene parameters of the main and secondary scene at that time, and determine the target power gear according to the power gear used by the electronic device when the jamming occurs. When multiple jamming events are obtained at the same time, the electronic device will also comprehensively compare the adjustment strategies made for each jamming event and the current operating scene of the electronic device to determine the final performance adjustment strategy. In this way, the electronic device can closely link the jamming event with the scene in which the electronic device is located when it occurs and the gear used, and determine the performance adjustment strategy to be executed in accordance with the performance requirements of the current scene, so that the performance adjustment strategy determined according to the jamming event after the jamming event is obtained is more reasonable, and the data updated by the gear exploration process for the jamming event is also more accurate, further improving the accuracy of the optimal power gear determined by the electronic device in the subsequent process based on the valid data of the main and secondary scenes.
[0184] Fig. 9 It is shown that the embodiment of the present application provides a system architecture, which can be used to execute the power determination method described above. Fig. 9 As shown, the electronic device 100 may be the electronic device provided by the present application in the foregoing description. The electronic device 100 may be connected to multiple input devices 200 (such as a mouse, a keyboard, etc.) Fig. 9 Specifically, some of the devices in the input device 200 are integrated on the electronic device 100; for example, when the electronic device 100 is a notebook computer, the keyboard included in the input device 200 can be integrated with the electronic device 100 on the same device body.
[0185] 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:
[0186] The data acquisition module 1001 is used to collect raw data. That is, for any primary secondary scene scene_x, the data acquisition module 1001 can, in the primary secondary scene scene_x, run the electronic device in all optional gears of the maximum power that the CPU can supply from high to low, and record the primary secondary scene parameters of scene_x and the percentage of the freezing time when running at each power gear under scene_x. When the total running time of the electronic device under scene_x reaches the specified time threshold T totalAfterwards, the original data of scene_x collected by the electronic device (the original data includes the main and secondary scene parameters of scene_x and the proportion of the freeze time when running at various power levels under scene_x) can be called a valid data corresponding to scene_x.
[0187] In the process of collecting raw data, for any jamming event captured under the main secondary scene scene_x, the data collection module will not only obtain the duration of each jamming event, but also obtain the running scene of the electronic device 100 when each jamming event occurs and the maximum power supply level of the CPU used. Among them, for each jamming event, the calculation module 1006 will determine a performance adjustment strategy based on the running scene of the electronic device 100 when the jamming event occurs and the maximum power supply level of the CPU used, and the performance adjustment strategy specifies which level the electronic device needs to adjust the maximum power supply of the CPU to in the next step under the scene where the jamming event occurs. When multiple jamming events are obtained at the same time, the calculation module 1006 will classify the jamming events according to the jamming event occurrence scene. For jamming events occurring in the same main secondary scene, the calculation module 1006 will comprehensively compare the adjustment strategies made for each jamming event and the running scene where the electronic device is currently located to determine the final performance adjustment strategy, and send the final performance adjustment strategy determined to the CPU performance adjustment module 1009 to ensure that the electronic device can make positive performance adjustments for each jamming event. For details, please refer to the above Figure 2-Figure 8 The relevant instructions will not be repeated here.
[0188] The valid data collected by the data collection module 1001 can be stored in the data storage module 1003. After the electronic device obtains the valid data of any one of the main and secondary scenes, if the electronic device is in the main and secondary scene again in the subsequent operation process, the calculation module 1006 can obtain the valid data of the main and secondary scene from the data storage module 1003 according to the main and secondary scene parameters, and directly determine the optimal power gear of the main and secondary scene based on the valid data, and send the optimal power gear to the CPU performance adjustment module 1009.
[0189] When the electronic device acquires enough valid data of the primary and secondary scenes, the electronic device, that is, when the amount of valid data is greater than a certain threshold, the data processing module 1002 is used to pre-process all the valid data collected by the data acquisition module 1001, such as numbering and marking the collected valid data, and obtaining a training set for training the power prediction model 1007. The data storage module 1003 is also used to store the data obtained when the data processing module 1002 pre-processes the valid data, such as a mapping relationship table for recording the mapping relationship between the focus application name and the focus application number, a gear mark table for recording whether the power gear causes damage to the user experience, and finally a training set for inputting into the prediction model for training. After the valid data is converted into a training set, the training module 1004 is used to perform model training using the training set stored in the data storage module 1003 to obtain the power prediction model 1007, and integrate the power prediction model in the calculation module 1006.
[0190] Optionally, before training the power prediction model 1007, the charging module 1010 can first identify whether the user is in a charging state; in the 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.
[0191] The power prediction model 1007 can predict the probability of impaired user experience corresponding to each gear when the electronic device is running at each power gear under the main secondary scene according to the main secondary scene parameters of the main secondary scene currently running. Further, the calculation module 1006 can determine the optimal power gear of the secondary scene according to the probability of impaired user experience corresponding to each gear when the electronic device is running at each power gear under the secondary scene output by the power prediction model, and the lowest gear with a probability of impaired less than or equal to 0.5, and send the optimal power gear to the CPU performance adjustment module 1009.
[0192] After receiving the above-mentioned optimal power level, the CPU performance adjustment module 1009 can adjust the level of the maximum power that can be supplied by the CPU of the electronic device 100 to the above-mentioned optimal power level.
[0193] In addition, when the user operates through the interface provided by the I / O interface 1008, such as clicking a mouse button or inputting an operation through a keyboard shortcut key, it can be regarded as the electronic device 100 triggering a first-level event, and the scene in which the electronic device 100 is running is a first-level scene. In this case, the I / O interface 1008 can send the corresponding instruction or information to the CPU performance adjustment module 1009, and the CPU performance adjustment module 1009 can directly adjust the gear of the maximum power that can be supplied by the CPU to the maximum gear. Specifically, the CPU performance adjustment module 1009 can exist in the electronic device 100 in the form of program code, which can include a storage address, which is used to record the gear value of the current maximum power that can be supplied by the CPU of the electronic device. When the CPU performance adjustment module 1009 receives an instruction or information for adjusting the gear of the maximum power that can be supplied by the CPU, the CPU performance adjustment module 1009 can change the gear value of the current maximum power that can be supplied by the CPU of the electronic device based on the above-mentioned storage address to complete the adjustment of the gear of the maximum power that can be supplied by the CPU.
[0194] Optionally, the CPU performance adjustment module 1009 may also receive a control instruction issued by the charging module 1010, which is used to indicate whether the electronic device 100 is currently in a charging state. When the control instruction indicates that the electronic device 100 is currently in a charging state, the CPU performance adjustment module 1009 may no longer use the optimal power gear issued by the calculation module 1006 as a reference to adjust the gear of the CPU's maximum power supply. That is, when the electronic device 100 is in a charging state, the power supply is sufficient, the prediction model 1007 may no longer take effect, and the CPU performance adjustment module 1009 may directly adjust the gear of the CPU's maximum power supply to the maximum power gear, and keep the maximum power gear running, giving priority to ensuring the performance requirements of the electronic device. When the control instruction indicates that the electronic device 100 is currently in an uncharged state, the CPU performance adjustment module 1009 will once again use the optimal power gear issued by the calculation module 1006 as a reference to adjust the gear of the CPU's maximum power supply of the electronic device 100 to the optimal power gear, ensuring the balance between the performance and power consumption of the electronic device 100.
[0195] Understandably, Fig. 9 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Fig. 9 In the embodiment, the data storage module 1003 is an internal memory in the electronic device 100. In other cases, the data storage module 1003 may also be placed outside the electronic device 100.
[0196] Next, the electronic device provided by this application is introduced.
[0197] The electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) or a dedicated camera (such as a SLR camera, a card camera), etc. The present application does not impose any restrictions on the specific type of the electronic device.
[0198] Fig.10 The structure of the electronic device is exemplarily shown.
[0199] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a button 190, an indicator 192, a camera 193, a display screen 194, etc.
[0200] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0201] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0202] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0203] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0204] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0205] The power management module 141 is used to connect 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, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0206] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0207] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0208] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0209] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0210] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0211] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0212] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0213] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0214] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0215] The external memory 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 memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0216] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0217] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0218] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0219] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0220] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0221] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0222] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0223] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0224] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0225] The processor 110 is used to collect valid data of the primary and secondary scenes in the primary and secondary scenes, and train the power prediction model according to the collected valid data. The electronic device 100 can store the collected valid data in the memory of the processor 110 or in the external memory connected through the external memory interface 120.
[0226] In the process of collecting valid data, for any freeze event captured in any primary or secondary scenario, the processor 110 will not only obtain the duration of each freeze event, but also obtain the operating scenario of the electronic device 100 when each freeze event occurs and the maximum power supply level of the CPU used. Among them, for each freeze event, the processor 110 will determine a performance adjustment strategy based on the operating scenario of the electronic device 100 when the freeze event occurs and the maximum power supply level of the CPU used. The performance adjustment strategy specifies the level to which the maximum power supply of the CPU of the electronic device needs to be adjusted in the next step in the scenario where the freeze event occurs. When multiple freeze events are obtained at the same time, the processor 110 will classify the freeze events according to the freeze event occurrence scenario. For freeze events occurring in the same primary or secondary scenario, the processor 110 will comprehensively compare the adjustment strategies made for each freeze event and the current operating scenario of the electronic device to determine the final performance adjustment strategy, to ensure that the electronic device 100 can make positive performance adjustments for each freeze event. For details, please refer to the aforementioned Figure 2-Figure 8 The relevant instructions will not be repeated here.
[0227] Specifically, when the amount of valid training data is sufficient, the charging management module 140 may send the first information to the processor 110, and the display screen 194 may send the second information to the processor 110 through the corresponding interface. When the first information indicates that the electronic device 100 is currently in a charging state and the second information indicates that the display screen of the electronic device is in an off state (the electronic device 100 is still in a powered-on state), the processor 110 will trigger the process of training the above-mentioned power prediction model.
[0228] 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 information to the processor 110, and the third information is used to notify the processor 110 that the electronic device 100 is currently in a charging state, so that the processor 110 maintains the maximum supplyable power level at the maximum power level.
[0229] If the electronic device 100 is in an uncharged state (but the electronic device is still in the turned-on state), the processor 110 can determine the scene attributes of the operating scene of the electronic device 100, and determine the power value or power level that needs to be adjusted for the maximum power that the processor 110 can supply based on the operating scene category.
[0230] Specifically, when the operation scenario of the electronic device is a level one scenario, based on the high performance requirements of the level one scenario for the electronic device, the processor 110 will directly adjust the CPU's maximum power supply gear to the maximum power gear to ensure 100% supply of the electronic device's performance. In the following N seconds, the processor 110 will always keep the gear of the maximum power supply at the maximum power gear. If the electronic device triggers a level one event again within N seconds, the electronic device will restart the timing from the trigger time of the second level one event. In the following N seconds, the processor 110 will always keep the gear of the maximum power supply at the maximum power gear, and so on, until the electronic device does not trigger a level one event within N consecutive seconds, the processor 110 will determine that the level one scenario has ended, and the operation scenario is now a level two scenario. The above N can be 5 or other values, and this application is not limited to this.
[0231] When the operation scenario of the electronic device is a secondary scenario, if the above-mentioned power prediction model has not been trained, when the main secondary scenario in the secondary scenario is a valid main secondary scenario, the processor 110 can determine the optimal power gear based on the valid data of the current main secondary scenario, and adjust the gear of the maximum power that the CPU can supply to the optimal power gear; when the main secondary scenario in the secondary scenario is an ineffective main secondary scenario, the processor 110 will adjust the gear of the maximum power that the CPU can supply to the gear corresponding to the gear exploration progress recorded in the original data of the main secondary scene. If the above-mentioned power prediction model is trained, regardless of whether the main secondary scenario of the secondary scenario is a valid main secondary scenario or an ineffective main secondary scenario, the processor 110 can determine the optimal power gear of the main secondary scenario based on the above-mentioned power prediction model, and adjust the gear of the maximum power that the CPU can supply to the optimal power gear.
[0232] An embodiment of the present 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, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method shown in the aforementioned embodiment.
[0233] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0234] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0235] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A power adjustment method, characterized in that: include: At least one freeze event is detected in a first primary-secondary scenario, the at least one freeze event includes at least one first freeze event, the at least one first freeze event occurs in the first primary-secondary scenario, and the first primary-secondary scenario includes a scenario related to a focus application when the electronic device does not detect an interaction event; The maximum power that can be supplied by the CPU of the electronic device is adjusted to a first power, wherein the first power is greater than the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one first freeze event occurs.
2. The method according to claim 1, characterized in that The difference between the first power and the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one first freeze event occurs is less than a first threshold.
3. The method according to claim 1 or 2, characterized in that: The maximum power that can be supplied by the CPU of the electronic device when each of the at least one first freeze event occurs is the same, or the maximum power that can be supplied by the CPU of the electronic device when at least two of the at least one first freeze event occur is different.
4. The method according to any one of claims 1 to 3, characterized in that: The at least one freeze event further includes at least one second freeze event, each freeze event in the at least one second freeze event occurs in a second primary secondary scenario, the first primary secondary scenario includes a scenario related to the focus application when the electronic device does not detect an interaction event, and the method further includes: When entering the second main-secondary scene, the maximum power that can be supplied by the CPU is adjusted to a second power, and the second power is greater than the maximum power that can be supplied by the CPU used by the electronic device when each of the at least one second freeze event occurs.
5. The method according to claim 4, characterized in that After detecting at least one second freeze event in at least one freeze event in the first primary-secondary scene, and before detecting entering the second primary-secondary scene, the method further includes: The exploration progress of the second main-secondary scene is updated to the second power; the exploration progress of the second main-secondary scene is used to adjust the maximum supplyable power of the CPU to the second power after re-entering the second main-secondary scene.
6. The method according to claim 4 or 5, characterized in that: A difference between the second power and a maximum power that can be supplied by a CPU used by the electronic device when each of the at least two first freeze events occurs is less than a first threshold.
7. The method according to claim 4 or 5, characterized in that: The maximum power that can be supplied by the CPU of the electronic device when each of the at least one second freeze event occurs is the same, or the maximum power that can be supplied by the CPU of the electronic device when at least two of the at least one second freeze event occur is different.
8. The method according to any one of claims 1 to 7, characterized in that: The at least one freeze event includes three freeze events, the third freeze event occurs in the first primary and secondary scenarios, and when the third freeze event occurs, the maximum power that can be supplied by the CPU used by the electronic device is a third power, and the method further includes: Update the operating data of the first main-secondary scenario, the operating data including the freeze duration when running at the third power under the first main-secondary scenario, and the freeze duration when running at the third power includes the freeze duration of the third freeze event.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors, a memory and a display screen; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 8.
10. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1-8.
11. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 8.