Battery health degree evaluation method based on LSTM and electrochemical mechanism model
By constructing a power battery health assessment link based on LSTM and electrochemical mechanism models, the generalization ability and cross-operating condition adaptability of SOH assessment in small sample scenarios are solved, achieving high-precision and interpretable SOH assessment, which is applicable to new energy vehicles and energy storage power stations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-13
AI Technical Summary
Existing power battery health (SOH) assessment technologies have weak generalization ability in small sample scenarios, lack physical interpretability, insufficient uncertainty quantification, and poor adaptability across operating conditions, making it difficult to meet the high precision and easy deployment requirements of new energy vehicles and energy storage power stations.
We construct an integrated evaluation link based on LSTM and electrochemical mechanism models, which combines "mechanism constraint-data-driven-dynamic correction". Through multi-dimensional data perception, P2D electrochemical mechanism modeling, Bayesian enhanced PI-LSTM learning, and dual-module dynamic correction, we achieve high-precision, interpretable, and strong generalization evaluation of SOH.
In small sample scenarios, the SOH evaluation error is reduced to less than 3%, and the accuracy fluctuation across operating conditions is less than 2%, meeting the real-time requirements of vehicles, reducing operation and maintenance costs, and adapting to various battery types and application scenarios.
Smart Images

Figure CN121656885A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power battery lifecycle management technology, specifically involving the cross-application of artificial intelligence and electrochemistry, and is particularly suitable for power battery health (SOH) assessment in scenarios such as new energy vehicles and energy storage power stations. This invention integrates a pseudo-two-dimensional (P2D) electrochemical mechanism model with a Bayesian-enhanced Long Short-Term Memory (LSTM) network to construct an integrated assessment link of "mechanism constraint - data-driven - dynamic correction," achieving high-precision, interpretable, and highly generalizable SOH assessment of power batteries. This provides core technical support for battery cascade utilization screening, remaining life prediction, and fault early warning. Background Technology
[0002] With the rapid development of the new energy industry, the health status of power batteries, as the core energy carrier, directly affects the safety and economy of equipment operation. Power battery health status (SOH, defined as the ratio of current maximum capacity to initial capacity) assessment technology has become a research hotspot. Existing technologies are mainly divided into two categories: mechanism-driven methods and data-driven methods. Mechanism-driven methods, represented by pseudo-two-dimensional (P2D) models and single-particle models (SPM), establish analytical relationships between degradation factors (such as active material loss and lithium-ion loss) and SOH by quantifying electrochemical processes such as lithium-ion diffusion and charge transfer. These methods have strong physical interpretability, but suffer from complex parameter calibration and high computational costs, making them difficult to adapt to real-time vehicle-mounted assessment scenarios. Data-driven methods, represented by deep learning models such as LSTM and Transformer, predict SOH by mining patterns in time-series data such as charging and discharging voltage and current. These methods are fast inference methods, but they rely on a large amount of labeled data. They have poor generalization in small sample scenarios (such as the initial cycling of new batteries) and the output lacks physical constraints, which can easily lead to prediction results that violate electrochemical laws (such as negative impedance and capacity rebound).
[0003] Currently, some fusion methods have emerged in the industry, but most are simply a combination of "mechanism model pre-training + data model fine-tuning," failing to achieve deep coupling between mechanistic constraints and data modeling. This results in issues such as a lack of uncertainty quantification and weak adaptability across operating conditions. For example, in scenarios involving switching charge / discharge rates from 1C to 2C or ambient temperatures dropping from 25℃ to -10℃, the accuracy of existing methods decreases by more than 50%, making them unsuitable for complex real-world applications. Furthermore, purely data-driven models require at least 200 cycles of data to guarantee accuracy. However, in the early stages of new battery production or when data is scarce for niche battery models, evaluation errors generally exceed 8%, failing to meet engineering requirements. Mainstream deep learning models are "black box" models, only outputting SOH values and unable to analyze specific degradation causes such as "active material loss" and "lithium-ion loss," hindering battery fault tracing and lifespan optimization. Simultaneously, existing methods fail to quantify the evaluation uncertainties caused by sensor noise and model bias, further limiting their application effectiveness in real-world scenarios.
[0004] With the number of new energy vehicles exceeding 30 million and the installed capacity of energy storage power stations surpassing 50GW, the market demand for "high-precision, early prediction, and easy deployment" power battery health assessment is becoming increasingly urgent. However, existing technologies cannot simultaneously meet the comprehensive requirements of small-sample generalization, physical interpretability, and cross-operating condition adaptability, resulting in low efficiency in battery cascade utilization screening (false screening rate exceeding 15%) and lagging on-board BMS early warning (fault early warning time less than 10 days). Therefore, there is an urgent need for an integrated assessment method that combines electrochemical mechanisms and advanced AI technology to solve the industry's core pain points and promote the upgrading of power battery full life cycle management technology. This invention aims to achieve high-precision, interpretable, and highly generalized SOH assessment of power batteries by constructing an integrated assessment link of "mechanism constraint - data-driven - dynamic correction," providing core technical support for battery cascade utilization screening, remaining life prediction, and fault early warning. Summary of the Invention
[0005] This invention aims to address the problems of weak generalization ability with small samples, lack of physical interpretability, insufficient quantification of uncertainty, and poor adaptability across operating conditions in the assessment of the state of health (SOH) of power batteries. Existing methods suffer from complex parameter calibration and high computational costs for purely mechanism-driven models (such as traditional P2D models), making them difficult to adapt to real-time vehicle scenarios. Purely data-driven models (such as pure LSTM) require at least 200 cycles of data to ensure accuracy, resulting in higher errors in the early stages of new battery production or when data is scarce for niche battery models, and the output is prone to violating electrochemical laws (such as negative impedance and capacity rebound). Current industry-standard fusion methods are mostly simple combinations of "mechanism pre-training + data fine-tuning," failing to achieve deep coupling. Accuracy significantly decreases across operating conditions (e.g., rate increase from 1C to 2C, temperature change from 25℃ to -15℃), failing to meet the requirements of new energy vehicles and energy storage power stations for "high accuracy, interpretability, and easy deployment" in their assessments. This invention provides a mechanism-data deep fusion, edge-deployable, and end-to-end self-optimizing SOH evaluation method, which completes "multi-source perception - mechanism modeling - constraint learning - dynamic correction - autonomous optimization" without relying on a large amount of labeled data.
[0006] A battery health assessment method based on LSTM and electrochemical mechanism models is implemented on an on-board battery management system (BMS) or an edge terminal of an energy storage power station (equipped with an ARM Cortex-A55 quad-core processor + 1 TOPS NPU). A five-stage processing chain is constructed around "data perception—mechanism modeling—constraint learning—dynamic correction—iterative optimization". (1) Multi-dimensional data perception: By synchronously collecting time-series data of electrical parameters, physical state data and periodic electrochemical impedance spectroscopy (EIS) data, and combining feature engineering to generate a time-series-mechanism fusion feature matrix, a high-quality input is provided for subsequent evaluation; (2) P2D electrochemical mechanism modeling: Based on Fick's law and Butler-Volmer equation, a pseudo two-dimensional (P2D) model is constructed, core parameters are calibrated and degradation factors are embedded, and physical constraint boundaries for output voltage, impedance and capacity decay are defined. (3) Physically Constrained LSTM (PI-LSTM) Learning: Introducing Bayesian enhancement mechanism to transform mechanistic constraints into model training regularization terms, constructing a hybrid loss function to train the network, and realizing SOH prediction and uncertainty quantification; (4) Dual-module dynamic correction: Through the interactive verification of the mechanism model and PI-LSTM, the prediction results of constraint violation and confidence interval exceedance are corrected to generate a high-precision SOH evaluation value; (5) Full-process iterative optimization: By using the improved crayfish algorithm and association rule mining, the historical evaluation data patterns are analyzed, and the parameters of the first four stages are automatically optimized to improve the long-term stability and robustness of operation.
[0007] Preferably, this method is specifically optimized for the entire life cycle of power batteries (cycle count 0-2000 times, temperature -20℃~45℃, rate capability 0.2C-2C), effectively solving the problems of poor generalization with small samples and weak cross-condition adaptation. At the same time, it meets the actual needs of edge devices for low latency (inference latency ≤10ms), low power consumption (power consumption ≤8W), and long-term stable operation. This method mainly includes the following five layers: "multi-dimensional data perception layer", "P2D electrochemical mechanism modeling layer", "Bayesian enhanced PI-LSTM learning layer", "dual-module dynamic correction layer", and "full-process iterative optimization layer". The multi-dimensional data perception layer comprises four modules: synchronous data acquisition, temporal feature extraction, mechanistic feature filtering, and feature fusion. This layer is responsible for acquiring real-time power battery operation data and generating a standardized fusion feature matrix to provide accurate input for subsequent modeling. The edge terminal synchronously acquires three types of data: ① Electrical parameter time series data (charging / discharging voltage, current, capacity, sampling frequency ≥ 1Hz) ② Physical state data (battery surface temperature, ambient temperature, charge / discharge rate) ③ Periodic EIS data (acquired once every 50 cycles to obtain ohmic resistance and charge transfer resistance); The sliding window technique is used to extract time-series features such as voltage plateau duration and current fluctuation coefficient. Spearman rank correlation coefficient is used to screen EIS mechanism features with a correlation ≥0.85 with capacity decay. After Z-score standardization, the features are spliced to generate a fusion feature matrix with dimensions [number of samples, 30-50, 20-35]. At the same time, the corresponding actual capacity of the cycle is labeled to determine the SOH benchmark value (SOH = current capacity / initial capacity × 100%). The feature processing accuracy is ≥99%, ensuring that the input data is free of redundancy and noise. The edge terminal uses low-power embedded devices (such as Rockchip RK3568 processor, 2GB LPDDR4 memory) and runs an embedded Linux system (such as Buildroot 2023.02) and a lightweight inference engine (TensorFlow LiteMicro). This method, deployed on this terminal, can achieve a data processing time of ≤200ms per loop, cache the feature data of the most recent 100 loops, support offline evaluation mode, and the entire process does not rely on cloud computing power. It is suitable for vehicle 12V power supply and industrial-grade environments of energy storage power stations. The "P2D electrochemical mechanism modeling layer" is based on Fick's law, the Butler-Volmer equation, and the capacity decay dynamic equation to construct a quantifiable degradation mechanism model and output physical constraint boundaries. This layer first collects the initial charge-discharge curves of the new battery at three rates: 0.5C, 1C, and 2C, and then uses the least squares method to calibrate the diffusion coefficients of the positive and negative electrodes (1×10⁻⁶).-14 ~5×10 - 13 m 2 / s), reaction rate constant (1×10) -8 ~1×10 -6 Core parameters such as m / s are used to ensure that the error between the model's output voltage curve and the measured value is ≤2%. Subsequently, a degradation factor equation is embedded to quantify the loss rate of active materials (0.02%~0.05% decay per cycle) and the amount of lithium-ion loss (5%~8% loss per 1000 cycles) as state variables. An analytical relationship between the degradation factor and the terminal voltage and impedance is established. Finally, a reasonable range of output voltage (3.0~4.2V for ternary lithium batteries and 2.5~3.65V for lithium iron phosphate batteries), a theoretical range of impedance (ohmic resistance 50~200mΩ), and a monotonic characteristic constraint of capacity decay are provided to provide physical priors for subsequent learning layers.
[0008] Preferably, the Bayesian enhanced PI-LSTM learning layer comprises four parts: bidirectional LSTM temporal modeling, Bayesian parameterization, constraint fusion, and hybrid loss training, achieving SOH prediction and uncertainty quantification. This layer first uses the fused feature matrix as input and extracts temporal features through a bidirectional LSTM layer (forward-facing to capture historical degradation trends, backward-facing to mine the impact of future operating conditions). The number of hidden layer units is optimized to 128-256 using an improved crayfish algorithm. Secondly, a Bayesian parameterization module is added, setting the weight matrix as a random variable following a Gaussian distribution, and a Monte Carlo Dropout layer (dropout probability 0.1-0.2) is introduced to quantify the uncertainty of sensor noise and model bias. Finally, a constraint fusion layer transforms the physical constraints output by the mechanistic model into regularization terms, preventing the prediction results from violating electrochemical laws. Finally, construct the hybrid loss function:
[0009] For MSE error, For physical boundary violations, It is a negative log-likelihood; , , These are the weighting coefficients; The Adam optimizer was used (learning rate 1×10⁻⁶). -4 ~5×10 -4 Training continued until the loss fluctuation was <0.001 for 10 consecutive rounds, the model's point estimation error for SOH was ≤0.75%, and the 95% confidence interval coverage was ≥92%. The dual-module dynamic correction layer comprises three parts: constraint violation detection, adaptive parameter adjustment, and weighted fusion, which corrects the initial prediction results to improve accuracy. First, the initial prediction results from the PI-LSTM are input into the P2D mechanism model. If physical constraint violations exist (e.g., predicted impedance exceeds the theoretical range by ±10%, voltage exceeds the reasonable range by ±5%), the mechanism model parameters are adaptively adjusted (e.g., the positive electrode diffusion coefficient is corrected), the constraint boundaries are updated, and then fed back to the PI-LSTM for secondary training. Second, based on the 95% confidence interval of the Bayesian output, the PI-LSTM prediction value and the mechanism model degradation factor estimate (e.g., "SOH attenuation corresponding to active material loss") are fused with a 7:3 weight. If the confidence interval width is >5%, additional EIS data acquisition (shortening the acquisition cycle to once every 30 cycles) and model updates are triggered. The final output SOH evaluation error is ≤0.75%, and the cross-operating-condition error is ≤3%. The full-process iterative optimization layer comprises two parts: multi-dimensional association rule mining and lightweight hyperparameter optimization. It achieves system self-evolution by analyzing historical evaluation data. This layer uses association rule mining to discover potential patterns, such as "low temperature (<0℃) + high magnification (>1.5C) → increased SOH evaluation error," which can uncover more than 30% more optimization clues than traditional methods. At the same time, an improved crayfish algorithm (parameter count ≤0.8M) is deployed, aiming to "minimize SOH evaluation RMSE and narrow the confidence interval width." It automatically adjusts the parameters of the first four stages (such as the number of hidden units in the PI-LSTM, the weight of the hybrid loss function, and the EIS acquisition cycle). The optimization cycle is once every 100 cycles, without manual intervention, which improves the system robustness by 60% and greatly extends the maintenance cycle.
[0010] Preferred core algorithms and process key points 1. Multi-dimensional data perception preprocessing: To address the issues of high noise and feature redundancy in power battery operation data, a dual preprocessing strategy of "synchronous acquisition + correlation filtering" is adopted. This involves synchronously accessing electrical parameters, physical state, and EIS data through high-precision sensors (voltage acquisition accuracy ±0.01V, current acquisition accuracy ±0.1A), extracting time-series features using a sliding window (window size 5-10 sampling points), eliminating redundant features with a correlation <0.85 with capacity decay using the Spearman rank correlation coefficient, and generating a fused feature matrix after Z-score standardization. The feature dimension is controlled at 20-35 dimensions, and the data preprocessing time is ≤50ms / cycle, reducing noise interference for subsequent modeling. 2. P2D Mechanism Model Parameter Calibration (Core Modeling): With "high precision + engineering" as the core, a feasible P2D model is constructed based on the initial experimental data of the new battery. Charge and discharge curves at three rates of 0.5C, 1C, and 2C are collected. The least squares method is used to calibrate eight core parameters, such as the diffusion coefficient of the positive / negative electrode and the reaction rate constant, so that the error between the model output voltage curve and the measured value is ≤2%. When embedding the degradation factor, the mapping relationship between the loss rate of active materials, the amount of lithium ion loss and the number of cycles is established through cyclic aging experiments (0-1000 cycles). The abstract degradation process is transformed into a calculable mathematical equation. The mechanism model takes ≤3ms for a single inference, which meets the requirements of real-time evaluation. 3. Bayesian Enhanced PI-LSTM Training (Constrained Learning): (1) Uncertainty quantification: Add a Monte Carlo Dropout layer to the PI-LSTM network, obtain the SOH prediction distribution through 50 random forward propagations, calculate the 95% confidence interval, quantify the random uncertainty (sensor noise) and cognitive uncertainty (model bias), and control the confidence interval width to 3%-5%; (2) Physical constraint fusion: The voltage and impedance constraints output by the P2D model are converted into penalty terms. If the predicted value exceeds the constraint range, physical losses are accumulated according to the degree of exceeding the limit (e.g., 0.1 times the base loss is accumulated for exceeding 1%) to avoid the model output from violating electrochemical laws. (3) Hybrid loss optimization: The Adam optimizer is used to iteratively train the hybrid loss function, and the learning rate is dynamically adjusted through a cosine annealing strategy (initially 1×10). -4 (The loss is reduced by 10% every 50 rounds), training stops when the loss fluctuation is less than 0.001 for 10 consecutive rounds, the number of model parameters is controlled within 5M, and the inference latency is ≤10ms; 4. Dual-module dynamic correction (accuracy improvement): If the initial PI-LSTM prediction violates physical constraints, the P2D model parameters are adaptively adjusted using gradient descent (e.g., the diffusion coefficient correction is controlled within ±5%). After updating the constraint boundaries, the data is re-input into the PI-LSTM for training. The PI-LSTM predictions and mechanistic model estimates are fused according to a certain weight ratio. The weights are dynamically adjusted based on the evaluation error of the first 100 iterations (the corresponding model weight is increased if the error is large). After correction, the SOH evaluation RMSE is ≤0.75%, and the cross-condition error is ≤3%. 5. Full-process self-optimization (robustness improvement): By analyzing historical data through association rule mining, the "operating condition-error" correlation pattern is identified (e.g., "-10℃ +2C ratio → error increase of 2%)", providing direction for parameter optimization; the improved crayfish algorithm is used to optimize the PI-LSTM hyperparameters (hidden layer unit number 128-256, dropout probability 0.1-0.2) and EIS acquisition cycle (30-50 cycles). After optimization, the system error is ≤3% in small sample scenarios (≤50 cycles), which is 40% lower than before optimization, and the cross-operating condition adaptability is improved by 50%. To protect corporate confidentiality, the specific values of the core components of the PI-LSTM network involved in this invention, such as the initial value of the number of hidden layer units, the learning rate decay coefficient, the dynamic adjustment threshold of the weights of the hybrid loss function, and the support and confidence thresholds for association rule mining, are all described in terms of range or abstraction. In practical applications, users can adjust these parameters according to the battery type (ternary lithium / lithium iron phosphate) and application scenario (vehicle / energy storage) without changing the technical essence, or choose other algorithms with equivalent functions (such as using particle swarm optimization to replace the crayfish algorithm for hyperparameter optimization).
[0011] The beneficial effects of this invention are as follows: This patent proposes a power battery SOH evaluation method based on "mechanism-data deep fusion + Bayesian uncertainty quantification"; This method takes "high precision, interpretability, strong generalization, and easy deployment" as its core design concept, and effectively solves the three major problems of existing technologies in small sample generalization, physical interpretability, and cross-operating condition adaptation. This invention achieves deep coupling between electrochemical mechanisms and time-series data by establishing a complete technical process of "multi-source sensing - mechanism modeling - constraint learning - dynamic correction - automatic optimization". Compared with the pure LSTM model, the SOH evaluation error in small sample scenarios (≤50 cycles) is reduced from more than 8% to less than 3%, a reduction of more than 60%. Compared with the traditional P2D model, the inference latency is shortened from more than 50ms to less than 10ms, meeting the real-time requirements of vehicle-mounted systems. Even under extreme conditions such as -20℃ low temperature and 2C high rate, the evaluation accuracy fluctuation is still <2%, which can accurately distinguish the contribution of "active material loss", "lithium ion loss" and "impedance growth" to SOH decay (such as "lithium ion loss leads to a 5.2% decrease in SOH"), solving the "black box" problem of pure data models. In terms of hardware deployment and engineering implementation, all modules of this invention can run on vehicle-mounted BMS or energy storage edge terminals, with a power consumption of ≤8W, which is only 1 / 5 of that of traditional server solutions; it does not rely on cloud computing power and a large amount of labeled data, and only 30 cycles of data are needed to complete model adaptation when a new battery leaves the factory, with an adaptation cycle of ≤24 hours, which is significantly shorter than the industry's conventional solution (requiring 200 cycles of data and a 1-week adaptation cycle); the full-process self-optimization mechanism greatly reduces the frequency of manual maintenance and operation and maintenance costs, and avoids the tedious process of frequent manual parameter debugging; This invention also boasts strong portability and scalability—it can be directly adapted to mainstream battery types such as ternary lithium, lithium iron phosphate, and lithium iron manganese phosphate without modifying the hardware architecture, covering various application scenarios including new energy vehicles (passenger / commercial vehicles), energy storage power stations (residential / industrial / commercial), and portable devices; subsequently, it can be adapted to new battery technologies such as solid-state batteries simply by expanding the EIS feature library and optimizing the degradation factor equation; this method provides a standardized and low-cost technical solution for the full life cycle health management of power batteries, and has broad application prospects and promotional value in areas such as new energy vehicle safety, energy storage power station efficiency improvement, and battery cascade utilization screening. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the layered design of the architecture of this invention, showing the composition and interrelationship of the "multi-dimensional data perception layer", "P2D electrochemical mechanism modeling layer", "Bayesian enhanced PI-LSTM learning layer", "dual-module dynamic correction layer" and "full-process iterative optimization layer". Detailed Implementation
[0013] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] Specific implementation examples are given below.
[0015] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, other embodiments obtained by those skilled in the art without creative effort are all within the protection scope of this invention.
[0016] Example 1 This embodiment is applied to a large electric vehicle charging station in a core business district of a city. This station serves more than 200 electric vehicles per day, covering two mainstream battery types: ternary lithium and lithium iron phosphate. It has three core needs: (1) Real-time health monitoring: The battery SOH needs to be assessed in real time during the vehicle charging process (1-2 hours) to provide early warning of the risk of thermal runaway (such as battery bulging, sudden increase in internal resistance). (2) Anti-interference adaptation: The charging station environment is subject to interference such as charging pile current fluctuations, temperature sensor noise, and unstable grid voltage. It is necessary to ensure that the evaluation accuracy is not affected. (3) Edge collaboration: There are a total of 60 charging piles at the site, which are managed in 3 areas. It is necessary to realize edge terminal data collaboration within the area to improve the generalization of cross-vehicle evaluation; This charging station is equipped with one edge terminal for every 20 charging piles, for a total of 3 terminals. The edge terminal uses an ARM Cortex-A55 quad-core processor (2.4GHz) and an NPU acceleration chip with 1 TOPS computing power. It has 4GB L PDDR4 memory + 32GB eMMC flash memory (caching charging data for the last 24 hours), and is connected to the charging pile CAN bus (to collect voltage / current), NTC temperature sensor (accuracy ±0.5℃), and EIS module (collecting data once every 30 minutes). The edge terminal collects charging parameters (voltage (0-500V, accuracy ±0.1V), current (0-200A, accuracy ±0.2A), temperature data (battery pack surface temperature (-20℃~80℃), ambient temperature (-10℃~40℃), sampling frequency 1Hz) and EIS data (frequency range 1mHz-1kHz, collected once every 30 minutes, obtaining ohmic resistance and charge transfer resistance) via CAN bus. At the same time, the three edge terminals are connected to form a federated learning network through a local area network, synchronizing model parameters once every hour without transmitting raw charging data to protect user privacy. The power battery health assessment scheme of the present invention is based on a framework of "multi-dimensional data perception layer", "P2D electrochemical mechanism modeling layer", "Bayesian enhanced PI-LSTM learning layer", "dual-module dynamic correction layer" and "full-process iterative optimization layer", and is deployed at the edge terminal of the charging station to realize a complete closed loop from charging data collection to SOH assessment. Main flow pseudocode: procedure BATTERY_SOH_EVALUATION_FULL(can_bus, temp_sensor, eis_module, fed_terminals): / / Initialize the core module init DATA_COLLECTOR(can_bus, temp_sensor, eis_module) / / Data acquisition init P2D_MODEL(initial_params=NCM811_default) / / P2D mechanism model (default ternary lithium parameters) init PI_LSTM(model_path="pi_lstm_tflite.tflite") / / Constrained LSTM init DYNAMIC_CORRECTOR(phys_constraints=DEFAULT_CONSTRAINTS) / / Dynamic calibration init FED_CLIENT(fed_alg="FedAvgV3", peers=fed_terminals) / / Federal Client init SELF_OPTIMIZER(rl_model="lightweight_rl.tflite") / / Self-optimization / / Initialize cache window init W_DATA(win_size=60) / / 2Hz sampling, buffer 30 seconds of data (60 sampling points) init W_CYCLE(win_size=30) / / Caches 30 charging cycle data (for time series modeling) init W_FED(win_size=60) / / Cache parameters for 60 minutes (for federated synchronization) while can_bus.is_connected(): / / 1. Multi-dimensional data perception: collecting and preprocessing charging data charge_data, ts = DATA_COLLECTOR.grab_data(win_size=30) / / Collect 30 seconds of data (60 sampling points) time_features = extract_time_features(charge_data) / / Extract time-series features if ts % 1800 == 0: / / Collect EIS data once every 30 minutes eis_data = eis_module.get_eis_data() eis_features = select_eis_features(eis_data, W_CYCLE.get_history_decay()) else: eis_features = W_DATA.get_last_eis() / / Reuse the most recent EIS data fusion_feat, soh_benchmark = fuse_standardize(time_features, eis_features) W_DATA.push(fusion_feat) / / 2. P2D electrochemical mechanism modeling: real-time updates of degradation factors and physical constraints cycle_num = W_CYCLE.get_cycle_count() / / Current number of charging cycles p2d_params = P2D_MODEL.update_degradation(cycle_num) / / Embedded degradation factor phys_constraints = P2D_MODEL.get_phys_constraints() / / Get voltage / impedance constraints DYNAMIC_CORRECTOR.update_constraints(phys_constraints) / / 3. Bayesian Enhanced PI-LSTM Learning: Predicting SOH and Uncertainty if W_DATA.get_feat_count() >= 30: / / Accumulate features from 30 loops (meeting input requirements) soh_pred, uncertainty = PI_LSTM.predict(W_DATA.get_feat_seq()) W_CYCLE.push(soh_pred, uncertainty, ts) / / 4. Dual-module dynamic correction: Correcting constraint violations and results with high uncertainty if W_CYCLE.get_pred_count() >= 1: soh_pred_last = W_CYCLE.get_last_pred() is_valid, corrected_soh = DYNAMIC_CORRECTOR.correct(soh_pred_last,phys_constraints) if not is_valid: / / Trigger additional EIS data collection (reduced to once every 10 minutes) eis_module.setCollectionPeriod(600) eis_data = eis_module.get_eis_data() eis_features = select_eis_features(eis_data, W_CYCLE.get_history_decay()) fusion_feat, _ = fuse_standardize(time_features, eis_features) soh_pred, _ = PI_LSTM.predict(fusion_feat) corrected_soh = soh_pred / / Output the final SOH evaluation results output_soh_result(corrected_soh, uncertainty, ts) / / 5. Federated Collaboration and End-to-End Optimization: Synchronize and optimize parameters every 60 minutes. if ts % 3600 == 0: / / Federal parameter synchronization local_params = get_local_model_params(PI_LSTM, P2D_MODEL) global_params = FED_CLIENT.sync(local_params, W_FED.get_params()) update_model_params(PI_LSTM, P2D_MODEL, global_params) / / Self-optimization adjustment parameters history_res = W_CYCLE.get_history_results(120) / / 2-hour history results optimized_params = SELF_OPTIMIZER.optimize(history_res) update_model_params(PI_LSTM, DYNAMIC_CORRECTOR, optimized_params) W_FED.push(optimized_params) / / Maintain cache window (remove expired data) W_DATA.clean_expired(ts, expire=3600) / / Cache data for 1 hour W_CYCLE.clean_expired(ts, expire=86400) / / Caches one day's worth of data; The corresponding multi-dimensional data perception stage adapts to the interference environment of the charging station, uses relevant technologies to collect charging parameters, temperature, and EIS data, and extracts high signal-to-noise ratio features. The aforementioned adaptation to the charging station interference environment refers to the use of shielded cables and anti-interference sensors for data acquisition in complex environments such as strong electromagnetic interference and voltage fluctuations at charging stations. For example, a high-precision isolation amplifier is integrated into the BMS (Battery Management System) to reduce noise interference during signal transmission. At the same time, a multi-channel synchronous acquisition module is deployed to achieve real-time synchronous acquisition of charging current (accuracy ±0.1A), voltage (accuracy ±1mV), battery surface temperature (accuracy ±0.5℃), and EIS (electrochemical impedance spectroscopy) data, with a sampling frequency of up to 100Hz. The related technologies refer to capturing transient responses during the charging process using high-frequency sampling technology, and removing high-frequency noise using low-pass filtering algorithms (such as Butterworth filters); in terms of EIS data acquisition, the AC small signal injection method is used to scan within the frequency range of 0.1Hz-10kHz to obtain the internal impedance change characteristics of the battery. The pseudocode for the multi-dimensional data perception stage is as follows: # 1.1 Extracting time-series features (resistant to current fluctuations) def extract_time_features(charge_data): voltage = np.array(charge_data["voltage"]) current = np.array(charge_data["current"]) temp_surface = np.array(charge_data["temp_surface"]) # Voltage stability index: Voltage standard deviation (suppressing grid fluctuation interference) voltage_stability = np.std(voltage) / np.mean(voltage) # Current integral capacity: Charging capacity = ∫ current dt (eliminating instantaneous current fluctuations) charge_capacity = np.trapz(current, dx=0.5) # Sampling interval 0.5 seconds # Temperature gradient: Rate of change of battery surface temperature (to identify abnormal temperature rise) temp_gradient = np.diff(temp_surface).mean() # Temperature change per second return { "voltage_stability": voltage_stability, "charge_capacity": charge_capacity, "temp_gradient": temp_gradient } # 1.2 EIS Feature Filtering (Resistant to Sensor Noise) def select_eis_features(eis_data, history_decay): from scipy.stats import spearmanr # EIS raw features (including noise) ohmic_r = eis_data["ohmic_resistance"] charge_transfer_r = eis_data["charge_transfer_resistance"] double_layer_c = eis_data["double_layer_capacitance"] # Calculate the Spearman correlation coefficient with capacity decay (to screen for strongly correlated features) corr_ohmic, _ = spearmanr([ohmic_r]*len(history_decay), history_decay) corr_charge, _ = spearmanr([charge_transfer_r]*len(history_decay),history_decay) corr_c, _ = spearmanr([double_layer_c]*len(history_decay), history_decay) # Filter features with a correlation coefficient ≥ 0.85 (remove noisy features) selected = {} if corr_ohmic >= 0.85: selected["ohmic_resistance"] = ohmic_r if corr_charge >= 0.85: selected["charge_transfer_resistance"] = charge_transfer_r # Double-layer capacitance has low correlation (typically <0.6), so it should be excluded. return selected # 1.3 Feature Fusion and Standardization (Adapting to Different Vehicle Models) def fuse_standardize(time_features, eis_features): # Merging timing characteristics and EIS characteristics (adapted for ternary lithium / lithium iron phosphate) feat_list = [ time_features["voltage_stability"], time_features["charge_capacity"] / 100, # Normalize to [0,1] (assuming maximum capacity is 100Ah) time_features["temp_gradient"] / 10, # Normalize to [0,1] (maximum gradient 10℃ / s) eis_features.get("ohmic_resistance", 0.1) / 0.5, # Normalize to [0,1] (maximum impedance 0.5Ω) eis_features.get("charge_transfer_resistance", 0.3) / 1.0 # Normalize to [0,1] ] # Z-score standardization (based on the mean / standard deviation of historical charging station data) mean = np.array([0.05, 0.5, 0.2, 0.2, 0.3]) # Historical statistical mean std = np.array([0.02, 0.2, 0.1, 0.1, 0.2]) # Historical standard deviation standardized_feat = (np.array(feat_list) - mean) / (std + 1e-8) # Mark the SOH baseline value (based on charging capacity: SOH = current capacity / rated capacity) rated_capacity = charge_data.get("rated_capacity", 50) # Rated capacity of vehicle model (default 50Ah) soh_benchmark = charge_capacity / rated_capacity return standardized_feat, soh_benchmark; In the P2D electrochemical mechanism modeling stage, targeting the two common battery types in charging stations—ternary lithium batteries and lithium iron phosphate batteries—the system dynamically adjusts key parameters in the P2D (pseudo-two-dimensional) model, such as solid-phase diffusion coefficient, electrolyte conductivity, and electrode reaction kinetics parameters, by real-time acquisition of battery charging and discharging current, voltage, and temperature, combined with historical battery health data, and leveraging the powerful time-series data processing capabilities of the LSTM network. After parameter optimization, the P2D model can accurately simulate the internal electrochemical reaction processes of different batteries under current operating conditions. Based on the optimized model, the system further outputs physical constraints adapted to the battery characteristics of the current vehicle model, including but not limited to safe charging current thresholds, optimal charging voltage ranges, and temperature control ranges, providing a reliable basis for power battery health assessment and safe and efficient charging. The pseudocode for the P2D electrochemical mechanism modeling stage is as follows: # 2.1 Dynamic adjustment of P2D model parameters (adapting to different battery types) def update_degradation(self, cycle_num): # Identify battery type (read the battery model reported by BMS from charging data) battery_type = self.charge_data.get("battery_type", "NCM811") if battery_type == "NCM811": # Ternary lithium battery # Initial parameters (after calibration) D_p_init, D_n_init, k_init = 2e-14, 1e-13, 5e-7 # Degradation factors: Active material loss 0.02% / cycle, lithium-ion loss 0.005% / cycle active_ratio = 1 - 0.0002 * cycle_num li_ratio = 1 - 0.00005 * cycle_num else: # Lithium iron phosphate battery D_p_init, D_n_init, k_init = 1e-14, 8e-14, 3e-7 active_ratio = 1 - 0.0001 * cycle_num # Slower decay (0.01% / cycle) li_ratio = 1 - 0.00003 * cycle_num # Slower decay (0.003% / cycle) # Degenerate parameters D_p_degraded = D_p_init * active_ratio D_n_degraded = D_n_init * active_ratio k_degraded = k_init * (active_ratio + li_ratio) / 2 # Reaction rate decreases with degradation self.calibrated_params = [D_p_degraded, D_n_degraded, k_degraded] return self.calibrated_params # 2.2 Output physical constraints (adapting to charging station environment) def get_phys_constraints(self): battery_type = self.charge_data.get("battery_type", "NCM811") if battery_type == "NCM811": # Ternary lithium battery constraints: Voltage 3.0-4.2V, Ohm resistance 50-200mΩ voltage_min, voltage_max = 3.0, 4.2 resistance_min, resistance_max = 0.05, 0.2 else: # Lithium iron phosphate constraint: voltage 2.5-3.65V, ohmic resistance 80-250mΩ voltage_min, voltage_max = 2.5, 3.65 resistance_min, resistance_max = 0.08, 0.25 # Capacity decay constraint: The capacity of a single charge shall not exceed 101% of the rated capacity (to suppress measurement error). def capacity_constraint(curr_capacity, rated_capacity): return curr_capacity <= rated_capacity * 1.01 return { "voltage": (voltage_min, voltage_max), "ohmic_resistance": (resistance_min, resistance_max), "capacity_constraint": capacity_constraint }; The corresponding Bayesian-enhanced PI-LSTM learning layer is the core connecting the "multi-dimensional data perception layer" (feature input) and the "dual-module dynamic correction layer" (prediction output). It is responsible for achieving high-precision SOH prediction and uncertainty quantification under physical constraints, addressing the problems of "poor generalization with small samples" and "lack of physical interpretation of prediction results" in charging station scenarios. Its core logic includes: bidirectional LSTM temporal modeling, Bayesian parameterization, physical constraint fusion, and hybrid loss function training. The bidirectional LSTM temporal modeling refers to the process of applying the feature sequence output by the multi-dimensional data perception layer. Input the forward LSTM and backward LSTM respectively. The forward LSTM starts from... arrive Sequential processing of sequences, backward LSTM from arrive The hidden states of the two processes are concatenated in reverse order to form the final feature representation. ; The Bayesian parameterization process refers to the modification of the weight parameters of the bidirectional LSTM. Introducing Bayesian prior distribution Approximate the posterior distribution using variational inference methods. Instead of point estimation, the probability distribution of the calculated parameters is used to output a prediction result that includes uncertainty. Assume the loss function is... Optimization based on the lower bound of evidence (ELBO):
[0017] Physical constraint fusion refers to combining the physical characteristics of the battery's state of health (SOH), using 0 ≤ SOH ≤ 100 as a hard constraint, and then using the projected gradient descent method to fusion the predicted results. Map to a reasonable range: 0,min(100 ; The hybrid loss function training involves designing a hybrid loss function that incorporates mean squared error (MSE) and KL divergence. Balancing forecast accuracy with uncertainty estimation:
[0018] The pseudocode for the Bayesian-enhanced PI-LSTM learning layer is as follows: #3.1 Initialization of Bayesian Enhanced PI-LSTM Model (Adapted for Edge Terminals) class PI_LSTM: def __init__(self, model_path="pi_lstm_tflite.tflite"): # Load the lightweight model (TensorFlow Lite format, adapted for edge terminal NPU) self.interpreter = tf.lite.Interpreter(model_path=model_path) self.interpreter.allocate_tensors() self.input_details = self.interpreter.get_input_details() self.output_details = self.interpreter.get_output_details() # Initialize Bayesian uncertainty quantization parameters self.dropout_rate = 0.15 # Original architecture range of 0.1-0.2, take the median value self.mc_samples = 50 # Number of Monte Carlo samplings (quantization uncertainty) # Load pre-trained physical constraint weights (passed from the P2D model) self.phys_weight = 0.3 # In the original mixed loss function, α² = 0.3 # 3.2 Bidirectional LSTM Temporal Feature Extraction (Capturing Historical and Future Trends) def extract_temporal_feat(self, fusion_feat_seq): """ fusion_feat_seq: Input feature sequence, shape=[number of samples, time step (30), number of features (5)] Returns: Temporal fusion features, shape=[number of samples, 256] (256 is the number of hidden layer units, the original architecture ranges from 128 to 256) """ # Forward LSTM: Capturing historical battery degradation trends (such as capacity decay in the first 15 cycles) forward_lstm = layers.LSTM(128, return_sequences=False, kernel_initializer="glorot_normal") # Backward LSTM: Discovering the impact of future operating conditions (such as changes in charge rate over the next 15 cycles) backward_lstm = layers.LSTM(128, return_sequences=False, go_backwards=True, kernel_initializer="glorot_normal") # Bidirectional LSTM stitching: 128 + 128 = 256-dimensional features bidirectional_feat = layers.Bidirectional(forward_lstm, backward_layer=backward_lstm)(fusion_feat_seq) return bidirectional_feat # 3.3 Bayesian parameterization (quantifying uncertainty) def bayesian_quantify(self, temporal_feat): """ temporal_feat: Temporal features output by the bidirectional LSTM, shape=[number of samples, 256] Returns: SOH predicted distribution (mean + standard deviation), used to calculate 95% confidence intervals. """ # Monte Carlo Dropout: Simulating Weight Uncertainty Through Multiple Sampling predictions = [] for _ in range(self.mc_samples): # Add a Dropout layer (enabled during inference to simulate Bayesian weight distribution) dropout_feat = layers.Dropout(self.dropout_rate)(temporal_feat,training=True) # Output layer: SOH prediction (range 0-1) soh_pred = layers.Dense(1, activation="sigmoid")(dropout_feat) predictions.append(soh_pred.numpy()) # Calculate the predicted distribution statistic pred_mean = np.mean(predictions, axis=0) # SOH point estimate pred_std = np.std(predictions, axis=0) # Uncertainty standard deviation # 95% confidence interval: mean ± 1.96 × standard deviation (original architecture coverage ≥ 92%) conf_interval = [pred_mean - 1.96 * pred_std, pred_mean + 1.96 *pred_std] return { "soh_pred": pred_mean, "uncertainty_std": pred_std, "95%_interval": conf_interval } # 3.4 Physically Constrained Fusion (To Avoid Violating Electrochemical Laws) def fuse_phys_constraints(self, bayesian_result, phys_constraints): """ bayesian_result: Bayesian prediction results (including SOH and confidence interval) phys_constraints: Physical constraints (voltage, impedance range) output by the P2D model. Returns: Prediction results after incorporating physical constraints (correcting for out-of-bounds values). """ soh_pred = bayesian_result["soh_pred"] # 1. Voltage-constrained SOH correction: If the current voltage exceeds the P2D constraint range, reduce the SOH confidence level. current_voltage = self.charge_data["voltage"][-1] if not (phys_constraints["voltage"][0] <= current_voltage <= phys_constraints["voltage"][1]): soh_pred *= 0.95 # When the voltage exceeds the limit, the SOH prediction value is reduced by 5% (to suppress unreasonable results). # 2. Uncertainty correction based on impedance constraints: If the current impedance is out of range, expand the confidence interval. current_resistance = self.eis_data["ohmic_resistance"] if not (phys_constraints["ohmic_resistance"][0] <= current_resistance<= phys_constraints["ohmic_resistance"][1]): bayesian_result["uncertainty_std"] *= 1.2 # Uncertainty increases by 20% when impedance exceeds limits. bayesian_result["soh_pred"] = soh_pred return bayesian_result # 3.5 Training with Hybrid Loss Functions (Original Architecture Loss = α1L_data + α2L_phys + α3L_uncert) def train_with_mixed_loss(self, fusion_feat_seq, soh_benchmark, phys_constraints): """ fusion_feat_seq: Input feature sequence soh_benchmark: State of Harm (SOH) benchmark value (calculated from charging capacity) phys_constraints: P2D physics constraints Returns: Trained model parameters """ # Define the hybrid loss function def mixed_loss(y_true, y_pred): # L_data: MSE error (deviation between predicted and baseline values, α1=0.6) l_data = tf.keras.losses.MSE(y_true, y_pred) # L_phys: Physics out-of-bounds penalty (α2=0.3) # Voltage out-of-range penalty: Accumulated loss when the current voltage exceeds the P2D range. current_voltage = self.charge_data["voltage"][-1] voltage_penalty = tf.maximum(0.0, current_voltage - phys_constraints["voltage"][1]) + \ tf.maximum(0.0, phys_constraints["voltage"][0] - current_voltage) # Impedance out-of-bounds penalty: Accumulated loss when the current impedance exceeds the P2D range. current_resistance = self.eis_data["ohmic_resistance"] resistance_penalty = tf.maximum(0.0, current_resistance - phys_constraints["ohmic_resistance"][1]) + \ tf.maximum(0.0, phys_constraints["ohmic_resistance"][0] - current_resistance) l_phys = self.phys_weight * (voltage_penalty + resistance_penalty) # L_uncert: Uncertainty loss (negative log-likelihood, α3=0.1) # Calculating the negative log-likelihood of the predicted distribution based on Monte Carlo sampling mc_predictions = [] for _ in range(10): # Simplify the number of samplings (reduce computational load during training) dropout_feat = layers.Dropout(self.dropout_rate)(self.extract_temporal_feat(fusion_feat_seq), training=True) mc_pred = layers.Dense(1, activation="sigmoid")(dropout_feat) mc_predictions.append(mc_pred) pred_dist = tf.convert_to_tensor(mc_predictions) l_uncert = -tf.reduce_mean(tf.keras.losses.binary_crossentropy(y_true, pred_dist)) # Total loss (α1+α2+α3=1) total_loss = 0.6 * l_data + 0.3 * l_phys + 0.1 * l_uncert return total_loss # Compile and train the model (adapting to edge terminal computing power, using mini-batch training) model = tf.keras.Sequential([ layers.Input(shape=(30, 5)), # Time step 30, number of features 5 layers.Bidirectional(layers.LSTM(128)), layers.Dropout(self.dropout_rate), layers.Dense(1, activation="sigmoid") ]) model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=3e-4), # Original architecture range 1e-4~5e-4) loss = mixed_loss # Training (Charging station scenario: update the model every 10 cycles, batch size 8) model.fit(fusion_feat_seq, soh_benchmark, batch_size=8, epochs=5, verbose=0) # Save the lightweight model (TensorFlow Lite format for edge terminal inference) converter = tf.lite.TFLiteConverter.from_keras_model(model) tflite_model = converter.convert() with open("pi_lstm_tflite.tflite", "wb") as f: f.write(tflite_model) return model.get_weights() # 3.6 Core Inference Interface (provides SOH prediction and uncertainty output to external parties) def predict(self, fusion_feat_seq): """ fusion_feat_seq: Input feature sequence (from the multi-dimensional data perception layer) Returns: soh_pred (point estimate), uncertainty (95% confidence interval) """ # Input data preprocessing (matching the model input format) input_data = np.array(fusion_feat_seq, dtype=np.float32) input_data = np.expand_dims(input_data, axis=0) # Add batch dimension # Model Inference self.interpreter.set_tensor(self.input_details[0]['index'], input_data) self.interpreter.invoke() # Output Analysis soh_pred = self.interpreter.get_tensor(self.output_details[0]['index'])[0][0] # Call the Bayesian quantization interface to obtain the uncertainty. temporal_feat = self.extract_temporal_feat(input_data) bayesian_result = self.bayesian_quantify(temporal_feat) return soh_pred, bayesian_result["95%_interval"] The corresponding dual-module dynamic correction layer is a key link connecting the "Bayesian-enhanced PI-LSTM learning layer" (predicting input) and the "full-process iterative optimization layer" (data feedback), and it primarily solves two types of problems: (1) Physical constraint violation correction: When the SOH prediction result output by PI-LSTM violates the physical laws of the P2D mechanism model (such as impedance out of range, voltage abnormality), the prediction value is corrected in reverse by the mechanism model; (2) Optimization of high uncertainty results: When the width of the 95% confidence interval of the PI-LSTM output exceeds the threshold (>5%), additional data acquisition is triggered (such as shortening the EIS acquisition cycle) to regenerate high-precision prediction results; the final output is made to meet the SOH evaluation value of "accuracy ≤0.75% and cross-condition error ≤3%" to provide reliable historical data for subsequent optimization layers.
[0019] The pseudocode for the dual-module dynamic correction layer is as follows: # Independent class for dual-module dynamic correction layer (no dependency on federation / optimization layer, only interfaces with P2D and PI-LSTM) class DYNAMIC_CORRECT_MODULE: def __init__(self, eis_module, fusion_weight=0.7, uncertainty_thresh=0.05): """ Args: eis_module: EIS data acquisition module (used to trigger additional data acquisition). fusion_weight: The fusion weight between the PI-LSTM predictions and the mechanistic model estimates (PI-LSTM ratio, original architecture 7:3). uncertainty_thresh: Confidence interval width threshold (>5% triggers correction, original architecture setting) """ self.eis_module = eis_module # Associate EIS acquisition module self.fusion_weight = fusion_weight # 0.7 (PI-LSTM weights), 1 - fusion weights are the mechanistic model weights (0.3). self.uncertainty_thresh = uncertainty_thresh # 0.05 (5%) self.default_eis_cycle = eis_module.get_collect_cycle() # Original EIS collection cycle (e.g., 30 minutes) self.correction_count = 0 # Correction count (used for subsequent optimization layer analysis) # 1. Physical constraint violation detection (one of the core dual modules: mechanism model constraint verification) def check_phys_constraint_violation(self, soh_pred, phys_constraints,real_time_data): """ Detecting whether PI-LSTM prediction results violate the physical constraints of the P2D mechanism model Args: soh_pred: The SOH point estimate output by the PI-LSTM phys_constraints: Physical constraints (voltage / impedance / capacitance range) output by the P2D model. real_time_data: Real-time acquired data (current voltage, impedance) Returns: is_violate: Whether the constraint is violated (True / False) violation_type: Type of violation (voltage / resistance / capacity / None) """ current_voltage = real_time_data["voltage"] current_resistance = real_time_data["ohmic_resistance"] current_capacity = real_time_data["capacity"] rated_capacity = real_time_data["rated_capacity"] # Voltage constraint detection (e.g., ternary lithium 3.0~4.2V) if not (phys_constraints["voltage"][0] <= current_voltage <= phys_constraints["voltage"][1]): return True, "voltage" # Impedance constraint testing (e.g., ohmic resistance 50~200mΩ) if not (phys_constraints["ohmic_resistance"][0] <= current_resistance<= phys_constraints["ohmic_resistance"][1]): return True, "resistance" # Capacity constraint test (SOH corresponds to a capacity ≤ 101% of the rated capacity, to avoid measurement error) predicted_capacity = soh_pred * rated_capacity if not (predicted_capacity <= rated_capacity * 1.01): return True, "capacity" # Unconstrained violation return False, "None" # 2. Uncertainty Verification (Second of the Core Dual Modules: Confidence Interval Analysis) def check_uncertainty(self, conf_interval): """ Verify whether the 95% confidence interval of the PI-LSTM output exceeds the threshold. Args: conf_interval: The confidence interval ([lower bound, upper bound]) of the PI-LSTM output. Returns: is_over_thresh: Whether the threshold has been exceeded (True / False) interval_width: Confidence interval width """ interval_width = conf_interval[1] - conf_interval[0] return interval_width > self.uncertainty_thresh, interval_width # 3. Constraint Violation Correction: Recalculating SOH based on the P2D mechanism model def correct_constraint_violation(self, violation_type, phys_constraints, real_time_data, p2d_module): """ For different constraint violation types, the reasonable SOH is derived in reverse through the P2D model. Args: violation_type: Type of violation (voltage / resistance / capacity) phys_constraints: P2D physics constraints real_time_data: Real-time data p2d_module: P2D mechanism model module Returns: corrected_soh: Corrected SOH value """ rated_capacity = real_time_data["rated_capacity"] # Voltage Violation: Inverse SOH Derivation from Voltage-Capacity Curves Based on P2D Model if violation_type == "voltage": current_voltage = real_time_data["voltage"] # The P2D model provides a voltage-to-capacity mapping function. predicted_capacity = p2d_module.voltage_to_capacity(current_voltage) corrected_soh = predicted_capacity / rated_capacity # Impedance violation: Inverse calculation of SOH based on the impedance-degradation factor relationship of the P2D model elif violation_type == "resistance": current_resistance = real_time_data["ohmic_resistance"] # P2D model calculates active material loss rate using impedance. active_loss_rate = p2d_module.resistance_to_active_loss(current_resistance) corrected_soh = 1 - active_loss_rate # Capacity violation: Corrected directly based on the rated capacity limit elif violation_type == "capacity": corrected_soh = (rated_capacity * 1.01) / rated_capacity # Corrected to 1.01 (i.e., 101%, to avoid exceeding the limit) # Ensure SOH is within a reasonable range (0.5~1.0, excluding outliers) corrected_soh = max(0.5, min(1.0, corrected_soh)) return corrected_soh # 4. High Uncertainty Correction: Trigger Additional EIS Data Acquisition + Re-prediction def correct_high_uncertainty(self, fusion_feat, pi_lstm_module, p2d_module, real_time_data): """ Shorten the EIS acquisition cycle and re-predict SOH after supplementing with high signal-to-noise ratio features. Args: fusion_feat: Original feature matrix (used to supplement EIS features) pi_lstm_module: PI-LSTM module p2d_module: P2D module real_time_data: Real-time data Returns: corrected_soh: Corrected SOH value new_conf_interval: New confidence interval """ # Step 1: Shorten the EIS acquisition cycle (e.g., from 30 minutes to 10 minutes) self.eis_module.set_collect_cycle(self.default_eis_cycle / / 3) # Step 2: Collect additional EIS data extra_eis_data = self.eis_module.get_eis_data(force_collect=True) # Step 3: Add EIS features to the original feature matrix fusion_feat_with_eis = self._supplement_eis_feat(fusion_feat, extra_eis_data) # Step 4: Re-predict using PI-LSTM new_soh_pred, new_conf_interval = pi_lstm_module.predict(fusion_feat_with_eis) # Step 5: Use a P2D model for weighted fusion (maintaining a 7:3 weight ratio) p2d_soh = p2d_module.calculate_soh(real_time_data["ohmic_resistance"]) corrected_soh = self.fusion_weight * new_soh_pred + (1 - self.fusion_weight) * p2d_soh # Step 6: Restore the original EIS acquisition cycle (to avoid consuming computing power due to long-term high-frequency acquisition) self.eis_module.set_collect_cycle(self.default_eis_cycle) return corrected_soh, new_conf_interval # Auxiliary function: supplement EIS features to the original feature matrix def _supplement_eis_feat(self, fusion_feat, eis_data): "Add additional EIS data (ohmic resistance, charge transfer resistance) to the last column of the feature matrix." # fusion_feat shape: [time step (30), original number of features (4)] → after padding to [30, 6] eis_feat = np.array([[eis_data["ohmic_resistance"], eis_data["charge_transfer_resistance"]]] * fusion_feat.shape[0]) return np.hstack([fusion_feat, eis_feat]) # 5. Core Calibration Interface: Integrates all calibration logic def correct(self, soh_pred, conf_interval, phys_constraints, real_time_data, p2d_module, pi_lstm_module, fusion_feat): """ The core calibration interface provided to external parties integrates constraint detection, uncertainty verification, and correction logic. Args: soh_pred: The SOH point estimate output by the PI-LSTM conf_interval: The 95% confidence interval of the PI-LSTM output. phys_constraints: Physical constraints output by the P2D model real_time_data: Real-time acquired data (voltage / impedance / capacity / rated capacity) p2d_module: P2D mechanism model module pi_lstm_module: PI-LSTM learning layer module fusion_feat: The feature matrix of the PI-LSTM input (used to supplement EIS in cases of high uncertainty). Returns: is_valid: Whether the original prediction is valid (True if no correction was triggered, False if correction was triggered). final_soh: The final corrected SOH value final_conf_interval: Final confidence interval correction_info: Correction information (type / number of corrections, for optimization layer analysis) """ # Initialize return value is_valid = True final_soh = soh_pred final_conf_interval = conf_interval correction_info = {"type": "none", "count": self.correction_count} # 1. First check for violations of physical constraints constraint_violate, violation_type = self.check_phys_constraint_violation(soh_pred, phys_constraints, real_time_data) if constraint_violate: # Triggering constraint violation correction final_soh = self.correct_constraint_violation(violation_type, phys_constraints, real_time_data, p2d_module) is_valid = False self.correction_count += 1 correction_info["type"] = f"constraint_{violation_type}" correction_info["count"] = self.correction_count # When constraints are violated, the confidence interval is directly adopted from the theoretical interval of the P2D model (which is more reliable). final_conf_interval = [final_soh - 0.02, final_soh + 0.02] # ±2% interval # 2. Re-verify uncertainty (verification is required regardless of whether constraints are violated). uncertainty_over, interval_width = self.check_uncertainty(conf_interval) if uncertainty_over: # Triggering high uncertainty correction final_soh, final_conf_interval = self.correct_high_uncertainty( fusion_feat, pi_lstm_module, p2d_module, real_time_data ) is_valid = False self.correction_count += 1 correction_info["type"] = f"uncertainty_width_{interval_width:.3f}" correction_info["count"] = self.correction_count return is_valid, final_soh, final_conf_interval, correction_info # 6. External Interface: Update Fusion Weights (Receive parameter adjustments from the optimization layer) def set_fusion_weight(self, new_weight): """ Receive new fusion weights from the full-process iterative optimization layer (e.g., adjust from 0.7 to 0.65 after optimization). Args: new_weight: New PI-LSTM weights (range 0.5~0.8, to ensure reasonable weights for the mechanistic model) """ self.fusion_weight = max(0.5, min(0.8, new_weight)) # 7. External Interface: Obtain calibration statistics (for the optimization layer to analyze patterns). def get_correction_stats(self, cycle_num): """ Output correction statistics to be used in the full-process iterative optimization layer to mine association rules (such as "low temperature → high correction count"). Returns: stats: Corrected statistical dictionary """ return { "cycle_num": cycle_num, "total_correction_count": self.correction_count, "fusion_weight": self.fusion_weight, "default_eis_cycle": self.default_eis_cycle, "uncertainty_thresh": self.uncertainty_thresh } Corresponding to the full-process iterative optimization layer and federated learning, the full-process iterative optimization layer of each edge terminal first completes "association rule mining → parameter optimization" based on local historical data to generate "local optimization parameters"; the federated server collects the "local optimization parameters" of all terminals, weights and merges them according to the terminal evaluation accuracy to generate "global optimization parameters"; the federated server distributes the "global optimization parameters" to all terminals, each terminal updates the parameters of the first four layers, and at the same time, the optimization layer adjusts the local rule mining strategy based on the global parameters to form a closed loop.
[0020] The pseudocode for the full-process iterative optimization layer and federated learning is as follows: #Federated - Integrated Optimization Module (Integrating end-to-end iterative optimization with federated learning) class FED_OPTIMIZER: def __init__(self, terminal_id, fed_server_addr, rl_model_path="lightweight_rl.tflite", optimize_cycle=100): # 1. Basic configuration of the federated client (interfacing with the federated server) self.terminal_id = terminal_id # Unique identifier for the terminal (3 terminals in the charging station: 0 / 1 / 2) self.fed_server = self.connect_fed_server(fed_server_addr) # Connect to the federated server self.fed_round = 0 # Fed rounds (1 round every 100 cycles, synchronized with the optimization cycle) # 2. Core configuration of the full-process iterative optimization layer (retaining the original optimization logic) self.rl_interpreter = tf.lite.Interpreter(model_path=rl_model_path) self.rl_interpreter.allocate_tensors() self.rl_input = self.rl_interpreter.get_input_details() self.rl_output = self.rl_interpreter.get_output_details() self.optimize_cycle = optimize_cycle self.history_cache = [] # Local historical data cache (supporting rule mining) # 3. Parameters to be optimized (initial values are consistent with the original architecture, and will be synchronized from the federated server later) self.global_params = { "data_sense": {"eis_collect_cycle": 1800, "spearman_thresh": 0.85}, "p2d_model": {"ncm_active_loss": 0.0002, "lfp_active_loss": 0.0001}, "pi_lstm": {"hidden_units": 128, "dropout_rate": 0.15}, "dynamic_correct": {"fusion_weight": 0.7} } # 1. Federated Server Connection (Basic Communication Functions) def connect_fed_server(self, addr): "Simulated connection to the charging station's federated server, actually using MQTT / HTTP communication." print(f"Terminal {self.terminal_id} connects to the federated server: {addr}") return {"addr": addr, "connected": True} # 2. Local end-to-end optimization (original core logic of the optimization layer, used as federated input) def local_optimize(self): """ Step 1: Local Association Rule Mining (Based on Historical Cache) Step 2: Local parameter optimization (based on rule + RL model) Output: Local optimization parameters (for federated upload) """ # 2.1 Local Association Rule Mining (Consistent with the original optimization layer logic) if len(self.history_cache) < self.optimize_cycle: return self.global_params # Returns the current global parameters when data is insufficient cycle_data = [] for item in self.history_cache: cycle_data.append({ "temp": item["env_temp"], "c_rate": item["charge_rate"], "battery_type": item["battery_type"], "soh_error": item["soh_error"], "constraint_violate": item["constraint_violate"], "uncertainty_width": item["uncertainty_width"] }) # Discover local rules (adapt to the operating conditions of the region where the terminal is located, such as terminal 0 being responsible for the fast charging zone and having many high-rate scenarios). rules = [] # Rule 1: Fast charging zone (terminal 0) high rate (>2C) → increased error if self.terminal_id == 0: high_rate_count = 0 high_rate_error_count = 0 for data in cycle_data: if data["c_rate"] > 2: high_rate_count += 1 if data["soh_error"] > 0.012: high_rate_error_count += 1 if high_rate_count > 12 and (high_rate_error_count / high_rate_count)> 0.65: rules.append({ "condition": "charge_rate>2C (Fast Charging Zone)", "suggestion": "EIS acquisition cycle changed from 30 minutes to 15 minutes (1800 seconds to 900 seconds)." }) # Rule 2: Slow charging zone (terminal 1 / 2) old battery (cycle > 1000) → Constraint violation if self.terminal_id in [1, 2]: old_battery_count = 0 old_battery_violate_count = 0 for data in cycle_data: if data["cycle_num"] > 1000: old_battery_count += 1 if data["constraint_violate"] > 0: old_battery_violate_count += 1 if old_battery_count > 9 and (old_battery_violate_count / old_battery_count) > 0.7: rules.append({ "condition": "cycle_num>1000 (old batteries in slow charging zone)", "suggestion": "The loss rate of ternary lithium active material decreased from 0.02% to 0.022% per cycle." }) # 2.2 Parameter Optimization Based on Local Rules (RL Model Assistance) local_params = self.global_params.copy() for rule in rules: if "charge_rate>2C" in rule["condition"]: # RL model calculates the optimal EIS period (input: current period 1800 seconds, multiplier 2C) self.rl_interpreter.set_tensor(self.rl_input[0]['index'], np.array([[2, 1800]], dtype=np.float32)) self.rl_interpreter.invoke() optimal_cycle = self.rl_interpreter.get_tensor(self.rl_output[0]['index'])[0][0] local_params["data_sense"]["eis_collect_cycle"] = int(optimal_cycle)# Output≈900 seconds if "cycle_num>1000" in rule["condition"]: local_params["p2d_model"]["ncm_active_loss"] = 0.00022 # 0.022% / loop # 2.3 Optimizing LSTM Parameters Based on Local Uncertainty avg_uncertainty = np.mean([item["uncertainty_width"] for item inself.history_cache]) if avg_uncertainty > 0.065: local_params["pi_lstm"]["dropout_rate"] = max(0.1, local_params["pi_lstm"]["dropout_rate"] - 0.03) return local_params # 3. Federation Global Optimization (Core Fusion Component: Local Parameters → Global Parameters) def fed_global_optimize(self): """ Step 1: Upload local optimization parameters to the federated server Step 2: Weighted Fusion by Federated Server (by Terminal Accuracy) Step 3: Download global optimization parameters to local machine Output: Global optimization parameters (update local parameters) """ # 3.1 Upload local optimization parameters local_params = self.local_optimize() self.fed_server["upload"](terminal_id=self.terminal_id, params=local_params, acc=self.get_local_accuracy()) # 3.2 Waiting for Federation Server Merging (simulating synchronous waiting, but actually asynchronous communication) import time time.sleep(5) # Wait for other terminals to upload parameters # 3.3 Download global optimization parameters (Federal server based on FedAvgV3 fusion) global_params = self.fed_server["download"](terminal_id=self.terminal_id, round=self.fed_round) self.global_params = global_params self.fed_round += 1 # Increase the number of federation rounds by 1 return global_params # 4. Local parameter application and feedback (optimization layer → first four layers) def apply_optimized_params(self, data_sense_module, p2d_module, pi_lstm_module, dynamic_correct_module): """Apply global optimization parameters to the first four layers of modules""" # 4.1 Data Awareness Layer: Update EIS Acquisition Cycle and Feature Filtering Thresholds data_sense_module.set_eis_cycle(self.global_params["data_sense"]["eis_collect_cycle"]) data_sense_module.set_spearman_thresh(self.global_params["data_sense"]["spearman_thresh"]) # 4.2 Mechanism Modeling Layer: Updating the Loss Rate of Active Materials p2d_module.update_active_loss_rate( ncm_rate=self.global_params["p2d_model"]["ncm_active_loss"], lfp_rate=self.global_params["p2d_model"]["lfp_active_loss"] ) # 4.3 PI-LSTM Layer: Update the number of hidden units and dropout rate (requires model reloading to take effect) pi_lstm_module.update_hidden_units(self.global_params["pi_lstm"]["hidden_units"]) pi_lstm_module.update_dropout_rate(self.global_params["pi_lstm"]["dropout_rate"]) # 4.4 Dynamic Correction Layer: Updating Fusion Weights dynamic_correct_module.set_fusion_weight(self.global_params["dynamic_correct"]["fusion_weight"]) # 4.5 Feedback: Update the rule mining strategy of the local optimization layer (based on global parameter adaptation) self.adjust_rule_strategy() # 5. Accessibility Features: Local accuracy calculation (for federated weighting) def get_local_accuracy(self): """Calculate the accuracy of local terminal SOH assessment (error ≤ 0.75% is considered accurate)"" if len(self.history_cache) < 50: return 0.85 # Returns the default accuracy when data is insufficient. accurate_count = sum(1 for item in self.history_cache if item["soh_error"] <= 0.0075) return accurate_count / len(self.history_cache) # 6. Accessibility Features: Adjusting local rule mining strategies (based on global parameters) def adjust_rule_strategy(self): "If the EIS period in the global parameters has been shortened, then the weight of the 'period-related' condition should be reduced during rule mining." current_eis_cycle = self.global_params["data_sense"]["eis_collect_cycle"] if current_eis_cycle <= 900: # If the global interval is already set to 15 minutes, the "shorten cycle" rule will not be searched locally. self.rule_weight["eis_cycle_rule"] = 0.1 else: self.rule_weight["eis_cycle_rule"] = 0.5 # 7. External Interface: Add historical data (supports local optimization) def add_history_data(self, cycle_item): if len(self.history_cache) >= self.optimize_cycle: self.history_cache.pop(0) self.history_cache.append(cycle_item) # 8. Federated Optimization Trigger Interface (Synchronized with Charging Cycle) def trigger_fed_optimize(self, data_sense_module, p2d_module, pi_lstm_module, dynamic_correct_module): "The federated-optimized integrated process is triggered once every 100 cycles." if len(self.history_cache) % self.optimize_cycle != 0: return {"status": "not_ready", "params": self.global_params} # Perform federal global optimization global_params = self.fed_global_optimize() # Apply optimization parameters to the first four layers self.apply_optimized_params(data_sense_module, p2d_module, pi_lstm_module, dynamic_correct_module) return {"status": "success", "params": global_params} This embodiment (electric vehicle core business district charging station scenario) has been running continuously for 120 hours (covering 500+ charging cycles and 300+ different vehicle models, including mainstream ternary lithium / lithium iron phosphate battery types). Its core performance closely aligns with the original architecture's goals of "high precision, strong generalization, self-optimization, and easy deployment": (1) Multi-dimensional data perception effect: Through sliding window time series feature extraction and Spearman correlation screening (threshold ≥ 0.85), power grid fluctuations and sensor noise interference are effectively eliminated, and the feature processing accuracy reaches 99.2%; EIS data is periodically collected (default 30 minutes / time, dynamically shortened to 10 minutes / time when abnormal), providing high signal-to-noise ratio input for subsequent modeling. Compared with the traditional unscreened data scheme, the redundancy of model input features is reduced by 40%; (2) P2D mechanism modeling effect: Dynamic calibration of core parameters for two types of batteries (ternary lithium diffusion coefficient 1×10) -14 ~5×10 -13 m 2 / s, lithium iron phosphate reaction rate constant 1×10 -8 ~1×10 -6 m / s), the error between the model output voltage curve and the measured value is ≤2%; after embedding the degradation factor, the contribution of "active material loss" and "lithium ion loss" to SOH can be accurately quantified (e.g., lithium ion loss of 5%~8% after 1000 cycles of ternary lithium), and the physical constraint boundary coverage reaches 98.5%, avoiding the problem of "violation of electrochemical laws" in pure data models. (3) Bayesian enhancement of PI-LSTM prediction performance: Bidirectional LSTM captures time series trends (128-256 hidden layer units), combined with Monte Carlo Dropout to quantify uncertainty, SOH point estimation error ≤0.75%, 95% confidence interval coverage ≥92%; under cross-condition scenarios (temperature -20℃~45℃, multiplier 0.2C-2C), the evaluation error ≤3%, which is significantly improved compared with the pure LSTM model (cross-condition error 8%+), and the error is significantly reduced in small sample scenarios (≤50 cycle data); (4) Dual-module dynamic correction effect: Through the dual logic of "physical constraint violation detection + high uncertainty correction", the initial prediction of PI-LSTM is iteratively optimized, and the constraint violation correction rate reaches 100% (such as when the impedance is out of range, the SOH is derived in reverse based on P2D). After correction, the final SOH evaluation error is stable at ≤0.75%, which is 20% more accurate than the uncorrected scheme. (5) Federated-full-process optimization effect: The generalization ability of the three terminals (1 in the fast charging zone and 2 in the slow charging zone) through FedAvgV3 collaborative parameters is significantly improved; the parameters of the first four layers are automatically optimized every 100 cycles (such as the EIS cycle of the fast charging zone from 30 minutes to 15 minutes, and the PI-LSTM dropout rate from 0.15 to 0.12), and the evaluation accuracy fluctuation within 120 hours is ≤ ±0.3%, without the need for manual parameter tuning. The operation and maintenance cycle is extended from 1 month to 3 months, and the operation and maintenance cost is significantly reduced. This embodiment focuses on the SOH assessment task of the entire life cycle of power batteries, and adopts a five-layer architecture of "multi-dimensional data perception → P2D electrochemical mechanism modeling → Bayesian enhanced PI-LSTM learning → dual-module dynamic correction → federated full-process optimization". This solution successfully achieves localized deployment at the edge terminal (single-cycle processing ≤200ms, power consumption ≤8W), which not only solves the pain points of poor generalization and weak cross-operating condition adaptability of traditional methods, but also reduces operation and maintenance costs through self-optimization mechanism, providing a standardized and high-precision technical solution for battery health management in scenarios such as new energy vehicle charging stations and energy storage power stations.
[0021] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A battery health assessment method based on LSTM and electrochemical mechanism models, characterized in that, Includes the following steps: S1. Collect multi-dimensional operational data of the power battery throughout its entire life cycle. The data includes time-series electrical parameter data such as charging / discharging voltage, current, and charge / discharge capacity; physical state data such as battery surface temperature, ambient temperature, charge / discharge rate, and periodic electrochemical impedance spectroscopy (EIS) data; and construct a time-series-mechanism fusion feature matrix through feature engineering: extract time-series features using a sliding window and difference method; use Spearman's rank correlation coefficient to screen EIS mechanism features with a correlation ≥ 0.85; standardize the two types of features and then concatenate them to generate the fusion feature matrix; and simultaneously label the actual capacity under the corresponding cycle to determine the SOH baseline value. S2. Construct a pseudo-two-dimensional P2D electrochemical mechanism model. Based on the initial charge-discharge experimental data of the new battery, use the least squares method to calibrate core parameters such as the diffusion coefficient of the positive / negative electrode and the reaction rate constant, so that the error between the model output voltage curve and the measured value is ≤2%. Embed the capacity decay dynamic equation, quantify the loss of active material and lithium-ion loss into model state variables, establish the analytical relationship between the degradation factor and the terminal voltage and impedance parameters, and the physical constraint boundary of the reasonable range of output voltage, the theoretical range of impedance, and the monotonic characteristics of capacity decay. S3. Design a Bayesian-enhanced Physically Constrained LSTM (PI-LSTM) network. Input the fused feature matrix described in step S1 and the physical constraint boundary described in step S2 into the network. Use a bidirectional LSTM structure to capture the temporal degradation trend. Implement uncertainty quantification through a Bayesian parameterization module layer. Construct a hybrid objective function containing data loss MSE, physical loss constraint violation penalty, and uncertainty loss negative log-likelihood. Iteratively train the Adam optimizer until the loss converges and output the preliminary SOH prediction results, including the predicted value, log-variance, and posterior parameter statistics. S4. Activate the dual-module dynamic correction mechanism: Input the preliminary SOH prediction result described in step S3 into the electrochemical mechanism model described in step S2 to detect whether there is a violation of physical constraints. If so, adaptively adjust the model parameters and update the constraint boundaries, and feed them back to the PI-LSTM network for secondary training. Based on the 95% confidence interval of the Bayesian output, combined with the estimated value of the degradation factor of the mechanism model, a weighted fusion strategy is used to generate the final SOH evaluation result. When the confidence interval width is >5%, additional feature acquisition and model update are triggered. S5. Outputs a power battery health assessment report, including SOH value, accuracy ±0.75%, 95% confidence interval, and contribution analysis of key degradation factors. Simultaneously, it inputs historical assessment data into the model optimization module, dynamically adjusting the PI-LSTM network hyperparameters, including the number of hidden layer units, learning rate, and weight coefficients of the hybrid loss function, using an improved "crayfish" algorithm. , , It enables continuous optimization of evaluation accuracy throughout the entire life cycle and is compatible with mainstream battery types such as ternary lithium and lithium iron phosphate.
2. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, In step S1, the sampling frequency of the electrical parameter time series data is ≥1Hz, the electrochemical impedance spectroscopy (EIS) data is collected once every 50 cycles, and the time-mechanism fusion feature matrix generated after feature engineering has the dimension of [number of samples, time step, feature dimension]. The time step is determined to be 30-50 cycles through cross-validation, and the feature dimension is controlled at 20-35 dimensions to balance model accuracy and computational efficiency.
3. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, In step S2, the core parameter calibration process of the pseudo-two-dimensional P2D electrochemical mechanism model requires the simultaneous collection of experimental data at three charge-discharge rates of 0.5C, 1C, and 2C to ensure the predictive stability of the model over a wide operating range. After calibration, the model's estimation error for ohmic resistance and charge transfer resistance should be ≤5%.
4. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, In step S3, the number of hidden layer units in the Bayesian-enhanced PI-LSTM network is optimized to 128-256 using the improved crayfish algorithm, and the dropout probability of the Monte Carlo Dropout layer is set to 0.1-0.
2. The batch size for the mixed objective function training process is set to 32-64, and the iteration count is stopped when the loss function fluctuation is <0.001 for 10 consecutive rounds.
5. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, The dual-module dynamic correction mechanism in step S4 uses the following criteria to determine whether physical constraints are violated: the predicted voltage exceeds the output range of the mechanism model by ±5%, and the predicted impedance exceeds the theoretical range by ±10%. In the weighted fusion strategy, the weight ratio of the PI-LSTM prediction result to the mechanism model estimate is 7:3, and the cross-condition error of the SOH evaluation result after correction is ≤3%.
6. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, The degradation factor contribution analysis output in step S5 uses SHAP (Shapley Additive Ex Planations) to quantify the proportion of each degradation factor's influence on SOH decay. This can accurately identify the dominant factors with the greatest impact on SOH among "active material loss", "lithium ion loss" and "resistance growth", with an error of ≤2%.
7. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, The model optimization module in step S5 uses the improved crayfish algorithm to optimize the PI-LSTM hyperparameters once every 100 cycles. The optimization objective is to minimize the root mean square error of the SOH evaluation RMSE. After optimization, the inference latency of the network is ≤10ms, which can be deployed in the vehicle battery management system (BMS).
8. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, With training data of ≤50 cycles in a small sample scenario, the SOH evaluation error of the PI-LSTM network can still be controlled to ≤3% through the physical prior constraints provided by the electrochemical mechanism model. Compared with the small sample error of ≥8% of the pure LSTM model, it is reduced by more than 60%, which is suitable for the health assessment needs of new batteries in the early stage.
9. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, For the SOH assessment of ternary lithium batteries, the assessment accuracy fluctuates by less than 2% within an ambient temperature range of -20℃ to 45℃; for the SOH assessment of lithium iron phosphate batteries, the assessment accuracy can still maintain ±0.75% even when SOH ≤ 80% in the later stages of cycle life, making it suitable for the full life cycle management of different types of power batteries.
10. The battery health assessment method based on LSTM and electrochemical mechanism model according to claim 1, characterized in that, In small-sample scenarios, the model training process does not require the collection of a large amount of additional cyclic data. Only the initial physicochemical data of the new battery at the time of manufacture, material particle size, porosity, initial capacity, and a small amount of cyclic data (≤50 cycles) are needed to complete the model adaptation. The adaptation cycle is ≤24 hours, reducing the deployment cost of new battery health assessment.