Running control method and device of application program, electronic equipment, storage medium and computer program product

By monitoring the characteristic data of the battery and application, using artificial intelligence models to identify abnormal applications and perform CPU regulation, the application's high power consumption and high heat generation on super-large cores is solved, and intelligent CPU resource management and performance optimization are achieved.

CN120256118APending Publication Date: 2025-07-04SAMSUNG GUANGZHOU MOBILE R&D CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510380574.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, the CPU operation control of the application is poor in intelligence and flexibility, resulting in high power consumption and high heat generation, especially when the application continues to run on super-large cores.

Method used

By monitoring battery behavior characteristic data and application behavior characteristic data, preset artificial intelligence models such as isolated forest models and reinforcement learning models are used to determine abnormal applications, and intelligently regulate the CPU usage and uclamp values ​​to optimize CPU usage.

Benefits of technology

It realizes intelligent and flexible control of application CPU usage, reduces power consumption, avoids high heat generation, maintains application performance and smoothness, and improves terminal battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120256118A_ABST
    Figure CN120256118A_ABST
Patent Text Reader

Abstract

The invention relates to an application program operation control method and device, electronic equipment, a storage medium and a computer program product. The method comprises the steps of obtaining battery behavior characteristic data of the electronic equipment; under the condition that the battery behavior characteristic data meets a preset limiting condition, determining the specific application program as a candidate abnormal application program; acquiring application behavior feature data of the candidate abnormal application program; determining whether the candidate abnormal application program is a target abnormal application program or not through a preset artificial intelligence model; and under the condition that the candidate abnormal application program is determined to be the target abnormal application program, regulating and controlling the CPU occupation condition of the target abnormal application program. In this way, the CPU occupancy condition of the specific application program can be regulated and controlled based on the battery behavior feature data and the application behavior feature data of the specific application program. Compared with a mode of forcibly binding the APP to run on a certain CPU core in the prior art, the process of performing CPU running control on the APP in the invention is more intelligent and flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, and more particularly, to a method, apparatus, electronic device, storage medium, and computer program product for controlling the operation of an application program. Background Art

[0002] Basically, terminal chips all have a heterogeneous architecture, which can be mainly divided into 4 groups of central processing unit cores (CPU Cores): small cores (silver), namely CPU0 - 1, large cores (gold), namely CPU2 - 4, large cores (titanium), namely CPU5 - 6, and extra-large cores (prime), namely CPU7. Additionally, some terminal chips combine gold and titanium into one group.

[0003] When an application program (APP) runs on different CPU cores, its power consumption is also different. For example, when the APP runs on the extra-large core (prime), its power consumption is more than twice that when it runs on the large core (gold / titanium). If the APP continuously runs on the extra-large core, high power consumption and high heat generation will occur.

[0004] In related technologies, specific CPU control of the APP is mainly achieved by customizing a whitelist, usually by forcibly binding the APP to run on a certain CPU core. However, this control method is likely to cause a performance decline of the APP in some scenarios, and the intelligence and flexibility of CPU operation control for the APP are poor. Summary of the Invention

[0005] The present disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for controlling the operation of an application program, so as to at least solve the problem of poor intelligence and flexibility in CPU operation control for the APP in the above-mentioned related technologies.

[0006] According to the first aspect of the embodiments of the present disclosure, a method for controlling the operation of an application is provided, which is applied to an electronic device and includes: in response to detecting that a specific application of the electronic device enters the foreground running state, obtaining battery behavior characteristic data of the electronic device, where the specific application is any application other than the system application in the electronic device; when the battery behavior characteristic data meets a preset limit condition, determining the specific application as a candidate abnormal application, where the abnormality refers to the CPU scheduling abnormality of the application; obtaining application behavior characteristic data of the candidate abnormal application; based on the application behavior characteristic data, determining whether the candidate abnormal application is a target abnormal application through a preset artificial intelligence model; when it is determined that the candidate abnormal application is the target abnormal application, regulating the CPU occupancy of the target abnormal application.

[0007] Optionally, the step of determining the specific application as a candidate abnormal application when the battery behavior characteristic data meets a preset limit condition includes: when the battery behavior characteristic data meets a first preset limit condition, detecting the load of the UI main thread of the specific application and determining the change value of part of the battery behavior characteristic data; when the change value meets a second preset limit condition, determining the specific application as the candidate abnormal application.

[0008] Optionally, regulating the CPU occupancy of the target abnormal application includes: regulating the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application.

[0009] Optionally, the step of regulating the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application includes: setting the initial CPU usage rate of the target abnormal application; obtaining the power consumption data and / or performance data of the target abnormal application; based on the power consumption data and / or the performance data through a reinforcement learning model, adjusting the CPU usage rate of the target abnormal application on the basis of the initial CPU usage rate; based on the adjusted CPU usage rate, regulating the CPU occupancy.

[0010] Optionally, the power consumption data is the system average current, and the performance data is the average frame drop rate of the target abnormal application.

[0011] Optionally, after regulating the CPU occupancy of the target abnormal application, the method further includes: adding the application behavior feature data into the original sample feature set corresponding to the preset artificial intelligence model to obtain a new sample feature set; and generating a private artificial intelligence model corresponding to the specific application based on the new sample feature set.

[0012] Optionally, the preset artificial intelligence model is a preset isolation forest model.

[0013] Optionally, the battery behavior feature data includes at least one of the following items: the total CPU occupancy rate of the specific application, the total system GPU occupancy rate, the system current, the total CPU occupancy rate of the background running applications, the occupancy rate of the specific application on the big core CPU, the temperature change feature, and the total CPU occupancy rate of the system camera service.

[0014] Optionally, the application behavior feature data includes at least one of the following items: the total CPU occupancy rate of the candidate abnormal application, the total system GPU occupancy rate, the system current, the frame rate of the candidate abnormal application, the occupancy rate of the candidate abnormal application on the big core CPU, the occupancy rate of the candidate abnormal application on the small core CPU, and the occupancy rate of the candidate abnormal application on the large core CPU.

[0015] According to a second aspect of the embodiments of the present disclosure, there is provided an operating control device for an application, which is applied to an electronic device and includes: a battery behavior acquisition module configured to acquire battery behavior feature data of the electronic device in response to detecting that a specific application of the electronic device enters the foreground running state, where the specific application is any application other than the system application in the electronic device; a candidate abnormal application determination module configured to determine the specific application as a candidate abnormal application when the battery behavior feature data meets a preset limit condition, where the abnormality refers to a CPU scheduling abnormality of the application; an application behavior acquisition module configured to acquire application behavior feature data of the candidate abnormal application; a target abnormal application determination module configured to determine whether the candidate abnormal application is a target abnormal application based on the application behavior feature data through a preset artificial intelligence model; and a regulation module configured to regulate the CPU occupancy of the target abnormal application when it is determined that the candidate abnormal application is the target abnormal application.

[0016] Optionally, the candidate abnormal application determination module is configured to: when the battery behavior characteristic data meets the first preset limit condition, detect the UI main thread load of the specific application and determine the change value of part of the battery behavior characteristic data; when the change value meets the second preset limit condition, determine the specific application as the candidate abnormal application.

[0017] Optionally, the regulation module is configured to: regulate the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application.

[0018] Optionally, the regulation module is configured to: set the initial CPU usage rate of the target abnormal application; obtain the power consumption data and / or performance data of the target abnormal application; based on the power consumption data and / or the performance data through a reinforcement learning model, adjust the CPU usage rate of the target abnormal application on the basis of the initial CPU usage rate; and regulate the CPU occupancy based on the adjusted CPU usage rate.

[0019] Optionally, the power consumption data is the system average current, and the performance data is the average frame drop rate of the target abnormal application.

[0020] Optionally, the application operation control device further includes: a sample addition module configured to add the application behavior characteristic data into the original sample feature set corresponding to the preset artificial intelligence model to obtain a new sample feature set; and a model generation module configured to generate a private artificial intelligence model corresponding to the specific application based on the new sample feature set.

[0021] Optionally, the preset artificial intelligence model is a preset isolation forest model.

[0022] Optionally, the battery behavior characteristic data includes at least one of the following items: the total CPU occupancy rate of the specific application, the total system GPU occupancy rate, the system current, the total CPU occupancy rate of the background running applications, the occupancy rate of the specific application on the super large core CPU, the temperature change characteristic, the total CPU occupancy rate of the system camera service.

[0023] Optionally, the application behavior characteristic data includes at least one of the following items: the total CPU occupancy rate of the candidate abnormal application, the total system GPU occupancy rate, the system current, the frame rate of the candidate abnormal application, the occupancy rate of the candidate abnormal application on the super large core CPU, the occupancy rate of the candidate abnormal application on the small core CPU, the occupancy rate of the candidate abnormal application on the large core CPU.

[0024] According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, including: a processor; a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the instructions to implement a method for controlling the operation of an application according to the present disclosure.

[0025] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute a method for controlling the operation of an application according to the present disclosure.

[0026] According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, it implements a method for controlling the operation of an application according to the present disclosure.

[0027] The technical solutions provided by the embodiments of the present disclosure at least bring the following beneficial effects: In the present disclosure, the CPU occupancy of a specific application can be regulated based on battery behavior characteristic data and application behavior characteristic data of the specific application. Compared with the method of forcibly binding an APP to run on a certain CPU core in the related art, the process of controlling the CPU operation of the APP in the present disclosure is more intelligent and flexible.

[0028] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation to the present disclosure.

[0030] Figure 1 is a flowchart showing a method for controlling the operation of an application according to an exemplary embodiment of the present disclosure; Figure 2 is a binary structure diagram of an isolation tree showing an exemplary embodiment of the present disclosure; Figure 3 is a contour distribution diagram of the anomaly scores of training samples showing an exemplary embodiment of the present disclosure; Figure 4 is a schematic diagram of the R table of the Sarsa Learning model showing an exemplary embodiment of the present disclosure; Figure 5 is a state transition diagram of Sarsa Learning (S, A) showing an exemplary embodiment of the present disclosure; Figure 6 is a schematic diagram after the Sarsa Learning Q-table update according to an exemplary embodiment of the present disclosure; Figure 7 is a schematic diagram of the Q-value in the S(1, 1) state according to an exemplary embodiment of the present disclosure; Figure 8 is a schematic diagram showing the change in current before and after improvement in an actual test scenario according to an exemplary embodiment of the present disclosure; Figure 9 is a block diagram of an operation control device of an application program according to an exemplary embodiment of the present disclosure; Figure 10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed implementation manners

