Battery dynamic charging method based on Linux Kernel

By adding current settings, battery monitoring and power control functions in Linux Kernel, dynamically adjusting the charging power, the problem of high battery damage to traditional charging solutions is solved and the battery life is extended.

CN120261775APending Publication Date: 2025-07-04EMDOOR CHINESE ACAD OF SCI CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510418687.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The existing traditional charging solution based on Linux Kernel cannot dynamically adjust the charging power according to the battery status, resulting in high battery damage and difficulty in extending the battery life.

Method used

By adding the current setting function, battery monitoring function and power control function, the temperature state, charging current and battery capacity during the battery charging process is monitored in real time, and the charging power of the charger is dynamically adjusted, including defining the event trigger mechanism in the charger driver and adjusting the charging current using the index table.

Benefits of technology

The battery charging efficiency and life are balanced, the battery is reduced, and the battery is damaged during charging is solved, and the traditional charging solution is a problem of high damage to the battery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120261775A_ABST
    Figure CN120261775A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic battery charging method based on Linux Kernel. The method comprises the following steps: adding a current setting function in a charger driver; adding a battery monitoring function in the driving sbs-battery. C of the battery, and monitoring the temperature state, the charging current and the battery electric quantity when the battery is charged; adding a function for controlling the charging current according to the temperature when the battery is charged in the driving sbs-battery. C of the battery, and meanwhile, monitoring whether the charger starts to charge the battery or not; when it is monitored that the charger starts to charge the battery, the charging power output by the charger to the battery is dynamically and automatically adjusted in real time according to the temperature state, the charging current and the battery electric quantity when the battery is charged. The method has the advantages that the state of the battery in the charging process can be monitored in real time, the charging power of the charger can be dynamically adjusted, and damage caused by battery charging is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery charging, and in particular, to a dynamic battery charging method based on the Linux Kernel. Background Art

[0002] The Linux Kernel, namely the Linux kernel, is the main component of the Linux operating system and also the core interface between computer hardware and its processes. It is responsible for communication between the two and manages resources as efficiently as possible. Its core functions mainly include process management, responsible for creating and destroying processes, as well as process scheduling. It determines which processes can use the central processing unit (CPU), when to use it, and for how long. For example, in a multitasking operating system, it will reasonably allocate CPU time to different processes to ensure the efficient operation of the system.

[0003] With the upgrading of the demand for energy efficiency management in mobile devices and embedded systems, the power management subsystem (Power Supply) of the Linux kernel has gradually integrated charging control capabilities. People use mobile devices more and more frequently, and almost all mobile devices are powered by non-removable rechargeable batteries. The battery needs to be charged from time to time. Battery charging is a process in which external power provides energy to cause a chemical reaction inside the battery, thereby converting electrical energy into chemical energy and storing it. Therefore, people's requirements for the battery life of mobile devices are also getting higher and higher.

[0004] In the prior art, the development bottleneck in battery hardware technology results in the battery life not meeting people's ideal requirements. Therefore, only by controlling the battery charging and discharging process can the purpose of extending the battery life be achieved. Currently, traditional charging schemes based on the Linux Kernel generally use a fixed current / voltage mode for charging, and cannot adjust the charging power according to the charging state of the battery during the charging process. Each charge will cause irreversible damage to the battery, and it is impossible to extend the battery life, resulting in a poor user experience. Summary of the Invention

[0005] To solve the problems in the prior art, the present invention provides a dynamic battery charging method based on the Linux Kernel. By adding a current setting function, a battery monitoring function, and a power control function, it can monitor the state during the battery charging process in real time and dynamically adjust the charging power of the charger, greatly reducing the damage caused during battery charging, and solving the problems in the prior art that traditional charging schemes based on the Linux Kernel cause relatively high damage to the battery and are difficult to extend the battery service life.

[0006] A battery dynamic charging method based on Linux Kernel of the present invention includes the following steps:

[0007] Step 1, add a current setting function, and add a current setting function in the charger driver with the chip model bq25700;

[0008] Step 2, add a battery monitoring function, and add a battery monitoring function in the battery driver sbs-battery.c to monitor the temperature status, charging current, and battery power during battery charging;

[0009] Step 3, add a power control function, and add a function in the battery driver sbs-battery.c to control the charging current according to the temperature during battery charging, and at the same time start monitoring whether the charger starts to charge the battery;

[0010] Step 4, control the dynamic output of the charging power. When it is monitored that the charger starts to charge the battery, the charging power output by the charger to the battery is adjusted automatically and dynamically in real time according to the temperature status, charging current, and battery power of the battery during charging.

