Battery SOC and RUL prediction method based on HS-MoE model
Through the battery SOC and RUL prediction method based on the HS-MoE model, the problem of time-consuming and labor-consuming training of battery SOC and RUL prediction in the prior art is solved, and temporary substitution and data correction are achieved in the case of BMS failure or error, reducing the need for reduced The model training time and cost are
Patent Information
- Application Number
- CN202411404706.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-10
Smart Images

Figure CN118914864B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a battery SOC and RUL prediction method, in particular to a battery SOC and RUL prediction method based on a HS-MoE model, and belongs to the technical field of battery detection. Background Art
[0002] The battery SOC (State of Charge) indicator quantifies the ratio of the current remaining battery power to the fully charged capacity, revealing the current battery power status. SOC is extremely critical for the battery management system (BMS), and it is the core parameter for monitoring and regulating the battery charging and discharging behavior. On the other hand, the remaining useful life (RUL) of the battery is one of the core indicators for evaluating its health status, usually measured by the remaining number of charge and discharge cycles. The importance of battery RUL is reflected in many aspects: it helps evaluate the health status of the battery, guides the correct use and maintenance of the battery, provides early warning of potential failures, monitors the attenuation of battery capacity, optimizes battery management strategies, and evaluates the possibility of battery reuse. Predicting battery SOC and RUL is of great importance in practical applications.
[0003] In the prior art, the SOC and RUL of the battery can usually be obtained through the battery management system BMS. However, during the operation of the BMS, failures or errors may occur due to various reasons, causing the BMS to stop running or generate obviously erroneous battery SOC and RUL data. Therefore, it is necessary to predict the battery SOC and RUL through a model algorithm as a temporary supplement after a BMS failure or as a reference for correcting BMS erroneous data. Generally speaking, the battery SOC and RUL need to be trained separately for prediction models, which is time-consuming, labor-intensive, and costly. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a battery SOC and RUL prediction method based on the HS-MoE model, realize the model prediction of battery SOC and RUL, realize the replacement under BMS failure and data correction when an error occurs, and one model predicts two goals of SOC and RUL.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] A battery SOC and RUL prediction method based on the HS-MoE model includes the following steps:
[0007] S1. Test and collect battery operation data as well as SOC and RUL. Battery operation data includes expansion stress, current, voltage and temperature.
[0008] S2. Construct the HS-MoE model. The HS-MoE model consists of two levels, each of which contains a multi-expert model and a gating network model;
[0009] S3, training and verifying the HS-MoE model;
[0010] S4. Predict the battery SOC and RUL. After the HS-MoE model is trained, if the model effect is good, deploy the HS-MoE model and use the HS-MoE model to predict the battery SOC and RUL.
[0011] Furthermore, the collection of battery operation data in step S1 is specifically as follows:
[0012] Expansion stress collection: Install a micro pressure sensor inside or outside the battery to collect expansion stress, and connect the signal of the micro pressure sensor to a data logger to record real-time data of expansion stress;
[0013] Current acquisition, measuring the current flowing through the battery through a current sensor, which uses a Hall effect sensor or a shunt resistor, connecting the current sensor to a data acquisition system and recording the current data;
[0014] Voltage acquisition: a high-precision voltmeter or a voltage measurement circuit built into the battery management system is used to collect the terminal voltage of the battery. The voltage data is recorded by the data acquisition system.
[0015] Temperature collection: A temperature sensor is used to collect the temperature of the battery. The temperature sensor uses a thermocouple, thermistor or infrared sensor. The temperature sensor is connected to the data acquisition system and records the temperature data.
[0016] Furthermore, the SOC and RUL data collection in step S1 is specifically as follows: SOC and RUL are calculated by a battery management system.
[0017] Furthermore, the multi-expert model in step S2 includes three expert sub-models, each of which is a multi-layer perceptron model, and each of which includes an expert sub-model input layer, an expert sub-model first intermediate layer, an expert sub-model second intermediate layer, and an expert sub-model output layer. The expert sub-model input layer receives input battery operation data, the dimension of the expert sub-model first intermediate layer is 64, the dimension of the expert sub-model second intermediate layer is 32, and the expert sub-model output layer outputs a 16-dimensional vector.
[0018] Furthermore, in step S2, the gated network model adopts a multi-layer perceptron model, and the gated network model includes a gated network model input layer, a gated network model middle layer and a gated network model output layer. The gated network model input layer receives the input battery operation data, the dimension of the gated network model middle layer is 32 dimensions, the activation function is the relu function, and the gated network model output layer outputs a 3-dimensional vector, the activation function is softmax, and the 3-dimensional vectors correspond to the weights of the three expert sub-models respectively and the sum of the weights of the three expert sub-models is 1.
[0019] Furthermore, the battery operation data are input into the three expert sub-models at the first level to extract corresponding features from different perspectives;
[0020] The outputs of the three expert sub-models at the first level are output_1_1, output_1_2, and output_1_3, which are all high-dimensional vectors, representing the feature representation of the input battery operation data by each expert sub-model;
[0021] The output of the first-level gating network model is a 3D vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1;
[0022] Select the outputs of the two expert sub-models with the highest probability among the three expert sub-models, then select the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gating network model, and sum the outputs of the two selected expert sub-models with the weights corresponding to the two selected expert sub-models to obtain the comprehensive feature representation of the first level;
[0023] Input the comprehensive feature representation of the first level into the second level as input data;
[0024] The outputs of the three expert sub-models at the second level are output_2_1, output_2_2, and output_2_3, respectively. Output_2_1, output_2_2, and output_2_3 are all high-dimensional vectors, representing the feature representation of each expert sub-model for the first-level comprehensive feature representation data of the input;
[0025] The output of the second-level gating network model is a 3D vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1;
[0026] Select the outputs of the two expert sub-models with the highest probability among the three expert sub-models, then select the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gating network model, and sum the outputs of the two selected expert sub-models with the weights corresponding to the two selected expert sub-models to obtain the comprehensive feature representation of the second level;
[0027] The comprehensive feature representation of the second level is then connected to a fully connected layer;
[0028] Finally, two linear regression layers are used to output SOC and RUL respectively.
[0029] Furthermore, the step S3 is specifically as follows: implementing the HS-MoE model code on the Keras platform and training it, with the number of training epochs=1000 and the number of batch samples batch_size=1024; the optimizer for model training is the adam algorithm, and the loss function is the mean square error; the training data is divided into a training set and a test set in a ratio of 8:2, the model is trained on the training set, and the model is verified on the test set.
[0030] Compared with the prior art, the present invention has the following advantages and effects:
[0031] 1. The present invention jointly predicts the battery SOC and RUL based on the HS-MoE model, improves the expression ability and prediction accuracy of the model, improves the robustness and generalization ability of the overall model, and reduces the risk of overfitting; the present invention jointly predicts SOC and RUL through the model, can temporarily replace the BMS when the BMS fails, and can provide correction data when an obvious error occurs in the BMS. Moreover, the joint prediction of SOC and RUL is achieved through one model, and only one model training is required, which reduces the time of model training and reduces the cost;
[0032] 2. The present invention adopts the HS-MoE model to gradually extract the complex features of the input data using its multi-level architecture, so that the model can more deeply understand and process the multi-level characteristics of the data; the hierarchical design of the model enhances its expressiveness, enabling it to more accurately capture the changing trends of the battery SOC and RUL;
[0033] 3. The present invention develops an integrated model that can simultaneously predict SOC and RUL, which can more accurately reveal the interaction and dependency between these two parameters;
[0034] 4. The present invention benefits from the sparse selection mechanism. Each layer of the network only activates part of the expert network, which greatly reduces the computational burden and improves the training and prediction speed of the model. The sparse selection mechanism helps prevent the model from overfitting because the model does not rely on the output of all experts, but selectively combines the most relevant expert network outputs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flow chart of the battery SOC and RUL prediction method based on the HS-MoE model of the present invention.
[0036] Figure 2 It is a structural diagram of the battery SOC and RUL prediction model based on the HS-MoE model of the present invention.
[0037] Figure 3 It is a structural diagram of the expert sub-model of the present invention.
[0038] Figure 4 It is a structural diagram of the gated network model of the present invention.
[0039] Figure 5 Schematic diagram of battery operation data and SOC and RUL data sets according to an embodiment of the present invention.
[0040] Figure 6 Schematic diagram of battery SOC prediction results according to an embodiment of the present invention.
[0041] Figure 7 It is a bar chart of the battery SOC prediction result of the embodiment of the present invention.
[0042] Figure 8 Schematic diagram of the battery RUL prediction result according to an embodiment of the present invention.
[0043] Fig. 9 It is a bar chart of the battery RUL prediction results of the embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to elaborate on the technical scheme adopted by the present invention to achieve the predetermined technical purpose, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only partial embodiments of the present invention, rather than all embodiments, and the technical means or technical features in the embodiments of the present invention can be replaced without paying creative work. The present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.
[0045] like Figure 1 As shown, a battery SOC and RUL prediction method based on the HS-MoE model of the present invention comprises the following steps:
[0046] S1. Test and collect battery operation data as well as SOC and RUL. Battery operation data includes expansion stress, current, voltage and temperature.
[0047] The collection of battery operation data in step S1 is specifically as follows:
[0048] Expansion stress collection: Install a micro pressure sensor inside or outside the battery to collect expansion stress, and connect the signal of the micro pressure sensor to a data logger to record real-time data of expansion stress.
[0049] Current acquisition, the current flowing through the battery is measured by a current sensor. The current sensor uses a Hall effect sensor or a shunt resistor. The current sensor is connected to the data acquisition system and the current data is recorded.
[0050] Voltage acquisition uses a high-precision voltmeter or a voltage measurement circuit built into the battery management system to collect the terminal voltage of the battery, and the voltage data is recorded through the data acquisition system.
[0051] Temperature collection: A temperature sensor is used to collect the temperature of the battery. The temperature sensor uses a thermocouple, thermistor or infrared sensor. The temperature sensor is connected to the data acquisition system and records the temperature data.
[0052] The specific process of collecting the above parameters is as follows: Design the sensor layout: Make sure that the sensor is placed in a position that can accurately reflect the battery status. Install the sensor: Install the sensor on the battery or battery management system. Calibrate the sensor: Calibrate the sensor to ensure that its readings are accurate and reliable. Connect the data acquisition system: Connect all sensors to the data acquisition system. Data synchronization: Ensure that all sensor data is synchronized during collection to enable accurate correlation analysis. Data recording: Record data in real time during the battery's charging and discharging process. Data processing: Pre-process the collected data, such as filtering, normalization, etc., for subsequent analysis. Through the above steps, relevant data of the battery under normal working conditions can be effectively collected.
[0053] Expansion stress data can also be obtained during battery operation. The battery will expand and shrink in volume during the charge and discharge process, which will produce internal expansion stress. The change in internal pressure of the battery is related to the intensity of the electrochemical reaction and can indirectly reflect the change in SOC. Long-term pressure changes will affect the structural integrity and performance of the battery, which is also an indicator for monitoring the health of the battery. Adding expansion stress data can increase the accuracy of battery SOC prediction. Combining multi-dimensional data such as expansion stress, current, voltage and temperature, the battery SOC can be accurately monitored and predicted.
[0054] The SOC and RUL data collection in step S1 is specifically as follows: SOC and RUL are calculated by the battery management system, and the BMS will estimate SOC and RUL by combining current, voltage and other sensor data.
[0055] S2, build HS-MoE model, such as Figure 2As shown, the HS-MoE model consists of two layers, each of which contains a multi-expert model and a gating network model.
[0056] like Figure 3 As shown, the multi-expert model in step S2 includes three expert sub-models, each of which is a multi-layer perceptron model, and each of which includes an expert sub-model input layer, an expert sub-model first intermediate layer, an expert sub-model second intermediate layer, and an expert sub-model output layer. The expert sub-model input layer receives input battery operation data, the dimension of the expert sub-model first intermediate layer is 64, the dimension of the expert sub-model second intermediate layer is 32, and the expert sub-model output layer outputs a 16-dimensional vector.
[0057] like Figure 4 As shown, in step S2, the gated network model adopts a multi-layer perceptron model, and the gated network model includes a gated network model input layer, a gated network model middle layer and a gated network model output layer. The gated network model input layer receives the input battery operation data, the dimension of the gated network model middle layer is 32 dimensions, the activation function is the relu function, and the gated network model output layer outputs a 3-dimensional vector, the activation function is softmax, and the 3-dimensional vectors correspond to the weights of the three expert sub-models respectively, and the sum of the weights of the three expert sub-models is 1.
[0058] The battery operation data are input into the three expert sub-models of the first level respectively to extract corresponding features from different angles.
[0059] The outputs of the three expert sub-models at the first level are output_1_1, output_1_2 and output_1_3, respectively. Output_1_1, output_1_2 and output_1_3 are all high-dimensional vectors, respectively representing the feature representation of each expert sub-model for the input battery operation data.
[0060] The output of the first-level gating network model is a 3-dimensional vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1.
[0061] The outputs of the two expert sub-models with the highest probability among the three expert sub-models are selected through Top_k, and then the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gating network model are selected. The outputs of the two selected expert sub-models and the weights corresponding to the two selected expert sub-models are weighted summed to obtain the comprehensive feature representation of the first level.
[0062] The comprehensive feature representation of the first level is input into the second level as input data.
[0063] The outputs of the three expert sub-models of the second level are output_2_1, output_2_2 and output_2_3 respectively. Output_2_1, output_2_2 and output_2_3 are all high-dimensional vectors, which respectively represent the feature representation of each expert sub-model for the comprehensive feature representation data of the first level of the input.
[0064] The output of the second-level gating network model is a 3-dimensional vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1.
[0065] The outputs of the two expert sub-models with the highest probability among the three expert sub-models are selected through Top_k, and then the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gating network model are selected. The outputs of the two selected expert sub-models and the weights corresponding to the two selected expert sub-models are weighted summed to obtain the comprehensive feature representation of the second level.
[0066] The comprehensive feature representation of the second level is then connected to a fully connected layer.
[0067] Finally, two linear regression layers are used to output SOC and RUL respectively.
[0068] S3. Train and verify the HS-MoE model.
[0069] Step S3 specifically includes implementing the HS-MoE model code and training on the Keras platform. The number of training epochs=1000 and the number of batch samples batch_size=1024 are used during training. The optimizer for model training is the adam algorithm, and the loss function is the mean square error. The training data is divided into a training set and a test set in a ratio of 8:2. The model is trained on the training set and verified on the test set.
[0070] S4. Predict the battery SOC and RUL. After the HS-MoE model is trained, if the model effect is good, deploy the HS-MoE model and use the HS-MoE model to predict the battery SOC and RUL.
[0071] In one embodiment of the present invention, the collected battery operation data is as follows: Figure 5 As shown, it is input into the trained HS-MoE model, and the prediction results are as follows Figure 6 , Figure 7 , Figure 8 and Fig. 9 shown. Figure 7 and Fig. 9In the figure, the solid line represents the true value, the dotted line represents the predicted value, the solid square represents the error value, and the numbers represent the true value. It can be seen from the figure that the prediction effect is good.
[0072] The mean of the SOC test set is 2.1872, the standard deviation is 1.2762, and the mean of the prediction set is 2.188, the standard deviation is 1.2767, which shows that the data distribution of the prediction results is basically consistent with the data distribution of the real data.
[0073] The root mean square error between the prediction set and the test set of battery SOC is only 0.01414, indicating that the prediction effect of the model is good.
[0074] The mean of the test set of RUL is 179.3942, the standard deviation is 107.86, and the mean of the prediction set is 178.9775, the standard deviation is 107.8341, which shows that the data distribution of the prediction results is basically consistent with the data distribution of the real data.
[0075] The root mean square error between the prediction set and the test set of battery SOC is only 3.4689, indicating that the prediction effect of the model is good.
[0076] The present invention jointly predicts the battery SOC and RUL based on the HS-MoE model, improves the expression ability and prediction accuracy of the model, improves the robustness and generalization ability of the overall model, and reduces the risk of overfitting; the present invention jointly predicts SOC and RUL through the model, can temporarily replace the BMS when the BMS fails, and can provide correction data when an obvious error occurs in the BMS, and realizes the joint prediction of SOC and RUL through one model, only needs to perform model training once, which reduces the time of model training and reduces the cost; the present invention adopts the HS-MoE model to gradually extract the complex features of the input data by utilizing its multi-level architecture, so that The model can more deeply understand and process the multi-level characteristics of the data; the hierarchical design of the model enhances its expressiveness, enabling it to more accurately capture the changing trends of the battery SOC and RUL; the present invention can more accurately reveal the interaction and dependency between these two parameters by developing an integrated model that can simultaneously predict SOC and RUL; the present invention benefits from the sparse selection mechanism, and each layer of the network only activates part of the expert network, which greatly reduces the computational burden and improves the training and prediction speed of the model; the sparse selection mechanism helps prevent the model from overfitting, because the model does not rely on the output of all experts, but selectively combines the most relevant expert network outputs.
[0077] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.
Claims
1. A battery SOC and RUL prediction method based on HS-MoE model, characterized in that The following steps are involved: S1. Test and collect battery operation data as well as SOC and RUL. Battery operation data includes expansion stress, current, voltage and temperature. S2. Construct the HS-MoE model. The HS-MoE model consists of two levels, each of which contains a multi-expert model and a gating network model; In step S2, the multi-expert model includes three expert sub-models, each of which is a multi-layer perceptron model, and each of which includes an expert sub-model input layer, an expert sub-model first intermediate layer, an expert sub-model second intermediate layer, and an expert sub-model output layer. The expert sub-model input layer receives input battery operation data, the dimension of the expert sub-model first intermediate layer is 64, the dimension of the expert sub-model second intermediate layer is 32, and the expert sub-model output layer outputs a 16-dimensional vector; In step S2, the gated network model adopts a multi-layer perceptron model, and the gated network model includes a gated network model input layer, a gated network model middle layer and a gated network model output layer. The gated network model input layer receives the input battery operation data, the dimension of the gated network model middle layer is 32 dimensions, the activation function is the relu function, and the gated network model output layer outputs a 3-dimensional vector, the activation function is softmax, and the 3-dimensional vectors correspond to the weights of the three expert sub-models respectively, and the sum of the weights of the three expert sub-models is 1; The battery operation data are input into the three expert sub-models at the first level to extract corresponding features from different perspectives; The outputs of the three expert sub-models at the first level are output_1_1, output_1_2, and output_1_3, which are all high-dimensional vectors, representing the feature representation of the input battery operation data by each expert sub-model; The output of the first-level gating network model is a 3D vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1; Select the outputs of the two expert sub-models with the highest probability among the three expert sub-models, then select the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gated network model, and sum the outputs of the two selected expert sub-models with the weights corresponding to the two selected expert sub-models to obtain the comprehensive feature representation of the first level; Input the comprehensive feature representation of the first level into the second level as input data; The outputs of the three expert sub-models at the second level are output_2_1, output_2_2, and output_2_3, respectively. Output_2_1, output_2_2, and output_2_3 are all high-dimensional vectors, representing the feature representation of each expert sub-model for the first-level comprehensive feature representation data of the input; The output of the second-level gating network model is a 3D vector, which corresponds to the weights of the three expert sub-models, and the sum of the weights of the three expert sub-models is 1; Select the outputs of the two expert sub-models with the highest probability among the three expert sub-models, then select the two weights corresponding to the two selected expert sub-models in the 3D vector output by the gating network model, and sum the outputs of the two selected expert sub-models with the weights corresponding to the two selected expert sub-models to obtain the comprehensive feature representation of the second level; The comprehensive feature representation of the second level is then connected to a fully connected layer; Finally, two linear regression layers are used to output SOC and RUL respectively; S3, training and verifying the HS-MoE model; S4. Predict the battery SOC and RUL. After the HS-MoE model is trained, if the model effect is good, deploy the HS-MoE model and use the HS-MoE model to predict the battery SOC and RUL.
2. The battery SOC and RUL prediction method based on the HS-MoE model according to claim 1, characterized in that: The collection of battery operation data in step S1 is specifically as follows: Expansion stress collection: Install a micro pressure sensor inside or outside the battery to collect expansion stress, and connect the signal of the micro pressure sensor to a data logger to record real-time data of expansion stress; Current acquisition, measuring the current flowing through the battery through a current sensor, which uses a Hall effect sensor or a shunt resistor, connecting the current sensor to a data acquisition system and recording the current data; Voltage acquisition: a high-precision voltmeter or a voltage measurement circuit built into the battery management system is used to collect the terminal voltage of the battery. The voltage data is recorded by the data acquisition system. Temperature collection: A temperature sensor is used to collect the temperature of the battery. The temperature sensor uses a thermocouple, thermistor or infrared sensor. The temperature sensor is connected to the data acquisition system and records the temperature data.
3. The battery SOC and RUL prediction method based on the HS-MoE model according to claim 1, characterized in that: The SOC and RUL data collection in step S1 is specifically as follows: SOC and RUL are calculated by the battery management system.
4. The battery SOC and RUL prediction method based on the HS-MoE model according to claim 1, characterized in that: Specifically, step S3 is to implement the HS-MoE model code and train it on the Keras platform, with the number of training epochs=1000 and the number of batch samples batch_size=1024; the optimizer for model training is the adam algorithm, and the loss function is the mean square error; the training data is divided into a training set and a test set in a ratio of 8:2, the model is trained on the training set, and the model is verified on the test set.
Citation Information
Patent Citations
Cloud auxiliary battery management system and method
CN112331941A
Method for estimating SOC (State of Charge) of lithium battery, battery management system, medium and electric energy equipment
CN118191637A
Multi-mode electric energy prediction and optimization method based on HS-MOE
CN118708886A