[0031] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following examples do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0033] It should be noted here that "at least one of several items" in the present disclosure all represents three parallel situations including "any one of the several items", "any combination of multiple items of the several items", and "the whole of the several items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "performing at least one of step one and step two", which means the following three parallel situations: (1) performing step one; (2) performing step two; (3) performing step one and step two.

[0034] The development levels of Android APPs on the market vary widely. Some APPs with poor development or insufficient testing, which are not high-computation or high-rendering types of APPs (such as game APPs), continuously maintain a high CPU occupancy rate in the foreground. This will induce the Kernel to migrate the APP process to the large-core CPU for long-term operation, which will lead to extremely high power consumption of the system, and may further cause abnormal heating of the terminal and a sharp drop in battery life. Moreover, the abnormal heating of the terminal will further cause the terminal to limit the CPU frequency, resulting in phenomena such as overall system lag.

[0035] In related technologies, each terminal manufacturer will automatically migrate the foreground APP to the 'top-APP' cgroup of the Kernel CGroup (control group), that is, no restrictions will be imposed on its resource utilization (cpu, memory, network, bi, etc.), and its needs will be met to the greatest extent; when the APP runs in the background, each terminal manufacturer will automatically migrate it to the 'bg-APP' cgroup of the Kernel CGroup (control group), that is, its resource utilization will be greatly restricted. For example, it is only allowed to run on the silver core, or even the process will be directly killed. Therefore, usually, the bad APP running in the foreground will be continuously scheduled by the android kernel to run on the large-core CPU, resulting in the phenomenon of extremely high power consumption.

[0036] Taking a certain translation software as an example, we observed that when the translation software stays on the main interface without any operation, its actual frame rate is lower than 24fps, but its CPU occupancy rate is as high as 100%. Its main thread runs on the large-core CPU (CPU7), resulting in extremely high power consumption.

[0037] In related technologies, there are mainly two ways to control the CPU operation of APPs. The first way is to test a large number of APPs manually to determine whether there is abnormal CPU scheduling, or passively wait for user complaints (Voice Complainment, VOC) to occur and then conduct reproduction tests. However, this manual testing method is time-consuming and laborious, and it is difficult to cover comprehensively.

[0038] The second method is as follows: for the abnormal 3rd APP detected in the test, invite the APP vendor to modify the code or perform specific CPU control on the APP by customizing the whitelist on the terminal side. However, it is relatively difficult to implement the solution of inviting the APP vendor to modify the code to reduce power consumption. This is because the APP vendor often does not care about the power consumption of the APP. Therefore, they rarely respond to the request of the terminal manufacturer to modify the code or often only fix it after several months. And the method of performing specific CPU control on the APP by customizing the whitelist usually requires forcibly binding the APP to run on a certain CPU core, which may forcibly reduce the CPU frequency when the APP is running. On the one hand, this method is very likely to cause the performance of the APP to decline in some scenarios; on the other hand, this method may become inadaptable as the APP is upgraded.

[0039] To solve the above problems existing in the related art, the method, device, electronic device, storage medium, and computer program product for controlling the operation of an application provided by the present disclosure can adjust the CPU occupancy of a specific application based on the battery behavior characteristic data and the application behavior characteristic data of the specific application. Compared with the method of forcibly binding the APP to run on a certain CPU core in the related art, the process of controlling the CPU operation of the APP in the present disclosure is more intelligent and flexible.

[0040] Figure 1 It is a flowchart showing a method for controlling the operation of an application according to an exemplary embodiment of the present disclosure.

[0041] Refer to Figure 1 , in step 101, in response to monitoring that a specific application of the electronic device enters the foreground running state, the battery behavior characteristic data (Battery Behavior) of the electronic device can be obtained, where the specific application can be any application other than the system application in the electronic device.

[0042] Exemplarily, a system service can be created at startup to monitor the switching of foreground APPs. When the APP running in the foreground is not a system APP, the battery behavior characteristic data can be sampled, that is, when the APP running in the foreground is a third-party APP (i.e., 3rd APP), the battery behavior characteristic data can be sampled.

