Federal learning method for training energy storage battery life prediction model and related device

By using the federated learning method to train a high-precision battery life prediction model in the lithium battery dataset, the problems of data privacy protection and prediction accuracy are solved, and the grid stability and prediction efficiency are improved.

CN120671776APending Publication Date: 2025-09-19STATE GRID HENAN ELECTRIC POWER ELECTRIC POWER SCI RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510746941.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

While protecting data privacy, how to train a high-precision battery life prediction model in a decentralized lithium battery dataset to address the impact of lithium battery performance degradation on grid stability.

Method used

Using the federated learning method, the global model is initialized by the server and trained on the client. The local data set is used to generate a local model. The server determines the dynamic performance threshold based on the loss rate and adjusts the aggregation weight, ultimately forming a high-precision battery life prediction model.

Benefits of technology

It has achieved the goal of improving the accuracy of lithium battery life prediction, reducing the risk of data leakage, and improving power grid stability and prediction efficiency while protecting data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671776A_ABST
    Figure CN120671776A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning method for training an energy storage battery life prediction model and a related device, and relates to the field of federated learning, and the method comprises the steps: a server initializes a global model, and transmits the global model to each client; each client uses a local battery life training data set to train a currently received model to obtain a local model, and sends corresponding model parameters to the server; the server determines a dynamic performance threshold according to the loss rate in the training process of each local model, and determines an aggregation weight of each local model; and the server aggregates each local model parameter according to the aggregation weight to obtain an aggregation model. According to the method, the server determines the dynamic performance threshold according to the loss rate of the local model in the training process when aggregating the local models, and further determines the aggregation weight of each local model, so that the aggregation weight of each local model can be dynamically adjusted, and a battery life prediction model with higher precision can be trained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of federated learning, and in particular to a federated learning method and related devices for training an energy storage battery life prediction model. Background Art

[0002] In modern power systems, the stability and reliability of power equipment are crucial to the safe operation of the grid. As a core energy storage technology, lithium batteries, with their high energy density, fast response, and stable voltage output, play a key role in multiple aspects, including energy storage, power grids, power stations, and energy management. They not only provide peak and frequency regulation, balancing supply and demand, and enhancing grid stability and reliability, but also collaborate with renewable energy sources such as wind and solar power to address their intermittent and fluctuating performance and increase grid integration. However, with age, lithium battery performance deteriorates, not only impacting the normal operation of equipment but also potentially leading to high replacement costs and potential safety risks. Therefore, accurately predicting the remaining useful life of lithium batteries is crucial for preventing battery failures, reducing unplanned downtime, extending battery life, and ensuring the continuity and stability of power supply. Currently, many lithium battery datasets are scattered across different institutions. Jointly leveraging these datasets is a promising solution. However, how to leverage these dispersed datasets while protecting data privacy to train highly accurate battery life prediction models remains an urgent challenge. Summary of the Invention

[0003] The purpose of this application is to provide a federated learning method and related devices for training an energy storage battery life prediction model, which can derive a high-precision prediction battery life prediction model, thereby achieving accurate prediction of battery service life.

[0004] To achieve the above objectives, this application provides the following solutions:

[0005] In a first aspect, the present application provides a federated learning method for training an energy storage battery life prediction model, comprising:

[0006] The server initializes the global model and sends it to each client;

[0007] Each client trains the currently received model using the local battery life training dataset to obtain a local model, and sends the model parameters corresponding to the local model to the server;

[0008] The server determines a dynamic performance threshold based on the loss rate of each local model during training, and determines the aggregation weight of each local model based on the dynamic performance threshold;

[0009] The server aggregates the model parameters corresponding to each local model according to the aggregation weight of each local model to obtain an aggregated model;

[0010] Determine whether the termination condition is currently met; the termination condition is that the performance of the aggregation model reaches the preset performance requirement or the number of training rounds reaches the maximum number;

[0011] If yes, the current aggregate model is the trained battery life prediction model;

[0012] If not, the server sends the current aggregate model to each client and returns to step "each client uses the local battery life training dataset to train the currently received model."

[0013] In a second aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned federated learning method for training an energy storage battery life prediction model.

[0014] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned federated learning method for training an energy storage battery life prediction model.

[0015] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned federated learning method for training an energy storage battery life prediction model.

