Battery capacity prediction method based on deep learning time sequence model and application thereof
Through the battery capacity prediction method based on the deep learning timing model, the battery charge and discharge timing data are acquired and processed in real time, and the dynamic change capture and process adaptability problems of battery capacity prediction in the prior art are solved, thereby achieving high-precision and high-efficiency battery capacity prediction.
Patent Information
- Application Number
- CN202411791010.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is difficult to effectively capture the dynamic changes in the internal state of the battery, and lacks adaptability when facing different charging and discharging processes, which affects the reliability and accuracy of capacity prediction.
The battery capacity prediction method based on the deep learning timing model is adopted, and the battery charge and discharge timing data is obtained in real time, slice preprocessing and feature extraction are performed, and the time series dependence relationship is captured using the Attention-LSTM model, and the confidence is calculated through Bayesian inference, and the capacity prediction result is finally output.
It significantly improves the accuracy and efficiency of battery capacity prediction, can be quickly adjusted under different charging and discharging processes, and improves the generalization ability and adaptability of the model.
Smart Images

Figure CN119511102A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of battery capacity testing, and specifically relates to a battery capacity prediction method based on a deep learning timing model and its application. Background Art
[0002] The performance and service life of batteries are affected by many factors such as the number of charge and discharge cycles, temperature, and depth of discharge. Accurately predicting the capacity of batteries is crucial to extending their service life, improving their efficiency, and preventing system failures caused by insufficient power. Traditional battery capacity testing methods require a complete charge and discharge cycle, which is time-consuming and consumes a lot of electricity, resulting in high costs in practical applications, especially in scenarios where frequent battery capacity testing is required, and the efficiency is low.
[0003] In order to improve the test efficiency, the existing technology begins to predict the battery capacity based on physical models, empirical formulas or statistical analysis. However, due to the nonlinear characteristics of the battery and the complex chemical reaction process, the existing methods are difficult to effectively capture the dynamic changes in the internal state of the battery, resulting in unstable reliability and accuracy of capacity prediction. In particular, there are many charging and discharging processes when the terminal performs battery capacity testing. The existing prediction methods lack sufficient adaptability when facing different charging and discharging processes, which limits their versatility and wide application, and affects the reliability and accuracy of capacity prediction. Summary of the invention
[0004] The purpose of this application is to provide a battery capacity prediction method based on a deep learning timing model and its application, so as to solve the problem that the battery capacity prediction method in the prior art is difficult to capture the dynamic changes of the internal state of the battery, lacks sufficient adaptive ability when facing different charging and discharging processes, and affects the reliability and accuracy of capacity prediction.
[0005] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a battery capacity prediction method based on a deep learning timing model, comprising:
[0006] Acquire battery charge and discharge timing data in real time, wherein the charge and discharge timing data includes a voltage-time variation curve during the battery charging or discharging process;
[0007] Slice the charge and discharge timing data to obtain a plurality of segment data, each of which includes a voltage-time variation curve of a fixed duration;
[0008] Inputting the segment data into a pre-trained feature extraction model to extract features and obtain local dynamic features, wherein the feature extraction model has been trained by domain adversarial training and meta-learning for different charge and discharge processes;
[0009] Inputting the local dynamic features into a pre-trained Attention-LSTM model in time sequence to obtain a real-time capacity prediction value, wherein the Attention-LSTM model is trained by meta-learning for different charging and discharging processes;
[0010] Perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
[0011] In one or more embodiments, the step of slicing and preprocessing the charge and discharge timing data includes:
[0012] The charge and discharge timing data are cleaned and normalized, and then sliced at fixed time intervals to obtain a number of fragment data.
[0013] In one or more embodiments, the training method of the feature extraction model and the Attention-LSTM model includes:
[0014] Obtaining battery charge and discharge cycle timing data and capacity data after each charge and discharge cycle, wherein each charge and discharge cycle includes multiple stages of different charge and discharge processes;
[0015] Dividing the charge-discharge cycle time series data into a plurality of sub-time series data according to the charge-discharge process;
[0016] Performing slicing preprocessing on each of the sub-time series data to obtain a plurality of training segment data, each of the training segment data comprising a voltage-time variation curve of a fixed duration;
[0017] generating a capacity label for the training segment data based on the capacity data after each charge and discharge cycle;
[0018] Based on the training segment data corresponding to different charging and discharging processes, domain adversarial training is performed on the feature extraction model;
[0019] Based on the training segment data corresponding to different charging and discharging processes and their marked capacity labels, meta-learning training is performed on the feature extraction model and the Attention-LSTM model.
[0020] In one or more embodiments, the step of performing domain adversarial training on the feature extraction model based on the training segment data corresponding to different charging and discharging processes includes:
[0021] The training segment data corresponding to the target charge-discharge process is used as the source domain, and the training segment data corresponding to other charge-discharge processes is used as the target domain, and is input into the feature extraction model for feature extraction;
[0022] The extracted features are input into a domain discriminator, a loss function of the domain discriminator is calculated, and the weights of the feature extraction model are updated through a gradient reversal layer until the loss function converges.
[0023] In one or more embodiments, the step of performing meta-learning training on the feature extraction model and the Attention-LSTM model based on the training segment data corresponding to different charge and discharge processes and the capacity labels marked therewith includes:
[0024] A training task is constructed for each charge and discharge process, and in the training task, the weights of the feature extraction model and the Attention-LSTM model are updated based on the corresponding training segment data and the capacity labels marked therewith;
[0025] After all training tasks are completed, the average loss of all training tasks is calculated, and the initial parameters of the feature extraction model and the Attention-LSTM model are updated.
[0026] In one or more embodiments, the step of updating the weights of the feature extraction model and the Attention-LSTM model based on the corresponding training segment data and the capacity labels marked therewith in the training task includes:
[0027] Obtaining a sample target set of a training task and dividing it into a sample training set and a sample verification set, wherein the sample target set includes training segment data with labeled capacity labels corresponding to the training task;
[0028] Using the training segment data in the sample training set as the input of the feature extraction model to perform feature extraction, using the extracted features as the input of the Attention-LSTM model, and updating the weights of the feature extraction model and the Attention-LSTM model along the direction of gradient descent based on the loss function and the capacity label until the loss function converges;
[0029] The performance of the feature extraction model and the Attention-LSTM model is tested using the sample validation set to obtain optimal model parameters.
[0030] In one or more embodiments, the step of generating a capacity label for the training segment data based on the capacity data after each charge and discharge cycle includes:
[0031] Dividing the capacity value of the battery into multiple threshold intervals;
[0032] A target threshold interval to which the capacity data belongs is obtained, and a threshold corresponding to the target threshold interval is used as a capacity label of the training segment data.
[0033] In one or more embodiments, the charge and discharge process in each charge and discharge cycle includes one or more of constant current and constant voltage charging, constant current charging, constant current discharging, and standing.
[0034] In one or more embodiments, each charge and discharge cycle includes a constant current discharge phase, a constant current constant voltage charge phase, a constant current charge phase, a rest phase, and a constant current discharge phase, which are arranged in sequence.
[0035] In order to achieve the above-mentioned purpose, the second aspect of the present application provides a battery capacity prediction device based on a deep learning timing model, comprising:
[0036] A data acquisition module, used to obtain the battery's charge and discharge timing data in real time, wherein the charge and discharge timing data includes a voltage-time variation curve during the battery's charge or discharge process;
[0037] A preprocessing module, used for slicing and preprocessing the charge and discharge timing data to obtain a plurality of segment data, each of which includes a voltage-time variation curve of a fixed duration;
[0038] A feature extraction module, used for inputting the segment data into a pre-trained feature extraction model in time sequence to extract features and obtain local dynamic features, wherein the feature extraction model has been trained by domain adversarial training and meta-learning for different charge and discharge processes;
[0039] A prediction module, used for inputting the local dynamic features into a pre-trained Attention-LSTM model in time sequence to obtain a real-time capacity prediction value, wherein the Attention-LSTM model is trained by meta-learning for different charging and discharging processes;
[0040] The output module is used to perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
[0041] In order to achieve the above-mentioned object, the third aspect of the present application provides an electronic device, including:
[0042] at least one processor; and
[0043] A memory storing instructions, which, when executed by the at least one processor, enables the at least one processor to execute the battery capacity prediction method based on the deep learning timing model as described in any of the above embodiments.
[0044] In order to achieve the above-mentioned objectives, the fourth aspect of the present application provides a machine-readable storage medium, which stores executable instructions, and when the instructions are executed, the machine executes the battery capacity prediction method based on the deep learning timing model as described in any of the above embodiments.
[0045] Different from the prior art, the beneficial effects of this application are:
[0046] This application obtains the local dynamic features of the voltage-time curve through feature extraction, and then uses the Attention-LSTM model to capture the time series dependencies and dynamic changes in the charging and discharging process, so that the model can focus on the time period that has the greatest impact on capacity prediction. Through multi-level feature extraction and time series modeling, the model can more accurately predict the battery capacity and significantly improve the prediction accuracy. The prediction result can automatically learn the pattern from the battery charging and discharging process data, and make high-precision predictions based on the battery capacity changes, avoiding lengthy charging and discharging tests, and improving the efficiency and accuracy of battery capacity prediction.
[0047] This application collects voltage data under various processes to perform domain adversarial training and meta-learning training on the model, so that the model of this application can be quickly adjusted under the characteristics of different processes. The battery can more comprehensively predict the actual operating characteristics of the battery during capacity prediction, thereby improving the generalization ability, accuracy and stability of the prediction model, ensuring the adaptability and reliability of the model in practical applications, and making the capacity prediction more accurate and suitable for different working conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 It is a flowchart of an implementation method of a battery capacity prediction method based on a deep learning timing model of the present application;
[0050] Figure 2 It is a flowchart of an implementation method of the training method of the model of the present application;
[0051] Figure 3 It is a schematic diagram of an implementation method of the charge-discharge cycle timing data of the present application;
[0052] Figure 4 is a schematic diagram of an embodiment of capacity data after charge and discharge cycles;
[0053] Figure 5 It is a flowchart of an implementation method of a domain adversarial training method of the present application;
[0054] Figure 6 It is a flowchart of an implementation method of the first embodiment of the meta-learning training method of the present application;
[0055] Figure 7 yes Figure 6 A schematic diagram of a flow chart of an implementation method corresponding to S601;
[0056] Figure 8 It is a structural schematic diagram of an implementation method of a battery capacity prediction device based on a deep learning timing model of the present application;
[0057] Fig. 9 It is a schematic structural diagram of an embodiment of an electronic device of the present application. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0059] This application is mainly used in battery capacity prediction scenarios, specifically for predicting the battery capacity based on the voltage, current and other data of the battery during the test when the battery is undergoing capacity testing, so that the operator can quickly obtain the battery capacity prediction results, thereby helping to extend the battery life, improve battery usage efficiency and prevent system failures caused by insufficient power.
[0060] Specifically, in the battery capacity testing scenario of the terminal, there are many charging and discharging processes for battery testing. Traditional prediction methods lack sufficient adaptability when facing different charging and discharging processes, which limits their versatility and wide application, and affects the reliability and accuracy of capacity prediction.
[0061] In order to solve the above problems, the present application uses generalization training of the model so that the model can be quickly adjusted under the characteristics of different processes, thereby reducing the uncertainty caused by process changes in charge and discharge tests and improving prediction accuracy.
[0062] Specifically, see Figure 1 , Figure 1 It is a flow chart of an implementation method of a battery capacity prediction method based on a deep learning timing model of the present application.
[0063] like Figure 1 As shown, the method includes:
[0064] S100, acquiring battery charge and discharge timing data in real time.
[0065] The charge and discharge timing data includes a voltage-time variation curve during the battery charging or discharging process.
[0066] S200 , performing slicing preprocessing on the charge and discharge timing data to obtain a plurality of segment data.
[0067] Each segment of data includes a voltage-time variation curve of a fixed duration.
[0068] Specifically, in one embodiment, the slice preprocessing process includes:
[0069] The charge and discharge timing data are cleaned and normalized, and then sliced at fixed time intervals to obtain several fragments of data.
[0070] The data cleaning process is used to remove outliers, noise data, and incomplete data segments in the charging and discharging time series data, thereby ensuring the validity and accuracy of the data and making the time series data entering the model more reliable.
[0071] Normalization processing is used to scale the voltage parameters in the charge and discharge timing data to a uniform numerical range, which can eliminate the numerical differences between different eigenvalues, ensure that the model can stably process various types of feature data, and improve the prediction accuracy of the model.
[0072] Exemplarily, in one embodiment, the normalization process may be Min-Max normalization, and its formula is: Where x is the voltage parameter before normalization, x norm is the voltage parameter after normalization, x max and x min They are the maximum voltage parameter and the minimum voltage parameter respectively.
[0073] The purpose of the data slicing operation is to provide more refined input data for subsequent models, thereby improving the prediction accuracy of the model. Each data segment obtained by slicing includes the voltage curve and other relevant characteristic data within the time period.
[0074] For example, in one implementation, the slicing operation may be performed at 10-minute time intervals, and each segment of data includes a voltage curve within 10 minutes.
[0075] S300, inputting the segment data into a pre-trained feature extraction model to extract features and obtain local dynamic features.
[0076] Among them, the feature extraction model undergoes domain adversarial training and meta-learning training for different charging and discharging processes.
[0077] In order to capture the local characteristics of voltage changes over time and remove redundant information, the present application uses a feature extraction model to extract features from the fragment data.
[0078] In one embodiment, the feature extraction model can adopt a 1D-CNN model, which may include multiple convolutional layers, pooling layers and fully connected layers. The convolutional layer slides the convolution kernel on the time dimension of the voltage curve to identify local dynamic change patterns, including the rise and fall rates of the voltage and local fluctuations, and generates a feature map that protects local dynamic features; the pooling layer performs pooling operations on the feature map and downsamples the local features to reduce data redundancy and computational complexity, thereby reducing the dimension of the feature map while retaining important local information; the fully connected layer can integrate the features after convolution and pooling operations to generate a feature sequence for time series modeling, which represents the key dynamic changes of the battery voltage curve.
[0079] Specifically, the convolution operation formula is:
[0080]
[0081] In the formula, y i represents the eigenvalue of the convolution output, x is the input voltage data, w k is the weight of the convolution kernel, and b is the bias term; the convolution kernel w slides along the time dimension to capture the dynamic characteristics of the local time step;
[0082] After the convolution operation, the ReLU activation function is used for nonlinear processing to retain positive features and ignore negative features, thereby improving the model's ability to capture the battery voltage change pattern. The formula is:
[0083] ReLU(x)=max(0,x)
[0084] Through the ReLU activation function, negative values are set to 0, retaining important positive eigenvalues, making the model more sensitive to local features.
[0085] Exemplarily, in one embodiment, the feature extraction model may include 4 convolutional layers, 3 pooling layers and 1 fully connected layer, the number of convolution kernels in the 4 convolutional layers are 64, 32, 64 and 32 respectively, the convolution kernel size is 3, and the step size is 2. The fully connected layer contains 32 neurons. In the 3 pooling layers, the pooling kernel size used is 3×1 and the step size is 2. The pooling method adopts the maximum pooling method (Max Pooling), which reduces the data dimension by extracting the maximum eigenvalue of the local voltage curve and retains the most representative features. After the pooling operation, the fully connected layer can integrate the features after the convolution and pooling operations to generate a feature sequence for time series modeling, which represents the key dynamic changes of the battery voltage curve.
[0086] In order to make the feature extraction model applicable to different charging and discharging processes, so that the terminal can maintain its feature extraction capability when facing different charging and discharging processes, this application performs domain adversarial training and meta-learning training on the feature extraction model for different charging and discharging processes, so that the model can be quickly adjusted under the characteristics of different processes and show better generalization ability under unseen process conditions. For specific training methods, please refer to the detailed description below.
[0087] S400, input the local dynamic features into the pre-trained Attention-LSTM model in time sequence to obtain the real-time capacity prediction value.
[0088] Among them, the Attention-LSTM model is trained through meta-learning for different charging and discharging processes.
[0089] In order to predict the battery capacity based on local dynamic features, this application adopts the Attention-LSTM model, which includes an LSTM network, an Attention mechanism and a fully connected layer.
[0090] The LSTM network is a deep learning model that can capture long-term dependencies in time series data. It controls the flow and retention of information through memory cells (cell states) and input gates, forget gates, and output gates, thereby capturing long-term and short-term dependencies in time series. The LSTM network can learn the long-term dependencies of time series data from local dynamic features and record the dynamic changes of the battery during the charging, discharging, and static stages.
[0091] Specifically, the key formula of the LSTM unit is as follows:
[0092] Forget gate: f t =σ(W f ·[h t-1 , x t ]+b f );
[0093] The forget gate determines how much old information the LSTM should discard. t is the output of the forget gate; σ is the Sigmoid activation function with an output range of [0, 1], which is used to control the proportion of information retention; W f is the weight matrix of the forget gate; b f is the bias term; h t-1 is the hidden state of the previous time step; x t is the input feature of the current time step.
[0094] Input gate: i t =σ(W i ·[ht-1 , x t ]+b i );
[0095] The input gate controls how much of the current input information should be retained. t is the output of the input gate, which controls the proportion of the current input information entering the memory unit; W i is the weight matrix of the input gate, b i is the bias term.
[0096] The memory unit update formula is:
[0097]
[0098] In the formula, C t is the unit state at the current time, C t-1 is the cell state at the previous time step, is the current input unit state, W C is the weight of the memory unit, b C is the bias term;
[0099] Output gate: o t =σ(W o ·[h t-1 , x t ]+b o );
[0100] Where W o is the weight of the output gate, b o is the bias term;
[0101] The final LSTM output is: h t =o t *tanh(C t )
[0102] Through the above formula, the LSTM network can remember the long-term dependence of the battery capacity during the charging and discharging process and capture the changing trend of the battery voltage over time.
[0103] Furthermore, the present application introduces an attention mechanism to dynamically adjust the weight of each time step, thereby focusing on the time period that has a greater impact on battery capacity prediction and improving the ability to capture changes in battery capacity.
[0104] Specifically, the attention mechanism of this application is a temporal attention mechanism, which is a mechanism specially designed for processing time series data. It can perform weighted calculations based on the influence weights of different time steps and dynamically adjust the contribution of each time step. Compared with the standard attention mechanism, temporal attention can more accurately capture the time-dependent features in the sequence.
[0105] The temporal attention mechanism formula is:
[0106] e t =tanh(W e ·h t +b e )
[0107]
[0108] In the formula, h t is the hidden state of LSTM, W e is the weight, b e is the bias term, α t is the attention weight at time step t, α t The larger it is, the greater the contribution of this time step to capacity prediction.
[0109] When processing the charge and discharge curves of lead-acid batteries, the temporal attention mechanism can focus on key moments that have a greater impact on battery capacity prediction, such as voltage peaks or changing trends during charging or discharging.
[0110] Finally, the real-time capacity prediction value processed by the Attention-LSTM model is output. The real-time capacity prediction value is a preliminary capacity prediction made by the model based on the voltage curve and time dependency of the battery at different time steps, which represents the system's preliminary prediction of the remaining capacity of the battery.
[0111] It should be noted that in the present application, the battery charge and discharge timing data is continuously collected, and accordingly, the local dynamic characteristics are also continuously input into the model, and the real-time capacity prediction value obtained by the model is also always in an updated state.
[0112] In order to make the model of this application applicable to different charging and discharging processes, this application performs meta-learning training on the Attention-LSTM model for different charging and discharging processes, so that the model can be quickly adjusted under the characteristics of different processes and show better generalization ability under unseen process conditions. For the specific training method, please refer to the detailed description below.
[0113] S500: Perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
[0114] Since the real-time capacity prediction value obtained by S400 is a preliminary estimate of the battery capacity and does not contain confidence information, it is also necessary to perform confidence analysis on the prediction value to ensure the reliability of the prediction result.
[0115] Specifically, in the present application, Bayesian reasoning is used to perform confidence analysis of the results. Bayesian reasoning samples the probability distribution of the capacity prediction value, calculates the variance and mean of the prediction result, and thus generates a confidence interval for the capacity prediction. The calculated confidence interval is then analyzed, and it is determined whether the confidence of the prediction value reaches a set threshold. If the threshold is reached, the system terminates the charge and discharge test and outputs the final capacity prediction result to reduce unnecessary energy consumption.
[0116] Specifically, Bayesian reasoning includes the following steps:
[0117] (1) Prior distribution:
[0118] (2) Calculate the likelihood function:
[0119] (3) Posterior distribution:
[0120] Among them, the mean μ post With variance The formula is:
[0121]
[0122] Further, from the posterior distribution, the confidence interval of the capacity prediction can be calculated. The confidence interval represents the probability that the capacity prediction value falls within a certain range. In one embodiment, a 95% confidence interval can be selected, and its formula is:
[0123] CI 95% =[μ post -1.96·σ post ,μ post +1.96·σ post ]
[0124] Finally, based on the calculation results of the confidence interval, if the confidence level of the capacity prediction reaches the set threshold, the system will automatically terminate the charge and discharge test and output the final capacity prediction result. If the confidence level does not reach the preset threshold, the system will continue the charge and discharge test until the confidence level reaches the target level.
[0125] Based on the above steps, the local dynamic features of the voltage-time curve are obtained through feature extraction. Then, the Attention-LSTM model is used to capture the time series dependencies and dynamic changes in the charging and discharging process, so that the model can focus on the time period that has the greatest impact on capacity prediction. Through multi-level feature extraction and time series modeling, the model can more accurately predict the battery capacity and significantly improve the prediction accuracy. The prediction result can automatically learn patterns from the battery charging and discharging process data, and make high-precision predictions based on the battery capacity changes, avoiding lengthy charging and discharging tests and improving the efficiency and accuracy of battery capacity prediction.
[0126] The following is a detailed introduction to the feature extraction model and the training method of the Attention-LSTM model of this application. Figure 2 , Figure 2 It is a flowchart of an implementation method of the training method of the model of the present application.
[0127] like Figure 2 As shown, the training method includes:
[0128] S10, obtaining the battery's charge and discharge cycle timing data and the capacity data after each charge and discharge cycle.
[0129] Each charge and discharge cycle includes multiple stages of different charge and discharge processes.
[0130] In order to improve the generalization ability of the model for different charging and discharging processes, the present application collects charging and discharging cycle timing data including multiple different charging and discharging processes, wherein each cycle has multiple stages with different charging and discharging processes.
[0131] In one embodiment, the charge and discharge process in each charge and discharge cycle includes one or more of constant current and constant voltage charging, constant current charging, constant current discharging and standing; of course, in other embodiments, other types of different charge and discharge processes may also be included, all of which can achieve the effect of this embodiment.
[0132] Exemplarily, each charge and discharge cycle may include a constant current discharge stage, a constant current constant voltage charge, a constant current charge stage, a rest stage, and a constant current discharge stage, which are arranged in sequence; in the constant current charge stage, the charging current is kept constant at first, and the battery voltage gradually rises. After reaching the set threshold, the voltage remains constant, and the current gradually decreases until it drops to a certain small current value, and the constant voltage charge ends; next, in the constant current charge stage, the battery is charged with a fixed current, and the voltage gradually rises with the charging process; when the charging is completed, it enters the rest stage, and the rest time is set according to the process requirements, which is usually used to stabilize the chemical reaction inside the battery. Finally, in the constant current discharge stage, the battery is discharged with a constant current, and the voltage gradually decreases. When the voltage drops to a preset value (such as 10.5V), the discharge ends.
[0133] Specifically, see Figure 3 and Figure 4 , Figure 3 It is a schematic diagram of an implementation method of the charge and discharge cycle timing data of the present application. Figure 4 Schematic diagram of an embodiment of capacity data after charge and discharge cycles. Figure 3 As shown, in each charge and discharge cycle, a variety of charge and discharge processes are used, and the voltage decreases, increases, remains unchanged, increases, and decreases in sequence; Figure 4 As shown, capacity data is recorded after each charge and discharge cycle, and the capacity value gradually decreases after multiple cycles.
[0134] S20, dividing the charge-discharge cycle time series data into a plurality of sub-time series data according to the charge-discharge process.
[0135] S30 , performing slice preprocessing on each sub-time series data to obtain a number of training segment data, each training segment data including a voltage-time variation curve of a fixed duration.
[0136] In order to generalize the model for different charging and discharging processes, the present application divides the time series data of multiple different charging and discharging processes according to different processes, thereby obtaining multiple sub-time series data corresponding to the charging and discharging processes one by one, and each sub-time series data includes a voltage-time variation curve of the battery under a charging and discharging process.
[0137] Then, similar to S200, the training data is sliced and preprocessed to help improve the subsequent prediction effect.
[0138] S40: Generate a capacity label for the training segment data based on the capacity data after each charge and discharge cycle.
[0139] like Figure 3 As shown, the capacity data of the current battery can be collected after each charge and discharge cycle, and a capacity label can be generated for the training segment data based on the capacity data.
[0140] Since the capacity of the battery changes continuously, for example, from 99.5% in the 10th cycle to 98.8% in the 11th cycle, in order to reduce the number of capacity labels, reduce the complexity of model training and allow the model to focus on the time period with faster capacity changes, in one embodiment, the method for generating capacity labels may include:
[0141] Dividing the capacity value of the battery into multiple threshold intervals;
[0142] The target threshold interval to which the capacity data belongs is obtained, and the threshold corresponding to the target threshold interval is used as the capacity label of the training segment data.
[0143] Based on the above scheme, a unified label is assigned to each data slice within the threshold range, so that the model can better focus on the overall trend of capacity decline, thereby significantly improving the accuracy of capacity prediction; for training segment data with unclear capacity value changes, the same capacity label can be used for annotation to ensure that the model can learn consistent capacity features in local areas and avoid the reduction of model generalization ability due to too many subtle labels; at the same time, by setting labels at key points of capacity change, the key state changes of the battery can be better captured, especially in the stage of rapid capacity decline, and the model can focus on learning the features of these important moments.
[0144] Exemplarily, in one implementation, 1% may be used as the width of the threshold interval. When the capacity values after the cycle are 99.5% and 99.3%, 99% may be used as their capacity labels.
[0145] S50. Based on the training segment data corresponding to different charging and discharging processes, domain adversarial training is performed on the feature extraction model.
[0146] After the training data is processed, the feature extraction model can be trained on domain adversarial data, so that it can extract domain-invariant features when facing different charging and discharging processes, ensuring the adaptability of the model to different process conditions.
[0147] Specifically, in this embodiment, a domain discriminator is introduced after the feature extraction model, and the domain discriminator is connected to the feature extraction model through a gradient reversal layer. Figure 5 , Figure 5 It is a flowchart of an implementation method of domain adversarial training in the present application.
[0148] like Figure 5 As shown, the domain adversarial training method includes:
[0149] S501 , taking the training segment data corresponding to the target charge-discharge process as the source domain, taking the training segment data corresponding to other charge-discharge processes as the target domain, and inputting them into the feature extraction model for feature extraction.
[0150] S502: Input the extracted features into the domain discriminator, calculate the loss function of the domain discriminator, and update the weights of the feature extraction model through the gradient reversal layer until the loss function converges.
[0151] Among them, the goal of the domain discriminator is to classify the input training fragment data into the correct category (source domain or target domain) as much as possible. However, due to the existence of the gradient reversal layer, the goal of the feature extraction model is to prevent the domain discriminator from classifying the training fragment data into the correct category as much as possible, thus forming an adversarial relationship.
[0152] By calculating the loss function of the domain discriminator and updating the weight of the feature extraction model through the gradient reversal layer, the feature extraction model can extract features for different charging and discharging processes, ensuring the adaptability of the model to different charging and discharging processes. Among them, the loss function of the domain discriminator is well known in the art and will not be repeated here.
[0153] S60. Based on the training segment data corresponding to different charging and discharging processes and their marked capacity labels, meta-learning training is performed on the feature extraction model and the Attention-LSTM model.
[0154] Furthermore, the present application trains the model through a meta-learning method to increase the generalization ability of the model and ensure the adaptability of the model to different process conditions.
[0155] Specifically, see Figure 6 , Figure 6 1 is a flow chart of an implementation method of the meta-learning training method of the present application. Figure 6 As shown, the meta-learning training method includes:
[0156] S601. Construct a training task for each charge and discharge process. In the training task, weights of a feature extraction model and an Attention-LSTM model are updated based on corresponding training segment data and their marked capacity labels.
[0157] S602: After all training tasks are completed, the average loss of all training tasks is calculated, and the initial parameters of the feature extraction model and the Attention-LSTM model are updated.
[0158] It is understandable that a training task can be constructed for each charge and discharge process, in which the model is trained based on the data of a single charge and discharge process so that the model adapts to the charge and discharge process, that is, the inner cycle step;
[0159] When the training tasks of all charging and discharging processes are completed, the average loss of all training tasks can be calculated, and the initial parameters of the model can be updated based on the average loss, that is, the outer loop step. The initial parameters enable the model to adjust quickly when facing different charging and discharging processes, thereby improving the generalization ability of the model.
[0160] Specifically, see Figure 7 , Figure 7 yes Figure 6 A flow chart of an implementation method corresponding to S601 in FIG.
[0161] like Figure 7 As shown, the inner loop steps specifically include:
[0162] S6011. Obtain a sample target set of a training task and divide it into a sample training set and a sample verification set. The sample target set includes training segment data with marked capacity labels corresponding to the training task.
[0163] S6012. Use the training fragment data in the sample training set as the input of the feature extraction model for feature extraction, use the extracted features as the input of the Attention-LSTM model, and based on the loss function and capacity label, update the weights of the feature extraction model and the Attention-LSTM model along the direction of gradient descent until the loss function converges.
[0164] S6013. Test the performance of the feature extraction model and Attention-LSTM model using a sample validation set to obtain the optimal model parameters.
[0165] In the above inner loop parameter update process, the loss function can be the mean square error (MSE), and the formula of MSE is as follows:
[0166]
[0167] In order to effectively optimize the model parameters, in one embodiment, the Adam optimization algorithm is also used in the training process, which combines the advantages of momentum and RMSprop, can adapt to the gradient changes of different parameters and accelerate convergence. The update formula of the Adam optimization algorithm is as follows:
[0168]
[0169] Among them, m t and v t are the first-order and second-order momentum of the gradient, respectively. η is the learning rate, which can be set to 0.001 in one embodiment; β1 and β2 are the decay rates of the momentum term, which are usually set to 0.9 and 0.999, respectively. The Adam optimization algorithm performs well when processing high-dimensional gradients, and can dynamically adjust the learning rate to ensure that the parameters of different features are effectively updated, avoiding the model from falling into the local optimum.
[0170] Based on the above steps, by collecting voltage data under various processes for domain adversarial training and meta-learning training of the model, the model of the present application can be quickly adjusted under the characteristics of different processes, and the battery can more comprehensively predict the actual operating characteristics of the battery during capacity prediction, thereby improving the generalization ability, accuracy and stability of the prediction model, ensuring the adaptability and reliability of the model in practical applications, and making the capacity prediction more accurate and suitable for different working conditions.
[0171] This application also provides a battery capacity prediction device based on a deep learning timing model, see Figure 8 , Figure 8It is a structural schematic diagram of an embodiment of a battery capacity prediction device based on a deep learning timing model of the present application.
[0172] like Figure 8 As shown, the device includes a data acquisition module 21, a preprocessing module 22, a feature extraction module 23, a prediction module 24 and an output module 25.
[0173] The data acquisition module 21 is used to obtain the battery charging and discharging timing data in real time, and the charging and discharging timing data includes the voltage-time variation curve during the battery charging or discharging process;
[0174] The preprocessing module 22 is used to perform slice preprocessing on the charge and discharge timing data to obtain a plurality of segment data, each of which includes a voltage-time variation curve of a fixed duration;
[0175] The feature extraction module 23 is used to input the segment data into a pre-trained feature extraction model in time sequence to extract features and obtain local dynamic features, wherein the feature extraction model has undergone domain adversarial training and meta-learning training for different charge and discharge processes;
[0176] The prediction module 24 is used to input the local dynamic features into the pre-trained Attention-LSTM model in time sequence to obtain the real-time capacity prediction value, wherein the Attention-LSTM model is trained by meta-learning for different charging and discharging processes;
[0177] The output module 25 is used to perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
[0178] In one embodiment, it also includes a model training module 26, which is used to obtain the battery's charge and discharge cycle timing data and capacity data after each charge and discharge cycle, wherein each charge and discharge cycle includes multiple stages of different charge and discharge processes; the charge and discharge cycle timing data is divided into multiple sub-timing data according to the charge and discharge process; each sub-timing data is sliced and preprocessed to obtain a number of training segment data, each training segment data includes a voltage-time variation curve of a fixed duration; based on the capacity data after each charge and discharge cycle, a capacity label is generated for the training segment data; based on the training segment data corresponding to different charge and discharge processes, domain adversarial training is performed on the feature extraction model; based on the training segment data corresponding to different charge and discharge processes and their marked capacity labels, meta-learning training is performed on the feature extraction model and the Attention-LSTM model.
[0179] As above Figures 1 to 7, a battery capacity prediction method according to an embodiment of this specification is described. The details mentioned in the above description of the method embodiment are also applicable to the battery capacity prediction device of the embodiment of this specification. The above battery capacity prediction device can be implemented in hardware, or in software, or in a combination of hardware and software.
[0180] The present application also provides an electronic device, see Fig. 9 , Fig. 9 Schematic diagram of the structure of an electronic device of the present application. Fig. 9 As shown, the electronic device 30 may include at least one processor 31, a memory 32 (e.g., a non-volatile memory), a memory 33, and a communication interface 34, and the at least one processor 31, the memory 32, the memory 33, and the communication interface 34 are connected together via a bus 35. At least one processor 31 executes at least one computer-readable instruction stored or encoded in the memory 32.
[0181] It should be understood that the computer executable instructions stored in the memory 32, when executed, cause at least one processor 31 to perform the above combined operations in various embodiments of the present specification. Figure 1-Figure 8 Describes the various operations and functions.
[0182] In the embodiments of the present specification, the electronic device 30 may include, but is not limited to, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, and the like.
[0183] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-Figure 5 Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.
[0184] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute part of this specification.
[0185] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.
[0186] Those skilled in the art should understand that the various embodiments disclosed above can be modified and altered in various ways without departing from the essence of the invention. Therefore, the protection scope of this specification should be defined by the appended claims.
[0187] It should be noted that not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical client, or some units may be implemented by multiple physical clients, or some components in multiple independent devices may be implemented together.
[0188] In the above embodiments, the hardware unit or module can be realized by mechanical or electrical means. For example, a hardware unit, module or processor can include permanent dedicated circuit or logic (such as special processor, FPGA or ASIC) to complete the corresponding operation. The hardware unit or processor can also include programmable logic or circuit (such as general-purpose processor or other programmable processor), which can be temporarily set by software to complete the corresponding operation. Specific implementation (mechanical method or dedicated permanent circuit or temporary circuit) can be determined based on cost and time consideration.
[0189] The specific embodiments described above in conjunction with the accompanying drawings describe exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of protection of the claims. The term "exemplary" used throughout this specification means "used as an example, instance or illustration" and does not mean "preferred" or "having advantages" over other embodiments. For the purpose of providing an understanding of the described technology, the specific embodiments include specific details. However, these technologies can be implemented without these specific details. In some instances, in order to avoid making the concepts of the described embodiments difficult to understand, well-known structures and devices are shown in block diagram form.
[0190] The above description of the disclosure is provided to enable any person of ordinary skill in the art to implement or use the disclosure. Various modifications to the disclosure will be apparent to those of ordinary skill in the art, and the general principles corresponding to the disclosure may be applied to other variations without departing from the scope of protection of the disclosure. Therefore, the disclosure is not limited to the examples and designs described herein, but is consistent with the widest range of principles and novel features disclosed herein.
Claims
1. A battery capacity prediction method based on a deep learning time series model, characterized in that: include: Acquire battery charge and discharge timing data in real time, wherein the charge and discharge timing data includes a voltage-time variation curve during the battery charging or discharging process; Slice the charge and discharge timing data to obtain a plurality of segment data, each of which includes a voltage-time variation curve of a fixed duration; Inputting the segment data into a pre-trained feature extraction model to extract features and obtain local dynamic features, wherein the feature extraction model has been trained by domain adversarial training and meta-learning for different charge and discharge processes; Inputting the local dynamic features into a pre-trained Attention-LSTM model in time sequence to obtain a real-time capacity prediction value, wherein the Attention-LSTM model is trained by meta-learning for different charging and discharging processes; Perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
2. The battery capacity prediction method according to claim 1, characterized in that: The step of slicing and preprocessing the charge and discharge timing data comprises: The charge and discharge timing data are cleaned and normalized, and then sliced at fixed time intervals to obtain a number of fragment data.
3. The battery capacity prediction method according to claim 1, characterized in that: The training method of the feature extraction model and the Attention-LSTM model includes: Obtaining battery charge and discharge cycle timing data and capacity data after each charge and discharge cycle, wherein each charge and discharge cycle includes multiple stages of different charge and discharge processes; Dividing the charge-discharge cycle time series data into a plurality of sub-time series data according to the charge-discharge process; Performing slicing preprocessing on each of the sub-time series data to obtain a plurality of training segment data, each of the training segment data comprising a voltage-time variation curve of a fixed duration; generating a capacity label for the training segment data based on the capacity data after each charge and discharge cycle; Based on the training segment data corresponding to different charging and discharging processes, domain adversarial training is performed on the feature extraction model; Based on the training segment data corresponding to different charging and discharging processes and their marked capacity labels, meta-learning training is performed on the feature extraction model and the Attention-LSTM model.
4. The battery capacity prediction method according to claim 3, characterized in that: The step of performing domain adversarial training on the feature extraction model based on the training segment data corresponding to different charging and discharging processes includes: The training segment data corresponding to the target charge-discharge process is used as the source domain, and the training segment data corresponding to other charge-discharge processes is used as the target domain, and is input into the feature extraction model for feature extraction; The extracted features are input into a domain discriminator, a loss function of the domain discriminator is calculated, and the weights of the feature extraction model are updated through a gradient reversal layer until the loss function converges.
5. The battery capacity prediction method according to claim 3, characterized in that: The step of performing meta-learning training on the feature extraction model and the Attention-LSTM model based on the training segment data corresponding to different charge and discharge processes and the capacity labels marked therein comprises: A training task is constructed for each charge and discharge process, and in the training task, the weights of the feature extraction model and the Attention-LSTM model are updated based on the corresponding training segment data and the capacity labels marked therewith; After all training tasks are completed, the average loss of all training tasks is calculated, and the initial parameters of the feature extraction model and the Attention-LSTM model are updated.
6. The battery capacity prediction method according to claim 5, characterized in that: The step of updating the weights of the feature extraction model and the Attention-LSTM model based on the corresponding training segment data and the capacity labels marked therein in the training task includes: Obtaining a sample target set of a training task and dividing it into a sample training set and a sample verification set, wherein the sample target set includes training segment data with labeled capacity labels corresponding to the training task; Using the training segment data in the sample training set as the input of the feature extraction model to perform feature extraction, using the extracted features as the input of the Attention-LSTM model, and updating the weights of the feature extraction model and the Attention-LSTM model along the direction of gradient descent based on the loss function and the capacity label until the loss function converges; The performance of the feature extraction model and the Attention-LSTM model is tested using the sample validation set to obtain optimal model parameters.
7. The battery capacity prediction method according to claim 3, characterized in that: The step of generating a capacity label for the training segment data based on the capacity data after each charge and discharge cycle includes: Dividing the capacity value of the battery into multiple threshold intervals; A target threshold interval to which the capacity data belongs is obtained, and a threshold corresponding to the target threshold interval is used as a capacity label of the training segment data.
8. The battery capacity prediction method according to claim 3, characterized in that: The charge and discharge process in each charge and discharge cycle includes one or more of constant current and constant voltage charging, constant current charging, constant current discharging and standing; and / or, Each charge and discharge cycle includes a constant current discharge phase, a constant current constant voltage charge phase, a constant current charge phase, a rest phase and a constant current discharge phase which are arranged in sequence.
9. A battery capacity prediction device based on a deep learning time series model, characterized in that: include: A data acquisition module, used to obtain the battery's charge and discharge timing data in real time, wherein the charge and discharge timing data includes a voltage-time variation curve during the battery's charge or discharge process; A preprocessing module, used for slicing and preprocessing the charge and discharge timing data to obtain a plurality of segment data, each of which includes a voltage-time variation curve of a fixed duration; A feature extraction module, used for inputting the segment data into a pre-trained feature extraction model in time sequence to extract features and obtain local dynamic features, wherein the feature extraction model has been trained by domain adversarial training and meta-learning for different charge and discharge processes; A prediction module, used for inputting the local dynamic features into a pre-trained Attention-LSTM model in time sequence to obtain a real-time capacity prediction value, wherein the Attention-LSTM model is trained by meta-learning for different charging and discharging processes; The output module is used to perform Bayesian reasoning on the real-time capacity prediction value, calculate the confidence level, and output the capacity prediction result until the confidence level reaches a set threshold.
10. An electronic device, comprising: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, enables the at least one processor to execute the battery capacity prediction method based on the deep learning timing model as described in any one of claims 1 to 9.
11. A machine-readable storage medium storing executable instructions, which, when executed, enable the machine to execute the battery capacity prediction method based on the deep learning timing model as described in any one of claims 1 to 9.