[0043] According to an exemplary embodiment of the present disclosure, the above "battery behavior characteristic data" may include, but is not limited to, at least one of the following items, as long as it is any characteristic data that can reflect the battery behavior: (1) The total CPU occupancy rate of a specific application ( : (1) Foreground APP CPU usage, (2) total system GPU occupancy ( : System GPU usage), (3) system current ( : System PowerConsumption), (4) total CPU occupancy of background running applications ( : Background Top5 APP CPUusage), (5) occupancy rate of a specific application on the big core CPU ( : Foreground APP PrimeCPU usage), (6) temperature change characteristics ( : Device Temp Growth), (7) total CPU occupancy of the system camera service ( : Camera Service CPU usage).

[0044] Among them, parameters (1), (4), and (7) can be obtained through the top –n command; parameter (2) can be obtained through the "cat / sys / kernel / gpu / gpu_busy" command; parameter (3) can be obtained through the following command: "cat / sys / class / power_supply / battery / current_avg"; parameter (5) can generally be calculated based on the running time of the APP on the big core CPU, and its basic principle is: , where represents the occupancy rate of the application on the big core CPU, represents the running time of the application on the big core CPU during the sampling period, represents the total running time of the big core CPU during the sampling period; parameter (6) can be obtained through each temperature sensor. For example, it can be obtained through the command "cat / sys / class / power_supply / battery / batt_temp".

[0045] In step 102, when the battery behavior characteristic data meets the preset limit conditions, a specific application can be determined as a candidate abnormal application, where the abnormality may refer to an abnormal CPU scheduling of the application.

[0046] According to an exemplary embodiment of the present disclosure, when the above battery behavior characteristic data meets the first preset limitation condition, UI main thread load detection can be performed on a specific application program, and the change values of some battery behavior characteristic data can be determined. When the change values meet the second preset limitation condition, the specific application program can be determined as a candidate abnormal application program. That is to say, in the present disclosure, the first limitation condition can be first used to perform a preliminary screening on a specific application program. When the specific application program meets the first limitation condition, main thread load detection can be performed on it. If it still meets the second limitation condition, subsequent processes can be carried out.

[0047] It should be noted that the foregoing "first limitation condition" can only roughly screen out whether the power consumption of the APP is relatively high and whether the APP mainly runs on the super large core CPU most of the time. As for whether it can be further optimized, further screening and discrimination are still required. Therefore, in the present disclosure, a "second limitation condition" is also set to further determine whether the APP needs to be optimized after the APP passes the screening of the "first limitation condition".

[0048] According to an exemplary embodiment of the present disclosure, the above battery behavior characteristic data may include multiple items. When it is determined that each battery behavior characteristic data in the multiple battery behavior characteristic data meets the respective set thresholds, it can be determined that the battery behavior characteristic data meets the first preset limitation condition. It should be noted that if the thread of the APP currently running on the Prime CPU is a pure background thread, it will not directly affect the UI main thread (APP Main Thread), that is, it will not affect the frame rate change of the APP, so it is impossible to determine the optimization effect of the APP. Therefore, the characteristic data related to the "foreground" in the above multiple battery behavior characteristic data can also be selected, that is, parameter (3): system current ( System Power Consumption), and parameter (5): the occupancy rate of the specific application program on the super large core CPU among multiple CPUs ( Foreground APPPrime CPU usage), that is, the occupancy rate of the application currently running in the foreground on the super large core CPU, to determine whether the application currently running in the foreground can be further optimized.

[0049] Specifically, for the first limitation condition: the above "battery behavior characteristic data" can be sampled every 10 s as a record. After accumulating a certain number of rounds (for example, 50 times), it can be determined whether each battery behavior characteristic data meets its respective first limitation condition.

[0050] Among them, the parameter (2) "total system GPU occupancy" can basically rule out most heavy Game APPs. This is because the CPU / GPU occupancy of general Game APPs is very large. For example, , and their fps is also relatively high. The optimization object of the present disclosure is mainly aimed at APPs with high CPU power consumption, and APPs with high GPU power consumption are not within the scope of discussion of the present disclosure.

[0051] The parameter (7) "total CPU occupancy of the system camera service" can basically rule out most heavy Camera APPs. This is because the main power consumption of heavy Camera APPs is concentrated in the camera, and its . In addition, here only counts the sum of the CPU occupancies of the system servers cameraserver and camera.provider-service.

[0052] The parameter (4) "total CPU occupancy of background running applications" can be calculated by the following formula:

[0053] Among them, can represent the occupancy of the i-th background running application on multiple CPUs. It should be noted that if the CPU occupancy of the background APP is very high (for example, exceeding the foreground), it will also cause an illusion of high system current. However, in fact, the current at this time is mainly caused by background activities, rather than generated by the foreground APP.

[0054] The parameter (3) "system current" can refer to the current consumed by the LCD screen, which can be queried from power_profile.xml.

[0055] The parameter (6) "temperature change characteristic" can refer to the temperature correction amount, which can be defined according to experience. For example, 25 degrees can be defined as 0.5; 45 degrees can be defined as 0, etc. This is mainly because when the terminal temperature is low, the temperature rises relatively fast (for example, 28 degrees); on the contrary, when the terminal temperature is high, the temperature rises relatively slowly and finally saturates and no longer rises (for example, reaching 50 degrees). The value range of the "temperature change characteristic" can be: -0.5~0.5, and the higher the temperature, the lower its value can be.

[0056] Exemplarily, the thresholds corresponding to the above 7 battery behavior characteristic data can be set respectively as: Foreground APP CPU usage The first threshold, for example, 70%; System GPU usage a second threshold, e.g., 30%; System Power Consumption A third threshold, for example, 350 mA; Background Top 5 App CPU usage a fourth threshold, for example, 20%; Foreground APP Prime CPU usage fifth threshold; Device Temp Growth sixth threshold; Camera Service CPU usage Seventh threshold.

[0057] If the battery behavior characteristic data of the APP running in the foreground all meet the corresponding set thresholds, it can be roughly determined that the power consumption of this APP is relatively high, and it mainly runs on the super-core CPU most of the time, so most of its power consumption is likely to come from the super-core CPU. At this time, it is necessary to continue to detect whether the APP can be optimized.

[0058] It should be noted that in the present disclosure, the principle of optimization is to maintain the balance between the performance and power consumption of the current APP, rather than simply reducing power consumption. If the pursuit of low power consumption leads to excessive decline in performance experience, it is likely to bring more user VOC. Therefore, in the present disclosure, the principle of optimization is to achieve a better balance between APP performance and power consumption, that is, to maintain the smoothness of the APP UI main thread while maintaining low power consumption. On the contrary, if the battery behavior characteristic data of each foreground APP cannot simultaneously meet the corresponding set thresholds, the APP is not an optimizable object and needs to wait for a certain period of time (for example, 5 minutes) before re-sampling and judging.

[0059] Regarding the second limitation condition: A 2ms sleep delay (APP MainThread Load Delay Probing) can be inserted in the APP UI main thread to observe the changes in the APP. As mentioned before, the main principle is that if the thread of the APP currently running on the Prime CPU is a pure background thread, it will not directly affect the UI main thread (APP MainThread), that is, it will not affect the frame rate change of the APP, and thus it is impossible to determine the optimization effect of the APP.

[0060] It should be noted that all APPs within the terminal can automatically call the requestNextVsync function through SurfaceFlinger for main thread periodic drawing synchronization. Therefore, a 2ms sleep delay can be added to the system's requestNextVsync function and maintained for a short period of time, for example, 30 seconds, and sampling can be started during this period.

[0061] By periodically inserting a 2ms sleep delay in the requestNextVsync function, its effect is actually to reduce the load of the APP main thread per unit time. Specifically, the Android Kernel will respond to the load change of the thread in real time, which affects the load calculation of the thread and ultimately causes the thread to be scheduled and migrated among different CPU Cores. Since the Kernel load calculation window period is generally 20ms, it is sufficient to maintain it for a very short time to complete this detection process.

[0062] As mentioned before, some of the battery behavior characteristic data can be part of the multiple battery behavior characteristic data. Exemplarily, these partial battery behavior characteristic data can be: Parameter (3): System current ( System Power Consumption), and, Parameter (5): Occupancy rate of a specific application on the super core CPU ( Foreground APP Prime CPU usage).

[0063] The above partial battery behavior characteristic data can be sampled as a record every 5s. After accumulating a certain number of rounds (for example, 6 times), it can be determined whether the changes in the sampled partial battery behavior characteristic data meet their respective set thresholds:

[0064]

[0065] Among them, represents the system current before inserting a 2ms sleep delay in the requestNextVsync function, represents the system current after inserting a 2ms sleep delay in the requestNextVsync function, represents the occupancy rate of a specific application on the big core CPU before inserting a 2ms sleep delay in the requestNextVsync function, represents the occupancy rate of a specific application on the big core CPU after inserting a 2ms sleep delay in the requestNextVsync function.

[0066] If the changes in the above-mentioned partial battery behavior characteristic data respectively meet their respective set thresholds, it can be roughly determined that most of the time the main thread of the foreground APP runs on the Prime CPU, or most of the time other threads of the foreground APP that have a communication relationship with the main thread run on the Prime CPU. Therefore, most of the power consumption of the foreground APP will be affected by abnormal behaviors on the UI thread, that is, there may be some invalid execution actions occupying the CPU. At this time, it is necessary to continue to detect whether there is indeed abnormal CPU scheduling in the foreground APP. On the contrary, if the above-mentioned partial battery behavior characteristic data do not respectively meet their respective thresholds, it can be determined that the foreground APP is not an optimization object and needs to wait for a certain period of time before re-sampling and judging.

[0067] In step 103, the application behavior characteristic data (APPBehavior) of the aforementioned candidate abnormal application can be obtained.

[0068] According to an exemplary embodiment of the present disclosure, the aforementioned "application behavior characteristic data" may include at least one of the following items, as long as it is characteristic data that can reflect application behavior: Parameter (1): The total CPU occupancy rate of the candidate abnormal application ( ), Parameter (2): The total occupancy rate of the system GPU ( ), Parameter (3): The system current ( ), Parameter (4): The frame rate of the candidate abnormal application ( : Foreground APP FPS), Parameter (5): The occupancy rate of the candidate abnormal application on the big core CPU ( ), Parameter (6): The occupancy rate of the candidate abnormal application on the small core CPU ( : Foreground APP Silver CPU usage), parameter (7): Occupancy rate of the candidate abnormal application on the big core CPU ( : Foreground APP Gold CPU usage).

[0069] In step 104, based on the above application behavior feature data, it can be determined whether the aforementioned candidate abnormal application is a target abnormal application through a preset artificial intelligence model.

[0070] According to an exemplary embodiment of the present disclosure, the above preset artificial intelligence model can be a preset isolation forest model. Specifically, the above application behavior feature data (APP Behavior) can be input into the preset isolation forest model (Isolation Forest) to predict again whether a specific application is an abnormal application (Outlier APP). That is, the application behavior feature data collected by timed sampling can be substituted into the trained isolation forest model to predict whether a specific application is an APP with abnormal CPU scheduling. If it is determined that a specific application does have abnormal CPU scheduling, that is, it belongs to an abnormal application, subsequent processes can be executed.

[0071] Exemplarily, the above application behavior feature data can be sampled every 10 s, and then the preset isolation forest model can be used based on the application behavior feature data sampled at regular intervals to predict and identify whether a specific application is an Outlier APP with abnormal CPU scheduling. Exemplarily, if the preset isolation forest model predicts a specific application as an Outlier APP for three consecutive times, it can be determined that the APP does have abnormal CPU scheduling, and subsequent processes can be executed. Otherwise, it is necessary to wait for a period of time and resample and predict.

[0072] Next, the training process of the isolation forest model will be explained in detail.

[0073] Isolation forest is a classic anomaly detection algorithm. The basic theoretical basis of the isolation forest is that the proportion of abnormal data in the total sample size is very small, and the difference between the feature values of abnormal points and normal points is very large. Therefore, abnormal samples are more likely to be isolated and can be clearly distinguished.

[0074] Generally speaking, the number of APPs with abnormal CPU scheduling and thus high power consumption is relatively small, while the number of APPs with normal power consumption is extremely large. Therefore, for many binary decision algorithms, such as SVM classification, C4.5 decision tree, random forest, etc., due to the huge difference in the ratio of positive examples to negative examples, it is very likely to lead to an obvious tendency in the prediction results, so the prediction accuracy of these algorithms is relatively low. The Isolation Forest can well solve this problem. It is the most widely used On-Device outlier detection algorithm in the industry and also has the best effect for global anomaly factors.

[0075] When training the Isolation Forest model, the "input of the model" can be: the above 7 application behavior feature data sampled and collected during the process of testing and monitoring a large number of Normal APPs and a small number of Abnormal APPs; the "model training process" can be: randomly generating several isolation trees based on the above 7 application behavior feature data as the decision model for subsequent calculation of new samples; the "output of the model" can be: sampling the application behavior feature data of the third-party APP currently running in the foreground on device, and using the trained decision model to determine whether the third-party APP currently running in the foreground is an Outlier APP, that is, whether there is indeed abnormal CPU scheduling.

[0076] (I). Prepare sample data By performing automated monkey testing on hundreds of known Normal APPs and several Abnormal APPs and sampling the application behavior feature data, a training data set for the Isolation Forest model can be formed. The training data set can contain a total of N samples, and each sample can correspond to 7-dimensional application behavior feature data, which are respectively: 、 、 、 、 、 、 . It should be noted that the N samples can come from different APPs respectively, or can contain the application behavior feature data of the same APP at different sampling times.

[0077] Different from other supervised decision tree machine learning algorithms, for the Isolation Forest model, it is an unsupervised machine learning model. Therefore, there is no need to label the APPs as Normal or Abnormal, and they are naturally distinguished through calculation during the construction of random trees. After obtaining the sample data, it is necessary to preprocess the sample data first, that is, perform standard normalization processing, and its calculation formula can be as follows:

[0078] Among them, represents the value after standard normalization processing for the sample data, represents the maximum value of the application behavior feature data of a certain dimension, that is, can represent the maximum value of a certain column of the application behavior feature data among the 7 columns of application behavior feature data , represents the minimum value of the application behavior feature data of a certain dimension, that is, can represent the minimum value of a certain column of the application behavior feature data among the 7 columns of application behavior feature data , max = +1, min = -1. In this way, the values of all sample data after standard normalization processing will fall within [-1, +1].

[0079] Exemplarily, taking the first column of the application behavior feature data among the aforementioned 7 columns of application behavior feature data, that is, this column of application behavior feature data as an example to explain the implementation process of standard normalization: Suppose the maximum value in this column of application behavior feature data is 85%, and the minimum value is 20%, then for the sample data of 30%, its standard normalization result is:

[0080] (2). Establishing an isolation forest The isolation forest can be composed of several randomly generated isolation trees. It should be noted that each isolation tree in the isolation forest is independent and random from each other. Therefore, multiple isolation trees can be calculated in parallel, and the calculation speed is extremely fast. Below, the calculation process of an isolation tree in the isolation forest will be elaborated in detail, and the calculation processes of other several isolation trees are similar.

[0081] (1). Randomly select several non-repeating samples from all the samples included in the training sample set to construct an isolation tree. Exemplarily, 256 samples can be randomly selected. It should be noted that these 256 samples can include the application behavior feature data from different APPs, or the application behavior feature data of the same APP at different sampling times. Moreover, the differences between these 256 samples cannot be too small, that is, there needs to be a certain difference between these samples.

[0082] (2). Calculate the maximum depth of this isolation tree: Among them, rows is the number of randomly selected samples, cols is the dimensionality of the samples, and c is the dimensional compensation value, whose value range can be: [-cols, cols], and can be specifically adjusted according to the training results. Exemplarily, c = 0 can be taken here. At this time, 。

[0083] (3) Any one of the aforementioned 7 dimensions can be randomly selected to construct a binary tree: a. Exemplarily, the second dimension can be selected : 。

[0084] b. Find the current maximum and minimum values in this dimension. Assume that the maximum value in this dimension is 80%, and the minimum value in this dimension is 2%. And, the normalized value of the maximum value = 80% is +1, and the normalized value of the minimum value 2% is -1.

[0085] c. Randomly select any value from this column of data, and assume that the standard normalization result of the randomly selected value is 0.3: 。

[0086] d. Use the standard normalization result 0.3 of the randomly selected value in step c to divide the aforementioned randomly selected 256 samples into left and right subtrees. Specifically, the samples corresponding to with a standard normalization result less than 0.3 among the 256 samples can be assigned to the left subtree, and the samples corresponding to with a standard normalization result greater than or equal to 0.3 among the 256 samples can be assigned to the right subtree. Figure 2 is a binary structure diagram of an isolation tree showing an exemplary embodiment according to the present disclosure. Refer to Figure 2 , among 256 samples, 230 samples are assigned to the left subtree, and 26 samples among 256 samples are assigned to the right subtree.

[0087] e. The left and right subtrees shown in Figure 2 can continue to be used for binary tree construction. Exemplarily, taking the left subtree shown in Figure 2 as an example for illustration.

[0088] Refer to Figure 2 , Figure 2 The left subtree in contains a total of 230 samples. Assume that the fifth dimension is randomly selected here The maximum and minimum values of the standard normalization results are 0.7 and -0.1 respectively. Then, any value can be randomly selected from the data in this column of these 230 samples, and it is assumed that the standard normalization result of the randomly selected value is 0.5, that is, it is assumed that the binary tree splitting value is 0.5. At this time, referring to 215 of the 230 samples are assigned to the left subtree, and 15 of the 230 samples are assigned to the right subtree. Figure 2 And so on, multiple levels of subtrees can continue to be constructed downward. Referring to

[0089] Sample (SampleXm) has a total of 3 parent nodes when counted upward, so the depth of sample (SampleXm) in this tree is e = 3. Figure 2 f. The binary tree construction process stops until the number of samples in the final subtree is 1 or the depth of the tree exceeds the maximum depth of this isolated tree

[0090] Exemplarily, as described above, the maximum depth of this isolated tree calculated in step (2) = 13. At this time, this isolated tree has been constructed. g. Similarly, several other isolated trees can be constructed according to the above steps a - f. The specific construction process is referred to the previous text and will not be elaborated here. Exemplarily, it is assumed that a total of 100 isolated trees are constructed.

[0091] Up to this point, the several isolated trees constructed above, such as 100 isolated trees, form an isolated forest model.

[0092] It should be noted that the memory required for the isolated forest model is actually very small, and its occupied space size can be calculated by the following formula:

[0093] Among them, m refers to the total number of samples in each isolated tree. As described above, m can be taken as 256; N refers to the number of isolated trees in the isolated forest. As described above, N can be taken as 100; b refers to the number of bytes occupied by the node value, and b can be taken as 4S.

[0094] Thus, if you want to store the above isolated forest model, only

[0095] storage space is required. (III). Online prediction of the path length of the APP currently running in the foreground

[0096] ​After obtaining the application behavior feature data of the currently foreground-running APP through on-device sampling, standard normalization processing can be performed on the collected application behavior feature data first, and its calculation formula can be as follows:

[0097] Wherein, represents the value after performing standard normalization processing on the collected application behavior feature data, represents the maximum value of the sample data under each dimension among the 7 dimensions included in the training sample set, that is, the maximum value among the sample data in each column of the 7-column sample data , represents the minimum value of the sample data under each dimension among the 7 dimensions included in the training sample set, that is, the minimum value among the sample data in each column of the 7-column sample data , max = +1, min = -1. In this way, the values of the application behavior feature data of the currently foreground-running APP sampled on-device after standard normalization processing will all fall within [-1, +1].

[0098] It should be noted that the path lengths of the currently foreground-running APP in each isolation tree can be calculated in parallel, and the calculation speed can be extremely fast. For example, it can reach the millisecond level. Next, the calculation process of the path length of the currently foreground-running APP in a single isolation tree will be specifically described, and the calculation processes of the path lengths of the currently foreground-running APP in several other isolation trees are similar to each other.

[0099] (1) Traverse the root node of the isolation tree to query the segmentation information of the trained isolation tree.

[0100] Specifically, as Figure 2 shown, Figure 2 the first-level segmentation dimension of the isolation tree shown in is the 2nd dimension, that is

[0101] and its segmentation value is 0.3. That is, cols = 2, val = 0.3.

[0102] (2) If the current root node still has subtrees, then judge the size relationship between the application behavior feature data of the currently foreground-running APP collected and the binary tree segmentation value.

[0102] Specifically, if the standard normalization result of the value of the currently foreground-running APP in the 2nd dimension is less than the segmentation value 0.3, that is , then the left subtree can be traversed continuously; If the value of the currently foreground-running APP in the 2nd dimension The standard normalization result of the value of is greater than or equal to the segmentation value 0.3, that is

[0103] (3) Continue to traverse the left and right subtrees at the next depth level until reaching the leaf node, that is, there is no next-level subtree, or until reaching the maximum depth H of the tree, and calculate the path length of the APP currently running in the foreground at this time:

[0104] Among them, e is the number of edges experienced by the APP currently running in the foreground during the process from the root node of the isolated tree to the final node, that is, the tree depth; represents the average path length of constructing a binary tree with n samples, and its calculation formula can be as follows:

[0105] Among them, n represents the remaining number of samples of the nodes at the current layer.

[0106] Exemplarily, as Figure 2 shown, the sample (Sample Xm) belongs to the leaf node, and there are a total of 3 parent nodes above this leaf node. Therefore, the depth e of this leaf node is 3. In addition, this leaf node only contains one sample, that is, the remaining number of samples of this leaf node is 1. Therefore, at this time .

[0107] Or, assume e = 13 and n = 26, then at this time (4) Similarly, the path length of the APP currently running in the foreground on other isolated trees can be calculated using a similar method as described above, and the path lengths of the APP currently running in the foreground on all isolated trees can be accumulated and averaged. Exemplarily, as described above, assume that there are a total of 100 isolated trees, then the average path length can be calculated as follows:

[0108] Among them, represents the average value of the path lengths of the APP currently running in the foreground on all isolated trees, represents the path length of the APP currently running in the foreground on the i-th isolated tree, represents the total number of isolated trees.

[0109] (4) Determine whether the APP currently running in the foreground is an abnormal APP, that is, whether there is indeed abnormal CPU scheduling.

[0110] (1) Calculate the abnormal score of the APP currently running in the foreground, and its calculation formula can be as follows:

[0111] Among them, m represents the total number of samples of each isolated tree. As mentioned above, m can be taken as 256. In this way, the anomaly score value of the APP currently running in the foreground can be calculated. It should be noted that, generally, the anomaly score value is between [0, 1], and the larger the value, the more anomalous it represents.

[0112] (2) Calculate the anomaly score threshold in advance.

[0113] Each sample in the training sample set can be substituted into the above anomaly score calculation formula in advance, and then the anomaly score value of each sample can be obtained respectively:

[0114] Among them, represents the i-th sample in the training sample set, ) represents the average value of the path lengths of the i-th sample on all isolated trees.