[0016] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0017] The present application provides a federated learning method and related devices for training energy storage battery life prediction models. The server initializes the global model and sends the global model to each client. Each client uses the local battery life training data set to train the currently received model to obtain a local model, and sends the model parameters corresponding to the local model to the server. The server determines the dynamic performance threshold according to the loss rate of each local model during the training process, and determines the aggregation weight of each local model according to the dynamic performance threshold. The server aggregates the model parameters corresponding to each local model according to the aggregation weight of each local model to obtain an aggregated model. In the present application, when aggregating each local model, the server determines the dynamic performance threshold according to the loss rate of the local model during the training process, and then determines the aggregation weight of each local model. It can dynamically adjust the aggregation weight of each local model, pay more attention to the local model with better performance, and thus train a battery life prediction model with higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 This is a diagram of an application environment for a federated learning method for training an energy storage battery life prediction model in one embodiment of the present application;

[0020] Figure 2 A flowchart of a federated learning method for training an energy storage battery life prediction model provided in one embodiment of the present application;

[0021] Figure 3 A schematic diagram of the technical concept of a federated learning method for training an energy storage battery life prediction model provided in one embodiment of the present application;

[0022] Figure 4 A schematic diagram of the structure of a global model provided in one embodiment of the present application;

[0023] Figure 5 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0025] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0026] The federated learning method for training the energy storage battery life prediction model provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal (client) communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The server initializes the global model and sends the global model to each client; each client uses the local battery life training data set to train the currently received model to obtain a local model, and sends the model parameters corresponding to the local model to the server; the server determines the dynamic performance threshold according to the loss rate of each local model during the training process, and determines the aggregation weight of each local model according to the dynamic performance threshold; the server aggregates the model parameters corresponding to each local model according to the aggregation weight of each local model to obtain an aggregate model; judges whether the termination condition is currently met; the termination condition is that the performance of the aggregate model reaches the preset performance requirements or the number of training rounds reaches the maximum number of rounds; if so, the current aggregate model is the trained battery life prediction model; if not, the server sends the current aggregate model to each client and returns to the step "each client uses the local battery life training data set to train the currently received model". The server can feedback the obtained trained battery life prediction model to each terminal.

[0027] In an exemplary embodiment, Figure 2 and Figure 3 As shown, a federated learning method for training an energy storage battery life prediction model is provided. The method is executed by a computer device, specifically by a terminal and a server. In the embodiment of the present application, the method is applied to Figure 1 The server and terminal in the example are used for description, including the following steps 101 to 107.

[0028] Step 101: The server initializes a global model and sends the global model to each client.

[0029] In step 102 , each client trains the currently received model using the local battery life training data set to obtain a local model, and sends the model parameters corresponding to the local model to the server.

[0030] In step 103 , the server determines a dynamic performance threshold according to the loss rate during the training of each local model, and determines an aggregation weight of each local model according to the dynamic performance threshold.

[0031] In step 104 , the server aggregates the model parameters corresponding to the local models according to the aggregation weight of each local model to obtain an aggregated model.

[0032] Step 105 , determining whether a termination condition is currently satisfied; the termination condition is that the performance of the aggregation model reaches a preset performance requirement or the number of training rounds reaches a maximum number.

[0033] If so, in step 106 , the current aggregated model is the trained battery life prediction model.

[0034] If not, step 107 is executed, the server sends the current aggregate model to each client, and returns to step 102 "each client uses the local battery life training data set to train the currently received model."

[0035] Implement the above steps 101 to 107, train local models on the private datasets of each client, and then aggregate these local models through dynamic weighted aggregation to form a global model to achieve collaborative prediction.

[0036] In another exemplary embodiment of the present application, in step 102, each client trains the currently received model using a local battery life training dataset to obtain a local model, specifically including:

[0037] (1) Each client pre-processes the local battery life data to obtain pre-processed data.

[0038] Data preprocessing includes removing outliers in the data and performing standard normalization.

[0039] (2) Construct a local battery life training dataset based on the preprocessed data.

[0040] (3) Each client uses the local battery life training dataset to train the currently received model to obtain a local model.

[0041] In another exemplary embodiment of the present application, Figure 4 As shown, the global model includes a position encoding layer, an encoder, an improved attention mechanism module and a decoder connected in sequence; the encoder and decoding layers adopt LSTM networks; the query vector and key-value pair in the improved attention mechanism module adopt different vectors.

[0042] In order to enhance the model's ability to model the nonlinearity, heterogeneity and time dependence of battery performance data, the present invention designs a deep learning model that combines position encoding, long short-term memory neural network and attention mechanism.

