This application claims the priority benefit of Taiwan application serial no. 96144301, filed on Nov. 22, 2007. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
1. Field of the Invention
The present invention relates to a power management method and a computer device using the same. More particularly, the present invention relates to a method capable of dealing with power fail and a computer device using the same.
2. Description of Related Art
As to computer devices such as personal computers and servers etc., power management thereof is essential. Presently, most of the computer systems may support an advanced configuration and power interface (ACPI) standard to implement the power management. The ACPI may manage a power supply via an operating system other than a basic input output system (BIOS) according to interactive between a user and the operating system, and therefore efficiency of the power management is improved. The ACPI may effectively distribute power to system devices, and in coordination with information such as temperature of main board, fan speed and voltage a host may be provided, and meanwhile energy is saved and efficiency of the computer system is improved.
However, as to the computer devices with power thereof supplied from power supplies, sudden power fail is a big problem. For a server requiring a relatively high reliability, when the power thereof is failed, and the server is restarted, certain settings or operations need to be performed to the server. However, according to the present technique, a manager cannot determine the reason of power fail, i.e. whether it is because a sudden power fail of an alternating current power supply or because the power supply cannot transform an alternating current to a direct current is unsure.
The present invention is directed to a method capable of dealing with a power fail, by which a user may find the reason of the power fail.
The present invention is directed to a computer device capable of dealing with a power fail, which may apply the aforementioned method.
The present invention provides a method capable of dealing with a power fail, which is adapted for a control board with power thereof supplied from a power supply. The control board has a processor and a memory thereon. The present method includes first determining whether or not an alternating current input to the power supply is normal. Next, triggering a non-maskable interrupt (NMI) signal to the processor when the alternating current is judged to be abnormal. Thereafter, writing a record of an alternating current fail into the memory via the processor.
In an embodiment of the present invention, the method capable of dealing with the power fail further includes providing an interrupt controller disposed on the control board.
In an embodiment of the present invention, the step of triggering the NMI signal includes triggering the NMI signal to the processor via the interrupt controller.
In an embodiment of the present invention, the step of determining whether or not the alternating current is normal includes determining whether or not the alternating current is normal via the interrupt controller.
In an embodiment of the present invention, the method capable of dealing with the power fail further includes first determining whether or not a direct current output from the power supply is normal. Next, triggering a non-maskable interrupt (NMI) signal to the processor when the direct current is judged to be abnormal. Thereafter, writing a record of a direct current fail into the memory via the processor.
In an embodiment of the present invention, the step of determining whether or not the direct current is normal includes first monitoring an output voltage of the power supply. Next, judging whether or not the output voltage is less than a threshold value, wherein the threshold value may be greater than a minimum working voltage of the processor.
In an embodiment of the present invention, the method capable of dealing with the power fail further includes first reading the record of the alternating current fail and sending a warning signal via the processor when the control board is restarted, so as to warn occurring of the alternating current fail before the control board is restarted. Next, eliminating the record of the alternating current fail stored in the memory, wherein method of sending the warning signal includes sending a warning sound or a twinkling light.
The present invention further provides a computer device capable of dealing with power fail. The computer device includes a control board, a power supply, a processor, an interrupt controller and a memory. The power supply is used for providing power to the control board. The processor is disposed on the control board. The interrupt controller is disposed on the control board and coupled to the power supply and the processor, and is used for determining whether or not an alternating current input to the power supply is normal. If the alternating current is judged to be abnormal, a NMI signal is triggered to the processor. The memory is coupled to the processor. The processor writes a record of the alternating current fail into the memory when the NMI signal is triggered.
In an embodiment of the present invention, the interrupt controller may be used for determining whether or not a direct current output from the power supply is normal, and when the direct current is judged to be abnormal, a NMI signal is triggered to the processor, such that the processor may write a record of the direct current fail to the memory.
In an embodiment of the present invention, the interrupt controller may be used for monitoring an output voltage of the power supply, so as to determine whether or not the direct current output from the power supply is normal by judging whether or not the output voltage is less than a threshold value, wherein the threshold value is greater than a minimum working voltage of the processor.
In an embodiment of the present invention, the interrupt controller may be a field-programmable gate array (FPGA).
In an embodiment of the present invention, the memory may be a complementary metal-oxide semiconductor (CMOS), and is suitable for storing a setting value of a basic input output system (BIOS).
In an embodiment of the present invention, the memory may be a non-volatile memory.
According to the present invention, when the input power or the output power of the power supply is judged to be failed, the processor may write the record of power fail into the memory. Therefore, a user may judge whether it is the alternating current fail or a power supply fail according to the record of the power fail.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, a preferred embodiment accompanied with figures is described in detail below.
When the alternating current fail such as power off is judged, in step S120, a NMI signal is triggered to the processor 130. To be specific, the control board 110 may further have an interrupt controller 140 (referring to
Next, in step S130, the processor 130 writes a record of the alternating current fail into the memory 150. In detail, the memory 150 may be a CMOS used for storing a setting value of a BIOS. During starting of the computer device 100, the BIOS is generally started first, and when the computer device 100 is restarted, the BIOS may read the setting value from the memory 150, and judge whether the record of the alternating current fail is stored within the memory 150. If the BIOS judges the record of the alternating current fail is stored in the memory 150, the BIOS may send a warning signal to the user. Wherein, the warning signal may be send as a warning sound or a twinkling light.
When the user hears the warning sound or observes the twinkling light, he may know that the computer device 100 is restarted due to the alternating current fail. While the warning signal is sent or after the warning signal is sent, the record of the alternating current fail stored within the memory 150 may be eliminated, so as to avoid repeat sending of the warning signal if the computer device 100 is again restarted.
In addition, in another embodiment, the memory 150 may be a non-volatile memory, and no matter the memory 150 is the aforementioned COMS or the non-volatile memory, besides sending the warning signal via the BIOS, the record of alternating current fail stored within the memory 150 may be read by a system manage program after entering the operating system, and the record may be further stored within a log file, such that the user may check a status of the power supply by reading the log file. After warning the user the alternating current fail or storing the record of alternating current fail into the log file, the operating system may further eliminate the record of the alternating current fail stored within the memory 150.
Furthermore, if the computer device 100 has the problem of being abnormally shutdown or restarted, and meanwhile no record of the alternating current fail is stored within the memory 150, it may indirectly deduce that the power supply 120 may have a problem. Therefore, the user may find the reason of power fail by judging whether the power supply 120 has a problem or the AC power supply 50 has a problem, and may solve the problem by changing the power supply 120 or further checking the AC power supply 50.
In addition,
In the present embodiment, the computer device 200 may be a server, and may further includes a plurality of hard disks 260 used for storing data. The control board 210 may be connected to the hard disks 260 for controlling the hard disks 260 to perform data exchange and data transmission. Moreover, the computer device 200 may further includes a backup control board 210a. The control board 210a has the same function with that of the control board 210, and when the control board 210 is removed from the computer device 200 or cannot work properly, the control board 210a may substitute the control board 210.
For example,
To provide an enough time for completing the steps S220 and S230, an energy storage unit (not shown) may be provided to the control board 210 or the power supply 220, so as to prolong dropping of the voltage Vcc. Wherein, the energy storage unit may be a plurality of capacitors. Furthermore, if the control board 210 is hot pulled out, the steps S220 and S230 may still be complete based on the energy storage unit. When the control board 210 is restarted and functions normally, the user may check whether or not the record of the direct current fail is stored within the memory 250 via the operating system or the BIOS, so as to find the reason of sudden shutdown.
In summary, when the input power or the output power of the power supply is failed, such power fail is recorded into the memory by the process. Therefore, the user may find whether the alternating current is failed or the power supply has a problem according to the record of the power fail. Moreover, when the control board or the computer device is restarted, the system may further send the warning signal such as the warning sound etc. according to the record of the power fail, such that the user may easily find the reason of the power fail.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
96144301 | Nov 2007 | TW | national |