[0115] Assume that the training sample set contains a total of 8092 samples, then 8092 anomaly score values will be generated, that is, the anomaly score value set can be obtained:

[0116] Furthermore, the 8092 anomaly score values can be sorted in descending order, and the 5%-th anomaly score value starting from the beginning in the sorting result can be taken as the anomaly score threshold Outlier:

[0117] As mentioned above, the training sample set can contain a total of 8092 samples, then Outlier can be the anomaly score value score corresponding to the 410-th sample among the 8092 samples:

[0118] It should be noted that if the anomaly score of the APP is less than 0.5, it can be determined as normal. Therefore, it can be defined that outlier is greater than or equal to 0.7. Figure 3 is a contour distribution diagram showing the anomaly scores of the training samples according to an exemplary embodiment of the present disclosure. Refer to Figure 3, the training sample obviously falls into two dark areas, area A and area B. Area A is the Not Outlier area, that is, the non-abnormal area, and area B is the Outlier area, that is, the abnormal area. In general, samples with the following characteristics tend to appear in the Outlier area: high current, high CPU usage, low GPU usage, high Prime CPU usage, low Gold CPU usage, and low FPS.

[0119] (3) Determine whether the APP currently running in the foreground is an Abnormal APP. The judgment method is:

[0120] For example, assume that the abnormal score of the app currently running in the foreground is , , then it can be determined that the APP currently running in the foreground is an outlier APP, that is, it can be determined that the APP currently running in the foreground does have abnormal CPU scheduling; or, assuming that the abnormal score of the APP currently running in the foreground is , , then it can be determined that the APP currently running in the foreground is not an OutlierAPP, that is, it can be determined that there is no abnormal CPU scheduling for the APP currently running in the foreground.

[0121] Furthermore, as mentioned above, if the preset isolation forest model predicts the APP currently running in the foreground as an Outlier APP for three consecutive times, it can be directly determined that the APP currently running in the foreground does have abnormal CPU scheduling, that is, there is still room for improvement for the APP currently running in the foreground.

[0122] In step 105, when it is determined that the candidate abnormal application is the target abnormal application, the CPU occupancy of the target abnormal application may be regulated.

[0123] It should be noted that CGroup (Control Group) is a kernel feature that is used to limit, count, and isolate the resources of a group of processes (for example, CPU, memory, disk, network, etc.). By using CGroup, you can finely control the allocation, sorting, rejection, management, and monitoring of system resources at the Framework level. In addition, hardware resources can be intelligently allocated between applications and users, thereby increasing overall efficiency.

[0124] The uclamp feature supported by CGroup, also known as CPU util clamp, is a scheduler feature that allows the user space to help manage the performance requirements of tasks. At the same time, it is also a hint mechanism that can inform the scheduler of the performance requirements and limitations of tasks, so it helps the scheduler make better decisions. That is to say, through the uclamp utilization rate, the system can be controlled to run at a certain performance point.

