201021348 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種電子裝置之電池保護系統及方 法,且特別是有關於一種利用降頻來保護可攜式電子裝置 之電池的系統及方法。 【先前技術】 可攜式裝置之應用已成為電子產品之趨勢,如筆記 ❹ 型 電腦、個人數位助理(PDA)等,而這些可攜式裝置的 電源供應通常設置有交流電源及電池。在某些使用情況 下,當交流電源自可攜式電子裝置移除時,若裝置仍維 持在高頻工作的狀態,電》池可能無法在瞬間負載這樣大 的電流,而對電池造成極大的損害。 因此,一種電池保護系統及方法是有必要的以改善上 述缺點。 φ 【發明内容】 因此本發明的目的就是在提供一種電子裝置之電池保 護系統及方法,可保護電池,延長電池壽命。 根據本發明一較佳實施例,此電子裝置之電池保護系 統包括:電池,用以提供電能;中央處理器;喪入式控制 器,用以摘測交流電源移除訊號,以及產生並傳送降頻控 制訊號;以及基本輸出輸入系統,用以接收降頻控制訊號 並發送降頻指令至中央處理器以執行降頻程序。 根據本發明一較佳實施例,并番工壯 只J此電子裝置之電池保護方 201021348 法包括以下步驟:偵測交流電源移除訊號;根據交流電源 移除訊號’產生並傳送降頻控制訊號至基本輸出輸入系 統;以及根據降頻控制訊號及電子裝置所支援之降頻機 制’發送降頻指令給中央處理器以執行降頻程序。 【實施方式】 接下來請參照本發明較佳實施例的詳細說明,其中所 知·到的範例會連同圖式一同進行說明。在任何可能的情況 ® 下,圖式及說明中所使用的相同參考數標都代表了相同或 類似的元件》 本發明之電池保護方法及系統可應用於各種不同之可 攜式電子裝置中’例如筆記型電腦或個人數位助理 (PDA) ’藉由本發明之降頻機制的設計,在使用電池為電子 裝置的電能來源時’能降低電池的功耗,避免對電池造成 損害。下述實施例係以筆記型電腦作為說明,但本發明之 應用當不僅限於以下所述之較佳實施例。 φ 第1圖繪示根據本發明實施例之電池保護系統的功能 架構方塊圖。此電池保護系統100為筆記型電腦之一部分, 包含了電池110、嵌入式控制器(Embedded Controller, EC)120、基本輸出輸人系'統(Basic inpUt/〇utpUt SyStem, BIOS)140、執行於電腦系統之中的作業系統ι6〇、以及中 央處理器180等元件。這些元件中的某些部分如電池、作 業系統、以及中央處理器等元件可利用一般現今筆記型電 腦内已具備的即可,各元件之間的功能與相互關係,以及 降頻機制的運作將敘述如下。 201021348 在本實施例中,嵌入式控制器120可為鍵盤控制器 (keyboard controller),可偵測電腦系統的電能來源狀態, 如在某一時間點時電源係由電池或是交流電源(AC)所提 供,以及其他與交流電源及電池有關的事件。當自電腦系 統移除交流電源時,嵌入式控制器120可偵測到交流電源 移除訊號,以及產生並傳送降頻控制訊號給基本輸出輸入 系統140,接著再繼續進行後續之處理程序。 基本輸出輸入系統140係用以接收降頻控制訊號並發 φ 送降頻指令至中央處理器180以執行降頻程序。基本輸出 輸入系統140可視不同的中央處理器180所支援之不同降 頻機制而以合適的機制實現降頻程序。在一種情況下,基 本輸出輸入系統140可直接與中央處理器180通訊,因此 可直接發送降頻指令至中央處理器180以執行降頻程序。 例如,在一實施例中,可在中央處理器180内部執行調速 功能(throttling function ),亦即在一工作週期寬度内,不 會讓中央處理器180於整個工作週期寬度持續運作,此調 _ 速功能機制會讓中央處理器180於一工作週期寬度内只執 行某個百分比,以降低中央處理器的頻率。 在另一種情況下,基本輸出輸入系統140要透過作業 系統160與中央處理器180通訊才能執行降頻程序。例如, 英特爾(Intel )公司所發展出來之變速(SpeedStep )技術, 可藉由作業系統對電腦系統之掌控,迅速改變中央處理器 之運轉速度,來達到降低頻率的目的。 在一實施例中,例如,降頻機制的程式控制碼可寫在 筆記型電腦中的鍵盤控制器(keyboard controller)所提供之 7 201021348 記憶區塊中,並配合相應之基本輸出輸入系統的程式碼更 改而實現本電池保護系統。 在一實施例中,作業系統160還可包含交流電源安全 移除單元165,用以接收使用者利用輸入裝置(如滑鼠或鍵 盤)所輸入的交流電源安全移除訊號,並根據交流電源安全 移除訊號執行預保護程序。舉例來說,在電腦系統準備好 處理移除交流電源的事件後,若使用者想要執行將使用大 量電腦系統資源的程式時,預保護程序可顯示警告訊息。 • 第2圖係繪示一種電子裝置之電池保護方法的流程 圖。此電池保護方法以一般之筆記型電腦所支援的功能架 構作為說明,包含以下步驟:在步驟210,偵測到交流電源 移除訊號。在步驟220,根據交流電源移除訊號,產生並傳 送降頻控制訊號至基本輸出輸入系統。在步驟230,基本輸 出輸入系統判定電腦系統是否支援變速(SpeedStep )技術。 亦即,此步驟是根據降頻控制訊號及電子裝置所支援之降 頻機制,發送降頻指令給中央處理器以執行降頻程序。 φ 在步驟240,當基本輸出輸入系統判定電腦系統支援變 速(SpeedStep)技術時,基本輸出輸入系統通知Passive Cooling event,而在步驟242,作業系統執行變速 (SpeedStep)技術以達到降頻。在這種情況下,執行降頻 程序之步驟是透過作業系統來降低中央處理器之運轉頻 率〇 在步驟250,當基本輸出輸入系統判定電腦系統不支援 變速(SpeedStep )技術時,基本輸出輸入系統發出中央處 理器指令以執行調速功能(throttling function )。在這種情 201021348 況下不需透過作業系統,即可降低中央處理器之運轉頻 率。在步驟26G,電腦系.统料下-事件的發生。 、在偵測交流電源移除訊號的步驟之前,此電池保護方 法還可包含以下額外步驟··接收交流電源安全移除訊號; 以及根據交流電源安全移除訊號,執行預保護程序。預保 護程序可讓電腦系統採取適當的行動以準備處理移除交流 電源的事件,例如,若使用者想要執行將使用大量電滕系 統資源的程式時,預保護程序可顯示警告訊息。 籲 纟使用電池為筆記型電腦的電能來源時,本發明的降 頻機制改寫了原先由作業系統所決定的頻率操作機制。舉 例來說,在一實施例中,當電能模式設為電池模式、性能 模式、或節能模式等不同的模式時,原本會有不同的頻率 切換設定,但在本發明的降頻機制下,當交流電源移除時 而使用電池為電能來源時,皆執行降頻以保護電池。 因為,當以電池來提供電能時,若電腦系統仍維持在 高頻工作的狀態(例如當使用者將電能模式設在性能模式 Ο 時),中央處理器在負載高時,耗電量增加,電流增大以提 供電腦系統所需之電流,電池可能無法在瞬間負载這樣大 的電流,容易對電池造成損害,造成電池壽命極短。因此, 本發明可保護電池,延長電池壽命。 雖然本發明已以一較佳實施例揭露如上,然其並非用 以限定本發明,任何熟習此技術者,在不脫離本發明之精 神和範圍内’當可作各種之更動與潤飾,因此本發明之保 護範圍當視後附之申請專利範圍所界定者為準。 9 201021348 【圖式簡單說明】 為讓本發明之上述和其他目的、特徵、優點與實施例 能更明顯易懂,所附圖式之詳細說明如下: 第1囷係繪示根據本發明實施例之電池保護系統的功 能架構方塊圖。 第2圖係繪示根據本發明實施例之電池保護方法的流 程圖。 160 :作業系統 165.交流電源安全移除單元 18〇 :中央處理器 【主要元件符號說明】 100 :電池保護系統 110 :電池 120 :嵌入式控制器 140:基本輸出輸入系統 210-260:步驟方法201021348 IX. Description of the Invention: [Technical Field] The present invention relates to a battery protection system and method for an electronic device, and more particularly to a system and method for protecting a battery of a portable electronic device by using frequency reduction . [Prior Art] The application of portable devices has become a trend in electronic products, such as notebook computers, personal digital assistants (PDAs), etc., and the power supply of these portable devices is usually provided with an AC power source and a battery. In some use cases, when the AC power is removed from the portable electronic device, if the device is still in the high-frequency operation state, the battery may not be able to load such a large current in an instant, which causes great damage to the battery. damage. Therefore, a battery protection system and method is necessary to improve the above disadvantages. φ [ SUMMARY OF THE INVENTION Accordingly, it is an object of the present invention to provide a battery protection system and method for an electronic device that protects the battery and extends battery life. According to a preferred embodiment of the present invention, a battery protection system of the electronic device includes: a battery for providing electrical energy; a central processor; a mortal controller for extracting an AC power removal signal, and generating and transmitting a drop The frequency control signal; and the basic output input system for receiving the down control signal and transmitting the down frequency command to the central processor to perform the frequency down procedure. According to a preferred embodiment of the present invention, the battery protection method 201021348 of the electronic device includes the following steps: detecting an AC power removal signal; generating and transmitting a down control signal according to the AC power removal signal Up to the basic output input system; and transmitting a down-converting command to the central processor to perform a down-conversion process according to the down-conversion control signal and the down-conversion mechanism supported by the electronic device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Reference will now be made in detail to the preferred embodiments embodiments In any case, the same reference numerals used in the drawings and the descriptions represent the same or similar elements. The battery protection method and system of the present invention can be applied to a variety of different portable electronic devices. For example, a notebook computer or a personal digital assistant (PDA) 'by the design of the frequency reduction mechanism of the present invention can reduce the power consumption of the battery when the battery is used as a source of electrical energy for the electronic device, thereby avoiding damage to the battery. The following embodiments are described with a notebook computer, but the application of the present invention is not limited to the preferred embodiments described below. φ Fig. 1 is a block diagram showing the functional architecture of a battery protection system according to an embodiment of the present invention. The battery protection system 100 is a part of a notebook computer, and includes a battery 110, an embedded controller (EC) 120, a basic output input system (Basic inpUt/〇utpUt SyStem, BIOS) 140, and is executed in The operating system in the computer system, and the components such as the central processing unit 180. Some of these components, such as batteries, operating systems, and central processing units, can be used in today's notebooks, the functions and interrelationships between the components, and the operation of the down-conversion mechanism. The description is as follows. In this embodiment, the embedded controller 120 can be a keyboard controller that can detect the power source status of the computer system. For example, at a certain time, the power source is powered by a battery or an AC power source (AC). Provided, as well as other events related to AC power and batteries. When AC power is removed from the computer system, embedded controller 120 can detect the AC power removal signal and generate and transmit a down control signal to base output input system 140, and then proceed with subsequent processing. The basic output input system 140 is configured to receive the down-converted control signal and send the down-converted command to the central processing unit 180 to perform the down-conversion procedure. The basic output input system 140 can implement the down-conversion procedure in a suitable mechanism, depending on the different down-conversion mechanisms supported by the different central processing units 180. In one case, the basic output input system 140 can communicate directly with the central processing unit 180 so that the down-converted instructions can be sent directly to the central processor 180 to perform the down-conversion procedure. For example, in one embodiment, a throttling function can be performed within the central processing unit 180, that is, within a duty cycle width, without causing the central processing unit 180 to continue to operate over the entire duty cycle width. The _ speed function mechanism causes the central processor 180 to perform only a certain percentage over a duty cycle width to reduce the frequency of the central processor. In another case, the basic output input system 140 is to communicate with the central processing unit 180 via the operating system 160 to perform the down-conversion procedure. For example, Intel's SpeedStep technology can reduce the frequency by quickly changing the operating speed of the central processing unit by controlling the computer system. In an embodiment, for example, the program control code of the down-conversion mechanism can be written in the 7201021348 memory block provided by the keyboard controller in the notebook computer, and matched with the corresponding basic output input system program. The battery protection system is implemented by changing the code. In an embodiment, the operating system 160 may further include an AC power safety removal unit 165 for receiving an AC power safety removal signal input by a user using an input device (such as a mouse or a keyboard), and according to the AC power supply security. Remove the signal to perform the pre-protection process. For example, after the computer system is ready to handle the removal of AC power, the pre-protection program can display a warning message if the user wants to execute a program that will use a large amount of computer system resources. • Figure 2 is a flow chart showing a battery protection method for an electronic device. The battery protection method is described by a functional architecture supported by a general notebook computer, and includes the following steps: In step 210, an AC power removal signal is detected. At step 220, a down-conversion control signal is generated and transmitted to the basic output input system based on the AC power removal signal. At step 230, the basic output input system determines if the computer system supports the SpeedStep technique. That is, this step is based on the down-conversion control signal and the down-conversion mechanism supported by the electronic device, and sends a down-converted command to the central processing unit to perform the down-conversion procedure. φ In step 240, when the basic output input system determines that the computer system supports the SpeedStep technique, the basic output input system notifies the Passive Cooling event, and in step 242, the operating system performs a SpeedStep technique to achieve down-conversion. In this case, the step of performing the down-conversion procedure is to reduce the operating frequency of the central processing unit through the operating system. In step 250, when the basic output input system determines that the computer system does not support the speed stepping (SpeedStep) technique, the basic output input system A central processor command is issued to perform a throttling function. In this case, in 201021348, the operating frequency of the central processing unit can be reduced without passing through the operating system. At step 26G, the computer system is down to the event. Before the step of detecting the AC power removal signal, the battery protection method may further include the following additional steps: receiving the AC power safety removal signal; and performing a pre-protection procedure based on the AC power safety removal signal. The pre-protection program allows the computer system to take appropriate action to prepare for the event of removing AC power. For example, if the user wants to execute a program that will use a large amount of electrical resources, the pre-protection program can display a warning message. When the battery is used as the power source for the notebook, the down-conversion mechanism of the present invention rewrites the frequency operation mechanism originally determined by the operating system. For example, in an embodiment, when the power mode is set to a different mode such as a battery mode, a performance mode, or a power saving mode, there may be different frequency switching settings, but in the frequency reduction mechanism of the present invention, when When the AC power is removed and the battery is used as the power source, the frequency reduction is performed to protect the battery. Because, when the battery is used to provide power, if the computer system is still in a high-frequency state (for example, when the user sets the power mode in the performance mode )), the CPU consumes more power when the load is high. The current is increased to provide the current required by the computer system. The battery may not be able to load such a large current in an instant, which may cause damage to the battery, resulting in extremely short battery life. Therefore, the present invention can protect the battery and extend the battery life. Although the present invention has been described above in terms of a preferred embodiment, it is not intended to limit the invention, and it is intended that various modifications and changes may be made without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS The above and other objects, features, advantages and embodiments of the present invention will become more <RTIgt; A block diagram of the functional architecture of the battery protection system. Fig. 2 is a flow chart showing a battery protection method according to an embodiment of the present invention. 160: Operating System 165. AC Power Safety Removal Unit 18〇: Central Processing Unit [Main Component Symbol Description] 100: Battery Protection System 110: Battery 120: Embedded Controller 140: Basic Output Input System 210-260: Step Method