CN105892615A - CPU load collecting method and device - Google Patents

CPU load collecting method and device Download PDF

Info

Publication number
CN105892615A
CN105892615A CN201510971294.7A CN201510971294A CN105892615A CN 105892615 A CN105892615 A CN 105892615A CN 201510971294 A CN201510971294 A CN 201510971294A CN 105892615 A CN105892615 A CN 105892615A
Authority
CN
China
Prior art keywords
processor
pattern
load value
cpu
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510971294.7A
Other languages
Chinese (zh)
Inventor
谢国锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Original Assignee
LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LeTV Mobile Intelligent Information Technology Beijing Co Ltd filed Critical LeTV Mobile Intelligent Information Technology Beijing Co Ltd
Priority to CN201510971294.7A priority Critical patent/CN105892615A/en
Publication of CN105892615A publication Critical patent/CN105892615A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3243Power saving in microcontroller unit

Abstract

The invention provides a CPU (Central Processing unit) load collecting method, which comprises the following steps of taking a frequency regulating mode of a CPU; if the frequency regulating mode is an interactive mode, judging whether the CPU is at a highest frequency or not; if the CPU is at the highest frequency, generating a load value in a simulative way according to the highest frequency; and sending the load value to a CPU hot plug module. When the CPU in the interactive mode is at the highest frequency, the CPU load value collection is not performed; by using a mode of generating the load value in the simulative way, the goal of sharing the CPU load value by the CPU hot plug module and a CPU frequency regulating module is achieved; the two modules do not need the single processor load value calculation; the operation steps are simplified; the system burden is reduced; and the energy is saved.

Description