[0125] Specifically, it can consist of two adjustable parameters, namely: "Set lower limit (UCLAMP_MIN)" and "Set upper limit (UCLAMP_MAX)". These two boundaries will ensure that tasks run within the performance range of the system. Among them, "UCLAMP_MIN" means promoting tasks, while "UCLAMP_MAX" means restricting tasks. In this disclosure, mainly aiming to solve the high power consumption problem of abnormal APPs, so the adjustable parameter can be only "UCLAMP_MAX", that is, the adjustable parameter can default to the maximum value.

[0126] It should be noted that in Android, uclamp can be used to limit the amount of resources consumed by tasks, which helps to limit the power they consume. This is more obvious in heterogeneous systems (e.g., Sliver / Gold / Titanium / Prime). This constraint will help keep tasks preferably running on the Prime Core occupancy, thus ensuring that they do not run on power-hungry cores too much and cause the battery to run out of power.

[0127] However, it should be pointed out that foreground applications are tasks that the user is currently interacting with, so they are the most important tasks in the system and often need to be able to run immediately on large cores to improve the execution speed. Therefore, excessive restrictions will affect the performance of foreground APPs. In this way, although it has been determined that the current APP is an Outlier APP, it is still necessary to ensure that when it is busy, it has the opportunity to run on the Prime Core to ensure smoothness, and thus not reduce the user experience. This means that an appropriate uclamp value is very important. Specifically, in this disclosure, the initial value of the CPU utilization rate (uclamp) can be set, and then CPU Utilization flow control can be performed based on the initial value of uclamp, that is, uclamp can be dynamically adjusted based on the initial value of uclamp to control the CPU occupancy of a specific application.

[0128] According to an exemplary embodiment of the present disclosure, the CPU occupancy of a target abnormal application can be regulated by adjusting the CPU usage rate of the target abnormal application. Specifically, the CPU usage rate of a specific application can be automatically flow-controlled by collecting the current system performance-power consumption status through timed sampling by a reinforcement learning model (Sarsa-Learning model), and then the optimal uclamp value can be found.

[0129] It should be noted that the unit of uclamp is percentage, and the adjustment of the uclamp of the current Outlier APP can be achieved through the following command: echo uclamp> / dev / cpuctl / top-APP / cpu.uclamp.max In the present disclosure, the initial value of uclamp can be set to 100%. That is, by default, uclamp is unrestricted at the beginning, and the initial value of uclamp of 100% can be used as the initial state parameter for the Sarsa-Learning model to learn.

[0130] In this way, by dynamically adjusting uclamp for CPU scheduling control, that is, by restricting cpu.uclamp.max to reduce the usage rate migrating to the high-power Prime Core per unit time, the power consumption can be greatly reduced. And although the load of the Outlier APP does not change at this time, if the Gold Core and Sliver Core can also meet the performance requirements for most of the time, then the reduced power consumption is very meaningful.

[0131] According to an exemplary embodiment of the present disclosure, the initial CPU usage rate of the target abnormal application can be set. Exemplarily, as described above, the initial value of the CPU usage rate of the target abnormal application can be set to 100%. Then, the power consumption data and / or performance data of the target abnormal application can be obtained. Next, based on the power consumption data and / or performance data through the reinforcement learning model, the CPU usage rate of the target abnormal application can be adjusted on the basis of the initial CPU usage rate. Then, based on the adjusted CPU usage rate, the CPU occupancy can be regulated. It should be noted that "regulating the CPU occupancy" can specifically refer to which CPUs are allocated to the APP currently running in the foreground and how long it runs on each allocated CPU, etc.

[0132] According to an exemplary embodiment of the present disclosure, the above-mentioned "power consumption data" can be, but is not limited to: the average system current; the above-mentioned "performance data" can be, but is not limited to: the average frame drop rate of the target abnormal application.

[0133] It should be noted that the optimal uclamp value of the APP needs to be adjusted even offline. However, the characteristics of different APPs are different from each other, and even the same APP may be different in different scenarios. Therefore, using a unified uclamp value will cause the following problems: too small a uclamp may lead to frequent frame drops; too large a uclamp may not result in power consumption benefits. Moreover, the same uclamp value may produce different results for different APPs. For example, for some APPs, the uclamp value can be set to 85%. At this time, it may be possible to reduce power consumption by 50% with almost no increase in the frame drop rate. However, for other APPs, if the uclamp value is set to 85%, the power consumption may be reduced by 60%, but at the same time, the frame drop rate may also increase by 5%. From the user's perspective, too many frame drops, that is, too many stuttering occurrences, will have a greater impact on the user experience. At this time, it is necessary to increase the uclamp to ensure smoothness. For example, it may be necessary to increase the uclamp to 90%.

[0134] Therefore, finding the optimal uclamp that can better balance power consumption gain and performance for different Outlier APPs is the flow control problem that this disclosure aims to solve. Moreover, this disclosure can perform uclamp flow control using the following two characteristic data: system average current ( : Average Current) and average frame drop rate ( :Average Frame Drop Rate). It should be noted that Janky frames can be used to represent the number of times a frame time exceeds 16.67 ms. Due to the Tripple buffering mechanism in Android Surface Flinger, in fact, most of the timeout frames do not cause real stuttering, that is, the user actually does not feel stuttering, but it does reflect the change in frame drawing time. Therefore, the following formula can be used for conversion to estimate the change in the frame drop rate:

[0135] Next, the reinforcement learning process of the Sarsa-Learning model will be specifically described.

[0136] When training the Sarsa-Learning model, the "input of the model" can be: when uclamp regulation is enabled, sample the before and after regulation and to form a state set of average current gain and average frame drop rate gain; The "training process of the model" can be as follows: According to the Sarsa Learning model, an action A (for example, increasing or decreasing uclamp) is selected in the current state S to affect the environment and generate a new state, and the penalty Q value corresponding to the action A can be calculated based on the penalty R value corresponding to the new state; The "output of the model" can be: According to the state table S, action A, and corresponding penalty Q that have been calculated in the Sarsa Learning model, a suitable and safe uclamp can be directly selected, that is, whether uclamp should be increased, decreased, or kept unchanged based on the initial value of uclamp.

[0137] First, a SARSA-Learning training model can be established. Among them, the process of establishing the SARSA-Learning training model can include 6 parts, namely: 1. State definition; 2. Action definition A; 3. Single-step reward (or single-step penalty) R; 4. Discounted action value function Q; 5. Iterative training process; 6. Policy function.

[0138] 1. State definition: First, it is necessary to sample the environment to obtain the current reference environment of the terminal. In addition, the "environment" here can mainly be characterized by the average current and the average dropped frame rate These two features. Assume that the average current before entering the uclamp adjustment is curr1, the average dropped frame rate is jank1, and the sampling period is 5s.

[0139] Assume that the target average current to be achieved , and the target average dropped frame rate to be achieved , where p and q are proportionality coefficients, and p < 1, q >= 1. And assume that the average current after sampling after entering the uclamp adjustment is curr, and the average dropped frame rate is jank. The average current curr after sampling after entering the uclamp adjustment can be referenced by the target average current curr2 and the average current curr1 of the terminal pre-sampling before entering the uclamp adjustment. Since p < 1, curr2 < curr1. In addition, fcurr can be set as the current factor, and fjank can be set as the smoothness factor.

[0140] The factor levels of the features can be defined, that is:

[0141]

[0142] In the present disclosure, the segmented size of the current can be set , and then the current can be segmented based on this segmentation size. The current factor fcurr can be defined in 5 levels, and the smaller the current factor fcurr, the greater the current benefit. Exemplarily, the correspondence between the current factor fcurr and the current can be as follows:

[0143] In addition, the average frame drop rate jank sampled after entering the uclamp adjustment can be based on the target average frame drop rate and the average frame drop rate jank1 sampled before entering the uclamp adjustment as a reference. Since q >= 1, therefore, jank1 jank2.

[0144] In the present disclosure, it is assumed that the segmentation size of the frame drop rate is: , and then the frame drop rate can be segmented based on this segmentation size. Here, the frame drop rate factor can be defined in 5 levels, and the frame drop rate factor is smaller, indicating that the frame drop rate benefit is greater. Exemplarily, the correspondence between the frame drop rate factor and the frame drop rate can be as follows:

[0145] In this way, the state S can be defined, that is:

[0146] For example, when, the state S is S(0, 1). It should be noted that the frame drop rate factor fjank mainly serves as an inhibition factor to balance the power consumption of Outlier APP while obtaining benefits and ensuring performance smoothness.

[0147] When regulating uclamp, the current can be reduced by approximately 50%, so the previous can be defined; for the frame drop rate, generally the worst allowable increase is 2%, so the previous can be defined. Therefore, the maximum reduction of current consumption by 50% and the maximum increase of the frame drop rate by 2% can be used as the regulation target.

[0148] Taking a certain third-party APP as an example, assume: , then there are: ; ; ; .

[0149] It should be noted that when determining the current state before initially adjusting uclamp, since the adjustment of uclamp has not started yet, it can be considered that = , = 。Since at this time 's value falls within this interval, it can be determined that in the current state, that is, before initially adjusting uclamp =2. Since at this time 's value falls within this interval, it can be determined that in the current state, that is, before initially adjusting uclamp =0. Therefore, the current state of the terminal is: Assume that after adjusting uclamp, the current curr = 500 mA, and the frame drop rate 。Then at this time: Since = 800 mA - , ,therefore: curr = 500 mA At this time, based on the correspondence between the aforementioned current factor fcurr and the current, it can be known that: after this adjustment of uclamp, fcurr = 。

[0150] And, since , ,therefore:

[0151] At this time, based on the correspondence between the aforementioned frame drop rate factor and the frame drop rate, it can be known that: after this adjustment of uclamp, = 。

[0152] Therefore, the state of the terminal after this adjustment of uclamp is:

[0153] 2. Action Definition A In the present disclosure, the actually controllable strategy is the uclamp percentage. Here, 3 actions can be defined, that is, the uclamp percentage can be increased or decreased in units of 5%, or the uclamp percentage can be kept unchanged:

[0154] In the present disclosure, the value range of uclamp can be [60%, 100%].

