LSTM-based lithium-ion battery pulse charging optimization method and system
An adaptive and safe lithium-ion battery charging method based on LSTM was developed, which solves the problems of the inability of charging strategies to be adaptively adjusted and the prediction bias of deep learning models under extreme conditions in existing technologies. This method improves charging efficiency and battery life and is applicable to various types of lithium-ion batteries.
Patent Information
- Application Number
- CN202610438458.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-07-07
AI Technical Summary
Existing lithium-ion battery pulse charging strategies cannot adaptively adjust, making it difficult to strike a balance between rapid charging and lithium plating prevention. Deep learning models have the risk of prediction bias under extreme conditions, and the computing power of onboard microcontrollers is insufficient to support the massive online backpropagation of deep learning. Dirty sensor data leads to data poisoning and catastrophic amnesia.
An LSTM-based optimization method for lithium-ion battery pulse charging is adopted. Through steps such as state acquisition and caching, dynamic optimization space construction, broadcast splicing and batch inference, adaptive safety funnel screening, state machine decision-making and execution, closed-loop feedback and incremental evolution, combined with hardware safety verification and lightweight model updates, adaptive safety and efficient charging are achieved.
It achieves maximum energy throughput while ensuring absolute physical boundary safety and high prediction accuracy throughout the entire life cycle under limited underlying computing power. It eliminates electrochemical and concentration polarization, improves charging efficiency, and solves the risks of overvoltage and lithium plating in extreme conditions of deep learning. It is applicable to various types of lithium-ion batteries.
Smart Images

