Battery charging and discharging management and electric quantity detection method based on gas detection alarm controller
By combining hardware voltage and current sampling with software control algorithms, along with charging duty cycle and charging working cycle, the problem of inaccurate backup power display in gas detection alarm controllers has been solved, achieving accurate power monitoring and safe charging.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-27
AI Technical Summary
The remaining power of the backup power supply in existing combustible or toxic gas detection alarm controllers cannot be displayed intuitively or calculated accurately, thus failing to meet the requirements of the new national standard.
By using hardware voltage and current sampling and software control algorithms, combined with charging duty cycle and charging cycle, the system realizes the charging and discharging control of the backup battery and the calculation and display of the remaining power. It calculates the power using fixed or non-fixed load power and sets the maximum and minimum allowable charging voltage limits.
It achieves accurate monitoring and display of the remaining power of the backup battery, ensuring safe and reliable charging. The logic is simple, the calculation results are accurate, and it meets the requirements of the new national standard.
Smart Images

Figure CN121749451A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of power supply detection, and in particular to a battery charging and discharging management and power detection method based on a gas detection alarm controller. Background Technology
[0002] Existing combustible or toxic gas detection alarm controllers all have a main power supply and a backup power supply (battery). While there is a dedicated charging and discharging management system for the backup power supply, they do not calculate or display the remaining power of the backup power supply, making it impossible to intuitively understand its remaining power status. Furthermore, the new national standard explicitly requires controllers to display the remaining power of the backup power supply. Current products do not calculate or display the remaining power; they only determine whether the backup power supply (battery) is low on power by checking its voltage. The main power supply of existing gas detection alarm controllers comes from AC mains power and is then converted from high voltage to low voltage (not battery power) through hardware circuitry; therefore, they also do not calculate the remaining power of the main power supply.
[0003] Patent application number 202110382686.5 discloses a battery power display method, including: when the terminal is powered on, acquiring a backup battery model and using the backup battery model as the current battery model; when the module using the battery is initialized, acquiring the current battery model, and performing initialization and battery power display based on the current battery model. This invention, by pre-importing a backup battery model and using it as the updated current battery model for initialization and battery power display, can dynamically update the current battery model according to changes in the battery, reducing power display deviations and improving the accuracy of the terminal's power display; it also avoids the problem of inaccurate remaining battery power display after prolonged use, improving user convenience. However, the aforementioned patent's patent also clarifies how the backup battery model distinguishes between different users' installation environments and load conditions, as various factors such as battery installation environment and load status can affect the remaining battery power deviation after prolonged use. Summary of the Invention
[0004] To address the technical problem of existing products lacking a display of remaining backup battery power, this invention proposes a battery charging and discharging management and power detection method based on a gas detection alarm controller. This method is used for backup battery charging and discharging management, and for calculating and displaying remaining power on a combustible or toxic gas detection alarm controller. Without adding a dedicated battery power detection device, it achieves charging and discharging control of the backup battery and calculation and display of remaining power solely through hardware voltage and current sampling and software control algorithms.
[0005] To achieve the above objectives, the technical solution of the present invention is as follows: a battery charging and discharging management and power detection method based on a gas detection alarm controller, comprising the following steps: Step 1: Preset a charging cycle T, and obtain the corresponding charging duty cycle n% based on the current backup power supply battery voltage. Step 2: The controller determines whether the charging count is in the charging phase of the charging cycle. If so, it proceeds to Step 4 for charging control judgment; otherwise, it shuts off the charging PWM control output and stops charging. When it is determined that the current non-charging phase is nearing its end and the charging phase is about to begin, the voltage of the backup power supply is collected, and it is determined whether the main power supply is faulty and whether the backup power supply is in operation. If so, the backup power supply discharge process is initiated, and the power consumption of the backup power supply in one charging cycle is calculated; otherwise, the backup power supply charging process is initiated, and the charging amount of the backup power supply in one charging cycle T is calculated; and the latest remaining power is calculated. Step 3: Calculate the battery percentage based on the latest remaining battery level and store the latest remaining battery level. Step 4: Charging control judgment: Determine whether the main power supply is faulty, and determine whether the backup power supply needs to continue charging based on the battery voltage of the backup power supply; Step 5: Decrease the charging count by 1. When the charging count decreases to 0, reset the charging count to the charging cycle T and return to Step 2. If the charging count does not decrease to 0, return to Step 2.
[0006] Preferably, after determining the charging working cycle T and the charging duty cycle n%, it is determined that within the preset charging working cycle T, there is n%T of time in the charging state and Tn%T of time in the non-charging state.
[0007] Preferably, the charging cycle T is set to 1 second; The battery voltage of the backup power supply is obtained through a hardware voltage AD sampling circuit; The charging duty cycle n% is dynamically adjusted based on the relationship between the backup power supply's battery voltage and its rated voltage.
[0008] Preferably, the backup power discharge process is implemented as follows: a fixed load power or a non-fixed load power is selected as the load power, the discharge amount within the current charging cycle T is calculated using the load power and the charging cycle T, and the latest current remaining amount is calculated based on the discharge amount within the current charging cycle T and the stored current remaining amount.
[0009] Preferably, when the fixed load power is used as the load power, the fixed load power of the system is taken as a preset fixed value, then the discharge capacity in this charging cycle T = fixed load power × charging cycle T; When the non-fixed load power is used as the load power, the discharge current of the backup power supply is collected. The discharge amount in this charging cycle T = the battery voltage of the backup power supply × the discharge current × the charging cycle T. The latest current remaining power is equal to the current remaining power minus the discharge power within the current charging cycle T. The current remaining power refers to the remaining power before this formula calculation.
[0010] Preferably, the charging count is a countdown of a timing variable controlled by the MCU; The charging PWM control is a hardware control of the port to charge or not charge. Closing the port stops charging, and opening the port charges. The switching of the port by the charging PWM control generates a PWM waveform. When it is determined that the charging phase is about to transition from the non-charging phase, the countdown of the charging cycle T has reached n%T; To determine whether the main power supply is faulty and the backup power supply is in operation, the main power supply voltage is checked to see if it is lower than a preset threshold. If it is lower than the preset threshold, the main power supply is considered to be faulty and the backup power supply will provide power. The discharge current of the backup power supply is acquired through a hardware current AD sampling circuit.
[0011] Preferably, the method for implementing the backup power charging process is as follows: determine whether the charging flag is turned on; if the charging flag is turned on, obtain the charging current of the backup power; the charging amount in this charging cycle T = backup power voltage × charging current × charging cycle T; then determine whether the voltage of the backup power is greater than the maximum allowable charging voltage; if it is greater, it is directly determined that it is fully charged, that is, the latest current remaining amount is equal to the total battery capacity of the backup power; if the voltage of the backup power is not greater than the maximum allowable charging voltage, the latest current remaining amount = current remaining amount + charging amount in this charging cycle T. If the charging flag is off, determine whether the voltage of the backup power supply is greater than the maximum allowable charging voltage. If it is, it is directly determined that the battery is fully charged, that is, the latest current remaining power is equal to the total power of the backup battery. If the backup power voltage is not greater than the maximum allowable charging voltage, the current remaining power remains unchanged.
[0012] Preferably, the battery percentage is calculated as the latest remaining battery level divided by the total battery capacity of the backup power supply, and the latest remaining battery level is recorded in Flash memory for storage as the initial value for recalculation.
[0013] Preferably, the method for implementing the charging control judgment is as follows: if the charging work cycle countdown enters the charging state stage, it is determined whether the main power supply is faulty; if so, the charging PWM control output is turned off. If the main power supply is not faulty, it is determined whether the charging flag is turned on; if the charging flag is turned on, the charging PWM control output is turned on. Then, the battery voltage of the backup power supply is judged to confirm whether the current backup power supply still needs to continue charging. If the voltage of the backup power supply is less than the minimum voltage of the charging judgment, the charging flag is turned on. If the voltage of the backup power supply is not less than the minimum voltage of the charging judgment, it is further judged whether the voltage of the backup power supply is greater than the maximum voltage of the charging judgment to confirm whether it is fully charged. If the voltage of the backup power supply is greater than the maximum voltage of the charging judgment, the charging flag is turned off.
[0014] Preferably, the calculation is performed using the rise or fall cycle of the discharge current of the backup power supply. If the difference between the current of the current of the current backup power supply and the current of the previous backup power supply is greater than a threshold, the charging amount or power consumption during each current level change period is calculated based on the current, average voltage, and the time difference between the two current changes.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This application, by judging and processing different stages of the charging duty cycle, uses the point value of current, voltage or power at a certain time point (when the non-charging stage is about to enter the charging stage) to represent the voltage and current of this cycle within a charging working cycle T, thereby estimating the charging amount or power consumption within a complete charging working cycle. This enables the monitoring and display of the remaining power of the backup battery. The smaller the charging working cycle T value, the more accurate the final power. The logic is simple and easy to implement.
[0016] 2. This application determines whether charging needs to continue during the charging phase of the charging duty cycle, and collects backup voltage and current and calculates the amount of electricity during the non-charging phase, thus ensuring the safety and reliability of charging and the accuracy of the calculated data.
[0017] 3. In the process of controlling charging and calculating power, this application also adds the limitation judgment conditions of maximum allowable charging voltage and minimum allowable charging voltage, which plays a protective role in charging and also plays a calibration role in calculating power. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1 like Figure 1 As shown, a battery charging and discharging management and power detection method based on a gas detection alarm controller includes charging control judgment, charging amount calculation during a charging cycle, and power consumption calculation during a charging cycle. The specific process of this invention is summarized as follows: Step 1: First, preset a charging cycle T, and obtain the corresponding charging duty cycle n% based on the current backup power supply battery voltage. For example, when the battery voltage is low, the duty cycle can be lowered to prevent current surges, and when the battery voltage is high, the duty cycle can be increased to improve charging efficiency.
[0022] The charging cycle T can be set to 1 second. Theoretically, the smaller the charging cycle T is set, the more accurate the calculated remaining capacity. This value is not fixed, but it should not be too large, otherwise it may lead to inaccurate calculation results. The backup power supply voltage is obtained through a hardware voltage sampling circuit. For backup batteries with a rated voltage of 24 volts: 50% duty cycle for backup voltage less than 18 volts; 70% duty cycle for backup voltage greater than 18 volts but less than 21 volts; and 90% duty cycle for backup voltage greater than 21 volts. The specific duty cycle is dynamically adjusted according to the battery specifications and performance specifications.
[0023] After determining the charging cycle T and the charging duty cycle n%, it is determined that within the preset charging cycle T, there is n%T of time in the charging state and Tn%T of time in the non-charging state.
[0024] Step Two: The controller determines whether the charging count is in the charging phase of the charging cycle. If so, proceed to Step Four for charging control judgment; otherwise, turn off the charging PWM control output and stop charging. When it is determined that the current non-charging phase is nearing its end and the charging phase is about to begin, the voltage of the backup power supply is collected to determine whether the main power supply is faulty and whether the backup power supply is in operation. If so, the backup power supply discharge process is initiated, and the power consumption of the backup power supply in one charging cycle is calculated; otherwise, the backup power supply charging process is initiated, and the charging amount of the backup power supply within one charging cycle T is calculated. The latest remaining power capacity is also calculated.
[0025] The charging count is a countdown timer controlled by the MCU chip, where the countdown unit is 1 millisecond. If the charging cycle T is set to 1 second, the initial value of the charging count is 1000. It decreases by 1 every millisecond, and when it reaches 0, it returns to 1000 to start counting down again, with each cycle lasting 1 second. Once the charging duty cycle n% is determined (e.g., 70%), the 300 milliseconds from 1000 to 700 represent the non-charging phase of the charging cycle, and the 700 milliseconds from 700 to 0 represent the charging phase.
[0026] The main program loop counts down the charging cycle. When in the non-charging state, the charging PWM control output is turned off, and charging stops. The charging PWM control is a hardware control port that controls whether to charge or not. Turning off the port stops charging, and turning on the port starts charging. The switching of the port through the control process in this application forms a PWM waveform. When it is determined that the non-charging state is about to enter the charging state, that is, when the charging cycle T counts down to n%T, the battery voltage value of the backup power supply is collected. The battery voltage is collected through the hardware voltage AD sampling circuit. Then it is determined whether the main power supply is faulty and whether the backup power supply is working. If so, the following (1) is executed to enter the backup power discharge process and calculate the backup power consumption. If not, the following (2) is executed to enter the backup power charging process and calculate the charging amount. Thus, the latest current remaining power is calculated. Determining whether the main power supply is faulty and whether the backup power supply is working is to determine whether the voltage of the main power supply is lower than a certain value, such as the rated voltage of 24V. If it is lower, it is determined that the main power supply is faulty, and the backup power supply is used for power supply.
[0027] (1) Backup power discharge process: First, calculate the load power. Here you can choose a fixed load power or a non-fixed load power. If the system selects a fixed load power, proceed to the following step ① for calculation. If it is a non-fixed load power, proceed to the following step ② for judgment.
[0028] ① Fixed load power: Treat the system's fixed load power as a preset fixed value, such as 50W; then the discharge capacity within this charging cycle T = fixed load power × charging cycle T; thus, the latest current remaining capacity is obtained as: current remaining capacity - discharge capacity within this charging cycle T. Here, the current remaining capacity refers to the remaining capacity before this formula calculation, which can also be understood as the remaining capacity of the previous charging cycle.
[0029] ② Non-fixed load power: Collect the discharge current of the backup power supply (collected through hardware current AD sampling circuit), and then the discharge amount in this charging cycle T = backup power supply voltage × discharge current × charging cycle T; thus, the latest current remaining amount is obtained as: current remaining amount - discharge amount in this charging cycle T.
[0030] (2) Backup power charging process: First, determine whether the charging flag is on. If the charging flag is on, proceed to step ① below; if the charging flag is off, proceed to step ② below.
[0031] ① Charging flag on: Obtain the charging current of the backup power supply. The charging capacity within this charging cycle T = backup power voltage × charging current × charging cycle T. Then, determine whether the voltage of the backup power supply is greater than the maximum allowable charging voltage. If it is greater, it is directly judged as fully charged, that is, the latest current remaining capacity is equal to the total battery capacity of the backup power supply. If the voltage of the backup power supply is not greater than the maximum allowable charging voltage, the latest current remaining capacity = current remaining capacity + charging capacity within this charging cycle T. The maximum allowable charging voltage is determined by the specific specifications of the battery. For example, if two 12V, 4.5AH batteries are connected in series as a backup power supply with a rated output of 24V, the maximum allowable charging voltage can be set to 27V. The total battery capacity of the backup battery = 12 * 4.5 * 3600 * 2 = 388800 watts.
[0032] ② Charging flag off: Determine if the voltage of the backup power supply is greater than the maximum allowable charging voltage. If it is, it is directly determined that the battery is fully charged, that is, the latest current remaining power is equal to the total power of the backup battery. If the backup power voltage is not greater than the maximum allowable charging voltage, the current remaining power remains unchanged.
[0033] Step 3: Calculate the battery percentage based on the latest remaining battery level and store the latest remaining battery level.
[0034] Battery percentage = latest current remaining battery level / total battery level of backup power supply. The latest current remaining battery level is recorded in Flash for storage. The battery percentage is calculated and displayed directly. For example, if there is 35% battery remaining, it will be displayed as 35%. The current remaining battery level is recorded in Flash to prevent damage in case of system power failure. When the system is powered off and then powered on again, the current remaining battery level stored in Flash can be read as the initial value for recalculation.
[0035] Step 4: Charging control judgment: Determine whether the main power supply is faulty, and determine whether the backup power supply needs to continue charging based on the voltage of the backup power supply.
[0036] If the charging cycle countdown enters the charging phase, the system first checks for a fault in the main power supply. If a fault is found, the charging PWM control output is disabled. If the main power supply is not faulty, the system checks if the charging flag is on. If the charging flag is on, the charging PWM control output is enabled. The purpose is to ensure that the backup power supply battery can only be charged when the main power supply is functioning correctly, and that the charging control port is only opened to charge the backup power supply when its voltage is low. Next, the backup power supply voltage is checked to determine if it needs further charging. If the backup power supply voltage is lower than the minimum voltage threshold for charging, the charging flag is enabled. If the backup power supply voltage is not lower than the minimum voltage threshold, the system checks if the backup power supply voltage is higher than the maximum voltage threshold for charging to confirm whether it is fully charged. If the backup power supply voltage is higher than the maximum voltage threshold, the charging flag is disabled. For example, for a 24V backup battery, the minimum voltage threshold for backup power charging can be set to 20V, and the maximum voltage threshold can be set to 27V. The specific voltage threshold depends on the application and is not fixed.
[0037] Step 5: Decrease the charging count by 1. When the charging count decreases to 0, reset the charging count to the charging cycle T and return to Step 2. If the charging count does not decrease to 0, also return to Step 2.
[0038] In step two, if it is determined that the current stage is not charging and the charging stage is not about to begin, it will directly proceed to step five, and the charging count will be decremented by 1. The charging count is essentially a countdown timer; step two simply determines whether the current count time is within the duty cycle of the charging stage, a non-charging stage, or about to transition from a non-charging stage to the charging stage. Figure 1 The process loops through each time unit shown. For example, if the time unit is 1 millisecond, and one charging cycle T is 1 second, the initial charging count is 1000. Every 1 millisecond, the software executes the entire logic once, decrementing the charging count by 1. After 1000 executions, it represents 1 second of one charging cycle T. When the charging cycle countdown reaches 0, the charging cycle is reset to T, and a new countdown begins, repeating the loop.
[0039] Example 2 A battery charging and discharging management and power detection method based on a gas detection alarm controller differs from Embodiment 1 in that it can also use the rise or fall cycle of the backup power supply (battery) current for calculation. For example, if the difference between the current of the current of the backup power supply and the previous backup power supply current is greater than n mA (e.g., 0.5mA), the power consumption within each current level change time period is calculated based on the current current, voltage, and the time difference between the two current changes. Similar steps are used, except that in step two, when it is determined that the current non-charging phase is nearing its end and the charging phase is about to begin, the backup power supply current is collected. In the next charging cycle T, when it is determined that the current non-charging phase is nearing its end and the charging phase is about to begin, the backup power supply current is collected again. This process is repeated. When the Nth collection indicates that the difference between the backup power supply current and the current of the backup power supply at the first collection is 0.5mA, the charging amount or power consumption during this process is 0.5mA multiplied by the average voltage multiplied by the time difference NT. Whether it is charging amount or power consumption depends on whether the process involves an increase or decrease of 0.5mA.
[0040] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A battery charging and discharging management and power detection method based on a gas detection alarm controller, characterized in that, Includes the following steps: Step 1: Preset a charging cycle T, and obtain the corresponding charging duty cycle n% based on the current backup power supply battery voltage. Step 2: The controller determines whether the charging count is in the charging phase of the charging cycle. If so, it proceeds to step 4, which involves charging control judgment. Otherwise, turn off the charging PWM control output and stop charging; when it is determined that the current non-charging stage is about to end and the charging stage is about to begin, collect the voltage of the backup power supply, determine whether the main power supply is faulty and whether the backup power supply is in working state. If so, enter the backup power supply discharge process and calculate the power consumption of the backup power supply in one charging cycle; otherwise, enter the backup power supply charging process and calculate the charging amount of the backup power supply in one charging cycle T. And calculate the latest remaining battery power; Step 3: Calculate the battery percentage based on the latest remaining battery level and store the latest remaining battery level. Step 4: Charging control judgment: Determine whether the main power supply is faulty, and determine whether the backup power supply needs to continue charging based on the battery voltage of the backup power supply; Step 5: Decrease the charging count by 1. When the charging count decreases to 0, reset the charging count to the charging cycle T and return to Step 2. If the charging count does not decrease to 0, return to Step 2.
2. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 1, characterized in that, After determining the charging cycle T and the charging duty cycle n%, it is determined that within the preset charging cycle T, there is n%T of time in the charging state and Tn%T of time in the non-charging state.
3. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 2, characterized in that, The charging cycle T is set to 1 second; The battery voltage of the backup power supply is obtained through a hardware voltage AD sampling circuit; The charging duty cycle n% is dynamically adjusted based on the relationship between the backup power supply's battery voltage and its rated voltage.
4. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to any one of claims 1-3, characterized in that, The backup power discharge process is implemented as follows: select a fixed load power or a non-fixed load power as the load power, calculate the discharge amount within the current charging cycle T using the load power and the charging cycle T, and calculate the latest current remaining amount based on the discharge amount within the current charging cycle T and the stored current remaining amount.
5. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 4, characterized in that, When the fixed load power is used as the load power, the fixed load power of the system is taken as a preset fixed value. Then, the discharge capacity in this charging cycle T = fixed load power × charging cycle T. When the non-fixed load power is used as the load power, the discharge current of the backup power supply is collected. The discharge amount in this charging cycle T = the battery voltage of the backup power supply × the discharge current × the charging cycle T. The latest current remaining power is equal to the current remaining power minus the discharge power within the current charging cycle T. The current remaining power refers to the remaining power before this formula calculation.
6. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 5, characterized in that, The charging count is a countdown timer controlled by the MCU; The charging PWM control is a hardware control of the port to charge or not charge. Closing the port stops charging, and opening the port charges. The switching of the port by the charging PWM control generates a PWM waveform. When it is determined that the charging phase is about to transition from the non-charging phase, the countdown of the charging cycle T has reached n%T; To determine whether the main power supply is faulty and the backup power supply is in operation, the main power supply voltage is checked to see if it is lower than a preset threshold. If it is lower than the preset threshold, the main power supply is considered to be faulty and the backup power supply will provide power. The discharge current of the backup power supply is acquired through a hardware current AD sampling circuit.
7. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 5, characterized in that, The method for implementing the backup power charging process is as follows: determine whether the charging flag is turned on. If the charging flag is turned on, obtain the charging current of the backup power. The charging amount in this charging cycle T = backup power voltage × charging current × charging cycle T. Then determine whether the voltage of the backup power is greater than the maximum allowable charging voltage. If it is greater, it is directly determined that it is fully charged. That is, the latest current remaining amount is equal to the total battery capacity of the backup power. If the voltage of the backup power is not greater than the maximum allowable charging voltage, the latest current remaining amount = current remaining amount + charging amount in this charging cycle T. If the charging flag is off, determine whether the voltage of the backup power supply is greater than the maximum allowable charging voltage. If it is, it is directly determined that the battery is fully charged, that is, the latest current remaining power is equal to the total power of the backup battery. If the backup power voltage is not greater than the maximum allowable charging voltage, the current remaining power remains unchanged.
8. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 7, characterized in that, The battery percentage is calculated as the latest remaining battery level divided by the total battery capacity of the backup power supply. The latest remaining battery level is then stored in Flash memory as the initial value for recalculation.
9. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to any one of claims 5-8, characterized in that, The method for implementing the charging control judgment is as follows: if the charging working cycle countdown enters the charging state stage, determine whether the main power supply is faulty; if so, shut down the charging PWM control output. If the main power supply is not faulty, check if the charging flag is on. If the charging flag is on, turn on the charging PWM control output. Then check the battery voltage of the backup power supply to confirm whether the backup power supply still needs to continue charging. If the backup power supply voltage is less than the minimum voltage for charging, turn on the charging flag. If the backup power supply voltage is not less than the minimum voltage for charging, check if the backup power supply voltage is greater than the maximum voltage for charging to confirm whether it is fully charged. If the backup power supply voltage is greater than the maximum voltage for charging, turn off the charging flag.
10. The battery charging and discharging management and power detection method based on a gas detection alarm controller according to claim 1, characterized in that, The calculation is performed using the rise or fall cycle of the backup power supply's discharge current. If the difference between the current of the current backup power supply and the current of the previous backup power supply is greater than a threshold, the charging amount or power consumption during each current level change period is calculated based on the current, average voltage, and the time difference between the two current changes.
Citation Information
Patent Citations
A battery power display method, terminal, and computer-readable storage medium
CN113162164B