An adaptive lithium protection method and system
Patent Information
- Application Number
- CN202611172016.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-30
AI Technical Summary
在聚会场景下多台设备短时间内集中接入,各设备充电握手阶段的浪涌电流叠加,极易触发短路或过流保护误动作,导致充电宝输出被误切断
1.本发明通过实时监测群体充电行为并动态识别多端口突增接入、突降卸载及单端口短时循环充放三类典型社交充电模式,基于置信度分数对保护参数进行连续化预调整,实现了充电宝锂电保护从被动响应到群体行为预判驱动的主动预适应升级;
Smart Images

Figure CN123019180A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of lithium battery protection technology, and in particular to a charging adaptive lithium battery protection method and system based on group behavior pattern recognition. Background Technology
[0002] With the widespread use of portable electronic devices, the usage scenarios of power banks are evolving from single-person, single-device to multi-person, multi-device scenarios. In social charging scenarios such as friend gatherings, family sharing, and office sharing, a single power bank serves multiple users and devices simultaneously or sequentially, exhibiting characteristics such as high-frequency port plugging and unplugging, diversified load demands, complex heat distribution, and dynamic group behavior.
[0003] The mandatory national standard GB 47372—2026, "Safety Technical Specifications for Portable Power Banks," was officially released on March 31, 2026, and will be fully implemented from April 1, 2027. The new standard sets forth stricter requirements in three dimensions: battery safety, overall circuit protection, and intelligent management, and sets higher standards for the safety protection capabilities of power banks in scenarios involving group use and multiple devices.
[0004] Currently, existing lithium battery protection technologies for power banks have the following shortcomings when dealing with the aforementioned social charging scenarios: First, protection parameters are fixed at the factory and cannot be dynamically adapted to group access behavior. Existing power banks have fixed overcurrent and short-circuit protection thresholds preset at the factory. In a gathering scenario, multiple devices connect within a short period, and the surge currents during the charging handshake phase of each device can easily trigger false short-circuit or overcurrent protection, causing the power bank's output to be mistakenly cut off. The system cannot detect the "people are gathering to charge" behavior pattern in advance and proactively adjust protection boundaries.
[0005] Secondly, there is a lack of predictive protection against rapid load changes. When multiple devices are unplugged simultaneously, the DC-DC circuit inside the power bank experiences rapid load unloading, which may cause a transient voltage surge at the output, potentially impacting the internal battery cells. Current power banks have a fixed overvoltage protection response time and cannot proactively accelerate their response after detecting a "disconnection" signal. If the power bank is placed in a bag after disconnection, the heat dissipation conditions in the enclosed space deteriorate drastically, accelerating the temperature rise of the battery cells. Existing solutions cannot predict and adjust the output in advance.
[0006] Third, the discharge management is rudimentary and fails to differentiate between usage modes. Existing power banks apply the same discharge management strategy to all discharge sessions, failing to recognize the differences between "alternating emergency charging" and "exclusive long-term power supply" modes. In alternating charging scenarios, the power bank's battery cells are frequently shallow-charged, resulting in large fluctuations in discharge depth and subjecting the SEI film to repeated mechanical stress. Simultaneously, users often rush to use fast charging, exacerbating polarization damage to the power bank's battery cells due to high-rate discharge. Existing solutions do not adjust discharge depth limits and discharge rate control according to different scenarios.
[0007] In summary, existing lithium battery protection technologies for power banks suffer from systemic shortcomings when dealing with social charging scenarios, including static protection parameters, lack of anticipation of load changes, and crude discharge management. There is an urgent need for an adaptive lithium battery protection solution that can integrate group behavior pattern recognition to meet the higher requirements of the new national standard GB 47372—2026 for power bank safety management. Summary of the Invention
[0008] An adaptive lithium battery protection method includes the following steps: S1: Monitor the plugging and unplugging events of each USB port in real time and obtain the identity of the connected device; S2: Establish a two-layer statistical architecture that decouples the port layer and the device layer. Maintain event gap statistics for each port and each device. The statistics include at least the mean and standard deviation of the event gap. When a device is connected, if there are historical statistics for the device, use the historical statistics as the initial value of the current statistics of the port. When a device is disconnected, write the current statistics of the port back to the file record of the device. S3: Dynamically cluster based on the deviation of the time interval of each port event from the current statistics, identify the current group charging behavior pattern, and output a scenario pre-adjustment command that includes at least the protection boundary adjustment range based on the identification results; S4: Arbitrate the hardware protection trigger signal, the temperature management polling signal and the scenario pre-adjustment instruction according to a preset priority, and output the final execution instruction; S5: After the device is removed, update the device's file information and statistics, and record the timestamp of this update; S6: Based on the final execution instruction or hardware trigger signal, execute multi-level lithium battery protection actions, including at least a recoverable soft shutdown and a hardware self-locking mechanism that requires reset via a dedicated maintenance interface. All protection actions act on the lithium battery cells inside the power bank.
[0009] Furthermore, in an adaptive lithium battery protection method, step S1 includes the following specific steps: S11. Data Acquisition: The electrical status changes of each port are monitored in real time through the USB port voltage detection circuit. When the port output voltage changes, an event is recorded. The event data structure includes at least the timestamp of the event, the event type, the port number, and the device identifier. Temperature data is collected in real time through NTC temperature sensors deployed on the surface of the battery cell and under the USB port to generate a thermal field distribution matrix. S12. Device Identifier Acquisition: The system acquires the identity identifier of the access device, which is generated based on the device hardware information and electrical response characteristics. For devices supporting the USB PD protocol, a unique ID is obtained through the Discover Identity command; for pure charging loads without data communication capabilities, the system generates an electrical fingerprint (temporary identifier) of the device by detecting its equivalent DC impedance, port voltage rise steepness, and D+ / D- static bias voltage when it is connected. This fingerprint is valid locally within the same power bank and is used to establish a short-term statistical profile. S13. Plug-in / plug-out event queue management: Each USB port maintains an independent circular queue, and each record contains a timestamp, event type, device identifier, and device battery percentage when the event occurred; S14. Power Bank Self-Power Monitoring and Low Power Degradation: The system monitors the remaining power of the power bank's battery cells in real time using a coulomb counter. When the power bank's own power is below 20%, the system automatically executes a degradation strategy: global merging calculation is paused, port statistics continue to be updated but no new scene recognition is triggered, existing scene markings continue to be effective but do not enter a cooling-off period, and the output current of all ports is limited to 50% of the rated value until the power bank's power recovers to above 30%. S15. Detection of loose connection and invalid access: After the system detects a port access event, it starts the charging current monitoring window: If the port output current is continuously lower than 50mA within 10 seconds, it is determined to be a loose connection or invalid access, and this event will not enter the statistical update process; if there is still no effective charging current within 30 seconds, the system will automatically shut down the port output; S16. Concurrent event processing sequence: The system maintains a global event timestamp counter; when multiple ports generate events simultaneously within 10ms, they are processed in ascending order of port number. The unplugging event of the same port takes priority over the access event. The timestamp of all events is unified to the start timestamp of the 10ms window.
[0010] Furthermore, in an adaptive lithium battery protection method, step S2 includes the following specific steps: S21. Definition and initialization of statistics: The port-level statistics Ω_port = {μ_p, σ_p, n, t_last,state} are bound to the physical port of the power bank and stored in RAM, with initial values μ0 = 180 seconds and σ0 = 120 seconds; the device-level statistics {μ_d,σ_d, timestamp} are bound to the device identifier and stored in the internal Flash archive of the power bank. S22. Statistics Synchronization Rules: When a device is inserted, if the file exists and the update timestamp is ≤7 days from the current time, the port statistics will be reset to the file value; when a device is removed, the port statistics will be overwritten to the device file; if a port is idle for more than 7 consecutive days, it will be automatically reset to the factory default value. S23. Cold start processing of statistics: After the port statistics are initialized, the first 3 events do not perform scene determination. The system implements a conservative protection strategy: the blanking time is fixed at 1.3 times the default value, 130μs, and the short-circuit threshold remains at the default value; when n≥3 and σ change rate<5% is updated 3 times consecutively, the system switches to the full scene recognition mode. S24. Deviation Compression Adaptive Update Law: When a new event arrives, the system calculates the interval Δt between the new event and the previous event at the same port, and updates the port statistics using the deviation compression adaptive update law. μ_new = μ_old + β × (Δt - μ_old) / (1 + |Δt - μ_old| / σ_old) σ_new = σ_old + β × (|Δt - μ_old| - σ_old) / (1 + |Δt - μ_old| / σ_old) Where μ_new is the mean of the event interval after the update, in seconds; μ_old is the mean of the event interval before the update, in seconds; σ_new is the standard deviation of the event interval after the update, in seconds; σ_old is the standard deviation of the event interval before the update, in seconds; Δt is the time interval between the current event and the previous event on the same port, in seconds; β is the learning rate, dimensionless, ranging from 0.1 to 0.2; σ has a lower limit, in seconds, to prevent computational overflow; |Δt - μ_old| is the absolute value of the difference, in seconds. In this update law, the denominator 1 + |Δt - μ| / σ automatically generates a decay weight when Δt deviates significantly from the mean, whether too large or too small, to suppress the update step size and prevent a single extreme outlier from significantly polluting the statistics. S25. Adaptive Boundary Decision Threshold: Define the adaptive attribution coefficient γ = (Δt - μ) / (σ + ε), where γ is the adaptive attribution coefficient, dimensionless; Δt is the time interval between the current event and the previous event, in seconds; μ is the mean of the current event interval, in seconds; σ is the standard deviation of the current event interval, in seconds; and ε is a minimal constant to prevent division by zero, in seconds, with a value of 0.1. Boundary decision thresholds C1 and C2 are dynamically adjusted with σ: when σ < 10 seconds, C1 = 1.2, C2 = 2.2; when σ > 120 seconds, C1 = 1.8, C2 = 2.8; in other cases, C1 = 1.5, C2 = 2.5, where C1 and C2 are dimensionless threshold constants. Decision rule: when γ ≤ C1, the event belongs to the current port sub-cluster; when C1 < γ ≤ At time C2, the system enters a hovering state, which refers to a temporary waiting period where the attribution of the current event is uncertain. During the hovering period, the system does not freeze the current subcluster and retains the possibility of merging. At the same time, a hovering timer is started with a duration of 2×μ in seconds. If no new event arrives before the timer expires, the subcluster is forcibly frozen. If a new event arrives before the timer expires and the γ value of the new event falls within C1, the hovering state is lifted and the new event is assigned to the current subcluster. If γ > C2, the current subcluster is immediately frozen and a new subcluster is opened. S26. Event debouncing filter: If the interval between the event and the most recent event at the tail of the queue is less than 500ms and the event type is opposite, it is judged as physical jitter and will not enter the main statistic update process, but will be included in the statistic correction coefficient with a low weight factor w=0.1. S27. Global Event Cluster Merger: Subclusters encapsulated at each port are submitted to the global merger for cross-port collaborative merging. The global merger maintains an active global cluster list G_list and global statistics μ_global and σ_global, with initial values consistent with port-level statistics: μ0 = 180 seconds and σ0 = 120 seconds. It uses the same bias compression adaptive update law as the port-level statistics for updating. Merging logic: If the midpoint T_mid of a subcluster's time falls within the range [T_first - ΔT, T_last + ΔT] of the existing global cluster (ΔT = 2 × μ_global), it is merged; otherwise, a new global cluster is created. When the last merging time of a global cluster exceeds 3 × σ_global, scene recognition is triggered. S28. Three-type scene recognition and confidence quantification: Mode A Multi-port Sudden Load Access Protection Mode: The triggering conditions for the multi-port sudden load access protection mode are: N_in ≥ 3 and N_in / (N_in+N_out) ≥ 0.7 and ρ ≤ 120 seconds / time; where, when N_in ≥ 2, ρ = T_duration / (N_in - 1); when N_in ≤ 1, the necessary condition of N_in ≥ 3 is not met, so this mode is not triggered, and ρ is not involved in the judgment; when N_in ≤ 1, the counting threshold condition is not met, so this mode is not triggered, and ρ does not need to be calculated. Where N_in is the total number of access events within the global cluster, a dimensionless integer; N_out is the total number of disconnect events within the global cluster, a dimensionless integer; ρ is the average access interval, in seconds / event; T_duration is the time span between the beginning and end of the global cluster, in seconds; confidence level c_surge = min(1.0, 0.6 + 0.1×N_in + α × (T0 / ρ)), where T0=1 second, α is a dimensionless empirical coefficient with a value of 0.05, then T0 / ρ is dimensionless, c_surge is the confidence level for multi-port surge load access protection, dimensionless, with a value range of [0,1], min(1.0, ·) indicates the upper limit of confidence level truncation; protection action: blanking time extension ΔT_blank = 50μs × c_surge, where ΔT_blank is the blanking time extension in microseconds, and 50μs is the maximum extension in microseconds; the short-circuit threshold adjustment ratio ΔI_short_ratio = 0.05 × c_surge, c_surge is dimensionless, and the actual short-circuit threshold during execution = default short-circuit threshold × (1 + ΔI_short_ratio); pre-triggered state: when 2 ≤ N_in < 3 and ρ ≤ 60 seconds / time, a slight pre-adjustment is performed according to c_pre = 0.5 × (N_in / 3), where c_pre is the pre-triggered state confidence, dimensionless, with a value range of (0, 0.5], to distinguish it from the full-triggered state confidence c_surge; Mode B Multi-port Drop Load Unloading Protection Mode: Triggering conditions: N_out ≥ 2 and N_out / (N_in+N_out) ≥ 0.7; Confidence level: c_drop = min(1.0, 0.5 + 0.2×N_out), where c_drop is the confidence level of multi-port drop load unloading protection, dimensionless, with a value range of [0,1], and N_out is the total number of unplug events in the global cluster, a dimensionless integer; Protection actions: Overvoltage protection response time is accelerated from the usual 100ms to T_ovp = 50ms + (1 - c_drop) ×50ms, where T_ovp is the overvoltage protection response time in milliseconds, and 50ms is the lower limit of the response time in milliseconds; The delay time for all ports to enter deep sleep after being idle is shortened from the usual 30 seconds to 5 seconds; When the accelerometer detects that the power bank has been moved, the judgment condition is: the three-axis composite acceleration amplitude > The current is 5 m / s² and this state lasts for more than 200 ms to filter out minor vibrations and false triggers during handling, and the output current of the remaining ports drops to 70% of the rated value; Mode C Single-Port Short-Term Cyclic Charge-Discharge Protection Mode: Triggering conditions: ≥3 times of alternating access and disconnection on the same port, and the duration of each access ≤0.3×μ_history, where μ_history is preferentially taken as the historical average charging time of the port (in seconds). If not available, the historical average charging time of the device on any port is taken (in seconds). If neither is available, the system default value of 3600 seconds is used. Confidence level c_cycle = min(1.0, 0.4 + 0.1×number of alternating pairs), where c_cycle is the confidence level of single-port short-term cyclic charge-discharge protection, dimensionless, with a value range of [0,1]. The number of alternating pairs is the cumulative number of complete access-disconnection pairs (dimensionless integer) that start with an access event and end with a disconnection event on the same port. Protection actions: Discharge depth is limited to no more than 70%; when the power bank's own power drops to 30%, the current is reduced to 0.5A and a low power reminder is issued; when the power bank's own power is <40%, the output power is limited to within 10W. S29. Cooling-off Period and Conflict Resolution: After a scenario is triggered, a cooling-off period of T_cool = min(300, 2×T_duration) seconds begins, where T_cool is the duration of the cooling-off period in seconds, T_duration is the time span between the beginning and end of the global cluster in seconds, and min(300, ·) indicates that the upper limit of the cooling-off period is truncated to 300 seconds. Events falling into the time window of the old triggering cluster during the cooling-off period will not be triggered again. Conflict resolution rules: Multi-port sudden load drop off protection mode > Multi-port sudden load increase access protection mode > Single-port short-term cyclic charge and discharge protection mode.
[0011] Furthermore, in an adaptive lithium battery protection method, in step S4, the system arbitrates according to a three-level priority: the first priority is the hardware protection trigger signal, which immediately blocks all port outputs once it is effective; the second priority is the thermal management polling instruction, which, when activated, continuously compresses the relaxation range multiplied by the attenuation factor (1 - temperature overshoot ratio), where the temperature overshoot ratio = (T_current - T_threshold) / (T_max - T_threshold), dimensionless, where T_current is the current measured temperature in °C, T_threshold is the thermal management trigger temperature threshold in °C with a value of 55 °C, and T_max is the overheat protection upper limit temperature in °C with a value of 75 °C; the temperature management polling signal detects the cell temperature at a 1 Hz cycle, and is activated when any temperature sensor measures a temperature of 55 °C, and deactivated after falling back below 50 °C for 10 seconds; the third priority is the behavior mode pre-adjustment instruction; each priority instruction is executed sequentially, and higher priority instructions can override lower priority instructions.
[0012] Furthermore, in an adaptive lithium battery protection method, in step S5, after the device is removed, the file is updated: the temperature rise rate adopts a weighted moving average (R_new = 0.7×R_old + 0.3×R_session), where R_new is the updated temperature rise rate in °C / min, R_old is the historical temperature rise rate in °C / min, and R_session is the temperature rise rate of the current charging session in °C / min; the cumulative number of charging times is incremented automatically; if the next access time is ≤7 days from the current time, a hot start is performed; if it exceeds 7 days, the settings are reset to factory defaults; the file database can store a maximum of 50 device files. The system maintains two levels of exception log areas: a circular log area with a capacity of 50 records, which cyclically overwrites all exception events, and a permanent log area with a capacity of 10 records, which only records two types of serious exception events: deep disable and hardware self-locking. Once written, these events are never overwritten until the product is scrapped. When the permanent log area is full of 10 records, any new deep disable or hardware self-locking events will only have their event type and timestamp recorded in the circular log area, and no further entries will be made in the permanent area.
[0013] The system calculates the equivalent number of cycles based on the cumulative number of cycles, average depth of discharge, average discharge rate, and cumulative high-temperature operating time. Equivalent number of cycles = N_cycles × (DOD_avg / 100%)^0.8 × (C_rate_avg / 0.5C)^0.5 × (1 + T_high_hours / 1000) Wherein, N_cycles is the cumulative number of charge-discharge cycles, a dimensionless integer. Each complete cycle is counted when the depth of discharge (DOD) is ≥ 50%. When DOD < 50%, it is proportionally converted according to the formula: DOD / 50%, dimensionless. All converted values are summed and rounded down to obtain the statistical value of N_cycles. DOD_avg is the average depth of discharge, a dimensionless percentage. C_rate_avg is the average discharge rate, in C, which is the average value of actual effective discharge sessions, with an initial default value of 0.2C. T_high_hours is the cumulative number of operating hours when the cell temperature exceeds 45℃, in hours. The exponents 0.8 and 0.5 are both dimensionless constants. 100% is the full discharge reference value, a dimensionless percentage. 0.5C is the reference discharge rate, in C. 1000 is the normalization factor for high-temperature time, in C. The system automatically calibrates after every 100 cycles, comparing the actual capacity decay rate with the predicted decay rate. If the deviation exceeds ±10%, the index 0.8 is fixed, and only the indices 0.8 and 0.5 are fine-tuned using a gradient descent method with a step size of 0.01. The adjustment range of index 0.5 is limited to [0.3, 0.7], and the adjustment range of index 0.8 is limited to [0.7, 0.9]. This baseline value and fluctuation range are determined based on an electrochemical model relating the growth of the SEI film and the loss of active material to the depth of discharge (DOD) of lithium-ion batteries. When the equivalent number of cycles is ≥500, a second-level depth disable is triggered.
[0014] Furthermore, in an adaptive lithium battery protection method, step S6 involves setting up three levels of protection in the system: Level 1 Soft Shutdown: Triggering conditions: Cell voltage exceeds 4.30V (in volts) or cell temperature exceeds 65℃ (in °C); MCU shuts down the output port, LED flashes yellow rapidly; Automatic recovery occurs after the temperature drops below 55℃ and the voltage drops below 4.25V and remains below 4.25V for 30 seconds. Level 2 Deep Disabling: Trigger conditions include a cell voltage continuously exceeding 4.35V for 5 seconds, a cell temperature continuously exceeding 75℃ for 10 seconds, or an equivalent cycle count exceeding 500; write a non-volatile disabling flag to Flash, shut down the output port, and activate a red breathing LED effect; after-sales service can reset via UART interface. Level 3 hardware self-locking: Triggering conditions include the independent hardware protection comparator detecting that the cell voltage exceeds 4.5V, the cell temperature exceeds 80℃, or the instantaneous current of the output circuit exceeds the preset hardware short-circuit threshold; directly drive the output circuit protection switch to turn off and self-lock, requiring return to the factory for repair; The system feeds back the status signal to the S5 file update module, completing the full closed loop.
[0015] An adaptive lithium battery protection system, comprising: Multi-source sensing module: collects port plug-in / plug-out events, device identification, power bank's own power level, temperature data, and acceleration sensor signals; Dual-layer statistics management unit: maintains statistics and synchronization logic at the port layer and device layer; Scene recognition engine: Runs event gap clustering and global merge algorithms, and outputs scene confidence scores; Protection parameter pre-adjustment actuator: Adjusts blanking time, overvoltage protection response time, discharge depth threshold, and power limit according to scenario results; Arbitration and Conflict Resolution Unit: Performs multi-scenario priority arbitration and temperature-compensated compression; Anomaly Log and Safety Life Calculation Unit: Maintains two-level anomaly logs, calculates the equivalent cycle count, and performs calibration; Three-level protection state machine: managing soft shutdown, deep disable, and hardware self-locking state transitions.
[0016] The beneficial effects of this invention are: 1. This invention monitors group charging behavior in real time and dynamically identifies three typical social charging modes: sudden increase in multi-port access, sudden decrease in unloading, and short-term cycle charging and discharging of a single port. Based on the confidence score, it continuously pre-adjusts the protection parameters, realizing an upgrade of the lithium battery protection of power banks from passive response to active pre-adaptation driven by prediction of group behavior. 2. This invention uses dynamic clustering of event interval statistics to automatically determine the window boundary based on the statistical significance of the data, and uses a global merger to achieve cross-port collaborative merging, thereby achieving precise adaptation to the random insertion and removal rhythm of users and overall perception of group behavior, avoiding fragmented missed reports under fixed time windows. 3. This invention achieves continuous self-learning of statistics and intelligent migration of device files through a two-layer statistical architecture that decouples the port layer and the device layer and a bias compression adaptive update law, enabling plug-and-play functionality and rapid convergence after new devices are connected. 4. This invention achieves a smooth transition in the adjustment range of protection parameters through continuous control of scene confidence, avoiding parameter mutations and system oscillations under traditional threshold triggering methods; 5. This invention achieves the optimal balance between security and user interests through a three-level progressive protection system and a three-level priority arbitration mechanism. Among them, automatic recovery from soft shutdown, after-sales reset for deep disabling, and hardware self-locking serve as a backup guarantee for extreme failures. 6. This invention achieves persistent storage of critical safety information through two-level anomaly log management, and calculates the equivalent number of cycles by comprehensively considering the number of cycles, depth of discharge, discharge rate and high-temperature operation time, thus realizing a scientific assessment of the cell's health status and an accurate prediction of its safe service life, fully meeting the mandatory requirements of GB 47372—2026. Attached Figure Description
[0017] Figure 1 A flowchart of an adaptive lithium battery protection method; Figure 2 This is a block diagram of an adaptive lithium battery protection system. Detailed Implementation
[0018] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, but the implementation of the present invention is not limited thereto.
[0019] Example 1: System Initialization and Verification of Core Statistical Mechanisms This embodiment elaborates in detail the core parameter definition, initialization process, and statistical update mechanism of the method of the present invention.
[0020] S0. System Initialization and Self-Test Procedure: After the power bank is powered on, the system performs initialization: loading the device archive stored in the power bank's internal Flash memory and verifying CRC integrity; checking whether the temperature sensors at each port are in place and their readings are normal (NTC readings within the range of -20℃, 100℃ are considered normal); loading persistent copies of the statistics for each port from Flash memory (if none are available, the factory default values μ0=180 seconds and σ0=120 seconds are used); initializing the global merger state; performing no-load checks on each output port to confirm no residual voltage; initializing the power bank's own power monitoring (if the power level is below 20%, it automatically enters low-power degradation mode). Port-level statistics Ω_port = {μ_p, σ_p, n, t_last, state} are bound to the power bank's physical ports and stored in RAM; device-level statistics {μ_d, σ_d, timestamp} are bound to the device identifier and stored in the power bank's internal Flash archive. The device identifier acquisition process is as follows: The system obtains the hardware information and electrical response characteristics of the access device through the USB protocol communication module, generates a unique identifier to distinguish different access devices, and indexes its historical records through the identifier; Plug-in / unplug event queue management: Each USB port maintains an independent circular queue with a capacity of 50 entries. Each record contains a 64-bit timestamp, event type (0x01 plug-in / 0x02 unplug), device identifier, and the device's battery percentage at the time of the event. When the queue is full, new events overwrite the oldest record, but the 20 most recent records are retained. The battery percentage is obtained through USB PD extended messages; for devices that do not support the PD or QC protocols, the system estimates the current battery percentage of the device being charged (estimated value, accuracy ±10%) by monitoring the attenuation slope of the power bank's own output current during the constant voltage phase and combining it with the built-in device type-charging curve mapping table. Coulomb integration is only used to measure the remaining capacity of the power bank's own battery cells and is not used to estimate the battery capacity of the device being charged. When a new event arrives, the system calculates the interval Δt between the new event and the previous event at the same port, and updates the port statistics using a biased compression adaptive update law: μ_new = μ_old + β × (Δt - μ_old) / (1 + |Δt - μ_old| / σ_old) σ_new = σ_old + β × (|Δt - μ_old| - σ_old) / (1 + |Δt - μ_old| / σ_old) Where μ_new is the average event interval after the update, in seconds; μ_old is the average event interval before the update, in seconds; σ_new is the standard deviation of the event interval after the update, in seconds; σ_old is the standard deviation of the event interval before the update, in seconds; Δt is the time interval between the current event and the previous event on the same port, in seconds; β is the learning rate, dimensionless; σ has a lower limit value, in seconds, to prevent computational overflow; and |Δt - μ_old| is the absolute value of the difference, in seconds. β = 0.15, and the lower limit of σ is 5.0 seconds. The value of β was determined through simulation testing of 500 sets of real charging behavior data. When β = 0.15, the system maintains stability while exhibiting the best learning convergence speed. The lower limit of σ is set to prevent σ from approaching zero under extreme and regular behavior, which could lead to division overflow in subsequent calculations. The mathematical characteristic of this update law is that when the interval of a new event Δt deviates significantly from the current mean μ, the robust denominator 1 + |Δt-μ| / σ adaptively generates a decaying weight between 0 and 1, performing bidirectional saturation compression on the update step size. Whether Δt is much larger than μ (extremely long interval, i.e., late events) or much smaller than μ (extremely short interval, i.e., dense jitter events), it effectively suppresses the impact of this extreme value on the mean and standard deviation of the statistic, fundamentally preventing the statistic from being skewed by a single, occasional outlier. To intuitively quantify its compression effect, assume the current statistic is in a typical steady state: μ = 180 seconds, σ = 100 seconds. If an extreme lateness event occurs, Δt = 600 seconds (a deviation of 4.2 standard deviations from the mean), then |Δt - μ| / σ = 4.2. In this case, the robust denominator is 1 + 4.2 = 5.2, and the corresponding update weight is 1 / 5.2 ≈ 0.192, with an update step size of only β × 0.192. However, if a normal random fluctuation event occurs, Δt = 200 seconds (a deviation of only 0.2 standard deviations from the mean), then |Δt - μ| / σ = 0.2, the denominator is 1 + 0.2 = 1.2, the update weight is 1 / 1.2 ≈ 0.833, and the update step size is β × 0.833. The comparison shows that the update weight for extreme lateness events is only about 23% of that for normal random fluctuations (0.192 / 0.833 ≈ 0.23), a difference of about 4.3 times, rather than the original 4.2 times deviation directly input. This fully demonstrates that, regardless of significant deviations in the positive or negative direction, the update contribution is compressed to less than a quarter of the normal value, thus ensuring that the statistics can robustly reflect the typical rhythm of group charging behavior without being significantly contaminated by occasional abnormal plugging and unplugging events. Define the adaptive attribution coefficient γ = (Δt - μ) / (σ + ε), where γ is the dimensionless adaptive attribution coefficient, Δt is the time interval between the current event and the previous event (in seconds), μ is the mean of the current event interval (in seconds), σ is the standard deviation of the current event interval (in seconds), and ε is a minimal constant to prevent division by zero (in seconds), with a value of 0.1. The boundary judgment thresholds C1 and C2 are dynamically adjusted with σ: when σ < 10 seconds, C1 = 1.2 and C2 = 2.2, the statistics are concentrated, and the boundaries are tightened, where C1 and C2 are both dimensionless threshold constants; when σ > 120 seconds, C1 = 1.8 and C2 = 2.8, the statistics are dispersed, and the boundaries are widened; in other cases, C1 = 1.5 and C2 = 2.5. Judgment rules: When γ ≤ C1, the event belongs to the current port sub-cluster; when C1 < γ ≤ C2, the event is temporarily added to the current sub-cluster but a hover timer is started for a duration of 2×μ in seconds. If no new event occurs after the timer expires, the sub-cluster is forcibly sealed; when γ > C2, the event does not belong to the current sub-cluster, the current sub-cluster is immediately sealed, and a new sub-cluster is opened. Cold start handling of statistics: After the port statistics are initialized, the first 3 events (n<3) do not perform scene determination, but are only used to establish the initial statistics. During the cold start, a conservative protection strategy is implemented: the blanking time is fixed at 1.3 times the default value, i.e., 130μs, the short-circuit threshold remains at the default value, and no scene pre-adjustment actions are performed. When n≥3 and the rate of change of σ<5% is updated for 3 consecutive times, the system determines that the statistics are mature, switches to the full scene recognition mode, and the blanking time is restored to the default value of 100μs; Statistics Synchronization Rule Verification: When a device is inserted, the system queries the statistics (μ_d, σ_d) in the device's file. If the file exists and the update timestamp is ≤7 days from the current date, the port statistics are reset to the file values; if no valid file exists, the current port statistics or factory default values are retained. When a device is removed, the current port statistics are overwritten into the device's file. Port statistics are not cleared when a device is removed, but are overwritten by the new device's file values when the next device is inserted. If a port is idle for more than 7 consecutive days, the port statistics are automatically reset to the factory default values.
[0021] Example 2: Global Merger and Recognition Verification of Three Social Scenarios This embodiment demonstrates the operating mechanism of the global event cluster merger and the complete identification and protection parameter adjustment process for the three types of protection modes.
[0022] Subclusters encapsulated at each port are submitted to the global merger for cross-port collaborative merging. The global merger maintains an active global cluster list G_list and global statistics μ_global and σ_global, with initial values consistent with the port-level statistics (μ0=180 seconds, σ0=120 seconds), and uses the same bias compression adaptive update law as the port-level statistics. Merge logic: When any port submits a sealed sub-cluster C, calculate the midpoint of time for that sub-cluster, T_mid = (C.T_first + C.T_last) / 2, where T_mid is the midpoint of time for the sub-cluster in seconds, C.T_first is the timestamp of the first event of the sub-cluster in seconds, and C.T_last is the timestamp of the last event of the sub-cluster in seconds. Traverse the existing active global clusters and search for the existence of a global cluster G_j such that T_mid falls within the range [G_j.T_first - ΔT, G_j.T_last + ΔT], where ΔT = 2 × μ_global, ΔT is the radius of the merge window (in seconds), and μ_global is the mean of the global statistics in seconds. If it exists, merge it; otherwise, create a new global cluster. When the last merge time of a global cluster exceeds 3 × σ_global, mark the global cluster as sealed and trigger protection mode recognition, where σ_global is the standard deviation of the global statistics in seconds.
[0023] Verification of multi-port surge load access protection mode: All three ports of the power bank are idle at the same time. At t=0s, port 1 is connected to device A (surge peak 4.2A), at t=12s, port 2 is connected to device B (surge peak 4.5A), and at t=28s, port 3 is connected to device C (surge peak 4.3A). The system determines that N_in=3, N_out=0, and ρ=T_duration / max(1, N_in-1)=28 / (3-1)=14 seconds / event, where N_in is the total number of access events (dimensionless integer), N_out is the total number of disconnection events (dimensionless integer), ρ is the average access interval (seconds / event), and T_duration is the global cluster start-end time span (seconds). Trigger condition verification: N_in(3)≥ 3, N_in / (N_in+N_out)=3 / 3=1.0≥0.7, ρ(14)≤120 seconds / event, all conditions are met. Confidence calculation: c_surge = min(1.0, 0.6 + 0.1×3 + 0.05×(1 / 14)) = min(1.0, 0.6 + 0.3 +0.0036) ≈ 0.904, where c_surge is the confidence level of multi-port surge load access protection, which is dimensionless and ranges from [0,1]. min(1.0, ·) indicates the upper limit truncation of the confidence level. Protection parameter pre-adjustment: The blanking time is extended from the default 100μs to ΔT_blank = 50μs × c_surge = 50 × 0.904 = 45.2μs, with a total blanking time of 145.2μs. Here, ΔT_blank is the amount of blanking time extension in microseconds, and 50μs is the maximum extension range in microseconds. The short-circuit threshold is adjusted by ΔI_short_ratio = 0.05 × c_surge = 0.045, or 4.5%. The actual short-circuit threshold is 4.5 × (1 + 0.045) = 4.70A. Pre-triggered state verification: When 2 ≤ N_in < 3 and ρ ≤ 60 seconds / time, the system performs a slight pre-adjustment proportional to c_pre = 0.5 × (N_in / 3), where c_pre is the pre-triggered state confidence level, which is dimensionless. For example, when two devices are connected successively within 5 seconds, the system will not immediately perform a full adjustment, but will instead perform a blanking time extension of approximately 16.7 μs with a confidence level of approximately 0.33. When a third device is connected subsequently, the system will smoothly transition to full adjustment to avoid abrupt changes in protection parameters. In this scenario, with a traditional power bank, the surge current caused by the third device connecting can exceed the 4.5A threshold, triggering the protection circuit to cut off after 100μs, thus interrupting charging for the first two devices. In this solution, the blanking time is extended to 145μs and the threshold is raised to 4.70A. None of the three surges trigger the protection, and the three devices successfully establish a charging connection.
[0024] Verification of multi-port descent load offloading protection mode: The power bank is charging three devices: device A (port 1) with 78% battery, device B (port 2) with 45% battery, and device C (port 3) with 92% battery. Device A is disconnected at t=0s, and device B is disconnected at t=15s. The system triggers a multi-port load descent protection mode: N_out=2, N_in=0, indicating that there are no new connections in the current global cluster, N_out / (N_in+N_out)=2 / 2=1.0≥0.7. Confidence level c_drop = min(1.0, 0.5 + 0.2×2) = min(1.0, 0.9) = 0.9, where c_drop is the confidence level of the multi-port load descent protection, dimensionless, with a value range of [0,1], and N_out is the total number of disconnection events, a dimensionless integer. Protection Action Execution: The overvoltage protection response time is accelerated from the usual 100ms to T_ovp = 50ms + (1 - c_drop) × 50ms = 50 + 0.1×50 = 55ms, where T_ovp is the overvoltage protection response time in milliseconds, and 50ms is the lower limit of the response time in milliseconds. During the load unloading transient, the output voltage surges from 5.2V to 5.8V, and the OVP response occurs within 55ms, ensuring the power bank's battery cells are not affected by the transient overvoltage impact. After all ports are idle, the deep sleep delay is shortened from the usual 30 seconds to 5 seconds, and the standby current drops from 100μA to 15μA. When the accelerometer detects that the power bank has been picked up, the output current of the remaining ports drops from 3.0A to 2.1A, 70% of the rated value.
[0025] Verification of single-port short-time cycle charge-discharge protection mode: The same port in the office serves 4 devices sequentially within 2 hours: Device A charges for 12 minutes and is then disconnected, Device B charges for 8 minutes and is then disconnected, Device C charges for 15 minutes and is then disconnected, and Device D charges for 10 minutes and is then disconnected. The system determines that the number of alternating connections to and from the same port is ≥3 times (4 times or more). The durations of each connection are 12, 8, 15, and 10 minutes, respectively. μ_history is the historical average charging time of this port, 3600 seconds. The threshold is 0.3 × 60 = 18 minutes, where μ_history is the historical average charging time in minutes. Since the duration of each connection is ≤18 minutes, the condition is met. The confidence level c_cycle = min(1.0, 0.4 + 0.1 × 4) = min(1.0, 0.8) = 0.8, where c_cycle is the single-port short-term cycle charge / discharge protection confidence level, dimensionless, ranging from [0,1], and the number of alternating connections is 4, a dimensionless integer. Protection actions implemented: Discharge depth is limited to no more than 70%. With the power bank currently at 45% charge, when the charge drops to 30%, the current is actively reduced to 0.5A and a low-charge warning is issued. If the current charge is 45% > 40%, the power limit is not triggered. The power bank's battery cell discharge depth is controlled within 70%, reserving at least 30% charge for subsequent devices. All four devices received emergency charging service within two hours. Compared to the traditional full-charge solution, the number of people served increased from two to four (a 100% increase), and the equivalent cycle aging of the power bank's battery cells was reduced by approximately 35%.
[0026] Example 3: Multi-scenario Conflict Resolution and Priority Arbitration Verification This embodiment demonstrates a three-level priority arbitration mechanism and conflict resolution logic when multiple scenarios are triggered simultaneously.
[0027] Level 3 priority arbitration verification: The system arbitrates all instructions according to a three-level priority system: The first priority is the hardware protection trigger signal, which comes from an independent comparator. Once this signal is valid, it immediately blocks all port outputs and blocks all scenario pre-adjustment commands. Verification: In a short-circuit fault, the hardware comparator output flips, directly driving the output circuit protection switch to turn off. The system ignores any scenario strategy when the hardware signal is valid, ensuring absolute safety in extreme situations. The second priority is the thermal management polling command. When the temperature sensor triggers, if the scenario strategy requires a relaxation of the protection boundary when the thermal polling is activated, the relaxation amount is multiplied by the attenuation factor (1 - temperature overshoot ratio) for continuous compression. The temperature overshoot ratio is calculated as (T_current - T_threshold) / (T_max - T_threshold), dimensionless. T_current is the current measured temperature in °C, T_threshold is the thermal management trigger temperature threshold in °C (55 °C), and T_max is the overheat protection upper limit temperature in °C (75 °C). The temperature management polling signal detects the cell temperature at a 1 Hz cycle. It is activated when any temperature sensor measures a temperature of 55 °C and deactivated after the temperature drops below 50 °C for 10 seconds. Verification: When the cell temperature reaches 60℃ (overshoot ratio = (60-55) / (75-55) = 5 / 20 = 0.25), if the party scenario requires the short circuit threshold to be increased by 4%, the actual increase is 4% × (1-0.25) = 3%. The closer the temperature is to the overheat threshold, the smaller the scenario adjustment range. The third priority is the behavior pattern pre-adjustment instruction, which only takes effect when hot polling is not activated in the second priority.
[0028] Verification of conflict resolution in multiple scenarios: All four ports of the power bank are operational. Within t=0-20s, four devices are successively connected to ports 1, 2, 3, and 4, triggering the multi-port surge load protection mode, c_surge≈0.90. When charging reaches the 15-minute mark, the device on port 1 is unplugged, and the device on port 2 is also unplugged 5 seconds later, triggering the multi-port drop load unloading protection mode, c_drop≈0.8. Conflict Status: Both the multi-port surge load access protection mode and the multi-port surge load off protection mode are active simultaneously. The system prioritizes the "multi-port surge load off protection mode" according to the conflict resolution rules. Execution Result: The blanking time extension reverts from 50μs × 0.90 = 45μs in the surge load mode to the default value. In the surge load scenario, no new devices connect, so there's no need to extend the blanking time; the OVP response acceleration takes effect, accelerating from 100ms to 60ms; the device with the lower remaining power receives a polling weight increase, defined as W = 1.0 + 0.4 × c_drop, where 0.4 is the maximum polling weight increase, a dimensionless constant. Substituting c_drop = 0.8, we get W = 1.0 + 0.4 × 0.8 = 1.32. The urgency of the "transient voltage surge risk" in load offloading takes precedence over the "preventive surge protection" in load access. Cooling-off period mechanism verification: After protection mode is triggered, a cooling-off period of T_cool = min(300, 2×T_duration) seconds is entered, where T_cool is the cooling-off period duration in seconds, T_duration is the time span between the beginning and end of the global cluster in seconds, and min(300, ·) indicates that the upper limit of the cooling-off period is truncated to 300 seconds. A sudden load surge triggers T_duration=25s, and the cooling-off period = min(300,50)=50s. The time window for the old trigger cluster is [G.T_first-σ_global, G.T_last+σ_global]. The second batch of devices connects at t=120s. Since 120s falls within the window, it is determined to be a residual connection of the same sudden load surge event, and the protection mode is not triggered again. The third batch of devices connects at t=180s, exceeding the window, and is determined to be an independent new event cluster, allowing re-triggering, and the cooling-off period is reset.
[0029] Example 4: Verification of Two-Level Statistical Synchronization and Hot Start Mechanism This embodiment demonstrates the access process of the same device at different times and on different ports, verifying the synchronization and warm-start mechanism of the two-layer statistical architecture.
[0030] First-time use – Learning phase: Device A is connected to port 1 of the power bank for the first time. System query: No historical records found. Port statistics remain at the default values of μ=180s and σ=120s. Device profile is created.
[0031] Device A exhibits the following plug-in / plug-out sequence during this charging session: t=0s plug in → 22s unplug → 45s plug in → 68s unplug → 90s plug in → 115s unplug → 137s plug in → 160s unplug → 183s plug in → 205s unplug → 228s plug in → 250s unplug → 273s plug in → 295s unplug → 318s plug in → 340s unplug → 363s plug in → 385s unplug → 408s plug in → 430s unplug. After approximately 20 updates, the port statistics gradually converge from the initial (180, 120) to the final (23.3, 1.2), where the first value in parentheses is μ (mean of event interval, in seconds), and the second value is σ (standard deviation of event interval, in seconds). The system performs statistical synchronization: (μ=23.3s, σ=1.2s, timestamp=now) is written to device A file; Second use – Warm start verification: On day 3, device A was connected to the power bank again, but plugged into port 3 (a different physical port). The system checked the archive statistics update timestamp: 3 days from now < 7 days, valid; The statistics for port 3 were reset to (23.3s, 1.2s) in the device A file. The system did not need to relearn and immediately processed device A's plug-in / plug-out events with a sensitivity of 23.3s. When device A generated an access event on day 3, the system's affiliation coefficient γ was calculated directly based on μ=23.3s and σ=1.2s, resulting in accurate boundary determination. If the default value (180s, 120s) was used, the affiliation coefficient γ=(22-180) / (120+0.1)≈-1.32 for device A's intensive plug-in / plug-out behavior (Δt≈22s), which was determined to "belong to the current subcluster," did not affect basic clustering but lacked sensitivity. After using the warm-start value, γ=(22-23.3) / (1.2+0.1)≈-1.0, precisely centered, resulting in optimal clustering sensitivity.
[0032] Statistical aging reset verification: Device A reconnected on day 180. The system checked the archive statistics update timestamp: 180 days ago > 7 days, indicating that the statistics were outdated. The system reset the port statistics to the factory default values μ0=180s and σ0=120s, and started learning again to prevent outdated dense behavioral data from contaminating the current (potentially changed) behavioral pattern recognition.
[0033] Archive Management Verification: After the device is unplugged, the system calculates the temperature rise rate for this charging session and updates the device profile. The temperature rise rate uses a weighted moving average (R_new = 0.7×R_old + 0.3×R_session), where R_new is the updated temperature rise rate, R_old is the historical temperature rise rate, and R_session is the temperature rise rate for this charging session. The cumulative number of charging sessions increments automatically. The temperature rise rate is calculated every 30 seconds, and the slope of the linear regression is fitted using 10 sampling points from the most recent 5 minutes. The archive can store files for a maximum of 50 devices. The device with the longest inactivity will be removed after the time limit is exceeded. Files that have not been accessed for more than 180 days will be automatically marked as cold files and their storage space will be reduced.
[0034] Example 5: Anomaly Logs, Safe Life Calculation, and Level 3 Protection Verification This embodiment demonstrates the recording and reading process of two-level anomaly logs, the dynamic calculation method for safe service life, and the complete verification of a three-level progressive hardware protection mechanism.
[0035] Two-level exception log management verification: The system maintains a two-tiered anomaly log area. The circular log area has a capacity of 50 entries, recording all anomaly events, including: over-temperature / over-voltage / over-current / short circuit / deep disable trigger / hardware self-locking trigger. It is cyclically overwritten, and each entry includes an anomaly type code, trigger timestamp, cell voltage, temperature, current, and port status bitmap at the time of triggering. The permanent log area has a capacity of 10 entries, recording only two types of critical anomaly events: "deep disable trigger" and "hardware self-locking trigger." It is never overwritten and can be appended to until full. Records in the permanent log area must not be deleted before the power bank is scrapped, meeting the requirement of GB 47372—2026 that critical anomaly information "must be retained until the product is scrapped." Example of anomaly log: The power bank experienced the following sequence of anomalies during a single use: 14:23:05 Port 1 overcurrent event, current 4.8A lasting 200ms; 14:25:30 Battery cell overheating event, temperature 66℃, triggering the first level of soft shutdown; 14:28:10 Battery cell temperature dropped to 54℃, soft shutdown automatically resumed; 14:35:00 Port 2 short circuit event, instantaneous current 15A, triggering the third level of hardware self-locking. The system writes these four anomaly log entries to the circular log area, with the "short circuit self-locking" event also written to the permanent log area. Users can read all logs via the Bluetooth app. For power bank models without Bluetooth, pressing and holding the function button for 5 seconds will cause the LED to flash and output the three most recent error type codes: a 2-second long light (start) → N rapid flashes (error type code) → pause → next code. After-sales service can read all contents of the permanent log area via the UART maintenance interface.
[0036] Dynamic calculation and verification of safe service life: The system calculates the equivalent number of cycles based on the cumulative number of cycles, average depth of discharge, average discharge rate, and cumulative high-temperature operating time. Equivalent number of cycles = N_cycles × (DOD_avg / 100%)^0.8 × (C_rate_avg / 0.5C)^0.5 × (1 + T_high_hours / 1000) Wherein, N_cycles is the cumulative number of charge-discharge cycles, each discharge depth DOD≥50% is counted as one complete cycle, and when DOD<50%, it is proportionally converted; DOD_avg is the average discharge depth, C_rate_avg is the average discharge rate, which is the average value of the actual effective discharge sessions, T_high_hours is the cumulative number of operating hours when the cell temperature exceeds 45℃, the exponents 0.8 and 0.5 are both dimensionless constants, 100% is the full discharge reference value, 0.5C is the reference discharge rate, and 1000 is the normalization factor for high temperature time; The index of 0.8 is based on the fitting results of accelerated aging experimental data of ternary lithium-ion batteries and lithium iron phosphate batteries under varying depth of cycling conditions, with a DOD range of 20%–100%, a rate range of 0.2C–1.0C, and a temperature range of 25℃–55℃. Experimental data show that the power-law relationship between the equivalent cycle decay and the normalized depth of discharge (DOD / 100%) fluctuates between 0.75 and 0.85. The median value of 0.8 is taken as a general benchmark. Its physicochemical essence corresponds to a positive correlation between the active lithium loss rate caused by the thickening of the graphite anode SEI film and a high power of the depth of discharge, based on the coupling fitting results of the Arrhenius modified model and the Tafel polarization curve. This index can reasonably fluctuate within the range of [0.7, 0.9] under different cell systems, therefore it is set as a calibrable parameter. Current system parameters: Cumulative number of cycles N_cycles = 320; Average depth of discharge DOD_avg = 65%; Average discharge rate C_rate_avg = 0.8C; Cumulative high-temperature operating time T_high_hours = 87 hours; Substitute into the formula: Equivalent number of iterations = 320 × (65 / 100)^0.8 × (0.8 / 0.5)^0.5 × (1 + 87 / 1000) = 320 × 0.711 × 1.265 × 1.087 ≈ 312.7 times The current equivalent cycle count is 312.7, and there are approximately 187.3 cycles remaining before the 500-cycle disable threshold. At the current usage rate (approximately 4 times / day), the estimated remaining safe usage period is approximately 187.3 / (4×365) ≈ 0.128 years ≈ 47 days. The system displays the following to the user via the app: "Current equivalent cycle count: 313 / 500, estimated remaining safe usage period: approximately 1.5 months; The system automatically calibrates after every 100 cycles: the actual capacity decay rate is compared with the predicted decay rate. If the deviation exceeds ±10%, the exponent 0.8 is kept unchanged, and only the exponent 0.5 is fine-tuned. The fine-tuning uses the gradient descent method with a step size of 0.01, and the adjustment range is limited to [0.3, 0.7]. The system has completed 3 calibrations. The most recent actual decay rate was 12.8%, the predicted rate was 11.2%, and the deviation was 1.6% (<10%), verifying the accuracy of the formula. When the equivalent number of cycles is ≥500, the second level of deep disabling is triggered, which is consistent with the labeling requirements for the safe service life in Chapter 8 "Labeling Requirements" of GB 47372—2026.
[0037] Three-level progressive hardware protection verification: In addition to scene recognition, the system has three insurmountable hardware protection levels: Level 1 soft shutdown, recoverable and automatic recovery: Triggering conditions: cell voltage exceeds 4.30V or cell temperature exceeds 65℃. During a charging session, the power bank was placed in a car under direct sunlight, and the cell temperature rose to 68℃. The system triggered a soft shutdown: the MCU shut down the output MOSFET, the port LED flashed yellow rapidly (0.5-second cycle), and output paused. After approximately 3 minutes, the cell temperature dropped to 54℃, the voltage fell back to 4.20V, and after maintaining this level for 30 seconds, the system automatically resumed output, the LED switched back to normal indication, and normal charging resumed without any user intervention. Level 2 deep disable, reversible, requires after-sales testing and evaluation: Triggering conditions: cell voltage continuously exceeds 4.35V for 5 seconds, or cell temperature continuously exceeds 75℃ for 10 seconds (in seconds), or equivalent cycle count exceeds 500 times. Device C's equivalent cycle count reaches 502 times, triggering deep disable. The system writes a non-volatile disable flag to Flash, shuts down all output ports, switches the LED to a red breathing effect, cycling for 2 seconds on and 1 second off, and broadcasts the fault status code "E003 - Cycle life exhausted" via Bluetooth. After-sales engineers read the fault log through the UART interface, confirming that only the cycle count exceeded the limit (502 times), the cell voltage was 3.85V, the internal resistance was 38mΩ (normal range 30-50mΩ), and the temperature rise rate was 0.42℃ / min (normal). A reset command was sent through a dedicated interface to clear the disable flag, and the device returned to normal. The third-level hardware self-locking is unrecoverable and requires professional repair: Triggering conditions include the independent hardware protection comparator detecting a cell voltage exceeding 4.5V or a cell temperature exceeding 80℃. In an extreme short-circuit fault, the main control MCU failed to respond due to power fluctuations. The independent comparator detected a momentary surge in cell voltage to 4.6V, causing the comparator output to flip, directly driving the output circuit protection switch to turn off and locking it in the open state via a self-locking thyristor. The output is completely cut off, and the LED remains constantly red. This hardware self-locking, as the third-level fallback protection, ensures cell safety even in the extreme case of MCU failure.
[0038] The system feeds back status signals such as normal completion of charging, soft shutdown recovery, deep disable trigger, and hardware self-lock trigger to the file update module, triggering the file update process and completing the complete closed loop of "perception → scene recognition and parameter pre-adjustment → arbitration → execution → iteration".
[0039] Example 6: Please see Figure 2 Embodiment 6 of the present invention provides an adaptive lithium battery protection system, which is applied to the method described in the above embodiments: An adaptive lithium battery protection system, comprising: Multi-source sensing module: collects port plug-in / plug-out events, device identification, power bank's own power level, temperature data, and acceleration sensor signals; Dual-layer statistics management unit: maintains statistics and synchronization logic at the port layer and device layer; Scene recognition engine: Runs event gap clustering and global merge algorithms, and outputs scene confidence scores; Protection parameter pre-adjustment actuator: Adjusts blanking time, overvoltage protection response time, discharge depth threshold, and power limit according to scenario results; Arbitration and Conflict Resolution Unit: Performs multi-scenario priority arbitration and temperature-compensated compression; Anomaly Log and Safety Life Calculation Unit: Maintains two-level anomaly logs, calculates the equivalent cycle count, and performs calibration; Three-level protection state machine: managing soft shutdown, deep disable, and hardware self-locking state transitions.
[0040] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0041] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0042] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0043] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0044] In conclusion, 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. An adaptive lithium battery protection method, characterized in that, Includes the following steps: S1: Monitor the plugging and unplugging events of each USB port in real time and obtain the identity of the connected device; S2: Establish a two-layer statistical architecture that decouples the port layer and the device layer. Maintain event gap statistics for each port and each device. The statistics include at least the mean and standard deviation of the event gap. When a device is connected, if there are historical statistics for the device, use the historical statistics as the initial value of the current statistics of the port. When a device is disconnected, write the current statistics of the port back to the file record of the device. S3: Dynamically cluster based on the deviation of the time interval of each port event from the current statistics, identify the current group charging behavior pattern, and output a scenario pre-adjustment command that includes at least the protection boundary adjustment range based on the identification results; S4: Arbitrate the hardware protection trigger signal, the temperature management polling signal and the scenario pre-adjustment instruction according to a preset priority, and output the final execution instruction; S5: After the device is removed, update the device's file information and statistics, and record the timestamp of this update; S6: Based on the final execution instruction or hardware trigger signal, execute multi-level lithium battery protection actions, including at least a recoverable soft shutdown and a hardware self-locking mechanism that requires reset via a dedicated maintenance interface. All protection actions act on the lithium battery cells inside the power bank.
2. The adaptive lithium battery protection method according to claim 1, characterized in that, The group charging behavior modes described in S3 include a multi-port sudden load increase protection mode, a multi-port sudden load decrease protection mode, and a single-port short-time cycle charge and discharge protection mode. The triggering logic for each protection mode is as follows: Multi-port surge load access protection mode: If the number of access events reaches the first threshold and the proportion of access events reaches the second threshold within a preset time window, the surge load protection confidence level is output. Multi-port descent load offloading protection mode: If the number of unplugged events reaches the third threshold and the proportion of unplugged events reaches the fourth threshold within a preset time window, the descent load protection confidence level is output. Single-port short-time cycle charge-discharge protection mode: On the same port, if the number of alternations between access and disconnection reaches the fifth threshold, and the duration of a single access is less than the historical average charging duration of that port multiplied by a preset ratio, the short-time cycle charge-discharge protection confidence level is output. The confidence score c ∈ [0,1] of each mode outputs, and the magnitude of the scenario pre-adjustment instruction changes continuously with the confidence score.
3. The adaptive lithium battery protection method according to claim 2, characterized in that, The triggering conditions for the multi-port surge load access protection mode are: N_in ≥ 3 and N_in / (N_in+N_out) ≥ 0.7 and ρ ≤ 120 seconds / time; where, when N_in ≥ 2, ρ = T_duration / (N_in - 1); when N_in ≤ 1, the mode is not triggered because the necessary condition of N_in ≥ 3 is not met, and ρ does not participate in the judgment; the confidence level c_surge = min(1.0,0.6 + 0.1×N_in + α × (T0 / ρ)), where T0 = 1 second, α is a dimensionless empirical coefficient with a value of 0.
05. Then T0 / ρ is dimensionless, N_in is the total number of access events in the global cluster, N_out is the total number of disconnect events in the global cluster, ρ is the average access interval, in seconds / event, T_duration is the time span between the beginning and end of the global cluster, in seconds, min(1.0, ·) indicates the upper limit of confidence truncation, and c_surge takes values in the range of [0,1]. The scenario pre-adjustment instructions corresponding to the multi-port surge load access protection mode include: blanking time extension ΔT_blank = 50μs × c_surge, short-circuit threshold increase ratio ΔI_short_ratio = 0.05 × c_surge (dimensionless), where ΔT_blank is the blanking time extension amount (unit: microseconds), 50μs is the maximum extension amount (unit: microseconds), ΔI_short_ratio is the short-circuit threshold increase ratio (dimensionless), and the actual short-circuit threshold during execution = default short-circuit threshold × (1 + ΔI_short_ratio); When 2 ≤ N_in < 3 and ρ ≤ 60 seconds / time, a slight pre-adjustment is performed according to the corresponding proportion of c_pre = 0.5 × (N_in / 3), where c_pre is the pre-triggered state confidence (dimensionless) with a value range of (0, 0.5]. The pre-triggered state and the aforementioned full-triggered state (N_in ≥ 3) are mutually exclusive decision branches. When the system is in the pre-triggered state, the value calculated by the c_surge formula is replaced by c_pre as the actual output scene confidence, and the two are not calculated together.
4. The adaptive lithium battery protection method according to claim 2, characterized in that, The triggering condition for the multi-port descent load unloading protection mode is: N_out ≥ 2 and N_out / (N_in+N_out) ≥ 0.7; confidence level c_drop = min(1.0, 0.5 + 0.2×N_out), where c_drop is the confidence level of the multi-port descent load unloading protection, dimensionless, with a value range of [0,1], and N_out is the total number of unplugged events in the global cluster, a dimensionless integer; The scenario pre-adjustment instructions corresponding to the multi-port sudden load unloading protection mode include: accelerating the overvoltage protection response time from the normal value to T_ovp = 50ms + (1 - c_drop) × 50ms, where T_ovp is the overvoltage protection response time in milliseconds, and 50ms is the lower limit of the response time in milliseconds; shortening the delay time for all ports to enter deep sleep after being idle from the normal value; and reducing the output current of the remaining ports to 70% of the rated value when the accelerometer detects that the power bank has been moved (the judgment condition is: the amplitude of the three-axis composite acceleration is >5m / s² and the state lasts for more than 200ms).
5. The adaptive lithium battery protection method according to claim 2, characterized in that, The triggering conditions for the single-port short-time cyclic charge-discharge protection mode are as follows: on the same port, there are ≥3 complete access-to-exit alternation pairs that start with an access event and end with an exit event (if the last one only has an access event and no corresponding exit event, then the incomplete alternation is not counted), and the duration of a single access is ≤0.3×μ_history, where μ_history is preferably taken as the historical average charging duration of the port, in seconds; if not, it is taken as the historical average duration of the device on any port, in seconds; if neither is available, the system default value is taken, in seconds; confidence level c_cycle = min(1.0, 0.4 + 0.1×number of alternation pairs), where c_cycle is the confidence level of the single-port short-time cyclic charge-discharge protection (dimensionless, value range [0,1]), and the number of alternation pairs is the cumulative number of complete access-to-exit pairs counted according to the above rules, a dimensionless integer; The scenario pre-adjustment instructions corresponding to the single-port short-time cycle charge and discharge protection mode include: the discharge depth is limited to no more than 70%; when the power bank's own power drops to 30%, the current is reduced to 0.5A and a low power reminder is issued; when the power bank's own power is below 40%, the output power is limited to within 10W.
6. The adaptive lithium battery protection method according to claim 1, characterized in that, The event gap statistics described in S2 are updated using a biased compression adaptive update law: μ_new = μ_old + β × (Δt - μ_old) / (1 + |Δt - μ_old| / σ_old) σ_new = σ_old + β × (|Δt - μ_old| - σ_old) / (1 + |Δt - μ_old| / σ_old) Where μ_new is the mean of the event interval after the update, in seconds; μ_old is the mean of the event interval before the update, in seconds; σ_new is the standard deviation of the event interval after the update, in seconds; σ_old is the standard deviation of the event interval before the update, in seconds; Δt is the time interval between the current event and the previous event on the same port, in seconds; β is the learning rate, dimensionless, ranging from 0.1 to 0.2; σ has a lower limit, in seconds, to prevent computational overflow; |Δt - μ_old| is the absolute value of the difference, in seconds; in the update law, the denominator 1 + |Δt - μ_old| / σ_old automatically generates a decay weight when Δt deviates significantly from μ_old, thus bidirectionally compressing the update step size to suppress the impact of a single extreme outlier on the statistics; Define the adaptive attribution coefficient γ = (Δt - μ) / (σ + ε), where γ is the adaptive attribution coefficient, dimensionless, Δt is the time interval between the current event and the previous event, in seconds, μ is the mean of the current event interval, in seconds, σ is the standard deviation of the current event interval, in seconds, and ε is a minimum constant to prevent division by zero, in seconds, with a value of 0.
1. The boundary judgment thresholds C1 and C2 are dynamically adjusted according to the current value of σ, where C1 and C2 are both dimensionless threshold constants. When γ ≤ C1, the event belongs to the current sub-cluster; when γ > C2, the event does not belong to the current sub-cluster and triggers sub-cluster sealing and creation.
7. The adaptive lithium battery protection method according to claim 1, characterized in that, The preset priority mentioned in S4 is specifically as follows: First priority: Hardware protection trigger signal. Once this signal is valid, all port outputs will be unconditionally blocked and all scenario pre-adjustment commands will be blocked. Second priority: Temperature management polling signal. When this signal is activated, the range of the protection boundary relaxation involved in the scenario pre-adjustment instruction is multiplied by the attenuation factor and continuously compressed. The closer the temperature is to the overheating threshold, the smaller the scenario adjustment range. The temperature management polling signal detects the cell temperature at a 1Hz cycle. It is activated when any temperature sensor measures a temperature of 55°C and deactivated after falling back to below 50°C for 10 seconds. Third priority: The scenario pre-adjustment instruction only takes full effect when neither the first nor the second priority is activated.
8. The adaptive lithium battery protection method according to claim 1, characterized in that, The update timestamp mentioned in S5 is used for hot start determination of statistics: when the device is connected again, if the update timestamp is no more than the current time of the preset valid number of days, the statistics stored in the file are used as the initial value of the port statistics. If the preset valid number of days is exceeded, the port statistics will be reset to the factory default value and relearned. The file shall at least record the cumulative number of charging times, the average temperature rise rate, and the aforementioned statistics; The system maintains a two-level abnormal log area: a circular log area with a capacity of 50 records, which cyclically overwrites all abnormal events; and a permanent log area with a capacity of 10 records, which only records two types of serious abnormal events: deep disable triggering and hardware self-locking triggering. Once written, the logs are never overwritten until the product is scrapped. The system calculates the equivalent number of cycles based on the cumulative number of cycles, average depth of discharge, average discharge rate, and cumulative high-temperature operating time. Equivalent number of cycles = N_cycles × (DOD_avg / 100%)^0.8 × (C_rate_avg / 0.5C)^0.5 × (1 + T_high_hours / 1000) Wherein, N_cycles is the cumulative number of charge-discharge cycles, a dimensionless integer. Each complete cycle is counted when the depth of discharge (DOD) is ≥ 50%. When DOD < 50%, the cycle count is proportionally calculated as DOD / 50%, and all calculated values are summed and rounded down to obtain the statistical value of N_cycles. DOD_avg is the average depth of discharge, a dimensionless percentage. C_rate_avg is the average discharge rate, in C, which is the average of the actual effective discharge sessions, with an initial default value of 0.2C. T_high_hours is the cumulative number of operating hours when the cell temperature exceeds 45℃, in hours. The exponents 0.8 and 0.5 are dimensionless constants. 100% is the full discharge reference value, a dimensionless percentage. 0.5C is the reference discharge rate, in C. 1000 is the normalization factor for high-temperature time, in C. The system automatically calibrates after every 100 cycles, comparing the actual capacity decay rate with the predicted decay rate. If the deviation exceeds ±10%, the index 0.8 remains unchanged, and only the indices 0.8 and 0.5 are fine-tuned using a gradient descent method with a step size of 0.
01. The adjustment range of index 0.5 is limited to [0.3, 0.7], and the adjustment range of index 0.8 is limited to [0.7, 0.9]. This baseline value and fluctuation range are determined based on an electrochemical model relating the growth of the SEI film and the loss of active material to the depth of discharge (DOD) of lithium-ion batteries. When the equivalent number of cycles is ≥500, a second-level depth disable is triggered.
9. An adaptive lithium battery protection system, characterized in that, Implementing an adaptive lithium battery protection method as described in any one of claims 1 to 8, comprising: Multi-source sensing module: collects port plug-in / plug-out events, device identification, power bank's own power and temperature data, and acceleration sensor signals; Dual-layer statistics management unit: maintains statistics and synchronization logic at the port layer and device layer; Scene recognition engine: Runs event gap clustering and global merge algorithms, and outputs scene confidence scores; Protection parameter pre-adjustment actuator: Adjusts blanking time, overvoltage protection response time, discharge depth threshold, and power limit according to scenario results; Arbitration and Conflict Resolution Unit: Performs multi-scenario priority arbitration and temperature-compensated compression; Anomaly Log and Safety Life Calculation Unit: Maintains two-level anomaly logs, calculates the equivalent cycle count, and performs calibration; Three-level protection state machine: managing soft shutdown, deep disable, and hardware self-locking state transitions.
