A method and device for predicting electric vehicle power battery failure
Through the combination of the Transformer model and the time channel self-attention module, the multi-dimensional data of electric vehicle power batteries is processed, which solves the problem of ignored cross-sensor dependencies in the existing technology and improves the accuracy of fault prediction.
Patent Information
- Application Number
- CN202410844732.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Existing power battery failure prediction methods only model the autocorrelation of a single sensor sequence and ignore the dependence across sensor dimensions, resulting in low accuracy of electric vehicle power battery failure prediction.
The Transformer model is used to collect multiple sensor data, perform data preprocessing, build a training data set, and use the time channel self-attention module and the cross-channel self-attention module for multi-dimensional data processing to establish a model for battery failure prediction.
The accuracy of fault prediction of electric vehicle power batteries is improved. Through data processing across time and cross-channel dimensions, the modeling ability of battery parameter dependencies is enhanced, and the accuracy of fault prediction is improved.
Smart Images

Figure CN118395310B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric vehicle batteries, and more specifically, to a method and device for predicting faults of electric vehicle power batteries. Background Art
[0002] The power source of electric vehicles is mainly power batteries, and their safety and reliability are crucial to the entire vehicle system. Power battery fault prediction and forecasting help ensure the safe and efficient operation of electric vehicles, extend battery life, reduce maintenance costs, enhance user confidence, and promote technological progress. Therefore, the research on power battery fault prediction has extremely important application and practical significance. However, existing power battery fault prediction methods usually only model the autocorrelation of a single sensor sequence and ignore the dependencies across sensor dimensions, resulting in low fault prediction accuracy of electric vehicle power batteries. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method and device for predicting faults of electric vehicle power batteries, which can improve the accuracy of fault prediction of electric vehicle power batteries.
[0004] The first aspect of the present application provides a method for predicting electric vehicle power battery failure, comprising:
[0005] Collecting first battery parameter sequence data of the electric vehicle power battery system;
[0006] Performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data;
[0007] constructing a training data set based on the preprocessed data;
[0008] Build a Transformer model for predicting electric vehicle battery failures and create a loss function;
[0009] Training the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model;
[0010] Acquire second battery parameter sequence data of the electric vehicle to be predicted;
[0011] The second battery parameter sequence data is input into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0012] In the above implementation process, the step of collecting the first battery parameter sequence data of the electric vehicle power battery system mainly illustrates that the present application wants to obtain the data returned by multiple sensors, so as to strengthen the dependency relationship across sensor dimensions. On this basis, the first battery parameter sequence data is preprocessed to obtain preprocessed data, which can make the data more suitable for modeling and training, thereby ensuring the training effect of the Transformer model, and thus helping to ensure the accuracy of battery fault prediction. Specifically, the method can construct training data based on preprocessed data, construct a Transformer model for predicting electric vehicle power battery faults, and create a loss function, and then train the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model; it can be seen that the method can be professionally trained based on the Transformer model so that its training results can be competent for the fault prediction of electric vehicle power batteries. Finally, the second battery parameter sequence data of the electric vehicle to be predicted is obtained; and the second battery parameter sequence data is input into the battery fault prediction model for battery fault prediction to obtain a battery fault prediction result; it can be seen that the method proposes an application method of a fault prediction model for an electric vehicle power battery, so as to present the fault prediction process of the electric vehicle power battery, and then realize the full process of fault prediction of the electric vehicle power battery.
[0013] Further, the performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data includes:
[0014] Segmenting the first battery parameter sequence data to obtain a plurality of segment data;
[0015] Performing pre-smoothing and gap-filling processing on each of the segment data based on a polynomial regression algorithm to obtain first processed segment data;
[0016] Performing secondary smoothing on the first processed segment data based on an exponentially weighted moving average algorithm to obtain second processed segment data after denoising and missing value filling;
[0017] The second processed segment data is standardized to obtain preprocessed data.
[0018] Furthermore, constructing a training data set based on the preprocessed data includes:
[0019] The pre-processed data is segmented by a preset sliding window to obtain a battery parameter subsequence;
[0020] Performing labeling processing on each of the battery parameter sequences to obtain labeling data; wherein the labeling data includes the battery parameter sequence and a battery safety status label corresponding to the battery parameter sequence;
[0021] A training data set, a validation data set, and a test data set are constructed based on the labeled data.
[0022] Furthermore, the Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module;
[0023] Wherein, the input data embedding module is used to embed the data in dimension segments, position, time and battery operation status;
[0024] The temporal channel self-attention module includes a cross-temporal self-attention stage, a cross-channel self-attention stage and an information fusion stage;
[0025] The classification head module includes a fully connected layer and a Softmax layer;
[0026] The loss function is a cross entropy loss function.
[0027] Furthermore, the training of the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model includes:
[0028] Determine an objective function and an optimization method for training the Transformer model based on the loss function and the Adam optimizer;
[0029] Obtaining a training strategy for the Transformer model;
[0030] Randomly initializing model parameters of the Transformer model;
[0031] Processing the Transformer model according to the training strategy and the training data set to obtain a processing result;
[0032] When training the Transformer model, calculating the gradient of the loss function for each parameter in the Transformer model based on the loss function, the back propagation algorithm, and the processing result;
[0033] Based on the gradient, the objective function and the optimization method, the model parameters of the Transformer model are updated to obtain an updated target Transformer model;
[0034] Adjusting the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy;
[0035] Determining whether the performance of the target Transformer model has passed the verification based on the verification data set;
[0036] If yes, the target Transformer model is determined as the battery fault prediction model.
[0037] Furthermore, adjusting the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy includes:
[0038] Monitoring the model's loss and diagnostic accuracy on the test dataset;
[0039] The training strategy is adjusted according to the loss and the diagnostic accuracy; wherein the training strategy includes at least a model learning rate, a batch size, and a number of training iterations.
[0040] Furthermore, judging whether the performance of the target Transformer model has passed the verification based on the verification data set includes:
[0041] Inputting the verification data set into the target Transformer model for prediction to obtain a prediction result;
[0042] Compare the prediction result with the battery condition label in the verification data set to obtain a comparison result;
[0043] Calculate the evaluation index result of the target Transformer model according to the comparison result;
[0044] Determine whether the performance of the target Transformer model has passed the verification according to the evaluation index result;
[0045] If yes, executing the step of determining the target Transformer model as a battery fault prediction model;
[0046] If not, execute the processing of the Transformer model according to the training strategy and the training data set to obtain a processing result.
[0047] A second aspect of the present application provides a device for predicting a fault of a power battery of an electric vehicle, the device comprising:
[0048] A collection unit, used for collecting first battery parameter sequence data of a power battery system of an electric vehicle;
[0049] A preprocessing unit, used for performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data;
[0050] A first construction unit, configured to construct a training data set based on the preprocessed data;
[0051] The second building unit is used to build a Transformer model for predicting electric vehicle power battery failure and create a loss function;
[0052] A training unit, used for training the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model;
[0053] An acquisition unit, used for acquiring second battery parameter sequence data of the electric vehicle to be predicted;
[0054] The prediction unit is used to input the second battery parameter sequence data into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0055] Furthermore, the preprocessing unit comprises:
[0056] A first segmentation subunit, configured to segment the first battery parameter sequence data to obtain a plurality of segment data;
[0057] a gap filling subunit, configured to perform pre-smoothing and gap filling processing on each of the segment data based on a polynomial regression algorithm to obtain first processed segment data;
[0058] A denoising and filling subunit, configured to perform secondary smoothing on the first processing segment data based on an exponentially weighted moving average algorithm to obtain second processing segment data after denoising and missing value filling;
[0059] The standardization subunit is used to perform standardization processing on the second processing segment data to obtain preprocessed data.
[0060] Furthermore, the first construction unit includes:
[0061] A second segmentation subunit, used for segmenting the pre-processed data through a preset sliding window to obtain a battery parameter subsequence;
[0062] A labeling subunit, configured to label each of the battery parameter sequences to obtain labeling data; wherein the labeling data includes the battery parameter sequence and a battery safety status label corresponding to the battery parameter sequence;
[0063] The construction subunit is used to construct a training data set, a verification data set and a test data set based on the labeled data.
[0064] Furthermore, the Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module;
[0065] Wherein, the input data embedding module is used to embed the data in dimension segments, position, time and battery operation status;
[0066] The temporal channel self-attention module includes a cross-temporal self-attention stage, a cross-channel self-attention stage and an information fusion stage;
[0067] The classification head module includes a fully connected layer and a Softmax layer;
[0068] The loss function is a cross entropy loss function.
[0069] Furthermore, the training unit comprises:
[0070] A first determination subunit, used to determine an objective function and an optimization method for training the Transformer model based on the loss function and the Adam optimizer;
[0071] An acquisition subunit is used to acquire a training strategy of the Transformer model;
[0072] An initialization subunit, used to randomly initialize the model parameters of the Transformer model;
[0073] A processing subunit, used to process the Transformer model according to the training strategy and the training data set to obtain a processing result;
[0074] A calculation subunit, used for calculating the gradient of the loss function for each parameter in the Transformer model based on the loss function, the back propagation algorithm and the processing result when training the Transformer model;
[0075] An updating subunit, used to update the model parameters of the Transformer model based on the gradient, the objective function and the optimization method to obtain an updated target Transformer model;
[0076] An adjustment subunit, used to adjust the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy;
[0077] A judging subunit, configured to judge whether the performance of the target Transformer model has passed the verification based on the verification data set;
[0078] The second determining subunit is used to determine the target Transformer model as the battery fault prediction model when the judging subunit determines that the result is yes.
[0079] Furthermore, the adjustment subunit includes:
[0080] A monitoring module, used to monitor the loss and diagnostic accuracy of the model on the test data set;
[0081] An adjustment module is used to adjust the training strategy according to the loss and the diagnostic accuracy; wherein the training strategy at least includes a model learning rate, a batch size, and a number of training iterations.
[0082] Furthermore, the judging subunit includes:
[0083] A prediction module, used to input the verification data set into the target Transformer model for prediction to obtain a prediction result;
[0084] A comparison module, used to compare the prediction result with the battery condition label in the verification data set to obtain a comparison result;
[0085] A calculation module, used to calculate the evaluation index result of the target Transformer model according to the comparison result;
[0086] A judgment module is used to judge whether the performance of the target Transformer model has passed the verification according to the evaluation index result; if yes, trigger the second determination subunit to execute the determination of the target Transformer model as a battery fault prediction model; if not, trigger the processing subunit to execute the processing of the Transformer model according to the training strategy and the training data set to obtain a processing result.
[0087] The third aspect of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the electric vehicle power battery fault prediction method described in any one of the first aspect of the present application.
[0088] A fourth aspect of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the electric vehicle power battery fault prediction method described in any one of the first aspect of the present application is executed.
[0089] The beneficial effects of the present application are as follows: the method and device can use a Transformer network architecture based on a time channel self-attention module, and process data from both a cross-time dimension and a cross-channel dimension (so that the cross-time self-attention module models time dependencies, and the cross-channel attention module models dependencies between different battery parameters), thereby achieving multi-dimensional data processing, which is beneficial for improving the accuracy of fault prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0091] Figure 1 A schematic diagram of a flow chart of a method for predicting electric vehicle power battery failure provided in an embodiment of the present application;
[0092] Figure 2 A schematic diagram of another electric vehicle power battery fault prediction method provided in an embodiment of the present application;
[0093] Figure 3 A schematic diagram of an example flow chart of a method for predicting electric vehicle power battery failure provided in an embodiment of the present application;
[0094] Figure 4 A schematic diagram of an example flow of an application of a battery failure prediction model provided in an embodiment of the present application;
[0095] Figure 5 A schematic diagram of the structure of a device for predicting power battery failure in an electric vehicle provided in an embodiment of the present application;
[0096] Figure 6 A schematic diagram of the structure of another electric vehicle power battery fault prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0097] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0098] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0099] Example 1
[0100] Please see Figure 1 , Figure 1 The present invention provides a flow chart of a method for predicting a power battery failure in an electric vehicle. The method for predicting a power battery failure in an electric vehicle includes:
[0101] S101. Collect first battery parameter sequence data of a power battery system of an electric vehicle.
[0102] S102: preprocess the first battery parameter sequence data to obtain preprocessed data.
[0103] S103: construct a training data set based on the preprocessed data.
[0104] S104. Build a Transformer model for predicting electric vehicle power battery failure and create a loss function.
[0105] In this embodiment, the Transformer model is a neural network architecture based on a self-attention mechanism, which is mainly used to process sequence data.
[0106] In this embodiment, the Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module;
[0107] The input data embedding module is used to embed the data in dimension segments, position, time and battery operation status;
[0108] The temporal channel self-attention module includes the cross-temporal self-attention stage, the cross-channel self-attention stage and the information fusion stage;
[0109] The classification head module includes a fully connected layer and a Softmax layer;
[0110] The loss function is the cross entropy loss function.
[0111] In this embodiment, the softmax layer is the most common activation function in a neural network, which can convert the output of the neural network into a probability distribution.
[0112] S105. Train the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model.
[0113] S106, obtaining second battery parameter sequence data of the electric vehicle to be predicted.
[0114] S107: Input the second battery parameter sequence data into a battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0115] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0116] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.
[0117] It can be seen that the electric vehicle power battery fault prediction method described in this embodiment can use the Transformer network architecture based on the time channel self-attention module to process data from the cross-time dimension and the cross-channel dimension at the same time (so that the cross-time self-attention module models the time dependency, and the cross-channel attention module models the dependency of different battery parameters), thereby realizing multi-dimensional data processing, which is beneficial to improving the accuracy of fault prediction.
[0118] Example 2
[0119] Please see Figure 2 , Figure 2 The present invention provides a flow chart of a method for predicting a power battery failure in an electric vehicle. The method for predicting a power battery failure in an electric vehicle includes:
[0120] S201, collecting first battery parameter sequence data of a power battery system of an electric vehicle.
[0121] In this embodiment, the method can collect battery parameter time series data recorded by the battery system during the daily operation of the target electric vehicle, including battery voltage, battery current and battery temperature time series data.
[0122] S202: Segment the first battery parameter sequence data to obtain a plurality of segment data.
[0123] S203 . Pre-smoothing and gap-filling processing are performed on each segment data based on a polynomial regression algorithm to obtain first processed segment data.
[0124] S204 , performing secondary smoothing on the first processed segment data based on an exponentially weighted moving average algorithm to obtain second processed segment data after denoising and missing value filling.
[0125] S205 , performing standardization processing on the second processing segment data to obtain preprocessed data.
[0126] In this embodiment, the method performs data preprocessing on each dimension of the collected battery parameter sequence data, and the preprocessing includes denoising, missing value filling and data standardization.
[0127] In this embodiment, denoising and missing value filling utilize a piecewise polynomial regression method, which specifically includes two steps:
[0128] In the first step, the battery parameter time series data is divided into smaller subsets or "segments", and polynomial regression is applied to each "segment" separately to complete the initial data pre-smoothing and gap filling;
[0129] In the second step, the full-length sequence data pre-smoothed in the first step is smoothed twice using exponentially weighted moving average to obtain the battery parameter time series data after denoising and missing value filling.
[0130] In this embodiment, each dimension of the battery parameter time series data after denoising and missing value filling is standardized. The data standardization formula is:
[0131]
[0132] in, It is The feature of Observed values. and They are The mean and standard deviation of each feature. After preprocessing, the mean of each dimension of data is 0 and the standard deviation is 1.
[0133] S206 , segmenting the preprocessed data using a preset sliding window to obtain a battery parameter subsequence.
[0134] In this embodiment, the method can divide the battery parameter time series data after the above preprocessing into battery parameter subsequences using a sliding window, and assign a corresponding label to each battery parameter subsequence to indicate the safety status, where the label is the safety status of the battery in each hour period from 12 to 168 (24*7) hours.
[0135] S207 , labeling each battery parameter sequence to obtain labeling data.
[0136] In this embodiment, the annotation data includes a battery parameter sequence and a battery safety status label corresponding to the battery parameter sequence.
[0137] In this embodiment, each battery parameter subsequence and the corresponding battery safety status after hours is a sample. The safety status is divided into two categories: fault and normal, and divided into training, verification and test sets according to the sample ratio for model training and evaluation.
[0138] S208. Construct a training data set, a verification data set, and a test data set based on the labeled data.
[0139] S209. Build a Transformer model for predicting electric vehicle power battery failure and create a loss function.
[0140] In this embodiment, the Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module;
[0141] The input data embedding module is used to embed the data in dimension segments, position, time and battery operation status;
[0142] The temporal channel self-attention module includes the cross-temporal self-attention stage, the cross-channel self-attention stage and the information fusion stage;
[0143] The classification head module includes a fully connected layer and a Softmax layer;
[0144] The loss function is the cross entropy loss function.
[0145] This implementation can include battery operation status encoding in the data embedding process, which helps to associate the fault mechanism with the battery performance under three different load modes: discharge, charge and rest, which is more in line with actual application scenarios. At the same time, the method can adapt to different embedding times, which is conducive to comprehensive time series data analysis. This function can achieve early anomaly detection and help understand the evolution of battery faults.
[0146] In this embodiment, the dimension segment embedding divides the points in each dimension of the battery parameter subsequence into Segmentation of , resulting in a vector of fixed length , For Dimension The medium length is No. segments; then each segment is transformed into Embedded into a length of Vector ,in, represents a learnable projection matrix.
[0147] In this embodiment, each segment is embedded by adding the dimension segment embedding, location embedding, time embedding and battery operation state embedding. Embedded into a vector, the calculation formula is as follows:
[0148]
[0149] in, Represents learnable position embeddings; represents a learnable temporal embedding, where the embedding vector is different for each hour from 2 to 168 hours; Indicates learnable battery operation state embedding, including different embedding vectors for three different states: discharging, charging, and resting. Representation Dimension The median length is Segmented data embedding.
[0150] In this embodiment, the temporal channel self-attention module consists of a cross-temporal self-attention stage, a cross-channel self-attention stage, and an information fusion stage.
[0151] In the cross-temporal self-attention stage, given an array As the input of the temporal channel self-attention module, and are the number of segments and dimensions respectively. Multi-head self-attention is applied to each dimension, and the calculation formula is as follows:
[0152]
[0153] in, Representation Dimension The vector of all time steps at , LayerNorm represents layer normalization, MLP represents a two-layer feedforward network, and MSA represents the multi-head self-attention layer in the traditional Transformer. All channel dimensions (1≤d≤D) multi-head self-attention layers share the same parameters, and Represent the outputs of MSA and MLP respectively.
[0154] The cross-channel self-attention stage and the cross-temporal self-attention stage are executed in parallel, and the calculation formula is as follows:
[0155]
[0156] in, Represents the time step For vectors of all dimensions at , all time steps (1≤i≤L) of the multi-head self-attention layers share the same parameters. and Represent the outputs of MSA and MLP respectively.
[0157] The information fusion stage adds the outputs of the cross-temporal self-attention stage and the cross-channel self-attention stage and performs information interaction through a layer of MLP. The calculation formula is as follows:
[0158]
[0159] in, is the layer normalized output, is the output of the time channel self-attention module. The neural network model for electric vehicle power battery fault prediction is composed of Time channel self-attention modules are stacked in series, The value is determined by experimental results.
[0160] In this embodiment, the classification head is composed of a fully connected layer and a Softmax layer, which is used to distinguish the battery fault category. The calculation formula is as follows:
[0161]
[0162] in, Indicates The temporal channel self-attention module outputs, and the Flatten layer converts Flattened into a one-dimensional vector, projected into a vector of the number of battery fault categories through MLP, and then passed through the Softmax layer to obtain the probability values of different battery fault categories. , the category corresponding to the maximum probability is the battery failure prediction result.
[0163] S210. Determine an objective function and an optimization method for training a Transformer model based on a loss function and an Adam optimizer.
[0164] S211. Obtain the training strategy of the Transformer model.
[0165] S212. Randomly initialize the model parameters of the Transformer model.
[0166] In this embodiment, the method selects the cross entropy loss function and the Adam optimizer to define the objective function and optimization method of the neural network model training for electric vehicle power battery fault prediction, and randomly initializes the parameters of the model.
[0167] S213. Process the Transformer model according to the training strategy and the training data set to obtain a processing result.
[0168] S214. When training the Transformer model, the gradient of the loss function for each parameter in the Transformer model is calculated based on the loss function, the back propagation algorithm, and the processing results.
[0169] In this embodiment, the method inputs the training data set into the constructed model, calculates the loss of the model on the training data set, and uses the back propagation algorithm to calculate the gradient of the loss function for each parameter in the model.
[0170] S215. Update the model parameters of the Transformer model based on the gradient, objective function and optimization method to obtain an updated target Transformer model.
[0171] S216. Adjust the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy.
[0172] As an optional implementation, the training strategy of the Transformer model is adjusted based on the test data set to obtain an adjusted training strategy, including:
[0173] Monitor the model’s loss and diagnostic accuracy on the test dataset;
[0174] The training strategy is adjusted according to the loss and the diagnostic accuracy; wherein the training strategy at least includes a model learning rate, a batch size, and a number of training iterations.
[0175] In this embodiment, the method can use the selected optimization method to update the model parameters to minimize the loss function. At the same time, the loss and diagnostic accuracy of the model on the test set are monitored, and the hyperparameters or training strategies of the model such as the learning rate, batch size, and number of training iterations are adjusted according to the performance of the test set to improve the performance and generalization ability of the model.
[0176] S217: Determine whether the performance of the target Transformer model has passed the verification based on the verification data set. If so, execute step S218; if not, end this process.
[0177] As an optional implementation, judging whether the performance of the target Transformer model passes the verification based on the verification data set includes:
[0178] Input the validation data set into the target Transformer model for prediction and obtain the prediction results;
[0179] Compare the prediction results with the battery condition labels in the validation dataset to obtain comparative results;
[0180] Calculate the evaluation index results of the target Transformer model based on the comparison results;
[0181] Determine whether the performance of the target Transformer model has passed the verification based on the evaluation index results;
[0182] If yes, the target Transformer model is determined as the battery failure prediction model;
[0183] If not, the Transformer model is processed according to the training strategy and the training data set to obtain the processing result.
[0184] In this embodiment, the method can input the validation set into the trained model, calculate the prediction results of the model through forward propagation, and compare these results with the actual labels to calculate the evaluation index of the model to verify the performance of the model. Then, the current, voltage and temperature time series data collected from the actual electric vehicle battery system in the period of 12 to 168 hours before the actual failure are input into the model loaded with pre-trained parameters, and the prediction results are obtained through forward propagation to complete the battery failure prediction.
[0185] S218. Determine the target Transformer model as a battery failure prediction model.
[0186] S219, obtaining second battery parameter sequence data of the electric vehicle to be predicted.
[0187] S220: Input the second battery parameter sequence data into a battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0188] Please see Figure 3 , Figure 3 A schematic diagram of an example flow chart of a method for predicting electric vehicle power battery failure is shown.
[0189] Please see Figure 4 , Figure 4 A schematic diagram of an application example of a battery failure prediction model is shown.
[0190] in, Figure 4 The actual application process from inputting battery parameter sequence data to obtaining battery fault prediction results is shown. The Transformer model is used, so it can be understood by referring to the principle of the Transformer model. In addition, Figure 4 The parameters in can refer to the description given in this embodiment and will not be repeated here.
[0191] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0192] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone, a tablet computer, etc., which is not limited in this embodiment.
[0193] It can be seen that the electric vehicle power battery fault prediction method described in this embodiment can use the Transformer network architecture based on the time channel self-attention module to process data from the cross-time dimension and the cross-channel dimension at the same time (so that the cross-time self-attention module models the time dependency, and the cross-channel attention module models the dependency of different battery parameters), thereby realizing multi-dimensional data processing, which is beneficial to improving the accuracy of fault prediction.
[0194] Example 3
[0195] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a device for predicting electric vehicle power battery failures provided in this embodiment. Figure 5 As shown, the electric vehicle power battery fault prediction device includes:
[0196] The acquisition unit 310 is used to acquire first battery parameter sequence data of the electric vehicle power battery system;
[0197] A preprocessing unit 320, configured to perform data preprocessing on the first battery parameter sequence data to obtain preprocessed data;
[0198] A first construction unit 330, configured to construct a training data set based on the preprocessed data;
[0199] A second construction unit 340 is used to construct a Transformer model for predicting electric vehicle power battery failure and create a loss function;
[0200] A training unit 350, used to train the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model;
[0201] An acquisition unit 360 is used to acquire second battery parameter sequence data of the electric vehicle to be predicted;
[0202] The prediction unit 370 is used to input the second battery parameter sequence data into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0203] In this embodiment, the explanation of the electric vehicle power battery fault prediction device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0204] It can be seen that the electric vehicle power battery fault prediction device described in this embodiment can use the Transformer network architecture based on the time channel self-attention module to process data from the cross-time dimension and the cross-channel dimension at the same time (so that the cross-time self-attention module models the time dependency, and the cross-channel attention module models the dependency of different battery parameters), thereby realizing multi-dimensional data processing, which is beneficial to improving the accuracy of fault prediction.
[0205] Example 4
[0206] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a device for predicting electric vehicle power battery failures provided in this embodiment. Figure 6 As shown, the electric vehicle power battery fault prediction device includes:
[0207] The acquisition unit 310 is used to acquire first battery parameter sequence data of the electric vehicle power battery system;
[0208] A preprocessing unit 320, configured to perform data preprocessing on the first battery parameter sequence data to obtain preprocessed data;
[0209] A first construction unit 330, configured to construct a training data set based on the preprocessed data;
[0210] A second construction unit 340 is used to construct a Transformer model for predicting electric vehicle power battery failure and create a loss function;
[0211] A training unit 350, used to train the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model;
[0212] An acquisition unit 360 is used to acquire second battery parameter sequence data of the electric vehicle to be predicted;
[0213] The prediction unit 370 is used to input the second battery parameter sequence data into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result.
[0214] As an optional implementation, the preprocessing unit 320 includes:
[0215] The first segmentation subunit 321 is used to segment the first battery parameter sequence data to obtain a plurality of segment data;
[0216] A gap filling subunit 322 is used to perform pre-smoothing and gap filling processing on each segment data based on a polynomial regression algorithm to obtain first processed segment data;
[0217] A denoising and filling subunit 323 is used to perform secondary smoothing on the first processing segment data based on an exponentially weighted moving average algorithm to obtain second processing segment data after denoising and missing value filling;
[0218] The standardization subunit 324 is used to perform standardization processing on the second processing segment data to obtain pre-processed data.
[0219] As an optional implementation manner, the first construction unit 330 includes:
[0220] The second segmentation subunit 331 is used to segment the pre-processed data through a preset sliding window to obtain a battery parameter subsequence;
[0221] The labeling subunit 332 is used to label each battery parameter sequence to obtain labeling data; wherein the labeling data includes the battery parameter sequence and the battery safety status label corresponding to the battery parameter sequence;
[0222] The construction subunit 333 is used to construct a training data set, a verification data set and a test data set based on the labeled data.
[0223] In this embodiment, the Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module;
[0224] The input data embedding module is used to embed the data in dimension segments, position, time and battery operation status;
[0225] The temporal channel self-attention module includes the cross-temporal self-attention stage, the cross-channel self-attention stage and the information fusion stage;
[0226] The classification head module includes a fully connected layer and a Softmax layer;
[0227] The loss function is the cross entropy loss function.
[0228] As an optional implementation, the training unit 350 includes:
[0229] A first determination subunit 351 is used to determine an objective function and an optimization method for training a Transformer model based on a loss function and an Adam optimizer;
[0230] An acquisition subunit 352 is used to acquire a training strategy of a Transformer model;
[0231] An initialization subunit 353, used to randomly initialize model parameters of the Transformer model;
[0232] A processing subunit 354 is used to process the Transformer model according to the training strategy and the training data set to obtain a processing result;
[0233] A calculation subunit 355, used to calculate the gradient of the loss function for each parameter in the Transformer model based on the loss function, the back propagation algorithm and the processing result when training the Transformer model;
[0234] An updating subunit 356 is used to update the model parameters of the Transformer model based on the gradient, the objective function and the optimization method to obtain an updated target Transformer model;
[0235] An adjustment subunit 357, used to adjust the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy;
[0236] A judging subunit 358, configured to judge whether the performance of the target Transformer model has passed the verification based on the verification data set;
[0237] The second determining subunit 359 is used to determine the target Transformer model as the battery fault prediction model when the judging subunit 358 determines that the result is yes.
[0238] As an optional implementation, the adjusting subunit 357 includes:
[0239] Monitoring module, used to monitor the model's loss and diagnostic accuracy on the test dataset;
[0240] The adjustment module is used to adjust the training strategy according to the loss and the diagnostic accuracy; wherein the training strategy at least includes the model learning rate, the batch size, and the number of training iterations.
[0241] As an optional implementation, the judging subunit 358 includes:
[0242] The prediction module is used to input the validation data set into the target Transformer model for prediction and obtain the prediction results;
[0243] A comparison module is used to compare the prediction result with the battery condition label in the verification data set to obtain a comparison result;
[0244] A calculation module is used to calculate the evaluation index results of the target Transformer model according to the comparison results;
[0245] The judgment module is used to judge whether the performance of the target Transformer model has passed the verification based on the evaluation index results; if so, trigger the second determination subunit 359 to determine the target Transformer model as a battery fault prediction model; if not, trigger the processing subunit 354 to process the Transformer model according to the training strategy and training data set to obtain the processing result.
[0246] In this embodiment, the explanation of the electric vehicle power battery fault prediction device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0247] It can be seen that the electric vehicle power battery fault prediction device described in this embodiment can use the Transformer network architecture based on the time channel self-attention module to process data from the cross-time dimension and the cross-channel dimension at the same time (so that the cross-time self-attention module models the time dependency, and the cross-channel attention module models the dependency of different battery parameters), thereby realizing multi-dimensional data processing, which is beneficial to improving the accuracy of fault prediction.
[0248] An embodiment of the present application provides an electronic device, including a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the electric vehicle power battery fault prediction method in embodiment 1 or embodiment 2 of the present application.
[0249] As an optional implementation, a Transformer-based electric vehicle power battery fault prediction device includes:
[0250] A memory for storing battery parameter time series data and a computer program recorded by the battery system;
[0251] A processor, running on the device to execute the above-mentioned Transformer-based electric vehicle power battery fault prediction method;
[0252] The display is used to display the device operation status and the above-mentioned battery failure prediction results.
[0253] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the electric vehicle power battery fault prediction method in embodiment 1 or embodiment 2 of the present application is executed.
[0254] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0255] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0256] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0257] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0258] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0259] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for predicting electric vehicle power battery failure, characterized in that: include: Collecting first battery parameter sequence data of the electric vehicle power battery system; Performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data; constructing a training data set based on the preprocessed data; Build a Transformer model for predicting electric vehicle battery failures and create a loss function; Training the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model; Acquire second battery parameter sequence data of the electric vehicle to be predicted; Inputting the second battery parameter sequence data into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result; Wherein, constructing a training data set based on the preprocessed data includes: The pre-processed data is segmented by a preset sliding window to obtain a battery parameter subsequence; Performing labeling processing on each of the battery parameter sequences to obtain labeling data; wherein the labeling data includes the battery parameter sequence and a battery safety status label corresponding to the battery parameter sequence; Constructing a training data set, a validation data set, and a test data set based on the labeled data; The step of training the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model includes: Determine an objective function and an optimization method for training the Transformer model based on the loss function and the Adam optimizer; Obtaining a training strategy for the Transformer model; Randomly initializing model parameters of the Transformer model; Processing the Transformer model according to the training strategy and the training data set to obtain a processing result; When training the Transformer model, calculating the gradient of the loss function for each parameter in the Transformer model based on the loss function, the back propagation algorithm, and the processing result; Based on the gradient, the objective function and the optimization method, the model parameters of the Transformer model are updated to obtain an updated target Transformer model; Adjusting the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy; Determining whether the performance of the target Transformer model has passed the verification based on the verification data set; If yes, the target Transformer model is determined as the battery fault prediction model.
2. The electric vehicle power battery fault prediction method according to claim 1, characterized in that: The performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data includes: Segmenting the first battery parameter sequence data to obtain a plurality of segment data; Performing pre-smoothing and gap-filling processing on each of the segment data based on a polynomial regression algorithm to obtain first processed segment data; Performing secondary smoothing on the first processed segment data based on an exponentially weighted moving average algorithm to obtain second processed segment data after denoising and missing value filling; The second processed segment data is standardized to obtain preprocessed data.
3. The electric vehicle power battery fault prediction method according to claim 1, characterized in that: The Transformer model includes an input data embedding module, a temporal channel self-attention module, and a classification head module; Wherein, the input data embedding module is used to embed the data in dimension segments, position, time and battery operation status; The temporal channel self-attention module includes a cross-temporal self-attention stage, a cross-channel self-attention stage and an information fusion stage; The classification head module includes a fully connected layer and a Softmax layer; The loss function is a cross entropy loss function.
4. The electric vehicle power battery fault prediction method according to claim 1, characterized in that: The step of adjusting the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy includes: Monitoring the model's loss and diagnostic accuracy on the test dataset; The training strategy is adjusted according to the loss and the diagnostic accuracy; wherein the training strategy includes at least a model learning rate, a batch size, and a number of training iterations.
5. The electric vehicle power battery fault prediction method according to claim 1, characterized in that: The determining, based on the verification data set, whether the performance of the target Transformer model has passed the verification includes: Inputting the verification data set into the target Transformer model for prediction to obtain a prediction result; Compare the prediction result with the battery condition label in the verification data set to obtain a comparison result; Calculate the evaluation index result of the target Transformer model according to the comparison result; Determine whether the performance of the target Transformer model has passed the verification according to the evaluation index result; If yes, executing the step of determining the target Transformer model as a battery fault prediction model; If not, execute the processing of the Transformer model according to the training strategy and the training data set to obtain a processing result.
6. A device for predicting electric vehicle power battery failure, characterized in that: The electric vehicle power battery fault prediction device comprises: A collection unit, used for collecting first battery parameter sequence data of a power battery system of an electric vehicle; A preprocessing unit, used for performing data preprocessing on the first battery parameter sequence data to obtain preprocessed data; A first construction unit, configured to construct a training data set based on the preprocessed data; The second building unit is used to build a Transformer model for predicting electric vehicle power battery failure and create a loss function; A training unit, used for training the Transformer model based on the loss function and the training data set to obtain a trained battery fault prediction model; An acquisition unit, used for acquiring second battery parameter sequence data of the electric vehicle to be predicted; A prediction unit, used for inputting the second battery parameter sequence data into the battery fault prediction model to perform battery fault prediction and obtain a battery fault prediction result; Wherein, the first building block comprises: A second segmentation subunit, used for segmenting the pre-processed data through a preset sliding window to obtain a battery parameter subsequence; A labeling subunit, configured to label each of the battery parameter sequences to obtain labeling data; wherein the labeling data includes the battery parameter sequence and a battery safety status label corresponding to the battery parameter sequence; A construction subunit, used to construct a training data set, a verification data set and a test data set based on the labeled data; Wherein, the training unit comprises: A first determination subunit, configured to determine an objective function and an optimization method for training the Transformer model based on the loss function and the Adam optimizer; An acquisition subunit is used to acquire a training strategy of the Transformer model; An initialization subunit, used to randomly initialize the model parameters of the Transformer model; A processing subunit, used to process the Transformer model according to the training strategy and the training data set to obtain a processing result; A calculation subunit, used for calculating the gradient of the loss function for each parameter in the Transformer model based on the loss function, the back propagation algorithm and the processing result when training the Transformer model; An updating subunit, used to update the model parameters of the Transformer model based on the gradient, the objective function and the optimization method to obtain an updated target Transformer model; An adjustment subunit, used to adjust the training strategy of the Transformer model based on the test data set to obtain an adjusted training strategy; A judging subunit, configured to judge whether the performance of the target Transformer model has passed the verification based on the verification data set; The second determining subunit is used to determine the target Transformer model as the battery fault prediction model when the judging subunit determines that the result is yes.
7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the electric vehicle power battery fault prediction method according to any one of claims 1 to 5.
8. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the electric vehicle power battery fault prediction method described in any one of claims 1 to 5 is executed.