[0043] In another exemplary embodiment of the present application, in step 102, each client trains the currently received model using a local battery life training dataset to obtain a local model, specifically including:

[0044] (1) Each client performs position encoding on the local battery life training dataset to obtain position encoding data.

[0045] In order to enhance the temporal sequence features, the input data is first positionally encoded.

[0046]

[0047] Where PE() represents the positional encoding data, p represents the index of the position in the sequence, i represents the dimension index, and D represents the dimension of the positional encoding, whose value is equal to the feature dimension of the model.

[0048] (2) Input the positional encoding data into the LSTM network of the encoder to obtain the encoding feature h t .

[0049] In order to extract sequential degradation features, the data is further processed by an encoder LSTM.

[0050] i t =σ(W i ·[h t-1 ,x t ]+b i )#(3)

[0051] f t =σ(W f ·[h t-1 ,x t ]+b f )#(4)

[0052] o t =σ(W o ·[h t-1 ,x t ]+b o )#(5)

[0053]

[0054]

[0055] h t =o t *tanh(C t )#(8)

[0056] Where i t 、f t 、o t is the activation vector of the three gates (input gate, forget gate, output gate), σ is the sigmoid activation function, and tanh is the hyperbolic tangent function. σ and tanh functions introduce nonlinear characteristics into the LSTM network. t Represents the memory state at time t. C t Update the parameters based on the memory state and candidate memory state of the previous unit time. t Determine C t-1 Which part will be forgotten, t Sure Which part will be added to C t , then, calculate the value of the output gate. W i 、W f 、W o 、W c are the weight matrices of the input gate, forget gate, output gate and candidate memory unit, respectively, b i 、b f 、b o 、b f are the corresponding bias terms respectively; x t is the input data at time step t; o t is the activation value of the output gate, which controls the final output h t .

[0057] (3) Use the improved attention mechanism module to assign different weights to the encoding features for feature extraction, and obtain the extracted features. Specifically:

[0058] 1) The output vectors of the last time step in all layers in the improved attention mechanism module are averaged and used as the query vector in the attention mechanism.

[0059] 2) The hidden states of all time steps in the last layer of the improved attention mechanism module are used as key-value pairs in the attention mechanism.

[0060] 3) According to the current query vector and key value, different weights are assigned to the encoded features for feature extraction to obtain the extracted features.

[0061] The specific execution process of the improved attention mechanism module is as follows:

[0062]

[0063] b=p T ·h mean +q T ·h M #(10)

[0064] s enc =v T tanh(b)#(11)

[0065] a t =softmax(s enc )#(12)

[0066]

[0067] Where h mean Indicates h L Take the average value and use it as the query vector in the attention mechanism, s encrepresents the additive attention score function, which is used to measure h mean and h M The similarity between them, a represents the attention weight, which is calculated by the softmax function, and h w represents the weighted output (extracted features), which not only retains the integrity of the sequence but also weights the features of each time step; L represents the sequence length; v is a learnable parameter vector, which is used to perform a weighted summation of the activated b through linear transformation to obtain the attention score value; p and q are weight vectors, which respectively mean and h M Perform weighted summation to calculate the final attention score b. M represents the number of LSTM layers in the encoder; Formula (9) to Formula (13) are the execution process of the attention mechanism, and the hidden state sequence h output by the encoder is M,t (The hidden state of each time step of the Mth layer) participates in the calculation as a key-value pair in the attention mechanism. The attention vector h is the final output of the attention mechanism w The importance of features at different time steps is integrated to achieve enhanced modeling of key information in the sequence.

[0068] The hidden state h of all time steps in the last layer of the encoder's LSTM M =(h M,1 ,h M,2 …h M,L ) are used as key-value pairs. M is a two-dimensional vector, where the two dimensions are the time step and the number of hidden units. Then the output vector h of the last time step in all layers of the encoder's LSTM is L =(h 1,L ,h 2,L ,…,h m,L ,…,h M,L ) are averaged. L It is also a two-dimensional vector, where the two dimensions are the time step and the number of hidden units.

[0069] The attention mechanism (AM) consists of three elements: query, key, and value. In previous studies based on AM, the query vector (query), key (key), and value (value) are usually the same vector, that is, the self-attention mechanism is adopted. However, giving the same attention to the features at all time steps may cause the model to fail to effectively capture the key features. Therefore, in this application, the query vector is set to be different from the key-value pair. Specifically, in the last layer, the hidden state h of all time steps is M Both are used as key-value pairs.