A kind of processor load collection method and device
Technical field
The present invention relates to field of processors, be specifically related to a kind of central processing unit load collection method and dress Put.
Background technology
Universal along with smart mobile phone, the performance of present smart mobile phone the most from strength to strength, mobile phone Energy consumption also increases.Although handset capability is more and more high-end, price is more cheap, but mobile phone The pain spot of continuation of the journey always Consumer's Experience, user denounces major part here, how to carry to intelligent machine The cruising time of high battery also becomes study hotspot and difficult point.Revolutionary raising is not had at battery technology Before, optimize system resource, reduce the system occupancy to resource, indirectly in just extend the continuous of battery The boat cycle.
The central processing unit (CPU) of mobile phone is one piece of ultra-large integrated circuit, and its major function is Data in interpreter directive and processing routine software, powerful due to CPU, energy consumption is also The biggest.In CPU runs, during to cpu frequency adjustment and CPU hot plug, need to carry out CPU The collection of load.It is provided with CPUfreq governor (cpu frequency adjusting module) in an operating system With CPU hotplug (CPU hot plug template), CPUfreq governor is used for dynamically adjusting CPU Frequency, CPU hotplug is for controlling the hot plug of multiple CPU core.
Owing to CPUfrequency driver exists several adjustable strategies governor, the most general bag Include 6 kinds of adjustable strategies, be respectively as follows: first mode ondemand (on-demand pattern), the second pattern Conservative (conservative mode), the 3rd pattern interactive (interactive mode), fourth mode Powersave (energy saver mode), the 5th pattern performance (performance preference mode), the 6th pattern Userspace (user model), wherein first mode ondemand, the second pattern conservative and 3rd pattern interactive governor needs to collect CPU loading value and carries out cpu frequency regulation , remaining Three models need not collect cpu load value.First mode ondemand and second The mode that pattern conservative governor collects CPU loading value is the same, interactive Governor pattern is in order to strengthen the user interactivity of android system, at regulation and collection CPU Loading load aspect is different, when CPU is in highest frequency, would not carry out Acquiring of CPUloading value.
In prior art, CPUfreq governor (uses first mode ondemand, the second pattern Conservative or the 3rd pattern interactive) and the process of CPU hotplug need to obtain CPU Load value i.e. CPUloading, as it is shown in figure 1, due to CPUfreq governor and CPU hotplug It is independent module, the regulation carrying out CPU loading value the most independent of each other.So, increase undoubtedly Add system burden, consume more energy.
Summary of the invention
Therefore, the technical problem to be solved in the present invention is to overcome CPUfreq of the prior art Governor and CPU hotplug cpu load of collecting independently causes the defect that energy consumption is high.
The present invention provides a kind of processor load collection method, comprises the steps:
Obtain the frequency adjustment modes of processor frequencies adjusting module;
If described frequency adjustment modes is the 3rd pattern, then judge whether described processor is in high frequency Rate, if being in highest frequency, then generates load value according to highest frequency simulation, and by described load value It is sent to hot plug of processor module.
Preferably, also include:
If described frequency adjustment modes is first mode or the second pattern, then adjusted by processor frequencies Module collection load value, and described load value is sent to hot plug of processor module.
Preferably, if also including, described frequency adjustment modes is the 3rd pattern, and described processor is not at During highest frequency, collect load value by processor frequencies adjusting module, and described load value is sent To hot plug of processor module.
Preferably, described first mode is ondemand, and the second pattern is conservative, the 3rd mould Formula is interactive.
The present invention provides a kind of mobile terminal using described processor load collection method.
The present invention provides a kind of processor load collection device, including:
Pattern acquiring unit, for obtaining the frequency adjustment modes of processor frequencies adjusting module;
First collector unit, if being the 3rd pattern for described frequency adjustment modes, then judges described place Whether reason device is in highest frequency, if being in highest frequency, then generates load according to highest frequency simulation Value, and described load value is sent to hot plug of processor module.
Preferably, also include:
Second collector unit, if being first mode or the second pattern for described frequency adjustment modes, then Collect load value by processor frequencies adjusting module, and described load value is sent to processor heat inserts Withdrawing pattern block.
Preferably, also include the 3rd collector unit, if described frequency adjustment modes is the 3rd pattern, institute State processor when being not at highest frequency, collect load value by processor frequencies adjusting module, and will Described load value is sent to hot plug of processor module.
Preferably, described first mode is ondemand, and the second pattern is conservative, the 3rd mould Formula is interactive.
Technical solution of the present invention, has the advantage that
1. the processor load collection method that the present invention provides, including the frequency adjustment modes taking processor; If described frequency adjustment modes is the 3rd pattern interactive, then judge whether described processor is in Altofrequency, if being in highest frequency, then generates load value according to highest frequency simulation, and by described negative Load value is sent to hot plug of processor module.Owing under interactive pattern, processor is in high frequency The when of rate, do not carry out the collection of cpu load value, by the way of simulation generates load value, it is achieved Hot plug of processor module and processor frequencies adjusting module common processor load value, the two mould Block, without individually carrying out the calculating of processor load value, simplifies operating procedure, and the system that reduces is born Load, has saved energy.
Processor load collection method the most of the present invention, when frequency adjustment modes is first mode When ondemand or the second pattern conservative, collection strategy can be loaded by common processor Carry out load to collect, and this load value is sent to hot plug of processor module shares, it is achieved thereby that Processor frequencies adjusting module and hot plug of processor module the most once load collection, simplify behaviour Make step, save energy consumption.
Accompanying drawing explanation
In order to be illustrated more clearly that the specific embodiment of the invention or technical scheme of the prior art, under The accompanying drawing used required in detailed description of the invention or description of the prior art will be briefly described by face, It should be evident that the accompanying drawing in describing below is some embodiments of the present invention, general for this area From the point of view of logical technical staff, on the premise of not paying creative work, it is also possible to obtain according to these accompanying drawings Obtain other accompanying drawing.
Fig. 1 is the flow chart that in prior art, processor load is collected
Fig. 2 is the overall flow figure of processor load collection method in the embodiment of the present invention 1;
Fig. 3 is the collection process flow diagram flow chart of processor load collection method in the embodiment of the present invention 1;
Fig. 4 is a structured flowchart of processor load collection device in the embodiment of the present invention 2.
Detailed description of the invention
Below in conjunction with accompanying drawing, technical scheme is clearly and completely described, it is clear that Described embodiment is a part of embodiment of the present invention rather than whole embodiments.Based on this Embodiment in bright, those of ordinary skill in the art are obtained under not making creative work premise Every other embodiment, broadly fall into the scope of protection of the invention.
In describing the invention, it should be noted that term " first ", " second ", " the 3rd " It is only used for describing purpose, and it is not intended that indicate or hint relative importance.Additionally, retouched below As long as technical characteristic involved in the difference embodiment of the present invention stated just does not constitutes conflict each other Can be combined with each other.
Embodiment 1
The present embodiment provides a kind of processor load collection method, can be used for smart mobile phone or other intelligence In the operating system of energy terminal unit, its objective is so that processor frequencies adjusting module (CPUfreq Governor) share one load collection strategy with hot plug of processor module (CPU hotplug).
Processor load collection method in the present embodiment comprises the steps, as shown in Figures 2 and 3:
S1, the frequency adjustment modes of acquisition processor frequencies adjusting module.
Owing to CPUfrequency driver exists several adjustable strategies governor, the most general bag Include 6 kinds of adjustable strategies, be respectively as follows: first mode ondemand, the second pattern conservative, 3rd pattern interactive, fourth mode powersave, the 5th pattern performance, the 6th mould Formula userspace, wherein first mode ondemand, the second pattern conservative and the 3rd pattern Interactive governor needs to collect CPU loading value and carries out cpu frequency regulation, remaining Three models (fourth mode powersave, the 5th pattern performance, the 6th pattern userspace) Need not collect cpu load value, the most do not exist and share loading value with CPUhotplug module , therefore the present embodiment need not consider.First mode ondemand and the second pattern conservative Governor collect CPU loading mode the same, the 3rd pattern interactive governor in order to Strengthen the user interactivity of android system, be to have in terms of regulation and collection CPU loading load Different.So during processing collection CPU loading, system to be distinguished is used is first Pattern ondemand, the second pattern conservative governor or the 3rd pattern interactive governor。
CPUfrequency driver loads in android system start-up course, CPUhotplug Driver is also to load in this stage, the order that both do not load, but for the starting up speed of system, The startup time of CPUhotplug driver should be postponed.
S2, when two driver loadeds, and CPUhotplug driver delay start time-out After, both carry out adopting of CPU loading for the pattern of different CPUfrequency governor Collection operation.
When system uses interactive governor chirping strategies when, due to interactive Governor is for some mutual characteristics, such as when CPU is in highest frequency when, and would not Carry out the collection of CPU loading, and after being to wait for idle, carry out the collection of loading, if also It is the method gathering loading with ondemand governor, the receipts that CPUhotplug can not be real-time Collection is to CPU loading value.The processing method now used be for: if described frequency adjustment modes is Three patterns interactive, then judge whether described processor is in highest frequency, if being in highest frequency, Then generating load value according to highest frequency simulation, the load value that general simulation generates is chosen as 95%-100%, and described load value is sent to hot plug of processor module.If described frequency adjusts mould Formula is the 3rd pattern interactive, when described processor is not at highest frequency, passes through processor frequencies Adjusting module collects load value, now with first mode ondemand and the second pattern conservative The load collection mode of governor is identical, and described load value is sent to hot plug of processor module CPUhotplug.Owing to, the when that under interactive pattern, processor being in highest frequency, not carrying out The collection of cpu load value, by the way of simulation generates load value, it is achieved that hot plug of processor mould Block and processor frequencies adjusting module common processor load value, the two module is without individually carrying out The calculating of processor load value, simplifies operating procedure, reduces system burden, has saved energy.
If described frequency adjustment modes is first mode ondemand or the second pattern conservative, Then collect load value by processor frequencies adjusting module, and described load value is sent to processor heat Plug-in module.When frequency adjustment modes is first mode ondemand and the second pattern conservative The when of governor, both can share CPU loading acquisition strategies, and concrete acquisition strategies is: The percentage ratio of total time shared by the busy of the CPU in collection certain time, such as busy 5 milliseconds, free time 5 milliseconds, then the CPUloading value in 10 milliseconds is 50%.It is achieved thereby that processor frequencies is adjusted Mould preparation block and hot plug of processor module the most once load collection, simplify operating procedure, save Energy consumption.
As long as system is in the operation phase, CPUfreq and CPUhotplug driver both coexists , proceed as described above circular treatment.
In order to reduce the waste of system resource so that processor frequencies adjusting module and hot plug of processor The CPU loading numerical value collection of module merges process, thus reduces CPU and gather and calculate The time of loading numerical value, reduce energy consumption.
The present embodiment also provides for a kind of mobile terminal device made in aforementioned manners, such as mobile phone, ipad Deng.
Embodiment 2
A kind of processor load collection device of offer in the present embodiment, as shown in Figure 4, including:
Pattern acquiring unit 01, for obtaining the frequency adjustment modes of processor frequencies adjusting module;
First collector unit 02, if being the 3rd pattern for described frequency adjustment modes, then judges described Whether processor is in highest frequency, if being in highest frequency, then generates negative according to highest frequency simulation Load value, and described load value is sent to hot plug of processor module.
Further, also include:
Second collector unit 03, if being first mode or the second pattern for described frequency adjustment modes, Then collect load value by processor frequencies adjusting module, and described load value is sent to processor heat Plug-in module.
Further, also include the 3rd collector unit 04, if described frequency adjustment modes is the 3rd pattern, When described processor is not at highest frequency, collect load value by processor frequencies adjusting module, and Described load value is sent to hot plug of processor module.
Wherein, described first mode is ondemand, and the second pattern is conservative, the 3rd pattern For interactive.
Processor load collection device in the present embodiment card, it is achieved that hot plug of processor module and place Reason device frequency regulation block common processor load value, the two module is without individually carrying out processor The calculating of load value, simplifies operating procedure, reduces system burden, has saved energy.
Those skilled in the art it should be appreciated that embodiments of the invention can be provided as method, system, Or computer program.Therefore, the present invention can use complete hardware embodiment, complete software to implement Example or the form of the embodiment in terms of combining software and hardware.And, the present invention can use at one Or multiple wherein include computer usable program code computer-usable storage medium (include but not It is limited to disk memory, CD-ROM, optical memory etc.) shape of the upper computer program implemented Formula.
The present invention is with reference to method, equipment (system) and computer program according to embodiments of the present invention The flow chart of product and/or block diagram describe.It should be understood that stream can be realized by computer program instructions In each flow process in journey figure and/or block diagram and/or square frame and flow chart and/or block diagram Flow process and/or the combination of square frame.These computer program instructions can be provided to general purpose computer, specially With the processor of computer, Embedded Processor or other programmable data processing device to produce one Machine so that the instruction performed by the processor of computer or other programmable data processing device is produced Raw for realizing one flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple side The device of the function specified in frame.
These computer program instructions may be alternatively stored in and computer or other programmable datas can be guided to process In the computer-readable memory that equipment works in a specific way so that be stored in this computer-readable and deposit Instruction in reservoir produces the manufacture including command device, and this command device realizes flow chart one The function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded into computer or other programmable data processing device On so that on computer or other programmable devices, perform sequence of operations step to produce computer The process realized, thus the instruction performed on computer or other programmable devices provides and is used for realizing One flow process of flow chart or multiple flow process and/or one square frame of block diagram or multiple square frame are specified The step of function.
Obviously, above-described embodiment is only for clearly demonstrating example, and not to embodiment party The restriction of formula.For those of ordinary skill in the field, the most also may be used To make other changes in different forms.Here without also all of embodiment being given With exhaustive.And the obvious change thus extended out or variation are still in the guarantor of the invention Protect among scope.

