Battery performance degradation trend prediction method and device based on hierarchical federated learning, and electronic equipment
Through the layered federated learning architecture and improved K-medoids grouping technology, the model weight dispersion problem caused by data differences in federated learning is solved, the accuracy and efficiency of battery performance decay trend prediction is improved, communication pressure is reduced, and More efficient model training and prediction.
Patent Information
- Application Number
- CN202411380789.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-07
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
In the prior art, federated learning has dispersed model weights due to data differences in prediction of battery performance decay trends, resulting in low model accuracy and slow convergence speed. The communication pressure of traditional client-server architecture is too high, hindering the global prediction model. efficient construction.
Adopting a hierarchical federated learning architecture, local servers, edge servers and cloud servers are divided at levels, and using improved K-medoids federated grouping technology and model aggregation strategy, combined with a fallback update strategy, grouping and model parameters of battery capacity degradation data weighted aggregation improves the training accuracy and convergence efficiency of the model and reduces communication pressure.
Through the hierarchical federated learning architecture and improved K-medoids grouping technology, the global model convergence direction is stabilized, the training accuracy and convergence efficiency of the model are improved, the communication burden is reduced, and the gradient oscillation and weight divergence problems caused by data differences are avoided. , improves the accuracy of battery performance decay trend prediction.
Smart Images

