Abstract:
A method of dynamically adjusting power consumption for a computer system. The method includes the steps of setting a parameter table in the computer system and checking the computer system to obtain a parameter. The parameter is compared with the parameter table to obtain a result. According to the result and the parameter table, the clock throttling ratio of a CPU in the computer system is adjusted.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The present invention relates to a dynamic adjustment method for power consumption in a computer system, especially a method related to computing power consumption to dynamically adjust clock throttling ratio of a central processing unit (CPU), for computer systems working steadily in battery mode.  
           [0003]    2. Description of the Related Art  
           [0004]    Notebook computers have the same advantages as desktop PCs, with further advantages of smaller size and portability. Notebook computers do have problems related to limited power supply when in battery mode. To increase the battery life of a notebook computer, it is possible to increase the capacity of the battery, but this will increase the volume and weight thereof, impacting portability. Reducing the power consumption of devices in the notebook computer, providing longer battery life with the same battery power, is preferable.  
           [0005]    In a computer system, power saving function of many devices can be promoted. Taiwan Patent number 265,431 discloses a power saving method and device for hard drive storage, reducing the angular velocity of the hard drive servomotor to reduce the power consumption thereof. However, in a computer system, the CPU is the most important device and expends considerable power, deeply affecting a notebook computer, not only in consumption of power, but also by generating heat that causes system instability and errors. To exhaust the heat, large heat sinks and fans are required, again impacting portability.  
         SUMMARY OF THE INVENTION  
         [0006]    An object of the present invention is to provide a method of making a computer system stable, by dynamically adjusting CPU clock throttling ratio, further controlling its power consumption, and extending battery life.  
           [0007]    Another object of the present invention is to solve problems of using a desktop CPU in a notebook computer, thereby reducing costs, including problems of high power consumption and unacceptable heat production.  
           [0008]    To achieve these objects, the present invention provides a method of dynamic adjustment, comprising setting a parameter table in a computer system, checking the computer system and obtaining a first parameter, comparing the first parameter with a second parameter to determine whether power consumption is going up or down, obtaining a third parameter from the predetermined parameter table, comparing the first parameter with the third parameter to adjust the CPU clock throttling ratio, and replacing the first parameter with the second parameter and the adjusted clock throttling ratio value, and checking the computer system again. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0009]    The present invention can be more fully understood by reading the subsequent detailed description in conjunction with the examples and references made of the accompanying drawings, wherein:  
         [0010]    [0010]FIG. 1 is a flowchart according to the embodiment of the present invention. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0011]    The present invention discloses a method of dynamic adjustment of power consumption for a computer system. FIG. 1 shows the following steps.  
         [0012]    In Step  10 , a parameter table of power throttling ratio is predetermined and stored in a computer system with CPU or system BIOS. For example, the predetermined parameter table is stored in a microcontroller of a computer system, such as an embedded controller or keyboard controller, the parameter table comprising power throttling ratio. In Table 1, a power throttling ratio parameter table is listed.  
                                 TABLE 1                           Power throttling ratio parameter table            CPU clock   CPU clock   Maximum power   Minimum power       throttling   throttling   of raising   of lowering       ratio steps   ratio   state   state               1     50%   &gt;50 W   &lt;39 W       2   37.5%   &gt;60 W   &lt;49 W       3     25%   &gt;70 W   &lt;59 W       4   12.5%   &gt;80 W   &lt;69 W                  
 
         [0013]    Table 1 shows parameters including CPU clock throttling ratio steps, CPU clock throttling ratio, maximum power of raising state and minimum power of lowering state. The parameter table also includes the predetermined parameter of system power consumption, for example 49W. Table 1 lists examples, not intended to limit the invention, and values of the parameters can be changed according to various systems.  
         [0014]    Step  12  checks the computer system to obtain a first parameter. Power consumption of the computer system is measured and a first parameter is obtained by the microcontroller, that is, system power consumption value. The first parameter can be obtained via monitoring the power consumption of the system in a specific period, resulting in the power consumption value.  
         [0015]    The steps of obtaining the first parameter include monitoring the current/voltage analog signals of the system, outputting the current/voltage analog signals to the microcontroller, which performs analog to digital conversion to obtain a related digital parameter. The analog signal is the voltage or current of the computer system or current of the CPU, and the analog signal converted to the related digital signal is a voltage or current parameter of the computer system or current of the CPU. Due to the constant nature of the CPU core voltage parameter, the voltage value times the current value of the computer system or the voltage value times the current value of the CPU, followed by several samplings and obtaining subsequent averages provides a first parameter, the average value avoiding the effect of voltage or current pulses. Computation of the power consumption can be performed by the microcontroller and saved as a first parameter therein.  
         [0016]    Four methods of checking power consumption of the computer system are described herein without intending to limit the invention to these methods. The methods are described as follows:  
         [0017]    Method 1 monitors the voltage of the computer system by an external voltage monitor circuit (for example, voltage of a battery, voltage of external power), and monitors the current of the computer system by an external current monitor circuit, to obtain the power consumption value by, for example, connecting the voltage monitor point and current monitor point to the microcontroller to perform signal processing.  
         [0018]    In method 2: Due to the constant nature of the CPU core voltage, an external monitor circuit monitors the current of the CPU, obtaining the power consumption value using the CPU operation voltage and the monitored current.  
         [0019]    In Method 3, when a notebook computer working in battery mode, power consumption of the system is limited. Microcontroller can obtain average voltage and current of the battery by the system management bus (SMB), and obtain the power consumption value for the system. This process also reduces the sampling rate of monitor.  
         [0020]    In Method 4, since the computer system is operated in battery mode, the voltage of the battery does not change much in a short period. Thus, the microcontroller in the computer system can read the average current of the battery by the system management bus, further obtaining the power consumption value for the system.  
         [0021]    Step  14  compares the first parameter with the second parameter to obtain the current power consumption state. The first parameter represents the current power consumption obtained by step  12 . The second parameter represents the former power consumption, at startup, and the second parameter is a preset value, according to the parameter table predetermined in Step  10 . If the first parameter is greater than the second parameter means the power consumption is in a raising state, and the method goes to step  16 . Otherwise, if the first parameter is smaller than the second parameter, the power consumption is in a lowering state, and the method goes to step  18 .  
         [0022]    In Step  16 , the microcontroller gets the maximum power of rising state according to the third parameter and compares with the first parameter, to see if the power consumption exceeds the predetermined maximum, wherein the third parameter is based on the CPU clock throttling ratio steps related to the maximum power of raising state in the parameter table respectively. If the first parameter is greater than the maximum corresponding to the third parameter in the parameter table, the method goes to step  20 . On the contrary, if the first parameter is not greater than the maximum parameter in the parameter table, the method goes to step  22 .  
         [0023]    For example, when the first parameter is 65W(Watt) and the second parameter is 55W, the power consumption is in a raising state. The second parameter (55W) is related to Step  1  of the CPU clock throttling ratio, and corresponds to 50% CPU clock throttling ratio of raising state, since 55W is in the range of 50W to 60W. The third parameter according to the second parameter (55W) is 1. Because the first parameter (65W) is greater than the maximum parameter (60W) corresponding to the CPU clock throttling ratio step  2  in the parameter table, the third parameter is modified from 1 to 2, which is raised from the step of the second parameter, and corresponds to 37.5% CPU clock throttling ratio of raising state. Then the method goes to step  20 .  
         [0024]    For another example, when the first parameter is 58W and the second parameter is 55W, the CPU clock throttling ratio steps corresponding to the first and second parameters are the same and in the step  1 . The CPU clock throttling ratio corresponding to the step  1  is 50%. Since the first parameter (58W) is smaller than the maximum power (60W) of the CPU clock throttling ratio step  2  in the parameter table, the system power consumption is stable and the third parameter is maintained. Then the method goes to step  22 .  
         [0025]    In Step  18 , the microcontroller get the minimum power of lowering state according to the third parameter and compares with the first parameter, to see if power consumption is under the predetermined minimum, the third parameter is based on the CPU clock throttling ratio steps in the parameter table related to the value of minimum power of lowering state. If the first parameter is smaller than minimum parameter corresponding to the third parameter in the parameter table, the method goes to step  24 . If the first parameter is not smaller than the minimum parameter in the parameter table, the method goes to step  22 .  
         [0026]    For example, when the first parameter is 48W and the second parameter is 65W, the power consumption is in a lowering state. In the second step of the CPU clock throttling ratio according to the second parameter (65W) in the maximum power column of the table, the corresponding CPU clock throttling ratio of lowering state is 37.5%. The third parameter according to the second parameter (65W) is 2. As the first parameter is smaller than the minimum parameter (49W) corresponding to the CPU clock throttling ratio step  2  in the parameter table, the third parameter is modified from 2 to 1, which is reduced from the step of the second parameter, and the corresponding CPU clock throttling ratio of lowering state is 50%. Then the method goes to step  24 .  
         [0027]    For another example, when the first parameter is 62W and the second parameter is 65W, the CPU clock throttling ratio steps corresponding to the first and second parameters are the same and in the step  2 . The CPU clock throttling ratio corresponding to the step  2  is 37.5%. The third parameter according to the second parameter (65W) is 2. Since the first parameter (62W) is not smaller than the minimum parameter (49W) of the CPU clock throttling ratio step  2  in the parameter table, the system is stable and the third parameter is maintained. Then the method goes to step  22 .  
         [0028]    Step  20  outputs an instruction of reducing clock throttling ratio to the system BIOS. The system is in a raising state of power consumption, so the microcontroller outputs an instruction of reducing clock throttling ratio to the system BIOS, and stores the related CPU clock throttling ratio step, and the method goes to step  26 . For example, when the first parameter is 65W, the second parameter is 55W, the power consumption is in a raising state, the first parameter (65W) related to CPU clock throttling ratio of raising state is 37.5%, and the second parameter (55W) related to CPU clock throttling ratio of the CPU in raising state is 50%. The microcontroller outputs an instruction of reducing clock throttling ratio to the system BIOS according to a parameter table, changing the CPU clock throttling ratio from 50% to 37.5%.  
         [0029]    In Step  22 , an instruction of adjustment clock throttling ratio won&#39;t be outputted to the system BIOS. The system is stable, so the CPU keeps its clock throttling ratio, and the method goes to step  30 . Since power consumption is stable, the microcontroller does not output an adjustment instruction to the system BIOS, so the CPU maintaining the clock throttling ratio.  
         [0030]    In Step  24 , the system is under a lowering state of power consumption, so the microcontroller outputs an instruction of raising clock throttling ratio to the system BIOS, and stores the related CPU clock throttling ratio step, then goes to step  28 . For example, when the first parameter is 48W and the second parameter is 65W, power consumption is in a lowering state. The CPU clock throttling ratio of lowering state related to the first parameter (48W) is 50%, and the CPU clock throttling ratio of lowering state related to the second parameter (65W) is 37.5%. Thus the microcontroller outputs an instruction of raising clock throttling ratio to the system BIOS according to a parameter table, changing the CPU clock throttling ratio from 37.5% to 50%.  
         [0031]    In Step  26 , the system BIOS outputs a reducing instruction to lower the CPU clock throttling ratio according to the instruction of reducing clock throttling ratio, the throttle lowers the clock throttling ratio to a preset value according to the reducing instruction, and the method goes to step  30 . The throttle can be in a CPU or a chipset of the computer system. For example, when the first parameter is 65W and the second parameter is 55W, the CPU clock throttling ratio will be changed from 50% to 37.5% (from Step  1  to Step  2  of the CPU clock throttling ratio).  
         [0032]    In Step  28  the system BIOS outputs a raising instruction to raise the CPU clock throttling ratio according to the instruction of raising clock throttling ratio, the throttle raises the CPU clock throttling ratio to a preset value according to the raising instruction, and the method goes to step  30 . For example, when the first parameter is 48W, the second parameter is 65W, and the CPU clock throttling ratio is changed from 37.5% to 50% (from Step  2  to Step  1  of the CPU clock throttling ratio).  
         [0033]    Step  30  saves the first parameter as the second parameter and the value of adjustment clock throttling ratio. The microcontroller makes the first parameter replace the second parameter, and saves the second parameter in the microcontroller, and updates these three parameters, then repeats step  12 .  
         [0034]    The present invention has the advantage of allowing a desktop CPU to replace mobile CPU in a notebook computer, and lowering costs of notebook computers. Additionally, this invention solves some problems caused by desktop CPUs, and extends battery life of the notebook computer.  
         [0035]    Finally, while the invention has been described by way of example and in terms of the above preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments. On the contrary, it is intended to cover various modifications and similar arrangements as would be apparent to those skilled in the art. Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.