Claims (9)

1. a processor load collection method, it is characterised in that comprise the steps:
Obtain the frequency adjustment modes of processor frequencies adjusting module;
If described frequency adjustment modes is the 3rd pattern, then judge whether described processor is in high frequency Rate, if being in highest frequency, then generates load value according to highest frequency simulation, and by described load value It is sent to hot plug of processor module.
Method the most according to claim 1, it is characterised in that also include:
If described frequency adjustment modes is first mode or the second pattern, then adjusted by processor frequencies Module collection load value, and described load value is sent to hot plug of processor module.
Method the most according to claim 1, it is characterised in that if described frequency adjustment modes is 3rd pattern, when described processor is not at highest frequency, is collected by processor frequencies adjusting module Load value, and described load value is sent to hot plug of processor module.
Method the most according to claim 1, it is characterised in that described first mode is Ondemand, the second pattern is conservative, and the 3rd pattern is interactive.
5. the mobile terminal using the arbitrary described processor load collection method of claim 1-4.
6. a processor load collection device, it is characterised in that including:
Pattern acquiring unit, for obtaining the frequency adjustment modes of processor frequencies adjusting module;
First collector unit, if being the 3rd pattern for described frequency adjustment modes, then judges described place Whether reason device is in highest frequency, if being in highest frequency, then generates load according to highest frequency simulation Value, and described load value is sent to hot plug of processor module.
Device the most according to claim 6, it is characterised in that also include:
Second collector unit, if being first mode or the second pattern for described frequency adjustment modes, then Collect load value by processor frequencies adjusting module, and described load value is sent to processor heat inserts Withdrawing pattern block.
8. according to the device described in claim 6 or 7, it is characterised in that also include that the 3rd collection is single Unit, if described frequency adjustment modes is the 3rd pattern, when described processor is not at highest frequency, logical Cross processor frequencies adjusting module and collect load value, and described load value is sent to hot plug of processor Module.
Device the most according to claim 8, it is characterised in that described first mode is Ondemand, the second pattern is conservative, and the 3rd pattern is interactive.
CN201510971294.7A 2015-12-22 2015-12-22 CPU load collecting method and device Pending CN105892615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510971294.7A CN105892615A (en) 2015-12-22 2015-12-22 CPU load collecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510971294.7A CN105892615A (en) 2015-12-22 2015-12-22 CPU load collecting method and device