[0155] 3. Single-step reward (or single-step penalty) R In the present disclosure, a minimum penalty value function can be adopted, taking into account both the current and the change in frame drop rate, and adding some prior information. Therefore, the single-step penalty can be defined in a table as Figure 4 . Figure 4 is a schematic diagram showing the R table of the Sarsa Learning model according to an exemplary embodiment of the present disclosure. Referring to Figure 4 , in a certain state , there can be a preset penalty value corresponding to it. Exemplarily, R(0, 0) = 0; R(4, 3) = 10; R(4, 4) = 14.

[0156] It should be noted that when the frame drop rate is relatively large, for example, fjank = 3, 4, no matter how much the current decreases, its penalty value R is relatively high; in the case of a constant frame drop rate, the penalty value R can be gradually increased according to the increase in current.

[0157] As described above, before the initial adjustment of uclamp at the beginning, the terminal is in the initial state S(2, 0), and the corresponding single-step penalty value is R(S(2, 0)) = R(2, 0) = 2, indicating that the optimization adjustment of uclamp can still be continued.

[0158] 4. Discounted action value function Q The definition of Q is: , the Q table can be initialized as a matrix of all zeros. In each state , there are 3 actions (Actions) corresponding to it, and each action corresponds to a discounted value, that is, the state-action penalty value. Exemplarily, Q(0, 0, 0) = 0.

[0159] The purpose of learning is to continuously calculate the Q value corresponding to the state during actual testing until the convergence state is reached, that is, until the floating range of the discounted value in each grid is within the preset range. Since the number of our states and actions is not large, it is possible to approach the convergence state in a relatively short time. After the Q table learning is completed, during actual use, it can be used to guide the adjustment of uclamp until the optimal uclamp is found.

[0160] 5. Iterative training process The SARSA-Learning iterative update formula of this model can be expressed as:

[0161] Among them, represents the current sampling state; A represents the action taken, a is the learning rate, and r is the discount factor; represents the new state reached after taking action A in state S; represents the action selected in the new state; is the single-step reward (single-step reward, single-step penalty) obtained for reaching the new state; Q(S, A) is the return value of taking this action in the current state.

[0162] Assume a = 0.2 and r = 0.7. As mentioned before, the state of the terminal before the initial adjustment of uclamp is S(2, 0), and uclamp = 100%.

[0163] Assume that in this state S(2, 0), action A is selected 5 times and different states are reached respectively. Figure 5 is a schematic diagram showing the state transition of Sarsa Learning (S, A) according to an exemplary embodiment of the present disclosure.

[0164] The following Q values can be calculated respectively: At the initial state S(2, 0), after executing action A = 1, the new state is reached, and the next action is also , then:

[0165]

[0166] In state S(1, 1), after executing action A = 1, the new state is reached, and the next action is also , then:

[0167]

[0168] In state S(0, 1), after executing action A = 1, the new state is reached, and the next action is , then:

[0169]

[0170] In state S(0, 2), after executing action A = 0, the new state is reached, and the next action is , then:

[0171]

[0172] After the above 5 actions, , the data in the Q-table has been updated. Figure 6 is a schematic diagram showing the Q-table updated by Sarsa Learning according to an exemplary embodiment of the present disclosure. Refer to Figure 6 , at this time, the value of is updated from 0 to 0.4; the value of is updated from 0 to 0.2;

[0173] And so on. After continuous iterative updates, the above Q-table data will be gradually filled and iteratively converge, that is, the data changes very little, that is, a final state-action penalty value will be converged under each state-action Q(S, A). 6. Policy function The policy function here is used to guide how to select the next action type when the Q-table after a period of training reaches a new state, that is, to explore how to obtain the optimal training result. The policy function used here should be both exploratory and greedy.

[0174] It should be noted that the ε-greedy method can be used to generate a random number p:

[0175] Assume a threshold of ε, then: When <= ε, the selected action type A can be the optimal action, that is, the action type with the smallest corresponding state-action penalty value; When > ε, a random action type A can be selected for exploration.

[0176] Exemplarily, assume that the Q-values in the S(1,1) state after a period of training are as Figure 10 shown. Figure 7 is a schematic diagram showing the Q-values in the S(1,1) state according to an exemplary embodiment of the present disclosure. Refer to Figure 7 , the Q-values (state-action penalty values) in the S(1,1) state altogether include 3, which are 0.15, 0.35, and 0.25 respectively.

[0177] When entering this state S(1, 1) again during training, assuming ε = 0.2, a random number is taken If p = 0.1, since p = 0.1 <= ε = 0.2, therefore, the action type with the smallest state-action penalty value can be selected, that is, the action type A = 0 with a corresponding state-action penalty value of 0.15 can be selected; If p = 0.4, since p = 0.4 > ε = 0.2, therefore, an action type can be randomly selected, that is A , that is, an action type can be randomly selected from the 3 action types [0, 1, 2].

[0178] It should be noted that it can be set that when the training iterates to a certain extent, a strategy of <= ε can be directly adopted , that is, directly adopt the action type with the smallest state-action penalty value, that is, directly adopt the corresponding action type.

[0179] According to the exemplary embodiments of the present disclosure, uclamp can be adjusted based on the power consumption data and performance data of the terminal and the preset state-action table of the reinforcement learning model to find the optimal uclamp. Among them, the preset state-action table, that is, the Q table, can include multiple states , and each state can correspond to multiple CPU usage rate adjustment action types. Exemplarily, each state can correspond to 3 CPU usage rate adjustment actions, which are: 0 (maintain the CPU usage rate), 1 (reduce the CPU usage rate downward), 2 (increase the CPU usage rate upward). Each CPU usage rate adjustment action type can correspond to its own state-action penalty value (Q value).

[0180] Exemplarily, as described above, the state of the terminal before the initial adjustment of the CPU usage rate value is S(2, 0), the CPU usage rate value before the initial adjustment is 100%, and the average sampling current of the terminal before the initial adjustment is , and the average frame drop rate of the terminal before the initial adjustment is jank1.

[0181] First, based on the initial state S(2, 0) at the beginning and the trained Q table, the action type with the smallest state-action penalty value corresponding to the 3 action types in the trained Q table with state = S(2, 0) can be found. Assuming that the action type with the smallest corresponding state-action penalty value is 1, that is, "reduce the CPU usage rate value downward", then the CPU usage rate value can be adjusted downward based on uclamp = 100% according to this action type 1.

[0182] Then, the average sampling current curr and the average frame drop rate jank of the terminal after this uclamp adjustment can be obtained. Furthermore, based on the average sampling current of the terminal before the initial adjustment , the average frame drop rate jank1 of the terminal before the initial adjustment, the average sampling current curr of the terminal after this CPU usage value adjustment, the average frame drop rate jank of the terminal after this CPU usage value adjustment, the correspondence between the current factor fcurr and the current curr, and the frame drop rate factor and the correspondence between the frame drop rate jank, determine the state of the terminal after this CPU usage value adjustment ( , ).

[0183] Next, based on the state and the trained Q-table, find the action type with the smallest corresponding state-action penalty value (Q-value) among the 3 action types in the trained Q-table for the state . Assume that the action type with the smallest corresponding state-action penalty value is 1, that is, "lower the CPU usage value". Then, according to this action type 1, continue to lower the CPU usage value on the basis of the current uclamp value. In this way, the state of the terminal after this CPU usage value adjustment (fcurr, fjank) can be determined.

[0184] And so on, until based on the current state of the terminal (fcurr, fjank) and the trained Q-table, the action type with the smallest corresponding state-action penalty value among the 3 action types in the trained Q-table for the current state (fcurr, fjank) is "maintain the CPU usage unchanged". At this time, the obtained CPU usage value is the optimal CPU usage value that balances the terminal power consumption and the terminal performance.

[0185] In this way, since the preset state-action table of the reinforcement learning model records the state-action penalty values corresponding to each action type in each of the multiple states, it is only necessary to query the trained Q-table using the state where the terminal is currently located to find the best action to be executed in the current state. Moreover, the optimal CPU usage value that balances the power consumption and performance of the terminal can be found through a finite number of queries, without the need for manual online parameter adjustment and setting on the server side. That is, the present disclosure can achieve smooth flow control for the Primary Core migration of the APP, and thus can greatly improve the high power consumption and high heat generation phenomena caused by abnormal CPU scheduling of the APP. Furthermore, by regulating the CPU occupancy based on the optimal CPU usage value, while significantly reducing the power consumption of the terminal, the performance of the application can also be ensured to be unaffected, that is, a smooth viewing experience can be guaranteed and the phenomenon of terminal freezing can be avoided.

[0186] According to an exemplary embodiment of the present disclosure, after regulating the CPU occupancy of the target abnormal application, the application behavior feature data of the specific application obtained can also be added to the original sample feature set corresponding to the preset artificial intelligence model to obtain a new sample feature set. Next, based on the new sample feature set, a private artificial intelligence model corresponding to the specific application can be generated. In this way, subsequently, the private artificial intelligence model of the specific application can be used to determine whether there is indeed abnormal CPU scheduling for the specific application.

[0187] It should be noted that in the foregoing step 104, the isolated tree path length is predicted based on a pre-trained isolated forest model. However, in an actual scenario, the matching degree between the training sample data of the preset isolated forest model and the characteristics of the specific application currently running in the foreground may be very low. For example, the base current of the specific application may generally be much higher than that of the training samples. At this time, directly predicting whether there is indeed abnormal CPU scheduling for the specific application based on the preset isolated forest model is likely to result in misjudgment, and thus unnecessary learning optimization may be performed.

[0188] To solve the above problems, in the present disclosure, the application behavior feature data of a specific application can be added to the original sample feature set corresponding to a preset isolation forest model to obtain a new sample feature set, that is, the application behavior feature data of a specific application can be added on-device to the basic isolation forest model to train a private isolation forest model exclusive to the specific application. Exemplarily, when a certain number of application behavior feature data of a specific application are collected, for example, 512 / 1024 groups of application behavior feature data, these application behavior feature data can be merged into the original training sample set of the preset isolation forest model to regenerate the private isolation forest model corresponding to the specific application. Moreover, each time sample data is selected from the new sample set to construct an isolation tree, the selected sample data needs to include the sample data of the specific application. In this way, the phenomenon of misjudgment can be avoided, that is, the prediction accuracy of the isolation forest model can be guaranteed. In addition, the training process of the private isolation forest model specifically refers to the foregoing, and will not be elaborated here.