Figure CN122348280A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of battery management system (BMS) and artificial intelligence control technology, and relates to an LSTM-based method and system for optimizing pulse charging of lithium-ion batteries. Background Technology
[0002] With the rapid development of new energy vehicles and energy storage systems, the demand for fast charging of lithium-ion batteries is becoming increasingly urgent. Traditional constant current-constant voltage (CC-CV) charging strategies suffer from severe polarization towards the end of the charging process, resulting in long charging times and potential lithium plating and battery life degradation. Pulse charging technology, by introducing intermittent resting or depolarizing pulses, can effectively eliminate concentration polarization and electrochemical polarization, thereby improving the charging rate.
[0003] However, existing pulse charging strategies and related intelligent optimization methods still suffer from the following significant technical shortcomings when applied in industrial applications: Static rules cannot adapt to dynamic polarization boundaries: Traditional pulse charging often uses fixed duty cycles and current amplitudes, which cannot adaptively adjust based on the real-time nonlinear polarization characteristics of the battery at different temperatures, states of charge (SOC), and aging stages (SOH), making it difficult to achieve the optimal balance between "rapid charging" and "lithium plating prevention safety." In recent years, although some studies have attempted to introduce neural networks to predict the battery's voltage response to optimize pulse parameters, deep learning is essentially a "black box" model lacking physical constraints. Under extreme conditions (such as extremely low temperatures), if the model makes a prediction error, issuing incorrect commands directly can easily cause the battery to cross the physical safety threshold, triggering thermal runaway. Existing algorithms often lack underlying anomaly handling mechanisms when encountering extreme conditions where safe parameters cannot be found. Furthermore, after the system goes into hibernation or is forced to rest, time-series data will experience "discontinuities," causing recurrent neural networks (RNN / LSTM) that rely on continuous window features to produce severe prediction distortions after being woken up. The polarization resistance of the battery increases significantly throughout its lifespan, causing severe "prediction drift" in the factory-pre-trained model. The computing power and memory of the automotive microcontroller (MCU) are extremely limited, making it impossible to support massive online backpropagation of deep learning. Moreover, real-world operating conditions are filled with dirty data such as sensor glitches and forced interruptions, and blindly performing incremental learning can easily lead to "data poisoning" and catastrophic amnesia. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide an LSTM-based method and system for optimizing pulse charging of lithium-ion batteries, aiming to maximize energy throughput while ensuring absolute physical boundary security and high prediction accuracy throughout the entire life cycle under environments with limited underlying computing power.
[0005] To achieve the above objectives, the present invention provides the following technical solution: An LSTM-based method for optimizing pulse charging of lithium-ion batteries, comprising the following steps: S1. State Acquisition and Caching: Acquire the physical state time sequence of the battery under the current control cycle and the global health scalar features characterizing aging, perform sliding window slicing and cache it as historical state; S2. Dynamic optimization space construction: Based on the current battery operating condition boundary, a set of instructions to be evaluated containing multiple sets of candidate pulse currents and pulse width parameters is generated in real time. S3. Broadcast splicing and batch deduction: For each set of candidate pulse parameters in the set of instructions to be evaluated, the broadcast mechanism is used to extend them and the global health scalar features in the time step dimension, and the features are spliced with the cached physical state time sequence to construct a multi-dimensional fusion input tensor; the constructed batch tensor is input into the pre-trained deep learning model, and the corresponding predicted terminal voltage set is output in parallel. S4. Adaptive safety funnel screening: Obtain the moving average prediction error of the deep learning model, and calculate the conservative safety margin including the model prediction confidence penalty by combining the physical extreme boundary obtained by looking up the table; perform funnel screening on the set of instructions to be evaluated based on the conservative safety margin to generate a safe candidate set. S5. State Machine Decision and Execution: Determine whether the safety candidate set is empty: If it is not empty, select the candidate pulse parameter with the largest energy throughput and send it for execution; if it is empty, intercept the instruction and trigger a multi-level abnormal exit state machine that includes forced rest, hot start refresh and natural full charge determination. S6. Closed-loop feedback and incremental evolution: After the candidate pulse parameters are executed, the actual terminal voltage is obtained, and the moving average prediction error is updated after filtering abnormal data based on the sample cleaning gateway. When the error is greater than the preset threshold, the weights of the fully connected layer are fine-tuned using recent healthy samples while keeping the parameters of the deep learning model feature extraction layer frozen.
[0006] Furthermore, before the state acquisition and caching in step S1, a pre-hardware safety verification step is also included: real-time reading of the current battery terminal voltage, surface temperature, and system-level state of charge; comparing the above parameters with the preset absolute safety extreme value threshold; if any parameter exceeds the extreme value range, a hardware-level interrupt instruction is triggered, skipping the feature splicing and model deduction process, directly cutting off the drive output and ending the charging process normally.
[0007] Furthermore, in step S3, constructing the multidimensional fusion input tensor specifically includes: S31. Extract the normalized historical voltage sequence and historical current sequence with a set sliding window length as time-series features, and extract the target pulse current and target pulse width to be evaluated as command scalar features; using the broadcast mechanism, copy and expand the global health scalar feature and the command scalar feature by the same number of times as the sliding window to form a pseudo-sequence; S32. Stack and concatenate the temporal features and the pseudo-sequence along the feature channel dimension to form the multidimensional fusion input tensor.
[0008] Further, in step S3, the deep learning model is a deep recurrent neural network, whose network topology sequentially includes: a first feature extraction layer containing a first preset number of Long Short-Term Memory (LSTM) memory units and configured to retain time-series outputs; a deactivation layer configured with a preset deactivation rate parameter; a second feature extraction layer containing a second preset number of LSTM memory units and outputting only the final time-step state vector; a fully connected layer containing multiple neurons using a non-linear activation function; and a single neuron output layer using a linear activation function.
[0009] Furthermore, the first preset quantity is 128, the second preset quantity is 64, and the preset inactivation rate parameter is 0.2.
[0010] Furthermore, the pre-trained deep learning model is obtained through an offline pre-training step, which specifically includes: Mean square error is used to measure the deviation between the predicted voltage and the actual acquired pulse end voltage; Backpropagation is performed using an adaptive moment estimation optimization algorithm; A learning rate plateau decay mechanism is introduced during training. When the validation set loss value does not decrease significantly within a set number of consecutive rounds, the current learning rate is multiplied by a preset decay coefficient until it drops below the set minimum learning rate threshold. An early stopping mechanism is introduced, which stops training early when the validation set loss value does not improve for a preset number of consecutive rounds, and saves the current optimal weights.
[0011] Furthermore, in step S4, calculating the conservative safety margin, which includes the model prediction confidence penalty, specifically includes: S41, Conservative Error Cold Start Initialization: In the initial stage of the charging cycle and before the error buffer queue is full, the moving average prediction error is forcibly set to the preset maximum conservative error threshold. S42. When the buffer queue is full in the closed loop, it is smoothly replaced with the actual calculated moving average prediction error. S43. Multiply the currently effective moving average prediction error by the preset reliability coefficient to generate a dynamic confidence penalty term, and subtract the predicted end voltage of the corresponding parameter and the dynamic confidence penalty term from the absolute safe cutoff voltage under the current environment to obtain the conservative safety margin.
[0012] Furthermore, in step S5, the multi-level abnormal exit state machine including forced rest specifically includes: S51, First-level forced rest and hot start detection: Accumulate the continuous rest counter, pause the application of pulse current and apply a preset relaxation time; S52. After the relaxation time ends, a preset hot start detection pulse is executed to collect physical response data to refresh the sliding window history state in step S1. S53. Second-level normal full charge determination: At the end of the relaxation stage, the open circuit voltage or state of charge is detected. If the full charge threshold is reached, the algorithm boundary is determined to converge naturally, triggering a normal shutdown. S54, Level 3 Operating Condition Limited Timeout Shutdown: If the full charge threshold is not reached and the continuous rest counter exceeds the preset upper limit, the drive output is cut off and a fault code is reported.
[0013] Furthermore, in step S6, filtering outlier data and fine-tuning the weights based on the sample cleaning gateway specifically includes: S61, Sample Cleaning Gateway Verification: Verify whether there are any underlying sensor hardware errors during the execution of this pulse, whether it is forcibly interrupted by the front-end hardware security verification, and whether there are any continuous frame drops in the acquired waveform. S62. Only when the pulse is determined to have completed its healthy execution can the group of status and action data be pushed into the historical data buffer. S63. Feature decoupling fine-tuning: Keep the weight matrices of the first and second feature extraction layers of the deep learning model in a completely frozen state; S64. Unfreeze only the last fully connected layer, calculate the partial derivative of the output layer error with respect to the weight matrix of the fully connected layer, perform local backpropagation, and overwrite the updated weights into the non-volatile memory.
[0014] The present invention also provides an LSTM-based lithium-ion battery pulse charging optimization system, which employs the above-described method.
[0015] The beneficial effects of this invention are as follows: This invention utilizes high-frequency data acquisition of at least 10Hz and the ability of a dual-layer LSTM model to capture nonlinear polarization characteristics, enabling real-time prediction of the pulse parameter combination when the voltage change rate reaches its maximum. This effectively eliminates electrochemical and concentration polarization, significantly improving charging efficiency and shortening charging time. Sliding window smoothing and 3σ principle preprocessing effectively filter out sampling noise and abnormal interference. Min-Max normalization ensures the model's prediction accuracy and system control robustness under different operating conditions. The optimized LSTM topology (two layers, 64 units per layer) balances the model's generalization ability and computational complexity, facilitating deployment in embedded systems. This method is applicable to various types of lithium-ion batteries, exhibiting strong universality. A real-time feedback mechanism based on prediction error is established, triggering incremental learning for online fine-tuning when the accumulated error exceeds 5%. The model can dynamically adjust its strategy based on battery aging and usage history, extending battery life while maintaining stable charging performance.
[0016] This invention pioneers an adaptive safety funnel mechanism, fusing the absolute physical safety extrema obtained from a lookup table with the model's moving average prediction error. Through a dynamic confidence penalty term and a cold-start conservative error mechanism, the optimization boundary of the AI algorithm adaptively recedes inward based on its "confidence level," completely resolving the risks of overvoltage and lithium plating that may arise from deep learning black-box models under extreme conditions. This invention utilizes a broadcasting mechanism to extend scalar instructions and global aging features along the time-step dimension and concatenates them with historical time-series sequences using tensors. This design not only achieves seamless integration of hypothetical future actions with historical realities but also significantly improves the inference accuracy of the LSTM model for dynamic temporal responses. For deadlock scenarios where safety parameters cannot be found consecutively, this invention designs a multi-level abnormal exit state machine, gracefully separating the natural convergence (full charge) of the algorithm boundary from hardware constraints (such as extreme low-temperature failures). Simultaneously, through a unique "hot-start probe pulse" mechanism, it perfectly repairs the temporal feature discontinuity problem after system sleep / wake-up, ensuring the physical continuity of neural network input. Addressing the pain point of insufficient computing power in BMS microcontrollers, this invention proposes a lightweight update architecture of "feature layer freezing and shallow fully connected fine-tuning," solving the problem of model drift caused by battery aging with almost zero additional computing power overhead. Furthermore, the front-end "sample cleaning gateway" effectively intercepts dirty sensor data and abnormal interruption scenarios, fundamentally preventing data poisoning and catastrophic forgetting in incremental learning.
[0017] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart of the LSTM-based lithium-ion battery pulse charging optimization method of the present invention; Figure 2 This is a schematic diagram illustrating the principle of multidimensional feature fusion and temporal sample input tensor construction in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the adaptive funnel screening mechanism based on multidimensional physical constraints and prediction uncertainties in an embodiment of the present invention. Figure 4 This is a state machine flowchart of the maximum energy throughput decision and multi-level abnormal exit mechanism in an embodiment of the present invention; Figure 5 This is a diagram of a lightweight model incremental update architecture under resource-constrained environments provided in an embodiment of the present invention. Detailed Implementation
[0019] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0020] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0021] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0022] like Figure 1 As shown, the LSTM-based lithium-ion battery pulse charging optimization method of this embodiment includes the following steps: S1. High-frequency synchronous data acquisition S101. Microsecond-level synchronous acquisition of key battery parameters: acquisition of lithium-ion battery terminal voltage. (precision) ), loop current To ensure microsecond-level hardware synchronization between the two, avoid model errors caused by timing misalignment in learning impedance characteristics, and simultaneously learn battery temperature. As an environmental characteristic.
[0023] S102. Collect charging command data: cumulative cycle count Records the battery's historical charge / discharge cycles (or cumulative throughput) as a long-term state characteristic; pulse width recording. : Real-time recording of the duration of pulse commands currently being executed or recently completed; target current command Records the theoretical current setpoint issued by the controller; cycle count indicator. Record the current cumulative charge-discharge cycle number of the battery as a long-term characteristic of SOH (State of Health).
[0024] S103. Execute using a unified timestamp: This will transfer physical sensor data ( , , ) and control command data ( Alignment is performed. For each sampling point, a full-dimensional feature vector containing "state-action" is generated and stored in the training database.
[0025] S104. Global Full-Charge and Hardware Safety Pre-check: After completing the data acquisition and timestamp alignment in steps S101 to S103, the system performs a high-priority global state self-check before entering neural network inference. Real-time reading of the current battery terminal voltage is also performed. Surface temperature And the system-level state of charge (SOC) calculated based on the fusion of ampere-hour integral and open-circuit voltage. The above parameters are compared with the absolute safety threshold matrix preset in the BMS underlying memory: If the current terminal voltage is detected... (For example ), or global (For example ), or temperature If the charging / discharging values exceed the permissible range, the controller immediately triggers a "global full charge or hard limit exceedance" interrupt command. The system proactively skips the subsequent feature stitching (S2) and neural network deduction (S5) processes, directly cutting off the PWM drive output of the main control chip and disconnecting the charging main contactor, thus normally ending the charging process. If all physical parameters are within the safety thresholds, the current data stream is allowed to proceed, and step S2 is entered for data preprocessing and time-series sample construction.
[0026] S2. Data Preprocessing and Time Series Sample Construction S201. Perform physical constraint denoising on the acquired current, voltage, and temperature data: Discard statistical algorithms that may disrupt step characteristics and adopt physical range-based filtering. Set reasonable physical thresholds (e.g., voltage [2.5V, 4.5V], current [-10A, 100A]). Only remove outliers (glitch-like events caused by sensor malfunctions) that exceed this physical range, and fill in the gaps using linear interpolation. Normal voltage jumps generated during pulse switching are fully preserved without smoothing. S202. Map voltage, current, and temperature data to the [0,1] interval using the Min-Max normalization method: Because the battery voltage (3.0-4.2V) and current (0-100A) differ by orders of magnitude, direct input can lead to gradient bias during neural network weight updates. Normalization eliminates the influence of dimensions, ensuring that features with small voltage changes (mV level) are not overwhelmed by large current values during model training. S203. Sliding Time Window Slicing and Historical State Extraction: Converting continuous sampled data streams into sequential samples required by the model. The sliding window length is set to... At the current decision-making moment Extract the past Normalized voltage sequence at each time step and current sequence Simultaneously, the aging features collected in step S102 are extracted and normalized to obtain scalar features. The current sequential state and the global state are cached for subsequent steps (S5) to be fused and invoked with the dynamically generated instruction sequence.
[0027] S3.LSTM Model Construction Construct a deep recurrent neural network to establish a structure from the input tensor "To "predicted voltage" The network structure is as follows: Input Layer: Receives a tensor with dimension (Batch_Size, L, 4); First Feature Extraction Layer (LSTM Layer 1): Contains 128 LSTM memory units, with return_sequences=True. This layer is responsible for capturing local transient features in the original waveform; Dropout Layer: Sets the dropout rate to 0.2 to prevent the model from overfitting on the training data; Second Feature Extraction Layer (LSTM Layer 2): Contains 64 LSTM memory units, with return_sequences=False. This layer is responsible for integrating memory information over a long time span, extracting the long-term aging trend and concentration polarization features of the battery, and compressing the temporal information into a single state vector; Dense Layer: Contains 32 neurons, using the ReLU activation function for high-dimensional nonlinear combination of features; Output Layer: Contains 1 neuron, using the Linear activation function.
[0028] S4.LSTM Model Training Label definition (Ground Truth): Labels of the training set Set to apply the corresponding action After completion, the actual voltage value at the end of the pulse is collected; Loss Function: The mean square error (MSE) is used to measure the deviation between the predicted voltage and the actual voltage. Optimizer: Employs the Adam optimization algorithm, with an initial learning rate set to... To achieve refined convergence in the later stages of training, a ReduceLROnPlateau (learning rate plateau decay) mechanism is introduced: The loss value on the validation set is monitored in real time. When the validation loss does not show a significant decrease within a preset number of epochs (maximum iterations), the model is considered to have entered a plateau phase. The current learning rate is then multiplied by a decay factor (set to 0.5 in this example), i.e. Set a minimum learning rate threshold. When the learning rate decays below this threshold, it stops to maintain the model's basic parameter update capability and prevent premature training stagnation. Training process: The dataset is divided into training and validation sets in an 8:2 ratio. The maximum number of epochs is set to 200, and an early stopping mechanism is introduced: training stops when the validation set loss does not improve for 10 consecutive epochs, and the current optimal weights are saved.
[0029] S5. State Prediction and Parameter Optimization S501. Constructing a dynamic candidate parameter space and multidimensional optimization solution At the decision moment of each charging cycle The controller generates an optimization space for the pulse parameters to be evaluated in real time based on the current battery state and operating condition boundaries. Let the dynamic safety domain of the pulse current be... (Preferred) The dynamic safety domain of pulse width time is (Preferred) To ensure optimization accuracy while strictly controlling the computational load on the underlying microcontroller, the controller employs a polymorphic optimization strategy to generate candidate parameter sets. The polymorphic optimization strategy includes, but is not limited to, any of the following implementations: Implementation Method A (Discrete Mesh and Multilevel Approximation Method) Within the preset current and time safety domains, a coarse-to-fine gridded discrete sampling method is employed. The first round uses a relatively large step size (e.g., ...). A global sparse candidate matrix is generated and fed into subsequent models for batch evaluation to identify high-optimal regions; in the next round, within this local high-optimal region, the model switches to a minimum step size (e.g., ...). A dense candidate matrix is generated for secondary precise retrieval. This method reduces the number of inferences required for global blind search from thousands to hundreds.
[0030] Implementation Method B (Group Heuristic Parallel Optimization) To avoid the high computational cost of full-space traversal, population-based heuristic strategies such as Particle Swarm Optimization (PSO) or Genetic Algorithm (GA) are employed. Taking PSO as an example, in... Initialization in the two-dimensional continuous solution space includes A population of particles (e.g.) Each particle represents a set of candidate pulse parameter pairs for the current iteration. In a single optimization cycle, extract this... The position coordinates of each particle are directly packaged to form the candidate parameter set for the current batch. The data is then fed into a parallel inference engine (S502) to calculate the fitness (i.e., predicted voltage). The positions of the next generation of particles are then updated based on individual and global extrema. This implementation naturally aligns with the parallel tensor operations of neural networks, converging to the global optimum with only a very small number of iterations.
[0031] Implementation method C (gradient ascent method based on surrogate model) The trained LSTM model is treated as a differentiable nonlinear surrogate equation. Given sufficient computational margin, several starting points are randomly initialized, and the automatic differentiation mechanism within the LSTM is directly utilized to compute the objective function relative to the input instruction. The gradient vector. A series of iterative candidate path points are generated along the gradient ascent direction, and these are compiled into a candidate parameter set. Perform safety boundary checks until the optimal solution is approached from the edge of the polarization voltage red line.
[0032] S502. Broadcast splicing and parallel voltage response inference: Extracting historical time-series sequences and aging characteristics from the cache in step S203. Traverse the data generated in step S501. Group candidate parameter set .like Figure 2 As shown, for the first Group candidate parameters Using a broadcast mechanism to connect with Replication and expansion in the time step dimension Next, it is concatenated with historical voltage and current sequences along the feature channel dimension to form a dimension of A single fused input tensor. All of them. Each sample is stacked to construct a batch tensor, which is then fed into an LSTM model for batch forward propagation, outputting... Each corresponding predicted value of the pulse end voltage.
[0033] S503. Adaptive Safety Filtering Based on Multidimensional Physical Constraints and Prediction Uncertainty like Figure 3 As shown, to prevent lithium plating or overheating runaway during pulse charging, and to account for the prediction errors of the neural network under different operating conditions, this embodiment establishes a multi-level funnel filtering mechanism that incorporates model confidence compensation to rigorously screen the batch candidate parameters and their prediction results output by S502: Cascaded constraint level 1: Dynamic Physical Boundary Query The system reads the battery surface temperature and current state of charge (SOC) in real time. Based on the electrochemical mechanism, it consults the maximum allowable polarization voltage (MAPV Table) preset in the BMS core to determine the absolute safe cutoff voltage under the current operating conditions. This threshold is adaptively adjusted according to the environment (e.g., at extremely low temperatures, the threshold is lowered to prevent lithium plating caused by excessively low negative electrode potential).
[0034] Second level of cascaded constraints: Introducing uncertainty-aware margin compensation. Considering the uncertainty of the prediction output of deep learning models under complex conditions, a conservative error initialization mechanism is set to address the cold start problem caused by the lack of error feedback in the initial stage of the system: In the first charging cycle... Next (before the buffer queue is full), force the MAE to be set to the preset maximum conservative error threshold (e.g., To ensure absolute safety during the cold start phase, the initial value is gradually replaced with the actual MAE calculated by S602 during closed-loop operation. To prevent voltage overshooting during actual execution due to underestimating model predictions, an adaptive margin assessment mechanism is established. The dynamic confidence penalty term is defined as the product of the model error and the reliability coefficient. For the ... The corrected safety margin of the candidate parameters is no longer a single theoretical difference, but a conservative margin after deducting the confidence penalty term. When the model's recent predictions are extremely accurate, the confidence penalty term approaches zero, allowing the battery to operate close to its physical limits in pursuit of ultimate fast charging. When the model error increases (for example, when the model has just entered a low-temperature environment and has not yet completed the incremental learning update of S6), the confidence penalty term increases, the safety boundary automatically shrinks inward, and the system is forced to take more conservative pulse actions.
[0035] Cascaded Constraint Level 3: Binary Decision and Safe Set Construction (Filtering Execution) For the revised conservative safety margin, a stringent binary decision logic is applied: If the calculated conservative safety margin is less than zero: it is determined that the candidate parameter group has a substantial risk of touching the safety red line, and it is directly removed from the candidate set (Drop). If the conservative safety margin is greater than or equal to zero: the parameters are determined to be in the absolutely safe operating area (SOA), which includes model error considerations, and are retained and pushed into the safe candidate set.
[0036] S504. Throughput Maximization & Multi-level Exception Exit Mechanism like Figure 4 As shown, after the adaptive security screening in step S503, the controller selects the security candidate set. Execute optimal decision-making and exception handling logic: Normal Execution Branch like It is not an empty set, for each set of parameters in it Establish an evaluation function oriented towards "maximizing charging speed". The parameter combination with the highest evaluation value is selected as the optimal instruction for this pulse cycle and sent to the underlying hardware (e.g., by configuring the PWM duty cycle of the main control chip to drive the charging and discharging circuit), and the continuous rest counter is cleared. .
[0037] Fallback and Termination State Machine like An empty set indicates that the current battery state (e.g., high SOC, extremely low temperature, or severe aging) cannot withstand any pulse charging action within the preset optimization space after the introduction of prediction uncertainty penalties. In this case, the controller state machine intercepts the action sent in this cycle, triggering a multi-level abnormal exit mechanism: Level 1: Polarization decay and state self-check (forced rest) Accumulated continuous rest counter The system pauses the application of pulse current (i.e., the target current command is set to zero) and sets the rest and relaxation time. (e.g., 5s), wait for the internal polarization voltage of the battery to naturally decrease. To prevent timing feature discontinuities caused by the relaxation period, if no subsequent shutdown condition is triggered after the relaxation time ends, the controller does not immediately enter the LSTM decision loop, but instead prioritizes executing a preset "hot start probe pulse" (e.g., applying a pulse with a duration of 5 seconds). A small safety test current is used to refill / refresh the sliding time window of step S2, and then the normal prediction loop of S5 is restored to ensure the physical continuity of the timing characteristics.
[0038] Level 2: Normal Full Charge Detection (End of Charge Detection) At the end of the relaxation phase described above, the system samples the current open-circuit voltage (OCV). If the OCV sampled multiple times consecutively reaches a preset full-charge threshold (e.g., ...), the system will then... ), or the SOC calculated by combining ampere-hours and integrals to reach the full charge limit (e.g. If the battery is fully charged, the controller will automatically trigger a "normal shutdown" interrupt, disconnecting the main charging contactor and ending the entire charging process.
[0039] Level 3: Constraint Timeout If the OCV does not reach the full charge threshold, but the continuous rest counter The maximum number of retries has been exceeded. If no safety parameters are found for 10 consecutive times, or the total accumulated rest time exceeds the limit, the system determines that it is currently in a "physically limited state" (e.g., the ambient temperature is too low to safely supply power). The controller triggers the "condition-limited shutdown" logic, immediately cuts off the PWM drive output, and reports a system-level fault code containing environmental limitation characteristics via the communication bus (e.g., CAN / UART), exiting the current control loop to prevent the microcontroller from entering an infinite loop.
[0040] S6. Closed-loop Feedback & Online Incremental Learning S601: Real-time monitoring of prediction error: Whenever the controller completes an optimal pulse action (i.e., step 5-4 is completed) and ends the relaxation phase, the system immediately acquires the actual pulse terminal voltage at that moment. Error calculation: Compare it with the voltage value predicted by LSTM during the decision-making stage. Compare the results and calculate the relative absolute error (RAE): To prevent "data poisoning" during incremental model learning due to abnormal operating conditions, the system introduces a sample cleaning gateway: This gateway verifies whether there are sensor hardware errors during the execution of this pulse, whether it was forcibly interrupted by the pre-verification (S104), and whether there are consecutive frame drops in the acquired waveform. Only when the pulse is executed completely and healthily is the data processed. Only then are they allowed to be pushed into the historical data buffer for subsequent training.
[0041] S602. Moving Average: To avoid false triggering caused by noise in a single sampling, maintain a moving average of length K (e.g., ...). The error buffer queue calculates the moving average error (MAE) in real time: Online update triggering logic: Set a preset update threshold. (For example ), Decision logic: If If the current model still accurately matches the battery state, maintain the existing model parameters and clear the acquisition cache to save storage space. If the battery characteristics are determined to have deviated significantly (e.g., entering an accelerated aging phase or experiencing drastic changes in ambient temperature), an online incremental learning program is triggered. S603. Model Fine-tuning and Hot Weight Update in Resource-Constrained Environments like Figure 5 As shown, considering that the underlying microcontroller (MCU) of the BMS typically lacks native support for complex deep learning backpropagation frameworks and has limited computational and memory resources, this embodiment adopts a lightweight update strategy of "feature layer freezing and shallow fine-tuning" and provides two optional implementation paths: Implementation Path A (Lightweight Self-Update on the Edge Side): Once an update is triggered, the BMS main control chip initiates a background fine-tuning task during idle computing power cycles. The weight matrices of the first and second LSTM feature extraction layers are kept completely frozen, and the system only uses the extracted fine-tuning dataset $(X, Y)$ to update the final fully connected layer (Dense Layer). Since backpropagation in the Dense layer is essentially a simple matrix multiplication and scalar differentiation, the system has a built-in lightweight gradient descent library pre-written in C language. This library only calculates the partial derivative of the output layer error with respect to the Dense layer weight matrix, and uses a very small learning rate (e.g., ...). Perform 1 to 3 iterations of updates. The updated Dense layer weight array is written to the microcontroller's non-volatile memory (such as Data Flash or EEPROM), completing the hot update of the model. No additional deep learning computing framework is required throughout the process, effectively preventing memory overflow and blocking of safety-critical tasks.
[0042] Implementation Path B (Vehicle-Cloud Collaboration / Computing Power Outsourcing Update): In another embodiment, if the BMS is on a low-computing-power platform, the cached fine-tuning dataset is packaged and uploaded to a higher-level domain controller or cloud server with stronger computing power via an in-vehicle gateway or wireless communication module. The cloud server loads the complete digital twin model and performs backpropagation fine-tuning in S603. After fine-tuning, the cloud only extracts the changed Dense layer weight difference matrix (Delta Weights) and sends it to the BMS. Upon receiving it, the BMS directly overwrites the corresponding weight array in its local memory, thereby achieving closed-loop evolution of the model with extremely low data transmission bandwidth and zero local computing power consumption.
[0043] S604 Closed-Loop Iteration: The updated model parameters take effect immediately and are used in the next time step. State prediction (step S5). The system continuously loops through step S1 (data acquisition). S2 (Processing) S5 (Decision) S6 (Feedback) until charging is complete.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for optimizing pulse charging of lithium-ion batteries based on LSTM, characterized in that, The method specifically includes the following steps: S1. State Acquisition and Caching: Acquire the physical state time sequence of the battery under the current control cycle and the global health scalar features characterizing aging, perform sliding window slicing and cache it as historical state; S2. Dynamic optimization space construction: Based on the current battery operating condition boundary, a set of instructions to be evaluated containing multiple sets of candidate pulse currents and pulse width parameters is generated in real time. S3. Broadcast splicing and batch deduction: For each set of candidate pulse parameters in the set of instructions to be evaluated, the broadcast mechanism is used to extend them and the global health scalar features in the time step dimension, and the features are spliced with the cached physical state time sequence to construct a multi-dimensional fusion input tensor; the constructed batch tensor is input into the pre-trained deep learning model, and the corresponding predicted terminal voltage set is output in parallel. S4. Adaptive safety funnel screening: Obtain the moving average prediction error of the deep learning model, and calculate the conservative safety margin including the model prediction confidence penalty by combining the physical extreme boundary obtained by looking up the table; perform funnel screening on the set of instructions to be evaluated based on the conservative safety margin to generate a safe candidate set. S5. State Machine Decision and Execution: Determine whether the safety candidate set is empty: If it is not empty, select the candidate pulse parameter with the largest energy throughput and send it for execution; if it is empty, intercept the instruction and trigger a multi-level abnormal exit state machine that includes forced rest, hot start refresh and natural full charge determination. S6. Closed-loop feedback and incremental evolution: After the candidate pulse parameters are executed, the actual terminal voltage is obtained, and the moving average prediction error is updated after filtering abnormal data based on the sample cleaning gateway. When the error is greater than the preset threshold, the weights of the fully connected layer are fine-tuned using recent healthy samples while keeping the parameters of the deep learning model feature extraction layer frozen.
2. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, Before the state acquisition and caching in step S1, a pre-hardware safety verification step is also included: real-time reading of the current battery terminal voltage, surface temperature and system-level state of charge; comparing the above parameters with the preset absolute safety extreme value threshold; if any parameter exceeds the extreme value range, a hardware-level interrupt instruction is triggered, skipping the feature splicing and model inference process, directly cutting off the drive output and ending the charging process normally.
3. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, In step S3, constructing the multidimensional fusion input tensor specifically includes: S31. Extract the normalized historical voltage sequence and historical current sequence with a set sliding window length as time-series features, and extract the target pulse current and target pulse width to be evaluated as command scalar features; using the broadcast mechanism, copy and expand the global health scalar feature and the command scalar feature by the same number of times as the sliding window to form a pseudo-sequence; S32. Stack and concatenate the temporal features and the pseudo-sequence along the feature channel dimension to form the multidimensional fusion input tensor.
4. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, In step S3, the deep learning model is a deep recurrent neural network, whose network topology sequentially includes: a first feature extraction layer containing a first preset number of long short-term memory network memory units and configured to retain time-series outputs; an inactivation layer configured with a preset inactivation rate parameter; a second feature extraction layer containing a second preset number of LSTM memory units and outputting only the final time-step state vector; a fully connected layer containing multiple neurons using a non-linear activation function; and a single neuron output layer using a linear activation function.
5. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 4, characterized in that, The first preset quantity is 128, the second preset quantity is 64, and the preset inactivation rate parameter is 0.
2.
6. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, The pre-trained deep learning model is obtained through an offline pre-training step, which specifically includes: Mean square error is used to measure the deviation between the predicted voltage and the actual acquired pulse end voltage; Backpropagation is performed using an adaptive moment estimation optimization algorithm; A learning rate plateau decay mechanism is introduced during training. When the validation set loss value does not decrease significantly within a set number of consecutive rounds, the current learning rate is multiplied by a preset decay coefficient until it drops below the set minimum learning rate threshold. An early stopping mechanism is introduced, which stops training early when the validation set loss value does not improve for a preset number of consecutive rounds, and saves the current optimal weights.
7. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, In step S4, calculating the conservative safety margin, which includes the model prediction confidence penalty, specifically includes: S41, Conservative Error Cold Start Initialization: In the initial stage of the charging cycle and before the error buffer queue is full, the moving average prediction error is forcibly set to the preset maximum conservative error threshold. S42. When the buffer queue is full in the closed loop, it is smoothly replaced with the actual calculated moving average prediction error. S43. Multiply the currently effective moving average prediction error by the preset reliability coefficient to generate a dynamic confidence penalty term, and subtract the predicted end voltage of the corresponding parameter and the dynamic confidence penalty term from the absolute safe cutoff voltage under the current environment to obtain the conservative safety margin.
8. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, In step S5, the multi-level abnormal exit state machine including forced rest specifically includes: S51, First-level forced rest and hot start detection: Accumulate the continuous rest counter, pause the application of pulse current and apply a preset relaxation time; S52. After the relaxation time ends, a preset hot start detection pulse is executed to collect physical response data to refresh the sliding window history state in step S1. S53. Second-level normal full charge determination: At the end of the relaxation stage, the open circuit voltage or state of charge is detected. If the full charge threshold is reached, the algorithm boundary is determined to converge naturally, triggering a normal shutdown. S54, Level 3 Operating Condition Limited Timeout Shutdown: If the full charge threshold is not reached and the continuous rest counter exceeds the preset upper limit, the drive output is cut off and a fault code is reported.
9. The LSTM-based lithium-ion battery pulse charging optimization method according to claim 1, characterized in that, In step S6, filtering outlier data and fine-tuning the weights based on the sample cleaning gateway specifically includes: S61, Sample Cleaning Gateway Verification: Verify whether there are any underlying sensor hardware errors during the execution of this pulse, whether it is forcibly interrupted by the front-end hardware security verification, and whether there are any continuous frame drops in the acquired waveform. S62. Only when the pulse is determined to have completed its healthy execution can the group of status and action data be pushed into the historical data buffer. S63. Feature decoupling fine-tuning: Keep the weight matrices of the first and second feature extraction layers of the deep learning model in a completely frozen state; S64. Unfreeze only the last fully connected layer, calculate the partial derivative of the output layer error with respect to the weight matrix of the fully connected layer, perform local backpropagation, and overwrite the updated weights into the non-volatile memory.
10. A lithium-ion battery pulse charging optimization system based on LSTM, characterized in that, The system employs the method as described in any one of claims 1 to 9.