Publications (1)

Publication Number Publication Date
CN105892615A true CN105892615A (en) 2016-08-24

Family

ID=57002515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510971294.7A Pending CN105892615A (en) 2015-12-22 2015-12-22 CPU load collecting method and device

Country Status (1)

Country Link
CN (1) CN105892615A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442226A (en) * 2019-08-09 2019-11-12 上海工程技术大学 A kind of the particular task terminal handler frequency modulation method and device of task based access control type
CN111324198A (en) * 2020-03-18 2020-06-23 深圳市亿晟科技有限公司 Method for dynamically adjusting frequency and voltage of android device according to load

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122008A1 (en) * 2007-12-13 2010-05-13 Texas Instruments Incorporated Interrupt morphing and configuration, circuits, systems, and processes
CN102520782A (en) * 2011-12-15 2012-06-27 江苏中科梦兰电子科技有限公司 Power supply management method based on automatic adjustment of processor nuclear number
CN102566739A (en) * 2012-01-06 2012-07-11 威盛电子股份有限公司 Multicore processor system and dynamic power management method and control device thereof
CN104423529A (en) * 2013-08-30 2015-03-18 华为技术有限公司 CPU (central processing unit) state adjustment method and device
CN104516480A (en) * 2014-12-08 2015-04-15 广东欧珀移动通信有限公司 Method and device for reducing system power consumption
CN104731740A (en) * 2013-12-23 2015-06-24 联芯科技有限公司 Hot-swap control method and hot-swap control device for multi-core central processing units in terminals

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100122008A1 (en) * 2007-12-13 2010-05-13 Texas Instruments Incorporated Interrupt morphing and configuration, circuits, systems, and processes
CN102520782A (en) * 2011-12-15 2012-06-27 江苏中科梦兰电子科技有限公司 Power supply management method based on automatic adjustment of processor nuclear number
CN102566739A (en) * 2012-01-06 2012-07-11 威盛电子股份有限公司 Multicore processor system and dynamic power management method and control device thereof
US20130179710A1 (en) * 2012-01-06 2013-07-11 Via Technologies, Inc. Multi-core processor system, dynamic power management method thereof and control apparatus thereof
CN104423529A (en) * 2013-08-30 2015-03-18 华为技术有限公司 CPU (central processing unit) state adjustment method and device
CN104731740A (en) * 2013-12-23 2015-06-24 联芯科技有限公司 Hot-swap control method and hot-swap control device for multi-core central processing units in terminals
CN104516480A (en) * 2014-12-08 2015-04-15 广东欧珀移动通信有限公司 Method and device for reducing system power consumption

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442226A (en) * 2019-08-09 2019-11-12 上海工程技术大学 A kind of the particular task terminal handler frequency modulation method and device of task based access control type
CN110442226B (en) * 2019-08-09 2023-05-30 上海工程技术大学 Task type-based frequency modulation method and device for specific task terminal processor
CN111324198A (en) * 2020-03-18 2020-06-23 深圳市亿晟科技有限公司 Method for dynamically adjusting frequency and voltage of android device according to load
CN111324198B (en) * 2020-03-18 2023-08-18 深圳市亿晟科技有限公司 Method for dynamically adjusting frequency and voltage of android device according to load