[0189] It should be noted that if it is determined based on the currently collected application behavior feature data that a specific application does have abnormal CPU scheduling, it means that the currently collected application behavior feature data sample is an outlier sample. When adding new samples to the original sample feature set corresponding to the preset isolation forest model, the number of outlier samples generally does not exceed 5%.

[0190] Suppose the preset isolation forest model, that is, the basic model, has 12288 samples, then the space size of its samples is also very small:

[0191] As mentioned above, the space size used to generate an isolation forest model is 600KB:

[0192] Therefore, there is not much space pressure to save a private isolation forest model for each APP separately.

[0193] In this way, through the above 5 steps, it is possible to achieve CPU flow control for a specific application by adaptively adjusting uclamp without manual intervention. From the experimental results, the power consumption can generally be improved by 30% - 50% while ensuring the performance remains basically unchanged, and the problems of short battery life and overheating of the mobile phone that may occur subsequently can be avoided. Figure 8 is a schematic diagram showing the change in current before and after improvement in the actual test scenario according to an exemplary embodiment of the present disclosure. Referring to Figure 8 , the current consumption is reduced from 850mA before improvement to 320mA after improvement.

[0194] Thus, in the present disclosure, after the terminal is powered on, if it is detected that a 3rd APP is running in the foreground, the battery behavior characteristic data can be collected at regular intervals, and the 3rd APP can be preliminarily screened and the main thread load transition detected based on the collected battery behavior characteristic data. In the case where it is preliminarily determined that the 3rd APP has abnormal CPU scheduling, it can be predicted whether there is indeed abnormal CPU scheduling through an isolation forest model. In the case where it is determined that the 3rd APP indeed has abnormal CPU scheduling, the CPU usage rate (CPU clamp value) of the 3rd APP can be automatically controlled through a reinforcement learning model, and then the optimal uclamp value can be found. Then, based on the optimal uclamp value, the CPU occupancy of the 3rd APP can be regulated, and a better balance can be achieved between power consumption and performance.

[0195] Figure 9 FIG. 6 is a block diagram showing an application program running control device 900 according to an exemplary embodiment of the present disclosure.

[0196] Referring to Figure 9 , the application program running control device 900 may include a battery behavior acquisition module 901, a candidate abnormal application program determination module 902, an application behavior acquisition module 903, a target abnormal application program determination module 904, and a regulation module 905.

[0197] The battery behavior acquisition module 901 can acquire the battery behavior characteristic data of the electronic device in response to monitoring that a specific application program of the electronic device enters the foreground running state, where the specific application program can be any application program other than the system application program in the electronic device.

[0198] Exemplarily, a system service can be created at startup to monitor the switching of foreground APPs. When the APP running in the foreground is not a system APP, the battery behavior characteristic data can be sampled, that is, when the APP running in the foreground is a third-party APP (i.e., 3rd APP), the battery behavior characteristic data can be sampled.

[0199] According to an exemplary embodiment of the present disclosure, the above-mentioned "battery behavior characteristic data" may include, but is not limited to, at least one of the following items, as long as any characteristic data that can reflect the battery behavior can be used: (1) The total CPU occupancy rate of a specific application program, (2) The total GPU occupancy rate of the system, (3) The system current, (4) The total CPU occupancy rate of background running application programs, (5) The occupancy rate of a specific application program on the super core CPU, (6) The temperature change characteristic, (7) The total CPU occupancy rate of the system camera service.

[0200] When the battery behavior characteristic data meets the preset limit condition, the candidate abnormal application determination module 902 can determine a specific application as a candidate abnormal application, where the abnormality may refer to an abnormal CPU scheduling of the application.

[0201] According to an exemplary embodiment of the present disclosure, when the battery behavior characteristic data meets the first preset limit condition, the candidate abnormal application determination module 902 can perform UI main thread load detection on a specific application and can determine the change value of part of the battery behavior characteristic data. When the change value meets the second preset limit condition, the candidate abnormal application determination module 902 can determine the specific application as a candidate abnormal application. That is, in the present disclosure, the first limit condition can be used to perform a preliminary screening on a specific application currently running in the foreground. When the specific application currently running in the foreground meets the first limit condition, the main thread load detection can be performed on it. If it still meets the second limit condition, the subsequent process can be carried out.

[0202] According to an exemplary embodiment of the present disclosure, the above battery behavior characteristic data can include multiple. The candidate abnormal application determination module 902 can respectively determine whether each battery behavior characteristic data in the multiple battery behavior characteristic data meets its respective first limit condition. Exemplarily, the candidate abnormal application determination module 902 can respectively determine whether each battery behavior characteristic data in the multiple battery behavior characteristic data meets its respective set threshold. When each battery behavior characteristic data meets its respective first limit condition, that is, when each battery behavior characteristic data meets its respective set threshold, the candidate abnormal application determination module 902 can respectively determine whether a part of the battery behavior characteristic data in each battery behavior characteristic data meets its respective second limit condition. Exemplarily, the candidate abnormal application determination module 902 can respectively determine whether the change of a part of the battery behavior characteristic data in each battery behavior characteristic data meets its respective set threshold. The above "part of the battery behavior characteristic data" can be part of the battery behavior characteristic data among the foregoing multiple battery behavior characteristic data.

[0203] The application behavior acquisition module 903 can acquire the application behavior characteristic data of the foregoing candidate abnormal application.

[0204] According to an exemplary embodiment of the present disclosure, the foregoing "application behavior characteristic data" can include at least one of the following items, as long as it is characteristic data that can reflect the application behavior: Parameter (1): Total CPU occupancy rate of the candidate abnormal application, Parameter (2): Total system GPU occupancy rate, Parameter (3): System current, Parameter (4): Frame rate of the candidate abnormal application, Parameter (5): Occupancy rate of the candidate abnormal application on the large-core CPU, Parameter (6): Occupancy rate of the candidate abnormal application on the small-core CPU, Parameter (7): Occupancy rate of the candidate abnormal application on the big-core CPU.

[0205] The target abnormal application determination module 904 can determine whether the aforementioned candidate abnormal application is a target abnormal application based on the above application behavior characteristic data through a preset artificial intelligence model. That is, the target abnormal application determination module 904 can substitute the application behavior characteristic data collected by timed sampling into the trained artificial intelligence model to predict whether the specific application currently running in the foreground is an APP with abnormal CPU scheduling. If it is determined that the specific application currently running in the foreground does have abnormal CPU scheduling, subsequent processes can be executed.

[0206] According to an exemplary embodiment of the present disclosure, the above preset artificial intelligence model can be a preset isolation forest model.

[0207] When the regulation module 905 determines that the aforementioned candidate abnormal application is a target abnormal application, it can regulate the CPU occupancy of the target abnormal application. Specifically, the initial value of the CPU usage rate (uclamp) can be set, and then CPU Utilization flow control can be performed based on the uclamp initial value, that is, uclamp can be dynamically adjusted based on the uclamp initial value to regulate the CPU occupancy of a specific application.

[0208] According to an exemplary embodiment of the present disclosure, the regulation module 905 can regulate the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application. Specifically, the current system performance-power consumption status can be collected by timed sampling through a reinforcement learning model (Sarsa-Learning model) to automatically control the CPU usage rate of a specific application, and then the optimal uclamp value can be found.

[0209] According to an exemplary embodiment of the present disclosure, the regulation module 905 may set the initial CPU usage rate of the target abnormal application. Exemplarily, as described above, the initial value of the CPU usage rate of the target abnormal application may be set to 100%. Then, the regulation module 905 may obtain the power consumption data and / or performance data of the target abnormal application. Next, the regulation module 905 may adjust the CPU usage rate of the target abnormal application based on the power consumption data and / or performance data through a reinforcement learning model on the basis of the initial CPU usage rate. Then, the regulation module 905 may regulate the CPU occupancy based on the adjusted CPU usage rate. It should be noted that "regulating the CPU occupancy" may specifically refer to which CPUs are allocated to the APP currently running in the foreground and the length of the running time on each allocated CPU, etc.

[0210] According to an exemplary embodiment of the present disclosure, the above-mentioned "power consumption data" may be, but is not limited to, the average system current; the above-mentioned "performance data" may be, but is not limited to, the average frame drop rate of the target abnormal application.

[0211] According to an exemplary embodiment of the present disclosure, the uclamp may be adjusted based on the power consumption data and performance data of the terminal and the preset state-action table of the reinforcement learning model to find the optimal uclamp. The preset state-action table, that is, the Q table, may include multiple states , and each state may correspond to multiple CPU usage rate adjustment action types. Exemplarily, each state may correspond to 3 CPU usage rate adjustment actions, which are: 0 (maintain the CPU usage rate), 1 (downward adjustment of the CPU usage rate), and 2 (upward adjustment of the CPU usage rate). Each CPU usage rate adjustment action type may correspond to its own state-action penalty value (Q value).

[0212] According to an exemplary embodiment of the present disclosure, the above-mentioned operation control device 900 of the application may further include a sample addition module and a model generation module.

[0213] After regulating the CPU occupancy of the target abnormal application, the sample addition module may also add the obtained application behavior feature data of the specific application to the original sample feature set corresponding to the preset artificial intelligence model to obtain a new sample feature set. Next, the model generation module may generate a private artificial intelligence model corresponding to the specific application based on the new sample feature set. In this way, the private artificial intelligence model of the specific application can be used subsequently to determine whether there is indeed abnormal CPU scheduling for the specific application.

[0214] It should be noted that, as mentioned above, the target abnormal application determination module 904 predicts the isolated tree path length based on a pre-trained isolation forest model. However, in an actual scenario, the matching degree between the training sample data of the preset isolation forest model and the characteristics of a specific application currently running in the foreground may be very low. For example, the base current of a specific application may generally be much higher than that of the training samples. At this time, directly predicting whether there is actually an abnormal CPU scheduling for a specific application based on the preset isolation forest model is likely to result in misjudgment, and thus unnecessary learning optimization may be carried out.

[0215] To solve the above problems, in the present disclosure, the application behavior feature data of a specific application can be added to the original sample feature set corresponding to the preset isolation forest model to obtain a new sample feature set, that is, the application behavior feature data of a specific application can be added on-device to the base isolation forest model to train a private isolation forest model exclusive to the specific application. Exemplarily, when a certain amount of application behavior feature data of a specific application is collected, for example, 512 / 1024 groups of application behavior feature data, these application behavior feature data can be merged into the original training sample set of the preset isolation forest model to regenerate the private isolation forest model corresponding to the specific application. In addition, the training process of the private isolation forest model is specifically referred to the foregoing, and will not be elaborated here.

