Adjust the control method and the system of operation frequency of microprocessor
Technical field
The present invention relates to a kind of control method and system that adjusts operation frequency of microprocessor, especially relate to the control method and the system of the operation frequency of microprocessor under a kind of enclosed environment.
Background technology
Development along with extensive integrated electronic technology, the runnability of computer and household electrical appliance is more and more higher, and as " heart " of computer and household electrical appliance or the microprocessor of " brain ", its frequency speed promotes significantly, and the power consumption of respective microprocessor also increases considerably.Microprocessor moves for a long time, and the silicon semiconductor of its microprocessor the inside will produce a large amount of heats, if can not in time dissipate the heat of its generation, will cause temperature too high and burnt.Therefore the heat dissipation problem of microprocessor is a great problem of industry.Use experience by reality finds that the microprocessor in the existing PC system all is the state that leaves unused in most of times, but still can keep the frequency of operation of full retaining.
Chinese invention patent Granted publication number No. 1153118 patent, providing a kind of is having under the environment of operating system, utilize pending (Idle) that the microprocessor executive operating system sends thus the program of signal realizes understanding the working clock frequency that the current utilization rate of microprocessor changes microprocessor.Just when present microprocessor utilization rate is quite low, can dynamically, suitably turn down the frequency of operation of microprocessor, can thereby not cause microprocessor to carry out the reduction of the speed of going up on the one hand, also can reach the purpose of power saving and cooling on the other hand.
Yet, this patent fails to solve in a kind of enclosed environment, this enclosed environment is to refer in particular to user's software environment of installing operating system and increase and decrease function voluntarily, for example: with the software environment that the audio/video hardware device is combined into one, the software environment under referring in the household appliances especially.Usually said operating system is meant resource management, promptly between the program of vying each other, control in an orderly manner processor, internal memory and other I/O interfacing equipment, the resources allocation of archives economy and management, and this supervisor ordered control just needs to solve by pending (Idle) signal.Therefore this patent can't solve the change that realizes operation frequency of microprocessor under enclosed environment.
This enclosed environment is mainly concerned with the environment of the decoding computing of the bigger audio/video file of deal with data amount, because this audio/video file storage capability is bigger, need form the less audio/video compressed file of memory capacity after overcompression and encoding process, this kind audio/video File Compress specification includes: MPEG (Motion Pictures Expert Group), WMA (Windows Media Audio), AVI (Audio Video Interleave) or the like.When the video file of playing after overcompression, just need be by microprocessor to this document computing of decoding.
Thus, be necessary to provide a kind of control method and system that under enclosed environment, also can change the frequency of operation of microprocessor.
Summary of the invention
The object of the present invention is to provide a kind of control method and system of the adjustment operation frequency of microprocessor under enclosed environment.
According to the foregoing invention purpose, the present invention proposes a kind of control method of adjusting operation frequency of microprocessor, and it comprises the following steps:
The first step: at first when being written into an audio/video data section and obtain this data section reproduction time and stored;
Second step: then by microprocessor decode this data section and dynamic memory decode time simultaneously;
The 3rd step: according to reproduction time of being stored and dynamic decoder time, the ratio that calculates dynamic decoder time and reproduction time is also stored with the current utilization rate that obtains microprocessor.
The 4th step: the working clock frequency that comes control microprocessor according to the current utilization rate of being stored.
According to the foregoing invention purpose, the present invention proposes a kind of control system of adjusting operation frequency of microprocessor, and it comprises: one is used for microprocessor that audio/video data section is decoded; The storer that links to each other with microprocessor is used to store the reproduction time and the dynamic decoder time of this video data section; Counter, the ratio that is used to calculate decode time and reproduction time calculates the current utilization rate of this microprocessor and delivers to storer and stored; Controller all links to each other with microprocessor with storer, and it changes the working clock frequency of this microprocessor according to the current utilization rate that storer is stored.
The control method of adjustment operation frequency of microprocessor disclosed in this invention and system, its advantage shows: under the lower situation of microprocessor utilization rate, and under enclosed environment the working clock frequency of achieve effective control microprocessor, thereby can reach the effect that reduces power consumption and reduce temperature.
Description of drawings
Fig. 1 is used to adjust the process flow diagram of the control method of operation frequency of microprocessor for the present invention.
Fig. 2 is the structural drawing of the control system that is used to adjust microprocessor among the present invention.
Fig. 3 is the graph of a relation of current microprocessor utilization rate among the present invention and microprocessor work clock frequency.
Embodiment
The present invention illustrates at general situation under enclosed environment, this enclosed environment is to refer in particular to user's software environment of installing operating system and increase and decrease function voluntarily, for example:, refer to software environment affiliated in the household appliances especially with the software environment that the audio/video hardware device is combined into one.Yet for the those skilled in the art in this field; can principle according to the present invention make amendment; also can be applicable to battery-driven smart machine; these equipment need be saved the power of battery; cell phone for example; PDA(Personal Digital Assistant) and the battery backed system of portable this class of audio/video player are all in protection scope of the present invention.
Present video standard has two kinds: NTSC (National Television SystemsCommittee) standard and PAL (Phase Alternating Line) standard.Under the NTSC standard, play 30 width of cloth pictures, under the PAL standard, play 25 width of cloth pictures, just can calculate the reproduction time T1 of above-mentioned each picture by above data easily for per second for per second.According to above-mentioned standard, one audio/video compressed file comprises the data section that several are continuous, and the reproduction time of playing each data section is also followed above-mentioned standard and is obtained, after being written into this video compress file, microprocessor need be to this document action of decoding, and the decoding action need be carried out the computing of large amount of complex by microprocessor, just produce decode time T2, after the decoding release, microprocessor just is in idle condition, it produces a standby time is T3, and promptly reproduction time T1 deducts the value of decode time T2.When standby time that obtains microprocessor behind the T3, T3 and known decode time T2 carry out ratio with this standby time, and this ratio is exactly the current utilization rate of microprocessor.Because the current utilization rate of microprocessor and the working clock frequency relation in direct ratio of microprocessor, it concerns that situation can consult Fig. 3.Just can adjust the working clock frequency of microprocessor thus according to the current utilization rate of this microprocessor, can reach purpose of power saving.Such as hypothesis the reproduction time T1 of one section video data section being arranged was 10 seconds, and the decode time T2 that microprocessor carried out was 1 second, so microprocessor is just idle 10-1=9 second is T3 standby time, according to above result, just the execution speed of microprocessor can be reduced to one one-tenth, make the microprocessor action of in the time in 10 seconds, decoding, suppose that this microprocessor is the Pentium II microprocessor of 266MHz, just can adjust it and be operated in the 26.6MHz clock frequency.
According to foregoing invention thought, and consult Fig. 1, concrete implementation step of the present invention is as follows:
The first step: at first be written into audio/video data section obtain simultaneously this data section reproduction time and stored;
Second step: then by microprocessor decode this data section and dynamic memory decode time simultaneously;
The 3rd step: according to reproduction time of being stored and dynamic decoder time, the ratio that calculates dynamic decoder time and reproduction time is also stored with the current utilization rate that obtains microprocessor.
The 4th step: the working clock frequency that comes control microprocessor according to the current utilization rate of being stored.
See also Fig. 2, a kind of control system of adjusting operation frequency of microprocessor according to inventive concept formation, it comprises: microprocessor, the storer that links to each other with microprocessor, counter that links to each other with an end of storer and the controller that all is connected with storer and microprocessor.Microprocessor is used for the decoding to an audio/video data section.Storer is used to store the reproduction time of this audio/video data section and two times of decode time that microprocessor is decoded and moved compressed file.Counter links to each other with above-mentioned storer, and the ratio that is used to calculate dynamic decoder time and reproduction time calculates the current utilization rate of this microprocessor.Current utilization rate after the process counter calculates feeds back to storer again and is stored.Controller all is connected with microprocessor with storer, the current utilization rate of the microprocessor that it is stored according to storer, and the combined memory current utilization rate of storing and the corresponding relation (referring to Fig. 3) of working clock frequency, change the corresponding work clock frequency according to different current utilization rates by controller thus, wherein corresponding frequency of operation is for one of in several frequency of operation set of this microprocessor, and each can be set in the corresponding scope of frequency of operation corresponding to this microprocessor utilization rate.As everyone knows, in the framework of general PC or household electrical appliance, the working clock frequency of microprocessor is provided by core logic chipset group (Core Logic Chipsets), therefore, see through controller and control the work clock signal of acp chip group, just can reach the purpose of adjusting the microprocessor work clock frequency.In addition, in general PC framework, the actual circuit that produces working clock frequency is in mainboard, and be the frequency that decides working clock frequency according to base frequency parameters and frequency parameter, for the purpose of convenient enforcement, present embodiment utilizes above-mentioned base frequency parameters and frequency parameter to adjust the work clock signal frequency, also is familiar with by those skilled in the art in this area, does not break away from spirit of the present invention.
For further solving the heat dissipation problem of microprocessor, also can be after the control method for frequency or control system that adopt microprocessor of the present invention, in conjunction with the temperature control of adopting the microprocessor rotation speed of the fan, effect can show more like this.