Abstract:
A method for reducing power consumption of a processor is disclosed comprising steps of applying time-frequency transformation to a plurality of load values of the processor to obtain the feature sampling cycle of the processor, and adjusting the voltage/frequency of the processor based on said feature sampling cycle. With the method of the present invention, the processor load value in next time interval can be accurately predicted, and thus the voltage/frequency of the processor in the next time interval can be adjusted on the basis of the load value.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of Invention 
         [0002]    The present invention relates to the power consumption conservation of a processor, and in particular to a method for reducing the power consumption of a processor, which can reduce the power consumption of the processor while guaranteeing that the voltage of the processor meets application requirements. 
         [0003]    2. Description of Prior Art 
         [0004]    Limited battery lifetime usually becomes the most severe bottleneck in a processing system powered by a battery, such as embedded handheld system. On the other hand, playing of multimedia, especially video, has gotten increasing popularity with various handsets, such as PMP and PDA. This gives considerable importance to a low power consumption design for any battery-powered processing system. Moreover, in current handsets, embedded CPUs have been expanded in terms of performance and function, and thus can enable such operation as soft decoding. It is well known that soft decoding is an application requiring intensive processing by CPU and consuming plenty of battery power. 
         [0005]    During video soft decoding by CPU, a low power consumption design is generally realized with a technique called DVS/DFS (Dynamic Voltage/Frequency Scaling). One significant task in the DVS technique is selecting a suitable CPU load sampling cycle and predicting CPU load through a proper algorithm so as to determine the magnitudes of voltage and frequency should be set in next time interval. As well known in the art, the selection of sampling cycle has tremendous effect on the performance of DVS. Currently, it is generally believed that the sampling cycle or interval should be the reciprocal of frame rate, since video stream is in unit of frame in most cases. Take as an example a segment of a stream of 30 frames/s, the sampling cycle or interval takes the value of 33 ms, which is regarded as the most suitable. However, many studies have proved that data of CPU load obtained on such sampling interval have a very poor regularity. Thus, it is difficult to present a satisfactory prediction result, leading to the case of voltage being lower than that required by the processor or the case of excessive power consumption of the processor. 
         [0006]    Another critical issue in the above low power consumption design based on time interval is how to accurately predict next time interval, since the processor load varies with applications. For example, Reference document 1 (Xiaotao Liu, Prashant Shenoy and Weibo Gong, A Time Series-based Approach for Power Management in Mobile Processors and Disks, In Proceedings of the 14 th ACM Workshop on Network and Operating System Support for Audio and Video  ( NOSSDAV )) proposes a time series-based prediction method, in which the value of processor load is predicted using time series. This method, however, gives no discussion about how to adjust the processor power dynamically. In other words, this method cannot precisely predict the value of processor load for next time interval upon changes in the running condition of the processor. 
       SUMMARY OF THE INVENTION 
       [0007]    The present invention is made in view of the above problems. The object of the present invention is to provide a method for reducing power consumption of a processor, which can reduce the power consumption of the processor while guaranteeing that the voltage of the processor meets application requirements. 
         [0008]    In one aspect of the present invention, a method for reducing power consumption of a processor is provided comprising steps of applying time-frequency transformation to a plurality of load values of the processor to obtain the feature sampling cycle of the processor, and adjusting the voltage/frequency of the processor based on the feature sampling cycle. 
         [0009]    According to an embodiment of the present invention, the step of time-frequency transformation comprises steps of sampling intensively the load of the processor to obtain a first number of processor load values, and applying Fourier transformation to the first number of processor load values to calculate a frequency corresponding to an amplitude peak and a feature sampling cycle corresponding to the frequency. 
         [0010]    According to an embodiment of the present invention, the step of adjusting comprises steps of resampling the load of the processor at the feature sampling cycle in the current time interval to obtain a second number of processor load values, constructing a prediction model based on the second number of processor load values to predict the processor load value of the processor in next time interval, and adjusting the voltage/frequency of the processor based on the predicted processor load value. 
         [0011]    According to an embodiment of the present invention, the step of constructing the prediction model comprises predicting the processor load value of the processor in next time interval with M processor load values through a linear model as follows: 
         [0000]    
       
         
           
             
               
                 
                   
                     x 
                     ^ 
                   
                   
                     t 
                     + 
                     1 
                   
                 
                 = 
                 
                   
                     x 
                     t 
                   
                   + 
                   
                     
                       ∑ 
                       
                         i 
                         = 
                         1 
                       
                       p 
                     
                      
                     
                       
                         ( 
                         
                           
                             x 
                             
                               t 
                               - 
                               i 
                               + 
                               1 
                             
                           
                           - 
                           
                             x 
                             
                               t 
                               - 
                               i 
                             
                           
                         
                         ) 
                       
                        
                       
                         φ 
                         i 
                       
                     
                   
                 
               
               ; 
               
                 t 
                 = 
                 0 
               
             
             , 
             1 
             , 
             2 
             , 
             3 
             , 
             … 
              
             
                 
             
             , 
             M 
           
         
       
     
         [0000]    where p represents the order of the linear model, and the coefficient φ i  can be estimated with M processor load values before the current time point by using Yule-Walker equation. 
         [0012]    According to an embodiment of the present invention, in the step of adjusting the voltage/frequency of the processor based on the predicted processor load value, the voltage/frequency of the processor is adjusted through a lookup table based on the predicted processor load value. 
         [0013]    According to an embodiment of the present invention, in the step of Fourier transformation, the feature sampling cycle is calculated as follows: 
         [0000]      τ=( T*N/ 2)/ f   τ   
         [0000]    where T represents the sampling cycle of intensive sampling, N is the first number, and f τ  is the frequency corresponding to the amplitude peak. 
         [0014]    According to an embodiment of the present invention, the step of adjusting comprises steps of resampling the load of the processor at the feature sampling cycle in the current time interval to obtain a second number of processor load values, constructing a prediction model based on the second number of processor load values to predict the processor load value of the processor in next time interval, compensating the predicted processor load value with a compensation factor, and adjusting the voltage/frequency of the processor based on the compensated processor load value. 
         [0015]    According to an embodiment of the present invention, the method further comprises repeating the above steps if the change in the compensation factor is greater than a predetermined threshold over a period of time. 
         [0016]    According to an embodiment of the present invention, the compensation factor is an additive compensation factor λ, and the step of compensating is performed by adding the additive compensation factor to the predicted processor load value. 
         [0017]    According to an embodiment of the present invention, the compensation factor is a multiplicative compensation factor λ, and the step of compensating is performed by dividing the predicted processor load value by the multiplicative compensation factor. 
         [0018]    According to an embodiment of the present invention, the additive compensation factor λ is determined as follows: 
         [0000]    
       
         
           
             λ 
             = 
             
               
                 
                   K 
                   P 
                 
                  
                 e 
               
               + 
               
                 
                   K 
                   I 
                 
                  
                 
                   ∫ 
                   edt 
                 
               
               + 
               
                 
                   K 
                   D 
                 
                  
                 
                   
                      
                     e 
                   
                   
                      
                     t 
                   
                 
               
             
           
         
       
     
         [0000]    where e represents the deviation between a statistically-obtained over scaling rate and an over scaling rate set by a user, and K P , K I  and K D  represent proportional gain, integral gain and derivative gain, respectively. 
         [0019]    With the method of the present invention, the processor load value in next time interval can be accurately predicted, and thus the voltage/frequency of the processor in the next time interval can be adjusted on the basis of the load value. Further, since the compensation factor can be used to compensate the predicted load value, a timely and accurate adjustment can be made upon any change in the running condition of the processor, so as to reduce the power consumption of the processor while meeting application requirements. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0020]      FIG. 1  shows a detained flowchart of a method for reducing power consumption of a processor according to the first embodiment of the present invention; and 
           [0021]      FIG. 2  shows a detained flowchart of a method for reducing power consumption of a processor according to the second embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
       [0022]    Now, a detailed description will be given to embodiments of the present invention with reference to the figures. 
         [0023]    As shown in  FIG. 1 , N (=128) CPU load values are initially sampled at certain intensive sampling interval, such as T=10 ms, at step S 110 . The 128 sampled CPU load values are subjected to FFT transformation so as to obtain a frequency f τ  corresponding to the amplitude peak for the former half of a cycle at step S 120 . 
         [0024]    Next, the feature sampling cycle is calculated from the frequency f τ  as 
         [0000]      τ=( T*N/ 2)/ f   τ   
         [0000]    at step S 130 . 
         [0025]    At step S 140 , the CPU load is sampled at the frequency corresponding to the feature sampling cycle τ to obtain a number of CPU load values, such as 64 values. At step S 150 , DVS modeling is made from the sampled CPU load values so as to predict the CPU load value in next time interval. 
         [0026]    The process of DVS modeling is specifically explained hereafter. Many studies have proved that the CPU load values sampled at the above feature sampling interval τ comply with ARIMA (Auto Regressive Integrated Moving Average) stochastic process to a great extent. 
         [0027]    Since the MA process component in the ARIMA process is minute, ignoring such component has no substantial effect on the result. On the other hand, such ignorance can simplify the complexity of the prediction model and relieve computation effort. The major function of the DVS model is to predict the CPU load in the succeeding time interval based on the previous CPU load and thus set a corresponding voltage/frequency. 
         [0028]    With ARI (Auto Regressive Integrated) model, the prediction value of the CPU load value at the current time point can be easily represented by M CPU load values before the current time point through a linear model 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         
                           x 
                           ^ 
                         
                         
                           t 
                           + 
                           1 
                         
                       
                       = 
                       
                         
                           x 
                           t 
                         
                         + 
                         
                           
                             ∑ 
                             
                               i 
                               = 
                               1 
                             
                             p 
                           
                            
                           
                             
                               ( 
                               
                                 
                                   x 
                                   
                                     t 
                                     - 
                                     i 
                                     + 
                                     1 
                                   
                                 
                                 - 
                                 
                                   x 
                                   
                                     t 
                                     - 
                                     i 
                                   
                                 
                               
                               ) 
                             
                              
                             
                               φ 
                               i 
                             
                           
                         
                       
                     
                     ; 
                     
                       t 
                       = 
                       0 
                     
                   
                   , 
                   1 
                   , 
                   2 
                   , 
                   3 
                   , 
                   … 
                    
                   
                       
                   
                   , 
                   M 
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where p represents the order of the ARI model, i.e., the size of observation window, and the coefficient φ i  can be estimated with the M processor load values before the current time point by using Yule-Walker equation as 
         [0000]    
       
         
           
             
               
                 
                   
                     [ 
                     
                       
                         
                           
                             
                               φ 
                               ^ 
                             
                             1 
                           
                         
                       
                       
                         
                           
                             
                               φ 
                               ^ 
                             
                             2 
                           
                         
                       
                       
                         
                           
                               
                           
                         
                       
                       
                         
                           
                             
                               φ 
                               ^ 
                             
                             p 
                           
                         
                       
                     
                     ] 
                   
                   = 
                   
                     
                       
                         [ 
                         
                           
                             
                               1 
                             
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 1 
                               
                             
                             
                               
                                   
                               
                             
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 
                                   p 
                                   - 
                                   1 
                                 
                               
                             
                           
                           
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 1 
                               
                             
                             
                               1 
                             
                             
                               
                                   
                               
                             
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 
                                   p 
                                   - 
                                   2 
                                 
                               
                             
                           
                           
                             
                               
                                   
                               
                             
                             
                               
                                   
                               
                             
                             
                               
                                   
                               
                             
                             
                               
                                   
                               
                             
                           
                           
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 
                                   p 
                                   - 
                                   1 
                                 
                               
                             
                             
                               
                                 
                                   ρ 
                                   ^ 
                                 
                                 
                                   p 
                                   - 
                                   2 
                                 
                               
                             
                             
                               
                                   
                               
                             
                             
                               1 
                             
                           
                         
                         ] 
                       
                       
                         - 
                         1 
                       
                     
                      
                     
                       [ 
                       
                         
                           
                             
                               
                                 ρ 
                                 ^ 
                               
                               1 
                             
                           
                         
                         
                           
                             
                               
                                 ρ 
                                 ^ 
                               
                               2 
                             
                           
                         
                         
                           
                             
                                 
                             
                           
                         
                         
                           
                             
                               
                                 ρ 
                                 ^ 
                               
                               p 
                             
                           
                         
                       
                       ] 
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         ρ 
                         ^ 
                       
                       k 
                     
                     = 
                     
                       
                         
                           ρ 
                           ^ 
                         
                         
                           - 
                           k 
                         
                       
                       = 
                       
                         
                           
                             r 
                             ^ 
                           
                           k 
                         
                         / 
                         
                           
                             r 
                             ^ 
                           
                           0 
                         
                       
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
             
               
                 
                   
                     
                       
                         
                           r 
                           ^ 
                         
                         k 
                       
                       = 
                       
                         
                           
                             r 
                             ^ 
                           
                           
                             - 
                             k 
                           
                         
                         = 
                         
                           
                             1 
                             M 
                           
                            
                           
                             
                               ∑ 
                               
                                 t 
                                 = 
                                 1 
                               
                               
                                 M 
                                 - 
                                 k 
                               
                             
                              
                             
                               
                                 x 
                                 t 
                               
                                
                               
                                 x 
                                 
                                   t 
                                   - 
                                   k 
                                 
                               
                             
                           
                         
                       
                     
                     , 
                     
                       k 
                       = 
                       0 
                     
                     , 
                     1 
                     , 
                     2 
                     , 
                     3 
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     
                       p 
                       ; 
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       t 
                       = 
                       0 
                     
                     , 
                     1 
                     , 
                     2 
                     , 
                     3 
                     , 
                     … 
                      
                     
                         
                     
                     , 
                     M 
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0000]    M is a natural number greater than p. 
         [0029]    In this way, the CPU load value in the next time interval can be predicted from the above DVS model. After the predicted CPU load value # 4  in the succeeding time slot is obtained, the corresponding voltage/frequency value can be acquired in the simple manner of a lookup table at step S 160 . For example, {circumflex over (x)} i+1 =0.3 means that the CPU load in the succeeding time interval is only 30% of the load of the CPU running at its peak frequency. Thus, the corresponding voltage value can be found from a voltage-frequency correspondence table provided by the manufacturer of the CPU. 
         [0030]    Besides, the DVS-based power conservation is realized by reducing the voltage/frequency of the CPU. This may incur a case where inaccurate prediction or excessive scale-down of the voltage leads to insufficient CPU performance and thus failure of fulfilling an application timely. In an example of video decoding, the playing effect will suffer if one frame, which should have been handled at certain time, cannot be decoded in time. 
         [0031]    To address the above problem, an overload control mechanism is adopted to control excessive scaling of voltage so as to protect the system performance from any adverse effect in the second embodiment of the present invention.  FIG. 2  shows a detained flowchart of a method for reducing power consumption of a processor according to the second embodiment of the present invention. 
         [0032]    Steps S 110  to S 150  of the method according to the second embodiment are identical to steps S 210  to S 250  of the method according to the first embodiment of the present invention, and thus description of these steps is omitted. 
         [0033]    At step S 255 , a compensation factor is defined for compensating the predicted CPU load in order to control the scaling magnitude of the CPU voltage. At step S 260 , it is determined whether the compensation factor has dramatic change over a period of time, i.e., whether the change in the compensation factor exceeds a predetermined threshold (for example, increased by 100%). If the change is strong, it can be derived that the characteristic of the stream has changed. Thus, the sampling frequency is not appropriate, and the corresponding DVS model is not accurate any more. At this point, the flow returns to step S 210 , where the above same process is repeated. If the change is within an acceptable range, the flow turns to step S 240 , where the above process is repeated. 
         [0034]    Specifically, after a CPU prediction value {circumflex over (x)} i+1  is obtained, it is compensated with a compensation factor λ as a final prediction value. In the second embodiment of the present invention, two types of compensation factors, additive and multiplicative factors, are defined. Then, either of the factors can be controlled so that the ultimate video effect (over scaling rate) is kept in a range preset or acceptable to the user. 
         [0035]    The predicted CPU load value is compensated with the additive compensation factor as follows, 
         [0000]        {circumflex over (x)}   i+1   ={circumflex over (x)}   i+1 +λ  (5) 
         [0036]    The predicted CPU load value is compensated with the multiplicative compensation factor as follows. 
         [0000]        {circumflex over (x)}   i+1   ={circumflex over (x)}   i+1 /λ  (6) 
         [0037]    The control over the compensation factor is adjusted by a PID controller in the following manner. 
         [0000]    
       
         
           
             
               
                 
                   λ 
                   = 
                   
                     
                       
                         K 
                         P 
                       
                        
                       e 
                     
                     + 
                     
                       
                         K 
                         I 
                       
                        
                       
                         ∫ 
                         edt 
                       
                     
                     + 
                     
                       
                         K 
                         D 
                       
                        
                       
                         
                            
                           e 
                         
                         
                            
                           t 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where e represents the deviation between a statistically-obtained over scaling rate and an over scaling rate set by the user, and K P , K I  and K D  represent proportional gain, integral gain and derivative gain, respectively. Obviously, when the deviation e is large, λ should be increased or decreased accordingly to keep the swing of the over scaling rate within the preset range. As used here, the over scaling rate indicates the number of time intervals among n time intervals in each of which the instructions that should have been completed are not fulfilled due to the excessive scaling-down of the voltage. 
         [0038]    With the compensation factor, it is convenient to detect the change in the characteristics of the video stream. A series of characteristics of a video stream must be changing with the change in the stream, thereby making the prediction model inaccurate. This will lead to an increase in the prediction error. And accordingly, the compensation factor is dramatically increased (additive) or decreased (multiplicative) to prevent the over scaling rate from increasing too much. 
         [0039]    As such, the change in the system characteristics has been learned, and thus a new model or sampling frequency is required. The flow returns to step S 210 , where the above process is repeated. 
         [0040]    The present invention is not limited to the above embodiments. Any modification, change or substitution readily made by those ordinarily skilled in the art shall fall into the scope of the present invention defined by the appended claims.