Android uninterruptible power supply control method based on dual-battery architecture
Patent Information
- Application Number
- CN202610737289.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-08-18
AI Technical Summary
但该方案在电池充电期间无法同步为负载稳定供电,充电与供电难以并行,切换过程存在明显供电间隙,无法保证连续供电
[0019] Compared with existing technologies, this invention adopts a pre-start plus zero-interval smooth switching method, which can achieve truly continuous power supply. The switching process is free from power loss, voltage fluctuations, and system restarts, ensuring the continuous operation of the Android system. At the same time, the system can monitor the battery status in real time, intelligently determine the switching timing, and automatically perform charging, discharging, and equalization management without manual intervention. By using dual batteries in a balanced manner and alternating charging and discharging, excessive wear and tear on a single battery can be effectively avoided, significantly improving the overall battery life. Furthermore, the system has multiple redundancies, fault self-diagnosis, and automatic switching capabilities, which can reduce the risk of system downtime. Maintenance is simple and convenient. The overall structure is small in size, low in cost, and does not require multiple mains power sources. It can be widely used in various scenarios such as Android handheld terminals, industrial tablets, medical equipment, and automotive equipment.
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power supply control technology, specifically relating to an uninterrupted power supply control method for Android based on a dual-battery architecture. Background Technology
[0002] With the increasing prevalence and performance upgrades of electronic devices, communication equipment, medical devices, and industrial control systems, the continuity, reliability, and stability of equipment operation have become core technical indicators. This is especially true for embedded terminals, portable devices, and uninterrupted operation equipment using Android systems. Power outages, power failures, or restarts can easily lead to data loss, service interruptions, control failures, and even safety accidents. Therefore, achieving truly uninterrupted and continuous operation of electronic devices has become a critical technical problem that the industry urgently needs to solve.
[0003] Currently, traditional power supply security solutions mainly take the following forms, but all of them have obvious drawbacks: 1. Single-battery power supply with external power source: This solution powers the device and charges the single battery when the external power source is connected normally, and switches to battery power when the external power source is interrupted. However, this solution cannot provide stable power to the load simultaneously while the battery is charging, making it difficult to charge and power supply in parallel. There is a significant power supply gap during the switching process, which cannot guarantee continuous power supply.
[0004] 2. UPS uninterruptible power supply solution: Although it can provide emergency power when the mains power is interrupted, the overall device is bulky, expensive, and has high requirements for heat dissipation and installation conditions. It is difficult to adapt to embedded, portable or space-constrained Android system devices, thus limiting the application scenarios.
[0005] 3. Dual-channel AC power supply solution: Relies on two independent AC power inputs to achieve redundancy. It has high requirements for power supply infrastructure and a very narrow range of applications. It cannot be used in mobile scenarios, outdoor scenarios or civilian terminals where there are no multiple AC power inputs.
[0006] Meanwhile, existing dual-battery power supply solutions have failed to solve the fundamental problems. Most existing dual-battery solutions employ simple manual or mechanical switching, resulting in long switching times, slow response speeds, and susceptibility to voltage fluctuations and momentary power outages during switching, failing to achieve a smooth, uninterrupted transition. Furthermore, the systems lack intelligent battery status monitoring, charge / discharge management, and fault prediction mechanisms, leading to significant issues such as uneven battery charging / discharging and prolonged single-battery load operation, resulting in low battery utilization, shortened overall lifespan, and poor system stability. Moreover, the overall architecture is complex, making fault location and maintenance difficult, hindering the achievement of truly continuous power supply.
[0007] In summary, existing power supply solutions generally suffer from drawbacks such as power supply gaps, switching interruptions, low levels of intelligence, short battery life, and difficult maintenance, failing to meet the uninterrupted power supply requirements of Android systems and high-reliability electronic devices. Therefore, the industry urgently needs a dual-battery power supply architecture that is structurally simple, allows for smooth switching, features intelligent management, and offers high reliability, enabling stable operation of electronic devices that are continuously online and never shut down. Summary of the Invention
[0008] In view of this, the main objective of the present invention is to provide an uninterrupted power supply control method for Android based on a dual-battery architecture.
[0009] To achieve the above objectives, the technical solution of the present invention is implemented as follows: This invention provides an Android uninterruptible power supply control method based on a dual-battery architecture, comprising the following steps: S1: Real-time monitoring of external power supply status, main battery cell status, and backup battery cell status; S2: Depending on the external power supply status, the system enters charging mode or battery power mode; S3: Determine whether the power supply switching conditions are met in the current working mode; S4: If the power supply switching conditions are met, first pre-start the power supply of the backup battery unit, and then perform zero-interval power supply switching between the main battery unit and the backup battery unit. S5: After the switch is complete, update the system power supply status to keep the Android system powered and prevent it from shutting down.
[0010] In the above scheme, step S1, the real-time detection specifically involves: collecting the voltage, current, and temperature parameters of the main battery unit and the backup battery unit in real time, and transmitting the collected parameters to the control core module for processing.
[0011] In the above scheme, in step S2, the external power supply status includes an access status and a disconnect status; when the external power supply is accessed, the system automatically enters the charging mode, and when the external power supply is disconnected, the system automatically enters the battery power supply mode.
[0012] In the above scheme, under the charging mode, the charging management module independently charges the main battery unit and the backup battery unit through multiple channels, and the charging process continuously supplies power to the load without interruption.
[0013] In the above scheme, under the battery power supply mode, the remaining power, health status and operating parameters of the current power supply battery unit are continuously monitored.
[0014] In the above scheme, the power supply switching conditions in step S3 include at least one of the following: the main battery cell charge is lower than a preset threshold, the main battery cell malfunctions, the external power supply is suddenly interrupted, and the battery temperature exceeds a safety threshold.
[0015] In the above scheme, step S4, the pre-starting of the backup battery unit's power supply specifically involves: starting the backup battery unit's power management circuit 5-20 milliseconds in advance, stabilizing its output at the target regulated voltage value, and keeping the backup battery unit's power supply switch off.
[0016] In the above scheme, in step S4, the zero-interval power supply switching adopts the first-on, then-off method, first connecting the power supply circuit of the backup battery unit, delaying for 100-200 microseconds, and then disconnecting the power supply circuit of the main battery unit, with the switching time controlled in the microsecond range.
[0017] The above scheme also includes an adaptive balancing step: the control core module dynamically allocates power supply and charging tasks based on the health status, cycle count, and remaining capacity of the main battery unit and the backup battery unit.
[0018] The above solution also includes a fault self-diagnosis step: when an abnormality is detected in the battery cell or power supply path, the system automatically switches to the normal power supply circuit, records the fault information, and uploads the current power supply status.
[0019] Compared with existing technologies, this invention adopts a pre-start plus zero-interval smooth switching method, which can achieve truly continuous power supply. The switching process is free from power loss, voltage fluctuations, and system restarts, ensuring the continuous operation of the Android system. At the same time, the system can monitor the battery status in real time, intelligently determine the switching timing, and automatically perform charging, discharging, and equalization management without manual intervention. By using dual batteries in a balanced manner and alternating charging and discharging, excessive wear and tear on a single battery can be effectively avoided, significantly improving the overall battery life. Furthermore, the system has multiple redundancies, fault self-diagnosis, and automatic switching capabilities, which can reduce the risk of system downtime. Maintenance is simple and convenient. The overall structure is small in size, low in cost, and does not require multiple mains power sources. It can be widely used in various scenarios such as Android handheld terminals, industrial tablets, medical equipment, and automotive equipment. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0021] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, article, or apparatus that includes that element.
[0022] This invention provides an Android uninterruptible power supply control method based on a dual-battery architecture, comprising the following steps: S1: Real-time monitoring of external power supply status, main battery cell status, and backup battery cell status; S2: Depending on the external power supply status, the system enters charging mode or battery power mode; S3: Determine whether the power supply switching conditions are met in the current working mode; S4: If the power supply switching conditions are met, first pre-start the power supply of the backup battery unit, and then perform zero-interval power supply switching between the main battery unit and the backup battery unit. S5: After the switch is complete, update the system power supply status to keep the Android system powered and prevent it from shutting down.
[0023] In the above scheme, step S1, the real-time detection specifically involves: collecting the voltage, current, and temperature parameters of the main battery unit and the backup battery unit in real time, and transmitting the collected parameters to the control core module for processing.
[0024] In the above scheme, in step S2, the external power supply status includes an access status and a disconnect status; when the external power supply is accessed, the system automatically enters the charging mode, and when the external power supply is disconnected, the system automatically enters the battery power supply mode.
[0025] In the above scheme, under the charging mode, the charging management module independently charges the main battery unit and the backup battery unit through multiple channels, and the charging process continuously supplies power to the load without interruption.
[0026] In the above scheme, under the battery power supply mode, the remaining power, health status and operating parameters of the current power supply battery unit are continuously monitored.
[0027] In the above scheme, the power supply switching conditions in step S3 include at least one of the following: the main battery cell charge is lower than a preset threshold, the main battery cell malfunctions, the external power supply is suddenly interrupted, and the battery temperature exceeds a safety threshold.
[0028] In the above scheme, step S4, the pre-starting of the backup battery unit's power supply specifically involves: starting the backup battery unit's power management circuit 5-20 milliseconds in advance, stabilizing its output at the target regulated voltage value, and keeping the backup battery unit's power supply switch off.
[0029] In the above scheme, in step S4, the zero-interval power supply switching adopts the first-on, then-off method, first connecting the power supply circuit of the backup battery unit, delaying for 100-200 microseconds, and then disconnecting the power supply circuit of the main battery unit, with the switching time controlled in the microsecond range.
[0030] The above scheme also includes an adaptive balancing step: the control core module dynamically allocates power supply and charging tasks based on the health status, cycle count, and remaining capacity of the main battery unit and the backup battery unit.
[0031] The above solution also includes a fault self-diagnosis step: when an abnormality is detected in the battery cell or power supply path, the system automatically switches to the normal power supply circuit, records the fault information, and uploads the current power supply status.
[0032] Example: An Android uninterruptible power supply control method based on a dual-battery architecture, applied to handheld terminals, industrial tablets, or smart devices running the Android system. The device hardware includes: a control core module, a main battery unit, a backup battery unit, a charging management module, a status monitoring module, a high-speed electronic switch array, a diode anti-reverse current circuit, a system-side energy storage capacitor bank, and a power path management chip; specifically including the following steps: Step S1: Real-time monitoring of external power supply status, main battery cell status, and backup battery cell status.
[0033] The control core module collects the connection / disconnection status of the external power supply in real time through the status monitoring module. At the same time, it collects the voltage, current, temperature, remaining power, internal resistance and health status parameters of the main battery unit and the backup battery unit. The sampling frequency of voltage, current and temperature is set to once every 10ms-50ms. The remaining power is obtained by using a coulomb counter chip combined with open circuit voltage calibration. Error calibration is performed every 10% change in power. After the data collection is completed, the status monitoring module transmits the above parameters to the control core module through the I2C bus for calculation and judgment.
[0034] Step S2: Depending on the external power supply status, the system enters charging mode or battery power mode.
[0035] When an external power source is connected, the system automatically enters charging mode. The charging management module uses an independent multi-channel charging method to charge the main battery unit and the backup battery unit simultaneously. The charging strategy is a three-stage process of trickle charging, constant current charging, and constant voltage charging: when the battery voltage is below 3.0V, it uses 100mA trickle charging; in the 3.0V-4.1V range, it uses constant current fast charging; after reaching 4.1V, it enters the constant voltage charging stage. The charging process supports simultaneous charging and discharging, and the system load is directly powered by the external power source without interrupting the load operation.
[0036] When the external power supply is disconnected, the system automatically switches to battery power mode. By default, the main battery unit powers the Android system, and the control core module continuously monitors the remaining power, voltage, temperature and discharge current of the currently powered battery.
[0037] Step S3: Determine whether the power supply switching conditions are met in the current working mode.
[0038] In battery-powered mode, the control core module determines whether to trigger a switch based on preset thresholds and priorities: The main battery cell has less than 15% remaining charge; The main battery cell voltage is less than 3.0V / cell; Battery temperature is above 60℃ or below 20℃; The discharge current exceeds 120% of the battery's maximum continuous discharge current; A short circuit occurs or the battery internal resistance exceeds 50% of its initial value; The external power supply was suddenly interrupted.
[0039] When multiple conditions are met simultaneously, the judgment is performed in the following order of priority: short circuit > battery damage > overcurrent / overtemperature > low voltage / low charge. To avoid false triggering, except for hardware faults such as short circuit and overcurrent, other abnormalities need to be confirmed by 3-5 consecutive checks. A continuous abnormality for 150-500ms is considered a valid trigger condition.
[0040] Step S4: When the switching conditions are met, first pre-start the backup battery unit, and then perform zero-interval power supply switching.
[0041] Once the switching conditions are confirmed to be met, the control core module first performs a pre-start operation for the backup battery unit: the DC-DC or LDO power management circuit of the backup battery unit is started 5-20 milliseconds in advance, so that its output voltage is stabilized at the target value of 3.8V-4.2V and enters the voltage regulation ready state; at this time, the back-to-back MOSFET switch of the backup battery unit remains off and does not discharge to the load. Only the internal circuit works, and the static current is as low as tens of microamps to a few milliamps, with no heat generation and no battery damage.
[0042] After pre-booting, a zero-interval, uninterrupted switching process is performed: using a make-before-break method, the MOSFET switch of the backup battery unit power supply circuit is first turned on through the power path management chip to ensure that the two batteries are briefly connected in parallel; after a delay of 100-200 microseconds, the MOSFET switch of the main battery unit power supply circuit is turned off; the entire switching process is completed by hardware, and the switching time is controlled within 2-5 microseconds (dedicated chip) or 50-100 microseconds (discrete device), which is much faster than the voltage drop threshold that the Android system can detect.
[0043] Meanwhile, a low-ESR ceramic capacitor and an electrolytic capacitor with a total capacity of more than 1000μF are connected in parallel at the system end to form an energy storage capacitor bank to maintain the system voltage stability and prevent it from dropping during switching; each battery circuit is equipped with an ideal diode circuit or a back-to-back MOSFET anti-reverse current structure to block reverse current in real time and prevent the two batteries from charging each other.
[0044] Step S5: After the switch is complete, update the system power supply status to keep the Android system powered and prevent it from shutting down.
[0045] After the switchover is complete, the control core module immediately updates the primary and backup battery roles, power sources, remaining power, and health status, and uploads the status information to the Android system via serial port or GPIO.
[0046] To achieve truly uninterrupted operation, this embodiment performs deep adaptation on the Android system: The kernel battery driver is modified to disable the 0% battery shutdown broadcast; the Framework layer power management service is modified to add a DualBatteryService system service for dual battery status display; the init process and PowerManagerService are modified to prevent the system from automatically shutting down due to low battery; simultaneously, the control core module continuously feeds the hardware watchdog to ensure that the switching process does not trigger a system reset. The Android system remains running throughout the entire process, without black screens, reboots, or shutdowns.
[0047] This embodiment also includes an adaptive balancing step: the control core module records the cumulative discharge amount and cycle number of the two batteries. When one battery completes an 80% deep discharge cycle, the primary and backup roles are automatically switched to balance the aging rate of the two batteries and extend the overall service life. When the difference in remaining charge between the two batteries exceeds 5%, passive balancing is initiated, discharging the higher-charge battery with a small current of 50mA-200mA until the voltage difference is less than 30mV.
[0048] This embodiment also includes a fault self-diagnosis step: the system can identify faults such as overvoltage, undervoltage, overcurrent, short circuit, overtemperature, battery damage, and communication abnormalities, and handle them according to a graded strategy. Fatal fault (such as short circuit, MOS breakdown): Immediately disconnect the faulty circuit, switch to the healthy battery in milliseconds, and send a hardware interrupt to the Android system; Serious faults (overcurrent, overtemperature, battery failure): Actively switch the power supply circuit and record the fault code; Early warning of faults: Software filtering will be retried, and the system will not be switched temporarily. If frequent anomalies occur, the system will be upgraded for handling. Fault recovery: Reconnect to the test during the idle period. If the test is normal, the user will be restored to the rotation pool. If the test is abnormal, the user will be permanently isolated.
[0049] Through the above steps, this embodiment enables the Android system to provide uninterrupted power and never shut down in scenarios such as battery replacement, low battery, fault, and external power failure, meeting the needs of industrial, medical, and automotive devices with extremely high requirements for power supply continuity.
[0050] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.
Claims
1. A method for controlling uninterruptible power supply (UPS) in Android based on a dual-battery architecture, characterized in that, Includes the following steps: S1: Real-time monitoring of external power supply status, main battery cell status, and backup battery cell status; S2: Depending on the external power supply status, the system enters charging mode or battery power mode; S3: Determine whether the power supply switching conditions are met in the current working mode; S4: If the power supply switching conditions are met, first pre-start the power supply of the backup battery unit, and then perform zero-interval power supply switching between the main battery unit and the backup battery unit. S5: After the switch is complete, update the system power supply status to keep the Android system powered and prevent it from shutting down.
2. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, In step S1, the real-time detection specifically involves: collecting the voltage, current, and temperature parameters of the main battery unit and the backup battery unit in real time, and transmitting the collected parameters to the control core module for processing.
3. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, In step S2, the external power supply status includes an on state and a off state; when the external power supply is on, the system automatically enters the charging mode, and when the external power supply is off, the system automatically enters the battery power supply mode.
4. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 3, characterized in that, In the charging mode, the charging management module independently charges the main battery unit and the backup battery unit through multiple channels, and the charging process continuously supplies power to the load without interruption.
5. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 3, characterized in that, In the battery-powered mode, the remaining power, health status, and operating parameters of the currently powered battery unit are continuously monitored.
6. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, In step S3, the power supply switching conditions include at least one of the following: the main battery cell charge is lower than a preset threshold, the main battery cell malfunctions, the external power supply is suddenly interrupted, and the battery temperature exceeds a safety threshold.
7. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, In step S4, the power supply of the backup battery unit is pre-started by starting the power management circuit of the backup battery unit 5-20 milliseconds in advance, so that its output is stabilized at the target regulated voltage value, and the power supply switch of the backup battery unit remains off.
8. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, In step S4, the zero-interval power supply switching adopts a first-on, then-off method, first connecting the power supply circuit of the backup battery unit, delaying for 100-200 microseconds, and then disconnecting the power supply circuit of the main battery unit, with the switching time controlled in the microsecond range.
9. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, It also includes an adaptive balancing step: the control core module dynamically allocates power supply and charging tasks based on the health status, cycle count and remaining capacity of the main battery unit and the backup battery unit.
10. The Android uninterruptible power supply control method based on a dual-battery architecture according to claim 1, characterized in that, It also includes a fault self-diagnosis step: when an abnormality is detected in the battery cell or power supply path, the system automatically switches to the normal power supply circuit, records the fault information, and uploads the current power supply status.