Similar Documents

Publication Publication Date Title
CN109829332B (en) Joint calculation unloading method and device based on energy collection technology
CN110536342A (en) A kind of network mode control method and terminal, storage medium
US10193386B2 (en) Wireless charging method and system, wireless charging device and wearable device
CN103838353B (en) A kind of method and terminal of control processor operation
CN105893148B (en) A kind of accidental task low energy consumption dispatching method based on RM strategy
CN103475754B (en) Based on personal information switch and the method for intelligent watch
CN102215481B (en) Mobile terminal and resource downloading method
CN109819046A (en) A kind of Internet of Things virtual computing resource dispatching method based on edge cooperation
CN103686876B (en) The method and a kind of electronic equipment of a kind of information processing
CN104142907B (en) Enhanced processor, processing method and electronic equipment
CN105975049B (en) A kind of accidental task low energy consumption dispatching method of tasks synchronization
CN105892615A (en) CPU load collecting method and device
CN105893141A (en) Regulation control method and apparatus for multi-core processor and mobile terminal using method
CN105467932A (en) Method and device for optimizing heating of terminal system
CN103631649A (en) Interrupt processing method and device and interrupt controller
CN101655711B (en) Device for acquiring and processing plant-level automatic generation control instruction
CN107820322A (en) A kind of method for network access, terminal and the device with store function
CN109800510A (en) A kind of method, system and the equipment of FPGA placement-and-routing
CN110958562B (en) Modulation mode selection method, near field communication device and storage medium
CN105359489A (en) Method, device and system for scheduling resources
CN108279934A (en) Server B IOS performance parameters setting method, device and storage medium
CN103249118A (en) Wireless access point selection method and electronic terminals
CN102438230A (en) Terminal and data service processing method
CN108810943A (en) A kind of configuration method, user equipment and network side equipment
CN105744046B (en) A kind of information processing method and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160824