Remaining service life prediction method, device and electronic equipment
By obtaining time-varying sequence data on the capacity of lithium-ion batteries and using the trained remaining service life prediction model to extract and aggregate multi-scale features, the problem of low prediction accuracy of lithium-ion batteries in the existing technology is solved, and a more accurate remaining service life prediction is achieved.
Patent Information
- Application Number
- CN202510075077.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Existing technologies are unable to comprehensively analyze lithium-ion battery data on a time scale, resulting in low accuracy in the prediction results of the remaining service life of lithium-ion batteries.
A remaining service life prediction method is adopted. By obtaining the sequence data of the capacity change of the battery to be tested over time, the trained remaining service life prediction model is used to extract multi-scale features, and the features are aggregated through the cross-attention mechanism. Finally, the prediction calculation is performed in the fully connected layer to obtain the remaining service life of the battery.
The prediction accuracy of the remaining service life of lithium-ion batteries has been improved, and battery data can be analyzed more comprehensively to provide more accurate predictions of the remaining service life.
Smart Images

Figure CN119959768B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery life prediction, and in particular to a method, device and electronic device for predicting remaining service life. Background Art
[0002] In today's society, lithium-ion batteries have been widely used in transportation, aerospace, and defense and military fields as a portable energy source. During the application process, the performance of various types of lithium-ion batteries will gradually decline due to material aging and capacity decay, which can easily lead to lithium-ion battery failure, increased maintenance costs, and even catastrophic equipment failure. In order to give full play to the advantages of lithium-ion batteries and prevent catastrophic failures, lithium-ion batteries are usually predicted for their remaining useful life (RUL). The predicted results of the remaining useful life can well reflect the health status of lithium-ion batteries, help formulate lithium-ion battery maintenance plans, and ensure the reliability and safety of lithium-ion batteries.
[0003] Currently, the methods for predicting the remaining service life of lithium-ion batteries mainly include the use of electrochemical and equivalent circuit models or data-driven methods. The methods based on electrochemical and equivalent circuit models can model the failure mechanism of lithium-ion batteries and can well reflect the physical and electrochemical properties of lithium-ion batteries. The data-driven method is simple and practical, and only requires lithium-ion battery test data and status monitoring data to predict the remaining service life of lithium-ion batteries. However, the above two methods cannot comprehensively analyze lithium-ion battery data on a time scale, resulting in inaccurate prediction results of the remaining service life of lithium-ion batteries. Therefore, the existing battery remaining service life prediction methods still have the technical problem of low accuracy of prediction results. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a remaining service life prediction method, device and electronic equipment, which can solve the technical problem in the prior art that lithium-ion battery data cannot be comprehensively analyzed on a time scale, resulting in low accuracy of the prediction results of the remaining service life of lithium-ion batteries.
[0005] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for predicting remaining useful life, comprising:
[0007] Obtaining sequence data of the capacity of the battery to be tested changing over time;
[0008] The sequence data is input into a trained remaining useful life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; the multi-scale features are aggregated to obtain full-scale features corresponding to the sequence data; the full-scale features are input into a fully connected layer for prediction calculation to obtain the remaining useful life of the battery to be tested; wherein the remaining useful life prediction model is trained using a training data set of sequence data marked with remaining useful life.
[0009] Furthermore, an embodiment of the present invention provides a first possible implementation of the first aspect, wherein the step of extracting features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data includes:
[0010] Performing feature encoding on the battery capacities corresponding to different times in the sequence data to obtain multiple capacity features of the sequence data;
[0011] Obtaining a time scale position code corresponding to each of the capacity features, and determining a plurality of scale position features based on a preset weight matrix, each of the capacity features, and the time scale position code corresponding to each of the capacity features;
[0012] A feature normalization process is performed on each of the capacity features and the scale position features corresponding to each of the capacity features to obtain a multi-scale feature.
[0013] Furthermore, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the step of aggregating the multi-scale features to obtain the full-scale features corresponding to the sequence data includes:
[0014] The multi-scale features whose time scale is greater than the time scale threshold are used as first-level features, and the multi-scale features whose time scale is less than or equal to the time scale threshold are used as second-level features;
[0015] Updating the first-level features and the second-level features based on the cross-attention mechanism;
[0016] The updated first-level features and the second-level features are connected and aggregated to obtain full-scale features corresponding to the sequence data.
[0017] Furthermore, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the step of updating the first-level features and the second-level features based on the cross-attention mechanism includes:
[0018] Using the first-level features as query parameters in the cross-attention mechanism, concatenating and aggregating the first-level features and the second-level features as key parameters and value parameters in the cross-attention mechanism, and obtaining updated first-level features based on the query parameters, the key parameters, and the value parameters;
[0019] The value of the query parameter is replaced based on the second-level feature, the value of the key parameter and the value parameter are replaced based on the result of concatenating and aggregating the second-level feature and the updated first-level feature, and the updated second-level feature is obtained based on the replaced values of the query parameter, the key parameter, and the value parameter.
[0020] Alternatively, the second-level features are used as query parameters in the cross-attention mechanism, the results of concatenating and aggregating the first-level features and the second-level features are used as key parameters and value parameters in the cross-attention mechanism, and the updated second-level features are obtained based on the values of the query parameters, the key parameters, and the value parameters;
[0021] The value of the query parameter is replaced based on the first-level feature, the value of the key parameter and the value parameter are replaced based on the result of connecting and aggregating the first-level feature and the updated second-level feature, and the updated first-level feature is obtained based on the values of the replaced query parameter, the key parameter, and the value parameter.
[0022] Furthermore, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein before the step of extracting features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data, the method further includes:
[0023] The dimension of the sequence data is increased based on the convolution layer in the trained remaining useful life prediction model, and the sequence data is subjected to nonlinear transformation processing through the activation function in the convolution layer.
[0024] Furthermore, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the step of obtaining sequence data of the capacity of the battery to be tested changing over time includes:
[0025] Determining initial sequence data of capacity variation over time of the battery to be tested based on data of impedance variation over time of the battery to be tested during charge and discharge processes;
[0026] The initial sequence data is preprocessed to obtain the sequence data; wherein the preprocessing includes: data normalization processing and noise reduction processing.
[0027] Furthermore, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the step of training the remaining useful life prediction model includes:
[0028] Obtaining initial sequence data of the capacity of each battery changing over time based on the charge and discharge data of each battery in each charge and discharge cycle; wherein the charge and discharge data includes voltage data, current data, temperature data, time data and impedance data;
[0029] Marking the remaining service life corresponding to different capacities in the initial sequence data of each battery, and preprocessing the marked initial sequence data of each battery to obtain a sample data set; wherein the preprocessing includes: data normalization processing and noise reduction processing;
[0030] The sample data set is divided into a training data set and a test data set, the training data set is input into the remaining useful life prediction model, and the remaining useful life prediction model is trained to obtain the trained remaining useful life prediction model.
[0031] Furthermore, the embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the step of training the remaining useful life prediction model further includes:
[0032] determining an actual value of the remaining service life of each of the batteries based on the capacity of each of the batteries corresponding to the test data set;
[0033] Inputting the test data set into the trained remaining service life prediction model to obtain a predicted value of the remaining service life of each battery;
[0034] Based on the actual value and predicted value of the remaining service life of each battery, a performance evaluation index is obtained to evaluate the performance of the trained remaining service life prediction model; wherein the performance evaluation index includes: relative error, mean absolute error and root mean square error.
[0035] In a second aspect, an embodiment of the present invention provides a remaining useful life prediction device, comprising:
[0036] A data acquisition module is used to obtain sequence data of the capacity of the battery to be tested changing over time;
[0037] A prediction module is configured to input the sequence data into a trained remaining useful life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregate the multi-scale features to obtain full-scale features corresponding to the sequence data; and input the full-scale features into a fully connected layer for prediction calculation to obtain the remaining useful life of the battery to be tested; wherein the remaining useful life prediction model is trained using a training dataset of sequence data labeled with remaining useful life.
[0038] In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor and a storage device;
[0039] The storage device stores a computer program, which, when executed by the processor, executes the method described above.
[0040] An embodiment of the present invention provides a remaining service life prediction method, which includes: obtaining sequence data of the capacity of a battery to be tested changing over time; inputting the sequence data into a trained remaining service life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregating the multi-scale features to obtain full-scale features corresponding to the sequence data; inputting the full-scale features into a fully connected layer to perform prediction calculations to obtain the remaining service life of the battery to be tested; wherein the remaining service life prediction model is trained using a training data set of sequence data marked with remaining service life. The present invention obtains sequence data of the capacity of the battery to be tested that changes over time, which facilitates the subsequent analysis of the change in battery capacity on a time scale, and inputs the sequence data of the battery to be tested into a trained remaining service life prediction model. Since the trained remaining service life prediction model is trained by a sequence data training data set marked with the remaining service life, the model can accurately predict the remaining service life of the battery to be tested based on the input sequence data of the battery to be tested. The remaining service life prediction model can more comprehensively analyze the sequence data of the battery to be tested by performing multi-scale feature extraction and multi-scale feature fusion on the sequence data on a time scale, and finally inputs the full-scale features into a fully connected layer to obtain the remaining service life of the battery to be tested. The present invention performs multi-scale feature analysis and prediction of the remaining service life of the battery to be tested on a time scale, thereby improving the prediction accuracy of the remaining service life.
[0041] Other features and advantages of the embodiments of the present invention will be described in the following description, or some features and advantages can be inferred or determined without doubt from the description, or can be learned by implementing the above-mentioned technologies of the embodiments of the present invention.
[0042] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 A schematic diagram showing a flow chart of a remaining useful life prediction method provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a remaining useful life prediction device provided by an embodiment of the present invention is shown;
[0046] Figure 3 A schematic diagram shows a flow chart of a remaining service life prediction method provided by an embodiment of the present invention, which performs prediction based on sequence data of the capacity of a battery to be tested changing over time. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0048] At present, in order to ensure the reliability and safety of lithium-ion batteries during use, it is necessary to predict the remaining service life of lithium-ion batteries. Commonly used methods for predicting the remaining service life of lithium-ion batteries include: electrochemical and equivalent circuit model methods or data-driven methods. Considering that the existing technology cannot comprehensively analyze lithium-ion battery data on a time scale when predicting the remaining service life of lithium-ion batteries, resulting in low accuracy of the prediction results of the battery's remaining service life, to improve this problem, the embodiments of the present invention provide a remaining service life prediction method, device and equipment. The remaining service life prediction method can be applied to predict the remaining service life of lithium-ion batteries and improve the prediction accuracy of the remaining service life of lithium-ion batteries. The embodiments of the present invention are described in detail below.
[0049] This embodiment provides a method for predicting the remaining useful life, which can be applied to electronic equipment such as computers. Figure 1 The flowchart of a method for predicting remaining useful life is shown in FIG. , which mainly includes the following steps:
[0050] Step S102, obtaining sequence data of the capacity of the battery to be tested changing with time;
[0051] There is a positive correlation between the capacity of a battery and its remaining service life. Generally, the smaller the capacity of a battery, the shorter its remaining service life, and the larger the capacity of a battery, the longer its remaining service life. By obtaining sequence data of the capacity of a battery to be tested changing over time, subsequent analysis on a time scale can be performed to obtain the remaining service life of the battery to be tested.
[0052] Step S104: Input the sequence data into the trained remaining service life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregate the multi-scale features to obtain full-scale features corresponding to the sequence data; input the full-scale features into the fully connected layer for prediction calculation to obtain the remaining service life of the battery to be tested;
[0053] The remaining useful life prediction model is trained by a training dataset of sequence data labeled with remaining useful life;
[0054] The remaining service life prediction model in the above steps is a neural network model that uses a convolutional neural network. The remaining service life prediction model is trained using a training data set of sequence data marked with the remaining service life, so that the remaining service life prediction model establishes a mapping between battery capacity and battery remaining service life, which facilitates the subsequent accurate acquisition of the remaining service life of the battery to be tested based on the input sequence data of the battery to be tested. The multi-scale features corresponding to the above sequence data are extracted by the multi-scale feature extraction module in the remaining service life prediction model; the full-scale features corresponding to the above sequence data are obtained by the multi-scale feature fusion module in the remaining service life prediction model;
[0055] In the process of predicting the remaining service life of the battery to be tested, the capacity data of the battery to be tested at the current moment contributes to the prediction of the remaining service life of the battery to be tested, and the capacity data of the battery to be tested at the previous moment also contributes to the prediction of the remaining service life of the battery to be tested. However, how long ago the capacity data of the battery to be tested is input into the remaining service life prediction model for prediction is an important issue. Obtaining the capacity data of the battery to be tested at a more distant moment for multi-scale feature analysis can better reflect the change trend information of the capacity of the battery to be tested. Obtaining the capacity data of the battery to be tested at a more recent moment for multi-scale feature analysis is more conducive to characterizing the subtle changes in the capacity of the battery to be tested. Therefore, the above steps ensure the feature extraction of the capacity data of the battery to be tested at a more distant moment and a more recent moment by obtaining the multi-scale features and full-scale features of the sequence data of the battery to be tested on a time scale;
[0056] The window scale of the full-scale features corresponding to the sequence data is mapped to 1 through the fully connected layer in the remaining service life prediction model, and the predicted value of the remaining service life of the battery to be tested is obtained through the output layer:
[0057] y t * =f(W p X e +b p ),
[0058] Among them, y t * is the predicted value of the remaining service life of the battery to be tested, f(*) is the activation function of the output layer, W p is the weight of the output layer, b p is the bias term of the output layer.
[0059] The above-mentioned remaining service life prediction method provided by an embodiment of the present invention obtains sequence data of the capacity change of the battery to be tested (the type of battery to be tested includes lithium batteries, etc.) over time, which facilitates the subsequent analysis of the change in battery capacity on a time scale, and inputs the sequence data of the battery to be tested into the trained remaining service life prediction model. The trained remaining service life prediction model is trained by a sequence data training data set marked with the remaining service life. Therefore, the model can accurately predict the remaining service life of the battery to be tested based on the input sequence data of the battery to be tested. The trained remaining service life prediction model extracts and fuses multi-scale features of the sequence data on the time scale, and can more comprehensively analyze the sequence data of the battery to be tested. Finally, the full-scale features are input into the fully connected layer to obtain the remaining service life of the battery to be tested. The present invention performs multi-scale feature analysis and prediction of the remaining service life of the battery to be tested from the time scale, thereby improving the prediction accuracy.
[0060] In one embodiment, this embodiment provides a method for extracting features of sequence data at different time scales to obtain multi-scale features corresponding to the sequence data, including:
[0061] Feature encoding is performed on the battery capacity corresponding to different times in the sequence data to obtain multiple capacity features of the sequence data;
[0062] The sequence data in the above steps is:
[0063] x∈R l×1 ,
[0064] Among them, R represents the set of real numbers, and l represents the length of the sequence data;
[0065] The battery capacity corresponding to different time periods in the sequence data is feature-encoded so that the sequence data can be converted into data that can be recognized by the remaining service life prediction model. After feature encoding, the capacity characteristics of the sequence data at different time scales are obtained:
[0066] X′=Silu(Conv(x)),
[0067] Where X′∈R l×d Represents the obtained capacity feature, d represents the sequence length of the capacity feature, Conv(*) is the convolution operation, and Silu(*) is the activation function.
[0068] Obtaining a time scale position code corresponding to each capacity feature, and determining a plurality of scale position features based on a preset weight matrix, each capacity feature, and the time scale position code corresponding to each capacity feature;
[0069] By constructing a multi-scale learnable convolution kernel using the upper triangular matrix of the weight matrix and combining the position encoding of each capacity feature and the time scale corresponding to each capacity feature, multiple scale position features are obtained:
[0070] X″=Silu(Triu(W)X ′ +P),
[0071] Where W∈R l×l is the weight matrix, P∈R l×d is the position code of the time scale corresponding to each capacity feature, Triu(·) is the upper triangular matrix of the extracted weight matrix, X″∈R l×d Represents multiple scale position features.
[0072] Perform feature normalization on each capacity feature and the scale position feature corresponding to each capacity feature to obtain multi-scale features;
[0073] In the above steps, multi-scale features are obtained by normalizing the scale and position features corresponding to each capacity feature:
[0074] X=LayerNorm(Silu(Conv(X″))+Silu(Conv(X′)))
[0075] Where X∈R l×d Represents the obtained multi-scale features, and LayerNorm(*) is the normalization function processing.
[0076] In one embodiment, this embodiment provides a specific implementation method for aggregating multi-scale features to obtain full-scale features corresponding to sequence data, including:
[0077] The multi-scale features with a time scale greater than the time scale threshold are taken as the first-level features, and the multi-scale features with a time scale less than or equal to the time scale threshold are taken as the second-level features;
[0078] The obtained multi-scale features are stored in the encoder of the remaining useful life prediction model. These multi-scale features contain different information depending on the time scale. Therefore, a time scale threshold is set. The multi-scale feature fusion module in the remaining useful life prediction model uses the multi-scale features with a time scale greater than the time scale threshold as the first-level features (i.e., high-level features):
[0079]
[0080] Among them, F H is the first-level feature, N H is the number of tokens corresponding to the first-level features, d midel is the output channel dimension of the convolutional layer in the remaining service life prediction model; the first-level features (i.e., high-level features) represent the capacity data of the battery under test at a more distant time. Therefore, the multi-scale features classified as the first-level features contain more abundant information about the capacity of the battery under test, but lack some important local multi-scale features that can reflect subtle changes in the capacity of the battery under test;
[0081] The multi-scale features whose time scale is less than or equal to the time scale threshold are used as the second-level features (i.e. low-level features):
[0082]
[0083] Among them, F L is the second-level feature, N L is the number of tokens corresponding to the second-level features; the second-level features (i.e., low-level features) represent the capacity data of the battery to be tested at a more recent time. Therefore, the multi-scale features classified as the second-level features do not contain much effective capacity information of the battery to be tested, but contain local multi-scale features that can reflect subtle changes in the capacity of the battery to be tested;
[0084] In general, the quantitative relationship between the number of tokens corresponding to the first-level features and the number of tokens corresponding to the second-level features is approximately:
[0085] N H ≈(6%-33%)N L ,
[0086] The information contained in the first-level features (i.e., high-level features) and the second-level features (i.e., low-level features) is complementary. Therefore, in the present invention, the first-level features and the second-level features are considered in an interleaved manner to improve the accuracy and efficiency of the remaining useful life prediction model.
[0087] Update the first-level features and the second-level features based on the cross-attention mechanism;
[0088] Based on the cross-attention mechanism, the first-level features and the second-level features can be correlated with each other, so that the first-level features and the second-level features can be updated more accurately.
[0089] The updated first-level features and second-level features are connected and aggregated to obtain the full-scale features corresponding to the sequence data;
[0090] The updated first-level features and second-level features are concatenated and aggregated to obtain full-scale features as the output of the multi-scale feature fusion module in the remaining useful life prediction model:
[0091] Output=Concat(F' H , F' L ),
[0092] Among them, Output is the output of the multi-scale feature fusion module in the remaining service life prediction model, Concat(F' H 'F' L ) is the full-scale feature after the first-level feature and the second-level feature are aggregated after the update process, Concat(*) is the aggregation function that connects and aggregates the first-level feature and the second-level feature after the update process, F' H is the first-level feature after updating, F' L It is the second-level feature after updating.
[0093] In one embodiment, this embodiment provides a specific implementation of updating the first-level features and the second-level features based on the cross-attention mechanism, including:
[0094] The first-level features are used as query parameters in the cross-attention mechanism, and the results of concatenating and aggregating the first-level features and the second-level features are used as key parameters and value parameters in the cross-attention mechanism. The updated first-level features are obtained based on the query parameters, key parameters, and value parameters.
[0095] Set the hyperparameter P in the cross-attention mechanism, set the hyperparameter P as the query parameter Q, and use the first-level features (i.e., high-level features) as the query parameter Q:
[0096] Q=P=F H ,
[0097] The result of concatenating and aggregating the first-level features and the second-level features is used as the key parameter K and value parameter V in the cross-attention mechanism:
[0098] K=V=Concat(F H , F L ),
[0099] Among them, Concat(F H , F L ) is the full-scale feature after the first-level feature and the second-level feature are connected and aggregated;
[0100] The cross-attention mechanism enables the query parameter Q to self-learn the full-scale features in the key parameter K and the value parameter V to obtain the updated first-level features:
[0101]
[0102] Among them, CrossAttention(*) is the calculation formula of the cross-attention mechanism, and the query parameter Q in the formula is the first-level feature F H , the key parameter K and the value parameter V are the full-scale features after the first-level features and the second-level features are connected and aggregated.
[0103] The values of the query parameters are replaced based on the second-level features, the values of the key parameters and the value parameters are replaced based on the result of the concatenation and aggregation of the second-level features and the updated first-level features, and the updated second-level features are obtained based on the values of the replaced query parameters, key parameters, and value parameters.
[0104] The value of the query parameter Q is replaced based on the second-level features to obtain:
[0105] Q=P=F L ,
[0106] Based on the full-scale features of the second-level features and the updated first-level features, the values of the key parameter K and the value parameter V are replaced:
[0107] K=V=Concat(F' H ,F L ),
[0108] The updated second-level features are obtained based on the replaced query parameter Q, key parameter K, and value parameter V:
[0109]
[0110] Among them, the query parameter Q in the formula is the second-level feature F L , the key parameter K and the value parameter V are the full-scale features of the second-level features and the updated first-level features.
[0111] Alternatively, the second-level features are used as query parameters in the cross-attention mechanism, and the results of concatenating and aggregating the first-level features and the second-level features are used as key parameters and value parameters in the cross-attention mechanism. The updated second-level features are obtained based on the values of the query parameters, key parameters, and value parameters.
[0112] The second-level features are used as query parameters Q in the cross-attention mechanism:
[0113] Q=P=F L ,
[0114] The result of concatenating and aggregating the first-level features and the second-level features is used as the key parameter and value parameter in the cross-attention mechanism:
[0115] K=V=Concat(F H ,F L ),
[0116] Among them, Concat(F H ,F L ) is the full-scale feature after the first-level feature and the second-level feature are connected and aggregated;
[0117] The cross-attention mechanism enables the query parameter Q to self-learn the full-scale features in the key parameter K and the value parameter V to obtain the updated second-level features:
[0118]
[0119] Among them, the query parameter Q in the formula is the second-level feature F L , the key parameter K and the value parameter V are the full-scale features after the first-level features and the second-level features are connected and aggregated.
[0120] The values of the query parameters are replaced based on the updated second-level features, the values of the key parameters and the value parameters are replaced based on the result of the concatenation and aggregation of the first-level features and the updated second-level features, and the updated second-level features are obtained based on the values of the replaced query parameters, key parameters, and value parameters.
[0121] The value of the query parameter Q is replaced based on the first-level features to obtain:
[0122] Q=P=F H ,
[0123] Based on the full-scale features of the first-level features and the updated second-level features, the values of the key parameters K and value parameters V are replaced:
[0124] K=V=Concat(F H ,F' L ),
[0125] The updated first-level features are obtained based on the replaced query parameter Q, key parameter K, and value parameter V:
[0126]
[0127] Among them, the query parameter Q in the formula is the first-level feature F L , the key parameter K and the value parameter V are the full-scale features of the first-level features and the updated second-level features.
[0128] In the above steps, the cross-attention mechanism calculation formula operates by calculating the correlation between each element in one sequence and all elements in the other sequence, and performing a weighted sum of each element in the two sequences based on the correlation. This establishes a correlation between different sequences and fuses the information of the two sequences.
[0129] The cross-attention mechanism is based on the query parameter Q, key parameter K and value parameter V in this application. The operation process of the cross-attention mechanism is as follows: the query parameter Q is multiplied by the transposed key parameter K, and the dot product operation is performed on the corresponding query parameter Q and key parameter K to obtain the similarity matrix between the query parameter Q and the key parameter K, which can reflect the similarity between the query parameter Q and the key parameter K;
[0130] Then, the similarity matrix between the query parameter Q and the key parameter K is scaled by the dimension of the key parameter K. That is, the dimension of the calculated similarity matrix is scaled to the same dimension as the key parameter K and the value parameter V to obtain the similarity weight matrix.
[0131] Normalize the similarity weight matrix to ensure that the sum of the similarity weights of any element in the query parameter Q and each element of the key parameter K is 1. This will give a weight coefficient matrix that represents the strength of each important feature in the time scale feature.
[0132] The weight coefficient matrix of the strength of important features is applied to the value parameter V to obtain the final full-scale features with attention weight distribution. The time scale features belonging to the query parameter Q on the value parameter V will be strengthened, and the time scale features that do not belong to the Q query parameter will be weakened.
[0133] In one embodiment, this embodiment provides a specific implementation method before the step of extracting features of sequence data at different time scales to obtain multi-scale features corresponding to the sequence data, including:
[0134] The convolution layer in the trained remaining useful life prediction model increases the dimension of the sequence data and performs nonlinear transformation on the sequence data through the activation function in the convolution layer;
[0135] The input channel dimension of the sequence data is increased by the convolution layer (i.e., Norm_conv convolution layer) in the remaining useful life prediction model:
[0136]
[0137] Among them, L out is the output channel dimension of the sequence data after dimensionality increase, L in is the input channel dimension of the sequence data, padding is the padding of the convolution layer input, dilation is the spacing between the control kernel points in the Norm_conv convolution layer, kernel_size is the size of the convolution kernel in the Norm_conv convolution layer, and stride is the moving step size of the convolution kernel in the Norm_conv convolution layer;
[0138] The sequence data is processed nonlinearly through the activation function in the Norm_conv convolution layer:
[0139] Silu(x)=x·sigmoid(x),
[0140] Among them, Silu(x) is the sequence data after nonlinear transformation processing by Silu activation function, x is the sequence data, and sigmoid(x) is the sequence data after processing by sigmoid activation function.
[0141] In one embodiment, the present embodiment provides a specific implementation method for obtaining sequence data of the capacity of a battery under test changing over time, including:
[0142] Determining initial sequence data of capacity variation over time of the battery under test based on data of impedance variation over time of the battery under test during charge and discharge processes;
[0143] Since the internal impedance of the battery will gradually increase as the charging and discharging time becomes longer during the charging and discharging process, and generally the internal impedance of the battery is inversely proportional to the battery capacity, that is, as the internal impedance of the battery increases, the battery capacity will decrease. Therefore, obtaining the data of the impedance change of the battery to be tested over time in the above steps can more accurately determine the initial sequence data of the capacity change of the battery to be tested over time.
[0144] Preprocessing the initial sequence data to obtain sequence data; wherein the preprocessing includes: data normalization processing and noise reduction processing;
[0145] In order to reduce the impact of the distribution change of the input sequence data on the remaining useful life prediction model (i.e., neural network model), the initial sequence data needs to be normalized (i.e., standardized):
[0146] x c =c / C0,
[0147] Where c=[c1,c2,…,c n ], c is the initial sequence data of the capacity of the battery to be tested changing with time, C0 is the initial capacity of the battery to be tested, x cis the normalized initial sequence data, and the capacity values in the initial sequence data are mapped to (0, 1];
[0148] Normalizing the initial sequence data ensures consistent representation of the data, minimizing problems caused by distribution differences in the data, enabling better generalization of the data and improving the reliability of subsequent prediction results.
[0149] At the same time, since the initial sequence data contains a large amount of noise data, it will affect the accuracy of the subsequent prediction results of the remaining service life of the battery to be tested. Therefore, the initial sequence data needs to be denoised:
[0150] x=dropout(x c ),
[0151] Among them, x is the sequence data, dropout(x c ) indicates that the normalized initial sequence data is subjected to noise reduction processing by using the dropout mask method;
[0152] The reliability of the subsequent remaining useful life prediction is ensured by performing noise reduction on the initial sequence data.
[0153] In one embodiment, this embodiment provides a specific implementation method for training a remaining useful life prediction model, including:
[0154] Based on the charge and discharge data of each battery in each charge and discharge cycle, initial sequence data of the capacity of each battery changing with time is obtained; wherein the charge and discharge data includes voltage data, current data, temperature data, time data and impedance data;
[0155] In the above steps, the charge and discharge data of each battery in each charge and discharge cycle can be obtained by acquiring an existing public data set of each battery, wherein the public data set includes the charge and discharge data of each battery in multiple charge and discharge processes.
[0156] The remaining service life corresponding to different capacities in the initial sequence data of each battery is marked, and the marked initial sequence data of each battery is preprocessed to obtain a sample data set; wherein the preprocessing includes: data normalization processing and noise reduction processing;
[0157] In the above steps, the remaining service life corresponding to different capacities in the initial sequence data of each battery can be obtained by establishing a capacity data degradation curve based on the charge and discharge data of each battery in each charging cycle, wherein the capacity data degradation curve facilitates clear identification of the corresponding relationship between battery capacity and remaining battery life, marks the remaining service life corresponding to different capacities in the initial sequence data of each battery, and establishes a corresponding relationship between capacity and remaining service life, so that the remaining service life prediction model after subsequent training can predict the remaining service life of the battery to be tested based on the input sequence data of capacity changing with time; data normalization and noise reduction processing are performed on the marked initial sequence data of each battery, which helps to ensure the convergence effect when training the remaining service life prediction model, improve the overall efficiency and effectiveness of the remaining service life prediction model, and ensure the stability of the remaining service life prediction model during the training process.
[0158] Dividing the sample data set into a training data set and a test data set, inputting the training data set into the remaining useful life prediction model, performing model training on the remaining useful life prediction model, and obtaining a trained remaining useful life prediction model;
[0159] In the above steps, the sample data set is divided into a training data set and a test data set, wherein the training data set is used to train the remaining useful life prediction model, and the test data set is used to test the performance of the trained remaining useful life prediction model.
[0160] In one embodiment, the specific implementation method of training the remaining useful life prediction model provided in this embodiment also includes:
[0161] Determining an actual value of the remaining useful life of each battery based on the capacity of each battery corresponding to the test data set;
[0162] Input the test data set into the trained remaining service life prediction model to obtain the predicted value of the remaining service life of each battery;
[0163] Based on the actual value and predicted value of the remaining service life of each battery, performance evaluation indicators are obtained to evaluate the performance of the trained remaining service life prediction model; wherein the performance evaluation indicators include relative error, mean absolute error and root mean square error;
[0164] In the above steps, the actual value of the remaining service life of each battery in the test data set and the predicted value of the remaining service life of each battery are obtained. Based on the actual value and predicted value of the remaining service life of each battery, the relative error (RE), mean absolute error (MAE) and root mean square error (RMSE) are obtained as performance evaluation indicators. Specifically, the relative error (RE) is:
[0165]
[0166] The mean absolute error (MAE) is:
[0167]
[0168] The root mean square error (RMSE) is:
[0169]
[0170] Among them, y t is the actual value of the remaining service life of each battery in the test data set, is the predicted value of the remaining service life of each battery in the test data set, and s represents the number of battery samples in the test data set;
[0171] The smaller the values of relative error, mean absolute error, and root mean square error, the smaller the difference between the actual value and the predicted value of the remaining service life of each battery is, the more accurate the predicted value is, and the better the performance of the trained remaining service life prediction model is.
[0172] This embodiment also provides a remaining useful life prediction device, see Figure 2 The schematic diagram of a remaining useful life prediction device shown in FIG. 1 includes:
[0173] The data acquisition module 201 is used to obtain the sequence data of the capacity of the battery to be tested changing with time;
[0174] The prediction module 203 is used to input the sequence data into the trained remaining service life prediction model to extract the features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregate the multi-scale features to obtain full-scale features corresponding to the sequence data; input the full-scale features into the fully connected layer for prediction calculation to obtain the remaining service life of the battery to be tested; wherein the remaining service life prediction model is trained using a training data set of sequence data marked with remaining service life.
[0175] This embodiment further provides an electronic device, including a processor and a storage device, wherein the storage device stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method provided in the above embodiment are implemented.
[0176] The above-mentioned method provided by the embodiment of the present invention first obtains initial sequence data of the capacity of each battery changing over time, marks the remaining service life corresponding to different capacities in the initial sequence data of each battery, and preprocesses the marked initial sequence data to obtain a sample data set. The sample data set is divided into a training data set and a test data set. The remaining service life prediction model is trained using the training data set, so that the remaining service life prediction model establishes a relationship between battery capacity and remaining service life, thereby improving the prediction accuracy of the remaining service life prediction model; the trained remaining service life prediction model is tested using the test data set to obtain a predicted value, and the performance of the trained remaining service life prediction model is judged based on the actual value and predicted value of the remaining service life of each battery in the test data set;
[0177] Acquire sequence data of the capacity change over time of the battery to be tested (the type of battery to be tested includes lithium batteries, etc.), so as to facilitate the subsequent analysis of the change of battery capacity on the time scale, and input the sequence data of the battery to be tested into the trained remaining service life prediction model. The trained remaining service life prediction model is trained by a sequence data training data set marked with the remaining service life. Therefore, the model can accurately predict the remaining service life of the battery to be tested based on the input sequence data of the battery to be tested. The trained remaining service life prediction model performs multi-scale feature extraction and multi-scale feature fusion on the sequence data on the time scale, which can more comprehensively analyze the sequence data of the battery to be tested, and finally inputs the full-scale features into the fully connected layer to obtain the remaining service life of the battery to be tested. The present invention performs multi-scale feature analysis and prediction of the remaining service life of the battery to be tested on the time scale, thereby improving the prediction accuracy.
[0178] Based on the above embodiment, this embodiment provides an example of applying the above remaining service life prediction method to predict the remaining service life of a lithium battery. Specifically, the following steps can be referred to:
[0179] Step S301, acquiring charge and discharge data of a plurality of lithium batteries during a charge and discharge cycle, and obtaining initial sequence data of the capacity of each lithium battery changing with time and a capacity data degradation curve corresponding to each lithium battery based on the charge and discharge data of each lithium battery; wherein the charge and discharge data includes voltage data, current data, temperature data, time data, and impedance data.
[0180] Step S303: Mark the remaining service life corresponding to different capacities in the initial sequence data of each battery, and preprocess the marked initial sequence data of each battery to obtain a sample data set; wherein the preprocessing includes: data normalization and noise reduction; the number of sample data sets can be one or more;
[0181] Step S305: Divide the sample dataset into multiple training datasets and test datasets using a leave-one-out method. Specifically, the initial sequence data of a battery in the sample dataset is used as the test dataset, and the initial sequence data of the remaining batteries are used as the training dataset. All batteries in the sample dataset are divided into the test dataset once, thereby obtaining multiple training datasets and test datasets.
[0182] Step S307: Input each set of training data sets into the remaining useful life prediction model for iterative training, and input the test data sets corresponding to each set of training data sets into the trained remaining useful life prediction model for testing. The relative error (RE), mean absolute error (MAE), and root mean square error (RMSE) are obtained based on the actual values of the remaining useful life of the batteries in each test data set and the predicted values of the remaining useful life of each battery to evaluate the performance of the trained remaining useful life prediction model. The preset number of iterative training times for the remaining useful life prediction model may be 5 times.
[0183] Step S309, see Figure 3 The diagram shows a flow chart of a method for predicting the remaining service life based on the sequence data of the capacity of the battery to be tested changing with time. The initial sequence data of the capacity of the battery to be tested changing with time is obtained as follows: c = [c1, c2, ..., c n ];
[0184] Perform data normalization on the initial sequence data to obtain the normalized initial sequence data x c , for x c The sequence data obtained by noise reduction is x;
[0185] In step S311, the sequence data x of the capacity of the battery to be tested that changes over time is input into the Norm_conv convolution layer in the remaining service life prediction model. The sequence data input into the convolution layer for processing usually has three dimensions, namely: Batch_size (the number of samples of the battery to be tested each time for prediction), Channel_size (channel dimension), and Window_size (window dimension, i.e., the length of the sequence data). In this example, the three dimensions of the sequence data x of the battery to be tested are (Batch_size, Channel_size=1, Window_size=64). The channel dimension of the sequence data x is increased in dimension by the Norm_conv convolution module:
[0186]
[0187] Among them, L out is the output channel dimension of the sequence data after dimensionality increase; L inis the input channel dimension of the sequence data, set to 1; padding is the padding of the input of the Norm_conv convolution layer, set to 0; dilation is the spacing between the control kernel points in the Norm_conv convolution layer, set to 1; kernel_size is the size of the convolution kernel in the Norm_conv convolution layer, set to 64; stride is the moving step size of the convolution kernel in the Norm_conv convolution layer, set to 1; based on the specific values of the above parameter settings, the output channel dimension L of the sequence data after dimensionality increase is obtained. out is 64;
[0188] The sequence data x is processed nonlinearly through the activation function in the Norm_conv convolution layer to obtain Silu(x).
[0189] Step S313: Input the sequence data after the nonlinear transformation into a multi-scale feature extraction module to obtain multi-scale features corresponding to the sequence data after the nonlinear transformation. Since the window dimension of the sequence data after the nonlinear transformation is 64, the multi-scale feature extraction module can ultimately obtain 64 multi-scale features of different time scales.
[0190] Step S315: The multi-scale features of 64 different time scales obtained above are input into the multi-scale feature fusion module and divided into low-level features and high-level features. The query parameter Q, key parameter K, and value parameter V in the cross-attention mechanism usually also have three dimensions, namely: Batch_size, Channel_size, and hidden_dim (the hidden dimension of each parameter). Specifically, in this example, the three dimensions of the key parameter K and the value parameter V in the cross-attention mechanism are set to (Batch_size, channel_size=64, hidden_dim=256), and a hyperparameter P is set as the query parameter Q, whose three dimensions are (Batch_size, channel_size=1, hidden_dim=256). The hidden dimension of each parameter is set to 256, which helps to improve the learning ability and the ability to fit complex data of the remaining service life prediction model.
[0191] First, the high-level features are mapped to the hyperparameter P (i.e., the query parameter Q) through the fully connected layer (Linear) in the multi-scale feature fusion module. The result of concatenating and aggregating the high-level features with the low-level features is mapped to the key parameter K and the value parameter V. Based on the cross-attention mechanism, the query parameter Q is used to learn the key parameter K and the value parameter V to obtain the updated high-level features.
[0192] Then, the low-level features are mapped to the hyperparameter P (i.e., the query parameter Q) through the fully connected layer in the multi-scale feature fusion module. The result of concatenating and aggregating the low-level features and the updated high-level features is mapped to the key parameter K and the value parameter V. Based on the cross-attention mechanism, the query parameter Q is used to learn the key parameter K and the value parameter V to obtain the updated low-level features.
[0193] The updated high-level features and the updated low-level features are connected and aggregated to obtain the full-scale features X corresponding to the sequence data, and the three dimensions of the full-scale features are (Batch_size, channel_size=1, hidden_dim=256).
[0194] Step S317: input the full-scale features into the fully connected layer (Linear) again, and map the window dimension of the full-scale features to 1 through the fully connected layer to obtain the output result X e , its three dimensions (Batch_size, channel = 1, hidden_dim = 1), and finally through the output layer based on the output result X e Get the predicted value of the remaining service life of the battery to be tested:
[0195] y t * =f(W p X e +b p ),
[0196] Among them, y t * is the predicted value of the remaining service life of the battery to be tested, W p represents the weight of the output layer, b p represents the bias of the output layer, and f(*) represents the activation function of the output layer.
[0197] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0198] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for predicting remaining useful life, characterized in that: include: Obtaining sequence data of the capacity of the battery to be tested changing over time; Inputting the sequence data into a trained remaining useful life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregating the multi-scale features to obtain full-scale features corresponding to the sequence data; inputting the full-scale features into a fully connected layer for prediction calculation to obtain the remaining useful life of the battery under test; wherein the remaining useful life prediction model is trained using a training dataset of sequence data labeled with remaining useful life; The step of extracting features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data includes: Performing feature encoding on the battery capacities corresponding to different times in the sequence data to obtain multiple capacity features of the sequence data; obtaining a time scale position code corresponding to each of the capacity features, and determining multiple scale position features based on a preset weight matrix, each of the capacity features, and the time scale position code corresponding to each of the capacity features; performing feature normalization processing on each of the capacity features and the scale position features corresponding to each of the capacity features to obtain a multi-scale feature; The aggregating the multi-scale features to obtain full-scale features corresponding to the sequence data includes: The multi-scale features whose time scale is greater than the time scale threshold are used as first-level features, and the multi-scale features whose time scale is less than or equal to the time scale threshold are used as second-level features; the first-level features and the second-level features are updated based on the cross-attention mechanism; the updated first-level features and the second-level features are concatenated and aggregated to obtain the full-scale features corresponding to the sequence data.
2. The remaining useful life prediction method according to claim 1, characterized in that: The step of updating the first-level features and the second-level features based on the cross-attention mechanism includes: Using the first-level features as query parameters in the cross-attention mechanism, concatenating and aggregating the first-level features and the second-level features as key parameters and value parameters in the cross-attention mechanism, and obtaining updated first-level features based on the query parameters, the key parameters, and the value parameters; The value of the query parameter is replaced based on the second-level feature, the value of the key parameter and the value parameter are replaced based on the result of concatenating and aggregating the second-level feature and the updated first-level feature, and the updated second-level feature is obtained based on the replaced values of the query parameter, the key parameter, and the value parameter. Alternatively, the second-level features are used as query parameters in the cross-attention mechanism, the results of concatenating and aggregating the first-level features and the second-level features are used as key parameters and value parameters in the cross-attention mechanism, and the updated second-level features are obtained based on the values of the query parameters, the key parameters, and the value parameters; The value of the query parameter is replaced based on the first-level feature, the value of the key parameter and the value parameter are replaced based on the result of connecting and aggregating the first-level feature and the updated second-level feature, and the updated first-level feature is obtained based on the values of the replaced query parameter, the key parameter, and the value parameter.
3. The method for predicting remaining useful life according to claim 1, wherein: Before the step of extracting features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data, the method further includes: The dimension of the sequence data is increased based on the convolution layer in the trained remaining useful life prediction model, and the sequence data is subjected to nonlinear transformation processing through the activation function in the convolution layer.
4. The method for predicting remaining useful life according to claim 1, wherein: The step of obtaining sequence data of the capacity of the battery to be tested changing over time includes: Determining initial sequence data of capacity variation over time of the battery to be tested based on data of impedance variation over time of the battery to be tested during charge and discharge processes; The initial sequence data is preprocessed to obtain the sequence data; wherein the preprocessing includes: data normalization processing and noise reduction processing.
5. The method for predicting remaining useful life according to claim 1, wherein: The training steps of the remaining useful life prediction model include: Obtaining initial sequence data of the capacity of each battery changing over time based on the charge and discharge data of each battery in each charge and discharge cycle; wherein the charge and discharge data includes voltage data, current data, temperature data, time data and impedance data; Marking the remaining service life corresponding to different capacities in the initial sequence data of each battery, and preprocessing the marked initial sequence data of each battery to obtain a sample data set; wherein the preprocessing includes: data normalization processing and noise reduction processing; The sample data set is divided into a training data set and a test data set, the training data set is input into the remaining useful life prediction model, and the remaining useful life prediction model is trained to obtain the trained remaining useful life prediction model.
6. The method for predicting remaining useful life according to claim 5, characterized in that: Also includes: determining an actual value of the remaining service life of each of the batteries based on the capacity of each of the batteries corresponding to the test data set; Inputting the test data set into the trained remaining service life prediction model to obtain a predicted value of the remaining service life of each battery; Based on the actual value and predicted value of the remaining service life of each battery, a performance evaluation index is obtained to evaluate the performance of the trained remaining service life prediction model; wherein the performance evaluation index includes: relative error, mean absolute error and root mean square error.
7. A device for predicting remaining useful life, characterized in that: include: A data acquisition module is used to obtain sequence data of the capacity of the battery to be tested changing over time; A prediction module is configured to input the sequence data into a trained remaining useful life prediction model to extract features of the sequence data at different time scales to obtain multi-scale features corresponding to the sequence data; aggregate the multi-scale features to obtain full-scale features corresponding to the sequence data; and input the full-scale features into a fully connected layer for prediction calculation to obtain the remaining useful life of the battery under test; wherein the remaining useful life prediction model is trained using a training dataset of sequence data labeled with remaining useful life; The prediction module is configured to perform feature encoding on the battery capacities corresponding to different times in the sequence data to obtain multiple capacity features of the sequence data; obtain a time scale position code corresponding to each of the capacity features, and determine multiple scale position features based on a preset weight matrix, each of the capacity features, and the time scale position code corresponding to each of the capacity features; and perform feature normalization processing on each of the capacity features and the scale position features corresponding to each of the capacity features to obtain a multi-scale feature. The prediction module is used to use the multi-scale features with a time scale greater than a time scale threshold as first-level features, and use the multi-scale features with a time scale less than or equal to the time scale threshold as second-level features; update the first-level features and the second-level features based on a cross-attention mechanism; and concatenate and aggregate the updated first-level features and the second-level features to obtain full-scale features corresponding to the sequence data.
8. An electronic device, characterized in that: include: processors and storage devices; The storage device stores a computer program, which, when executed by the processor, executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Lithium battery life prediction method, system, equipment and medium
CN118938061A
Battery multi-state joint estimation method and device, electronic equipment and storage medium
CN118964939A