Electric vehicle power battery health state prediction method based on attention federal learning
By designing the global-local attention network model structure and optimizing the attention federated learning strategy, the difficulty in capturing local and global information of battery monitoring signals and data privacy issues are solved, and battery health status prediction with high generalization and accuracy is achieved, extending Improves battery life and driving safety.
Patent Information
- Application Number
- CN202411535487.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-24
AI Technical Summary
The prior art is difficult to effectively capture local and global information of battery monitoring signals, resulting in insufficient accuracy and generalization of battery health status prediction. At the same time, due to data privacy issues, it is difficult to realize a highly generalized generalized general SOH prediction model.
Design global-local attention network model structure, and optimize the federal learning strategy, learn the aging characteristics of battery through the global-local attention network model structure, and select the time-guided model selection strategy and the attention-based model self-adaptive aggregation strategy , Generate a highly general SOH prediction model.
The accurate prediction of the health state of the battery is achieved, improved the generalization and adaptability of the model, protects the privacy of data, and extends the life of the power battery, and improves driving safety.
Smart Images

Figure CN119355534A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to battery health state prediction and deep learning, and in particular to a method for predicting the health state of a power battery of an electric vehicle based on attention federated learning. Background Art
[0002] The global energy crisis and the intensification of environmental pollution have made the importance of new energy technologies increasingly prominent. The popularity of electric vehicles has reduced dependence on fossil fuels and reduced greenhouse gas emissions. Lithium batteries have become the main power source for electric vehicles due to their high energy density, long life and excellent performance. Due to complex chemical reactions, the capacity of lithium batteries will gradually decrease with use. There may be risks of overheating, leakage, expansion or short circuit during battery use, and even vehicle explosion. Lithium battery health prediction is crucial to prevent risks, extend battery life and ensure vehicle safety. The state of health (SOH) is a comprehensive indicator that represents both battery performance and remaining service life. However, SOH cannot be directly observed and is usually estimated based on changes in external signal parameters such as voltage, current and temperature. Traditional methods, such as electrochemical models, partially reflect the health of the battery. However, they require advanced testing equipment and controllable experimental settings. In addition, its prediction accuracy and applicability need to be further improved.
[0003] Data-driven SOH prediction methods mine battery health status from data and avoid complex electrochemical modeling. These methods can adjust models for different battery types and scenarios and have strong adaptability and generalization capabilities. Gaussian process regression models are designed for SOH estimation, however, this method has difficulty handling high-dimensional data, resulting in overfitting or underfitting problems. Integrated learning methods based on comprehensive health features are used for battery health prediction. However, traditional machine learning relies on feature engineering and has weaker nonlinear expression capabilities than neural networks.
[0004] Neural network-based methods can automatically learn data features and capture the complex nonlinear relationship between monitoring signals and SOH. Long short-term memory neural network methods are used to learn the degradation pattern of batteries over time. A CNN-LSTM method improves the SOH prediction accuracy by understanding the local and global information from sensor signals. ACNN-Transformer has also been proposed to enhance SOH estimation for long-term monitoring data, which uses the global information integration capability of the self-attention mechanism to characterize the degradation pattern. However, these methods cannot adaptively capture the local and global information of the monitoring sequence.
[0005] In addition, the monitoring data of the battery varies significantly between electric vehicles. Due to privacy issues, it is difficult to aggregate data from multiple electric vehicles to train a common model. A federated learning method is proposed, which predicts the remaining battery life by passing model parameters instead of raw data to protect data privacy. A method combining LSTM and federated average aggregation has also been proposed to improve the effectiveness of battery life prediction. However, this aggregation strategy limits the flexibility of the model for the target battery and increases the training time. Therefore, it is necessary to design an effective model structure for the local and global features of the capacity change curve, and at the same time optimize the traditional federated learning framework to train a highly generalized SOH prediction model to improve the accuracy of the prediction of the health status of the target electric vehicle battery. Summary of the invention
[0006] In order to solve the shortcomings and deficiencies in the prior art, the purpose of the present invention is to propose a method for predicting the health status of electric vehicle power batteries based on attention federated learning;
[0007] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0008] S1. Import and pre-process the electric vehicle battery data, and use each electric vehicle battery data as the client local data;
[0009] S2. In federated learning, a global-local attention network model structure is designed as a client model to learn battery aging characteristics;
[0010] S3, designing a time-guided model selection strategy to upload the screened client models to the server;
[0011] S4. Design an attention-based model adaptive aggregation strategy to aggregate uploaded client models to generate a global model;
[0012] S5: The global model is sent to each client to complete this round of federated learning. When the global model converges, the training ends and a highly generalized SOH prediction model is obtained.
[0013] S6. Use partial data of the target electric vehicle battery to fine-tune the obtained model to achieve SOH prediction of the target electric vehicle battery.
[0014] In the above step S1, the electric vehicle battery data is imported and pre-processed, and each electric vehicle battery data is used as the client local data;
[0015] In the above step S2, a global-local attention network model structure is designed as a client model to learn battery aging characteristics, specifically including:
[0016] S21. Design a local attention module. Use multi-scale convolution and cross-attention mechanism to learn the local morphological information of the monitoring signal;
[0017] S22. Design a global attention module. Embed the attention mechanism into the gated unit to learn the feature relationship of each time step; use layer normalization to map the matrix Z to the time series query vector Q T and the time-series key vector K T , and the linear map Z is the value vector V T and matrix U. Use gated attention A to learn dynamic attention weights;
[0018] S23, client model training. Each client c (c = 1, 2, ..., M) downloads parameters θ from the server and trains the client model using local battery data In each training round e = 1, 2, ... e, the difference between the predicted value and the true SOH is calculated using MSE to obtain the loss The loss is then passed back, and the parameters are updated using gradient descent to complete the training of the client model.
[0019] In the above step S3, a time-guided model selection strategy is designed to upload the screened client model to the server. Specifically:
[0020] The client model upload time and the client local data size are embedded in the exponential weighted moving average algorithm for dynamic screening. In the process, if a client does not upload within the specified time, it will not upload in this round r. Each client c has its own time threshold in the current round r, and the formula is as follows:
[0021]
[0022] in is the average upload time of all clients in the last round r-1, is the ratio of the data volume of client c to the average data volume of all clients, is the upload time of client c in round r-1, α and β are weight parameters.
[0023] In the above step S4, an attention-based model adaptive aggregation strategy is designed to aggregate the uploaded client models to generate a global model, which specifically includes:
[0024] S41, when the communication round number r+1, according to the global model w(Θ r ) to construct the query vector Q GC , according to the parameters w(θ r+1 ) c Constructing the key vector When the model has L layers, the formula is as follows:
[0025]
[0026]
[0027] S42. Use cosine similarity to characterize attention weight. Attention weight of the first layer of client model c It can be expressed as:
[0028]
[0029]
[0030] The attention weight of a client model is
[0031] S43, construct a value vector. Construct a value vector based on the Euclidean distance between each client model parameter and the server model parameter The formula is as follows:
[0032]
[0033] The value vector for a client model is
[0034] S44. Update the global model on the server side. Use the gradient descent method to update the global model. The formula is as follows:
[0035]
[0036] Where η is the learning rate.
[0037] In the above step S5, the global model is sent to each client to complete this round of federated learning. When the global model converges, the training ends and a highly generalized SOH prediction model is obtained.
[0038] In the above step S6, the obtained model is fine-tuned using partial data of the target electric vehicle battery to achieve the SOH prediction of the target electric vehicle battery;
[0039] The beneficial effects of the present invention are: a method for predicting the health status of electric vehicle power batteries based on attention federated learning, which aims to solve the problems of difficulty in perceiving the interaction between local and global features of battery monitoring signals and weak generalization of a single electric vehicle SOH prediction model. Existing methods are difficult to use deep learning to conduct accurate SOH prediction related research. Therefore, the present invention designs a global-local attention network model structure and optimizes the attention federated learning strategy to protect data privacy while achieving accurate target electric vehicle battery health status prediction, which has significant application value in extending the life of power batteries and improving driving safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 The figure is a flow chart of the method for predicting the health status of electric vehicle power batteries based on attention federated learning of the present invention.
[0042] Figure 2 Schematic diagram of the global-local attention network model structure of the present invention.
[0043] Figure 3 Schematic diagram of the attention-based federated learning framework of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Due to the complex interaction between local features and global features of battery discharge signal data, it is difficult for existing models to perform effective feature representation. At the same time, due to data privacy, the SOH prediction model of a single electric vehicle battery has weak generalization, and it is difficult to carry out related research with the help of deep learning methods. The present invention aims at the SOH estimation problem of the target electric vehicle power battery and proposes a method for predicting the health status of an electric vehicle power battery based on attention federated learning. The main steps include: importing electric vehicle battery data and preprocessing it, and taking each electric vehicle battery data as client local data; in federated learning, designing a global-local attention network model structure as a client model to learn battery aging characteristics; designing a time-guided model selection strategy to upload the screened client model to the server; designing an attention-based model adaptive aggregation strategy to aggregate the uploaded client models to generate a global model; the global model is sent to each client to complete this round of federated learning, and the training is terminated when the global model converges to obtain a highly generalized SOH prediction model; using partial data of the target electric vehicle battery to fine-tune the obtained model to achieve SOH prediction of the target electric vehicle battery.
[0046] A method for predicting the health status of electric vehicle power batteries based on attention federated learning. The specific process is as follows: Figure 1 As shown, the implementation steps are as follows:
[0047] S1. Import and pre-process the electric vehicle battery data, and use each electric vehicle battery data as the client local data;
[0048] S2. In federated learning, a global-local attention network model structure is designed as a client model to learn battery aging characteristics;
[0049] S3, designing a time-guided model selection strategy to upload the screened client models to the server;
[0050] S4. Design an attention-based model adaptive aggregation strategy to aggregate uploaded client models to generate a global model;
[0051] S5: The global model is sent to each client to complete this round of federated learning. When the global model converges, the training ends and a highly generalized SOH prediction model is obtained.
[0052] S6. Use partial data of the target electric vehicle battery to fine-tune the obtained model to achieve SOH prediction of the target electric vehicle battery.
[0053] In the above step S1, the electric vehicle battery data is imported and preprocessed, and each electric vehicle battery data is used as the client local data. Specifically:
[0054] Input feature [f 1 , f 2 , ..., f d] consists of battery discharge current, voltage, and temperature monitoring data. The training sample x is obtained using a sliding window. The formula is as follows:
[0055]
[0056] Where d is the number of sample features, t is the time window size, that is, the sample length. The SOH value is the current battery capacity C cur and the battery rated capacity C nom The true SOH value is y, that is, the sample label, and the formula is as follows:
[0057]
[0058] In addition, outliers whose SOH is not in the range of 0 to 1 are deleted, and the data is standardized. For each electric vehicle battery client, the training set, validation set, and test set are set in a ratio of 7:2:1.
[0059] In the above step S2, a global-local attention network model structure is designed as a client model to learn battery aging characteristics, such as Figure 2 As shown, specifically including:
[0060] S21. Design a local attention module. Use multi-scale convolution and cross-attention mechanism to learn the local morphological information of the monitoring signal;
[0061] S211, using two convolutional layers and a maximum pooling layer MaxP, the input features are mapped to a spatial query vector Q s and the key vector K S .Q S The convolution kernel size is set to 5 and 1, denoted as Conv5 and Conv1, respectively. S The convolution kernel size is set to 3 and 1, denoted as Conv3 and Conv1 respectively. The mapping formula is as follows:
[0062] Conv1(MaxP(Conv5(x)))×W Q =Q S ,
[0063] Conv1(MaxP(Conv3(x)))×W K =K S ,
[0064] Where W Q , W K is the learnable weight matrix;
[0065] S212, use two convolutional layers and an average pooling layer AvgP to map the input features into a spatial value vector V SThe kernel sizes of the two convolutional layers are set to 3 and 1 respectively, and the mapping formula is as follows:
[0066] Conv1(AvgP(Conv3(x)))×W V =V S ,
[0067] Where W V is the learnable weight matrix;
[0068] S213, attention weight matrix calculation. S With K S The corresponding elements are multiplied, and then normalized using the softmax function to obtain the cross attention score, which is then combined with V S Perform weighted summation to output the implicit feature h, the formula is as follows
[0069] h=softmax(Q S K S T )V S ;
[0070] S214, get the local attention output. Perform residual connection between the original input and the implicit feature, the formula is as follows:
[0071] Z=r(x+h),
[0072] Then Z is fed into the global attention module;
[0073] S22. Design a global attention module. Embed the attention mechanism into the gated unit to learn the feature relationship of each time step; use layer normalization to map the matrix Z to the time series query vector Q T and the time-series key vector K T , and the linear map Z is the value vector V T And matrix U. Use gated attention A to learn dynamic attention weights, the formula is as follows:
[0074]
[0075]
[0076] in represents the normalization factor to avoid the influence of sample length, ⊙ is multiplication by corresponding position, W O is a learnable matrix, is the output of the linear layer;
[0077] S23, client model training. Each client c (c = 1, 2, ..., M) downloads parameters θ from the server and trains the client model using local battery data In each training round e = 1, 2, ... e, the loss is calculated using MSE to calculate the difference between the predicted value and the true SOH The loss is then passed back and the parameters are updated using gradient descent to complete the training of the client model. The formula is as follows:
[0078]
[0079]
[0080] in represents the derivative calculation, and λ is the learning rate.
[0081] In the above step S3, a time-guided model selection strategy is designed to upload the client model that has passed the screening to the server, such as Figure 3 As shown, specifically:
[0082] The client model upload time and the client local data size are embedded in the exponential weighted moving average algorithm for dynamic screening. In the process, if a client does not upload within the specified time, it will not upload in this round r. Each client c has its own time threshold in the current round r, and the formula is as follows:
[0083]
[0084] in is the average upload time of all clients in the last round r-1, is the ratio of the data volume of client c to the average data volume of all clients, is the upload time of client c in round r-1, ɑ and β are weight parameters.
[0085] In the above step S4, an attention-based model adaptive aggregation strategy is designed to aggregate the uploaded client models to generate a global model, such as Figure 3 As shown, specifically including:
[0086] S41, when the communication round number r+1, according to the global model w(Θ r ) to construct the query vector Q GC , according to the parameters w(θ r+1 ) c Constructing the key vector When the model has L layers, the formula is as follows:
[0087]
[0088]
[0089] S42. Use cosine similarity to characterize attention weight. Attention weight of the first layer of client model c It can be expressed as:
[0090]
[0091]
[0092] The attention weight of a client model is
[0093] S43, construct a value vector. Construct a value vector based on the Euclidean distance between each client model parameter and the server model parameter The formula is as follows:
[0094]
[0095] The value vector for a client model is
[0096] S44. Update the global model on the server side. Use the gradient descent method to update the global model. The formula is as follows:
[0097]
[0098] Where η is the learning rate.
[0099] In the above step S6, the global model is sent to each client to complete this round of federated learning. When the global model converges, the training ends and a highly generalized SOH prediction model is obtained.
[0100] The pseudo code based on attention federated learning is as follows:
[0101]
[0102]
[0103] In the above step S6, the obtained model is fine-tuned using partial data of the target electric vehicle battery to achieve the prediction of the SOH of the target electric vehicle battery.
[0104] The present invention aims to address the problems of difficulty in perceiving the interaction between local and global features of battery monitoring signals and weak generalization of a single electric vehicle SOH prediction model. Existing methods make it difficult to use deep learning to conduct accurate SOH prediction related research. Therefore, the present invention designs a global-local attention network model structure and optimizes the attention federated learning strategy to protect data privacy while achieving accurate prediction of the health status of the target electric vehicle battery, which has significant application value in extending the life of power batteries and improving driving safety.
[0105] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting the health status of electric vehicle power batteries based on attention federated learning, characterized in that: The specific steps are as follows: S1. Import and pre-process the electric vehicle battery data, and use each electric vehicle battery data as the client local data; S2. In federated learning, a global-local attention network model structure is designed as a client model to learn battery aging characteristics; S3, designing a time-guided model selection strategy to upload the screened client models to the server; S4. Design an attention-based model adaptive aggregation strategy to aggregate uploaded client models to generate a global model; S5: The global model is sent to each client to complete this round of federated learning. When the global model converges, the training ends and a highly generalized SOH prediction model is obtained. S6. Use partial data of the target electric vehicle battery to fine-tune the obtained model to achieve SOH prediction of the target electric vehicle battery.
2. According to claim 1, a method for predicting the health status of electric vehicle power batteries based on attention federated learning is characterized in that: In step S2, in federated learning, a global-local attention network model structure is designed as a client model to learn battery aging characteristics, including the following steps: S21. Design a local attention module. Use multi-scale convolution and cross-attention mechanism to learn the local morphological information of the monitoring signal; S22. Design a global attention module. Embed the attention mechanism into the gated unit to learn the feature relationship of each time step; use layer normalization to map the matrix Z to the time series query vector Q T and the time-series key vector K T , and the linear map Z is the value vector V T And matrix U. Use gated attention A to learn dynamic attention weights, the formula is as follows: in represents the normalization factor to avoid the influence of sample length, ⊙ is multiplication by corresponding position, W O is a learnable matrix, is the output of the linear layer; S23. Use MSE to calculate the difference between the predicted value and the actual SOH to obtain the loss, and send the loss back to complete the training of the client model.
3. According to claim 1, a lithium battery health status perception method based on contribution perception federated learning is characterized in that: The design time guided model selection strategy described in step S3 uploads the client model that passes the screening to the server. Specifically: The client model upload time and the client local data size are embedded in the exponential weighted moving average algorithm for dynamic screening. In the process, if a client does not upload within the specified time, it will not upload in this round r. Each client c has its own time threshold in the current round r, and the formula is as follows: in is the average upload time of all clients in the last round r-1, is the ratio of the data volume of client c to the average data volume of all clients, is the upload time of client c in round r-1, ɑ and β are weight parameters.
4. The method according to claim 1, characterized in that: The design of the attention-based model adaptive aggregation strategy described in step S4, aggregating the uploaded client models to generate a global model, includes the following steps: S41, when the communication round number r+1, according to the global model w(Θ r ) to construct the query vector Q GC , according to the parameters w(θ r+1 ) c Constructing the key vector When the model has L layers, the formula is as follows: S42. Use cosine similarity to characterize attention weight. Attention weight of the first layer of client model c It can be expressed as: The attention weight of a client model is S43, construct a value vector. Construct a value vector based on the Euclidean distance between each client model parameter and the server model parameter The formula is as follows: The value vector for a client model is S44. Update the global model on the server side. Use the gradient descent method to update the global model. The formula is as follows: Where η is the learning rate.
Citation Information
Cited By
Method and device for optimizing battery health state prediction model based on federal continuous learning
CN120180101A
RUL prediction method based on sorting contrast learning under federated learning
CN120850251A
Data center uninterruptible power supply intelligent control method and device based on reinforcement learning
CN121332870A