Figure CN119310463A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of performance degradation trend prediction, and in particular to a battery performance degradation trend prediction method, device and electronic equipment based on hierarchical federated learning. Background Art
[0002] As lithium batteries are increasingly used in portable electronic devices, electric vehicles, aerospace and many other industrial fields, people have higher and higher requirements for the reliability of lithium batteries. High-reliability lithium batteries that can meet the system's specified functions within the specified use time and under the specified conditions are sought after and favored by people. However, traditional regular maintenance and post-repair methods can no longer meet people's requirements for high reliability of lithium batteries. The emergence of fault prediction and health management (PHM) technology provides a solution to improve the reliability of lithium batteries. Among them, performance degradation trend prediction technology, as one of the core contents of PHM technology, can accurately predict performance degradation trends based on historical status data and environmental conditions data, relying on performance degradation trend prediction technologies such as data-driven or physical model-driven, and transform traditional post-repair into active maintenance, thereby guiding maintenance and guarantee work and reducing the time cost and economic consumption of the maintenance process.
[0003] At present, a lot of research has been carried out on PHM research at home and abroad around data-driven performance degradation trend prediction methods, and certain results have been achieved. However, the accuracy of the prediction model is seriously restricted by the amount of degradation data. Generally speaking, the more degradation data, the higher the accuracy of the constructed model. However, the cost of obtaining full-life performance degradation data is too high, and for lithium batteries with the same formula, even if the full-life performance degradation data of a battery has been obtained, it is unrealistic for other batteries to use the data of the battery for the purpose of privacy protection and corporate competition. In addition, the data of different batteries are quite different, and the model development cost is high. It costs a lot to develop a specific prediction model for each battery separately, and the unified integration of data to develop a unified prediction model is constrained by communication burden and privacy protection. The emergence of federated learning has become a key technology to break this limitation. Federated learning is a distributed machine learning that replaces shared training data with shared model parameters. Federated learning can replace shared training data with shared model parameters without leaving the local area, so that multiple participants with different data holdings can jointly train a unified model. For participants with less data, it can reduce the cost of obtaining degradation data and improve the accuracy of their trend prediction.
[0004] Although federated learning solves the above problems, the problem of low model accuracy and slow convergence speed caused by the dispersion of model weights due to large data differences still needs to be solved. In addition, the introduction of federated learning in the scenario of multi-formula battery performance degradation trend prediction can comprehensively utilize a large amount of performance monitoring data of multiple batteries to improve the generalization ability of the performance degradation trend prediction model, which can avoid the problem of poor model effect caused by lack of degradation data. However, each battery is affected by individual differences, and the battery performance degradation trends reflected by their performance monitoring data may be quite different, which hinders the efficient construction of a global prediction model. At the same time, the communication pressure on the server side in traditional client-server architecture federated learning is too high. Summary of the invention
[0005] In view of the above-mentioned problem of low model accuracy and slow convergence speed caused by the dispersion of model weights due to large data differences, the present invention is proposed to provide a battery performance degradation trend prediction method, device and electronic device based on hierarchical federated learning to overcome the above-mentioned problems.
[0006] One aspect of the present invention provides a method for predicting battery performance degradation trend based on hierarchical federated learning, comprising:
[0007] Construct a hierarchical federated learning architecture for battery performance degradation trend prediction, which consists of a local server, an edge server, and a cloud server from bottom to top;
[0008] Obtaining battery capacity degradation data stored on each local server, and grouping the local servers using a federated grouping technique based on improved K-medoids and the battery capacity degradation data stored on each local server to determine a corresponding relationship between the edge server and the local server;
[0009] During the training of the hierarchical federated learning architecture using the battery capacity degradation data stored on each local server, the hierarchical federated learning architecture is trained by combining a model aggregation strategy and a fallback update strategy to obtain a trained hierarchical federated learning architecture;
[0010] The predicted battery performance degradation trend is predicted based on the trained hierarchical federated learning architecture.
[0011] Furthermore, the battery capacity degradation data is battery capacity degradation data of different models, different temperatures and different formulations.
[0012] Further, the local servers are grouped using the federated grouping technology based on improved K-medoids and the battery capacity degradation data stored on each local server to determine the corresponding relationship between the edge server and the local server, including:
[0013] The elbow method is used to determine the optimal number of clusters for all battery capacity degradation data, and the angle cosine distance is used as the distance metric in the K-Medoids clustering algorithm, and an improved K-Medoids clustering algorithm is obtained by combining the optimal number of clusters;
[0014] The battery capacity degradation data stored in each local server is grouped based on the improved K-Medoids clustering algorithm so as to group batteries with similar battery capacity decay curves;
[0015] A corresponding relationship is established between at least one local server storing a battery capacity decay curve similar to the edge server to determine the corresponding relationship between the edge server and the local server.
[0016] Furthermore, the model aggregation strategy includes:
[0017] Each edge server calculates the average loss of each corresponding local server model and calculates the weight coefficient of each edge server model using adaptive weights;
[0018] The cloud server performs weighted aggregation of each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server.
[0019] Furthermore, the weight coefficient of each edge server model is calculated using the adaptive weight including:
[0020]
[0021] Where W[k] represents the weight coefficient, represents the average loss of the local server model of client k; n represents the number of clients.
[0022] Furthermore, the cloud server performs weighted aggregation of each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server including:
[0023]
[0024] Among them, GM represents the global model, N k Denotes the local dataset D of client k k The size of N represents the size of the entire data set, M k Represents the local server model of client k.
[0025] Furthermore, the rollback update strategy includes:
[0026] A fallback window of size n is set on each local server to record the weight parameters of the local model in n updates;
[0027] If the loss of the local model continues to increase during n updates, the local model is rolled back to the state before n rounds of updates according to the weight parameters of the model in the rollback window;
[0028] If the loss of the local model does not continue to increase in n updates, then in each update round, the first element in the backoff window is discarded and the local model weight is added to the end of the backoff window.
[0029] Furthermore, during the training of the hierarchical federated learning architecture using the battery capacity degradation data stored on each local server, the following steps are included:
[0030] The local server trains the model locally with local data. The edge server receives the local model parameters for preliminary aggregation and uploads the results to the cloud server. The cloud server aggregates the edge server model parameters and sends the results to the edge server. The edge server then sends the model parameters to the local server to update the model.
[0031] Another aspect of the present invention provides a battery performance degradation trend prediction device based on hierarchical federated learning, comprising:
[0032] A building module for building a hierarchical federated learning architecture for battery performance degradation trend prediction, which consists of a local server, an edge server, and a cloud server from bottom to top;
[0033] A grouping module, used to obtain battery capacity degradation data stored on each local server, and group the local servers using a federated grouping technology based on improved K-medoids and the battery capacity degradation data stored on each local server to determine a corresponding relationship between an edge server and a local server;
[0034] A training module, used for training the hierarchical federated learning architecture by using the battery capacity degradation data stored on each local server, and combining a model aggregation strategy and a fallback update strategy to train the hierarchical federated learning architecture to obtain a trained hierarchical federated learning architecture;
[0035] The prediction module is used to predict the battery performance degradation trend to be predicted based on the trained hierarchical federated learning architecture.
[0036] Another aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the steps of the battery performance degradation trend prediction method based on hierarchical federated learning as described above are implemented.
[0037] The battery performance degradation trend prediction method, device and electronic device based on hierarchical federated learning provided in the embodiments of the present invention introduce a hierarchical federated learning architecture, and apply the federated grouping technology based on improved K-medoids to the division of local servers and the correspondence between local servers and edge servers in the hierarchical federated learning architecture. Subsequently, the model aggregation strategy and fallback update strategy in the hierarchical federated learning architecture are studied. Further, considering the continuous growth of data, regularized incremental learning is introduced to improve the prediction effect of the model.
[0038] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. In the accompanying drawings:
[0040] Figure 1 A flowchart of a method for predicting battery performance degradation trend based on hierarchical federated learning provided in an embodiment of the present invention;
[0041] Figure 2 A schematic diagram of a federated grouping technology based on decay curve similarity clustering provided by an embodiment of the present invention;
[0042] Figure 3 A comparison chart of lithium battery capacity degradation data at test temperatures of 25°C, 45°C and 60°C provided in an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of an elbow diagram of different distance measurement methods at test temperatures of 25°C, 45°C and 60°C provided by an embodiment of the present invention;
[0044] Figure 5 Schematic diagram of silhouette coefficient of K-medoids clustering algorithm at different temperatures provided by an embodiment of the present invention;
[0045] Figure 6 A flowchart of a method for predicting performance degradation trends based on hierarchical federated learning provided in an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of a hierarchical federated learning architecture provided for an embodiment of the present invention;
[0047] Figure 8A schematic diagram of a technology for predicting performance degradation trends based on a multi-scale temporal convolutional network provided by an embodiment of the present invention;
[0048] Fig. 9 A schematic diagram of a performance degradation trend prediction process based on a multi-scale time convolutional neural network provided in an embodiment of the present invention;
[0049] Fig.10 The present invention is a schematic diagram of the structure of a battery performance degradation trend prediction system based on hierarchical federated learning according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0051] The present invention is based on the improved K-medoids federated grouping technology. By dividing the data with high similarity into a group, the weight divergence phenomenon caused by large data differences is reduced, and the purpose of stabilizing the convergence direction of the global model is achieved. Furthermore, based on the improved K-medoids federated grouping technology, considering the large differences in the decay data of multi-formula batteries, directly using these batteries in federated learning is likely to cause the global model to produce weight divergence, which will greatly slow down the training speed of the model and reduce the accuracy of the model. In view of the model weight divergence problem caused by directly applying federated learning to the decay data of multi-formula batteries, the similarity of the decay data of multi-formula batteries is calculated, and multiple batteries with correlation are clustered based on the similarity, so as to improve the model convergence consistency of the same group of batteries, thereby reducing the gradient oscillation and weight divergence problems caused by the large differences in the data of the participants, and improving the training accuracy and convergence efficiency of federated learning.
[0052] Aiming at the problem of excessive communication burden of the server in the traditional client-server federated learning architecture, the communication pressure of the server is dispersed by introducing a hierarchical federated architecture. At the same time, the hierarchical federated learning architecture introduced is used to improve the prediction accuracy of the model based on the federated aggregation strategy based on fallback. Furthermore, in the battery performance degradation trend prediction method based on hierarchical federated learning, in the collaborative prediction scenario of multiple battery degradation trends, the comprehensive use of a large amount of performance monitoring data of multiple batteries to improve the generalization ability of the degradation trend prediction model is of great significance for accurate prediction, and can avoid the problem of overfitting caused by the inability to build the model due to the lack of degradation data or the single degradation mode. However, each battery is affected by individual differences, different usage time, different working environment and other factors, and the degree of degradation and degradation trend reflected by its performance monitoring data may be quite different, which brings obstacles to the efficient construction of the global prediction model. The federal grouping technology based on decay feature clustering is used to solve the problems of gradient oscillation and weight divergence caused by the large difference in data between the participants, and further improve the training accuracy and convergence efficiency of the model and reduce the communication burden. The present invention introduces a hierarchical federated learning architecture and studies the model update strategy in federated learning. Based on the federated grouping, federated learning is divided into three layers: local servers, edge servers, and cloud servers. After determining the architecture of hierarchical federated learning, the model aggregation strategy and selective update strategy are designed, and the local model is selectively updated according to the selective update strategy. Further considering the continuous growth of data in practice, regularized incremental learning is also introduced in this architecture to continuously improve the prediction effect of the model.
[0053] The present invention is based on the improved K-medoids federated grouping technology. By dividing the data with high similarity into a group, the weight divergence caused by large data differences is reduced, thereby achieving the purpose of stabilizing the convergence direction of the global model. In order to solve the problem of excessive communication burden on the server in the traditional client-server federated learning architecture, a hierarchical federated architecture is introduced to disperse the communication pressure of the server, and the model aggregation strategy and fallback update strategy are studied to improve the prediction accuracy of the model. Further considering the continuous growth of data in practice, the federated grouping technology based on the improved K-medoids is used for continuous adjustment, and regularized incremental learning is introduced to continuously improve the prediction effect of the model. Figure 1 As shown, the present invention provides a battery performance degradation trend prediction method based on hierarchical federated learning, comprising:
[0054] S1: Build a hierarchical federated learning architecture for battery performance degradation trend prediction, which consists of a local server, an edge server, and a cloud server from bottom to top;
[0055] S2: obtaining battery capacity degradation data stored on each local server, and grouping the local servers using a federated grouping technique based on improved K-medoids and the battery capacity degradation data stored on each local server to determine a corresponding relationship between the edge server and the local server;
[0056] Furthermore, the battery capacity degradation data is battery capacity degradation data of different models, different temperatures and different formulations.
[0057] Furthermore, the local servers are grouped using the improved K-medoids-based federated grouping technology and the battery capacity degradation data stored on each local server to determine the corresponding relationship between the edge server and the local server, including: using the elbow method to determine the optimal number of clusters for all battery capacity degradation data, and using the angle cosine distance as the distance metric in the K-Medoids clustering algorithm, and combining the optimal number of clusters to obtain an improved K-Medoids clustering algorithm; based on the improved K-Medoids clustering algorithm, the battery capacity degradation data stored on each local server are grouped so that batteries with similar battery capacity degradation curves are grouped together; establishing a corresponding relationship between at least one local server storing a similar battery capacity degradation curve and the edge server to determine the corresponding relationship between the edge server and the local server.
[0058] S3: While the hierarchical federated learning architecture is being trained using the battery capacity degradation data stored on each local server, the hierarchical federated learning architecture is trained by combining a model aggregation strategy and a fallback update strategy to obtain a trained hierarchical federated learning architecture;
[0059] Furthermore, the model aggregation strategy includes: each edge server calculates the average loss of its corresponding local server models, and uses adaptive weights to calculate the weight coefficient of each edge server model; and the cloud server performs weighted aggregation on each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server.
[0060] Furthermore, the weight coefficient of each edge server model is calculated using the adaptive weight including:
[0061]
[0062] Where W[k] represents the weight coefficient, represents the average loss of the local server model for client k.
[0063] Furthermore, the cloud server performs weighted aggregation of each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server including:
[0064]
[0065] Among them, GM represents the global model, N k Denotes the local dataset D of client k k The size of N represents the size of the entire data set, M k Represents the local server model of client k.
[0066] Furthermore, the rollback update strategy includes: setting a rollback window of size n on each local server to record the weight parameters of the local model in n updates; if the loss of the local model continues to increase during n updates, the local model is rolled back to the state before n rounds of updates according to the weight parameters of the model in the rollback window; if the loss of the local model does not continue to increase during n updates, then for each update round, the first element in the rollback window is discarded, and the local model weight is added at the end of the rollback window.
[0067] Furthermore, during the training of the hierarchical federated learning architecture using the battery capacity degradation data stored on each local server, the local server trains the model locally using local data, the edge server receives the local model parameters for preliminary aggregation and uploads the results to the cloud server, the cloud server aggregates the edge server model parameters and sends the results to the edge server, and the edge server then sends the model parameters to the local server for updating the model.
[0068] S4: Predict the battery performance degradation trend based on the trained hierarchical federated learning architecture.
[0069] The following is combined with Figure 2-Figure 10 Further explanation of the technical content of the present invention
[0070] Federated grouping technology based on improved K-medoids
[0071] (1) Introduction to K-medoids clustering algorithm
[0072] K-medoids algorithm: Assume that the data set X1 contains N data objects = {x1, x2, x3, ... x N}, each data object contains M-dimensional features. Now we plan to use the K-mediods algorithm to divide the data set into k different clusters C j ={c1,c2,c3,…c k For any class of clusters, except for the data object c j In addition, other data samples x i With c j The distance between them is d(x i ,c j) is used to measure, where d(x i ,c j ) is the Euclidean distance between two sample points, and the sum of squared errors is used to measure the center point c of each cluster. j The quality is shown in the following formula:
[0073]
[0074] In the formula, E is the total number of objects p and clusters C in the data set j Represents object c j The K-medoids algorithm usually uses the cost function shown above to evaluate whether the clustering quality is optimized. E2 represents the sum of the absolute error values between all representative points in the data set with the replaced center point and the new center point of their clusters, and E1 represents the sum of the absolute error values between all representative points in the data set with the center point replaced and the center point of their clusters before replacement. S represents the difference before and after replacement. If S<0, the new center point replaces the old center point. After the replacement is completed, the remaining data samples are re-divided into the cluster represented by the center point closest to it; if S≥0, there is no need to change the current center point.
[0075] S=E2-E1
[0076] In order to obtain the best clustering effect at each reallocation, the sum of squared errors must be as small as possible. By comparing the difference between the sum of squared errors of the new and old center points, it is evaluated whether the new center point after replacement can replace the previous center point. In the process of repeatedly replacing the center points of clusters, the sum of absolute error values continues to decrease until the difference between the sum of squared errors of the new and old center points of clusters reaches a certain threshold or no longer changes, then the set of output clusters is obtained, and the best clustering effect is obtained.
[0077] (2) Federated grouping technology based on improved K-medoids
[0078] In combination with the prediction task, the focus is on the curve trend. The dynamic time warping distance, angle cosine distance and Euclidean distance are used as the distance measurement algorithms in the K-medoids algorithm to group the performance decay curves of multiple objects by similarity, so as to achieve the purpose of grouping batteries with similar performance decay curve shapes. Specifically, the elbow method is first used to determine the optimal number of clusters. On this basis, the dynamic time warping distance, Euclidean distance and angle cosine distance are used based on the K-medoids algorithm to measure the similarity of the performance trend decay curves of different lithium batteries, and cluster analysis is performed based on the determined optimal number of clusters.
[0079] The core indicator of the elbow method is SSE (sum of the squared errors), which measures the quality of clustering effect.i is the i-th cluster, p is C i The sample points in m i It is C i The centroid of (the mean of all samples in Ci). The core idea of the elbow method is: as the number of clusters k increases, the sample division will be more refined, the degree of aggregation of each cluster will gradually increase, and the SSE will gradually decrease. When k is less than the actual number of clusters, increasing k will greatly increase the degree of aggregation of each cluster, and the decrease in SSE will be large. When k reaches the actual number of clusters, the return on the degree of aggregation obtained by increasing k will rapidly decrease, and the decrease in SSE will drop sharply, and then tend to be flat as the k value continues to increase. Therefore, the relationship graph between SSE and k is in the shape of an elbow, and the k value corresponding to this elbow is the actual number of clusters of the data, which is why this method is called the elbow method. The elbow method is used to determine the optimal number of clusters for lithium battery data. According to the rule of the elbow method, the k corresponding to the elbow of the relationship graph between the number of clusters and the average degree of distortion is the optimal number of clusters. The calculation formula is shown below.
[0080]
[0081] Example
[0082] Introduction to Lithium Battery Capacity Degradation Dataset
[0083] In order to verify the effectiveness of the federated grouping technology based on improved K-Medoids, lithium battery capacity degradation data is used for verification. This data set is collected through cycle life experiments on a lithium-ion battery cycle life test bench designed by a new energy technology company. It contains lithium-ion battery capacity degradation data at three different temperatures (25°C, 45°C, and 60°C) and 10 different formulations (Groups A, B, C, D, E, F, G, H, I, and J). The original degradation data (remaining capacity) of lithium batteries with different formulations are shown in Figure 2. Figure 3 As shown. A sample is randomly selected from the capacity degradation data of lithium batteries of each formula for plotting. It can be seen from the figure that the degradation data of lithium batteries with different formulas are quite different. Directly using them in federated learning will inevitably cause weight divergence and slow convergence problems. Therefore, lithium batteries under three temperature conditions of 25℃, 45℃ and 60℃ are grouped using the federated grouping technology based on improved K-medoids.
[0084] (11) Lithium battery test temperature T
[0085] The lithium battery data set was obtained through cyclic charge and discharge life tests under three temperature conditions: 25°C, 45°C, and 60°C, where 25°C was used as the standard test temperature condition, and 45°C and 60°C were used as high temperature test temperature conditions.
[0086] (12) Cyclic charge and discharge process
[0087] The cycle charge and discharge life test is carried out in a constant current and voltage limiting manner. The constant current and voltage limiting charge and discharge method refers to charging and discharging the battery with a constant current and a limited voltage range. Among them, the charge and discharge current is 2000mA, and the charge and discharge voltage range is 2.78V-4.2V.
[0088] (13) Lithium battery failure threshold TS EOL (End of life conditions)
[0089] Subject to test conditions and test costs, TS was selected EOL =82% is taken as the failure threshold of the battery. In the continuous charge and discharge cycle, when it is found that the capacity of the lithium battery has degraded to 82% of the initial capacity, it is determined that the lithium battery has reached the end of life condition and the test is stopped immediately.
[0090] Data preprocessing
[0091] Due to the non-stationarity of the lithium battery capacity degradation process or the influence of the data acquisition process, there are data fluctuations or outliers in the original capacity degradation data. Therefore, the lithium battery capacity degradation data at different test temperatures are normalized and smoothed. Among them, the normalization process can make different samples have the same distribution scale, which is convenient for measuring the similarity of individual degradation data of different samples. During the lithium battery cycle life test, the battery capacity gradually decreases from the initial value to the preset failure threshold, which means the end of the service life of the lithium battery. This paper selects 82% of the initial capacity of the lithium battery as the failure threshold. The original data is smoothed using local weighted regression. While eliminating noise interference, the smoothing process retains the overall degradation trend of the original curve to the maximum extent. The capacity degradation curve becomes smooth, which is conducive to improving the accuracy of similarity calculation.
[0092] Federated grouping technology based on improved K-medoids
[0093] At different temperatures, the elbow method is used to determine the optimal number of clusters. The elbow graphs of different distance measurement methods at different temperatures are plotted as follows: Figure 4 As shown, it can be determined that the optimal number of clusters is 4.
[0094] The K-medoids algorithm is used to cluster lithium batteries at 25 degrees, 45 degrees, and 60 degrees respectively. The dynamic time warping distance, Euclidean distance, and angle cosine distance are used to measure the similarity of the performance trend decay curves of different lithium batteries. According to the selected number of clusters, cluster analysis is performed on the performance decay data of lithium batteries at 25 degrees, 45 degrees, and 60 degrees.
[0095] The silhouette coefficients of K-medoids clustering based on dynamic time warping distance, angle cosine distance, and Euclidean distance at different temperatures were statistically analyzed, and it was found that the clustering effect based on dynamic time warping distance, angle cosine distance, and Euclidean distance to measure similarity was good, and the effect based on angle cosine distance was the best, such as Figure 5 In general, the dynamic time rule distance and the Euclidean distance measure the distance between two curves, while the angle cosine distance measures the similarity of the trends between the two curves. The more similar the trends of the two curves are, the more similar their degradation laws are.
[0096] like Figure 2 As shown, the present invention takes into account that directly introducing federated learning in the decay trend prediction scenario of multi-formula batteries will cause the model weight to diverge due to large data differences, thereby reducing the model training speed and model accuracy. The present invention clusters and groups curves with similar trends by using similarity measurement technology and K-medoids algorithm, thereby improving the model convergence consistency of batteries in the same group, thereby improving the model training speed and accuracy.
[0097] In summary, the federated grouping technology based on improved K-medoids can group batteries with similar decay curves into a group, thereby alleviating gradient oscillation and weight divergence, improving the training accuracy and convergence efficiency of federated learning, and providing services for subsequent hierarchical federated learning architectures. Further considering the scenario of growing data in actual applications, this grouping technology can be used continuously as the data grows and the architecture can be adjusted dynamically.
[0098] Prediction model architecture based on dynamic grouping and hierarchical federated learning
[0099] The present invention introduces a hierarchical federated learning architecture, such as Figure 7 As shown in the figure, from bottom to top, they are local servers, edge servers, and cloud servers. The participants are divided based on the improved K-medoids federated grouping technology. The corresponding relationship between local servers and edge servers is determined according to the grouping results. The local server trains the model locally with local data. The edge server receives the local model parameters for preliminary aggregation and uploads the results to the cloud server. The cloud server aggregates the edge server model parameters and sends the results to the edge server. The edge server then sends the model parameters to the local server to update the model, including:
[0100] (21) Federated grouping: All local servers participating in hierarchical federated learning are numbered, and the data of the local servers is encrypted and handed over to the grouping server to group the local servers based on the improved K-medoids federated grouping technology to determine the number of edge servers and their corresponding relationships.
[0101] (22) Initialize the global model: The cloud server generates the model initialization parameters, which are the learning rate, the number of local training iterations on the local server, and the number of iterations on the edge server, and then broadcasts them.
[0102] (23) Sending global model parameters: The edge server receives the global model parameters from the cloud server and further sends the global model parameters to the local server.
[0103] (24) Train the local model and upload model parameters: The local server uses local data to train the local model and uploads the local model parameters to the edge server.
[0104] (25) Collect model loss and upload model loss and parameters: The edge server collects model loss and model parameters and uploads them to the cloud server for aggregation.
[0105] (26) Update the global model: The cloud server updates the global model parameters and broadcasts them to the edge servers again.
[0106] (27) Sending updated model parameters: The edge server sends updated global model parameters to the local server.
[0107] (28) Update local model: The local server updates the local model based on the global model parameters sent to complete a round of training.
[0108] (29) The above process is repeated until the specified number of cycles is reached or the model loss reaches the specified range.
[0109] Prediction model aggregation strategy and fallback update strategy
[0110] In multiple scenarios of collaborative prediction of battery degradation trends, model aggregation strategy and backoff update strategy are designed to improve the model convergence efficiency and model accuracy of hierarchical federated learning.
[0111] The classic federated average aggregation algorithm only considers the impact of the client data set size on the global model, and ignores the impact of the client model effect on the global model. To address this problem, the model aggregation strategy of the present invention collects the average loss of the local model on the edge server, and then uses the adaptive weight calculation formula to calculate the weight coefficient of each edge model. The cloud server performs weighted aggregation of the edge server model parameters based on the adaptive weights to obtain the cloud server model parameters, such as Figure 6 shown.
[0112]
[0113] Where GM represents the global model, N k Denotes the local dataset D of client k kThe size of N represents the size of the entire data set, M k represents the local model of client k.
[0114] When the edge server sends model parameters to the local server, there is a situation where the sent model parameters are not applicable to the local server, resulting in low model convergence efficiency and poor model effect of the local server. To address this problem, a rollback update strategy is designed. The rollback update strategy is to set a rollback window of size n on each local server to record the weight parameters of the local model in n updates. If it is found that the loss of the local model continues to increase in n updates, it means that these n updates are not applicable to the local model. Then, according to the weight parameters of the model in the rollback window, the local model is rolled back to the state before n rounds of updates. If it is found that the loss of the local model does not continue to increase in n updates, then after each update round, the first element in the rollback window is discarded, and the local model weight is added at the end of the rollback window, such as Figure 6 shown.
[0115] Federated incremental learning method considering data growth
[0116] Incremental learning means that a learning system can continuously learn new knowledge from new samples and can preserve most of the previously learned knowledge. Incremental learning also plays an important role in machine learning. The cost of modifying a trained system is usually lower than retraining a system. Incremental learning means that whenever new data is added, the knowledge base does not need to be rebuilt. Instead, the knowledge base is incrementally updated based on the new information brought by the new data.
[0117] Incremental learning can be divided into model structure-based methods, replay-based methods, and regularization-based methods. The model structure-based method is to continuously modify the network structure with incremental learning. For example, a new model structure is added to the incremental task, so that the old task can be maintained through the old model weights, and the newly added model structure adapts to the new task; the replay-based method refers to reusing or resampling previously learned samples when learning new tasks, so that these samples can be used again in the new learning process. This method is to use the knowledge that has been learned to help learn new tasks; the regularization-based method can help the model maintain good performance on the original task while adapting to new tasks. This method is simple to implement and can effectively improve model performance. It is widely used in practice. Incremental learning is performed by introducing regularization terms in the loss function of the local model, so that the model can maintain its memory of old data while learning new data, thereby continuously improving the model effect. As shown in the following formula, Represents the loss value of the local model on the new data in the e-th iteration, Represents the loss value of the local model on the old data in the e-th iteration.
[0118]
[0119] Example
[0120] The present invention uses the federated grouping technology based on improved K-medoids to group lithium batteries at 25°C, 45°C and 60°C. There are 46 batteries at 25°C, 55 batteries at 45°C and 32 batteries at 60°C. The batteries are numbered starting from 1, and the grouping is shown in Table 1.
[0121] Table 1 Lithium battery grouping at 25℃, 45℃ and 60℃ test temperatures
[0122]
[0123] For each multi-formula battery sample at each temperature, let the original data length be length, randomly select one or more batteries, and then generate a scaling factor scale less than 1. For the selected battery, the prediction task is to use the data of [0, scale*length) to predict the data of [scale*length, length]. For the unselected batteries, the value of scale is uniformly set to 0.8. The battery numbers selected at each temperature and the generated scaling factor scale are statistically shown in Table 2.
[0124] Table 2 Scaling battery serial number and scaling factor
[0125]
[0126] The battery performance degradation trend prediction technology based on multi-scale time convolutional neural network is used to predict the degradation trend. The input and output of the model are constructed by trying different step intervals and data numbers many times. Combined with the receptive field size of the multi-scale time convolutional neural network model, the input and output of the model are set as follows according to the model training effect: Model input: Input data X = (x t-30 ,……,x t-2 ,x t-1 ) is a time window data with a shape of (1×30), containing 30 data points in total, and the step interval of the data points is 1. Model output: Output data Y = (x t ) is a time window data with a shape of (1×1) and contains 1 data point.
[0127] After the data set is processed and the prediction model is selected, we first compare the prediction effects before and after the introduction of hierarchical federated learning to prove that the overall prediction model becomes better after the introduction of hierarchical federated learning. Then, we compare the prediction effects of using the model aggregation strategy and the fallback update strategy in the hierarchical federated learning architecture to prove the effectiveness of the designed strategy. Finally, we prove that under the condition of data growth, the introduction of federated incremental learning in the hierarchical federated learning architecture improves the model prediction effect.
[0128] (31) Comparison of the prediction effects before and after the introduction of hierarchical federated learning in the battery performance degradation trend prediction technology based on multi-scale time convolutional neural network
[0129] The predictions were carried out for batteries at three temperatures, 25°C, 45°C and 60°C, using hierarchical federated learning and multi-scale time convolutional neural networks respectively. From the prediction results, it can be seen that hierarchical federated learning improves the model prediction effect of individuals with less training data.
[0130] The prediction effect is evaluated using mean square error (MSE) and mean absolute error (MAE) indicators. The average values of MSE and MAE under different temperature conditions are recorded in Table 3. It can be clearly seen that the overall prediction effect of the model is improved after the introduction of the hierarchical federated architecture. The reason is that with the assistance of individuals with a large amount of data, the prediction effect of the model constructed by individuals with a small amount of data has been greatly improved, thereby improving the overall prediction effect of the model.
[0131] Table 3 Comparison of prediction effects of two methods under different temperature conditions
[0132]
[0133] (32) Comparison of prediction results using model aggregation strategy and backoff update strategy
[0134] In order to further improve the prediction effect of the model, a model aggregation strategy and a fallback update strategy are designed. In the aforementioned multi-formula battery hierarchical federated learning architecture, the designed strategy is used as a single variable, and other settings are kept consistent to compare the prediction effect of the model before and after using the strategy. MSE is used to evaluate the model prediction effect before and after using the model aggregation strategy and the fallback update strategy as shown in Table 4. It can be clearly seen from the numerical values that after using the strategy, since the local model can be selectively updated, and the aggregation strategy considers the impact of the local model effect on the global model, the final overall prediction effect is improved.
[0135] Table 4 Comparison of prediction effects before and after using model aggregation strategy and backoff update strategy
[0136]
[0137] (33) Prediction effect of federated incremental learning considering data growth
[0138] Considering that the data is in a state of continuous growth in actual situations, in order to continuously improve the prediction effect of the model and make full use of the existing data, regularized incremental learning is introduced. On the basis of retaining the above settings, the growth of battery data is simulated by randomly expanding the scaling factor. The specific scaling factor settings are shown in Table 5. After the data grows, it is first grouped based on the improved K-medoids federated grouping technology.
[0139] Table 5 Scaling factor settings for battery data growth scenarios
[0140]
[0141] The prediction results before and after the introduction of regularized incremental learning are recorded in Table 6. It can be clearly seen from the numerical values that the overall prediction effect has been improved after the introduction of regularized incremental learning. This is the result of the model being trained using growth data without forgetting the original training effect.
[0142] Table 6 Comparison of prediction effects before and after the introduction of regularized incremental learning
[0143]
[0144] The present invention compares the prediction effects before and after the introduction of hierarchical federated learning, proves that the overall prediction model becomes better after the introduction of hierarchical federated learning, and then compares the prediction effects of using the model aggregation strategy and the fallback update strategy in the hierarchical federated learning architecture to prove the effectiveness of the designed strategy. Finally, it proves that under the condition of data growth, the model prediction effect is improved by introducing federated incremental learning in the hierarchical federated learning architecture. The battery performance degradation trend prediction technology based on dynamic grouping and hierarchical federated learning can use individuals with more data to assist individuals with less data in training models to improve the overall prediction effect.
[0145] The present invention also includes: using a temporal convolutional neural network (Temporal Convolutiona l Networks) in combination with a gated recurrent unit (Gate Recurrent Unit) to build a TCN-GRU model. Generate data to be predicted under large-scale conditions by polynomial fitting, and use the generated data in the TCN-GRU model to predict performance degradation trends under small-scale conditions, and finally achieve accurate prediction, which specifically includes: obtaining the existing performance degradation trend data of the battery, and fitting the existing performance degradation trend data of the battery by polynomials to obtain the predicted performance degradation trend data under large-scale conditions; constructing a TCN-GRU model of a temporal convolutional neural network combined with a gated recurrent unit, and training the TCN-GRU model using the existing performance degradation trend data of the battery to obtain a trained TCN-GRU model; by inputting the performance degradation trend data to be predicted into the trained TCN-GRU model for prediction, the predicted performance degradation trend data under small-scale conditions are obtained; using the predicted performance degradation trend data under large-scale conditions and the predicted performance degradation trend data under small-scale conditions, the battery performance degradation trend prediction result is obtained.
[0146] Among them, fitting the existing performance degradation trend data of the battery by polynomial to obtain the predicted performance degradation trend data under large-scale conditions includes: taking the existing performance degradation trend data of the battery as the original data, and cyclically selecting numbers in the nm range to perform polynomial fitting on the original data to obtain fitting data corresponding to each number in the nm range; wherein n and m are both positive integers, and n is less than m; calculating the mean square error value between the original data and the fitting data corresponding to each number in the nm range, and taking the number corresponding to the minimum mean square error value as the best polynomial fitting number, and at the same time taking the fitting data corresponding to the number as the predicted performance degradation trend data under large-scale conditions.
[0147] The TCN-GRU model includes a data input layer, a TCN layer, a reconstruction layer, a GRU layer and a fully connected layer; wherein the TCN layer is used to learn local area features in performance decay trend data, and the GRU layer is used to learn long-term correlations in local area features of performance decay trend data.
[0148] Among them, using the predicted performance degradation trend data under the large-scale conditions and the predicted performance degradation trend data under the small-scale conditions to obtain the battery performance degradation trend prediction result includes: calculating the first mean square error between the predicted performance degradation trend data under the large-scale conditions and the existing performance degradation trend data of the battery; calculating the second mean square error between the predicted performance degradation trend data under the small-scale conditions and the existing performance degradation trend data of the battery; according to the first mean square error, the second mean square error, the predicted performance degradation trend data under the large-scale conditions and the predicted performance degradation trend data under the small-scale conditions, obtaining the battery performance degradation trend prediction result. Furthermore, according to the first mean square error, the second mean square error, the predicted performance degradation trend data under the large-scale conditions and the predicted performance degradation trend data under the small-scale conditions, obtaining the battery performance degradation trend prediction result includes:
[0149]
[0150] Among them, MSE1 refers to the first mean square error; MSE2 refers to the second mean square error; y1 refers to the predicted performance degradation trend data under large-scale conditions; y2 refers to the predicted performance degradation trend data under small-scale conditions; y refers to the battery performance degradation trend prediction result.
[0151] Building a TCN-GRU model includes: determining the shape of input data, the number of convolutional layers, the size of the convolution kernel, the size of the expansion factor, the pooling method and other model parameters, as well as the shape of the output layer and the activation function to define the model structure; after defining the model structure, selecting a suitable optimizer, loss function and evaluation index to compile the TCN-GRU model; dividing the existing performance degradation trend data of the battery into a training set and a test set and loading them into the memory, and preprocessing and normalizing the training set and the test set loaded into the memory.
[0152] The TCN-GRU model is trained using the existing performance degradation trend data of the battery to obtain the trained TCN-GRU model, including: in each training cycle, dividing the existing performance degradation trend data of the battery in the training set into several batches to train the TCN-GRU model, and adjusting the learning rate during the training process; after the training is completed, using the test set to evaluate the performance of the TCN-GRU model on unknown data to obtain the trained TCN-GRU model.
[0153] like Figure 8As shown in the figure, firstly, a polynomial is used to fit the data to be predicted, and the prediction result is generated according to the prediction step size based on the overall trend of the data to be predicted. Then, a temporal convolutional network and a gated recurrent unit are introduced to determine the coverage of the small-scale sliding window based on the prediction step size. TCN is used to learn the local area features in the time series data, and GRU is used to process the long-term correlation in the time series data. Specifically, TCN takes the historical time series as input, extracts features through multiple convolutional layers and pooling layers, and then inputs these features into the GRU to learn the long-term correlation in the data, and finally outputs the predicted value of the future time point through a fully connected layer.
[0154] The present invention proposes a performance degradation trend prediction method based on a multi-scale temporal convolutional network. First, prediction data is generated under large-scale conditions by polynomial fitting, and the generated data is used in the temporal convolutional network to predict performance degradation trends under small-scale conditions. The overall trend of the performance degradation trend curve is grasped by polynomial fitting under large-scale conditions, and the local shape of the curve is learned by the temporal convolutional network under small-scale conditions. The combination of the two finally achieves accurate prediction. The performance degradation trend prediction based on the multi-scale temporal convolutional neural network uses data generated by polynomials for prediction. The input of the trained TCN-GRU model is generated by fragments of the original performance degradation trend data. Therefore, it can better learn the local trend of the performance degradation curve, such as Fig. 9 shown.
[0155] (1) Fitting the original data. The number of polynomial fittings is initialized to 2. According to the fitting effect, the number of polynomial fittings is continuously updated. After the best number of polynomial fittings is determined, the fitted polynomial is used to generate the data to be predicted.
[0156] (2) Build and train the TCN-GRU model. The main steps are as follows: define the model structure, determine the model parameters such as the shape of the input data, the number of convolutional layers, the size of the convolution kernel, the size of the dilation factor, the pooling method, and the shape of the output layer and the activation function; compile the model, select the appropriate optimizer, loss function and evaluation index, and compile the model; load the dataset, load the training set and test set into memory, and perform preprocessing and normalization operations; train the model, and use the loaded dataset to train the model. In each training cycle, the training set is divided into several batches for training. During the training process, the learning rate can be adjusted as needed; evaluate the model, and use the test set to evaluate the performance of the model on unknown data.
[0157] The TCN-GRU model design includes a data input layer, a TCN layer, a reconstruction layer, a GRU layer, and a fully connected layer. The causal convolution of the TCN layer is used to extract features of the performance degradation trend data to ensure data temporality. The dilated convolution achieves a strong ability to capture data features. The residual connection of the model can speed up the convergence of the model, and then the obtained features are input into the GRU layer for nonlinear fitting.
[0158] (3) First, the predicted data under large-scale conditions generated by polynomial fitting is input into the TCN-GRU model for prediction to obtain the prediction results under small-scale conditions. Then, the mean square error MSE1 between the fitted polynomial and the original data is calculated, the original data is input into the TCN-GRU model for prediction and the mean square error MSE2 between the predicted results and the original data is calculated. Then, the predicted results y1 under large-scale conditions and the predicted results y2 under small-scale conditions are weighted based on the following formula to obtain the final predicted result y.
[0159]
[0160] Another embodiment of the present invention also provides a battery performance degradation trend prediction device based on hierarchical federated learning, such as Fig.10 As shown, it includes: a construction module 201, which is used to construct a hierarchical federated learning architecture for battery performance degradation trend prediction, which is respectively a local server, an edge server and a cloud server from bottom to top; a grouping module 202, which is used to obtain the battery capacity degradation data stored on each local server, and group the local servers by using the federated grouping technology based on improved K-medoids and the battery capacity degradation data stored on each local server to determine the corresponding relationship between the edge server and the local server; a training module 203, which is used to train the hierarchical federated learning architecture by combining the model aggregation strategy and the fallback update strategy during the training of the hierarchical federated learning architecture by using the battery capacity degradation data stored on each local server to obtain the trained hierarchical federated learning architecture; a prediction module 204, which is used to predict the battery performance degradation trend to be predicted based on the trained hierarchical federated learning architecture.
[0161] Another aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the steps of predicting the battery performance degradation trend based on hierarchical federated learning as described above are implemented.
[0162] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be used to modify the technical solutions or to perform equivalent replacements on some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A battery performance degradation trend prediction method based on hierarchical federated learning, characterized in that: The method comprises: Construct a hierarchical federated learning architecture for battery performance degradation trend prediction, which consists of a local server, an edge server, and a cloud server from bottom to top; Obtaining battery capacity degradation data stored on each local server, and grouping the local servers using a federated grouping technique based on improved K-medoids and the battery capacity degradation data stored on each local server to determine a corresponding relationship between the edge server and the local server; During the training of the hierarchical federated learning architecture using the battery capacity degradation data stored on each local server, the hierarchical federated learning architecture is trained by combining a model aggregation strategy and a fallback update strategy to obtain a trained hierarchical federated learning architecture; The predicted battery performance degradation trend is predicted based on the trained hierarchical federated learning architecture.
2. The method according to claim 1, characterized in that The battery capacity degradation data is battery capacity degradation data of different models, different temperatures and different formulations.
3. The method according to claim 1, characterized in that The local servers are grouped using the federated grouping technology based on improved K-medoids and the battery capacity degradation data stored on each local server to determine the corresponding relationship between the edge server and the local server, including: The elbow method is used to determine the optimal number of clusters for all battery capacity degradation data, and the angle cosine distance is used as the distance metric in the K-Medoids clustering algorithm, and an improved K-Medoids clustering algorithm is obtained by combining the optimal number of clusters; The battery capacity degradation data stored in each local server is grouped based on the improved K-Medoids clustering algorithm so as to group batteries with similar battery capacity decay curves; A corresponding relationship is established between at least one local server storing a battery capacity decay curve similar to the edge server to determine the corresponding relationship between the edge server and the local server.
4. The method according to claim 1, characterized in that: Model aggregation strategies include: Each edge server calculates the average loss of each corresponding local server model and calculates the weight coefficient of each edge server model using adaptive weights; The cloud server performs weighted aggregation of each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server.
5. The method according to claim 4, characterized in that The weight coefficients of each edge server model calculated using adaptive weights include: Where W[k] represents the weight coefficient, represents the average loss of the local server model of client k; n represents the number of clients.
6. The method according to claim 5, characterized in that The cloud server performs weighted aggregation of each edge server model parameter based on the adaptive weight to obtain the global model parameters of the cloud server, including: Among them, GM represents the global model, N k Denotes the local dataset D of client k k The size of N represents the size of the entire data set, M k Represents the local server model of client k.
7. The method according to claim 4, characterized in that The fallback update strategies include: A fallback window of size n is set on each local server to record the weight parameters of the local model in n updates; If the loss of the local model continues to increase during n updates, the local model is rolled back to the state before n rounds of updates according to the weight parameters of the model in the rollback window; If the loss of the local model does not continue to increase in n updates, then in each update round, the first element in the backoff window is discarded and the local model weight is added to the end of the backoff window.
8. The method according to claim 1, characterized in that During the training of the hierarchical federated learning architecture using the battery capacity degradation data stored on each local server, the following steps are included: The local server trains the model locally with local data. The edge server receives the local model parameters for preliminary aggregation and uploads the results to the cloud server. The cloud server aggregates the edge server model parameters and sends the results to the edge server. The edge server then sends the model parameters to the local server to update the model.
9. A battery performance degradation trend prediction device based on hierarchical federated learning, characterized in that: include: A building module for building a hierarchical federated learning architecture for battery performance degradation trend prediction, which consists of a local server, an edge server, and a cloud server from bottom to top; A grouping module, used to obtain battery capacity degradation data stored on each local server, and group the local servers using a federated grouping technology based on improved K-medoids and the battery capacity degradation data stored on each local server to determine a corresponding relationship between an edge server and a local server; A training module, used for training the hierarchical federated learning architecture by using the battery capacity degradation data stored on each local server, and combining a model aggregation strategy and a fallback update strategy to train the hierarchical federated learning architecture to obtain a trained hierarchical federated learning architecture; The prediction module is used to predict the battery performance degradation trend to be predicted based on the trained hierarchical federated learning architecture.
10. An electronic device, characterized in that: It comprises a memory, a processor and a computer program stored in the memory and executable on the processor; when the computer program is executed by the processor, the steps of the method for predicting battery performance degradation trend based on hierarchical federated learning described in any one of claims 1 to 8 are implemented.