[0070] (4) The extracted features are input into the LSTM network in the decoder to obtain the decoding features; the decoding features are processed by a single-layer fully connected neural network and the remaining life prediction results are obtained after regression processing.

[0071] H=LSTM(X,h0,c0)#(14)

[0072] Y=W fc H+b fc #(15)

[0073] Where, is the input sequence, is the output sequence of the decoder LSTM, B represents the batch size, that is, the number of samples processed in parallel at a time; T represents the time step, that is, the length of the input sequence; D m is the input feature dimension of the decoder LSTM; D hidden W represents the hidden state dimension of the decoder LSTM, which represents the feature dimension of each time step; h0 and c0 are the initial hidden state and cell state of LSTM respectively. fc and b fc Represent the weight matrix and bias vector of the fully connected layer, respectively, which are used to linearly transform the decoder output features to adapt to the output dimension of the regression task. Y represents the remaining life prediction result.

[0074] (5) Calculate the loss error based on the remaining life prediction results and the corresponding actual remaining life.

[0075] (6) Determine whether the loss error converges or reaches the maximum number of iterations.

[0076] If yes, a local model is obtained; if not, the process returns to the step of "each client performs position encoding on the local battery life training dataset".

[0077] In another exemplary embodiment of the present application, in step 103, a dynamic performance threshold is determined according to the loss rate during the model training process, and the calculation formula is:

[0078] θ new =β·θ old +(1-β)·(μ+α·σ std )#(16)

[0079] Where θ new represents the dynamic performance threshold corresponding to the current cycle round; θ old represents the dynamic performance threshold corresponding to the previous cycle; μ is the mean of the loss rates of all current local models; σ stdis the standard deviation of the loss rates of all current local models; the mean and standard deviation are introduced to better describe the distribution of client model performance. This method is similar to confidence interval estimation in statistics. By controlling the fluctuation range of the threshold, weight adjustment can be more flexible. α is an adjustable coefficient. By adjusting α, the threshold's responsiveness to performance differences can be controlled. A larger α makes weight adjustment more sensitive and can quickly respond to changes in client performance. β is a parameter that controls the smoothness of the threshold and is used to adjust the stability of weight adjustment to avoid excessive weight adjustment due to local fluctuations.

[0080] The weights of each local model are adjusted based on the performance threshold. Models with performance above the threshold have their weights appropriately increased during aggregation, while models with performance below the threshold have their weights appropriately reduced. k1 and k2 represent multiplicative coefficients for adjusting the weights, and their values ​​are determined using a grid search algorithm. Grid search is a hyperparameter optimization method that uses an exhaustive search within a predefined parameter space to find the parameter combination that optimizes model performance.

[0081] The calculation formula for the aggregation weight of each local model is:

[0082]

[0083] in,

[0084] Where w i represents the aggregation weight calculated in the previous cycle of the local model corresponding to client i. Initially, it refers to the initial preset aggregation weight; p i represents the local average loss corresponding to client i; w i " represents the adjusted aggregate weight of client i in the current round; w' j represents the adjusted aggregate weight of client j in the current cycle round; C represents the client set; k1 and k2 represent the multiplication coefficients of the adjusted weight.

[0085] The aggregation model is:

[0086] Where W global represents the aggregation model, N represents the number of clients, and W i The i-th client corresponds to the model parameters

[0087] The deep learning model and federated learning framework proposed in this application can effectively improve the accuracy of lithium battery remaining service life prediction, while solving the problem of data privacy protection in distributed learning. By introducing position encoding and an improved attention mechanism, the model's dependence on time series data and its ability to capture key features are enhanced. In addition, the improved federated learning weighting method can dynamically adjust the weights of model parameters based on the data quality of each participating institution and its contribution to the global model, thereby optimizing the global model performance. The method of this application allows each institution to independently train the model locally and only share model parameters, avoiding the risk of data privacy leakage, while improving the prediction efficiency and accuracy of the model in a distributed environment.

[0088] The present application also provides an application scenario, which applies the above-mentioned federated learning method for training the energy storage battery life prediction model. Specifically: the federated learning method for training the energy storage battery life prediction model provided in this embodiment can be applied to the lithium battery life prediction scenario in the power system. The scenario includes a model training link and a life prediction link; the model training link is used to apply the federated learning method to obtain a trained life prediction model; the life prediction link is used to predict the life of the lithium battery under actual working conditions in the power system based on the trained life prediction model. The federated learning method for training the energy storage battery life prediction model provided in this embodiment belongs to the model training link.

