A vehicle-end privacy protection-oriented power battery cloud-edge collaborative health prediction method
Patent Information
- Application Number
- CN202611090418.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-08-18
AI Technical Summary
[0006]发明目的: 针对现有车载锂电池SOH预测方法在多源实车场景下面临长时序退化依赖、高频噪声影响、数据非独立同分布、数据隐私和安全要求限制等问题,本发明提供一种面向车端隐私保护的动力电池云边协同健康预测方法,在保护数据隐私的前提下实现多源异构数据的协同建模,提高复杂工况下SOH预测的准确性、高效性和鲁棒性
[0022] Beneficial effects: First, this invention extracts multi-dimensional health features such as incremental capacity curve features, incremental slope curve features, and auxiliary statistical features, and combines them with empirical mode decomposition to smooth the capacity degradation trajectory, which can more stably characterize the battery degradation state and improve the reliability of health state prediction. Second, this invention uses the Mamba model for modeling, which can effectively capture the long-term dependencies in the battery degradation process and reduce the computational complexity to linear. By establishing a global information interaction mechanism through the Agent Attention module, the model can fully explore the correlation information between different degradation features, improving computational efficiency while maintaining the ability to learn global degradation patterns. Third, this invention combines time-frequency information through a frequency-domain enhanced channel attention mechanism, improving the model's ability to identify noise and non-stationary degradation signals in complex operating conditions, and enhancing the accuracy and robustness of prediction results. Fourth, this invention constructs a federated learning training framework to achieve collaborative modeling of multi-source heterogeneous real vehicle data without sharing original vehicle data, effectively solving the problems of data privacy protection and data silos. Fifth, this invention utilizes an adaptive aggregation weight optimization strategy to enable the global model update direction to better take into account the update information of different clients, suppressing client drift caused by heterogeneous data and improving the convergence and generalization of the global model. Sixth, based on the obtained point prediction results, this invention introduces an error quantification conformal inference method to quantify the uncertainty of the prediction results, reflecting the credibility of the prediction results under complex real vehicle operating conditions, and improving the safety and interpretability of the prediction results. Seventh, this invention can achieve high-precision prediction and evaluation of the health status of power batteries under complex real vehicle operating conditions, providing reliable technical support for health monitoring, life prediction, safety early warning, and operation and maintenance decision-making in the battery management system of new energy vehicles.
Smart Images

