Content of the invention
Based on this, the present invention solves and conventional art refreshes during interface because polycaryon processor in application
The excessive technical problem of power consumption that frequency or the quantity operational factor current with terminal are not mated and existed, spy proposes a kind of control
The method of CPU power consumption processed.
A kind of method controlling CPU power consumption, comprising:
Screen refresh rate FPS of detection display thread;
Obtain the described display corresponding processor core of thread;
Regulate the running frequency of this corresponding processor core of display thread according to the FPS of display thread;
Detect the running frequency of described processor core, be more than threshold value in the running frequency described processor core being detected
When, increase new processor core for described display thread.
Optionally, in one embodiment, described according to display thread FPS regulate this corresponding processor of display thread
The running frequency of core includes:
When the FPS of described display thread is less than a FPS threshold value, heighten this corresponding processor core of display thread
Running frequency;
When the FPS of described display thread is higher than the 2nd FPS threshold value, turn down this corresponding processor core of display thread
Running frequency;
Described 2nd FPS threshold value is higher than a described FPS threshold value.
Optionally, in one embodiment, described according to display thread FPS regulate this corresponding processor of display thread
The running frequency of core also includes:
When the FPS of described display thread is less than the 3rd FPS threshold value, described display thread is defined as being in idle shape
State;
Described 3rd FPS threshold value is less than a described FPS threshold value.
Optionally, in one embodiment, described method also includes:
Obtain the data volume change of described display thread refresh process, according to described data volume change calculations processor core
Resources limit;
Also include after the running frequency of the described processor core of described detection:
According to described processor core resource limit regulating frequency or increase new processor core.
Optionally, in one embodiment, described obtain described display thread refresh process data volume change particularly as follows:
According to formula
M=(ABS (Xnew*Ynew Xold*Yold) | Npixel) * Byte
Calculate the data volume change of described display thread refresh process, wherein, after described Xnew*Ynew represents refreshing
Window size, described Xold*Yold represents the window size before refreshing, and described Npixel represents after refreshing relative to refreshing
Change pixel number before, described Byte represents each pixel size of data;
Described according to described data volume change calculations processor core resource limit particularly as follows:
According to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Calculating screen change percentage, wherein said P represents the quantity of display thread, and described Xtotal*Ytotal represents
Screen resolution, described Mi represents that the data volume of i-th display thread refresh process changes, described i=1,2 ..., P;
Then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
Calculating described processor core resource limit, wherein, described Nnew represents new online processor core quantity, institute
Stating Fnew and representing the peak frequency of new processor core, described Nmax represents available processors core amounts, described Fmax table
Show the limiting frequency of available processors core.
Additionally, the present invention solves and conventional art refreshes during interface because the frequency of polycaryon processor in application
The excessive technical problem of power consumption that rate or the quantity operational factor current with terminal are not mated and existed, spy proposes a kind of control
The device of CPU power consumption.
A kind of device controlling CPU power consumption, comprising:
Screen refresh rate detection module, for detecting screen refresh rate FPS of display thread;
Processor core determining module, is used for obtaining the described display corresponding processor core of thread;
Processor frequencies adjustment module, for regulating this corresponding processor core of display thread according to the FPS of display thread
The running frequency of the heart;
Processor core adjusting module, for detecting the running frequency of described processor core, is detecting described process
When the running frequency of device core is more than threshold value, increase new processor core for described display thread.
Optionally, in one embodiment, described processor frequencies adjustment module is additionally operable to the FPS at described display thread
During less than a FPS threshold value, heighten the running frequency of this corresponding processor core of display thread;At described display thread
When FPS is higher than the 2nd FPS threshold value, turn down the running frequency of this corresponding processor core of display thread;Described 2nd FPS threshold value
Higher than a described FPS threshold value.
Optionally, in one embodiment, described processor frequencies adjustment module is additionally operable to the FPS at described display thread
During less than the 3rd FPS threshold value, described display thread is defined as being in idle state;Described 3rd FPS threshold value is less than described the
One FPS threshold value.
Optionally, in one embodiment, described device also includes processor core resource limit computing module, is used for obtaining
Take the data volume change of described display thread refresh process, according to described data volume change calculations processor core resource limit;
Described processor core adjusting module is additionally operable to according to described processor core resource limit regulating frequency or increasing
Add new processor core.
Optionally, in one embodiment, described processor core resource limit computing module is additionally operable to according to formula
M=(ABS (Xnew*Ynew Xold*Yold) | Npixel) * Byte
Calculate the data volume change of described display thread refresh process, wherein, after described Xnew*Ynew represents refreshing
Window size, described Xold*Yold represents the window size before refreshing, and described Npixel represents after refreshing relative to refreshing
Change pixel number before, described Byte represents each pixel size of data;
Described processor core resource limit computing module is additionally operable to according to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Calculating screen change percentage, wherein said P represents the quantity of display thread, and described Xtotal*Ytotal represents
Screen resolution, described Mi represents that the data volume of i-th display thread refresh process changes, described i=1,2 ..., P;
Then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
Calculating described processor core resource limit, wherein, described Nnew represents new online processor core quantity, institute
Stating Fnew and representing the peak frequency of new processor core, described Nmax represents available processors core amounts, described Fmax table
Show the limiting frequency of available processors core.
Implement the embodiment of the present invention, will have the advantages that
After have employed the method and apparatus of above-mentioned control CPU power consumption, the size of the screen refresh rate according to display thread
The running frequency of this corresponding processor core of display thread is adjusted, and according to each thread place that each and every one shows
Processor core and its corresponding running frequency, determining whether should be to the quantity of the processor core running and operation
Frequency is adjusted, and for example, increases new processor core to run display thread.It is to say, do not destroying any application
Operation logic and on the premise of screen display operation logic, actively the refresh case of the display related linear program that each is applied is entered
Row is analyzed, and is adjusted the running frequency of processor core and operation quantity according to analysis result, i.e. according to each
The demand of display thread accurately determines the stock number of its required processor core, and then the ensuing process of determination more optimizing
The quantity of device core and running frequency, on the premise of ensure that the performance of display thread, reduce the power consumption of terminal.
Detailed description of the invention
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
Describe, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments wholely.Based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work
Embodiment, broadly falls into the scope of protection of the invention.
It should be noted that the term using in embodiments of the present invention is only merely for the mesh describing 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 " being somebody's turn to do " are also intended to include most form, unless context clearly shows that other implications.It is also understood that this
The term "and/or" using in Wen refers to and comprises one or more any or all possible group listing project being associated
Close.
For solve in conventional art during application refreshes interface because the frequency of polycaryon processor or quantity with
The excessive technical problem of power consumption that the current operational factor of terminal is not mated and existed, in the present embodiment, spy proposes one
The method of control CPU power consumption, the realization of the method can be dependent on computer program, and this computer program can run on based on Feng Nuo
On computer system according to graceful system, this computer program can be the processor control application journey of the terminal of polycaryon processor
Sequence.This computer system can be to run the terminals such as the such as smart mobile phone of above computer program, panel computer, PC
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 combination in (Micro Controller Unit, MCU).And, the processor in the present embodiment is permissible
It is symmetric multi-core processor (Symmetrical Multi-Processing, SMP), it is also possible to be non-symmetric multi-core processor
(Asymmetric Multi-Processing, AMP).In addition, the terminal mentioned in the embodiment of the present invention can be smart mobile phone
(smart phone), panel computer (Tablet Personal Computer), car-mounted terminal, desktop computer (computer)
Etc..
Concrete, as it is shown in figure 1, the method for above-mentioned control CPU power consumption comprises the steps S102-S108, concrete:
Step S102: screen refresh rate FPS of detection display thread.
Refreshing frequency within the unit interval for the display content on screen refresh rate i.e. screen, in the present embodiment, permissible
It is the refreshing frequency in per second, i.e. FPS, Frames Per Second, transmission frame number per second on display screen.For example, general
The default screen refresh rate of computer display screen is 60Hz, and the refresh rate at the picture of the display screen display of computer i.e. per second is 60
Frame is per second.In general, in the case that resolution ratio is constant, screen refresh rate is higher, requires the disposal ability of processor also
Higher, for example, when the resolution ratio of picture is 1024 × 768, the refresh rate of picture to 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 risen to " 1024 × 768 × 50=39321600 " quickly.
From the point of view of the display interface of terminal, include multiple display unit, for example, in surfing Internet with cell phone interface, signal
Unit corresponding signal in hurdle shows, browser cell is corresponding is that web page contents shows, electricity control unit is corresponding is battery
The icon of electricity shows;Each display unit is a corresponding display thread, each display thread is responsible for corresponding display
The display data of window, and after each frame display data are ready, together with other display threads on whole show layers
The display data preparing carry out synthesizing to obtain the picture frame of whole display interface.It is to say, each display thread is aobvious
More new capital of registration evidence is independent of each other.
In the present embodiment, prospect application refresh rate in the terminal is analyzed in module, can refresh sub-line for each
The refresh rate of journey carries out independently tracked and statistical unit time each display thread interior refreshing frequency, thus show that each shows
The screen refresh rate of timberline journey.
Step S104: obtain the described display corresponding processor core of thread.
The process of each display thread is that processor completes, in the present embodiment, because the quantity of processor is
Multiple, therefore, the process of different display threads is probably what different processor cores completed.In the present embodiment, according to
Each display thread obtains corresponding processor core, i.e. determines each display thread just at which processor core
Run in the heart.
Step S106: regulate the running frequency of this corresponding processor core of display thread according to the FPS of display thread.
There is corresponding running frequency within a processor in each display thread, but, this running frequency is basis
Running status before terminal or the refresh rate before this display thread determine, can not be necessarily current with this display thread
Screen refresh rate be coupling.It is to say, need to determine corresponding process according to the current screen refresh rate of display thread
The running frequency of device core.Concrete, if the running frequency that the display corresponding screen refresh rate of thread requires is higher than currently displaying
During the running frequency of the corresponding processor core of thread, the running frequency of this corresponding processor core of display thread should be heightened;
Corresponding, if the flat rate of operation that the display corresponding screen refresh rate of thread requires is less than the corresponding processor core of currently displaying thread
During the running frequency of the heart, the running frequency of this corresponding processor core of display thread should be turned down, and, to processor core
The adjustment amount of running frequency is determined by the screen refresh rate of the display thread obtaining in step S102.
In a specific embodiment, in above-mentioned steps S104, described according to display thread FPS regulate this display line
In the step of the running frequency of the corresponding processor core of journey, specifically include: be less than a FPS at the FPS of described display thread
During threshold value, heighten the running frequency of this corresponding processor core of display thread;It is higher than second at the FPS of described display thread
During FPS threshold value, turn down the running frequency of this corresponding processor core of display thread;Described 2nd FPS threshold value is higher than described the
One FPS threshold value.
In the present embodiment, there is maximum in screen refresh rate, i.e. largest frames frequency, for example, it is possible to by largest frames frequency
It is set to 60 frames/second.Preset the threshold value of screen refresh rate, the i.e. the first FPS threshold value and the 2nd FPS threshold value, wherein the 2nd FPS
Threshold value is higher than a described FPS threshold value.For example, it is possible to arranging a FPS threshold value is 58 frames/second, the 2nd FPS threshold value be 50 frames/
Per second, when the screen refresh rate showing thread is more than 58 frames/second, illustrate that the processor core at this display thread place runs frequency
Rate is sufficient, can suitably lower the running frequency of processor core, and the disposal ability of i.e. corresponding processor core is too high, or
Person, in other embodiments, can also is that the relatively low processor core of serviceability processes above-mentioned display thread;At display thread
Screen refresh rate less than 50 frames/per second when, illustrate that the running frequency of the processor core at this display thread place is not enough, i.e. right
The processor disposal ability answered is not enough, needs to adjust upward the running frequency of processor core, or the higher place of serviceability
Reason device core.To sum up, when the FPS showing thread is less than a FPS threshold value, improve the disposal ability of processor core, showing
When the FPS of timberline journey is higher than the 2nd FPS threshold value, reduce the disposal ability of processor core.
In a specific embodiment, in the above-mentioned running frequency heightening or turning down processor core, new fortune
The calculating of line frequency can calculate according to equation below:
New_freq=old_freq*Good_FPS_THRESHOLD/current_fps
Wherein new_freq represents new running frequency, old_freq represent early regulate before the operation frequency of processor core
Rate, Good_FPS_THRESHOLD represents the 2nd FPS threshold value, and current_fps represents the display thread obtaining in step S102
Screen refresh rate.
Further, in an optional embodiment, in above-mentioned steps S104, the described FPS tune according to display thread
In the step of the running frequency saving this corresponding processor core of display thread, also include: be less than at the FPS of described display thread
During the 3rd FPS threshold value, described display thread is defined as being in idle state;Described 3rd FPS threshold value is less than a described FPS
Threshold value.
It is to say, when the screen refresh rate showing thread is less than the 3rd FPS threshold value, corresponding display thread pair is described
Not having demand in screen-refresh, in general, one relatively low numerical value during the 3rd FPS threshold value, for one for screen brush
Newly have normal refresh demand should for saying, the screen refresh rate of its corresponding show process should be greater than this relatively low the 3rd
FPS threshold value, so, screen refresh rate can be defined as being in idle shape less than the display thread of the 3rd FPS threshold value preset
State, is i.e. in idle condition, can be for the process resource of this display thread distribution processor core.For example, at one
In embodiment, the 3rd FPS threshold value can be set to 10 frames/second, when the screen refresh rate showing thread is less than 10 frames/second,
Corresponding display thread is defined as idle state.In another embodiment, the ideal value of the 3rd FPS threshold value be 0 frame/
Second.
Step S108: detect the running frequency of described processor core, is detecting the operation frequency of described processor core
When rate is more than threshold value, increase new processor core for described display thread.
In step s 106, the running frequency for each display thread is regulated, may after regulation
Occurring, the summation of the running frequency of the corresponding all of display thread of some processor core can exceed that this processor core
The load capacity of the heart, it is therefore desirable to be adjusted correspondingly.Concrete, detect each display corresponding processor core of thread
Running frequency, in this example it is shown that the corresponding processor core of thread can be one, it is also possible to be multiple.For
In display thread each processor core corresponding, detect its corresponding running frequency respectively.
From the point of view of processor core, preset a threshold value for its running frequency, when running flat rate more than this threshold value,
Illustrate that the load of this processor core is excessive, be the performance ensureing processor core, and avoid this processor core
Disposal ability deficiency causes the situation of card, it is necessary to increase the disposal ability of processor core, and being display thread increases new
Processor core, will partly show that the operation of thread is distributed to the processor core that newly increases and run.
It should be noted that in the present embodiment, new determining whether to increase according to the running frequency of processor core
During processor core, i.e. during the quantity of the processor core determining after adjusting, in addition it is also necessary to calculating process
Device core resource limit.Concrete, obtain the data volume change of described display thread refresh process, change according to described data volume
Computation processor core resource limit;Also include after the running frequency of the described processor core of described detection: according to described place
Manage device core resource limit regulating frequency or increase new processor core.
For each refresh sub-line journey refreshing content carry out independently tracked during, detect corresponding display in
The situation of change held, is analyzed to the change of refreshing content each time, concrete, shows thread for each, obtains each
Window size before and after secondary refreshing, i.e. Xnew*Ynew represents the window size after refreshing, before Xold*Yold represents refreshing
Window size, say, that ABS (Xnew*Ynew Xold*Yold) represents the display window change feelings before and after refreshing every time
Condition.It is also possible that obtain the quantity of the pixel of change in the image frame before and after refreshing every time, after i.e. Npixel represents refreshing
Relative to the change pixel number before refreshing.It is to say, show thread for each, according to formula
M=(ABS (Xnew*Ynew Xold*Yold) | Npixel) * Byte
Calculating the data volume change of display thread refresh process, wherein M represents this number in refresh process for display thread
According to amount change, Byte represents each pixel size of data, for example, RGB888, RGB565, YUV422 etc..
If terminal is altogether corresponding P display thread, calculate each data volume showing the corresponding refresh process of thread
Change, i.e. M1, M2 ..., MP, wherein Mi represents that the data volume of i-th display thread refresh process changes, described i=1,
2 ..., P.
During above-mentioned calculating computation processor core resource limit, can be according to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Calculate screen change percentage Percentage, then according to formula
Nnew*Fnew=Nmax*Fmax*Percentage
Calculate described processor core resource limit, wherein, Xtotal*Ytotal represents screen resolution, i.e. screen
Size, Nnew represents new online processor core quantity, and Fnew represents the peak frequency of new processor core, and Nmax represents
Available processors core amounts, Fmax represents the limiting frequency of available processors core.It is to say, use said method protecting
While having demonstrate,proved each display thread refresh rate (i.e. performance priority), again restriction is made that to the resource of overall processor core
(i.e. tending to power consumption preferential), it is achieved thereby that the display performance power dissipation ratio of optimum, on the premise of ensure that Consumer's Experience, control
Make the power consumption of terminal.
Additionally, for solve in conventional art during application refreshes interface because the frequency of polycaryon processor or number
Measure the operational factor current with terminal not mate and the excessive technical problem of the power consumption that exists, in one embodiment, such as Fig. 2 institute
Show, it is also proposed that a kind of device controlling CPU power consumption, including screen refresh rate detection module the 102nd, processor core determining module
104th, processor frequencies adjustment module 106 and processor core adjusting module 108, wherein:
Screen refresh rate detection module 102, for detecting screen refresh rate FPS of display thread;
Processor core determining module 104, is used for obtaining the described display corresponding processor core of thread;
Processor frequencies adjustment module 106, for regulating this corresponding processor of display thread according to the FPS of display thread
The running frequency of core;
Processor core adjusting module 108, for detecting the running frequency of described processor core, is detecting described place
When the running frequency of reason device core is more than threshold value, increase new processor core for described display thread.
Optionally, in one embodiment, processor frequencies adjustment module 106 is additionally operable to the FPS at described display thread
During less than a FPS threshold value, heighten the running frequency of this corresponding processor core of display thread;At described display thread
When FPS is higher than the 2nd FPS threshold value, turn down the running frequency of this corresponding processor core of display thread;Described 2nd FPS threshold value
Higher than a described FPS threshold value.
Optionally, in one embodiment, processor frequencies adjustment module 106 is additionally operable to the FPS at described display thread
During less than the 3rd FPS threshold value, described display thread is defined as being in idle state;Described 3rd FPS threshold value is less than described the
One FPS threshold value.
Optionally, in one embodiment, as in figure 2 it is shown, said apparatus also includes that processor core resource limit calculates
Module 110, for obtaining the data volume change of described display thread refresh process, according to described data volume change calculations processor
Core resource limit;Processor core adjusting module 108 be additionally operable to according to described 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
Calculate the data volume change of described display thread refresh process, wherein, after described Xnew*Ynew represents refreshing
Window size, described Xold*Yold represents the window size before refreshing, and described Npixel represents after refreshing relative to refreshing
Change pixel number before, described Byte represents each pixel size of data;Described processor core resource limit 110 is counted
Calculate module to be additionally operable to according to formula
Percentage=(M1+M2+M3+ ...)/(P*Xtotal*Ytotal)
Calculating screen change percentage, wherein said P represents the quantity of display thread, and described Xtotal*Ytotal represents
Screen resolution, described Mi represents that the data volume of i-th display thread refresh process changes, described i=1,2 ..., P;Then root
According to formula
Nnew*Fnew=Nmax*Fmax*Percentage (screen change percentage)
Calculating described processor core resource limit, wherein, described Nnew represents new online processor core quantity, institute
Stating Fnew and representing the peak frequency of new processor core, described Nmax represents available processors core amounts, described Fmax table
Show the limiting frequency of available processors core.
Implement the embodiment of the present invention, will have the advantages that
After have employed the method and apparatus of above-mentioned control CPU power consumption, the size of the screen refresh rate according to display thread
The running frequency of this corresponding processor core of display thread is adjusted, and according to each thread place that each and every one shows
Processor core and its corresponding running frequency, determining whether should be to the quantity of the processor core running and operation
Frequency is adjusted, and for example, increases new processor core to run display thread.It is to say, do not destroying any application
Operation logic and on the premise of screen display operation logic, actively the refresh case of the display related linear program that each is applied is entered
Row is analyzed, and is adjusted the running frequency of processor core and operation quantity according to analysis result, i.e. according to each
The demand of display thread accurately determines the stock number of its required processor core, and then the ensuing process of determination more optimizing
The quantity of device core and running frequency, on the premise of ensure that the performance of display thread, reduce the power consumption of terminal.
In one embodiment, as it is shown on figure 3, Fig. 3 illustrate a kind of method running above-mentioned control CPU power consumption based on
The terminal of the computer system of von Neumann system.This computer system can be smart mobile phone, panel computer, palm PC,
The terminal device such as notebook computer or PC.Concrete, it may include the outer input interface being connected by system bus
1001st, processor the 1002nd, memory 1003 and output interface 1004.Wherein, outer input interface 1001 optionally can at least wrap
Include network interface 10012.Memory 1003 can include external memory 10032 (such as hard disk, CD or floppy disk etc.) and interior storage
Device 10034.Output interface 1004 can at least include display screen 10042 grade equipment.
In the present embodiment, the operation of this method is stored in based on computer program, the program file of this computer program
It in the external memory 10032 of the aforementioned computer system based on von Neumann system, is operationally loaded into built-in storage
It in 10034, is transferred to after being then compiled as machine code in processor 1002 perform, so that based on von Neumann system
Computer system in form the 102nd, processor core determining module the 104th, the processor of screen refresh rate detection module in logic
Frequency adjustment module 106 and processor core adjusting module 108.And during the method for above-mentioned control CPU power consumption performs,
The parameter of input is all received by outer input interface 1001, and is transferred in memory 1003 caching, is then input to process
Processing in device 1002, the result data of process or be cached in memory 1003 is subsequently processed, or is passed to
Output interface 1004 exports.
The above disclosed present pre-ferred embodiments that is only, can not limit the right model of the present invention with this certainly
Enclose, the equivalent variations therefore made according to the claims in the present invention, still belong to the scope that the present invention is covered.