[0089] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store the trained battery life prediction model. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a federated learning method for training an energy storage battery life prediction model is implemented.

[0090] Those skilled in the art will understand that Figure 5The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.

[0091] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0092] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0093] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0094] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0095] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0096] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0097] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A federated learning method for training an energy storage battery life prediction model, characterized in that: include: The server initializes the global model and sends it to each client; Each client trains the currently received model using the local battery life training dataset to obtain a local model, and sends the model parameters corresponding to the local model to the server; The server determines a dynamic performance threshold based on the loss rate of each local model during training, and determines the aggregation weight of each local model based on the dynamic performance threshold; The server aggregates the model parameters corresponding to each local model according to the aggregation weight of each local model to obtain an aggregated model; Determine whether the termination condition is currently met; the termination condition is that the performance of the aggregation model reaches the preset performance requirement or the number of training rounds reaches the maximum number; If yes, the current aggregate model is the trained battery life prediction model; If not, the server sends the current aggregate model to each client and returns to step "each client uses the local battery life training dataset to train the currently received model".

2. The federated learning method for training an energy storage battery life prediction model according to claim 1, characterized in that: Each client uses the local battery life training dataset to train the currently received model to obtain a local model, specifically including: Each client pre-processes local battery life data to obtain pre-processed data; Construct a local battery life training dataset based on the preprocessed data; Each client uses the local battery life training dataset to train the currently received model to obtain a local model.

3. The federated learning method for training an energy storage battery life prediction model according to claim 1, characterized in that: The global model includes a position encoding layer, an encoder, an improved attention mechanism module and a decoder connected in sequence; the encoder and decoding layers adopt LSTM networks; Improve the attention mechanism module to use different vectors for query vectors and key-value pairs.

4. The federated learning method for training an energy storage battery life prediction model according to claim 3, characterized in that: Each client uses the local battery life training dataset to train the currently received model to obtain a local model, specifically including: Each client performs position encoding on the local battery life training dataset to obtain position encoding data; Input the position-encoded data into the LSTM network of the encoder to obtain the encoding features; The improved attention mechanism module is used to assign different weights to the encoding features for feature extraction, and the extracted features are obtained; The extracted features are input into the LSTM network in the decoder to obtain the decoding features; the decoding features are processed by the fully connected neural network to obtain the remaining life prediction results; Calculate the loss error based on the remaining life prediction result and the corresponding actual remaining life; Determine whether the loss error has converged or reached the maximum number of iterations; If so, a local model is obtained; If not, return to step "each client position encodes the local battery life training dataset".

5. The federated learning method for training an energy storage battery life prediction model according to claim 4, characterized in that: The improved attention mechanism module is used to assign different weights to the encoding features for feature extraction, and the extracted features are obtained, including: The output vectors of the last time step of all layers in the improved attention mechanism module are averaged as the query vector in the attention mechanism; The hidden states of all time steps in the last layer of the improved attention mechanism module are used as key-value pairs in the attention mechanism; According to the current query vector and key value, different weights are assigned to the encoded features for feature extraction to obtain the extracted features.

6. The federated learning method for training an energy storage battery life prediction model according to claim 1, characterized in that: The calculation formula of the dynamic performance threshold is: i new =β·θ old +(1-β)·(μ+α·σ std ) Where θ new represents the dynamic performance threshold corresponding to the current cycle round; θ old represents the dynamic performance threshold corresponding to the previous cycle; μ is the mean of the loss rates of all current local models; σ std is the standard deviation of the loss rate of all current local models; α is an adjustable coefficient; β is a parameter that controls the smoothness of the threshold.

7. The federated learning method for training an energy storage battery life prediction model according to claim 6, characterized in that: The calculation formula for the aggregation weight of each local model is: in, Where w i represents the aggregation weight calculated in the previous cycle of the local model corresponding to client i; p i represents the local average loss corresponding to client i; w i " represents the adjusted aggregate weight of client i in the current round; w ' j represents the adjusted aggregate weight of client j in the current cycle round; C represents the client set; k1 and k2 represent the multiplication coefficients of the adjusted weight.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the federated learning method for training an energy storage battery life prediction model according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the federated learning method for training an energy storage battery life prediction model as described in any one of claims 1-7.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the federated learning method for training an energy storage battery life prediction model as described in any one of claims 1-7.