Method and device for predicting state of charge of automobile battery
By using a hybrid neural network model, including a CNN-Transformer block and a prediction head, the state of charge prediction of automobile batteries is solved, and the problem of low prediction accuracy in the prior art is achieved, and high-precision battery state of charge prediction is achieved.
Patent Information
- Application Number
- CN202510503199.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-05-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing methods of automobile battery state of charge prediction cannot accurately reflect the dynamic characteristics of the battery during actual use, resulting in low prediction accuracy and inability to meet the actual application needs.
Using a hybrid neural network model, including a feature extraction module and a prediction head, the real-time vehicle data is characterized by three stacked CNN-Transformer blocks, and the processed feature is input to the prediction head for battery state of charge prediction.
Accurate prediction of battery charge state is achieved, the performance and reliability of electric vehicles are improved, and the accuracy of prediction is significantly enhanced.
Smart Images

Figure CN120030317A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of automobile battery management, and in particular to a method and device for predicting the state of charge of an automobile battery. Background Art
[0002] With the continuous aggravation of environmental pollution and energy crisis, the development of new energy has become increasingly important. Among them, electric vehicles have become the focus of widespread attention due to their clean and efficient characteristics. However, the range anxiety and safety issues of electric vehicles have always been the key factors restricting their development. The state of charge (SOC) of the battery system is an important indicator for evaluating the remaining endurance and battery safety of electric vehicles. Its accurate prediction is crucial for the popularization and application of electric vehicles. At present, the existing SOC estimation methods are mainly based on empirical equations, mathematical models or equivalent circuits. However, the parameters of these mathematical models are usually obtained through constant current charge and discharge characteristics. This steady-state model cannot fully and accurately reflect the dynamic characteristics of the battery during actual use. Therefore, in the actual operation of electric vehicles, the prediction accuracy of these methods is often greatly limited and cannot meet the needs of practical applications. Summary of the invention
[0003] The purpose of this application is to provide a method and device for predicting the state of charge of a vehicle battery, which can accurately predict the battery state of charge of the vehicle with high accuracy, and help to further improve the performance and reliability of electric vehicles.
[0004] The first aspect of the present application provides a method for predicting the state of charge of a vehicle battery, comprising: Get sample datasets and pre-built hybrid neural network models; The hybrid neural network model is trained by the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block, and a third CNN-Transformer block; Obtain real-time vehicle data of the vehicle to be predicted; Performing feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features; Performing feature processing on the first layer of normalized features through the second CNN-Transformer block to obtain a second layer of normalized features; Performing feature processing on the second layer normalized features through the third CNN-Transformer block to obtain a third layer normalized features; Performing feature splicing processing on the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features; The target feature is input into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
[0005] In the above implementation process, the method can accurately predict the battery state of charge of the vehicle with high accuracy, which helps to further improve the performance and reliability of electric vehicles.
[0006] Furthermore, the obtaining of the sample data set and the pre-built hybrid neural network model includes: Collecting vehicle operation data of the electric vehicle; wherein the vehicle operation data at least includes battery voltage, battery current, battery state of charge, brake pedal depth and ambient temperature; Performing data preprocessing on the vehicle operation data to obtain preprocessed data; Constructing a sample data set according to the preprocessed data; wherein the sample data set includes a training set and a test set; Get pre-built hybrid neural network models. Furthermore, the preprocessing of the vehicle operation data to obtain preprocessed data includes: Acquiring battery parameter sequence data according to the vehicle operation data; Performing data synchronization processing on the battery parameter sequence data using a Lagrange interpolation method to obtain first processed data; Using an outlier box plot method to remove outliers from the first processed data to obtain second processed data; Performing missing value deletion processing on the second processed data to obtain third processed data; The third processed data is subjected to data standardization processing to obtain preprocessed data.
[0007] Furthermore, constructing a sample data set according to the preprocessed data includes: Calculating the correlation between the vehicle operation data and the battery state of charge according to the preprocessed data; Selecting characteristic parameters according to the correlation between the vehicle operation data and the battery state of charge; wherein the characteristic parameters include vehicle speed, motor speed and brake pedal depth; Performing non-overlapping segmentation on the feature parameters through a preset sliding window and a preset calculation window to obtain a segmented data set; Determine the segmented data set as a sample data set; The sample data set is divided according to a preset division ratio to obtain a training set and a test set.
[0008] Furthermore, the first CNN-Transformer block includes a first convolutional layer, a second convolutional layer, a multi-head self-attention module and a third convolutional layer; the first convolutional layer is connected to the second convolutional layer; The step of performing feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features includes: Performing convolution processing on the real-time vehicle data through the first convolution layer and the second convolution layer to obtain convolution data; Down-sampling the convolution data through the multi-head self-attention module to obtain sampled data; Perform matrix calculation according to the multi-head self-attention module and the sampled data to obtain a query matrix, a value matrix and a key matrix; Calculating a multi-head self-attention result according to the multi-head self-attention module, the query matrix, the value matrix and the key matrix; Performing convolution projection on the multi-head self-attention result through the third convolution layer to obtain output features; Perform layer normalization processing on the output features to obtain first layer normalized features.
[0009] Furthermore, the step of performing feature concatenation processing on the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features includes: Performing adaptive pooling processing on the first layer normalized features to obtain first feature data; Performing dimension splicing processing on the second layer normalized features and the first feature data to obtain a first spliced feature; Performing adaptive pooling processing on the first splicing features to obtain second feature data; Dimensionally concatenating the second feature data with the third-layer normalized features to obtain a second concatenated feature; The second splicing feature is determined as the target feature output by the feature extraction module.
[0010] Further, the prediction head includes a prediction head convolution layer and a fully connected layer; The step of inputting the target feature into the prediction head for battery state of charge prediction processing to obtain a prediction result includes: Adjusting the feature dimension of the target feature through the prediction head convolution layer to obtain the feature to be predicted; A multi-step prediction of the battery state of charge is performed according to the fully connected layer and the features to be predicted to obtain a prediction result.
[0011] A second aspect of the present application provides a vehicle battery state of charge prediction device, the vehicle battery state of charge prediction device comprising: A first acquisition unit, used to acquire a sample data set and a pre-built hybrid neural network model; A model training unit, used for training the hybrid neural network model through the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block and a third CNN-Transformer block; A second acquisition unit, used to acquire real-time vehicle data of a vehicle to be predicted; a first processing unit, configured to perform feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features; a second processing unit, configured to perform feature processing on the first layer normalized features through the second CNN-Transformer block to obtain a second layer normalized features; a third processing unit, configured to perform feature processing on the second layer normalized features through the third CNN-Transformer block to obtain a third layer normalized features; A splicing unit, used for performing feature splicing processing on the first layer normalized features, the second layer normalized features and the third layer normalized features to obtain target features; The prediction unit is used to input the target feature into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
[0012] Furthermore, the first acquiring unit includes: The acquisition subunit is used to collect vehicle operation data of the electric vehicle; wherein the vehicle operation data at least includes battery voltage, battery current, battery state of charge, brake pedal depth and ambient temperature; A preprocessing subunit, used for performing data preprocessing on the vehicle operation data to obtain preprocessed data; A construction subunit, used to construct a sample data set according to the preprocessed data; wherein the sample data set includes a training set and a test set; Get subunit for getting pre-built hybrid neural network models. Furthermore, the preprocessing subunit includes: An acquisition module, used for acquiring battery parameter sequence data according to the vehicle operation data; A synchronization module, used for performing data synchronization processing on the battery parameter sequence data by using a Lagrange interpolation method to obtain first processed data; a removal module, configured to perform outlier removal processing on the first processed data using an outlier box plot method to obtain second processed data; a deletion module, configured to perform missing value deletion processing on the second processed data to obtain third processed data; The standardization module is used to perform data standardization processing on the third processed data to obtain pre-processed data.
[0013] Furthermore, the construction subunit includes: A first calculation module, configured to calculate the correlation between the vehicle operation data and the battery state of charge according to the preprocessed data; A selection module, used to select characteristic parameters according to the correlation between the vehicle operation data and the battery state of charge; wherein the characteristic parameters include vehicle speed, motor speed and brake pedal depth; A segmentation module, used for performing non-overlapping segmentation on the feature parameters through a preset sliding window and a preset calculation window to obtain a segmented data set; A determination module, used to determine the segmented data set as a sample data set; The partitioning module is used to partition the sample data set according to a preset partitioning ratio to obtain a training set and a test set.
[0014] Furthermore, the first CNN-Transformer block includes a first convolutional layer, a second convolutional layer, a multi-head self-attention module and a third convolutional layer; the first convolutional layer is connected to the second convolutional layer; Wherein, the first processing unit includes: A convolution subunit, configured to perform convolution processing on the real-time vehicle data through the first convolution layer and the second convolution layer to obtain convolution data; A downsampling subunit, used to downsample the convolution data through the multi-head self-attention module to obtain sampled data; A computing subunit, configured to perform matrix calculations according to the multi-head self-attention module and the sampled data to obtain a query matrix, a value matrix, and a key matrix; The computing subunit is further configured to calculate a multi-head self-attention result according to the multi-head self-attention module, the query matrix, the value matrix and the key matrix; A projection subunit, configured to perform convolution projection on the multi-head self-attention result through the third convolution layer to obtain output features; The normalization subunit is used to perform layer normalization processing on the output features to obtain first layer normalized features.
[0015] Furthermore, the splicing unit comprises: A pooling subunit, configured to perform adaptive pooling processing on the first layer normalized features to obtain first feature data; A splicing subunit, configured to perform dimension splicing processing on the second layer normalized features and the first feature data to obtain a first splicing feature; The pooling subunit is further used to perform adaptive pooling processing on the first splicing feature to obtain second feature data; The splicing subunit is further used to perform dimension splicing on the second feature data and the third layer normalized feature to obtain a second splicing feature; A determination subunit is used to determine the second splicing feature as the target feature output by the feature extraction module.
[0016] Further, the prediction head includes a prediction head convolution layer and a fully connected layer; Wherein, the prediction unit comprises: An adjustment subunit, used for adjusting the feature dimension of the target feature through the prediction head convolution layer to obtain a feature to be predicted; The prediction subunit is used to perform multi-step prediction of the battery state of charge according to the fully connected layer and the features to be predicted to obtain a prediction result.
[0017] A 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 method for predicting the state of charge of a vehicle battery as described in any one of the first aspect of the present application.
[0018] 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 method for predicting the state of charge of a vehicle battery described in any one of the first aspect of the present application is executed.
[0019] The beneficial effects of the present application are as follows: the method and device can use real vehicle data and screen out key parameters that are crucial to the state of charge prediction through a data similarity measurement method, thereby improving the prediction efficiency of the model through data dimensionality reduction and significantly enhancing the accuracy of the prediction; At the same time, the hybrid neural network model can successfully capture the rich representative information in the data by constructing and integrating feature maps of different scales and the long-term dependencies between them, which can significantly improve the multi-step prediction accuracy of the battery state of charge and provide a more accurate prediction result for the battery management system. In addition, the hybrid neural network model can also realize multi-step prediction of the state of charge of the electric vehicle power battery system, thereby effectively solving the limitation that the state of charge prediction can only be single-step prediction, and then provide strong technical support for the long-term prediction of battery status, which will help to further improve the performance and reliability of electric vehicles. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] 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.
[0021] Figure 1 A schematic diagram of a flow chart of a method for predicting the state of charge of a vehicle battery provided in an embodiment of the present application; Figure 2 A partial flow chart of another method for predicting the state of charge of a vehicle battery provided in an embodiment of the present application; Figure 3 A schematic diagram of another part of the flow chart of another method for predicting the state of charge of a vehicle battery provided in an embodiment of the present application; Figure 4 A schematic diagram of an example flow chart of a method for predicting the state of charge of a vehicle battery provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of a vehicle battery state of charge prediction device provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of another vehicle battery state of charge prediction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] 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.
[0023] 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.
[0024] Example 1 Please see Figure 1 , Figure 1 The following is a flow chart of a method for predicting the state of charge of a vehicle battery provided in this embodiment. The method for predicting the state of charge of a vehicle battery includes: S101, obtaining a sample data set and a pre-built hybrid neural network model.
[0025] S102: training the hybrid neural network model using a sample data set to obtain a trained state of charge prediction model.
[0026] In this embodiment, the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block, and a third CNN-Transformer block.
[0027] S103: Acquire real-time vehicle data of the vehicle to be predicted.
[0028] S104, performing feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features.
[0029] S105. Perform feature processing on the first layer normalized features through the second CNN-Transformer block to obtain the second layer normalized features.
[0030] S106. Perform feature processing on the second layer normalized features through the third CNN-Transformer block to obtain the third layer normalized features.
[0031] S107, performing feature concatenation processing on the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features.
[0032] S108: Input the target features into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
[0033] 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.
[0034] 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.
[0035] It can be seen that the implementation of the vehicle battery state of charge prediction method described in this embodiment can accurately predict the vehicle battery state of charge with high accuracy, which helps to further improve the performance and reliability of electric vehicles.
[0036] Example 2 Please see Figure 2 and Figure 3 , Figure 2 and Figure 3The following is a flow chart of a method for predicting the state of charge of a vehicle battery provided in this embodiment. The method for predicting the state of charge of a vehicle battery includes: S201. Collect vehicle operation data of the electric vehicle.
[0037] In this embodiment, the vehicle operation data includes at least battery voltage, battery current, battery state of charge, brake pedal depth, ambient temperature and other data related to the battery system, driving behavior and environment.
[0038] In this embodiment, the method can collect vehicle operation data of the electric vehicle, and the vehicle operation data is key parameter data of the vehicle operation.
[0039] S202. Obtain battery parameter sequence data according to vehicle operation data.
[0040] S203 , performing data synchronization processing on the battery parameter sequence data using a Lagrange interpolation method to obtain first processed data.
[0041] In this embodiment, the method may use Lagrange interpolation to interpolate the environmental data to match the acquisition frequency of the vehicle data.
[0042] S204, using an outlier box plot method to remove outliers from the first processed data to obtain second processed data.
[0043] In this embodiment, the method can use the outlier box plot method to remove outliers.
[0044] S205. Perform missing value deletion processing on the second processed data to obtain third processed data.
[0045] S206: Perform data standardization processing on the third processed data to obtain preprocessed data.
[0046] In this embodiment, the method can perform standardization processing on each dimension of the vehicle key operating parameter time series data after the above processing. The data standardization processing formula is:
[0047] Among them, is the tth observation of the dth feature. and are the mean and standard deviation of the dth feature respectively. After preprocessing, the mean value of each dimension of data is 0 and the standard deviation is 1.
[0048] In this embodiment, the method can perform data preprocessing on each dimension parameter in the collected battery parameter sequence data, specifically including data synchronization, outlier removal, missing value deletion and data standardization, so as to obtain preprocessed data.
[0049] S207 . Calculate the correlation between the vehicle operation data and the battery state of charge according to the preprocessed data.
[0050] In this embodiment, the method may use JS discrete calculation to calculate the correlation between the preprocessed key vehicle operation parameters and the battery state of charge.
[0051] S208. Select characteristic parameters according to the correlation between the vehicle operation data and the battery state of charge.
[0052] In this embodiment, the method can select key parameters related to the change of the battery state of charge for use as characteristic parameters for battery state of charge prediction, including vehicle speed, motor speed, and brake pedal depth.
[0053] S209 , performing non-overlapping segmentation on the feature parameters through a preset sliding window and a preset calculation window to obtain a segmented data set.
[0054] In this embodiment, the method may use a preset sliding window and a calculation window to perform non-overlapping segmentation on the above-selected key parameters to obtain a segmented data set.
[0055] In this embodiment, the sliding window size is the calculation data scale for the model input, which slides on all parameters. The calculation window size is the prediction time scale for the model input, which slides only on the battery state of charge parameter.
[0056] S210: Determine the segmented data set as a sample data set.
[0057] In this embodiment, the method can form a sample by combining the data in each adjacent sliding window and the calculation window to obtain a sample data set.
[0058] S211. Divide the sample data set according to a preset division ratio to obtain a training set and a test set.
[0059] In this embodiment, the method can divide the samples into a training set, a validation set, and a test set according to the proportion to perform model training and evaluation.
[0060] It can be seen that this method can use the data similarity measurement method to extract the key parameters of state of charge prediction and construct a training data set.
[0061] S212. Obtain a pre-built hybrid neural network model.
[0062] In this embodiment, the method can pre-build a hybrid neural network model for predicting the state of charge of the electric vehicle power battery system, so that a loss function can be created in the subsequent steps to train the model using the training set.
[0063] In this embodiment, commonly used loss functions include mean square error, root mean square error, etc. The model training process uses a gradient descent algorithm to optimize the model parameters. At the same time, a cross-validation mechanism is introduced in the training process to prevent the model from overfitting.
[0064] In this embodiment, the method uses an independent test set to verify the performance of the trained model after model training is completed, thereby evaluating the prediction accuracy and generalization ability of the model. Then, during the operation of the electric vehicle, the trained model is used to perform real-time multi-step forward prediction of the battery state of charge of the battery system, thereby providing an accurate battery state of charge estimate.
[0065] S213, training the hybrid neural network model using the sample data set to obtain a trained state of charge prediction model.
[0066] In this embodiment, the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block, and a third CNN-Transformer block.
[0067] In this embodiment, the prediction head includes a prediction head convolution layer and a fully connected layer.
[0068] In this embodiment, the first CNN-Transformer block includes a first convolutional layer, a second convolutional layer, a multi-head self-attention module and a third convolutional layer; the first convolutional layer is connected to the second convolutional layer.
[0069] In this embodiment, the first CNN-Transformer block, the second CNN-Transformer block, and the third CNN-Transformer block are all composed of a convolution module and an improved multi-head self-attention module. Among them, the convolution module uses two consecutive convolution layers with the same convolution kernel size and ReLU activation function to process the input data. This design can gradually reduce the size of the input while increasing the dimension of the feature, thereby enhancing the nonlinear representation; the multi-head self-attention module adopts an improved self-attention mechanism to reduce redundant information and better focus on adjacent points.
[0070] S214: Acquire real-time vehicle data of the vehicle to be predicted.
[0071] S215. Perform convolution processing on the real-time vehicle data through the first convolution layer and the second convolution layer to obtain convolution data.
[0072] S216. Downsample the convolution data through a multi-head self-attention module to obtain sampled data.
[0073] In this embodiment, the multi-head self-attention module uses a one-dimensional CNN to Downsampling is performed, where N represents the number of input tokens and dm represents the dimension of the input token.
[0074] S217. Perform matrix calculation based on the multi-head self-attention module and the sampled data to obtain a query matrix, a value matrix, and a key matrix.
[0075] In this embodiment, the method calculates the Q, K and V matrices using the following formulas:
[0076] Among them, Qj, Vj and Kj are the query, value and key matrices of the jth head respectively, and their corresponding linear mapping matrices are , and , Represents a one-dimensional convolution operation with a kernel size of 2 and a stride of 2.
[0077] S218. Calculate the multi-head self-attention result according to the multi-head self-attention module, query matrix, value matrix and key matrix.
[0078] In this embodiment, the calculation formula for calculating the multi-head self-attention result of this method is as follows:
[0079]
[0080]
[0081] Among them, Zj represents the self-attention value of the jth head, is the linear projection matrix of multiple heads, Concat represents feature concatenation, LayerNorm represents layer normalization, and h represents the number of self-attention heads.
[0082] S219. Perform convolution projection on the multi-head self-attention results through the third convolution layer to obtain output features.
[0083] In this embodiment, the method can use convolution projection instead of linear projection to further extract features from the above multi-head self-attention results to obtain the output of the multi-head self-attention module. The calculation formula is as follows:
[0084] in, Represents a one-dimensional convolution projection with a convolution kernel size of 1.
[0085] S220, performing layer normalization processing on the output features to obtain first layer normalized features.
[0086] S221. Perform feature processing on the first layer normalized features through the second CNN-Transformer block to obtain the second layer normalized features.
[0087] S222. Perform feature processing on the second layer normalized features through the third CNN-Transformer block to obtain the third layer normalized features.
[0088] S223. Perform adaptive pooling processing on the normalized features of the first layer to obtain first feature data.
[0089] S224. Perform dimension concatenation processing on the second-layer normalized features and the first feature data to obtain first concatenated features.
[0090] S225. Perform adaptive pooling processing on the first splicing feature to obtain second feature data.
[0091] S226. Dimensionally concatenate the second feature data and the third-layer normalized feature to obtain a second concatenated feature.
[0092] S227: Determine the second splicing feature as the target feature output by the feature extraction module.
[0093] In this embodiment, among the three stacked CNN-Transformer blocks, the outputs of the first two CNN-Transformer blocks are adaptively pooled to obtain features of the same size as the last CNN-Transformer block, and are concatenated and input into the prediction head.
[0094] S228. Adjust the feature dimension of the target feature through the prediction head convolution layer to obtain the feature to be predicted.
[0095] S229: Perform multi-step prediction of the battery state of charge according to the fully connected layer and the features to be predicted to obtain a prediction result.
[0096] In this embodiment, the prediction head consists of a convolutional layer and a fully connected layer. The convolutional layer is used to adjust the feature dimension of the feature extraction module output, and the fully connected layer is used to perform multi-step prediction of the battery state of charge. The calculation formula is as follows:
[0097] in, represents the output of the feature extraction module, Represents a one-dimensional convolution operation with a kernel size of 1. Flatten flattens the input into a one-dimensional vector and projects it into a multi-step prediction result of the battery state of charge through MLP, where MLP is a linear projection layer.
[0098] Please see Figure 4 , Figure 4 An example flow chart of a method for predicting the state of charge of a vehicle battery is shown.
[0099] 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.
[0100] 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.
[0101] It can be seen that the implementation of the vehicle battery state of charge prediction method described in this embodiment can accurately predict the vehicle battery state of charge with high accuracy, which helps to further improve the performance and reliability of electric vehicles.
[0102] Example 3 Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a vehicle battery charge state prediction device provided in this embodiment. Figure 5 As shown, the vehicle battery charge state prediction device includes: A first acquisition unit 310 is used to acquire a sample data set and a pre-built hybrid neural network model; The model training unit 320 is used to train the hybrid neural network model through the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block and a third CNN-Transformer block; The second acquisition unit 330 is used to acquire real-time vehicle data of the vehicle to be predicted; A first processing unit 340, configured to perform feature processing on the real-time vehicle data through a first CNN-Transformer block to obtain a first layer of normalized features; A second processing unit 350 is used to perform feature processing on the first layer normalized features through a second CNN-Transformer block to obtain a second layer normalized features; a third processing unit 360, configured to perform feature processing on the second layer normalized features through a third CNN-Transformer block to obtain a third layer normalized features; A concatenation unit 370 is used to concatenate the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features; The prediction unit 380 is used to input the target feature into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
[0103] In this embodiment, the explanation of the vehicle battery state of charge prediction device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0104] It can be seen that the vehicle battery state of charge prediction device described in this embodiment can accurately predict the vehicle battery state of charge with high accuracy, which helps to further improve the performance and reliability of electric vehicles.
[0105] Example 4 Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a vehicle battery charge state prediction device provided in this embodiment. Figure 6 As shown, the vehicle battery charge state prediction device includes: A first acquisition unit 310 is used to acquire a sample data set and a pre-built hybrid neural network model; The model training unit 320 is used to train the hybrid neural network model through the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block and a third CNN-Transformer block; The second acquisition unit 330 is used to acquire real-time vehicle data of the vehicle to be predicted; A first processing unit 340, configured to perform feature processing on the real-time vehicle data through a first CNN-Transformer block to obtain a first layer of normalized features; A second processing unit 350 is used to perform feature processing on the first layer normalized features through a second CNN-Transformer block to obtain a second layer normalized features; a third processing unit 360, configured to perform feature processing on the second layer normalized features through a third CNN-Transformer block to obtain a third layer normalized features; A concatenation unit 370 is used to concatenate the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features; The prediction unit 380 is used to input the target feature into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
[0106] As an optional implementation manner, the first acquiring unit 310 includes: The acquisition subunit 311 is used to collect vehicle operation data of the electric vehicle; wherein the vehicle operation data at least includes battery voltage, battery current, battery state of charge, brake pedal depth and ambient temperature; The preprocessing subunit 312 is used to perform data preprocessing on the vehicle operation data to obtain preprocessed data; A construction subunit 313 is used to construct a sample data set according to the preprocessed data; wherein the sample data set includes a training set and a test set; The acquisition subunit 314 is used to acquire a pre-built hybrid neural network model. As an optional implementation, the preprocessing subunit 312 includes: An acquisition module, used for acquiring battery parameter sequence data according to vehicle operation data; A synchronization module, used for performing data synchronization processing on the battery parameter sequence data by using a Lagrange interpolation method to obtain first processed data; A removal module, used for performing outlier removal processing on the first processed data by using an outlier box plot method to obtain second processed data; A deletion module, used for performing missing value deletion processing on the second processed data to obtain third processed data; The standardization module is used to perform data standardization processing on the third processed data to obtain pre-processed data.
[0107] As an optional implementation, the construction subunit 313 includes: A first calculation module, used for calculating the correlation between the vehicle operation data and the battery state of charge according to the preprocessed data; A selection module, used to select characteristic parameters according to the correlation between the vehicle operation data and the battery state of charge; wherein the characteristic parameters include vehicle speed, motor speed and brake pedal depth; A segmentation module, used for performing non-overlap segmentation on feature parameters through a preset sliding window and a preset calculation window to obtain a segmented data set; A determination module, used for determining the segmented data set as a sample data set; The partitioning module is used to partition the sample data set according to a preset partitioning ratio to obtain a training set and a test set.
[0108] As an optional implementation, the first CNN-Transformer block includes a first convolutional layer, a second convolutional layer, a multi-head self-attention module, and a third convolutional layer; the first convolutional layer is connected to the second convolutional layer; The first processing unit 340 includes: The convolution subunit 341 is used to perform convolution processing on the real-time vehicle data through the first convolution layer and the second convolution layer to obtain convolution data; A downsampling subunit 342, used to downsample the convolution data through a multi-head self-attention module to obtain sampled data; A calculation subunit 343 is used to perform matrix calculation according to the multi-head self-attention module and the sampled data to obtain a query matrix, a value matrix and a key matrix; The calculation subunit 343 is further used to calculate the multi-head self-attention result according to the multi-head self-attention module, the query matrix, the value matrix and the key matrix; A projection subunit 344 is used to perform convolution projection on the multi-head self-attention result through the third convolution layer to obtain output features; The normalization subunit 345 is used to perform layer normalization processing on the output features to obtain first-layer normalized features.
[0109] As an optional implementation, the splicing unit 370 includes: A pooling subunit 371, configured to perform adaptive pooling processing on the first layer normalized features to obtain first feature data; The splicing subunit 372 is used to perform dimension splicing processing on the second layer normalized features and the first feature data to obtain a first splicing feature; The pooling subunit 371 is further used to perform adaptive pooling processing on the first splicing feature to obtain second feature data; The concatenation subunit 372 is further used to concatenate the second feature data with the third layer normalized feature to obtain a second concatenated feature; The determination subunit 373 is used to determine the second splicing feature as the target feature output by the feature extraction module.
[0110] As an optional implementation, the prediction head includes a prediction head convolution layer and a fully connected layer; The prediction unit 380 includes: An adjustment subunit 381 is used to adjust the feature dimension of the target feature through the prediction head convolution layer to obtain the feature to be predicted; The prediction subunit 382 is used to perform multi-step prediction of the battery state of charge according to the fully connected layer and the features to be predicted to obtain a prediction result.
[0111] In this embodiment, the explanation of the vehicle battery state of charge prediction device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0112] It can be seen that the vehicle battery state of charge prediction device described in this embodiment can accurately predict the vehicle battery state of charge with high accuracy, which helps to further improve the performance and reliability of electric vehicles.
[0113] An embodiment 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 method for predicting the state of charge of a vehicle battery in Embodiment 1 or Embodiment 2 of the present application.
[0114] 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 method for predicting the state of charge of a vehicle battery in Embodiment 1 or Embodiment 2 of the present application is executed.
[0115] 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.
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] 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 the state of charge of a vehicle battery, characterized in that: include: Get sample datasets and pre-built hybrid neural network models; The hybrid neural network model is trained by the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block, and a third CNN-Transformer block; Obtain real-time vehicle data of the vehicle to be predicted; Performing feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features; Performing feature processing on the first layer of normalized features through the second CNN-Transformer block to obtain a second layer of normalized features; Performing feature processing on the second layer normalized features through the third CNN-Transformer block to obtain a third layer normalized features; Performing feature splicing processing on the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features; The target feature is input into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
2. The method for predicting the state of charge of a vehicle battery according to claim 1, characterized in that: The obtaining of the sample data set and the pre-built hybrid neural network model comprises: Collecting vehicle operation data of the electric vehicle; wherein the vehicle operation data at least includes battery voltage, battery current, battery state of charge, brake pedal depth and ambient temperature; Performing data preprocessing on the vehicle operation data to obtain preprocessed data; Constructing a sample data set according to the preprocessed data; wherein the sample data set includes a training set and a test set; Get pre-built hybrid neural network models.
3. The method for predicting the state of charge of a vehicle battery according to claim 2, characterized in that: The preprocessing of the vehicle operation data to obtain preprocessed data includes: Acquiring battery parameter sequence data according to the vehicle operation data; Performing data synchronization processing on the battery parameter sequence data using a Lagrange interpolation method to obtain first processed data; Using an outlier box plot method to remove outliers from the first processed data to obtain second processed data; Performing missing value deletion processing on the second processed data to obtain third processed data; The third processed data is subjected to data standardization processing to obtain preprocessed data.
4. The method for predicting the state of charge of a vehicle battery according to claim 2, characterized in that: The step of constructing a sample data set according to the preprocessed data includes: Calculating the correlation between the vehicle operation data and the battery state of charge according to the preprocessed data; Selecting characteristic parameters according to the correlation between the vehicle operation data and the battery state of charge; wherein the characteristic parameters include vehicle speed, motor speed and brake pedal depth; Performing non-overlapping segmentation on the feature parameters through a preset sliding window and a preset calculation window to obtain a segmented data set; Determine the segmented data set as a sample data set; The sample data set is divided according to a preset division ratio to obtain a training set and a test set.
5. The method for predicting the state of charge of a vehicle battery according to claim 1, characterized in that: The first CNN-Transformer block includes a first convolutional layer, a second convolutional layer, a multi-head self-attention module and a third convolutional layer; the first convolutional layer is connected to the second convolutional layer; The step of performing feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features includes: Performing convolution processing on the real-time vehicle data through the first convolution layer and the second convolution layer to obtain convolution data; Down-sampling the convolution data through the multi-head self-attention module to obtain sampled data; Perform matrix calculation according to the multi-head self-attention module and the sampled data to obtain a query matrix, a value matrix and a key matrix; Calculating a multi-head self-attention result according to the multi-head self-attention module, the query matrix, the value matrix and the key matrix; Performing convolution projection on the multi-head self-attention result through the third convolution layer to obtain output features; Perform layer normalization processing on the output features to obtain first layer normalized features.
6. The method for predicting the state of charge of a vehicle battery according to claim 1, characterized in that: The step of performing feature splicing processing on the first layer normalized features, the second layer normalized features, and the third layer normalized features to obtain target features includes: Performing adaptive pooling processing on the first layer normalized features to obtain first feature data; Performing dimension splicing processing on the second layer normalized features and the first feature data to obtain a first spliced feature; Performing adaptive pooling processing on the first splicing features to obtain second feature data; Dimensionally concatenating the second feature data with the third-layer normalized feature to obtain a second concatenated feature; The second splicing feature is determined as the target feature output by the feature extraction module.
7. The method for predicting the state of charge of a vehicle battery according to claim 1, characterized in that: The prediction head includes a prediction head convolution layer and a fully connected layer; The step of inputting the target feature into the prediction head for battery state of charge prediction processing to obtain a prediction result includes: Adjusting the feature dimension of the target feature through the prediction head convolution layer to obtain the feature to be predicted; A multi-step prediction of the battery state of charge is performed according to the fully connected layer and the features to be predicted to obtain a prediction result.
8. A device for predicting the state of charge of a vehicle battery, characterized in that: The vehicle battery charge state prediction device comprises: A first acquisition unit, used to acquire a sample data set and a pre-built hybrid neural network model; A model training unit, used for training the hybrid neural network model through the sample data set to obtain a trained state of charge prediction model; wherein the state of charge prediction model includes a feature extraction module and a prediction head; the feature extraction module includes three stacked first CNN-Transformer blocks, a second CNN-Transformer block and a third CNN-Transformer block; A second acquisition unit, used to acquire real-time vehicle data of a vehicle to be predicted; a first processing unit, configured to perform feature processing on the real-time vehicle data through the first CNN-Transformer block to obtain a first layer of normalized features; a second processing unit, configured to perform feature processing on the first layer normalized features through the second CNN-Transformer block to obtain a second layer normalized features; a third processing unit, configured to perform feature processing on the second layer normalized features through the third CNN-Transformer block to obtain a third layer normalized features; A splicing unit, used for performing feature splicing processing on the first layer normalized features, the second layer normalized features and the third layer normalized features to obtain target features; The prediction unit is used to input the target feature into the prediction head to perform battery state of charge prediction processing to obtain a prediction result.
9. 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 method for predicting the state of charge of a vehicle battery according to any one of claims 1 to 7.
10. 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 method for predicting the state of charge of a vehicle battery according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Bearing metal temperature prediction method based on CNN-GRU algorithm
CN115358137A
Battery charge state prediction method and device, electronic equipment and readable storage medium
CN119247170A
Unmanned aerial vehicle power transmission line target detection method, computer device, medium and product
CN119360005A
Remote sensing image water body extraction method based on multi-scale feature fusion of compressed pyramid gating unit
CN119495004A
Method for event-based failure prediction and remaining useful life estimation
EP4012525A1
Cited By
Battery charge state prediction method, system and device and storage medium
CN121027865A