[0011] For further improvement of the present invention, in the said Step 1, the control system of the charger is a control management system based on Linux Kernel.

[0012] For further improvement of the present invention, in the said Step 2, the control system of the battery is a control management system based on Linux Kernel.

[0013] For further improvement of the present invention, in the said Step 2, the temperature status interval index table during battery charging is configured through the device tree, including the mapping relationship between the temperature range and the charging current value, and the specific format is <starting temperature ending temperature charging current>.

[0014] For further improvement of the present invention, in the said Step 2, adding the battery monitoring function includes registering a delayed_work task in the battery driver sbs-battery.c to periodically obtain the temperature data during battery charging and trigger the control logic.

[0015] For further improvement of the present invention, in the said Step 4, the real-time dynamic automatic adjustment of the charging power output by the charger to the battery includes the following steps:

[0016] Step 401, the event trigger mechanism defined in the charger driver is triggered, including CHARGER_CURRENT_EVENT and INPUT_CURRENT_EVENT;

[0017] Step 402: Call the preset current setting function according to the event type, determine the charging current value by looking up the index table, write it into the charger register, and adjust the charging power output by the charger to the battery.

[0018] The present invention is further improved. In step 4, when the temperature during battery charging exceeds the preset safety range, the charging current of the charger is automatically cut off. The temperature safety range is configured as temperature T through the device tree, where 0°C ≤ T ≤ 51°C.

[0019] The present invention is further improved. In step 4, the charging current of the charger is cut off through POWER_SUPPLY_STATUS_FULL in the bq25700_charger_set_current function.

[0020] The beneficial effects of the present invention are as follows: A battery dynamic charging method based on Linux Kernel provided by the present invention realizes the dynamic output control of the charging power by adding a current setting function, adding a battery monitoring function, and adding a power control function. It can monitor the status during the battery charging process in real time, including the temperature status, charging current, and battery power during battery charging, and then dynamically adjust the charging power of the charger, greatly reducing the damage caused during battery charging, achieving the balance between battery charging efficiency and battery life, and solving the problems in the prior art that the traditional charging scheme based on Linux Kernel causes relatively high damage to the battery and it is difficult to extend the battery service life. Description of the Drawings

[0021] Figure 1 It is a flowchart of a battery dynamic charging method based on Linux Kernel of the present invention. Detailed Embodiment

[0022] The present invention will be further described in detail below with reference to the drawings and embodiments.

[0023] Please refer to Figure 1 , a battery dynamic charging method based on Linux Kernel of the present invention includes the following steps:

[0024] Step 1: Add a current setting function, and add a current setting function in the charger driver with the chip model bq25700; wherein, the control system of the charger is a control management system based on Linux Kernel. In this embodiment, the specific code for adding the current setting function is as follows:

[0025]

[0026]

[0027] Step 2, add a battery monitoring function, add a battery monitoring function in the battery driver sbs-battery.c, monitor the temperature state, charging current and battery power of the battery during charging; wherein, the battery control system is a control management system based on Linux Kernel; the temperature state interval index table of the battery during charging is configured through the device tree, including the mapping relationship between the temperature range and the charging current value, and the specific format is <starting temperature ending temperature charging current>; adding a battery monitoring function includes registering the delayed_work task in the battery driver sbs-battery.c, periodically obtaining the temperature data of the battery during charging and triggering the control logic. In this embodiment, the specific code for adding a battery monitoring function is as follows:

[0028]

[0029]

[0030] Among them, the temperature code for monitoring the battery charging is as follows:

[0031]

[0032]

[0033] The temperature state interval index table when the battery is charging is configured through the device tree:

[0034] / / Charging temperature control strategy <starting temperature, ending temperature, charging current>

[0035] temperature_chrg_table_v2=<(-80)00>, <1102000> , <1039250>0> , <4050200>0> , <51800> ;

[0036] Step 3, add a power control function, add a function to control the charging current according to the temperature of the battery during charging in the battery driver sbs-battery.c, and start monitoring whether the charger starts charging the battery. In this embodiment, the specific code for adding the power control function is as follows:

[0037]

[0038]

