The content of the invention
Based on this, the present invention for solve in conventional art during application refreshes interface because polycaryon processor
Frequency or quantity and the current operational factor of terminal mismatch and the excessive technical problem of existing power consumption, and spy proposes a kind of control
The method of CPU power consumption processed.
A kind of method for controlling CPU power consumption, including:
Detection shows the screen refresh rate FPS of thread;
Obtain processor core corresponding to the display thread;
The running frequency of processor core according to corresponding to the FPS of display thread adjusts the display thread;
The running frequency of the processor core is detected, is more than threshold value in the running frequency for detecting the processor core
When, increase new processor core for the display thread.
Optionally, in one embodiment, the processor according to corresponding to the FPS for showing thread adjusts the display thread
The running frequency of core includes:
When the FPS of the display thread is less than the first FPS threshold values, processor core corresponding to the display thread is heightened
Running frequency;
When the FPS of the display thread is higher than the 2nd FPS threshold values, processor core corresponding to the display thread is turned down
Running frequency;
The 2nd FPS threshold values are higher than the first FPS threshold values.
Optionally, in one embodiment, the processor according to corresponding to the FPS for showing thread adjusts the display thread
The running frequency of core also includes:
When the FPS of the display thread is less than the 3rd FPS threshold values, the display thread is defined as being in idle shapes
State;
The 3rd FPS threshold values are less than the first FPS threshold values.
Optionally, in one embodiment, methods described also includes:
The data volume change of the display thread refresh process is obtained, computation processor core is changed according to the data volume
Resources limit;
Also include after the running frequency of the detection processor core:
According to the new processor core of the processor core resource limit regulating frequency or increase.
Optionally, in one embodiment, the data volume for obtaining the display thread refresh process, which changes, is specially:
According to formula
M=(ABS (Xnew*Ynew-Xold*Yold) | Npixel) * Byte
The data volume change of the display thread refresh process is calculated, wherein, the Xnew*Ynew is represented after refreshing
Window size, the Xold*Yold represent the window size before refreshing, and the Npixel is represented after refreshing relative to refreshing
Change pixel number before, the Byte represent each pixel size of data;
It is described to be specially according to data volume change computation processor core resource limit:
According to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Screen change percentage is calculated, wherein the P represents to show the quantity of thread, the Xtotal*Ytotal is represented
Screen resolution, the Mi represent the data volume change of i-th of display thread refresh process, the i=1,2 ..., P;
Then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
The processor core resource limit is calculated, wherein, the Nnew represents new online processor core quantity, institute
The peak frequency that Fnew represents new processor core is stated, the Nmax represents available processors core amounts, the Fmax tables
Show the limiting frequency of available processors core.
In addition, the present invention for solve conventional art in application refresh interface during because polycaryon processor frequency
Rate or quantity and the current operational factor of terminal mismatch and the excessive technical problem of existing power consumption, and spy proposes a kind of control
The device of CPU power consumption.
A kind of device for controlling CPU power consumption, including:
Screen refresh rate detection module, the screen refresh rate FPS of thread is shown for detecting;
Processor core determining module, for obtaining processor core corresponding to the display thread;
Processor frequencies adjustment module, for according to display thread FPS adjust the display thread corresponding to processor core
The running frequency of the heart;
Processor core adjusting module, for detecting the running frequency of the processor core, detecting the processing
When the running frequency of device core is more than threshold value, increase new processor core for the display thread.
Optionally, in one embodiment, the processor frequencies adjustment module is additionally operable to the FPS in the display thread
During less than the first FPS threshold values, the running frequency of processor core corresponding to the display thread is heightened;In the display thread
When FPS is higher than the 2nd FPS threshold values, the running frequency of processor core corresponding to the display thread is turned down;The 2nd FPS threshold values
Higher than the first FPS threshold values.
Optionally, in one embodiment, the processor frequencies adjustment module is additionally operable to the FPS in the display thread
During less than the 3rd FPS threshold values, the display thread is defined as being in idle states;The 3rd FPS threshold values are less than described the
One FPS threshold values.
Optionally, in one embodiment, described device also includes processor core resource limit computing module, for obtaining
The data volume change of the display thread refresh process is taken, computation processor core resource limit is changed according to the data volume;
The processor core adjusting module is additionally operable to according to the processor core resource limit regulating frequency or increasing
Add new processor core.
Optionally, in one embodiment, the processor core resource limit computing module is additionally operable to according to formula
M=(ABS (Xnew*Ynew-Xold*Yold) | Npixel) * Byte
The data volume change of the display thread refresh process is calculated, wherein, the Xnew*Ynew is represented after refreshing
Window size, the Xold*Yold represent the window size before refreshing, and the Npixel is represented after refreshing relative to refreshing
Change pixel number before, the Byte represent each pixel size of data;
The processor core resource limit computing module is additionally operable to according to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Screen change percentage is calculated, wherein the P represents to show the quantity of thread, the Xtotal*Ytotal is represented
Screen resolution, the Mi represent the data volume change of i-th of display thread refresh process, the i=1,2 ..., P;
Then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
The processor core resource limit is calculated, wherein, the Nnew represents new online processor core quantity, institute
The peak frequency that Fnew represents new processor core is stated, the Nmax represents available processors core amounts, the Fmax tables
Show the limiting frequency of available processors core.
Implement the embodiment of the present invention, will have the advantages that:
After the method and apparatus for employing above-mentioned control CPU power consumption, according to the size of the screen refresh rate of display thread
The running frequency of processor core corresponding to the display thread is adjusted, and according to it is each each and every one show thread where
Processor core and its corresponding running frequency, determine whether should be to the processor core of operation quantity and operation
Frequency is adjusted, for example, increasing new processor core to run display thread.That is, do not destroying any application
Operation logic and screen display operation logic on the premise of, actively the refresh case of the display related linear program of each application is entered
Row analysis, and the running frequency of processor core and operation quantity are adjusted according to analysis result, i.e., according to each
The demand of display thread accurately determines the stock number of the processor core needed for it, and then the ensuing processing of the determination more optimized
The quantity and running frequency of device core, on the premise of it ensure that the performance of display thread, reduce the power consumption of terminal.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
It should be noted that the term used in embodiments of the present invention is only merely for the mesh of description specific embodiment
, and it is not intended to be limiting the present invention." one of singulative used in the embodiment of the present invention and appended claims
Kind ", " described " and "the" are also intended to including most forms, unless context clearly shows that other implications.It is also understood that this
Term "and/or" used herein refers to and comprising any or all possible group associated of list items purpose of one or more
Close.
For solve conventional art in application refresh interface during because polycaryon processor frequency or quantity with
The current operational factor of terminal mismatches and the excessive technical problem of existing power consumption, and in the present embodiment, spy proposes one kind
The method for controlling CPU power consumption, the realization of this method can be dependent on computer program, and the computer program can run on based on Feng Nuo
On computer system according to graceful system, the computer program can be that journey is applied in the processor control of the terminal of polycaryon processor
Sequence.The computer system can run the terminal such as smart mobile phone, tablet personal computer, PC of above computer program
Equipment.
It should be noted that in embodiments of the present invention, mentioned processor can be central processing unit (Central
Processing Unit, CPU), image processor (Graphics Processing Unit, GPU), micro-control unit
One or more kinds of combinations in (Micro Controller Unit, MCU).Moreover, processor in the present embodiment can be with
It is symmetric multi-core processor (Symmetrical Multi-Processing, SMP) or asymmetric polycaryon processor
(Asymmetric Multi-Processing, AMP).In addition, the terminal referred in the embodiment of the present invention can be smart mobile phone
(smart phone), tablet personal computer (Tablet Personal Computer), car-mounted terminal, desktop computer (computer)
Etc..
Specifically, as shown in figure 1, the method for above-mentioned control CPU power consumption comprises the following steps S102-S108, specifically:
Step S102:Detection shows the screen refresh rate FPS of thread.
Screen refresh rate is refreshing frequency of the display content within the unit interval on screen, in the present embodiment, can be with
It is the transmission frame number per second on interior refreshing frequency per second, i.e. FPS, Frames Per Second, display screen.For example, in general
The default screen refresh rate of computer display screen is 60Hz, i.e., the refresh rate of the picture of the display screen display per second in computer is 60
Frame is per second.In general, in the case where resolution ratio is constant, screen refresh rate is higher, the disposal ability requirement to processor
Higher, for example, when the resolution ratio of picture is 1024 × 768, the refresh rate of picture will reach 24 frames/second, then video card exists
One second domestic demand amount of pixels to be processed has just reached " 1024 × 768 × 24=18874368 ", if requiring the refreshing of picture
Rate reaches 50 frames/second, then data volume has lifted " 1024 × 768 × 50=39321600 " quickly.
For the display interface of terminal, include multiple display units, for example, in surfing Internet with cell phone interface, signal
Signal corresponding to column unit is shown, is that web page contents are shown corresponding to browser cell, is battery corresponding to electricity control unit
The icon of electricity is shown;Each display unit has corresponded to a display thread, and each display thread is responsible for corresponding show
The display data of window, and after each frame display data is ready, can be with other display threads on whole show layers
The display data of preparation is synthesized to obtain the picture frame of whole display interface.That is, each display thread is aobvious
More new capital of registration evidence is independent of each other.
In the present embodiment, in prospect application refresh rate analysis module in the terminal, each refreshing sub-line can be directed to
The refresh rate of journey carries out the refreshing frequency of each display thread in the independently tracked and statistical unit time, so as to show that each is aobvious
The screen refresh rate of timberline journey.
Step S104:Obtain processor core corresponding to the display thread.
The processing of each display thread is that processor is completed, in the present embodiment, because the quantity of processor is
Multiple, therefore, the processing of different display threads is probably what different processor cores were completed.In the present embodiment, according to
Each display thread obtains corresponding processor core, that is, determines each display thread just in which processor core
Run in the heart.
Step S106:The running frequency of processor core according to corresponding to the FPS of display thread adjusts the display thread.
There is corresponding running frequency in each display thread, still, this running frequency is basis within a processor
What the refresh rate before the running status or the display thread before terminal determined, can not be necessarily current with the display thread
Screen refresh rate be matching.That is, it is necessary to the processing according to corresponding to determining the current screen refresh rate of display thread
The running frequency of device core.Specifically, if the running frequency of screen refresh rate requirement corresponding to display thread is higher than current display
During the running frequency of processor core corresponding to thread, the running frequency of processor core corresponding to the display thread should be heightened;
It is corresponding, if the running frequency of screen refresh rate requirement corresponding to display thread is less than processor core corresponding to current display thread
During the running frequency of the heart, the running frequency of processor core corresponding to the display thread should be turned down, also, to processor core
The adjustment amount of running frequency is determined by the screen refresh rate of the display thread obtained in step S102.
In a specific embodiment, in above-mentioned steps S104, the FPS according to display thread adjusts the display line
In the step of running frequency of processor core corresponding to journey, specifically include:It is less than the first FPS in the FPS of the display thread
During threshold value, the running frequency of processor core corresponding to the display thread is heightened;It is higher than second in the FPS of the display thread
During FPS threshold values, the running frequency of processor core corresponding to the display thread is turned down;The 2nd FPS threshold values are higher than described the
One FPS threshold values.
In the present embodiment, there is maximum, i.e. largest frames frequency in screen refresh rate, for example, can be by largest frames frequency
It is arranged to 60 frames/second.The threshold value of screen refresh rate, i.e. the first FPS threshold values and the 2nd FPS threshold values are preset, wherein the 2nd FPS
Threshold value is higher than the first FPS threshold values.For example, it is 58 frames/second that can set the 2nd FPS threshold values, the first FPS threshold values be 50 frames/
It is per second, when the screen refresh rate for showing thread is more than 58 frames/second, illustrate the processor core operation frequency where the display thread
Rate is sufficient, can suitably lower the running frequency of processor core, i.e., the disposal ability of corresponding processor core is too high, or
Person, in other embodiments, it can also be that the relatively low processor core of performance handles above-mentioned display thread;In display thread
Screen refresh rate when being less than 50 frames/per second, pair illustrate the running frequency deficiency of the processor core where the display thread, i.e.,
The processor disposal ability deficiency answered is, it is necessary to adjust upward the running frequency of processor core, or the place that performance is higher
Manage device core.To sum up, when the FPS for showing thread is less than the first FPS threshold values, the disposal ability of processor core is improved, aobvious
When the FPS of timberline journey is higher than the 2nd FPS threshold values, the disposal ability of processor core is reduced.
In a specific embodiment, heighten above-mentioned or turn down the running frequency of processor core, new fortune
The calculating of line frequency can be calculated according to equation below:
New_freq=old_freq*Good_FPS_THRESHOLD/current_fps
Wherein new_freq represents new running frequency, and old_freq represents the operation frequency of processor core before early regulation
Rate, Good_FPS_THRESHOLD represent the 2nd FPS threshold values, and current_fps represents the display thread obtained in step S102
Screen refresh rate.
Further, in an optional embodiment, in above-mentioned steps S104, the FPS according to display thread is adjusted
In the step of saving the running frequency of processor core corresponding to the display thread, in addition to:It is less than in the FPS of the display thread
During the 3rd FPS threshold values, the display thread is defined as being in idle states;The 3rd FPS threshold values are less than the first FPS
Threshold value.
That is, when the screen refresh rate for showing thread is less than the 3rd FPS threshold values, illustrate corresponding display thread pair
Do not have demand in screen-refresh, in general, one relatively low numerical value during the 3rd FPS threshold values, for one for screen brush
It is new have the application of normal refresh demand for, the screen refresh rate of its corresponding show process should be greater than this relatively low the 3rd
FPS threshold values, so, display thread of the screen refresh rate less than default 3rd FPS threshold values can be defined as being in idle shapes
State, i.e., in idle condition, the process resource for display thread distribution processor core can not had to.For example, at one
In embodiment, the 3rd FPS threshold values can be arranged to 10 frames/second, when the screen refresh rate for showing thread is less than 10 frames/second,
Corresponding display thread is defined as idle states.In another embodiment, the ideal value of the 3rd FPS threshold value be 0 frame/
Second.
Step S108:The running frequency of the processor core is detected, is detecting the operation frequency of the processor core
When rate is more than threshold value, increase new processor core for the display thread.
In step s 106, adjusted for the running frequency of each display thread, may after regulation
Occur, the summation of the running frequency of all display threads can exceed that the processor core corresponding to some processor core
The load capacity of the heart, it is therefore desirable to be adjusted correspondingly.Specifically, detect processor core corresponding to each display thread
Running frequency, in this example it is shown that processor core corresponding to thread can be one or multiple.For
In each processor core corresponding to display thread, its corresponding running frequency is detected respectively.
For processor core, a threshold value is preset for its running frequency, when running frequency is more than the threshold value,
Illustrate that the load of the processor core is excessive, to ensure the performance of processor core, and avoid the processor core
Disposal ability deficiency causes the situation of interim card, it is necessary to increases the disposal ability of processor core, as shows that thread increase is new
Processor core, will partly show the operation of thread distribute to newly increase processor core operation.
It should be noted that in the present embodiment, determining whether to increase newly according to the running frequency of processor core
During processor core, i.e., it is determined that adjustment after processor core quantity during, it is also necessary to calculating handle
Device core resource limit.Specifically, obtaining the data volume change of the display thread refresh process, changed according to the data volume
Computation processor core resource limit;Also include after the running frequency of the detection processor core:According to the place
Manage device core resource limit regulating frequency or increase new processor core.
During independently tracked for the refreshing content progress of each refreshing sub-line journey, detect in corresponding display
The situation of change of appearance, the change of refreshing content each time is analyzed, specifically, for each display thread, obtained each
Before window size before and after secondary refreshing, i.e. Xnew*Ynew represent that the window size after refreshing, Xold*Yold represent to refresh
Window size, that is to say, that ABS (Xnew*Ynew-Xold*Yold) represents to refresh front and rear display window change feelings every time
Condition.It is also possible that obtaining the quantity for refreshing in front and rear image frame the pixel changed every time, i.e. Npixel is represented after refreshing
Relative to the change pixel number before refreshing.That is, for each display thread, according to formula
M=(ABS (Xnew*Ynew-Xold*Yold) | Npixel) * Byte
The data volume change for showing thread refresh process is calculated, wherein M represents the number of the display thread in refresh process
Change according to amount, Byte represents each pixel size of data, for example, RGB888, RGB565, YUV422 etc..
If terminal has corresponded to P display thread altogether, the data volume of refresh process corresponding to each display thread is calculated
Change, i.e. M1, wherein M2 ... ..., MP, Mi represent that the data volume of i-th of display thread refresh process changes, the i=1,
2 ..., P.
, can be according to formula during above-mentioned calculating computation processor core resource limit
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Screen change percentage Percentage is calculated, then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage
The processor core resource limit is calculated, wherein, Xtotal*Ytotal expression screen resolutions, i.e. screen
Size, Nnew represent new online processor core quantity, and Fnew represents the peak frequency of new processor core, and Nmax is represented
Available processors core amounts, Fmax represent the limiting frequency of available processors core.That is, protected using the above method
While having demonstrate,proved each display thread refresh rate (i.e. performance priority), and limitation is made that to the resource of overall processor core
(it is preferential to tend to power consumption), it is achieved thereby that optimal display performance power dissipation ratio, on the premise of it ensure that Consumer's Experience, control
The power consumption of terminal is made.
In addition, for solve conventional art in application refresh interface during because polycaryon processor frequency or number
Amount and the current operational factor of terminal mismatch and the excessive technical problem of existing power consumption, in one embodiment, such as Fig. 2 institutes
Show, it is also proposed that a kind of device for controlling CPU power consumption, including screen refresh rate detection module 102, processor core determining module
104th, processor frequencies adjustment module 106 and processor core adjusting module 108, wherein:
Screen refresh rate detection module 102, the screen refresh rate FPS of thread is shown for detecting;
Processor core determining module 104, for obtaining processor core corresponding to the display thread;
Processor frequencies adjustment module 106, for according to display thread FPS adjust the display thread corresponding to processor
The running frequency of core;
Processor core adjusting module 108, for detecting the running frequency of the processor core, detecting the place
When the running frequency of reason device core is more than threshold value, increase new processor core for the display thread.
Optionally, in one embodiment, processor frequencies adjustment module 106 is additionally operable to the FPS in the display thread
During less than the first FPS threshold values, the running frequency of processor core corresponding to the display thread is heightened;In the display thread
When FPS is higher than the 2nd FPS threshold values, the running frequency of processor core corresponding to the display thread is turned down;The 2nd FPS threshold values
Higher than the first FPS threshold values.
Optionally, in one embodiment, processor frequencies adjustment module 106 is additionally operable to the FPS in the display thread
During less than the 3rd FPS threshold values, the display thread is defined as being in idle states;The 3rd FPS threshold values are less than described the
One FPS threshold values.
Optionally, in one embodiment, as shown in Fig. 2 said apparatus also includes the calculating of processor core resource limit
Module 110, for obtaining the data volume change of the display thread refresh process, computation processor is changed according to the data volume
Core resource limit;Processor core adjusting module 108 be additionally operable to according to the processor core resource limit regulating frequency or
Person increases new processor core.
Optionally, in one embodiment, processor core resource limit computing module 110 is additionally operable to according to formula
M=(ABS (Xnew*Ynew-Xold*Yold) | Npixel) * Byte
The data volume change of the display thread refresh process is calculated, wherein, the Xnew*Ynew is represented after refreshing
Window size, the Xold*Yold represent the window size before refreshing, and the Npixel is represented after refreshing relative to refreshing
Change pixel number before, the Byte represent each pixel size of data;The processor core resource limit 110 is counted
Module is calculated to be additionally operable to according to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Screen change percentage is calculated, wherein the P represents to show the quantity of thread, the Xtotal*Ytotal is represented
Screen resolution, the Mi represent the data volume change of i-th of display thread refresh process, the i=1,2 ..., P;Then root
According to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
The processor core resource limit is calculated, wherein, the Nnew represents new online processor core quantity, institute
The peak frequency that Fnew represents new processor core is stated, the Nmax represents available processors core amounts, the Fmax tables
Show the limiting frequency of available processors core.
Implement the embodiment of the present invention, will have the advantages that:
After the method and apparatus for employing above-mentioned control CPU power consumption, according to the size of the screen refresh rate of display thread
The running frequency of processor core corresponding to the display thread is adjusted, and according to it is each each and every one show thread where
Processor core and its corresponding running frequency, determine whether should be to the processor core of operation quantity and operation
Frequency is adjusted, for example, increasing new processor core to run display thread.That is, do not destroying any application
Operation logic and screen display operation logic on the premise of, actively the refresh case of the display related linear program of each application is entered
Row analysis, and the running frequency of processor core and operation quantity are adjusted according to analysis result, i.e., according to each
The demand of display thread accurately determines the stock number of the processor core needed for it, and then the ensuing processing of the determination more optimized
The quantity and running frequency of device core, on the premise of it ensure that the performance of display thread, reduce the power consumption of terminal.
In one embodiment, as shown in figure 3, Fig. 3 illustrate a kind of method for running above-mentioned control CPU power consumption based on
The terminal of the computer system of von Neumann system.The computer system can be smart mobile phone, tablet personal computer, palm PC,
The terminal device such as notebook computer or PC.Specifically, it may include the outer input interface connected by system bus
1001st, processor 1002, memory 1003 and output interface 1004.Wherein, outer input interface 1001 optionally can be wrapped at least
Include network interface 10012.Memory 1003 may include external memory 10032 (such as hard disk, CD or floppy disk etc.) and memory storage
Device 10034.Output interface 1004 can comprise at least the equipment such as display screen 10042.
In the present embodiment, the operation of this method is based on computer program, and the program file of the computer program is stored in
In the external memory 10032 of the foregoing computer system based on von Neumann system, built-in storage is operationally loaded into
In 10034, then it is compiled as being transferred in processor 1002 after machine code performing, so that being based on von Neumann system
Computer system in form screen refresh rate detection module 102, processor core determining module 104, processor in logic
Frequency adjustment module 106 and processor core adjusting module 108.And in the method implementation procedure of above-mentioned control CPU power consumption,
The parameter of input is received by outer input interface 1001, and is transferred in memory 1003 and is cached, and is then input to processing
Handled in device 1002, the result data of processing or be cached in memory 1003 is subsequently handled, or is passed to
Output interface 1004 is exported.
Above disclosure is only preferred embodiment of present invention, can not limit the right model of the present invention with this certainly
Enclose, therefore the equivalent variations made according to the claims in the present invention, still belong to the scope that the present invention is covered.