A kind of intelligent mobile terminal power consumption management
Technical field
The present invention relates to data processing technique and terminal field of energy-saving technology, specifically, the present invention relates to a kind of intelligent mobile terminal power consumption management.
Background technology
In recent years, the smart mobile phone of diverse in function is more and more subject to market and welcomes, but meanwhile, and the too short problem of smart mobile phone stand-by time is also more and more outstanding, causes inconvenience to user.At present, the speed of development of battery technology has been difficult to catch up with user's craving for for longer stand-by time, and therefore carrying out prolongs standby time by more optimal smart mobile phone power managed strategy becomes one of more and more important research direction.
CPU is the core component of smart mobile phone, it for mobile phone of all shapes and colors application provide calculate support, such as game, browser, tool software etc., these apply spent by electricity exceeded the electricity spent by traditional communication.In order to meet the demand of these application, cpu performance constantly promotes, and its power consumption also grows with each passing day, and effectively reduces CPU power consumption to reduction smart mobile phone overall power important in inhibiting.
At present, two of CPU power managed conventional algorithms are LinuxPERFORMANCE algorithm and LinuxPOWERSAVING algorithm.LinuxPERFORMANCE algorithm is intended to performance priority, and it can be located at highest level cpu frequency always, and LinuxPOWERSAVING algorithm is energy conservation priority, and it is located at floor level frequency always.These two kinds of algorithms all do not consider dynamically regulating frequency, cause or waste resource, or compromising Consumer's Experience.
LinuxONDEMAND algorithm is a kind of CPU power managed algorithm carrying out regulating frequency according to real-time cpu busy percentage.In typical LinuxONDEMAND algorithm, when cpu busy percentage is more than a upper limit, frequency can be set in highest frequency; When utilization factor is lower than a lower limit, frequency will be set in the frequency of the utilization factor that can keep low compared with the upper limit 10%.Relative to LinuxPERFORMANCE algorithm, LinuxONDEMAND algorithm effectively can reduce the power consumption of CPU.But this power managed algorithm does not directly consider Consumer's Experience, and more and more put into practice and show, in a lot of situation, LinuxONDEMAND algorithm easily distributes too much computational resource and but correspondingly cannot improve Consumer's Experience, therefore, on the basis of LinuxONDEMAND algorithm, also there is the space reducing power consumption further.
In sum, currently under the prerequisite ensureing Consumer's Experience, the solution of intelligent mobile terminal power consumption can accurately be reduced in the urgent need to a kind of.
Summary of the invention
Under the object of this invention is to provide a kind of prerequisite that can not reduce at guarantee Consumer's Experience, accurately reduce the solution of intelligent mobile terminal power consumption.
For achieving the above object, the invention provides a kind of model training method of predicted application saturation frequency, comprise the following steps:
1) set up forecast model, when application runs by this model, the terminal operating proper vector that forms of active characteristics of terminal is as input, using Candidate Frequency lid as output; Wherein, when described application runs, the active characteristics of terminal comprises: the busy time of CPU accounts for ratio or the number percent of working time; The ratio of the working time of CPU on each frequency or number percent; And CPU continues average and the variance of busy time span;
2) train described forecast model based on sample set, in this sample set, acquire the active characteristics of terminal when application runs, and corresponding Consumer's Experience and cpu frequency.
Wherein, when described application runs, the active characteristics of terminal also comprises: the average of system break number of times caused by touch screen and variance; The average of touch screen time span; The average of interval time and variance between touch screen; And the gravity average of component and variance on y-axis direction in terminal local Coordinate System.
Wherein, described forecast model is neural network model.
Wherein, described step 2) in, when the average user experience value of a large number of users and the ratio of maximum user experience value exceed predetermined threshold, regard as the frequency that reaches capacity.
Present invention also offers a kind of method of predicted application saturation frequency, comprise the following steps:
Start application, gather the terminal operating proper vector of mobile terminal in this application operational process, by the forecast model that the method in collected terminal operating proper vector input Claims 1 to 4 described in any one is trained, the frequency that this forecast model exports is the saturation frequency corresponding to this application.
Present invention also offers a kind of intelligent mobile terminal power consumption management, comprise the following steps:
11) method of aforementioned predicted application saturation frequency is utilized to obtain the saturation frequency of application;
12) carry out dynamic adjustments based on ONDEMAND algorithm to the frequency of CPU, wherein the saturation frequency that obtains of step 11) is as the highest frequency in ONDEMAND algorithm.
Wherein, in described step 11), the model of predicted application saturation frequency completes training at server end, then, server sends the parameter of described model to mobile terminal, sets up the saturation frequency of each application of history lists record at mobile terminal, each application first time is when running, obtained corresponding saturation frequency by the end activity proper vector prediction collected and be recorded in described history lists, each this application of startup, checks that history lists obtains corresponding saturation frequency later.
Wherein, in described step 11), for the unseen newtype application of described forecast model, mobile terminal accepts frequency that user manually arranges and user experience value, and the two and corresponding terminal operating proper vector are sent to server, described server is added the described sample set for model training.
Compared with prior art, the present invention has following technique effect:
1, the present invention can prevent the too much computational resource of distribution from but correspondingly cannot improve Consumer's Experience, thus reaches the effect of energy saving optimizing.
2, the present invention can reach the effect accurately reducing power consumption according to Consumer's Experience.
Accompanying drawing explanation
Fig. 1 shows the distribution situation of the Consumer's Experience of lower six different application of different CPU frequency;
Fig. 2 shows the process flow diagram of one embodiment of the invention;
Fig. 3 shows and is respectively applied in traditional ONDEMAND algorithm and the contrast based on CPU working time in each frequency under the ONDEMAND algorithm of one embodiment of the invention;
Fig. 4 to show in experiment cpu busy percentage time dependent curve when different application is run; Wherein X-coordinate represents tactic time percentage sheet from small to large;
Fig. 5 shows the time dependent curve of system break number when different application in experiment is run caused by touch screen;
Fig. 6 shows 27 application motion feature scatter diagram operationally in experiment;
Fig. 7 shows the schematic diagram of mobile phone coordinate system;
Fig. 8 shows in the present invention the precision of the embodiment prediction saturation frequency using different characteristic vector;
CPU power consumption contrast when Fig. 9 difference shown under algorithms of different should be run;
Overall Power Consumption contrast when Figure 10 difference shown under algorithms of different should be run.
Embodiment
For the ease of understanding, first introduce the research that the present inventor does for the relation between cpu frequency and Consumer's Experience.Inventor has done the investigation that relates to 20 users and 6 application (comprising: TalkingTom, SnowPro, Storm, FruitNinja, UCBrowser and QQ), in order to the feature of digging user, application.In investigation, when user uses application, the frequency of random adjustment CPU, and inquire the experience of user.Consumer's Experience is divided into three grades: good, in, poor.So just, obtain the Consumer's Experience distribution of Consumer's Experience on each CPU frequency.Fig. 1 shows the distribution situation of the Consumer's Experience of lower six different application of different CPU frequency.With reference to figure 1, wherein each bar shaped represents this number of users corresponding to Consumer's Experience level.For some application, such as TalkingTom, SnowPro, Storm, along with the raising of cpu frequency, comment the number of users of " good " to increase, and comments the number of users of " poor " to reduce.But also there is other application, such as FruitNinja and UCBrowser, when cpu frequency brings up to 800 from 600, Consumer's Experience does not significantly promote.And for QQ, when cpu frequency brings up to 600 from 300, Consumer's Experience does not also significantly promote.Can find out, cpu frequency and Consumer's Experience be always positive correlation not, and some application existence saturation frequency, when cpu frequency is higher than saturation frequency, Consumer's Experience does not almost promote.By screening the saturation frequency of different application, saturation frequency is set to the frequency lid of this application, the dynamic adjustments scope of CUP frequency is made not exceed this frequency lid, the phenomenon that can prevent the too much computational resource of distribution from but correspondingly cannot improve Consumer's Experience occurs, thus reaches the effect of energy saving optimizing.Further, in order to determine frequency lid exactly, propose a kind of scheme of the predict frequency lid based on neural network model in the following embodiments, a series of active characteristics when it is run in the terminal by application, predict the frequency lid of each user for each application, thus reach the effect accurately reducing power consumption according to Consumer's Experience.
Below in conjunction with embodiment, the present invention will be further described.
According to one embodiment of present invention, a kind of method of saturation frequency of predicted application is provided.
The saturation frequency of application is relevant to Consumer's Experience, the sample of some can be collected by experiment, in sample, recording user experiences the relation with the change of CPU frequency, and a series of active characteristics of corresponding application when running in the terminal, for convenience of describing, hereinafter the vector that a series of active characteristics described in this form is called terminal operating proper vector.Based on collected sample, neural network training model, in this neural network model, using the neuron of each active characteristics in terminal operating proper vector as neural network model input layer, a neuron using the frequency lid of candidate as neural network model output layer.Utilize above-mentioned trained neural network model, namely measurable each application saturation frequency and corresponding frequency lid is set.
In this step, Consumer's Experience UX is quantized to be defined as:
Wherein, W
1, W
2, W
3represent the scoring of Consumer's Experience, be respectively 1,2,3, the evaluation of representative " poor, in, good ".N
1, N
2, N
3represent to the number of corresponding scoring.Easily find out, under this definition, the maximal value of Consumer's Experience UX is 3.In the present embodiment, by UX, more than 2.7, the situation of (i.e. UX maximal value more than 90%) is thought to reach the highest Consumer's Experience, now regards as the situation that significantly cannot promote Consumer's Experience again.More generally, first can set a threshold value (such as 90%), when the average user experience value of a large number of users and the ratio of maximum user experience value exceed this threshold value, the situation that significantly cannot promote Consumer's Experience again can be regarded as, namely regard as the frequency that reached capacity.
Prior art adjusts cpu frequency by means of only cpu busy percentage, and unlike the prior art, the active characteristics when application that it utilizes runs in the terminal comprises a series of feature relevant to CPU to the present embodiment.These features relevant to CPU comprise:
The busy time of a, CPU accounts for the ratio (R of working time
bt),
Number percent (the P of b, CPU working time on each candidate's frequency (i.e. the frequency of Candidate Frequency lid)
f),
C, the average continuing busy time span and variance (μ (Lcb), δ (Lcb)).
Particularly, R
btthat cpu busy percentage is at the working time of 100% and the ratio of total run time.R
btthe demand of this application of larger explanation to calculated amount is larger.Such as, Fig. 4 to show in experiment cpu busy percentage time dependent curve when different application is run; Wherein X-coordinate represents tactic time percentage sheet from small to large.In the diagram, the R of Storm
btup to 65%, and its corresponding frequency lid is 800MHz.On the contrary, the R of QQ and UC
btvalue only has 30%, and finally their frequency lid is lower 600MHz.
But, only use R
btinadequate, because R
btdo not consider cpu frequency.Such as different application may have close R
btbut, operate in different cpu frequencies.Like this, in that application affirmative more consumption calculations resource of upper frequency.The present embodiment introduces P
fthis feature.Fig. 3 shows and is respectively applied in traditional ONDEMAND algorithm and the contrast based on CPU working time in each frequency under the ONDEMAND algorithm of one embodiment of the invention, and as shown in Figure 3, in ONDEMAND algorithm (w/ocap in figure), application has respective P
fvalue.
Continuous busy time (CBsession) refers to that cpu busy percentage keeps the time of 100% continuously.Usually, a long-term Cbsession is caused by larger load, brings higher μ (Lcb).On the contrary, less load can only cause shorter Cbsession and lower μ (Lcb).An application having higher μ (Lcb) should operate on higher cpu frequency, its real time reaction of such guarantee.The present embodiment uses δ (Lcb) to classify to different application further.Fig. 4 shows average and the variance of 6 application continuous busy time span of CPU operationally in experiment.As shown in Figure 4, MPC has higher δ (Lcb), and this represents that it needs higher frequency lid, namely 800MHz.By contrast, the fruit person of bearing has lower μ (Lcb) and δ (Lcb), illustrates that it only needs lower frequency lid.
The feature that above-mentioned CPU is correlated with can portray the demand of application to cpu performance at most of conditions very well, has higher precision of prediction.But for some special applications, the application of such as game class and video class, the feature that CPU is correlated with for the precision of prediction that can only obtain 70% and 50% respectively, as shown in Figure 8.Given this, in a preferred embodiment, can also increase other two category features, namely touch screen characteristic sum motion feature, classifies to application.
Dissimilar application has the touch screen feature of oneself uniqueness usually, and this embodies to some extent by the system break information caused at touch screen.Fig. 5 shows the time dependent curve of system break number when different application in experiment is run caused by touch screen.Can see that UCBrowser has touch screen frequently compared to Gofishing and Dragon, and Storm almost do not have touch screen.In addition, the time of the touch screen of different application is also not quite similar.Such as, such as some application needs to drag the page more, and drags the page, and its touch screen time is generally long than tapping a page widgets.In addition, the time interval change between different application twice touch screen also very greatly.Consider these situations, the touch screen feature of three aspects is have employed in the preferred embodiment, comprise: the average of system break number of times (Nint) caused by touch screen and variance (μ (Nint), δ (Nint)), sample frequency is 5Hz, the average (μ (Ltouch)) of touch screen time span, the average of interval time (Linterval) and variance (μ (Linterval), δ (Linterval)) between touch screen.
Introduce the feature of mobile phone motion aspect below again.The feature of these motion aspects be from the acquisition of information of the gravity sensor of embedded in mobile phone to.Fig. 6 shows 27 application motion feature scatter diagram operationally in experiment.Wherein, x-axis represents the average of gravity component on mobile phone vertical direction, represents with μ (y).Y-axis is then corresponding standard deviation, i.e. δ (y).For clarity sake, application is noted as game class, browser class and video class.In figure, plane has been divided into four regions (Domain), and Domain1 contains needs horizontal machine of shaking hands, and frequently rocks the application of mobile phone, the game of class of such as competing for speed.Mainly some need horizontal machine of shaking hands to Domain2, but the application of almost not rocking.Some perpendicular machines of shaking hands, do not need the application of rocking, such as browser, are generally distributed in Domain3.In addition, application is not had to appear in Domain4 in experiment.
Fig. 8 shows the precision of prediction using the feature of different sets to bring.Only use cpu character that the application of browser class can be made to have good precision of prediction, but can be only that precision of prediction reaches 70% and 50% for the application of game class and video class.When using above-mentioned all features, corresponding survey precision in advance can be brought up to 91% and 85%.Result is used to confirm Such analysis.
Based on Such analysis, for one embodiment of the present of invention, provide a kind of method of training saturation frequency forecast model, comprise step 101 ~ 103:
Step 101: set up a three-layer neural network model, its input layer has 12 neurons, and hidden layer has 18 neurons, and output layer has 4 neurons.
Wherein, the output layer of three-layer neural network model is the vector of 4 elements, and each element represents 300MHz, 600MHz, 800MHz and HIGHER respectively.HIGHER is meant to, and apply the demand of calculated performance too high, to such an extent as to 800MHz can not meet its demand.
12 neurons of the input layer of three-layer neural network model are exactly 12 features introduced above, these 12 structural feature terminal operating proper vectors.12 features are respectively:
1, the busy time of CPU accounts for the ratio of working time or number percent (busy refer to, the utilization factor of CPU is 100%);
2, the ratio of the working time of CPU on each frequency or number percent, in the present embodiment, by the ratio of CPU working time on 300MHz or number percent, and the ratio of CPU working time on 600MHz or number percent are respectively as two eigenwerts, 300MHz, 600MHz are less two of numerical value in the final Candidate Frequency lid exported;
3, continue average and the variance (the lasting busy time refers to, the utilization factor of CPU continues maintenance 100%) of busy time span, wherein average and variance are separately as an eigenwert;
4, the average of system break number of times caused by touch screen and variance, wherein average and variance are separately as an eigenwert;
5, the average of touch screen time span, namely presses the time of unclamping from finger;
6, the average of interval time and variance between touch screen, wherein average and variance are separately as an eigenwert;
7, gravity y-axis direction (refer to the longitudinal direction of mobile phone, Fig. 7 shows the schematic diagram of mobile phone coordinate system) in mobile phone local Coordinate System goes up average and the variance of component, and wherein average and variance are separately as an eigenwert.
In above-mentioned 12 features, 1 to 3 is CPU correlated characteristic, and 4 to 5 is touch screen feature, and 7 is the physical motion feature of terminal.4 to 7 can be referred to as non-CPU correlated characteristic.Analysis to each category feature in reference above, can find out, whole 12 features are selected to be only a preferred version as the input layer of forecast model, in other embodiments, also the part in 12 features can be selected as the input layer of forecast model, such as can only use CPU correlated characteristic and not use the physical motion feature of touch screen characteristic sum terminal, this forecast model more adequately can predict the saturation frequency of great majority application (such as the application of browser class) of non-video class and non-gaming class.
Step 102: collecting sample data as training set, the three-layer neural network model set up with this training set training step 101.In different application operational processs, the active characteristics of 12 mobile terminals described in gathering above, thus form terminal operating proper vector.In the present embodiment, acquire the data of 20 users and 27 application as training set.
Step 103: after user starts an application, gather the terminal operating proper vector of mobile terminal in this application operational process, by the three-layer neural network model that the input of collected terminal operating proper vector is trained through step 102, one in 300MHz, 600MHz, 800MHz, HIGHER is obtained at output layer, the frequency obtained is saturation frequency corresponding to this application (when Output rusults is HIGHER, can think that saturation frequency is too high, now can be considered that frequency lid is for empty, does not namely arrange frequency lid in addition).
Inventor implements 4 retransposing proof procedures to verify the model of the present embodiment.
Experiment adopts Motorola ME525 mobile phone.Its application processor adopts TIOMAP3610, and be integrated with ARMCortexA8 kernel, it has 300MHz, 600MHz, 800MHz tri-frequencies that can regulate.Adopt PowerVRSGX530 integrative display chip simultaneously.Almost can be competent at the 3D game of all existing main flows.Have 512MRAM, and the ten thousand pixel TFT screens that are equipped with 3.7 cun 1600.Adopt android2.2 operating system, the experience of user can well be met in high performance mode.
Inventors have developed a background service and carry out acquisition system action message (i.e. end activity proper vector), its sample frequency is for being 5Hz.System activity info when 20 users use 27 to apply is acquired in experiment, and Consumer's Experience feedback.27 application testing GooglePlay are popular, comprising angry bird, QQ, UC browser etc.Each test process duration 3 minutes, total acquisition time reaches 20 hours.After carrying out feature extraction, just obtain 540 training examples, and labelled to each training examples by corresponding saturation frequency (being obtained by Consumer's Experience feedback).
Training set is divided into 4 groups randomly, then chooses arbitrarily 3 and merge into training set, another one is as checking collection.Like this, the average training set precision of prediction obtained is 92%, and what checking was gathered is 80%.Inventor also uses 5 and both occurred in training set, does not also collect the new opplication of appearance as test set in checking, tests the model trained.Experiment display, this model can obtain the precision of prediction of 82%.
Based on the scheme of each application saturation frequency of above-mentioned prediction, power managed can be done to mobile terminal further, thus accurately reduce the power consumption of mobile terminal.
According to another embodiment of the invention, provide a kind of mobile terminal power consumption management method, comprise the following steps:
Step 1: during terminal operating one application, obtain the saturation frequency of this application.The method of prediction saturation frequency, see embodiment above, repeats no more herein.
In the present embodiment, the framework of whole system can adopt the form of client-server.The model of prediction saturation frequency completes training at high performance server end.Then, server sends the parameter of forecast model to client, namely intelligent mobile terminal.In client, establish a history lists to record the frequency lid (i.e. saturation frequency) of each application.Each application first time, when running, is obtained corresponding frequency lid by the end activity proper vector prediction collected and is recorded in described history lists.Like this, each this application of startup, only needs to check that history lists can obtain corresponding frequency lid later.If do not found in history lists, system will start forecasting process, and will be added in history lists by this new application-frequency lid record.
In addition, when considering that the application that forecast model did not meet newtype occurs, forecast model needs to improve self adaptively.So, present embodiments provide user interface, make the frequency lid that user can manually be arranged.Meanwhile, the information (terminal operating proper vector) when the value of this frequency lid and system cloud gray model is sent to server by the background program of terminal.These data will become the new training sample of machine learning, thus continuous prediction correcting model.
Step 2: carry out dynamic adjustments to the frequency of CPU based on ONDEMAND algorithm, wherein, for each application, saturation frequency step 1 obtained respectively is as the highest frequency in ONDEMAND algorithm.
The power consumption management method of the present embodiment is based upon on ONDEMAND algorithm, original LinuxONDEMAND algorithm is: when cpu busy percentage (cpu_util) is greater than one the upper limit (UP_THRESHOLD), by the set of frequency of CPU at " highest frequency " (highest_frequency); When cpu busy percentage is less than one lower limit (DOWN_THRESHOLD), by frequency setting in the level that can maintain cpu busy percentage at least (UP_THRESHOLD-10%).The correlative code of ONDEMAND algorithm is as follows:
In the present embodiment, taking the method for dynamic restriction " highest frequency ", namely give different " highest_frequency " according to different application, this " highest frequency " can be described as frequency lid.Adopt and can effectively prevent cpu frequency from excessively heightening in this way.Further, experiment proves, arranges frequency lid and can't cause obviously reduce the working time be respectively applied in low frequency.As shown in Figure 3, the method of more original ONDEMAND algorithm and the present embodiment, the Annual distribution be applied on this low frequency of 300MHz does not have significant change, that is, that eliminates frequency excessively heightens the remarkable minimizing that can't bring working time on low frequency, therefore can reduce the power consumption of CPU on the whole.
In order to verify the validity of the present embodiment, inventors have investigated frequency lid and predicting the outcome and the matching rate of user's actual selection.The precision of prediction of frequency lid is determined and frequency lid is set Consumer's Experience whether can be avoided to decline.Table 1 gives the matching rate predicted the outcome with user's actual selection.
Table 1
Numerical value sum on diagonal line reaches 87.4%, represents that precision of prediction reaches 87.4%.The numerical value sum of upper Delta Region represents the ratio shared by false positive, and this situation does not reach the energy-saving effect of expection, but can't experience by impaired user.It is on the low side that the numerical value sum of lower triangle represents the frequency lid predicted, may have influence on Consumer's Experience, but this situation only accounts for 7.6% generally.That is, when 92.4%, the algorithm of the present embodiment can not bring the decline of Consumer's Experience, so, can be used it safely.
And application processor energy-saving effect aspect: use PowerMonitor to measure the actual power loss of mobile phone.CPU power consumption contrast when Fig. 9 difference shown under algorithms of different should be run.As shown in Figure 9, the precision of prediction of the present embodiment is tactful close to the Oracle of optimum.Experimental result shows, and for CPU, the scheme of the present embodiment can make lower power consumption 11% to 84%.
Usually, for the application that computation requirement is little, as Strom:Lin and ChineseChess, the effect of the present embodiment is clearly, but for the larger application of computation requirement amount, as Strom:Run and Gofishing, also has certain effect.It should be noted that, calculated amount is not the reliable foundation of assessment energy-saving effect.Such as this game of NeedforSpeed, computational requirements is very large in fact for it, but it does not but need high frequency lid.The scheme of the present embodiment also can identify this situation.This shows, the scheme of the present embodiment goes for many situations.
The electricity that application processor is saved, also can see effect in the level of complete machine usually.Figure 10 shows the comparison of the Overall Power Consumption of the strategy of linuxeONDEMANDDFS strategy and the present embodiment.Result shows, energy-conservation 10mW to the 466mW of the scheme of the present embodiment, average out to 82mW in complete machine level.For specific application, such as NeedforSpeed and Storm:Dragon, the power consumption of 466mW and 256mW is had to save respectively.For the application that UCBrowser and QQ is such, although the relatively energy-conservation of application processor is not very high, finally still have that 93mW's and 73mW is definitely energy-conservation.This is because the power consumption of application processor is the main power consumption of complete machine at this moment.
The system-level energy-conservation of this tens milliwatt is significant for smart phone user, because it can very significant prolongs standby time.The power consumption of smart mobile phone when standby is 25mW, and the strategy of the present embodiment is 82mW applying when running on average energy-conservation.This just means, as long as the cell phone active state (non-standby state) of accumulation reaches 5 hours, just prolongs standby time can reach 16 hours.
Finally it should be noted that, above embodiment is only in order to describe technical scheme of the present invention instead of to limit this technical method, the present invention can extend in application other amendment, change, application and embodiment, and therefore think that all such amendments, change, application, embodiment are all in spirit of the present invention and teachings.