Figure CN122594829A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle-mounted lithium battery health status prediction technology, specifically to a cloud-edge collaborative health prediction method for power batteries with a focus on protecting vehicle-side privacy. Background Technology
[0002] Lithium-ion batteries, with their advantages of high energy density, long cycle life, and environmental friendliness, have become the primary energy storage device for new energy vehicles. As a core component of new energy vehicles, the health status of the battery directly affects the vehicle's range, operational safety, and lifespan. Therefore, accurately assessing and predicting the State of Health (SOH) of the battery is crucial for the Battery Management System (BMS).
[0003] Existing SOH prediction methods mainly include model-based methods and data-driven methods. The former primarily involves electrochemical models and equivalent circuit models, which have high computational complexity and rely on accurate parameter measurements, making them difficult to adapt to the complex operating conditions in real-world vehicles. The latter can learn battery degradation patterns from massive amounts of data without requiring prior knowledge of the battery's internal workings. The battery capacity degradation process in real-world vehicle conditions is often lengthy and exhibits significant fluctuations, placing higher demands on the time modeling capabilities, computational efficiency, and model robustness of data-driven methods.
[0004] Modern battery systems often face the problem of data silos. Data from a single battery system is usually insufficient to train a model with strong generalization capabilities. Federated learning enables collaborative modeling across multiple clients without sharing raw data, providing an effective solution to data silos and data privacy issues. However, in reality, multi-source data from different vehicle models, battery systems, and operating environments typically exhibit non-independent and identically distributed characteristics. Differences in data distribution between different clients can easily lead to client drift, making it difficult for the global model to converge stably.
[0005] Therefore, there is still a need for an onboard lithium battery SOH prediction technology that can efficiently model long-term degradation characteristics and collaboratively train multi-source heterogeneous real vehicle data, in order to improve the accuracy and generalization ability of battery SOH prediction under complex real-world operating conditions. Summary of the Invention
[0006] Purpose of the invention: To address the problems faced by existing onboard lithium battery SOH prediction methods in multi-source real-world vehicle scenarios, such as long-term degradation dependence, high-frequency noise influence, non-independent and identically distributed data, and limitations imposed by data privacy and security requirements, this invention provides a cloud-edge collaborative health prediction method for power batteries with vehicle-side privacy protection. This method achieves collaborative modeling of multi-source heterogeneous data while protecting data privacy, thereby improving the accuracy, efficiency, and robustness of SOH prediction under complex operating conditions.
[0007] Technical solution: The present invention provides a cloud-edge collaborative health prediction method for power batteries with vehicle-side privacy protection, comprising:
[0008] Step 1: Obtain battery charging and discharging data generated by multiple vehicle clients during actual operation, divide the data into cycles according to the charging and discharging process and obtain the battery capacity of each cycle; smooth the battery capacity to construct a health status label, and extract multi-dimensional health features that characterize the battery degradation state from the charging and discharging data.
[0009] Step 2: Using a sliding time window, multidimensional health features and health status information from multiple historical periods are used as input, and health status information from future periods is used as prediction labels to construct prediction samples;
[0010] Step 3: Input the predicted samples into the prediction network. The prediction network uses the Mamba module to model long-term temporal dependencies and the Agent Attention module to establish global feature interaction relationships. The Mamba module and the Agent Attention module are interleaved and connected to construct a temporal prediction link. Finally, the frequency domain enhancement channel attention mechanism is combined to mine frequency domain information related to degradation and output the health status prediction result.
[0011] Step 4: Construct a federated learning framework. Each client independently trains the prediction network using local data and only uploads the model parameters and update information to the server. The server constructs client vectors based on the update direction of each client's model and dynamically calculates the aggregation weights of each client through an adaptive weight optimization strategy, ensuring that the update direction of the global model obtained by weighted aggregation is consistent with the update direction of each client. The server performs weighted aggregation on the model parameters of each client based on the aggregation weights to obtain the global model, and distributes the updated global model to each client for the next round of collaborative training until the model converges.
[0012] Step 5: Use the converged global model to predict the health status, and introduce the error quantification conformal inference method to quantify the uncertainty of the prediction results, and output the predicted value and the corresponding confidence interval.
[0013] Furthermore, in step 1, when the cycle capacity label is missing, the ampere-hour integration method is used to calculate the capacity value of the corresponding cycle based on the charging current and the change in state of charge; the capacity sequence is smoothed by empirical mode decomposition, and the low-frequency intrinsic mode function components and residual terms are selected to reconstruct the capacity sequence to remove high-frequency noise and retain the real fluctuations in the degradation process; the health status label is the ratio of the available capacity of the target cycle to the reference capacity after smoothing; where the reference capacity is the rated capacity or the maximum capacity observed in the data.
[0014] Furthermore, in step 1, the multidimensional health characteristics include the peak value of the incremental capacity curve, the voltage corresponding to the peak value of the incremental slope curve, the standard deviation of the incremental capacity curve, the average maximum temperature during charging, the voltage stability ratio, and the average charging rate; wherein, the incremental capacity curve and the incremental slope curve are smoothed by the Savitzky-Golay filtering method.
[0015] Furthermore, in step 2, the sliding time window includes health feature sequences and health status sequences corresponding to multiple consecutive cycle periods; wherein the prediction label is the health status value corresponding to the preset prediction step size after the end of the window.
[0016] Furthermore, in step 3, the prediction network includes an input mapping module, a Mamba module, an Agent Attention module, a frequency domain enhanced channel attention module, and a prediction output module. The Mamba module uses a selective state-space model as its core, dynamically generating state-space parameters and recursively updating hidden states to capture long-term temporal dependencies in the battery degradation process. The Agent Attention module generates a proxy matrix from the query matrix through pooling operations and interacts with both the query vector and the key-value vector to establish global temporal dependencies and reduce computational complexity. The output of the Mamba and Agent Attention modules is interleaved and fed into the frequency domain enhanced channel attention module. Discrete cosine transform is used to map the temporal space features to the frequency domain, and an attention weight matrix is generated based on the frequency domain features of each channel. The original temporal feature matrix is multiplied by the attention weight matrix, and then output.
[0017] Furthermore, in step 4, each client uses a joint loss function that includes a prediction loss term and a dynamic regularization term for local training; wherein, the dynamic regularization term is used to constrain the update direction of the client model so that it does not deviate excessively from the update direction of the global model.
[0018] Furthermore, in step 4, the client vector is composed of the difference between the client's local model parameters and the current global model parameters, and is used to describe the update direction of the client model in the current communication round.
[0019] Furthermore, in step 4, the adaptive weight optimization strategy uses the aggregate weights corresponding to each client as learnable parameters, constructs an optimization objective function on the server side to minimize the difference between the global update vector and the vectors of each client, and uses gradient descent and backpropagation mechanisms to iteratively optimize the aggregate weights.
[0020] Furthermore, in step 4, the aggregate weights are dynamically updated during each round of communication to improve the generalization ability and convergence stability of the global model in heterogeneous data environments.
[0021] Furthermore, in step 4, the error quantization conformal inference method dynamically adjusts the threshold size of the prediction interval by observing the inconsistency score and its deviation from the current interval threshold, so that the long-term average coverage converges to the specified confidence level; when the root mean square error of the global model on the validation set is lower than the preset threshold or the maximum number of communication rounds is reached, federated learning stops.
[0022] Beneficial effects: First, this invention extracts multi-dimensional health features such as incremental capacity curve features, incremental slope curve features, and auxiliary statistical features, and combines them with empirical mode decomposition to smooth the capacity degradation trajectory, which can more stably characterize the battery degradation state and improve the reliability of health state prediction. Second, this invention uses the Mamba model for modeling, which can effectively capture the long-term dependencies in the battery degradation process and reduce the computational complexity to linear. By establishing a global information interaction mechanism through the Agent Attention module, the model can fully explore the correlation information between different degradation features, improving computational efficiency while maintaining the ability to learn global degradation patterns. Third, this invention combines time-frequency information through a frequency-domain enhanced channel attention mechanism, improving the model's ability to identify noise and non-stationary degradation signals in complex operating conditions, and enhancing the accuracy and robustness of prediction results. Fourth, this invention constructs a federated learning training framework to achieve collaborative modeling of multi-source heterogeneous real vehicle data without sharing original vehicle data, effectively solving the problems of data privacy protection and data silos. Fifth, this invention utilizes an adaptive aggregation weight optimization strategy to enable the global model update direction to better take into account the update information of different clients, suppressing client drift caused by heterogeneous data and improving the convergence and generalization of the global model. Sixth, based on the obtained point prediction results, this invention introduces an error quantification conformal inference method to quantify the uncertainty of the prediction results, reflecting the credibility of the prediction results under complex real vehicle operating conditions, and improving the safety and interpretability of the prediction results. Seventh, this invention can achieve high-precision prediction and evaluation of the health status of power batteries under complex real vehicle operating conditions, providing reliable technical support for health monitoring, life prediction, safety early warning, and operation and maintenance decision-making in the battery management system of new energy vehicles. Attached Figure Description
[0023] Figure 1 The above is a flowchart of the method provided in the embodiments of the present invention.
[0024] Figure 2 This is a flowchart illustrating the data processing and input sample construction process provided in an embodiment of the present invention.
[0025] Figure 3 The flowchart of the Mamba-Agent frequency domain enhancement network structure provided in the embodiments of the present invention is shown.
[0026] Figure 4 A flowchart of federated learning based on adaptive weight optimization is provided for embodiments of the present invention.
[0027] Figure 5 A flowchart of uncertainty quantization based on error quantization conformal inference provided for embodiments of the present invention.
[0028] Figure 6 This is a comparison chart showing the prediction performance of each model provided in this embodiment of the invention after being trained on different on-board lithium battery datasets using a centralized method; wherein, Figure 6 In the dataset, (a) represents the SOH prediction curves for each model of a vehicle in dataset 1. Figure 6 In the dataset, (b) represents the SOH prediction curves for each model of a vehicle in dataset 2. Figure 6 In the figure, (c) represents the root mean square error and absolute error distribution of each model on dataset 1; Figure 6 In the figure, (d) represents the root mean square error and absolute error distribution of each model on dataset 2.
[0029] Figure 7 This invention provides a comparison of the prediction performance of global models obtained through different federated learning methods and models obtained through non-federated training on two datasets, using the Mamba-Agent frequency domain augmentation network as the backbone model. Figure 7 In the dataset, (a) represents the SOH prediction curves for each model of a vehicle in dataset 1. Figure 7 In the dataset, (b) represents the SOH prediction curves for each model of a vehicle in dataset 2. Figure 7 In the figure, (c) represents the root mean square error and absolute error distribution of each model on dataset 1; Figure 7 In the figure, (d) represents the root mean square error and absolute error distribution of each model in dataset 2.
[0030] Figure 8 This is a schematic diagram illustrating the result of uncertainty quantification of the predictions made by the global model on various client data after obtaining the global model using the federated learning method, as provided in an embodiment of the present invention. Detailed Implementation
[0031] The technical solution of the present invention will be further described below with reference to the accompanying drawings. It should be understood that the following embodiments are used to illustrate the technical solution of the present invention and do not constitute a limitation on the scope of protection of the present invention; without departing from the concept of the present invention, those skilled in the art can make equivalent substitutions or adjustments to the data fields, parameter values and deployment methods.
[0032] Reference Figure 1 As shown, this embodiment provides a cloud-edge collaborative health prediction method for power batteries with vehicle-side privacy protection, including six steps: data acquisition and preprocessing, feature extraction and sample construction, Mamba-Agent frequency domain enhancement network construction, non-independent and identically distributed federated learning, and uncertainty quantification. For ease of explanation, the sliding window length when constructing samples in this embodiment is denoted as L=100, and the prediction step size is denoted as 1. The main process of this embodiment includes the following steps.
[0033] S101: Acquire multiple vehicle BMS operation data from different manufacturers and divide the raw charging and discharging data into cycles; in the absence of capacity tags, calculate the capacity value corresponding to each cycle using the ampere-hour integration method.
[0034] S102, EMD decomposition is performed on the battery capacity degradation sequence to reconstruct a smooth capacity sequence and calculate SOH; multidimensional health features that can characterize the battery degradation state are extracted based on voltage, current and temperature within the cycle period; according to the multidimensional health feature sequence and SOH sequence, a sliding window is used to generate SOH prediction samples.
[0035] S103, the samples are input into the Mamba-Agent frequency domain enhancement network. The Mamba module performs state-space modeling of the long-term degradation process, extracting long-term dependency features in the battery degradation process. The Agent Attention module performs global interaction modeling of the temporal features output by Mamba, and the time complexity of attention computation is reduced by introducing a proxy matrix. The features enhanced by Agent Attention are then input into a second Mamba module for secondary temporal refinement, forming an extraction chain in which Mamba and Agent Attention modules are interleaved and connected.
[0036] S104, the features output by the series structure are input into the frequency domain enhancement channel attention module, and the time domain features are mapped to the frequency domain space using discrete cosine transform. The weights of each channel are learned based on the frequency domain features to enhance important information related to battery aging and suppress the influence of high-frequency noise.
[0037] S105. Construct a federated learning training framework for multi-source heterogeneous real vehicle data. Each client independently trains the Mamba-Agent frequency domain augmentation network using local data, and uploads local model parameters and model update information to the federated server without transmitting the original data.
[0038] S106 addresses the client drift problem caused by differences in data distribution among different clients by constructing client update vectors on the federated server side and dynamically calculating the aggregation weights of each client through an adaptive weight optimization mechanism, so that the update direction of the global model after weighted aggregation is as close as possible to the update direction of each client.
[0039] S107, Based on the optimized adaptive aggregation weights, the model parameters uploaded by each client are weighted and aggregated to obtain a global prediction model; the updated global model is then distributed to each client for the next round of training, and steps S105 to S107 are repeated until the model converges or the maximum number of communication rounds is reached.
[0040] S108 uses the obtained global model to test the lithium battery health status data of each client that did not participate in the training, and on the basis of obtaining the point prediction results, introduces the error quantification conformal inference method to quantify the uncertainty of the prediction results, and outputs the SOH prediction value and the corresponding confidence interval.
[0041] For steps S101 and S102, refer to Figure 2 As shown, the specific steps include the following.
[0042] S201 (Capacity Tag Construction): This involves acquiring vehicle BMS operation data from multiple automakers and constructing a foundational dataset for subsequent health status prediction. The vehicle BMS data includes at least timestamps, battery pack voltage, battery pack current, state of charge (SOC), and the highest and lowest battery pack temperatures. For each vehicle dataset, the complete charging process is first identified based on SOC changes and charging / discharging current variations, and then divided into cycles. When capacity tags cannot be directly obtained from the dataset, the ampere-hour integration method is used to calculate the actual capacity corresponding to each cycle based on the battery's charging process. In this embodiment, short cycles with fewer than 100 timestamp records are removed, as these cycles are not conducive to integration calculation. Then, the relative time is calculated based on the charging start time for integration calculation. The specific calculation method can be expressed as follows:
[0043]
[0044] in, This indicates a fixed sampling time interval. Indicates time The charging current at that time, and Indicates the start and end times of the charging process. and Corresponding to and The state of charge at any given moment. Since the current is negative during charging, a negative sign needs to be added to calculate the actual amount of charge.
[0045] S202 (Capacity Sequence Smoothing and SOH Construction): Unlike high-quality data collected under controlled laboratory conditions, battery charge / discharge data from real-world vehicle scenarios often contain noise and are influenced by user habits. Therefore, the directly calculated capacity sequence usually exhibits significant fluctuations and contains abnormally high-frequency noise. The EMD method is used to smooth and reconstruct the original capacity sequence. The result after EMD decomposition can be expressed as:
[0046]
[0047] in, Represents a capacity sequence, Indicates the first One eigenmode function This represents the trend term of the decomposition. To ensure the authenticity of the battery capacity degradation trend in real vehicles, the last two low-frequency terms were selected. Components and trend terms are used for smoothing and reconstructing the capacity sequence, eliminating high-frequency noise while preserving the rebound phenomenon of temporary capacity increases. Then, the SOH tag for each period is calculated using the smoothed capacity, expressed as follows:
[0048]
[0049] in, Representative period The battery capacity below, This indicates the rated capacity. If the rated capacity is unknown, the observed maximum capacity can be used instead.
[0050] S203 (Main Degradation Feature Extraction) extracts interpretable and highly correlated general features with battery degradation based on the raw data. First, aging information is extracted based on the incremental capacity (IC) and incremental slope (IS) curves during constant current charging. The IC and IS curves can be represented as follows:
[0051]
[0052] The incremental capacity is obtained by multiplying the time difference between adjacent records by a constant current, and these are sequentially accumulated to obtain the capacity growth sequence within a period. Savitzky-Golay filtering is applied to the maximum battery pack voltage and capacity sequences to eliminate noise and ensure the voltage sequence is monotonically increasing. The voltage is then resampled, discretized into equally spaced grid points, and the capacity value at the corresponding voltage is obtained using conformal piecewise cubic interpolation. The resampled values are then... - The original IC curve is obtained by calculating the numerical gradient of the curve, and then Savitzky-Golay smoothing is performed. This is achieved by... - The numerical gradient of the curve is used to obtain the IS curve, which is then smoothed using Savitzky-Golay.
[0053] Extracting the peak value of the IC curve, a continuous decrease in the peak value indicates a significant loss of active material in the battery; extracting the voltage corresponding to the peak value of the IS curve, a continuous increase in the voltage indicates enhanced polarization and loss of active material. These phenomena are universal to various types of batteries and all reflect that the battery is gradually aging.
[0054] S204 (Auxiliary Feature Extraction) extracts other easily operable features in addition to IC and IS curve features: the standard deviation of IC values and the average maximum temperature during charging are extracted; the proportion of voltage fluctuations between adjacent sampling points that are less than a set threshold is extracted as a voltage stability feature; and the average SOC increment per unit time during charging is extracted as the average charging rate. These auxiliary features reflect the battery aging state from the perspectives of electrochemical response, thermal behavior, voltage stability, and SOC evolution, respectively.
[0055] S205 (Sample Construction): Using the health feature sequences extracted in step S203, construct SOH prediction samples. The data for each vehicle is organized into a multi-dimensional sequence according to the cycle order. The input data and prediction labels are generated using the sliding window method. A sample can be represented as:
[0056]
[0057] in, Indicates SOH, Indicates the first The first cycle One characteristic, Indicates the number of feature dimensions. The input window contains data from... The feature and SOH of each period, and the label is the SOH value of the next period outside the window. To ensure the continuity of prediction, the window step size is set to 1 in this embodiment.
[0058] For steps S103 and S104, refer to Figure 3 As shown, the specific steps include the following.
[0059] S301 (Input Mapping): The window-shaped samples obtained in step S205 are normalized and then input into the model. In one implementation, the input samples are first mapped to a high-dimensional feature space through a mapping layer. The mapping process can be represented as follows:
[0060]
[0061] in, For the input sample, and These represent the weight parameters and bias parameters of the input mapping layer, respectively.
[0062] S302 (Mamba Long Sequence Modeling) addresses the significant long-term cumulative characteristics of battery degradation, where early cycle states continuously influence health status changes in subsequent cycles, necessitating the establishment of long-range degradation dependencies. Traditional recurrent neural networks (RNNs) are prone to gradient vanishing issues in long sequence modeling, while Transformers, though capable of capturing long-range dependencies, suffer from computational complexity that increases quadratically with sequence length, resulting in substantial overhead in long-cycle vehicle data modeling scenarios. Therefore, this embodiment employs the Mamba module as the backbone temporal modeling structure to uncover temporal dependencies and hidden degradation patterns present in the long-term battery degradation process. This model dynamically generates a parameter matrix, enabling adaptive adjustments to the state transition process based on current input features. For the t-th cycle, the state update process is expressed as:
[0063]
[0064] in, This indicates the hidden state at the current moment. This indicates the hidden state in the previous moment. This represents the state transition matrix after discretization. This represents the discretized input control matrix. This represents the input at the current time step. Before discretization, it is determined based on the input time series matrix. The following parameter matrix is obtained after linear mapping:
[0065]
[0066]
[0067]
[0068] in, The input control matrix before discretization. To output the control matrix, For bias, This is the time step matrix, which will be used for subsequent discretization. Additionally, the parameter matrix before discretization... It is initialized using HiPPO (High-order Polynomial Projection Operators). This initialization allows the model to learn long-term dependencies, achieving a long-term memory effect by compressing input information. Then, the matrix... and Zero-order preserved discretization is performed, and the discretization process is as follows:
[0069]
[0070]
[0071] in, It is an identity matrix. It can be seen that... and Instead of fixed parameters, they are dynamically generated based on the input. Through this input-dependent state update mechanism, different degradation stages can correspond to different state transition patterns. Then, the output features are obtained based on the current hidden state.
[0072]
[0073] in, This is the output result. Through the above calculations, the degenerate state sequence corresponding to the entire historical window can be obtained. This sequence not only retains local cyclic degenerate information but also effectively characterizes the evolution of healthy states across multiple cycles. Furthermore, to improve model stability, residual connections and layer normalization operations are added after the Mamba module:
[0074]
[0075] in, It is a high-dimensional feature space obtained through the input mapping layer. It is the sequence of degradation states corresponding to the entire history window obtained through the Mamba module. This is the final output. After the above processing, the model can obtain a degenerate state representation with long-term dependencies, providing a foundation for subsequent global feature interactions.
[0076] S303 (Agent Attention Global Interaction Modeling): While the Mamba module can effectively model long-term degradation processes and reduce computational overhead, it primarily focuses on state propagation during sequence recursion, and its ability to model global relationships between different degradation stages remains limited. Furthermore, Mamba stores information by compressing historical information into fixed-size latent states, which can lead to information loss and performance limitations. Therefore, this embodiment further inserts an Agent Attention module between two Mamba blocks to enhance the ability to model global degradation patterns. Similar to traditional self-attention mechanisms, it is necessary to first generate three matrices, Q, K, and V, using the input:
[0077]
[0078] in, This is the output of step S301. Unlike traditional self-attention, the Agent Attention mechanism introduces an agent matrix A, which can be represented as:
[0079]
[0080] in, This represents the pooling compression process. The shapes of matrices Q, K, and V are all... , It is the length of the window. It is the hidden dimension. The matrix A generated after pooling compression has the following shape: ,in Less than This reduces complexity in subsequent attention calculations. The agent matrix can be understood as a global summary of the degradation process, which can compress key degradation patterns throughout the time window. The attention calculation in the first stage of Agent Attention can be expressed as:
[0081]
[0082] in, This represents learnable location information. This represents the Softmax function. In this step, the surrogate matrix A is treated as a query, and attention is calculated among A, K, and V. Global information from K and V is aggregated to obtain the surrogate features. The attention calculation in the second stage can be expressed as:
[0083]
[0084] in, This represents learnable location information. This represents the Softmax function. In this step, the surrogate matrix A is used as the key matrix, and the surrogate features... As a value matrix, The global information is broadcast to each query token, and the final output is obtained. This avoids calculating pairwise similarity between Q and K, while preserving the information exchange between each query-key pair through the surrogate matrix. This achieves both global modeling capability and... The linear complexity compared to the original self-attention mechanism. The time complexity is significantly improved. This embodiment sets... = .
[0085] While Agent Attention boasts both low computational cost and high expressive power, as a generalized linear attention mechanism, it also suffers from insufficient feature diversity. To compensate for this, a Deep Convolutional (DWC) module is employed to preserve feature diversity. The computation process can be represented as follows:
[0086]
[0087] in, The output is obtained through two-stage attention calculation. It is the initially generated value matrix. This is the final output. The time complexity of depthwise convolution is O(n log n). , Given the convolution kernel size, this operation is relative to the window length. It also exhibits linear complexity.
[0088] S304 (Stacked Modeling) involves the Agent Attention module completing global information interaction, followed by the Mamba module performing temporal reconstruction and state updates on the enhanced degradation features to further integrate local degradation patterns with global degradation information. This embodiment builds the model in the stacked order of Mamba, Agent Attention, and Mamba.
[0089] S305 (Frequency Enhanced Channel Attention Mechanism): The evolution of SOH (State of Harmony) during lithium battery degradation not only exhibits a decay trend in the time domain but also contains rich frequency domain information. However, existing prediction methods based on time domain features often neglect the frequency domain response characteristics during degradation, making it difficult to fully explore the deep coupling information closely related to battery aging, resulting in insufficient ability of the model to capture degradation trends under complex operating conditions. Therefore, this embodiment further introduces the Frequency Enhanced Channel Attention Mechanism (FECAM) to perform frequency domain modeling on the output of the stacked Mamba and AgentAttention mechanisms. It automatically learns the importance of each channel and suppresses useless information. This module first transforms each channel dimension from the time domain to the frequency domain using discrete cosine transform. For the first channel... The calculation process for each channel can be expressed as follows:
[0090]
[0091] in, This represents the output of the Mamba and Agent Attention stack (i.e., the input of FECAM). That is to say The List this dimension, Indicates the first The frequency domain representation of each channel. The one-dimensional discrete cosine transform (DCT) operation can be represented as:
[0092]
[0093] in, Indicates the first The first channel in the The eigenvalues at each time step, and This represents the DCT frequency index. Then, the weighted attention matrix can be represented as:
[0094]
[0095]
[0096] in, Representing the frequency domain matrix, by Stacked together This represents the weight matrix learned based on the spatial features in the frequency domain. and These represent the Sigmoid and ReLU activation functions, respectively. and Let represent the learnable parameter matrices used for linear mapping. The final output of FECAM can be expressed as:
[0097]
[0098] in, This represents the input to FECAM. This represents element-wise multiplication. This represents the final output of FECAM. Through this process, important frequency components closely related to battery aging are given higher weights, while noise frequency components are suppressed.
[0099] S306 (model prediction output), after being processed by the frequency domain enhancement module, yields the final degraded feature sequence, which can be represented as:
[0100]
[0101] in, Indicates the length of the history window. Indicates the first The degradation features corresponding to each cycle are represented. Since battery SOH prediction is a window-level regression task, it is necessary to aggregate the degradation features within the entire time window to generate a fixed-length feature vector that can characterize the overall degradation state. This embodiment uses global mean pooling to aggregate the features along the time dimension. The calculation process can be represented as follows:
[0102]
[0103] in, This represents the window-level degradation features. This operation fully utilizes the degradation information throughout the entire historical window, avoiding reliance solely on the local fluctuations of the last cycle, thereby improving the stability and robustness of the model's predictions. Subsequently, the aggregated degradation features are input into the prediction head for SOH regression prediction. The prediction head employs a two-layer fully connected mapping structure, introducing nonlinear activation and random deactivation operations in between. Its calculation process is as follows:
[0104]
[0105] in, This is the first layer weight matrix. This represents the bias parameter. Then, the intermediate results... After processing with the ReLU activation function, and then undergoing a random deactivation (Dropout) operation, the result is... This prevents overfitting. Finally, the second-level linear transformation will... The 3D feature is mapped to a scalar output to obtain the final output:
[0106]
[0107] in, , This is a bias parameter. In this embodiment, it is set... .
[0108] For steps S105, S106, and S107, refer to Figure 4 As shown, the specific steps include the following.
[0109] S401 (Construction of Federated Learning Framework): The federated learning framework system mainly consists of a federated server and multiple vehicle clients. Each vehicle client corresponds to a real-vehicle dataset from a different source. In practice, due to different clients corresponding to different vehicle groups, different battery systems, and different operating environments, the data distribution of each client differs significantly, typically exhibiting a non-independent and identically distributed (Non-IID) characteristic. Suppose there are K clients in the federated system, then the dataset corresponding to client k can be represented as:
[0110]
[0111] in, This represents the input feature sequence window. Indicates the label to be predicted. This indicates the number of client-side samples.
[0112] S402 (Client-Side Local Training): At the start of federated training, the server first initializes the global model parameters. The global model parameters are then distributed to all participating clients. Each client independently trains the Mamba-Agent frequency domain augmentation network using local data without uploading any local real-vehicle data. However, due to the non-IID distribution of data from different clients, the update directions of the models on each client differ significantly, and the models tend to converge towards their local optimum. This causes the model parameters on different clients to gradually deviate from the global optimum, making it difficult for the global model to achieve good performance on all client data simultaneously, resulting in client drift. To mitigate this phenomenon, this embodiment incorporates a dynamic regularization constraint mechanism (Federated Learning with Dynamic Regularization, FedDyn) into the loss function. For client k in the t-th round of communication, its complete local loss function can be expressed as:
[0113]
[0114]
[0115] in, Indicates the mean square error loss. This represents the model parameters of client k in the previous round. This represents the global model parameters sent during the t-th round of communication. This represents the local model parameters being calculated. This represents the coefficients of the proximal terms. The final loss function. middle, It is a dynamic linear regularization term. This represents the gradient of the local model of client k in the previous round of communication. Minimizing this term can guide the currently trained local model away from the local model of the previous round, thus playing a role in calibrating the update direction. This is the standard proximal term, which constrains the local model from deviating too far from the global model by penalizing the square of the L2 distance between the local model and the current global model, thereby mitigating client drift.
[0116] The client-side local model parameters obtained through the loss function can be expressed as:
[0117]
[0118] in, This represents the updated model parameters of client k in the t-th round of communication. The gradient of the local model needs to be updated subsequently, and the update method can be represented as:
[0119]
[0120] in, This represents the gradient of the local model of client k in the t-th round of communication, used to construct the local loss function in the (t+1)-th round of communication. In this embodiment, the optimizer for local model training is set to the Adam optimizer, the learning rate is set to 0.001, the proximal term coefficient is set to 0.0001, the local model is trained for 5 rounds each time, the batch size is 64, and the maximum number of communication rounds in the entire federated learning process is 40 rounds.
[0121] S403 (Server-Side Adaptive Aggregation Weight Optimization) addresses the issue that client data exhibits significant Non-IID characteristics, leading to substantial differences in model update directions across different clients. The traditional FedAvg algorithm typically aggregates parameters using the following calculation method:
[0122]
[0123] in, This represents the total number of samples from all clients. However, in Non-IID scenarios, the update directions of different client models may conflict. Direct averaging or weighted averaging based on the number of client samples can easily lead to client drift, causing the global model to deviate from the optimal solution. To address this problem, this embodiment employs an adaptive weight aggregation mechanism. First, for client k, its client vector is defined as:
[0124]
[0125] in, This represents the global model parameters issued at the start of the current communication round. This represents the model parameters after local model training. This represents the client vector of client k in the t-th round of communication, which actually reflects the update direction of the local model. Each client uploads its local model parameters and client vector to the server to further construct the global update vector:
[0126]
[0127]
[0128] in, This represents the aggregate weight of client k. This represents the global model update vector obtained in the t-th round of communication. Unlike traditional fixed-weight methods, this embodiment does not directly average or determine the aggregation weights based on the number of samples, but instead dynamically learns the optimal weights based on the client vectors. Therefore, an aggregation optimization objective function is constructed on the server side:
[0129]
[0130] The objective function represents the weighted sum of the squared L2 distances between the global update vector and each client vector. The weights assigned to each client are still the aggregated weights used when constructing the global update vector. The optimization objective of the function is to find an optimal set of aggregated weights such that the aggregated global update vector is as close as possible to the update directions of all clients. If a client's update direction is consistent with that of the majority of clients, its corresponding weight automatically increases; if a client's update direction deviates from the overall direction, its weight automatically decreases.
[0131] Furthermore, to ensure that the aggregated global model does not deviate excessively from the global model of the previous round of communication, thereby maintaining the stability of the training process, this embodiment also introduces an additional regularization term. The complete aggregation optimization objective function can be expressed as:
[0132]
[0133] in, The distance function is represented by 1-cosine similarity in this embodiment. The optimal aggregation weight of the target can be expressed as:
[0134]
[0135] in, This means ensuring that the sum of the weights of all clients is 1, and then using gradient descent to optimize the aggregated weights. In this embodiment, the server-side uses the Adam optimizer with a learning rate of 0.001, performing 10 iterations to obtain the final aggregated weights. Through this mechanism, the server can automatically identify the update directions of clients with high representativeness and suppress the adverse effects of abnormal clients or clients with extreme data distributions on the global model, thereby improving the convergence stability of the global model.
[0136] S404 (Global Model Update): After obtaining the final aggregated weights, the server uses these weights to perform a weighted aggregation of the model parameters for each client. The global model update formula is as follows:
[0137]
[0138] in, This represents the global model parameters after the t-th round of communication. This represents the local model parameters uploaded by client k to the server.
[0139] In S405 (Federated Iterative Training), after completing the global model update, the server broadcasts the new global model parameters to all clients. Upon receiving the new global model, the client uses it as the initialization parameters for the next training round and continues training using local data. This process then repeats: local model training; uploading model parameters and client vectors; adaptive weight optimization; global model aggregation; and model updates. This process continues until the preset maximum number of communication rounds is reached or the global model prediction error reaches a preset requirement.
[0140] For step S108, refer to Figure 5 As shown, the specific steps include the following.
[0141] S501 (Calibration Set Error Statistics) utilizes the trained federated global model to test lithium battery data from various clients that were not part of the training, obtaining point prediction results. Based on this, the Error-quantified Conformal Inference (ECI) method is introduced to quantify the uncertainty of the prediction results. In actual vehicle operating environments, lithium battery conditions are complex and variable, and data often contains noise or distribution shifts. Traditional point prediction only provides a single value, failing to reflect the reliability of the prediction results and potentially leading to decision-making risks. By introducing uncertainty quantification, the model can provide a confidence interval for each prediction value, clearly expressing the range of confidence in the prediction and providing a safer basis for decision-making.
[0142] The ECI method constructs a non-consistency score using the prediction results of calibration samples and dynamically adjusts the prediction interval width using an online error feedback mechanism to obtain the most compact prediction interval possible while ensuring coverage. In this embodiment, after federated training, the vehicle data from each client that did not participate in the training are divided into a calibration set and a test set. The model prediction error is statistically analyzed using the calibration set data. In this embodiment, the battery data of one vehicle is used as the calibration set, and the data from the remaining vehicles is used as the test set. For each calibration sample, the non-consistency score of the global model prediction result can be expressed as:
[0143]
[0144] in, For real labels, For the model prediction results, If the actual value represents the absolute error of the prediction, then the set of inconsistent scores formed by the calibration samples can be represented as:
[0145]
[0146] in, To sort by periodicity A set of inconsistent scores for a calibration sample.
[0147] S502 (quantile threshold calculation), assuming the target confidence level is... ,in =0.1 corresponds to a 90% confidence interval. =0.05 corresponds to a 95% confidence interval, which is selected in this embodiment. =0.1. The error quantile can be expressed as:
[0148]
[0149] in, yes of Quantiles represent the threshold of the current prediction error, and are also the threshold of the prediction interval.
[0150] S503 (Error Quantization Mechanism for Threshold Update): Traditional conformal inference methods only update the threshold based on whether the interval covers the binary classification criterion. This embodiment, however, employs an error quantization-based conformal inference mechanism, introducing an error quantization value:
[0151]
[0152] in, This represents the current true error. The current error threshold, This is the error quantization value. When... When, it indicates that the actual error exceeds the current prediction range; when When the threshold is set to 0, it indicates that there is redundancy in the current prediction interval. Therefore, the threshold is updated using an error quantization feedback mechanism:
[0153]
[0154] in, Indicates the learning rate. In this embodiment, the Sigmoid function is used. The derivative of the function. It is a covered indicator variable. hour =1, hour =0. Compared to traditional online conformal inference methods that only utilize 0 / 1 feedback, ECI utilizes an error quantization term. Provide continuous feedback based on the current error quantization value. It will automatically increase (widen the prediction interval) or decrease (tighten the prediction interval) based on the actual error quantification value, thereby maintaining a long-term coverage rate close to the expected value. .
[0155] S504 (Prediction Interval Generation and Evaluation): For test samples in the test set, the global model first outputs the predicted point values, and then constructs the prediction interval using the current error threshold.
[0156]
[0157] Wherein, the upper bound of the interval is The lower bound of the interval is To evaluate the quality of the prediction interval construction, quantitative assessment is needed using evaluation metrics for uncertainty quantification. In this embodiment, the following evaluation metrics are used: coverage rate, which represents the proportion of true labels falling into the prediction interval; average interval width; and continuous hierarchical probability score, which measures both prediction accuracy and the concentration of prediction intervals.
[0158] To verify the SOH prediction performance of the method of this invention in a multi-source heterogeneous real vehicle data scenario, in one embodiment, the method of this invention is compared with typical time-series prediction models and federated learning methods such as Convolutional Neural Network-Long Short-Term Memory (CNN-LSTM), Transformer, Mamba, Federated Averaging (FedAvg). All comparison methods use the same data partitioning method and the same evaluation metrics. Federated learning methods are all trained under the same client partitioning conditions, with different clients corresponding to real vehicle lithium battery data provided by different vehicle manufacturers.
[0159] Reference Figure 6 As shown, Figure 6 (a) and Figure 6 In (b), the horizontal axis represents the number of cycles, and the vertical axis represents SOH. It can be seen that as the number of cycles increases, the method of this invention can accurately track the overall degradation trend of SOH, demonstrating good fitting ability in the early, middle, and late stages of degradation. In contrast, some comparative methods suffer from frequent local high-frequency fluctuations or insufficient fitting in certain stages. Figure 6 (c) and Figure 6 In section (d), the root mean square error (RMSE) and mean absolute error (MAE) are used to evaluate the prediction performance of each method. Smaller RMSE and MAE indicate lower prediction errors. Experimental results show that the method of this invention outperforms the comparative methods in all evaluation metrics, indicating that the proposed Mamba-Agent frequency domain enhancement network can fully exploit long-term temporal dependencies, global correlation information, and frequency domain degradation characteristics in the battery degradation process.
[0160] Further reference Figure 7 As shown, Figure 7 (a) and Figure 7In (b), the horizontal axis represents the number of iterations, and the vertical axis represents the state of loss (SOH). It can be seen that as the number of iterations increases, the global model obtained by the federated learning method of this invention demonstrates the ability to accurately track the overall degradation trend of SOH across client datasets, exhibiting balanced performance across all datasets. In contrast, the comparative average federated aggregation method (FedAvg) suffers from insufficient generalization and cannot achieve good results on both datasets simultaneously. Experimental results show that the federated learning method of this invention outperforms the comparative method in all evaluation metrics. The adaptive weight optimization mechanism can effectively integrate degradation knowledge from different clients, improving the model's generalization ability in multi-source heterogeneous data scenarios.
[0161] Further reference Figure 8 As shown, in addition to outputting the SOH point prediction results, this invention further generates the corresponding prediction confidence intervals. It can be seen that during the relatively stable phase of the degradation process, the prediction interval is relatively narrow; while during the phase of large degradation fluctuations, the prediction interval automatically widens, reflecting the uncertainty of the model's understanding of the future degradation state. Experimental results show that the uncertainty quantification method of this invention can achieve a narrow prediction interval width while ensuring high coverage.
[0162] This invention also provides an on-board lithium battery SOH prediction system. The system includes modules for data acquisition and preprocessing, feature extraction and sample construction, Mamba-Agent frequency domain enhancement network construction, non-independent and identically distributed federated learning, and uncertainty quantification. Each module is used to perform the corresponding processing procedures in steps S101 to S108. These modules can be implemented by software programs or by a combination of software and hardware, and can be deployed in vehicle terminal devices, edge computing nodes, vehicle-to-everything (V2X) cloud platforms, experimental analysis servers, or other electronic devices with data processing capabilities.
Claims
1. A cloud-edge collaborative health prediction method for power batteries with vehicle-side privacy protection, characterized in that, include: Step 1: Obtain battery charging and discharging data generated by multiple vehicle clients during actual operation, divide the data into cycles according to the charging and discharging process, and obtain the battery capacity of each cycle. Battery capacity is smoothed to construct a health status label, and multidimensional health features characterizing battery degradation status are extracted from charge and discharge data. Step 2: Using a sliding time window, multidimensional health features and health status information from multiple historical periods are used as input, and health status information from future periods is used as prediction labels to construct prediction samples; Step 3: Input the predicted samples into the prediction network. The prediction network uses the Mamba module to model long-term degradation dependencies and the Agent Attention module to establish global feature interaction relationships. The Mamba module and the Agent Attention module are interleaved and connected to construct a temporal prediction link. Finally, the frequency domain enhancement channel attention mechanism is combined to mine frequency domain information related to degradation and output the health status prediction result. Step 4: Construct a federated learning framework. Each client independently trains the prediction network using local data and only uploads the model parameters and update information to the server. The server constructs client vectors based on the update direction of each client's model and dynamically calculates the aggregation weights of each client through an adaptive weight optimization strategy, ensuring that the update direction of the global model obtained by weighted aggregation is consistent with the update direction of each client. The server performs weighted aggregation on the model parameters of each client based on the aggregation weights to obtain the global model, and distributes the updated global model to each client for the next round of collaborative training until the model converges. Step 5: Use the converged global model to predict the health status, and introduce the error quantification conformal inference method to quantify the uncertainty of the prediction results, and output the predicted value and the corresponding confidence interval.
2. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 1, when the cycle capacity tag is missing, the ampere-hour integration method is used to calculate the capacity value of the corresponding cycle based on the charging current and the change in state of charge. Empirical mode decomposition is used to smooth the capacity sequence, and low-frequency intrinsic mode function components and residual terms are selected to reconstruct the capacity sequence in order to remove high-frequency noise and retain the real fluctuations in the degradation process. The health status label is the ratio of the available capacity to the reference capacity after smoothing the target period; where the reference capacity is the rated capacity or the maximum capacity observed in the dataset.
3. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 1, the multidimensional health features include the peak value of the incremental capacity curve, the voltage corresponding to the peak value of the incremental slope curve, the standard deviation of the incremental capacity curve, the average maximum temperature during charging, the voltage stability ratio, and the average charging rate; among them, the incremental capacity curve and the incremental slope curve are smoothed by the Savitzky-Golay filtering method.
4. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 2, the sliding time window includes health feature sequences and health status sequences corresponding to multiple consecutive cycles; the prediction label is the health status value after the end of the window with a preset prediction step size.
5. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 3, the prediction network includes an input mapping module, a Mamba module, an Agent Attention module, a frequency domain enhanced channel attention module, and a prediction output module. The Mamba module uses a selective state-space model as its core, dynamically generating state-space parameters and recursively updating hidden states to capture long-term temporal dependencies in the battery degradation process. The Agent Attention module generates a proxy matrix from the query matrix through pooling operations and interacts with the query vector and key-value vector respectively to establish global temporal dependencies and reduce computational complexity. The output of the Mamba module and the Agent Attention module is fed into the frequency domain enhanced channel attention module, which uses discrete cosine transform to map the temporal space features to the frequency domain space, generates an attention weight matrix based on the frequency domain features of each channel, and outputs the result after multiplying the original temporal feature matrix with the attention weight matrix.
6. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 4, each client uses a joint loss function that includes a prediction loss term and a dynamic regularization term for local training; the dynamic regularization term is used to constrain the update direction of the client model so that it does not deviate too much from the update direction of the global model.
7. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 4, the client vector is composed of the difference between the client's local model parameters and the current global model parameters, and is used to describe the update direction of the client model in the current communication round.
8. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 4, the adaptive weight optimization strategy uses the aggregate weights corresponding to each client as learnable parameters, constructs an optimization objective function on the server side to minimize the difference between the global update vector and the vectors of each client, and uses gradient descent and backpropagation mechanisms to iteratively optimize the aggregate weights.
9. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 4, the aggregate weight is dynamically updated during each round of communication.
10. The cloud-edge collaborative health prediction method for power batteries oriented towards vehicle-side privacy protection according to claim 1, characterized in that, In step 4, the error quantization conformal inference method dynamically adjusts the threshold size of the prediction interval by observing the inconsistency score and its deviation from the current interval threshold, so that the long-term average coverage converges to the specified confidence level; when the root mean square error of the global model on the validation set is lower than the preset threshold or the maximum number of communication rounds is reached, federated learning stops.