Battery electric quantity control method and device, controller, equipment and storage medium
The embedded controller-based battery power control method addresses the unreliability of OS-dependent methods by managing battery charging and discharging independently, ensuring consistent power management and battery longevity.
Patent Information
- Application Number
- CN202411222705.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-10
AI Technical Summary
Existing battery power control methods relying on operating system background programs are unreliable due to interruptions caused by system changes, such as power on/off, restarts, or failures, leading to inconsistent battery management.
Implementing a battery power control method using an embedded controller (EC) that receives control instructions from the system and manages battery charging and discharging based on real-time parameters, independent of the operating system's status, including upper and lower power limits, temperature thresholds, and charging current/voltage, via interfaces like ACPI.
Ensures continuous and reliable battery power management by maintaining control during system changes, preventing overcharging/over-discharging, and extending battery life and safety.
Smart Images

Figure CN119109171A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery management, and in particular to a method, device, controller, equipment and storage medium for controlling battery power. Background Art
[0002] In the development and testing of existing computer equipment (such as laptops, tablets, etc.), controlling the battery power helps optimize the power management system. By monitoring and analyzing the charging and discharging behavior of the battery, potential problems in the power management system can be discovered and resolved, improving the overall performance and reliability of the computer equipment.
[0003] In the related art, the battery power is controlled by writing a background program for battery power control and running it in the operating system (OS). However, in the above process, the background program that relies on the OS will be affected by the change of the computer device status (such as power on and off, system restart, or system failure), resulting in failure of battery power control.
[0004] It can be seen from the above that in the related art, the reliability of battery power control is poor. Summary of the invention
[0005] The present application provides a battery power control method, device, controller, equipment and storage medium to solve the problem of poor reliability of battery power control existing in related technologies.
[0006] In a first aspect, the present application provides a battery power control method, which is applied to an embedded controller EC in a computer device, comprising:
[0007] Receiving a battery control instruction sent by the system of the computer device, wherein the battery control instruction includes a control parameter for controlling the battery power;
[0008] The charging and discharging of the battery is controlled according to the control parameters and the battery parameters acquired in real time.
[0009] In a possible implementation manner, the battery control instruction is generated by the system of the computer device based on the control parameters of the battery input by the user in the system command interface.
[0010] In a possible implementation manner, the control parameter includes at least one of the following parameters:
[0011] Upper limit of power, lower limit of power, battery temperature, charging current and charging voltage.
[0012] In a possible implementation, the control parameter includes the power upper limit; and controlling the charging and discharging of the battery according to the control parameter and the battery parameter acquired in real time includes:
[0013] During the battery charging process, the battery power is acquired in real time, and it is determined whether the battery power reaches the upper power limit, and the battery parameters include the battery power;
[0014] If the battery power reaches the upper power limit, the charging IC is controlled to stop charging.
[0015] In a possible implementation, the control parameter includes the lower limit of the power; and controlling the charging and discharging of the battery according to the control parameter and the battery parameter acquired in real time includes:
[0016] During the battery discharge process, the battery power is acquired in real time, and it is determined whether the battery power drops to the lower power limit, and the battery parameters include the battery power;
[0017] If the battery power drops to the lower power limit, the charging IC is controlled to charge the battery or the battery stops discharging.
[0018] In a possible implementation, the control parameter includes the battery temperature threshold; and controlling the charging and discharging of the battery according to the control parameter and the battery parameter acquired in real time includes:
[0019] During the battery charging process, obtaining the battery temperature in real time, and determining whether the battery temperature reaches the battery temperature threshold, the battery parameter including the battery temperature;
[0020] If the battery temperature reaches the battery temperature threshold, the charging IC is controlled to stop charging.
[0021] In a possible implementation manner, the receiving the battery control instruction sent by the system of the computer device includes:
[0022] The battery control instruction is received from the system of the computer device through the Advanced Configuration Power Management Interface (ACPI).
[0023] In a second aspect, the present application provides a battery power control device, comprising:
[0024] A receiving module, used to receive a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes a control parameter for controlling the battery power;
[0025] The control module is used to control the charging and discharging of the battery according to the control parameters and the battery parameters obtained in real time.
[0026] In a third aspect, the present application provides an embedded controller EC, comprising: a processor, a memory and a communication interface;
[0027] The memory stores computer-executable instructions;
[0028] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the battery power control method described in any one of the first aspects.
[0029] In a fourth aspect, the present application provides a computer device, comprising: a charging IC, a battery, and the embedded controller EC described in the third aspect.
[0030] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the battery power control method described in any one of the first aspects.
[0031] The present application provides a battery power control method, device, controller, equipment and storage medium, including an EC that can receive a battery control instruction sent by a computer device system, and control the charging and discharging of the battery according to the control parameters included in the battery control instruction and the battery parameters obtained in real time. In the above process, the EC can continue to control the charging and discharging of the battery when the state of the computer device changes according to the received battery control instruction, thereby improving the reliability of battery power control. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0033] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;
[0034] Figure 2 A flowchart of a first embodiment of a method for controlling battery power provided in the present application;
[0035] Figure 3 A flowchart of a second embodiment of a method for controlling battery power provided in the present application;
[0036] Figure 4 A flowchart of a third embodiment of a method for controlling battery power provided in the present application;
[0037] Figure 5 A flowchart of a fourth embodiment of a method for controlling battery power provided in the present application;
[0038] Figure 6 A flowchart of an example of a method for controlling battery power provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the control principle of the battery power provided in the embodiment of the present application;
[0040] Figure 8 A schematic diagram of the structure of a battery power control device provided in an embodiment of the present application;
[0041] Fig. 9 A schematic diagram of the structure of an embedded controller provided in an embodiment of the present application.
[0042] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0044] Battery performance and life are key factors in determining the overall performance of computer equipment. During the research and development and testing process, by monitoring and analyzing the charging and discharging behavior of the battery, potential problems in the power management system can be identified and resolved. An optimized power management system can more efficiently utilize battery power, thereby improving the energy efficiency and reliability of computer equipment.
[0045] In the related art, the battery power management and control is usually achieved by writing background programs. These background programs run in the operating system and are responsible for real-time monitoring of the battery power status and performing corresponding management operations as needed. For example, when the battery power is too low, the background program can trigger the charging mode to charge the battery; and when the battery power is too high, the background program can trigger the discharge mode to prevent the battery from overcharging.
[0046] However, this power management method that relies on the normal operation of the operating system has significant limitations and will be affected by changes in the status of the computer device. For example, when the computer device is turned off, the operating system stops running, and the background program also stops, and it is impossible to continue to monitor and manage the battery power; when the computer device is turned on or the system is restarted, the operating system and background programs will temporarily stop working, resulting in interruption of battery power management; in addition, if the operating system crashes or other failures occur, the background program will not be able to run normally, and the battery power management will also fail.
[0047] In summary, the method of controlling battery power through operating system background programs in the related art has significant deficiencies in reliability.
[0048] In response to the above problems, the inventors considered using an embedded controller (EC) in a computer device to implement a battery power management method without relying on the normal operation of the operating system. Specifically, after many experiments, the inventors found that the battery control instructions sent by the system (i.e., the operating system) of the computer device can be received through the EC in the computer device, and the battery charging and discharging can be controlled according to the control parameters for controlling the battery power included in the control instructions and the battery parameters obtained in real time. This method can continue to effectively manage the charging and discharging process of the battery when the state of the computer device changes. Based on this, the present application proposes a battery power control method to further improve the reliability of battery power control.
[0049] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 The computer device 100 includes an embedded controller 102 and a battery 103 .
[0050] The computer device 100 may run a system 101 , and the system 101 of the computer device 100 may send a battery control instruction to the embedded controller 102 , and the embedded controller 102 may control the charging and discharging of the battery 103 according to the battery control instruction.
[0051] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0052] Figure 2 This is a flow chart of the first embodiment of the method for controlling the battery power provided by this application. Figure 2, the method is applied to an embedded controller EC in a computer device, and the method may include:
[0053] S201, receiving a battery control instruction sent by a system of a computer device, where the battery control instruction includes control parameters for managing battery power.
[0054] The execution subject of the embodiment of the present application may be an EC, or a battery power control device set in the EC. The battery power control device may be implemented by software, or by a combination of software and hardware. The battery power control device may be a processor in the EC. For ease of understanding, the following description is made by taking the execution subject as an EC as an example.
[0055] In this step, the EC may receive a battery control instruction sent by the system of the computer device through the advanced configuration power management interface, where the battery control instruction includes control parameters for managing the battery power.
[0056] In computer equipment, EC can be responsible for managing and controlling various hardware functions and system tasks. It is usually a low-power microcontroller that is independent of the main processor (Central Processing Unit, CPU) and can run independently using system power supply without being affected by changes in the status of the computer equipment.
[0057] Advanced Configuration and Power Interface (ACPI) is an open standard for communication between OS and computer device hardware (such as EC). ACPI is mainly used to implement functions such as power management, temperature management and system resource allocation.
[0058] The battery control instruction may be generated by the system of the computer device based on the battery control parameters input by the user in the system command interface.
[0059] The control parameters may include any one or a combination of an upper power limit, a lower power limit, a battery temperature, a charging current, and a charging voltage.
[0060] The upper limit of power refers to the maximum percentage of power allowed when the battery is charged. Usually, the upper limit of the battery power is set to 100%, but in order to extend the battery life, the computer device allows the upper limit of power to be set to less than 100%, such as 80% or 90%, so as to reduce the battery charging cycle and delay the aging of the battery.
[0061] The lower limit of power refers to the lowest percentage of power allowed when the battery is discharged. For example, the lower limit of the battery power is set to 5% or 10% to ensure that the system has enough time to shut down safely before the battery is exhausted.
[0062] Battery temperature refers to the temperature generated by the battery during the charging process. Excessive temperature will accelerate the aging of the battery and even cause safety problems such as overheating or fire. Therefore, computer equipment needs to monitor battery temperature and adjust the charging rate when necessary to prevent overheating.
[0063] The charging current refers to the amount of current that the battery receives during the charging process. The charging current affects the charging speed and battery life. A larger charging current can speed up the charging speed, but may increase the temperature and aging of the battery. A smaller charging current helps to extend the battery life, but the charging time is longer.
[0064] The charging voltage refers to the voltage received by the battery during the charging process. The charging voltage directly affects the charging efficiency and life of the battery. Too high a charging voltage may cause the battery to overheat and be damaged, while too low a charging voltage will prolong the charging time.
[0065] For example, the EC may receive a battery control instruction sent by a system of a computer device through an APCI interface, wherein the battery control instruction includes control parameters for managing the battery power, and the control parameters include a power upper limit of 80%.
[0066] S202: Control the charging and discharging of the battery according to the control parameters and the battery parameters acquired in real time.
[0067] In this step, the EC can control the charging and discharging of the battery according to the control parameters included in the battery control instruction and the battery parameters obtained by real-time monitoring of the battery status.
[0068] For example, if the battery is in a charging state, the battery parameters obtained by the EC in real time include a battery power of 70%. Since the battery control instruction includes an upper limit of 80%, which is greater than the battery power of 70%, the battery can continue to be charged. During the charging process, if the battery power included in the battery parameters obtained in real time reaches the upper limit of 80%, the battery will stop charging.
[0069] In an embodiment of the present application, the EC can receive a battery control instruction sent by the system of the computer device, and the battery control instruction includes a control parameter for controlling the battery power. The EC can control the charging and discharging of the battery according to the control parameter and the battery parameters obtained in real time. In the above process, the battery charging and discharging can be managed through the battery control instruction received by the EC, effectively avoiding the failure of battery power management caused by the change of the computer device state, thereby improving the reliability of battery power management.
[0070] exist Figure 2 Based on the embodiment shown below, combined with Figure 3 According to the control parameters including the upper limit of power, the battery parameters including the battery power, the above-mentioned battery power control method is further described in detail.
[0071] Figure 3 This is a flow chart of the second embodiment of the method for controlling the battery power provided by this application. Figure 3 , the method may include:
[0072] S301, receiving a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes control parameters for controlling battery power, and the control parameters include an upper limit of battery power.
[0073] In this step, the EC can receive a battery control instruction sent by the computer system through the ACPI interface, and the battery control instruction is generated by the computer system based on the battery control parameters input by the user in the system command interface, wherein the control parameters include the upper limit of the power.
[0074] Optionally, you can enter the system command interface in any of the following ways:
[0075] Method 1: The system of the computer device can respond to the user opening a "Run" dialog box in the system and entering a command to enter the system command interface, such as "Power shell", to enter the system command interface.
[0076] Method 2: An application (Application, APP) for controlling battery charging and discharging may be installed in the system of the computer device, and the user can enter the system command interface by clicking on the APP.
[0077] For example, the EC may receive a battery control instruction sent by a system of a computer device through an ACPI interface, where the battery control instruction includes an upper limit of 80% of the power.
[0078] S302: During the battery charging process, the battery power is obtained in real time, and it is determined whether the battery power reaches an upper power limit.
[0079] In this step, during the battery charging process, the EC can communicate with the battery through the communication protocol to obtain the battery power in real time, compare the real-time obtained battery power with the power limit included in the battery control instruction, and determine whether the battery power reaches the power limit.
[0080] Optionally, the communication protocol between the EC and the battery may include any one of a system management bus (SMBus), an inter-integrated circuit (I2C), and a battery serial bus (BSB).
[0081] For example, during the battery charging process, the EC can communicate with the battery through the I2C communication protocol and obtain the real-time battery power of 80%. By comparing the real-time battery power of 80% with the upper limit of 80% included in the battery control instruction, it can be determined that the battery power has reached the upper limit of 80%.
[0082] S303: If the battery power reaches the upper power limit, the charging IC is controlled to stop charging.
[0083] In this step, the EC can control the charging IC to stop charging the battery according to the battery power reaching the upper limit obtained in real time.
[0084] Charge IC is an integrated circuit specially designed to manage and control the battery charging process, which is commonly used in various computer devices such as smartphones, tablets and laptops. The charging process can be optimized by charging IC to ensure that the battery is charged under safe and efficient conditions, thereby extending battery life and improving device performance.
[0085] Charging IC supports multiple charging modes, such as constant current charging, constant voltage charging and trickle charging. Using charging IC in the battery charging process can simplify the battery charging circuit design, improve the charging efficiency, and ensure the safety of the battery and computer equipment.
[0086] For example, the EC can control the charging IC to stop charging the battery according to the battery power reaching the upper limit of 80% obtained in real time.
[0087] In the embodiment of the present application, the EC can receive a battery control instruction sent by the computer device system, and the battery control instruction includes a control parameter of the upper limit of the power. During the charging process, the EC can monitor the battery power in real time, obtain battery parameters including the battery power, and control the charging IC to stop charging according to the battery power reaching the upper limit of the power. In the above process, when the EC receives the upper limit control parameter of the power to control the upper limit of the battery power, it will not be affected by the change of the computer device state, thereby improving the reliability of battery power control.
[0088] Furthermore, in the embodiment of the present application, the EC can control the upper limit of the battery power according to the received upper limit of the power, thereby avoiding overcharging of the battery, reducing the aging speed of the battery, and extending the service life of the battery.
[0089] exist Figure 2 Based on the embodiment shown below, combined with Figure 4 According to the control parameters including the lower limit of power, the battery parameters including the battery power, the above-mentioned battery power control method is further described in detail.
[0090] Figure 4 This is a flow chart of the third embodiment of the battery power control method provided in this application. Figure 4 , the method may include:
[0091] S401, receiving a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes control parameters for controlling battery power, and the control parameters include a lower limit of battery power.
[0092] For example, the EC may receive a battery control instruction sent by a system of a computer device through an ACPI interface, where the battery control instruction includes a battery power lower limit of 10%.
[0093] S402: During the battery discharge process, the battery power is obtained in real time, and it is determined whether the battery power drops to a lower power limit.
[0094] For example, during battery discharge, the EC can communicate with the battery through the I2C communication protocol and obtain the real-time battery power of 10%. By comparing the real-time battery power of 10% with the lower limit of 10% included in the battery control instruction, it can be determined that the battery power drops to the lower limit of 10%.
[0095] S403: If the battery power drops to the lower power limit, the charging IC is controlled to charge the battery or the battery stops discharging.
[0096] In this step, the EC can control the charging IC to charge the battery when the charging IC is connected to an external power source according to the battery power level obtained in real time and drops to the lower limit, or control the battery to stop discharging when the charging IC is not connected to the external power source.
[0097] An external power supply refers to an external power adapter that provides power to a computer device. It is also called a power adapter or power charger. It is connected to a computer device through a power cord to charge the battery of the computer device.
[0098] In an optional implementation, after completing the development and testing tasks for the computer device, it is necessary to switch it to the ship mode. In a specific implementation, when the charging IC is not connected to the external power supply and the battery power drops to the lower limit, the battery is controlled to stop discharging, so that the device enters the ship mode.
[0099] For example, the EC can control the charging to charge the battery when the charging IC is connected to an external power source based on the battery power reaching the lower limit of 10% obtained in real time.
[0100] For another example, the EC can control the battery to stop discharging when the battery power obtained in real time reaches the lower limit of 10% and the charging IC is not connected to the external power supply.
[0101] In an embodiment of the present application, the EC can receive a battery control instruction sent by a computer device system, and the battery control instruction includes a control parameter of the lower limit of the power. During the charging process, the EC can monitor the battery power in real time, obtain battery parameters including the battery power, and can control the charging IC to charge the battery or stop discharging the battery according to the battery power falling to the lower limit. In this process, the EC will not be affected by the change in the state of the computer device, thereby improving the reliability of battery power management and control. In addition, the EC can control the lower limit of the battery power according to the received lower limit of the power, reduce the deep discharge of the battery, and prevent damage caused by over-discharge of the battery, thereby ensuring the safety of the device.
[0102] It should be noted that if the control parameters included in the battery control instruction include an upper power limit and a lower power limit, the process of the EC controlling the charging IC to stop charging when the battery power reaches the upper power limit can be referred to in Example 2; the process of controlling the charging IC to charge the battery or stop discharging the battery when the battery power drops to the lower power limit can be referred to in Example 3, which will not be repeated here.
[0103] exist Figure 2 Based on the embodiment shown below, combined with Figure 5According to the control parameters including the battery temperature threshold, the battery parameters including the battery temperature, the above-mentioned battery power control method is further described in detail.
[0104] Figure 5 This is a flowchart of the fourth embodiment of the battery power control method provided in this application. Figure 5 , the method may include:
[0105] S501, receiving a battery control instruction sent by a system of a computer device, where the battery control instruction includes control parameters for managing battery power, and the control parameters include a battery temperature threshold.
[0106] The battery temperature threshold refers to the maximum temperature limit that the battery can withstand during charging. Once the battery temperature threshold is exceeded, the battery may experience performance degradation or even safety problems such as overheating or fire. The unit is degrees Celsius (℃). For example, the battery temperature threshold is 50℃.
[0107] For example, the EC may receive a battery control instruction sent by a system of a computer device through an ACPI interface, where the battery control instruction includes a battery temperature threshold of 50° C.
[0108] S502: During the battery charging process, obtain the battery temperature in real time, and determine whether the battery temperature reaches a battery temperature threshold.
[0109] For example, during the battery charging process, the EC can communicate with the battery through the I2C communication protocol and obtain the real-time battery temperature of 50°C. By comparing the real-time battery temperature of 50°C with the battery temperature threshold of 50°C included in the battery control instruction, it can be determined that the battery temperature of 50°C has reached the battery temperature threshold of 50°C.
[0110] S503: If the battery temperature reaches the battery temperature threshold, control the charging IC to stop charging.
[0111] For example, the EC can control the charging IC to stop charging the battery based on the battery temperature of 50° C. acquired in real time reaching the battery temperature threshold of 50° C.
[0112] In an embodiment of the present application, the EC can receive a battery control instruction sent by a computer device system, and the battery control instruction includes a control parameter of a battery temperature threshold. During the charging process, the EC can monitor the battery temperature in real time, obtain battery parameters including the battery temperature, and control the charging IC to stop charging according to the battery temperature reaching the battery temperature threshold. During this process, the EC will not be affected by changes in the state of the computer device, thereby improving the reliability of battery power management and control. In addition, the EC can control the upper limit of the battery temperature according to the received battery temperature threshold, thereby preventing the battery from overheating during the charging process and improving the battery life and safety.
[0113] Figure 6 A flowchart of an example of a method for controlling battery power provided in an embodiment of the present application.
[0114] See also Figure 6 , the method may include:
[0115] S601. Run the power management tool.
[0116] In this step, the operating system can respond to the user opening the power control tool in the operating system and enter the system command interface. The power control tool can be a "Run" dialog box in the system, or an application that controls battery charging and discharging.
[0117] Optionally, the system command interface may provide a command line for the user to input commands, and the user may input control parameters for managing the battery power in the command line.
[0118] S602: Set the upper and lower power limits for power control.
[0119] In this step, the system of the computer device can generate a battery control instruction based on the battery control parameters input by the user in the system command interface, and the battery control instruction includes an upper power limit and a lower power limit.
[0120] For example, the system of the computer device may generate a battery control instruction based on a power lower limit of 10% and a power upper limit of 80% input by a user in a system command interface.
[0121] S603 . The EC receives the upper power limit and the lower power limit through the advanced configuration power management interface ACPI.
[0122] For example, the EC may receive a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes control parameters for managing the battery power, wherein the control parameters include a lower power limit of 10% and an upper power limit of 80%.
[0123] In an optional implementation, in order to enhance the security of EC configuration of charging IC and battery and prevent users from sending erroneous battery control instructions, the battery control instructions may also include control instructions for unlocking EC. Only after EC is successfully unlocked can the charging IC and battery be configured according to the control parameters included in the battery control instructions to manage the battery power.
[0124] If the battery control instruction also includes a control instruction for unlocking the EC, and the EC cannot be unlocked correctly, the EC may continue to remain in a locked state and the battery control instruction will not be executed.
[0125] S604, the EC configures the charging IC and the battery according to the upper and lower limits of the power, and feeds back the return value.
[0126] In this step, the EC can configure the charging IC and the battery according to the upper and lower power limits, and when receiving the battery control command sent by the system of the computer device, it feeds back the return value to the power management tool.
[0127] Optionally, the return value is used to indicate whether the EC successfully receives the battery control instruction sent by the system of the computer device.
[0128] For example, if the EC successfully receives the battery control instruction sent by the system of the computer device, it can return a setting success value of 1; otherwise, if the EC fails to successfully receive the battery control instruction sent by the system of the computer device, it can return a setting failure value of 0.
[0129] For another example, if the EC successfully receives the battery control instruction sent by the system of the computer device, it may return a hexadecimal number 0x01; conversely, if the EC fails to successfully receive the battery control instruction sent by the system of the computer device, it may return a hexadecimal number 0x00.
[0130] For example, the EC can control the charging IC to charge the battery when the battery power reaches the lower limit of 10%, and control the charging IC to stop charging the battery when the battery power reaches the upper limit of 80%; and feedback the return value 0x01 to the power control tool.
[0131] S605. The power management tool determines that the setting is successful based on the returned value.
[0132] For example, the power management tool determines that the EC is successfully set based on the return value 0x01.
[0133] The example of the battery power control method provided in the present application can refer to the process shown in the above method embodiment for its working process during application. Its implementation principle and beneficial effects are similar and will not be described in detail here.
[0134] Figure 7 This is a schematic diagram of the battery power control principle provided in the embodiment of this application. Figure 7 , including a control tool 200, an interactive channel 300, a control unit 400, and an execution unit 500, wherein the execution unit 500 includes a charging IC 501, a battery 502, and a power control function 503. The power control function 503 can be run in the control unit 400.
[0135] The control tool 200 can perform write operations and read operations on the control unit 400 through the interactive channel 300. In a specific implementation, the power control tool running in the operating system of the computer device can send a battery control instruction to the EC through the ACPI interface; after the EC receives the battery control instruction through the ACPI interface, it can feedback a return value to the power control tool. The power control tool can determine whether the EC successfully receives the battery control instruction based on the return value fed back by the EC.
[0136] The control unit 400 can perform write operations and read operations on the charging IC 501. In a specific implementation, the charging IC has a microcontroller unit (MCU), and the EC can perform write operations and read operations on the MCU of the charging IC.
[0137] For example, if the battery control instruction includes a charging current control parameter, the EC can set the charging current for the MCU of the charging IC according to the control parameter, and read the set charging current from the register of the MCU.
[0138] The control unit 400 can perform write operations and read operations on the battery 502. Similarly, the battery has an MCU, and the EC can perform write operations and read operations on the MCU of the battery.
[0139] For example, the EC can write instructions to read battery information to the battery's MCU and read the real-time charging current from the battery's MCU.
[0140] Optionally, in addition to inputting control parameters for controlling battery power in the power control tool to generate battery control instructions, you can also input battery control instructions for reading battery information in the power control tool. For example, the user can input the battery control instruction 0x3f for reading battery information in the power control tool, and 0x3f is used to instruct the EC to read the real-time charging current of the battery.
[0141] The control unit 400 can control the charging IC 501 to charge or stop charging the battery 502 through the power control function 503. In a specific implementation, the control unit 400 can receive a battery control instruction sent by the control tool 200 through the interactive channel 300, and configure the power control function 503 according to the battery control instruction to control the charging IC 501 to charge or stop charging the battery 502.
[0142] For example, EC can receive a battery control instruction sent by a power control tool through an ACPI interface, and the battery control instruction includes a power lower limit of 10% and a power upper limit of 80%. EC can configure the power control function according to the power lower limit of 10% and the power upper limit of 80%. When the battery power reaches the power lower limit of 10%, the power control function controls the charging IC to charge the battery. When the battery power reaches the power upper limit of 80%, the power control function controls the charging IC to stop charging the battery.
[0143] Furthermore, after the control unit 400 successfully configures the power control function 503 according to the control parameters included in the battery control instruction, the control unit 400 can obtain a return value and determine whether the power control function 503 is successfully configured according to the return value.
[0144] For example, the power lower limit of 10% is the actual parameter A sent by the power control tool through the ACPI interface, and the power upper limit of 10% is the actual parameter B. There are formal parameters C and D in the power control function, where formal parameter C represents the power lower limit and formal parameter D represents the power upper limit. If EC successfully configures formal parameter C according to actual parameter A and configures the power lower limit to 10%, and successfully configures formal parameter D according to actual parameter B and configures the power upper limit to 80%, then EC can obtain the return value 0x01, and determine that the power control function has been successfully configured based on the return value 0x01.
[0145] In an optional implementation, when the charging IC 501 is controlled according to the power control function 503, the correctness of the control parameters written into the MCU of the charging IC 501 can be verified. In a specific implementation, the control unit 400 writes the control parameters to the charging IC 501 through the power control function 503 and verifies the correctness of the control parameters, which may include parameter writing, writing confirmation, parameter reading, and parameter verification.
[0146] In the writing process, the EC can write the control parameters into the register of the charging IC through the SMBus, I2C, or BSB communication protocol.
[0147] In the write confirmation phase, the charging IC will return a confirmation signal after completing the write operation. The EC can read the confirmation signal to confirm whether the control parameter writing is successful.
[0148] In the parameter reading stage, in order to further verify whether the written control parameters are correct, the EC can read the written control parameters from the charging IC again through the communication protocol.
[0149] In the parameter verification phase, EC can compare the read control parameters with the originally written control parameters. If the two are consistent, the write operation is successful. If the values are inconsistent, EC can record error information and rewrite the control parameters.
[0150] Figure 8 This is a schematic diagram of the structure of the battery power control device provided in the embodiment of the present application. Figure 8 The battery power control device 10 is applied to an embedded controller EC in a computer device, and includes:
[0151] A receiving module 11 is used to receive a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes a control parameter for controlling the battery power;
[0152] The control module 12 is used to control the charging and discharging of the battery according to the control parameters and the battery parameters acquired in real time.
[0153] The battery power control device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0154] In a possible implementation manner, the battery control instruction is generated by the system of the computer device based on the control parameters of the battery input by the user in the system command interface.
[0155] In a possible implementation manner, the control parameter includes at least one of the following parameters:
[0156] Upper limit of power, lower limit of power, battery temperature, charging current and charging voltage.
[0157] In a possible implementation manner, the control parameter includes the power upper limit; the control module 12 is specifically configured to:
[0158] During the battery charging process, the battery power is acquired in real time, and it is determined whether the battery power reaches the upper power limit, and the battery parameters include the battery power;
[0159] If the battery power reaches the upper power limit, the charging IC is controlled to stop charging.
[0160] In a possible implementation manner, the control parameter includes the lower limit of the power; the control module 12 is specifically configured to:
[0161] During the battery discharge process, the battery power is acquired in real time, and it is determined whether the battery power drops to the lower power limit, and the battery parameters include the battery power;
[0162] If the battery power drops to the lower power limit, the charging IC is controlled to charge the battery or the battery stops discharging.
[0163] In a possible implementation manner, the control parameter includes the battery temperature threshold; the control module 12 is specifically configured to:
[0164] During the battery charging process, obtaining the battery temperature in real time, and determining whether the battery temperature reaches the battery temperature threshold, the battery parameter including the battery temperature;
[0165] If the battery temperature reaches the battery temperature threshold, the charging IC is controlled to stop charging.
[0166] In a possible implementation manner, the receiving module 11 is specifically configured to:
[0167] The battery control instruction is received from the system of the computer device through the Advanced Configuration Power Management Interface (ACPI).
[0168] The battery power control device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0169] Fig. 9 This is a schematic diagram of the structure of the embedded controller provided in the embodiment of the present application. Fig. 9 , the embedded controller (EC) 20 may include a processor 21, a memory 22 and a communication interface 24. Exemplarily, the processor 21, the memory 22 and the communication interface 24 are connected to each other via a bus 23.
[0170] The memory 22 stores computer-executable instructions;
[0171] The processor 21 executes the computer-executable instructions stored in the memory 22, so that the processor 21 executes the battery power control method provided in the above method embodiment.
[0172] The present application embodiment provides a computer device, including a charging IC, a battery, and Fig. 9 The embedded controller shown is used to implement the battery power control method provided in the above method embodiment.
[0173] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the battery power control method described in the above method embodiment.
[0174] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0175] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0176] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0177] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0178] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0179] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0180] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0181] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0182] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for controlling battery power, characterized in that: Embedded controllers EC used in computer equipment include: Receiving a battery control instruction sent by the system of the computer device, wherein the battery control instruction includes a control parameter for controlling the battery power; The charging and discharging of the battery is controlled according to the control parameters and the battery parameters acquired in real time.
2. The method according to claim 1, characterized in that The battery control instruction is generated by the system of the computer device based on the control parameters of the battery input by the user in the system command interface.
3. The method according to claim 1 or 2, characterized in that: The control parameters include at least one of the following parameters: Upper limit of power, lower limit of power, battery temperature, charging current and charging voltage.
4. The method according to claim 3, characterized in that The control parameter includes the upper limit of the power; and the charging and discharging of the battery is controlled according to the control parameter and the battery parameter obtained in real time, including: During the battery charging process, the battery power is acquired in real time, and it is determined whether the battery power reaches the upper power limit, and the battery parameters include the battery power; If the battery power reaches the upper power limit, the charging IC is controlled to stop charging.
5. The method according to claim 3, characterized in that: The control parameter includes the lower limit of the power; and the charging and discharging of the battery is controlled according to the control parameter and the battery parameter obtained in real time, including: During the battery discharge process, the battery power is acquired in real time, and it is determined whether the battery power drops to the lower power limit, and the battery parameters include the battery power; If the battery power drops to the lower power limit, the charging IC is controlled to charge the battery or the battery stops discharging.
6. The method according to claim 3, characterized in that The control parameter includes the battery temperature threshold; and the charging and discharging of the battery is controlled according to the control parameter and the battery parameter acquired in real time, including: During the battery charging process, obtaining the battery temperature in real time, and determining whether the battery temperature reaches the battery temperature threshold, the battery parameter including the battery temperature; If the battery temperature reaches the battery temperature threshold, the charging IC is controlled to stop charging.
7. A battery power control device, characterized in that: include: A receiving module, used to receive a battery control instruction sent by a system of a computer device, wherein the battery control instruction includes a control parameter for controlling the battery power; The control module is used to control the charging and discharging of the battery according to the control parameters and the battery parameters obtained in real time.
8. An embedded controller EC, characterized in that: include: Processor, memory and communication interface; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the battery power control method according to any one of claims 1 to 6.
9. A computer device, characterized in that: include: A charging IC, a battery, and an embedded controller EC as claimed in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the battery power control method according to any one of claims 1 to 6.