[0039] Step 4: Control the dynamic output of the charging power. When it is monitored that the charger starts to charge the battery, the charging power output by the charger to the battery is automatically adjusted in real time and dynamically according to the temperature state, charging current, and battery power during the battery charging process. Among them, when the temperature during battery charging exceeds the preset safety range, the charging current of the charger is automatically cut off. The temperature safety range is configured as temperature T through the device tree, where 0°C ≤ T ≤ 51°C. The charging current of the charger is cut off through POWER_SUPPLY_STATUS_FULL in the bq25700_charger_set_current function. In this embodiment, by adding a current setting function, a battery monitoring function, and a power control function, the dynamic output of the charging power is controlled, and the status during the battery charging process can be monitored in real time, including the temperature state, charging current, and battery power during battery charging. Then, the charging power of the charger is adjusted dynamically, greatly reducing the damage caused during battery charging and achieving the balance between battery charging efficiency and battery life.

[0040] Please refer to Figure 1 , in the said Step 4, the real-time and dynamic automatic adjustment of the charging power output by the charger to the battery includes the following steps:

[0041] Step 401: The event trigger mechanism defined in the charger driver is triggered, including CHARGER_CURRENT_EVENT and INPUT_CURRENT_EVENT;

[0042] Step 402: Call the preset current setting function according to the event type, determine the charging current value by looking up the index table, and write it into the charger register to adjust the charging power output by the charger to the battery.

[0043] As can be seen from the above, the beneficial effects of the present invention are as follows: A battery dynamic charging method based on Linux Kernel provided by the present invention realizes the dynamic output of the charging power control by adding a current setting function, a battery monitoring function, and a power control function. It can monitor the status during the battery charging process in real time, including the temperature state, charging current, and battery power during battery charging. Then, the charging power of the charger is adjusted dynamically, greatly reducing the damage caused during battery charging and achieving the balance between battery charging efficiency and battery life, and solving the problems in the prior art that the traditional charging scheme based on Linux Kernel causes relatively high damage to the battery and it is difficult to extend the battery service life.

[0044] The above-mentioned specific implementation manners are the preferred implementation manners of the present invention, and do not limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to this specific implementation manner. All equivalent changes made in accordance with the present invention are within the protection scope of the present invention.

Claims

1. A battery dynamic charging method based on Linux Kernel, characterized in that It includes the following steps: Step 1: Add a current setting function. Add a current setting function in the charger driver with the chip model bq25700. Step 2: Add a battery monitoring function. Add a battery monitoring function in the battery driver sbs-battery.c to monitor the temperature status, charging current, and battery power during battery charging. Step 3: Add a power control function. Add a function in the battery driver sbs-battery.c to control the charging current according to the temperature during battery charging, and at the same time start monitoring whether the charger starts charging this battery. Step 4: Control the dynamic output of the charging power. When it is monitored that the charger starts charging this battery, according to the temperature status, charging current, and battery power during battery charging, dynamically and automatically adjust the charging power output by the charger to this battery in real time.

2. The battery dynamic charging method based on Linux Kernel according to claim 1, wherein: In Step 1, the control system of the charger is a control management system based on the Linux Kernel.

3. The battery dynamic charging method based on Linux Kernel according to claim 2, wherein: In Step 2, the control system of the battery is a control management system based on the Linux Kernel.

4. The battery dynamic charging method based on Linux Kernel according to claim 3, wherein: In Step 2, the temperature status interval index table during battery charging is configured through the device tree, including the mapping relationship between the temperature range and the charging current value, and the specific format is <starting temperature ending temperature charging current>.

5. The battery dynamic charging method based on Linux Kernel according to claim 4, characterized in that: In Step 2, adding the battery monitoring function includes registering a delayed_work task in the battery driver sbs-battery.c to periodically obtain the temperature data during battery charging and trigger the control logic.

6. The battery dynamic charging method based on Linux Kernel as claimed in claim 5, wherein In Step 4, dynamically and automatically adjusting the charging power output by the charger to this battery in real time includes the following steps: Step 401: The event trigger mechanism defined in the charger driver is triggered, including CHARGER_CURRENT_EVENT and INPUT_CURRENT_EVENT. Step 402: Call the preset current setting function according to the event type, determine the charging current value by looking up the index table, and write it into the charger register to adjust the charging power output by the charger to this battery.

7. The battery dynamic charging method based on Linux Kernel according to claim 6, characterized in that: In Step 4, when the temperature during battery charging exceeds the preset safety range, automatically cut off the charging current of the charger. The temperature safety range is configured through the device tree as temperature T, where 0℃ ≤ T ≤ 51℃.

8. The battery dynamic charging method based on Linux Kernel according to claim 7, characterized in that: In Step 4, the charging current of the charger is cut off through POWER_SUPPLY_STATUS_FULL in the bq25700_charger_set_current function.