[0216] In this way, in the present disclosure, after the terminal is powered on, if it is detected that a specific application is running in the foreground, the battery behavior feature data can be collected at regular intervals, and the initial screening and main thread load transition detection of the specific application can be performed based on the collected battery behavior feature data. In the case where it is preliminarily determined that there is an abnormal CPU scheduling for the specific application, it can be predicted whether there is actually an abnormal CPU scheduling through the isolation forest model. In the case where it is determined that there is actually an abnormal CPU scheduling for the specific application, the CPU usage rate (CPUclamp value) of the specific application can be automatically controlled through the reinforcement learning model, and then the optimal uclamp value can be found. Then, based on the optimal uclamp value, the CPU occupancy of the specific application can be regulated, and a better balance between power consumption and performance can be achieved.

[0217] According to an exemplary embodiment of the present disclosure, at least one of the foregoing multiple modules can be implemented by an AI model. The functions associated with AI can be executed by a non-volatile memory, a volatile memory, and a processor.

[0218] The processor may include one or more processors. At this time, the one or more processors may be general-purpose processors, such as a central processing unit (CPU), an application processor (AP), etc., a processor dedicated only to graphics (such as a graphics processing unit (GPU), a vision processing unit (VPU)), and / or an AI dedicated processor (such as a neural processing unit (NPU)).

[0219] The one or more processors control the processing of input data according to predefined operation rules or artificial intelligence (AI) models stored in the non-volatile memory and the volatile memory. As an example, the predefined operation rules or artificial intelligence models may be provided through training or learning. Here, being provided through learning means that by applying a learning algorithm to a plurality of learning data, a predefined operation rule or an AI model with desired characteristics is formed. The learning may be performed in the device itself that executes AI according to an embodiment, and / or may be implemented through a separate server / device / system.

[0220] As an example, the artificial intelligence model may be composed of multiple neural network layers. Each layer has a plurality of weight values, and layer operations are performed through the calculations of the previous layer and the operations of the plurality of weight values. Examples of neural networks include, but are not limited to, convolutional neural networks (CNNs), deep neural networks (DNNs), recurrent neural networks (RNNs), restricted Boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), generative adversarial networks (GANs), and deep Q networks.

[0221] A learning algorithm is a method of using a plurality of learning data to train a predetermined target device (e.g., a robot) to enable, allow, or control the target device to make a determination or prediction. Examples of learning algorithms include, but are not limited to, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning.

[0222] Figure 10 FIG. is a block diagram showing an electronic device 1000 according to an exemplary embodiment of the present disclosure.

[0223] Referring to Figure 10 , the electronic device 1000 includes at least one memory 1001 and at least one processor 1002. Instructions are stored in the at least one memory 1001, and when the instructions are executed by the at least one processor 1002, a method for controlling the operation of an application according to an exemplary embodiment of the present disclosure is executed.

[0224] As an example, the electronic device 1000 can be a PC computer, a tablet device, a personal digital assistant, a smart phone, or other devices capable of executing the above instructions. Here, the electronic device 1000 does not have to be a single electronic device, but can also be a collection of devices or circuits that can execute the above instructions (or instruction sets) individually or jointly. The electronic device 1000 can also be a part of an integrated control system or system manager, or can be configured as a portable electronic device that interfaces with a local or remote device (e.g., via wireless transmission).

[0225] In the electronic device 1000, the processor 1002 can include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, the processor can also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and so on.

[0226] The processor 1002 can run instructions or code stored in the memory 1001, where the memory 1001 can also store data. The instructions and data can also be sent and received via a network interface device over a network, where the network interface device can use any known transmission protocol.

[0227] The memory 1001 can be integrated with the processor 1002, for example, by arranging RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 1001 can include a separate device, such as an external disk drive, a storage array, or other storage devices that can be used by any database system. The memory 1001 and the processor 1002 can be operatively coupled or can communicate with each other, for example, via an I / O port, a network connection, etc., such that the processor 1002 can read files stored in the memory.

[0228] In addition, the electronic device 1000 can also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.). All components of the electronic device 1000 can be connected to each other via a bus and / or a network.

[0229] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium may also be provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned running control method of the application program. Examples of the computer-readable storage medium here include: read-only memory (ROM), programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-RLTH, BD-RE, Blu-ray or optical disc memory, hard disk drive (HDD), solid state drive (SSD), cartridge memory (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and provide the computer program and any associated data, data files, and data structures to a processor or computer such that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium may run in an environment deployed in computer devices such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files, and data structures are distributed on a networked computer system such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner by one or more processors or computers.

[0230] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, including a computer program which, when executed by a processor, implements the running control method of the application program according to the present disclosure.

[0231] According to the method, device, electronic device, storage medium and computer program product for controlling the operation of an application according to the present disclosure, after the terminal is powered on, if it is detected that a 3rd APP is running in the foreground, battery behavior characteristic data can be collected at regular intervals, and the 3rd APP can be preliminarily screened and the main thread load transition detected based on the collected battery behavior characteristic data. In the case where it is preliminarily determined that the 3rd APP has abnormal CPU scheduling, it can be predicted whether there is indeed abnormal CPU scheduling through an isolation forest model. In the case where it is determined that the 3rd APP indeed has abnormal CPU scheduling, the CPU usage rate (CPU clamp value) of the 3rd APP can be automatically controlled through a reinforcement learning model, and then the optimal uclamp value can be found. Then, based on the optimal uclamp value, the CPU occupancy of the 3rd APP can be regulated, and a better balance can be achieved between power consumption and performance.

[0232] According to an exemplary embodiment of the present disclosure, the application behavior characteristic data of a specific application collected can also be merged into the original training sample set of a preset isolation forest model to regenerate a private isolation forest model corresponding to the specific application. In this way, the phenomenon of misjudgment can be avoided, that is, the prediction accuracy of the isolation forest model can be ensured.

[0233] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0234] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. A method for controlling the operation of an application, applied to an electronic device, characterized in that, Including: Upon detecting that a specific application of the electronic device enters the foreground running state, obtaining battery behavior characteristic data of the electronic device, where the specific application is any application other than the system application in the electronic device; When the battery behavior characteristic data meets a preset limitation condition, determining the specific application as a candidate abnormal application, where the abnormality refers to a CPU scheduling abnormality of the application; Obtaining application behavior characteristic data of the candidate abnormal application; Based on the application behavior characteristic data, determining whether the candidate abnormal application is a target abnormal application through a preset artificial intelligence model; When determining that the candidate abnormal application is the target abnormal application, regulating the CPU occupancy of the target abnormal application.

2. The operation control method according to claim 1, characterized in that, The step of determining the specific application as a candidate abnormal application when the battery behavior characteristic data meets a preset limitation condition includes: When the battery behavior characteristic data meets a first preset limitation condition, detecting the load of the UI main thread of the specific application and determining the change value of part of the battery behavior characteristic data; When the change value meets a second preset limitation condition, determining the specific application as the candidate abnormal application.

3. The operation control method according to claim 1, wherein, The regulating the CPU occupancy of the target abnormal application includes: Regulating the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application.

4. The operation control method according to claim 3, wherein The regulating the CPU occupancy of the target abnormal application by adjusting the CPU usage rate of the target abnormal application includes: Setting an initial CPU usage rate of the target abnormal application; Obtaining power consumption data and / or performance data of the target abnormal application; Based on the power consumption data and / or the performance data through a reinforcement learning model, adjusting the CPU usage rate of the target abnormal application on the basis of the initial CPU usage rate; Based on the adjusted CPU usage rate, regulating the CPU occupancy.

5. The operation control method according to claim 4, wherein The power consumption data is the system average current, and the performance data is the average frame drop rate of the target abnormal application.

6. The operation control method according to claim 1, wherein After regulating the CPU occupancy of the target abnormal application, it further includes: Adding the application behavior characteristic data into the original sample feature set corresponding to the preset artificial intelligence model to obtain a new sample feature set; Based on the new sample feature set, generating a private artificial intelligence model corresponding to the specific application.

7. The operation control method according to claim 1, characterized in that, The preset artificial intelligence model is a preset isolation forest model.

8. The operating control method according to claim 1, characterized in that, The battery behavior characteristic data includes at least one of the following items: The total CPU occupancy rate of the specific application, the total system GPU occupancy rate, the system current, the total CPU occupancy rate of the background running applications, the occupancy rate of the specific application on the large core CPU, the temperature change characteristic, the total CPU occupancy rate of the system camera service.

9. The operation control method according to claim 1, wherein, The application behavior characteristic data includes at least one of the following items: The total CPU occupancy rate of the candidate abnormal application, the total system GPU occupancy rate, the system current, the frame rate of the candidate abnormal application, the occupancy rate of the candidate abnormal application on the super core CPU, the occupancy rate of the candidate abnormal application on the small core CPU, and the occupancy rate of the candidate abnormal application on the large core CPU.

10. A running control device for an application, applied to an electronic device, characterized in that Including: A battery behavior acquisition module, configured to acquire the battery behavior characteristic data of the electronic device in response to detecting that a specific application of the electronic device enters the foreground running state, where the specific application is any application other than the system application in the electronic device; A candidate abnormal application determination module, configured to determine the specific application as a candidate abnormal application when the battery behavior characteristic data meets a preset limit condition, where the abnormality refers to a CPU scheduling abnormality of the application; An application behavior acquisition module, configured to acquire the application behavior characteristic data of the candidate abnormal application; A target abnormal application determination module, configured to determine whether the candidate abnormal application is a target abnormal application based on the application behavior characteristic data through a preset artificial intelligence model; A regulation module, configured to regulate the CPU occupancy of the target abnormal application when it is determined that the candidate abnormal application is the target abnormal application.

11. An electronic device, characterized in that, Including: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the instructions to implement the method for controlling the operation of the application according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device can execute the method for controlling the operation of the application according to any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the method for controlling the operation of the application according to any one of claims 1 to 9.