Battery state prediction method and device, storage medium and program product
By aligning the distribution of laboratory and real-vehicle data through adversarial training, the parameters of the battery state prediction model are updated, solving the problem of inaccurate SOH prediction in real-vehicle environments and improving the model's generalization and accuracy.
Patent Information
- Application Number
- CN202410868172.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-30
- Publication Date
- 2025-12-30
AI Technical Summary
In existing technologies, battery SOH prediction models trained on laboratory data are inaccurate in real vehicle environments, mainly due to the differences between real vehicle data and laboratory data, resulting in insufficient model generalization.
An adversarial training method is used to align the distribution of laboratory data and real vehicle data. The model parameters are updated through adversarial learning, making the pre-trained model applicable to real vehicle data, reducing dataset differences and improving model generalization.
This improved the accuracy of the battery state prediction model in predicting SOH (State of Health) based on real-vehicle data and enhanced the model's applicability across different datasets.
Smart Images

Figure CN121232017A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of batteries, and relate to but are not limited to a battery state prediction method and device, a storage medium, and a program product. BACKGROUND
[0002] In recent years, the world is facing major challenges in sustainable development such as energy shortage, climate change, and pollutant emissions, so countries have begun to pay widespread attention to the development of new energy vehicles represented by electric vehicles. Electric vehicles use batteries as power sources, and the battery pack of an electric vehicle needs to be managed using an advanced battery management system (BMS). One of the basic functions of the BMS is to accurately estimate the state of health (SOH) of the battery pack. SOH is an indicator of battery performance degradation and is of great significance in the actual charging and discharging process of electric vehicle batteries. Batteries will experience irreversible performance degradation during use, and when the degree of degradation reaches a point where the vehicle's power, reliability, and safety requirements cannot be met, it can lead to reduced vehicle performance or even failure. Currently, many fires are closely related to battery aging. Therefore, accurately and timely assessing the SOH of the battery can replace low-life batteries, reduce the likelihood of failure, ensure the safety of vehicles and personnel, avoid resource waste, and ultimately improve the overall performance of the battery.
[0003] Related technologies predict the SOH of the battery using a pre-trained prediction model. However, the measurement process of the battery in a real vehicle environment and the internal structure of the battery are complex, and data may have problems such as outliers, missing values, or sampling noise of the BMS. The data used for model training has high quality, which can cause differences in data during model training and inference, resulting in the problem that the prediction model trained in the laboratory is not accurate in predicting the SOH of real vehicle data. SUMMARY
[0004] To solve the problems existing in related technologies, embodiments of the present application provide a battery state prediction method and device, a storage medium, and a program product, which can align the distribution between laboratory data and battery usage data based on a method of adversarial training, train a model using the aligned data, and obtain a battery state prediction model. The trained battery state prediction model can accurately predict the health status of the battery based on the data of the battery when used in an electrical equipment, thereby improving the accuracy of SOH prediction of the battery in actual application.
[0005] In a first aspect, the application provides a battery state prediction method, comprising: obtaining charge-discharge data of a battery to be measured; performing feature extraction on the charge-discharge data by a feature extraction module in a trained battery state prediction model to obtain battery charge-discharge features; performing battery state prediction based on the battery charge-discharge features by a prediction module in the battery state prediction model to obtain a health state of the battery to be measured; wherein parameters of the battery state prediction model are adjusted based on loss values corresponding to classification results of a discriminator having the same structure as the prediction module when classifying experimental charge-discharge features corresponding to charge-discharge data of the battery in a laboratory and usage charge-discharge features corresponding to charge-discharge data of the battery in use of an electrical equipment.
[0006] In the above embodiment, the experimental data and the actual use data of the battery are used for adversarial learning, the model parameters of the SOH pre-training model are updated to align the distance in the feature space and the distribution of the two data sets of the experimental data and the actual use data, and the difference between the two data sets is reduced. The battery state prediction model provided by the embodiment can be applied to different data sets, and the generalization of the model is improved. The SOH of the battery to be measured is predicted by the battery state prediction model after parameter updating, and the prediction accuracy of the SOH of the battery state prediction model for the real vehicle data is improved.
[0007] In some embodiments, the feature extraction module includes at least one residual module, and the residual module includes at least a first feature extraction module, a second feature extraction module, and an activation module; the feature extraction on the charge-discharge data by the feature extraction module in the trained battery state prediction model to obtain the battery charge-discharge features includes: performing nonlinear feature extraction on the charge-discharge data by the first feature extraction module to obtain nonlinear features of the charge-discharge data; performing local feature extraction on the charge-discharge data by the second feature extraction module to obtain local features of the charge-discharge data; performing feature fusion on the nonlinear features and the local features to obtain fused features; and performing nonlinear activation on the fused features by the activation module to obtain the battery charge-discharge features.
[0008] In the above embodiment, the first feature extraction module captures complex patterns and detailed information of the charge-discharge data, the second feature extraction module extracts local features of the charge-discharge data, and the fused features extract more useful information, thereby improving the accuracy of SOH prediction.
[0009] In some embodiments, the prediction module comprises at least a feature integration module and a regression module; the battery charging and discharging features comprise features in at least one of the following dimensions: current, voltage, and temperature; the prediction of the battery state based on the battery charging and discharging features in the battery state prediction model to obtain the state of health of the battery under test comprises: integrating features of different dimensions in the battery charging and discharging features based on the feature integration module to obtain global features; and performing regression prediction on the global features based on the regression module to obtain the state of health of the battery under test.
[0010] In the above embodiments, the prediction module composed of a fully connected layer can effectively utilize multi-dimensional features to improve the accuracy and stability of SOH prediction.
[0011] In some embodiments, the training process of the battery state prediction model comprises: performing feature extraction on source domain data based on a feature extraction module of a pre-trained model to obtain source domain features; wherein the source domain data is charging and discharging data of a battery in a laboratory; the pre-trained model is obtained by training the source domain data; performing feature extraction on target domain data based on the feature extraction module to obtain target domain features; the target domain data is charging and discharging data of a battery in use of an electrical equipment; performing discrimination on the source domain features and the target domain features based on a discriminator with the same structure as the prediction module of the pre-trained model to determine the difference degree between the source domain data and the target domain data; and updating model parameters of the pre-trained model based on the difference degree to obtain the battery state prediction model.
[0012] In the above embodiments, after obtaining the pre-trained model for predicting SOH, the source domain data and the target domain data are used for adversarial learning to update the model parameters of the SOH pre-trained model to align the distance in the feature space and the distribution of the two data sets of the source domain data and the target domain data, thereby reducing the difference between the two data sets. The model provided in the embodiments can be applied to different data sets, thereby improving the generalization of the model. The SOH of the battery under test is predicted by the battery state prediction model after parameter updating, thereby improving the prediction accuracy of the battery state prediction model for the SOH of the real vehicle data.
[0013] In some embodiments, the discrimination on the source domain features and the target domain features based on the discriminator to determine the difference degree between the source domain data and the target domain data comprises: classifying the source domain features and the target domain features based on the discriminator to obtain a classification result; and determining the difference degree between the source domain data and the target domain data based on the classification result and a preset algorithm.
[0014] In the above embodiments, the discriminator classifies the source domain features and target domain features to determine whether the discriminator can distinguish between the two types of data, thereby updating the pre-trained model, aligning the feature distributions of the source domain features and target domain features, and improving the accuracy of SOH prediction.
[0015] In some embodiments, the battery state prediction method further includes: obtaining the loss result of the pre-trained model; the loss result is obtained by the pre-trained model based on the source domain data; correspondingly, updating the model parameters of the pre-trained model based on the degree of difference to obtain the battery state prediction model includes: determining the model loss function of the pre-trained model and the discriminator loss function of the discriminator based on the degree of difference and the loss result; determining the initial model update parameters of the pre-trained model and the initial discriminator update parameters of the discriminator with the goal of minimizing the model loss function and maximizing the discriminator loss function; updating the pre-trained model and the discriminator respectively based on the initial model update parameters and the initial discriminator update parameters to obtain the updated pre-trained model and the updated discriminator; determining the new degree of difference between the source domain data and the target domain data again based on the updated pre-trained model, and updating the updated pre-trained model and the updated discriminator again based on the new degree of difference, until the number of adversarial iterations is reached, and predicting the battery state after the last update as the battery state prediction model.
[0016] In the above embodiments, adversarial learning is performed using source domain data and target domain data. The pre-trained model and discriminator optimize the loss function in an adversarial manner, and the parameters of the pre-trained model are iteratively updated. The final battery state prediction model maps the source domain data and target domain data to the same feature space, making them indistinguishable by the discriminator. This achieves the goal of reducing the difference between the two datasets, thereby improving the generalization of the model's prediction and enhancing the accuracy of the battery state prediction model in predicting SOH based on real vehicle data.
[0017] In some embodiments, the battery state prediction method further includes: processing sample charge-discharge data to obtain processed charge-discharge data; the source domain data includes at least sample charge-discharge data and sample battery state; inputting the processed charge-discharge data into an initial pre-trained model; the initial pre-trained model includes an initial feature extraction module and an initial prediction module; based on the initial feature extraction module, performing feature extraction on the sample charge-discharge data to obtain pre-trained features; based on the initial prediction module, performing battery state prediction on the pre-trained features to obtain a predicted battery state; inputting the predicted battery state and the sample battery state into a preset loss model to obtain a loss result; and correcting the model parameters of the initial feature extraction module and the initial prediction module based on the loss result to obtain the pre-trained model.
[0018] In the above embodiments, a base model for predicting the state of energy (SOH) of a battery is trained based on source domain data, so that the pre-trained model has the ability to predict SOH.
[0019] In some embodiments, the step of correcting the model parameters of the initial feature extraction module and the initial prediction module based on the loss result to obtain the pre-trained model includes: performing an initial correction on the model parameters of the initial feature extraction module and the initial prediction module based on the loss result to obtain a corrected pre-trained model; predicting the processed charge and discharge data again based on the corrected pre-trained model to obtain a new predicted battery state; inputting the new predicted battery state and the sample battery state into a preset loss model to obtain a new loss result; and correcting the model parameters of the initial feature extraction module and the initial prediction module again based on the new loss result until the number of pre-training iterations is reached, and predicting the battery state after the last update as the pre-trained model.
[0020] In the above embodiments, the pre-trained model is iteratively trained based on the processed data, making the data used by the pre-trained model closer to real vehicle data, and thus achieving higher accuracy in predicting SOH based on real vehicle data.
[0021] In some embodiments, the step of processing the sample charge-discharge data to obtain processed charge-discharge data includes: normalizing the sample charge-discharge data to obtain normalized data; generating random probabilities corresponding to the normalized data based on a preset random probability generation algorithm; and performing random data augmentation on the normalized data based on the random probabilities to obtain the processed charge-discharge data.
[0022] In some embodiments, the random data augmentation includes multiple data processing steps, each corresponding to an execution condition; the step of performing random data augmentation on the normalized data based on the random probability to obtain the processed charge-discharge data includes: based on the comparison result between the random probability and the execution condition corresponding to each data processing step, performing random pruning, random deletion, random replacement, and noise addition on the normalized data in sequence to obtain the processed charge-discharge data.
[0023] In some embodiments, the step of performing random cropping, random deletion, random replacement, and noise addition on the normalized data sequentially based on the comparison result between the random probability and the execution conditions corresponding to each data processing step to obtain the processed charge / discharge data includes: in response to the random probability satisfying a first execution condition, determining the random cropping ratio of the normalized data, and performing random cropping processing on the normalized data based on the random cropping ratio to obtain cropped data; in response to the random probability satisfying a second execution condition, performing random deletion processing on the cropped data to obtain missing data; in response to the random probability satisfying a third execution condition, performing random replacement processing on the missing data based on a random anomaly coefficient to obtain abnormal data; and in response to the random probability satisfying a fourth execution condition, adding noise to the abnormal data to obtain the processed charge / discharge data.
[0024] In some embodiments, the method further includes: in response to the random probability not satisfying the execution condition corresponding to any data processing step, skipping any data processing step and proceeding to the next data processing step until the processed charge / discharge data is obtained.
[0025] In the above embodiments, random perturbation is applied to the training data during model pre-training to simulate the data conditions of real vehicle scenarios. This not only makes the algorithm of the pre-trained model closer to real vehicle data, but also further expands the dataset to reduce overfitting.
[0026] Secondly, embodiments of this application provide a battery state prediction device, comprising: an acquisition module for acquiring charge and discharge data of a battery under test; a feature extraction module for extracting features from the charge and discharge data using a feature extraction module in a trained battery state prediction model to obtain battery charge and discharge features; and a prediction module for predicting the battery state based on the battery charge and discharge features to obtain the health state of the battery under test; wherein the parameters of the battery state prediction model are adjusted based on the loss values corresponding to the experimental charge and discharge features of the battery in the laboratory and the classification results when classifying the battery using the charge and discharge features in the use of electrical equipment, using a discriminator with the same structure as the prediction module.
[0027] In the above embodiments, adversarial learning is performed using experimental data and actual usage data of the battery to update the model parameters of the SOH pre-trained model, so as to align the distance between the experimental data and actual usage data in the feature space and the distribution of the two datasets, thereby reducing the difference between the two datasets. The battery state prediction model provided by this application embodiment can be applied to different datasets, improving the generalization of the model. The battery state prediction model with updated parameters is used to predict the SOH of the battery under test, thereby improving the accuracy of the battery state prediction model in predicting the SOH of real vehicle data.
[0028] Thirdly, embodiments of this application provide an electrical device including a memory and a processor. The memory stores a computer program that can run on the processor, and when the processor executes the program, it implements the steps in the above-described battery state prediction method.
[0029] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps in the above-described battery state prediction method.
[0030] Fifthly, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the above-described battery state prediction method.
[0031] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0032] Figure 1 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure One ;
[0033] Figure 2 This is a schematic diagram of the battery state prediction model provided in the embodiments of this application;
[0034] Figure 3 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Two ;
[0035] Figure 4 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Three ;
[0036] Figure 5This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Four ;
[0037] Figure 6 This is a schematic diagram of the unsupervised adversarial learning process of the SOH model provided in the embodiments of this application;
[0038] Figure 7 This is a schematic diagram of the data enhancement process provided in an embodiment of this application;
[0039] Figure 8 This is a schematic diagram of the SOH model provided in the embodiments of this application;
[0040] Figure 9 This is a schematic diagram of dataset alignment during adversarial learning provided in an embodiment of this application;
[0041] Figure 10 This is a schematic diagram of the adversarial training process of the SOH model provided in the embodiments of this application;
[0042] Figure 11 This is a schematic diagram of the composition structure of a battery state prediction device provided in an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0044] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiments of this application pertain. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit the application.
[0045] Currently, new energy batteries are increasingly widely used in daily life and industry. They are not only used in energy storage systems such as hydropower, thermal power, wind power, and solar power plants, but also extensively used in electric vehicles such as electric bicycles, electric motorcycles, and electric cars, as well as in aerospace and other fields. With the continuous expansion of the application areas of power batteries, the market demand is also constantly increasing. In this application embodiment, the battery involved can be a battery cell, also known as a battery unit. A battery cell refers to a basic unit capable of converting chemical energy into electrical energy, which can be used to manufacture battery modules or battery packs to supply power to electrical devices. A battery cell can be a rechargeable battery, which refers to a battery cell that can be recharged after discharge to activate the active materials and continue to be used. Battery cells can be lithium-ion batteries, sodium-ion batteries, sodium-lithium-ion batteries, lithium metal batteries, sodium metal batteries, lithium-sulfur batteries, magnesium-ion batteries, nickel-metal hydride batteries, nickel-cadmium batteries, lead-acid batteries, etc., and this application embodiment is not limited to these.
[0046] In this application embodiment, the term "battery cell" can refer to any shape, such as a square cell or a round cell. Furthermore, "battery cell" typically refers to a battery cell, which is one of the basic units constituting a battery. The battery cell is the core component of a battery, responsible for storing and releasing electrical energy. A battery cell can be a lithium-ion battery cell (Li-ion Cell), a lithium-polymer battery cell (Li-polymer Cell), a nickel-metal hydride battery cell (NiMH Cell), etc. This application embodiment does not limit the type of battery cell; the specific type can be selected according to the actual application scenario.
[0047] In this embodiment, the battery cell is the core component of the battery pack. A battery pack typically contains multiple battery cells, which are combined to provide the required energy capacity and voltage. The components of a battery pack include at least: individual battery cells, a battery management system (BMS), a casing, wiring harnesses, connectors, and interfaces. These components work together to combine the battery cells into a fully functional battery pack for various applications. For example, the battery pack can be used in electric vehicles, energy storage systems, portable electronic devices, solar power systems, wind power systems, emergency backup power supplies, power tools, or electric bicycles, etc. This embodiment does not impose any limitations on this; the specific choice can be made according to the actual application scenario.
[0048] It should be noted that the battery pack can use different types of battery cells, such as lithium-ion batteries, nickel-metal hydride batteries, lithium polymer batteries, etc., depending on the specific application requirements and performance specifications.
[0049] In this embodiment, the battery may also be a single physical module comprising one or more battery cells to provide higher voltage and capacity. When there are multiple battery cells, the multiple battery cells are connected in series, parallel, or mixed via a busbar.
[0050] Current SOH estimation methods mostly focus on laboratory data and rarely analyze the differences between real-world automotive operating data and laboratory data. Furthermore, features extracted from laboratory data may not be applicable to the real-world automotive operating data domain.
[0051] In real-world vehicle scenarios, obtaining accurate State of Harm (SOH) labels is extremely difficult, typically requiring users to slowly charge and discharge the battery and allow it to rest for an extended period. This makes it nearly impossible to obtain labels in real-world settings, hindering the deployment of transfer learning even with only a small sample size. Furthermore, data collection in real-world vehicles is subject to various environmental and conditional limitations, such as vehicle operating status, road conditions, and sensor malfunctions, leading to instability and inconsistent data quality. This results in significant discrepancies between the training data and the data distribution in real-world automotive scenarios, compromising the generalization ability of the model algorithm. Finally, the charging depth of real-world vehicle data exhibits significant variance due to variations in user charging habits. Therefore, directly applying models trained on laboratory data to real-world automotive operating conditions may result in prediction errors in practical applications.
[0052] To address the issue of inaccurate SOH predictions by models trained on laboratory data when using real-vehicle data in related technologies, the applicant's research found that after obtaining a pre-trained model trained on laboratory data, adversarial learning can be used to reduce the distance between the training data and real-vehicle data in the feature space, aligning the distributions of the two datasets. By reducing the differences between the two datasets, the generalization of the model's predictions can be improved, enabling the adversarially trained model to accurately predict SOH using real-vehicle data.
[0053] Based on the above considerations, the inventors, through in-depth research, can train a pre-trained model for SOH prediction using experimental battery data. Then, adversarial learning is performed using actual battery usage data and experimental data from real-world scenarios to update the parameters of the pre-trained model, resulting in a battery state prediction model suitable for real-world data. Finally, the SOH of the battery under test is predicted using the battery state prediction model and the charge / discharge data of the battery under test, thus solving the problems existing in the prior art.
[0054] Thus, this embodiment of the application uses experimental battery data and actual usage data to perform adversarial learning, updating the model parameters of the SOH pre-trained model to align the distance between the experimental data and actual usage data in the feature space and the distribution of the two datasets, reducing the difference between the two datasets. The battery state prediction model provided by this embodiment of the application can be applied to different datasets, improving the model's generalization ability. By using the battery state prediction model with updated parameters to predict the SOH of the battery under test, the accuracy of the battery state prediction model in predicting the SOH of real vehicle data is improved.
[0055] The battery state prediction method disclosed in this application can be used, but is not limited to, for predicting the state of health (SOH) of batteries in electrical equipment such as vehicles, ships, or aircraft. A power system comprising such an electrical device can be used, incorporating batteries that can accurately predict SOH as disclosed in this application. This helps to mitigate and automatically regulate the deterioration of cell expansion forces, replenish electrolyte consumption, and improve the stability of battery performance and battery life.
[0056] The battery state prediction method disclosed in this application can be applied to various battery-powered devices, including but not limited to mobile phones, tablets, laptops, electric toys, power tools, electric vehicles, electric cars, ships, spacecraft, etc. Electric toys can include stationary or mobile electric toys, such as game consoles, electric car toys, electric ship toys, and electric airplane toys, etc. Spacecraft can include airplanes, rockets, space shuttles, and spacecraft, etc.
[0057] This application provides a battery state prediction method to predict the health state of a battery under specific application scenarios. The executing entity can be a processor of a battery-powered device (e.g., a car), a vehicle's battery management system (BMS), or a cloud server corresponding to the device. The technical solution of this application will be described in detail below with reference to the accompanying drawings.
[0058] Figure 1 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure One ,like Figure 1 As shown, the battery state prediction method provided in this application embodiment can be implemented through steps S101 to S103:
[0059] Step S101: Obtain the charge and discharge data of the battery under test.
[0060] In some embodiments, the battery under test refers to the battery for which SOH prediction needs to be performed. It can originate from any electronic device, and the charge / discharge data can be information such as current, voltage, state of charge (SOC), and temperature of the battery under test during a single charge or discharge cycle. For example, it could be data on the temperature, current, and voltage changes over time as the battery under test charges from 20% SOC to 80% SOC over one hour. Here, during the charging process of the battery under test, sampling can be performed in real-time or at preset intervals, such as once per minute. This means the charge / discharge data has 60 data points, each including information such as voltage, current, SOC, and temperature at that moment.
[0061] Step S102: Extract features from the charge and discharge data using the feature extraction module in the trained battery state prediction model to obtain battery charge and discharge features.
[0062] In this embodiment of the application, before feature extraction of the charge and discharge data, data preprocessing can be performed on the charge and discharge data, such as noise reduction and normalization, to remove outliers in the charge and discharge data.
[0063] The feature extraction module in this embodiment may include multiple CNN-based residual modules (ResBlocks). Each residual module may have the same or different network structures. The residual modules can use convolutional neural networks to extract features from the battery's charging and discharging data to obtain battery charging and discharging features.
[0064] Here, each residual module can include a backbone network composed of multiple convolutional layers and a residual layer. The backbone network with multiple convolutional layers extracts the nonlinear features of the charge and discharge data. However, too many convolutional layers can lead to the vanishing gradient problem. To avoid this problem, the residual layer can use no convolutional layer or only one convolutional layer, thus preserving the information of the charge and discharge data itself and maintaining a stable gradient. Finally, the outputs of the backbone network and the residual layer are added together to obtain the output of a single residual module, ultimately yielding the battery charge and discharge features.
[0065] In some embodiments, battery charge / discharge characteristics can be the temporal and spatial distribution and changes of battery data, such as the fluctuation patterns of voltage and current over time. Battery charge / discharge characteristics can also be local features of the charge / discharge data. When the convolution kernel of the feature extraction module slides across the data, it can extract local features of the battery data, such as voltage peaks or current valleys within a specific time period, effectively extracting the feature of current jumps during stepped charging. Other features include the duration of constant current charging, the duration of constant voltage charging, and the slope and area of the voltage curve before the start of constant voltage charging.
[0066] In this embodiment, the multi-layer residual module enhances the model's expressive power. The residual module allows gradients to propagate by skipping a certain number of layers, effectively mitigating the gradient vanishing problem in the feature extraction module. This allows the network to be trained deeper, thereby enhancing the model's expressive power. Furthermore, by using multiple residual modules to extract features from the charge and discharge data of the battery under test, this embodiment can learn more useful information, thus improving the accuracy of SOH prediction.
[0067] Here, the battery state prediction model is pre-trained, and the parameters of the feature extraction module in the battery state prediction model are obtained through training.
[0068] Step S103: The prediction module in the battery state prediction model predicts the battery state based on the battery charge and discharge characteristics to obtain the health state of the battery under test; wherein, the parameters of the battery state prediction model are adjusted based on the loss value corresponding to the classification result when classifying the experimental charge and discharge characteristics of the battery in the laboratory and the usage charge and discharge characteristics in the electrical equipment, which are based on the same discriminator as the prediction module.
[0069] In some embodiments, the prediction module can consist of two fully connected layers (FC). The first FC layer integrates the battery charging and discharging features output by the feature extraction module, combining features from different dimensions extracted earlier to form global features. For example, the charging and discharging data includes voltage, current, and temperature data during the charging and discharging process. The first FC layer can integrate the features corresponding to the voltage, current, and temperature data respectively to obtain global features. The second FC layer serves as the output layer of the model, used for regression to convert the integrated global features into the final prediction result. The second FC layer performs regression calculations based on the global features, combining the features from the previous layer through learned weights to obtain the final SOH prediction result.
[0070] Here, the battery state prediction model is a pre-trained model trained using charge-discharge data from a battery in a laboratory setting. The pre-trained model includes a feature extraction module and a prediction module. The feature extraction module extracts features from the laboratory charge-discharge data to obtain experimental charge-discharge features. It also extracts features from the battery's charge-discharge data during use, yielding experimental charge-discharge features. A discriminator with the same structure as the prediction module is then used to classify these experimental and usage charge-discharge features. The parameters of the feature extraction module in the pre-trained model are updated based on the loss value corresponding to the classification results. The updated feature extraction module then extracts features again from the laboratory and usage data to obtain new experimental and usage charge-discharge features. These are then classified again by the discriminator, and the model is updated again based on the classification results. This process is repeated until the desired number of iterations is reached, resulting in a well-trained battery state prediction model.
[0071] This application embodiment uses experimental and actual usage data of batteries to perform adversarial learning, updating the model parameters of the SOH pre-trained model to align the distance between the experimental and actual usage data in the feature space and the distribution of the two datasets, reducing the difference between the two datasets. The battery state prediction model provided by this application embodiment can be applied to different datasets, improving the model's generalization ability. The battery state prediction model with updated parameters predicts the SOH of the battery under test, improving the accuracy of the battery state prediction model in predicting the SOH of real vehicle data.
[0072] Figure 2 This is a schematic diagram of the battery state prediction model provided in the embodiments of this application, as shown below. Figure 2 As shown, the battery state prediction model includes a feature extraction module 201 and a prediction module 202. The feature extraction module 201 includes multiple residual modules, such as... Figure 2 The feature extraction module 201 includes five residual modules, each with the same or different network structures. The residual modules may include a first feature extraction module 2011, a second feature extraction module 2012, and an activation module 2013. The prediction module 202 may include a feature integration module 2021 and a regression module 2022.
[0073] Correspondingly, step S102 can be achieved through steps S1021 to S1024:
[0074] Step S1021: Nonlinear feature extraction is performed on the charge and discharge data by the first feature extraction module to obtain the nonlinear features of the charge and discharge data.
[0075] In this embodiment, the first feature extraction module can be a neural network composed of multiple convolutional layers, capable of extracting nonlinear features with stronger expressive power, such as... Figure 2 As shown, the first feature extraction module can be composed of a first convolutional layer, a first normalization layer, an activation layer, a second convolutional layer, and a second normalization layer connected in sequence. Here, the number of convolutional layers can be determined during the training process.
[0076] Here, the convolutional layers (first and second convolutional layers) extract features from the battery's charging and discharging data through filters containing multiple convolutional kernels. The extracted features can be features of multiple parameters such as current, voltage, charging and discharging power, and voltage change rate. The convolutional layers can also extract multi-level features from the input data. These features are used together to estimate the battery's internal resistance and thus estimate the battery's SOH.
[0077] In some embodiments, a normalization layer can normalize the output of the convolutional layer, making the feature distribution more stable, which can improve the prevention of overfitting, speed up the convergence speed, and improve the prediction accuracy of the model.
[0078] In some embodiments, the activation layer can be the ReLU activation function, which is used to introduce nonlinearity. The ReLU function sets all negative values to zero and keeps positive values unchanged, which can speed up convergence and prevent the gradient vanishing problem.
[0079] Here, the first feature extraction module uses a double convolution structure to further refine and enhance the feature representation, enabling the model to capture more complex patterns and detailed information, increasing the depth of the first feature extraction module, and thus improving the feature extraction capability.
[0080] Step S1022: Local features of the charge and discharge data are obtained by performing local feature extraction on the charge and discharge data through the second feature extraction module.
[0081] Here, stacking too many convolutional layers in the first feature extraction module may lead to network degradation and gradient vanishing problems. Therefore, the second feature extraction module can use no convolutional layer or only one convolutional layer, which can not only preserve the information of the input data itself, but also maintain stable gradients of the model. Figure 2 As shown, the second feature extraction module may include a third convolutional layer and a third normalization layer. It has low computational cost and can capture local changes in the charge and discharge data of the battery under test. It can effectively extract the feature of current jump in step charging to obtain local features of charge and discharge data.
[0082] Step S1023: Perform feature fusion on the nonlinear feature and the local feature to obtain the fused feature.
[0083] Here, as Figure 2As shown, after obtaining the nonlinear features and local features, the extracted nonlinear features and local features can be fused by the add operation to obtain fused features, thereby increasing the information content of the features and further enhancing the expressive power of the features. This makes it easier for the subsequent prediction module to capture important features in the charging and discharging data, thereby improving the prediction performance.
[0084] Step S1024: The fusion feature is nonlinearly activated by the activation module to obtain the battery charge and discharge feature.
[0085] Here, the activation module can be the ReLU activation function, which introduces non-linearity. By suppressing negative values, unimportant features are set to 0, resulting in the battery's charging and discharging characteristics. This makes the network sparser, reduces the number of parameters, and lowers the risk of overfitting. Simultaneously, ReLU can accelerate feature learning, allowing the model to converge faster.
[0086] This application embodiment captures complex patterns and details of charge and discharge data through a first feature extraction module, and extracts local features of the charge and discharge data through a second feature extraction module. The fused features extract more useful information, thereby improving the accuracy of SOH prediction.
[0087] In some embodiments, the battery charge / discharge characteristics include features in at least one of the following dimensions: current, voltage, and temperature. They may also include trends and patterns in the changes of current, voltage, and temperature data over time, entropy features used to assess the uncertainty of the battery state, and other features. Correspondingly, step S103 can be implemented through steps S1031 and S1032:
[0088] Step S1031: Based on the feature integration module, integrate the features of different dimensions in the battery charging and discharging features to obtain global features.
[0089] Here, integrating features from different dimensions in battery charging and discharging characteristics can refer to converting a multidimensional data structure into a one-dimensional data structure. The fully connected layer maps the multidimensional features from different dimensions in battery charging and discharging characteristics to a low-dimensional space using trained parameters, obtaining global features for effective regression prediction.
[0090] Step S1032: Based on the regression module, perform regression prediction on the global features to obtain the health status of the battery under test.
[0091] In this embodiment, the regression module can use nonlinear activation functions (such as ReLU, sigmoid, or tanh), through linear combination and nonlinear activation functions, to map global features to the sample label space and generate the final SOH prediction result, i.e., the health status of the battery under test.
[0092] In the embodiments of this application, the prediction module composed of fully connected layers can effectively utilize multidimensional features to improve the accuracy and stability of SOH prediction.
[0093] In order to address the problem of significant differences between real vehicle data and model training data, this application employs adversarial learning to reduce the distance between training data and real vehicle data in the feature space, align the distribution of the two datasets, reduce the differences between the two datasets, and thus improve the generalization of model predictions. Figure 3 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Two ,like Figure 3 As shown, the training process of the battery state prediction model can be achieved through steps S301 to S304:
[0094] Step S301: The feature extraction module based on the pre-trained model extracts features from the source domain data to obtain source domain features; wherein, the source domain data is the charging and discharging data of the battery in the laboratory; the pre-trained model is trained using the source domain data.
[0095] In some embodiments, source domain data can refer to battery data in a laboratory setting, i.e., battery charge-discharge experimental data under experimental conditions. To cover different charging conditions of the battery as comprehensively as possible, embodiments of this application can collect source domain data from multiple sources. Source domain data can include multiple sets of sample data. Each set of sample data includes information such as current, voltage, state of charge (SOC), and temperature during a single charge or discharge cycle. For example, a set of sample data might show the battery charging from 20% SOC to 80% over one hour, with data collected every minute. This means a set of sample data has 60 data points, each including information such as voltage, current, SOC, and temperature at that moment. Each set of sample data also includes the sample SOH of the corresponding battery at the time the sample data was collected.
[0096] Here, the pre-trained model is obtained by training an initial model with residual modules based on convolutional neural networks (CNN) using source domain data. The initial model may include a feature extraction module consisting of 5 residual modules and a prediction module consisting of 2 fully connected layers. The 5 residual modules are used to extract features from the data, and the 2 fully connected layers are used to estimate the state of harmonics (SOH).
[0097] In some embodiments, the feature extraction module of the pre-trained model can be a CNN structure composed of multiple identical or different residual modules. Each residual module can be a Conv-BN-ReLU structure, i.e., composed of a convolutional layer (Conv), a batch normalization layer (BN), and an activation layer (ReLU). The specific combination and number are determined according to the requirements, for example, it can be... Figure 2 The structure is shown. By extracting features from the source domain data using the feature extraction module, source domain features can be obtained, which can characterize the features of the experimental data.
[0098] Here, the pre-trained model can be trained on source domain data, and the source domain data is significantly different from the target domain data when the battery is used in the car. Therefore, unsupervised transfer is needed to improve the generalization of the pre-trained model on real vehicle data, thereby improving the estimation accuracy of SOH.
[0099] Step S302: Based on the feature extraction module of the pre-trained model, feature extraction is performed on the target domain data to obtain target domain features; the target domain data is the charging and discharging data of the battery during use in electrical equipment.
[0100] In some embodiments, target domain data can refer to battery charging and discharging data during use in electrical devices, or actual vehicle charging and discharging data from daily vehicle use. Target domain data can come from different battery brands. A characteristic of actual vehicle data is that some data points may be lost, and outliers and noise may occur in the data collected by the BMS. Therefore, the distribution of target domain data differs significantly from that of source domain data, necessitating alignment of the distributions of source and target domain data to reduce the distance between them in the feature space.
[0101] In this embodiment of the application, the target domain data can be extracted using a feature extraction module to obtain target domain features, which can characterize the charging and discharging characteristics of the battery during actual use.
[0102] In some embodiments, the feature extraction module extracts features from the source domain data and the target domain data respectively, obtaining the source domain features f. s and target domain features f t As shown in formula (1):
[0103] f s ,f t =CNN([x s ,x t ]) (1);
[0104] Where, x s For source domain data, xt For the target domain data, CNN is the feature extraction module.
[0105] Step S303: Based on a discriminator with the same prediction module structure as the pre-trained model, the source domain features and the target domain features are discriminated to determine the degree of difference between the source domain data and the target domain data.
[0106] Here, the discriminator has the same structure as the prediction module of the pre-trained model. It is used to distinguish between source domain data and target domain data. It can consist of fully connected layers and normalization layers (i.e., softmax layers), or it can consist of multiple fully connected layers. The purpose of the discriminator is to distinguish which dataset the source domain features and target domain features come from, i.e., whether they are source domain data or target domain data. If the discriminator cannot distinguish them, it means that the difference between the source domain data and the target domain data is small; if it can distinguish them accurately, it means that the difference between the source domain data and the target domain data is large. In this case, it is necessary to perform adversarial training between the discriminator and the pre-trained model to update both the discriminator and the pre-trained model, so that the features extracted by the pre-trained model are indistinguishable to the discriminator.
[0107] Here, the discriminator classifies the source domain features and target domain features. Based on the classification results, the degree of difference between the source domain data and the target domain data can be obtained, that is, the distance between the two datasets in the feature space.
[0108] Step S304: Based on the degree of difference, update the model parameters of the pre-trained model to obtain the battery state prediction model.
[0109] Here, the battery state prediction model is used to predict the health status of the battery under test during use in electrical equipment based on the charge and discharge data of the battery under test.
[0110] In some embodiments, the parameters of the pre-trained model can be updated using adversarial learning to reduce the distance between the source and target domain data in the feature space and the distribution of the two datasets, thereby reducing the difference between the two datasets and enabling the updated model to perform better on real vehicle data, thus improving the generalization of model prediction.
[0111] The pre-trained model in this embodiment includes at least a feature extraction module and a prediction module. Adversarial learning is performed using source domain data and target domain data to optimize the feature extraction module of the pre-trained model. This optimizes the feature extraction module to extract corresponding features from the source and target domain data, making the introduced discriminator unable to distinguish between the two datasets. The pre-trained model and the discriminator optimize their respective loss functions adversarially to obtain the model update parameters of the pre-trained model. The model with these update parameters can map the source and target domain data to the same feature space, making the discriminator indistinguishable. This achieves the goal of reducing the difference between the two datasets and enabling the updated model to be applied to the target domain data.
[0112] In this embodiment, the discriminator aims to distinguish whether features originate from source domain data or target domain data. Therefore, it needs to maximize the degree of difference to update the discriminator's parameters. The feature extraction module, on the other hand, generates features that the discriminator cannot distinguish, thus requiring the degree of difference to be minimized to obtain the update parameters for the feature extraction module, i.e., the model update parameters of the pre-trained model. Based on these update parameters, the trained model is updated to obtain the battery state prediction model. The model update parameters can be parameters from the feature extraction module, such as bias parameters.
[0113] Here, adversarial training can be performed multiple times. After obtaining the model update parameters, the parameters in the feature extraction module and the prediction layer are updated based on the model update parameters to obtain the updated pre-trained model. Using source domain data and target domain data, adversarial training is performed again based on the updated pre-trained model to obtain new model update parameters. The parameters in the feature extraction module and the prediction module are updated again based on the new model update parameters until the number of iterations is reached to obtain the final model update parameters. The battery state prediction model is then updated based on the final model update parameters.
[0114] In some embodiments, the model parameters of the pre-trained model are updated based on the model update parameters. That is, the parameters and weights in the feature extraction module and prediction module of the pre-trained model are replaced by the model update parameters to obtain a battery state prediction model suitable for target domain data.
[0115] In some embodiments, after obtaining the battery state prediction model, the model can be deployed on the processor of an electrical device that uses a battery as a power source, such as a car processor or a BMS. The charging and discharging data of the battery under test can be the charging or discharging data of the battery used in the car, and can include voltage-time curves, current-time curves, SOC-time curves, and temperature-time curves. In some embodiments, the voltage-time curves, current-time curves, and temperature-time curves can be concatenated as input to the battery state prediction model. For example, the voltage-time curve, current-time curve, and temperature-time curve each have 60 data points collected at 60 time points, which are concatenated to form a 3*60 matrix as input to the model.
[0116] Here, the charge and discharge data are input into the battery state prediction model. The feature extraction module in the battery state prediction model extracts features from the charge and discharge data to obtain charge and discharge features. Based on the prediction module and the charge and discharge features, the SOH of the battery under test is estimated to obtain the predicted SOH of the battery under test.
[0117] In this embodiment, after obtaining the pre-trained model for predicting SOH, adversarial learning is performed using source domain data and target domain data to update the model parameters of the SOH pre-trained model. This aligns the distance between the source domain data and the target domain data in the feature space and the distribution of the two datasets, reducing the difference between the two datasets. The model provided by this embodiment can be applied to different datasets, improving the model's generalization ability. The updated battery state prediction model then predicts the SOH of the battery under test, improving the accuracy of the battery state prediction model in predicting the SOH of real vehicle data.
[0118] Step S303 in this embodiment can be implemented through steps S3031 and S3032:
[0119] Step S3031: Based on the discriminator, classify the source domain features and the target domain features to obtain the classification result.
[0120] In this embodiment, the discriminator δ(x) can consist of two fully connected layers, with the same structure as the prediction module in the pre-trained model. Source domain features and target domain features are input into the discriminator, which then distinguishes between them to determine the dataset category of the feature, such as whether it comes from source domain data or target domain data. The classification result output by the discriminator can be the probability that the source domain feature or target domain feature comes from source domain data. For example, if the discriminator classifies source domain data as 1 and target domain data as 0, the probability that the classification result is δ(x)≠0 is given.
[0121] In some embodiments, there may be multiple data points in the source domain data and the target domain data, resulting in multiple classification results. The probability output by the discriminator is the average of the probabilities of multiple source domain features originating from the source domain data and the average of the probabilities of multiple target domain features originating from the source domain data.
[0122] Step S3032: Based on the classification results and the preset algorithm, determine the degree of difference between the source domain data and the target domain data.
[0123] In some embodiments, after obtaining the probabilities that the source domain features and target domain features output by the discriminator originate from the source domain data, the difference between the source domain data and the target domain data is characterized by the difference between the probabilities of the source domain features originating from the source domain data and the probabilities of the target domain features originating from the source domain data. A greater degree of difference indicates that the discriminator can effectively distinguish between the source domain features and the target domain features, and that the distance between the source domain data and the target domain data is greater. Therefore, the degree of difference can be expressed by formula (2):
[0124]
[0125] Here, δ(x) is the newly introduced discriminator, which classifies source domain data as 1 and target domain data as 0. If the two datasets are significantly different, the discriminator can easily determine the category of each feature in the dataset; conversely, if the two datasets are very similar, the discriminator cannot distinguish them.
[0126] Here, the discriminator aims to distinguish between the source and target domains, so it needs to maximize the degree of difference to train the discriminator; the CNN aims to generate features that the discriminator cannot distinguish, so it needs to minimize the degree of difference to train the CNN.
[0127] This application embodiment classifies source domain features and target domain features using a discriminator to determine whether the discriminator can distinguish between these two types of data, thereby updating the pre-trained model, aligning the feature distributions of source domain features and target domain features, and improving the accuracy of SOH prediction.
[0128] Based on the foregoing embodiments, when updating the model parameters of the pre-trained model, both the parameters of the feature extraction module and the prediction module can be updated. Therefore, the battery state prediction method further includes obtaining the loss result of the pre-trained model. The loss result is obtained by the pre-trained model based on the source domain data. Here, after the pre-trained model is trained, the difference between the SOH predicted based on the source domain data and the actual SOH of the battery corresponding to the source domain data is the loss result. Based on this, step S304 can be implemented through steps S3041 to S3044:
[0129] Step S3041: Based on the degree of difference and the loss result, determine the model loss function of the pre-trained model and the discriminator loss function of the discriminator.
[0130] In some embodiments, the error in updating the parameters of the pre-trained model can be the sum of the error between the predicted SOH obtained after the source domain features are predicted by the prediction module of the pre-trained model and the actual SOH of the battery corresponding to the source domain features, and the degree of difference between the source domain data and the target domain data. That is, the model loss function of the pre-trained model is shown in Equation (3):
[0131]
[0132] in, The error between the predicted SOH and the true SOH is calculated by inputting source domain features into the prediction module. This represents the degree of difference between the source domain data and the target domain data. Here, when updating the parameters of the pre-trained model, the feature extraction module needs to generate features that the discriminator cannot distinguish. This requires minimizing the model loss function to obtain the updated parameters for the feature extraction module.
[0133] In some embodiments, the purpose of the discriminator is to distinguish whether a feature comes from source domain data or target domain data. Therefore, it is necessary to maximize the degree of difference to update the discriminator parameters. Thus, the discriminator loss function is as shown in Equation (4):
[0134]
[0135] Step S3042: With the goal of minimizing the model loss function and maximizing the discriminator loss function, determine the initial model update parameters of the pre-trained model and the initial discriminator update parameters of the discriminator.
[0136] In this embodiment, the initial model update parameters of the pre-trained model and the initial discriminator update parameters of the discriminator are determined with the objectives of minimizing the model loss function and maximizing the discriminator loss function. Based on the initial model update parameters, the model parameters and weights of the pre-trained model are updated to obtain the updated pre-trained model; similarly, the parameters and weights of the discriminator are updated using the initial discriminator update parameters to obtain the updated discriminator.
[0137] Here, during the adversarial training process between the pre-trained model and the discriminator, a gradient reversal layer (GRL) can be introduced after the feature extraction module to reverse the sign of the gradient passed from the discriminator to the generator (i.e., the feature extraction module), enabling the pre-trained model and the discriminator to be trained jointly and the parameters of the pre-trained model to be updated.
[0138] Step S3043: Based on the initial model update parameters and the initial discriminator update parameters, update the pre-trained model and the discriminator respectively to obtain the updated pre-trained model and the updated discriminator.
[0139] In this embodiment of the application, after obtaining the initial model update parameters and the initial discriminator update parameters, the parameters in the pre-trained model and the discriminator are replaced with the initial model update parameters and the initial discriminator update parameters to obtain the updated pre-trained model and the updated discriminator.
[0140] Step S3044: Based on the updated pre-trained model, determine the new degree of difference between the source domain data and the target domain data again, and based on the new degree of difference, update the updated pre-trained model and the updated discrimination again until the number of adversarial iterations is reached, and predict the battery state after the last update as the battery state prediction model.
[0141] In this embodiment, adversarial training requires multiple iterations to obtain initial model update parameters. Based on these parameters, the parameters in the feature extraction module and prediction layer are updated to obtain an updated pre-trained model. Using source and target domain data, adversarial training is performed again based on the updated pre-trained model and the updated discriminator to obtain new model update parameters. These new parameters are then used to update the parameters in the feature extraction and prediction modules again until the required number of iterations (e.g., 100) is reached. The update parameters of the last updated model are then determined as the final model update parameters. Based on these final model update parameters, a battery state prediction model is obtained.
[0142] This application embodiment uses source domain data and target domain data for adversarial learning. The pre-trained model and discriminator optimize the loss function in an adversarial manner, and update the parameters of the pre-trained model. The final battery state prediction model maps the source domain data and target domain data to the same feature space, which is indistinguishable by the discriminator. This achieves the goal of reducing the difference between the two datasets, thereby improving the generalization of the model prediction and enhancing the accuracy of the battery state prediction model in predicting SOH based on real vehicle data.
[0143] After obtaining a battery state prediction model with a feature extraction module and a prediction module, the embodiments of this application can predict the SOH of batteries used in any electrical device.
[0144] In some embodiments, the pre-trained model is trained based on source domain data. Figure 4 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Three ,likeFigure 4 As shown, in this embodiment of the application, training a pre-trained model using source domain data can be achieved through steps S401 to S406:
[0145] Step S401: Process the sample charge and discharge data to obtain processed charge and discharge data; the source domain data includes at least the sample charge and discharge data of the battery and the sample battery state.
[0146] Here, source domain data can refer to data collected from the laboratory, including sample charge and discharge data (including sample voltage, sample current, and sample temperature data collected in the laboratory during charge and discharge) and sample battery state (i.e., the SOH of the battery corresponding to the sample charge and discharge data).
[0147] In some embodiments, data processing may include at least data preprocessing and data augmentation to obtain processed charge-discharge data. Data preprocessing may involve normalizing the mean and variance of the current, voltage, and temperature for each sample of charge-discharge data to map data from different charging behaviors to the same scale, avoiding the influence of outlier data and improving the model's generalization ability on test data.
[0148] Real-world vehicle data is characterized by the presence of some missing data points, outliers, and noise. Data augmentation involves randomly perturbing the sample charge-discharge data to simulate data disturbances in a real-world vehicle environment, thereby enhancing the sample charge-discharge data and improving its generalization ability.
[0149] Step S402: Input the processed charge and discharge data into the initial pre-trained model; the initial pre-trained model includes an initial feature extraction module and an initial prediction module;
[0150] In some embodiments, the initial pre-trained model can be a CNN-based residual module, including an initial feature extraction module and an initial prediction module. The initial feature extraction module can consist of five identical or different residual modules, and the initial prediction module can consist of two fully connected layers. The five residual modules are used to extract features from the original data, and the two fully connected layers are used to estimate the SOH.
[0151] Step S403: Based on the initial feature extraction module, perform feature extraction on the processed charge and discharge data to obtain pre-trained features.
[0152] In some embodiments, the source domain data can be sample data spliced together from sample voltage, sample current and sample temperature. The initial feature extraction module extracts features from the sample data to obtain pre-trained features.
[0153] Step S404: Based on the initial prediction module, predict the battery state of the pre-trained features to obtain the predicted battery state.
[0154] In some embodiments, the battery state is predicted based on the pre-trained features by the initial prediction module to obtain the predicted battery state, i.e., the predicted SOH.
[0155] Step S405: Input the predicted battery state and the sample battery state into a preset loss model to obtain the loss result.
[0156] In some embodiments, the preset loss model includes a least squares loss function, as shown in Equation (5):
[0157]
[0158] in, For each sample data point, the corresponding SOH value of the battery is given. pred The predicted SOH value of the battery corresponding to each sample data.
[0159] The distance between the predicted SOH value and the sample SOH value is calculated using the least squares loss function shown in formula (5). Based on the distance, the similarity between the predicted SOH value and the sample SOH value is determined. Here, the larger the distance, the smaller the similarity between the predicted SOH value and the sample SOH; the smaller the distance, the larger the similarity between the predicted SOH value and the sample SOH. The similarity is determined as the loss result of the model.
[0160] Step S406: Based on the loss result, correct the model parameters of the initial feature extraction module and the initial prediction module to obtain the pre-trained model.
[0161] In some embodiments, iterative training is required when training the pre-trained model; therefore, step S406 can be implemented through steps S4061 to S4064.
[0162] Step S4061: Based on the loss result, perform initial correction on the model parameters of the initial feature extraction module and the initial prediction module to obtain the corrected pre-trained model.
[0163] Here, after obtaining the loss result, the model parameters of the initial feature extraction module and the initial prediction module are initially corrected to obtain the corrected pre-trained model.
[0164] Step S4062: Based on the corrected pre-trained model, predict the processed charge and discharge data again to obtain a new predicted battery state.
[0165] Step S4063: Input the new predicted battery state and the sample battery state into the preset loss model to obtain a new loss result.
[0166] Step S4064: Based on the new loss result, the model parameters of the initial feature extraction module and the initial prediction module are corrected again until the number of pre-training iterations is reached, and the battery state after the last update is predicted as the pre-trained model.
[0167] Here, based on the corrected pre-trained model, the SOH prediction is performed again on the processed charge and discharge data to obtain a new predicted battery state. The new predicted battery state and the sample battery state are then input into a preset loss model to obtain a new loss result. Based on the new loss result, the model parameters of the corrected pre-trained model are corrected again to obtain a new corrected pre-trained model. This process continues until the number of pre-training iterations is reached (e.g., 100 times), and the battery state after the last update is predicted as the pre-trained model.
[0168] In the embodiments of this application, the initial model is modified based on the loss result, thereby achieving pre-training of the initial model and obtaining a pre-trained model that can accurately predict on source domain data.
[0169] This application embodiment trains a base model for SOH prediction based on source domain data, enabling the pre-trained model to predict SOH, thereby achieving SOH prediction.
[0170] In some embodiments, the data acquisition process in real vehicles is subject to various environmental and conditional limitations, such as vehicle operating status, road conditions, and sensor malfunctions, resulting in inconsistent data quality. For example, the data may contain outliers, missing values, and sampling noise from the BMS. However, the data used for training is of higher quality, causing discrepancies between training and inference. To address this issue, this application proposes a random data augmentation scheme that randomly perturbs the training data during training, including randomly discarding a portion of the simulated missing data and adding noise to simulate BMS sampling noise. Figure 5 This is an optional flowchart illustrating the battery state prediction method provided in the embodiments of this application. Figure Four ,like Figure 5 As shown, in this embodiment of the application, the random enhancement of data, i.e., step S402, can be implemented through steps S501 to S503:
[0171] Step S501: Normalize the sample charge and discharge data to obtain normalized data.
[0172] In some embodiments, different users exhibit different charging behaviors, such as choosing constant current charging or stepped charging, the magnitude of the charging rate, and the depth of the State of Charge (SOC). Different charging rates can lead to significant differences in the magnitude of the charging current and the temperature. To mitigate the differences in charging conditions, this embodiment of the application can perform mean-variance normalization on the current, voltage, and temperature of each training sample, as shown in formula (6):
[0173]
[0174] Where x is each data point in a current, voltage, or temperature sequence in a sample dataset; μ(x) represents the mean of the sequence, and σ(x) represents the variance of the sequence.
[0175] The embodiments of this application demonstrate that normalizing each sample individually can significantly improve the model's generalization ability on test data.
[0176] Step S502: Generate random probabilities corresponding to the normalized data based on a preset random probability generation algorithm.
[0177] In some embodiments, in order to randomly perturb the training data during training, each training data point needs to be assigned a random probability to perform random data augmentation based on the random probability.
[0178] Step S503: Based on the random probability, perform random data augmentation on the normalized data to obtain the processed charge and discharge data.
[0179] In some embodiments, random data augmentation may include at least several data processing steps such as random pruning, random missing data, random replacement, and adding noise, as well as the execution conditions corresponding to each data processing step. Therefore, step S503 can also be implemented through step S1:
[0180] Step S1: Based on the comparison results between the random probability and the execution conditions corresponding to each data processing step, the normalized data is randomly pruned, randomly missing, randomly replaced, and noise is added in sequence to obtain the processed charge and discharge data.
[0181] In this embodiment, each data processing step corresponds to an execution condition. When the random probability meets the execution condition, the data processing step is executed; otherwise, the data processing step is skipped, and the next data processing step is executed, until the execution conditions corresponding to random cropping, random missing, random replacement, and noise addition are judged in sequence to obtain the processed charging and discharging data.
[0182] In some embodiments, each of the multiple data processing steps has a certain probability of being executed and a certain probability of being ignored. For example, the execution probabilities of the four steps can be set to 0.9, 0.3, 0.1, and 0.4, respectively, and the execution probabilities can be set according to requirements. When normalized data is randomly augmented, a random probability corresponding to that training data is generated. Based on the comparison between the random probability and each execution probability, the steps for data augmentation of the training data are determined.
[0183] In some embodiments, step S1 can be implemented by steps S11 to S15:
[0184] Step S11: In response to the random probability satisfying the first execution condition, determine the random pruning ratio of the normalized data, and perform random pruning processing on the normalized data based on the random pruning ratio to obtain pruned data.
[0185] In some embodiments, predicting low-charge-depth data is more difficult than predicting high-charge-depth data. Therefore, model training should focus more on low-charge-depth data, and low pruning ratios should occur more frequently. To achieve this goal, this application proposes an importance sampling method. First, a series of pruning ratios are constructed, such as [0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9]. The pruning ratio is used to determine the pruned portion of the training data. For example, 0.5 means that the normalized data retains the top 50% of the data. The lower the pruning ratio, the lower the charge-depth of the data after pruning. Therefore, during training, it is desirable for low pruning ratios to occur more frequently to retain more training data with low charge-depth.
[0186] To increase the frequency of low cropping ratios, a value-related weight can be assigned to each ratio. The weights can be achieved using formula (7):
[0187] w r =e -λr (7);
[0188] Where r is the current cropping ratio, and λ is the parameter to be set. The larger the value of λ, the more uniform the sampling distribution; the smaller the value of λ, the more uneven the sampling distribution.
[0189] Based on formula (7), the probability value of sampling for each cutting ratio is obtained as formula (8):
[0190]
[0191] Based on the above formula (8), the lower the cutting ratio, the greater the probability of being allocated.
[0192] Here, the first execution condition can be that the random probability is less than 0.9. When the random probability meets the first execution condition, the random pruning ratio is determined. Based on the probability value of the pruning ratio sampling, a random probability is randomly selected to randomly prune the normalized data to obtain the pruned data.
[0193] Step S12: In response to the random probability satisfying the second execution condition, perform random missing data processing on the cropped data to obtain missing data.
[0194] The second execution condition can be that the random probability is less than 0.3. When the random probability meets the second execution condition, 5% of the clipped data is randomly discarded, and the two ends after the discard are spliced together to obtain the missing data.
[0195] Step S13: In response to the random probability satisfying the third execution condition, the missing data is randomly replaced based on the random anomaly coefficient to obtain abnormal data.
[0196] The third execution condition can be that the random probability is less than 0.1. When the random probability meets the third execution condition, 5% of the missing data is replaced with outliers to obtain outlier data. Here, the outlier is obtained by multiplying the current 5% of missing data by a coefficient α, where α ~ U(0.2, 1.5), that is, α is any value from 0.2 to 1.5.
[0197] Step S14: In response to the random probability satisfying the fourth execution condition, noise is added to the abnormal data to obtain the processed charge and discharge data.
[0198] The third execution condition can be that the random probability is less than 0.4. When the random probability satisfies the fourth execution condition, Gaussian noise ∈ is added to the abnormal data to obtain the source domain data. Where ∈ ~ N(0, 0.01). That is, the Gaussian noise is noise data with a mean of 0 and a variance of 0.01.
[0199] Step S15: In response to the random probability not satisfying the execution condition corresponding to any data processing step, skip any data processing step and proceed to the next data processing step until the processed charge and discharge data is obtained.
[0200] In some embodiments, if the random probability does not meet the execution condition corresponding to any data processing step, the data processing step is skipped and the next data processing step is performed. For example, if the random probability is 0.5 and less than 0.9, the first execution condition is not met, so the normalized data is not randomly pruned. It is then determined whether the random probability meets the second execution condition. If 0.5 is greater than 0.3, the normalized data is randomly missing.
[0201] In this embodiment of the application, the training data is randomly perturbed during model pre-training to simulate the data conditions of real vehicle scenarios. This not only makes the algorithm of the pre-trained model closer to real vehicle data, but also further expands the dataset to reduce overfitting.
[0202] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0203] In real-world vehicle scenarios, obtaining accurate State of Harm (SOH) annotations is extremely challenging due to the stringent conditions required by the technology. Users typically need to perform slow charging and discharging of the battery and allow it to rest for an extended period, making it nearly impossible to obtain annotations in real-world environments. Even transfer learning, requiring only a small number of samples, is difficult to deploy. Furthermore, data collection in real-world vehicles is subject to various environmental and conditional limitations, such as vehicle operating status, road conditions, and sensor malfunctions, leading to unstable and inconsistent data quality. This results in significant differences between the data used for model training and the data distribution in real-world scenarios, compromising the generalization ability of the model algorithm. Finally, the charging depth in real-world vehicle data exhibits significant variance due to variations in user charging habits, resulting in low accuracy in SOH estimation at different charging depths.
[0204] To address the problems existing in related technologies, this application proposes an unsupervised transfer algorithm framework based on adversarial learning, including pre-training and unsupervised transfer steps. The purpose of pre-training is to train a base model for SOH estimation. This model is a neural module with a CNN structure, which takes the battery's current, voltage, and temperature as input and outputs an estimated value of SOH.
[0205] After pre-training, the model possesses the ability to predict SOH (State of Health). However, due to the differences between training data and real-vehicle data, the model's generalization ability on real-vehicle data cannot be guaranteed. Unsupervised transfer learning aims to improve the model's generalization ability on real-vehicle data, thereby improving the estimation accuracy of SOH. Since there is no labeled real-vehicle data, traditional fine-tuning methods cannot be used to adjust the model. Therefore, this application uses adversarial learning to reduce the distance between training data and real-vehicle data in the feature space, align the distributions of the two datasets, reduce the differences between the two datasets, and thus improve the model's predictive generalization ability. The method provided in this application effectively avoids the problem of fine-tuning with labels required for transfer learning, improving the algorithm's practicality in different scenarios.
[0206] In some embodiments, the data acquisition process in real vehicles is subject to various environmental and conditional limitations, such as vehicle operating status, road conditions, and sensor malfunctions, resulting in inconsistent data quality. For example, the data may contain outliers, missing values, or sampling noise from the BMS. Meanwhile, the data used for training is of higher quality, causing data discrepancies between model training and inference. To address this issue, this application proposes a random data augmentation scheme. First, during training, the training data is randomly perturbed, including randomly discarding a portion of the simulated missing data and adding noise to simulate BMS sampling noise. Second, real vehicle data has a shallow charging depth and high variance, while training data has a more uniform charging depth, generally greater than 50%. This application employs random pruning technology to simulate the low charging depth and high variance scenario of real vehicles. For a sample, a segment is randomly pruned at a certain proportion for training. In this way, a single sample can generate training data with different charging depths, thereby simulating real vehicle scenarios. Furthermore, it can further expand the dataset and mitigate overfitting. For the random pruning strategy, since low charging depth is more difficult to predict than high charging depth, this paper proposes an importance sampling method, which enables the training process to focus more on low charging depth, thereby improving the accuracy of low charging depth SOH estimation in real vehicle scenarios.
[0207] The embodiments of this application can improve the accuracy of SOH estimation in unlabeled real vehicle scenarios, and also improve the generalization ability of the SOH model in real vehicle scenarios; it can also improve the accuracy of SOH estimation for low charging depth data.
[0208] Figure 6 This is a schematic diagram of the unsupervised adversarial learning process of the SOH model provided in this application embodiment. The unsupervised adversarial learning of the SOH model mainly consists of three steps: data processing, pre-training, and unsupervised adversarial learning. Data processing can be implemented through steps S601 and S602; pre-training can be implemented through steps S603 to S605; and unsupervised adversarial learning can be implemented through steps S606 and S607.
[0209] S601, Collect data.
[0210] In some embodiments, the data are the source domain data and target domain data in the foregoing embodiments. In order to make the training data cover the working conditions of different charging depths and charging conditions as much as possible, this application collects data from multiple sources for training, including data from laboratories (i.e., source domain data) and charging records from real vehicles of different brands (i.e., target domain data).
[0211] S602. Preprocess the data to obtain training data.
[0212] In some embodiments, different users exhibit different charging behaviors, such as choosing constant current charging or stepped charging, the magnitude of the charging rate, and the depth of the State of Charge (SOC). Different charging rates can lead to significant differences in the magnitude of the charging current and the temperature. To mitigate the differences in charging conditions, this application embodiment can perform mean-variance normalization on the current, voltage, and temperature of each training sample, as shown in formula (9):
[0213]
[0214] Where x is each data point in a current, voltage, or temperature sequence in a sample dataset; μ(x) represents the mean of the sequence, and σ(x) represents the variance of the sequence.
[0215] The embodiments of this application demonstrate that normalizing each sample individually can significantly improve the model's generalization ability on test data.
[0216] S603. Randomly augment the training data to obtain augmented training data.
[0217] In some embodiments, real-vehicle data is characterized by the presence of some missing data points, outliers, and noise. Therefore, training data with random perturbations should be used during model training. Thus, the process of perturbing the original data through data augmentation to simulate real-vehicle data can simulate the perturbations in the real-vehicle environment, thereby enhancing the dataset and improving generalization.
[0218] In this embodiment, data augmentation may include several steps such as random pruning, random missing data, random anomalies, and random noise. Each step has a certain probability of being executed and a certain probability of being ignored. For example, the execution probabilities of the four steps can be set to 0.9, 0.3, 0.1, and 0.4, respectively. When random augmentation is performed on a training data set, a random probability corresponding to that training data is generated. Based on the comparison between the random probability and each execution probability, the steps for data augmentation of the training data are determined. Figure 7 This is a schematic diagram of the data enhancement process provided in the embodiments of this application, such as... Figure 7 As shown, data augmentation can be achieved through steps S701 to S710:
[0219] S701, Obtain the data augmentation probability of the training data.
[0220] In some embodiments, the data augmentation probability p of the training data is randomly generated and is any number between 0 and 1, for example, p is 0.5.
[0221] S702. Determine whether the probability of data augmentation is less than 0.9.
[0222] Here, the execution probability of random pruning is 0.9. The determination of whether to perform random pruning on the training data is based on whether the data augmentation probability is less than 0.9. If it is less than 0.9, step S704 is executed; if it is greater than or equal to 0.9, step S705 is executed.
[0223] S703, Obtain the sampling clipping rate of the training data.
[0224] In some embodiments, random pruning aims to extract data with low charging depth from the training data to simulate low charging depth conditions in a real-world vehicle environment. During each execution, the training data is pruned by setting a random pruning ratio to obtain pruned current, voltage, and temperature segments.
[0225] However, predicting data with low charging depth is more difficult than predicting data with high charging depth. Therefore, model training should focus more on low charging depth, and thus low pruning ratios should occur more frequently. To achieve this goal, this application proposes an importance sampling method. First, a series of pruning ratios [0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9] are constructed. The pruning ratio is used to determine the pruned portion of the training data. For example, 0.5 means that the training data retains the first 50% of the data. The lower the pruning ratio, the lower the charging depth of the pruned data. Therefore, during training, it is desirable for low pruning ratios to occur more frequently to retain more training data with low charging depth.
[0226] To increase the frequency of low cropping ratios, a value-related weight can be assigned to each ratio. The weight can be achieved using formula (10):
[0227] w r =e -λr (10);
[0228] Where r is the current cropping ratio, and λ is the parameter to be set. The larger the value of λ, the more uniform the sampling distribution; the smaller the value of λ, the more uneven the sampling distribution.
[0229] Based on formula (10), the probability value of sampling for each cutting ratio is obtained as formula (11):
[0230]
[0231] Based on the above formula (11), the lower the cutting ratio, the higher the probability value, and the greater the probability of being allocated.
[0232] S704. Perform random cropping of the training data.
[0233] Based on the sampling pruning rate, the training data is randomly pruned, and for each training data point, a data augmentation probability is randomly assigned, and the above steps are performed.
[0234] S705. Determine whether the probability of data augmentation is less than 0.3.
[0235] In some embodiments, after randomly cropping the training data, it is determined whether the data augmentation probability is less than 0.3. If it is less than 0.3, step S706 is executed; if it is greater than or equal to 0.3, step S707 is executed.
[0236] S706. Perform random missing data processing on the training data.
[0237] In some embodiments, random missing data processing refers to discarding 5% of the data and then piecing together the two ends after the discarding.
[0238] S707. Determine whether the probability of data augmentation is less than 0.1.
[0239] In some embodiments, after randomly missing training data, it is determined whether the data augmentation probability is less than 0.1. If it is less than 0.1, step S708 is executed; if it is greater than or equal to 0.1, step S709 is executed.
[0240] S708. Perform random anomaly processing on the training data.
[0241] In some embodiments, random anomaly handling may refer to replacing 5% of the data with outliers by multiplying 5% of the values in the current training data by a coefficient α, where α ~ U(0.2, 1.5), that is, α is any value from 0.2 to 1.5.
[0242] S709. Determine whether the probability of data augmentation is less than 0.4.
[0243] In some embodiments, after random anomaly processing of the training data, it is determined whether the data augmentation probability is less than 0.4. If it is less than 0.4, step S710 is executed; if it is greater than or equal to 0.4, the data augmentation ends.
[0244] S710, Perform random noise processing on the training data.
[0245] In some embodiments, random noise processing of training data can refer to adding Gaussian noise ∈, ∈ ~ N(0, 0.01) to the data with a certain probability. That is, Gaussian noise is noise data with a mean of 0 and a variance of 0.01.
[0246] In some embodiments, after performing steps S701 to S710, enhanced training data is obtained.
[0247] S604, Model training based on augmented data.
[0248] In some embodiments, the SOH model proposed in this application is a residual module based on Convolutional Neural Networks (CNN). Figure 8 This is a schematic diagram of the SOH model provided in the embodiments of this application, as shown below. Figure 8 As shown, the SOH model consists of 5 residual modules and 2 fully connected layers. The 5 residual modules are used to extract features from the original data, and the 2 fully connected layers are used to estimate the SOH.
[0249] In this embodiment, the SOH model consists of a first residual module 801, a second residual module 802, a third residual module 803, a fourth residual module 804, a fifth residual module 805, a first fully connected layer 806, and a second fully connected layer 807 connected sequentially. The structures of the different residual modules and fully connected layers may be the same or different. The structure of the residual module is as follows: Figure 8 As shown, it consists of a first convolutional layer 8011, a first normalization layer 8012, a first activation layer 8013, a second convolutional layer 8014, a second normalization layer 8015, a third convolutional layer 8016, a third normalization layer 8017, and a second activation layer 8018.
[0250] In this embodiment of the application, the model prediction of SOH can be expressed mathematically as formula (12):
[0251] S pred =FC(CNN([V,I,T])) (12);
[0252] Among them, S pred The SOH value predicted by the model is given by , where V, I, and T represent the voltage, current, and temperature curves, respectively. [,] indicates the splicing operation, CNN represents the CNN part of the model, and FC represents the fully connected layer part of the model.
[0253] The SOH model optimizes the model parameters by minimizing the least squares loss, and the loss function is shown in Equation (13):
[0254]
[0255] in, It is the sample SOH value for each training data point.
[0256] The embodiments of this application use CNN as the basic structure. Through the parameter sharing mechanism of convolution, the overall number of parameters and computation of CNN is small, making it easy to deploy on the edge. Moreover, CNN is good at capturing local changes in data and can effectively extract the feature of current jump in stepped charging.
[0257] S605. Has the training reached the specified number of iterations?
[0258] In this embodiment, the model pre-training optimizes the parameters of the pre-trained model using the loss function of formula (13), and stops training after reaching the required number of iterations. Here, the number of iterations is set by the technician and can be 100.
[0259] S606 uses adversarial learning based on real vehicle data, training data, and pre-trained models to achieve unsupervised training.
[0260] In this embodiment, unsupervised training aims to reduce the gap between the distribution of training data and real-vehicle data, thereby enabling the SOH algorithm to generalize to real-vehicle data. Related technologies utilize a small amount of real-vehicle data to fine-tune the model; however, in most real-vehicle scenarios, obtaining labeled data is difficult. Therefore, this application employs an unsupervised method for model transfer. After unsupervised transfer, the distribution of training data and real-vehicle data in the feature space becomes closer, allowing the SOH algorithm to provide more accurate predictions. Figure 9 This is a schematic diagram of dataset alignment during adversarial learning provided in an embodiment of this application, as shown below. Figure 9 As shown, after adversarial learning, the data distribution in the feature space of the source domain 901 and the target domain 902 will be more similar.
[0261] The unsupervised adversarial learning proposed in this application utilizes the idea of domain adaptation. The model is trained on the source dataset, and the prediction error on the target dataset can be expressed as formula (14):
[0262] ∈ T (h)≤∈ S (h)+[∈ S (h * )+∈ T (h * )]+[∈ S (h,h * )-∈ T (h,h * (14)
[0263] Where h is the current pre-trained model, ∈ T (h) represents the model error on the target dataset, which is the real vehicle data, ∈ S (h) represents the test error of model h on the source data, [∈ S (h * )+∈ T (h * [ ] represents the error of the optimal model (the SOH model after adversarial learning) on the source and target data, respectively. S(h,h * )-∈ T (h,h * The first term ∈ represents the discrepancy between the source and target domains (i.e., the difference in predictions caused by the different data features in the two domains). S (h) Once the model is pre-trained, it can be determined that the second term can assume that the error of the optimal model on both datasets is 0, that is, the error of the second term is also 0.
[0264] Therefore, the magnitude of the error of the SOH model on the target data depends on the last term, the divergence; the smaller the divergence, the smaller the error of the model on the target data. Thus, optimizing the error of the SOH model on the target data can be transformed into minimizing the upper bound of the divergence, i.e., the error of the SOH model on the target data can be expressed by formula (15):
[0265]
[0266] Where sup represents the upper bound of the function, the above formula (15) can be equivalent to minimizing the following binary classification loss, as shown in formula (16):
[0267]
[0268] Here, δ(x) is the newly introduced discriminator, which classifies the source data as 1 and the target data as 0. If the two datasets are significantly different, the discriminator can easily determine the category of each dataset; conversely, if the two datasets are very different, the discriminator cannot distinguish them, thus reducing the discriminant term. Therefore, the discriminator aims to find the upper bound of the discriminant term, and thus needs to maximize the discriminant term. The loss function of the discriminator is shown in formula (17):
[0269]
[0270] The SOH estimation model must minimize the upper bound of the difference divergence, and the extracted features must be indistinguishable between the two datasets. Therefore, it is necessary to minimize the difference divergence, as shown in formula (18):
[0271]
[0272] Figure 10 This is a schematic diagram of the adversarial training process of the SOH model provided in the embodiments of this application, as follows: Figure 10 As shown, the training data and real vehicle data are respectively fed into the CNN module 101 of the SOH model to obtain the source domain data features f. s and target domain data features f t Source domain data features f sThe prediction process proceeds to SOH prediction head 102 to obtain the predicted SOH. Then, based on the loss function of the SOH model, the prediction loss, i.e., the SOH error, is obtained. Source domain data features f s and target domain data features f t Entering the discriminator 103, the difference discrepancy between the source domain and the target domain is calculated. The SOH estimation model needs to minimize the SOH error and minimize the difference discrepancy, while the discriminator maximizes the difference discrepancy. This allows the discriminator and the generator (i.e., the CNN module) to be jointly trained, and finally the adversarial learning-adversarial SOH model is obtained.
[0273] In some embodiments, This indicates optimization of the CNN module in the SOH estimation model. This demonstrates that the CNN must extract common features from both the source and target data, making them indistinguishable to the discriminator. The SOH estimation model and the discriminator optimize the loss function adversarially. Ultimately, the SOH estimation model maps the source and target data to the same feature space, making them indistinguishable and thus reducing the difference between the two datasets.
[0274] In some embodiments, firstly, the CNN module of the SOH estimation model extracts features from the source and target domain data, as shown in Equation (19):
[0275] f s ,f t =CNN([x s ,x t ]) (19);
[0276] Next, the source domain features are input into the fully connected layer and the discriminator for estimation, as shown in Equation (20):
[0277] S pred =FC(f s (20);
[0278] Next, the source domain features and target domain features are input into the discriminator to calculate the difference divergence, as shown in formula (21):
[0279]
[0280] Next, the SOH estimation model needs to minimize the SOH error and minimize the difference divergence, i.e., the generator loss function is shown in Equation (22):
[0281]
[0282] Next, the discriminator needs to maximize the difference divergence, i.e., the loss function of the discriminator is shown in Equation (23):
[0283]
[0284] Here, in the actual training process, a gradient reversal layer (GRL) is introduced in the feature extraction part to reverse the sign of the gradient passed from the discriminator to the generator, so that the SOH estimation model and the discriminator can be trained together to update the parameters of the pre-trained model.
[0285] S607. Has the unsupervised training reached the specified number of iterations?
[0286] In this embodiment of the application, when the unsupervised training reaches a specified number of iterations, the training is stopped, and the adversarially trained SOH model is obtained.
[0287] The embodiments of this application can improve the accuracy of SOH estimation in unlabeled real vehicle scenarios, improve the generalization ability of the model in test driving scenarios, and improve the accuracy of SOH estimation of the model for low charging depth data.
[0288] Based on the foregoing embodiments, this application provides a battery state prediction device. The device includes various units and modules included in each unit. It can be implemented by a processor in an electrical device or by a BMS; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0289] Figure 11 This is a schematic diagram of the composition structure of a battery state prediction device provided in an embodiment of this application, as shown below. Figure 11 As shown, the battery state prediction device 110 includes: an acquisition module 111, a feature extraction module 112, and a battery state prediction module 113, wherein:
[0290] The first feature extraction module 111 is used to acquire the charge and discharge data of the battery under test; the feature extraction module 112 is used to extract features from the charge and discharge data through the feature extraction module in the trained battery state prediction model to obtain battery charge and discharge features; the battery state prediction module 113 is used by the prediction module in the battery state prediction model to predict the battery state based on the battery charge and discharge features to obtain the health state of the battery under test; wherein, the parameters of the battery state prediction model are based on a discriminator with the same structure as the prediction module, and are adjusted for the loss value corresponding to the classification results when classifying the battery using the charge and discharge features corresponding to the battery charge and discharge data in the laboratory and the battery using the charge and discharge features in the electrical equipment.
[0291] In some embodiments, the feature extraction module includes at least one residual module, the residual module including at least a first feature extraction module, a second feature extraction module, and an activation module; the feature extraction module 112 is further configured to obtain nonlinear features of the charge-discharge data by performing nonlinear feature extraction on the charge-discharge data through the first feature extraction module; obtain local features of the charge-discharge data by performing local feature extraction on the charge-discharge data through the second feature extraction module; perform feature fusion on the nonlinear features and the local features to obtain fused features; and perform nonlinear activation on the fused features through the activation module to obtain the battery charge-discharge features.
[0292] In some embodiments, the prediction module includes at least a feature integration module and a regression module; the battery charge and discharge features include features of at least one of the following dimensions: current, voltage, and temperature; the battery state prediction module 113 is further configured to integrate features of different dimensions in the battery charge and discharge features based on the feature integration module to obtain global features; and to perform regression prediction on the global features based on the regression module to obtain the health state of the battery under test.
[0293] In some embodiments, the battery state prediction device 110 further includes: a first feature extraction module, used to extract features from source domain data based on a feature extraction module of a pre-trained model to obtain source domain features; wherein the source domain data is battery charging and discharging data in a laboratory; the pre-trained model is trained using the source domain data; a second feature extraction module, used to extract features from target domain data based on the feature extraction module of the pre-trained model to obtain target domain features; the target domain data is battery charging and discharging data during use in electrical equipment; a discriminator with the same prediction module structure as the pre-trained model is used to discriminate the source domain features and the target domain features, the discriminator module being used to determine the degree of difference between the source domain data and the target domain data; and an update module, used to update the model parameters of the pre-trained model based on the degree of difference to obtain the battery state prediction model.
[0294] In some embodiments, the discrimination module is further configured to classify the source domain features and the target domain features based on the discriminator to obtain a classification result; and to determine the degree of difference between the source domain data and the target domain data based on the classification result and a preset algorithm.
[0295] In some embodiments, the battery state prediction device 110 further includes: a first acquisition module, configured to acquire the loss result of the pre-trained model; the loss result is obtained by the pre-trained model based on the source domain data; correspondingly, the update module 114 is further configured to determine the model loss function of the pre-trained model and the discriminator loss function of the discriminator based on the degree of difference and the loss result; determine the initial model update parameters of the pre-trained model and the initial discriminator update parameters of the discriminator with the goal of minimizing the model loss function and maximizing the discriminator loss function; update the pre-trained model and the discriminator respectively based on the initial model update parameters and the initial discriminator update parameters to obtain the updated pre-trained model and the updated discriminator; determine the new degree of difference between the source domain data and the target domain data again based on the updated pre-trained model, and update the updated pre-trained model and the updated discriminator again based on the new degree of difference, until the number of adversarial iterations is reached, and predict the battery state after the last update as the battery state prediction model.
[0296] In some embodiments, the battery state prediction device 110 further includes: a data processing module for processing sample charge-discharge data to obtain processed charge-discharge data; the source domain data includes at least sample charge-discharge data and sample battery state; an input module for inputting the processed charge-discharge data into an initial pre-trained model; the initial pre-trained model includes an initial feature extraction module and an initial prediction module; a feature extraction module for extracting features from the processed charge-discharge data based on the initial feature extraction module to obtain pre-trained features; a battery state prediction module for predicting battery state based on the pre-trained features based on the initial prediction module to obtain a predicted battery state; an input module for inputting the predicted battery state and the sample battery state into a preset loss model to obtain a loss result; and a correction module for correcting the model parameters of the initial feature extraction module and the initial prediction module based on the loss result to obtain the pre-trained model.
[0297] In some embodiments, the correction module is further configured to perform an initial correction on the model parameters of the initial feature extraction module and the initial prediction module based on the loss result, to obtain a corrected pre-trained model; based on the corrected pre-trained model, to predict the processed charge and discharge data again, to obtain a new predicted battery state; to input the new predicted battery state and the sample battery state into a preset loss model, to obtain a new loss result; and to correct the model parameters of the initial feature extraction module and the initial prediction module again based on the new loss result, until the number of pre-training iterations is reached, and to predict the battery state after the last update as the pre-trained model.
[0298] In some embodiments, the data processing module is further configured to normalize the sample charge-discharge data to obtain normalized data; generate random probabilities corresponding to the normalized data based on a preset random probability generation algorithm; and perform random data augmentation on the normalized data based on the random probabilities to obtain the processed charge-discharge data.
[0299] In some embodiments, the random data augmentation includes multiple data processing steps, each data processing step corresponding to an execution condition; the data processing module is further configured to, based on the comparison result between the random probability and the execution condition corresponding to each data processing step, sequentially perform random cropping, random deletion, random replacement and noise addition on the normalized data to obtain the processed charge and discharge data.
[0300] In some embodiments, the data processing module is further configured to: determine a random pruning ratio for the normalized data in response to the random probability satisfying a first execution condition; perform random pruning processing on the normalized data based on the random pruning ratio to obtain pruned data; perform random missing processing on the pruned data in response to the random probability satisfying a second execution condition to obtain missing data; perform random replacement processing on the missing data based on a random anomaly coefficient in response to the random probability satisfying a third execution condition to obtain abnormal data; and add noise to the abnormal data in response to the random probability satisfying a fourth execution condition to obtain the processed charge / discharge data.
[0301] In some embodiments, the data processing module is further configured to skip any data processing step and proceed to the next data processing step in response to the random probability not satisfying the execution condition corresponding to any data processing step, until the processed charge and discharge data is obtained.
[0302] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided in this disclosure can be used to perform the methods described in the method embodiments above. For technical details not disclosed in the apparatus embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0303] It should be noted that, in the embodiments of this application, if the above-mentioned battery state prediction method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a module device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.
[0304] This application provides an electrical device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.
[0305] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.
[0306] This application provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs some or all of the steps in the above-described method.
[0307] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0308] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0309] This application uses terms such as "upper," "lower," "top," "bottom," "front," "back," "inner," and "outer" to indicate orientation or positional relationships. This is only for the convenience of describing this application and is not intended to indicate or imply that the device referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation on the scope of protection of this application.
[0310] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application depending on the specific circumstances.
[0311] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0312] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0313] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; they may be located in one place or distributed across multiple module units; some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this application may all be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the integrated unit may be implemented in hardware or in a combination of hardware and software functional units.
[0314] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A battery state prediction method characterized by, The battery state prediction method comprises: obtaining the charge-discharge data of the battery to be tested; extracting features from the charge-discharge data through a feature extraction module in the trained battery state prediction model to obtain battery charge-discharge features; the prediction module in the battery state prediction model predicts the battery state based on the battery charge-discharge features to obtain the health status of the battery to be tested; wherein the parameters of the battery state prediction model are adjusted based on the loss value corresponding to the classification result when a discriminator with the same structure as the prediction module classifies the experimental charge-discharge features corresponding to the charge-discharge data of the battery in the laboratory and the use charge-discharge features corresponding to the charge-discharge data of the battery in use in the electrical equipment.
2. The battery state prediction method according to claim 1, characterized by, The feature extraction module comprises at least one residual module, and the residual module comprises at least a first feature extraction module, a second feature extraction module and an activation module. The feature extraction module in the trained battery state prediction model extracts features from the charge-discharge data to obtain battery charge-discharge features, comprising: nonlinear feature extraction of the first feature extraction module on the charge-discharge data to obtain nonlinear features of the charge-discharge data; local feature extraction of the second feature extraction module on the charge-discharge data to obtain local features of the charge-discharge data; feature fusion of the nonlinear features and the local features to obtain fused features; nonlinear activation of the fused features by the activation module to obtain the battery charge-discharge features.
3. The battery state prediction method according to claim 1 or 2, characterized by, The prediction module comprises at least a feature integration module and a regression module; the battery charge-discharge features comprise features of at least one dimension: current, voltage and temperature; The prediction module in the battery state prediction model predicts the battery state based on the battery charge-discharge features to obtain the health status of the battery to be tested, comprising: based on the feature integration module, integrating features of different dimensions in the battery charge-discharge features to obtain global features; based on the regression module, regressing the global features to obtain the health status of the battery to be tested.
4. The battery state prediction method according to any one of claims 1 to 3, characterized by, The training process of the battery state prediction model comprises: based on the feature extraction module of the pre-trained model, extracting features from the source domain data to obtain source domain features; wherein the source domain data is the charge-discharge data of the battery in the laboratory; the pre-trained model is obtained by training the source domain data; based on the feature extraction module of the pre-trained model, extracting features from the target domain data to obtain target domain features; the target domain data is the charge-discharge data of the battery in use in the electrical equipment; based on a discriminator with the same structure as the prediction module of the pre-trained model, discriminating the source domain features and the target domain features to determine the difference between the source domain data and the target domain data; based on the difference, updating the model parameters of the pre-trained model to obtain the battery state prediction model.
5. The battery state prediction method according to claim 4, characterized by, The discriminator based on the same prediction module structure as the pre-training model discriminates the source domain feature and the target domain feature to determine the difference between the source domain data and the target domain data, comprising: Based on the discriminator, the source domain feature and the target domain feature are classified to obtain a classification result; Based on the classification result and a preset algorithm, the difference between the source domain data and the target domain data is determined.
6. The battery state prediction method according to claim 4 or 5, characterized by, The battery state prediction method further comprises: Obtaining the loss result of the pre-training model; the loss result is obtained by the pre-training model based on the source domain data; Correspondingly, the model parameters of the pre-training model are updated based on the difference, and a battery state prediction model is obtained, comprising: Based on the difference and the loss result, the model loss function of the pre-training model and the discriminator loss function of the discriminator are determined; The initial model update parameters of the pre-training model and the initial discriminator update parameters of the discriminator are determined to minimize the model loss function and maximize the discriminator loss function; Based on the initial model update parameters and the initial discriminator update parameters, the pre-training model and the discriminator are updated respectively to obtain an updated pre-training model and an updated discriminator; Based on the updated pre-training model, the new difference between the source domain data and the target domain data is determined again, and based on the new difference, the updated pre-training model and the updated discriminator are updated again until the number of adversarial iterations is reached. The last updated battery state prediction is the battery state prediction model.
7. The battery state prediction method according to any one of claims 4 to 6, characterized by, The battery state prediction method further comprises: Data processing is performed on the sample charge and discharge data to obtain processed charge and discharge data; the source domain data at least includes sample charge and discharge data and sample battery state of the battery; The processed charge and discharge data is input into an initial pre-training model; the initial pre-training model includes an initial feature extraction module and an initial prediction module; Based on the initial feature extraction module, the sample charge and discharge data is feature extracted to obtain pre-training features; Based on the initial prediction module, the pre-training features are battery state predicted to obtain predicted battery states; The predicted battery states and the sample battery states are input into a preset loss model to obtain a loss result; Based on the loss result, the model parameters of the initial feature extraction module and the initial prediction module are corrected to obtain the pre-training model.
8. The battery state prediction method according to claim 7, characterized by, The pre-training model is obtained by correcting the model parameters of the initial feature extraction module and the initial prediction module based on the loss result, comprising: The model parameters of the initial feature extraction module and the initial prediction module are initially corrected based on the loss result to obtain a corrected pre-training model; Based on the corrected pre-training model, the processed charge and discharge data is predicted again to obtain new predicted battery states; The new predicted battery states and the sample battery states are input into a preset loss model to obtain a new loss result; Based on the new loss result, the model parameters of the initial feature extraction module and the initial prediction module are corrected again until the pre-training iteration number is reached, and the last updated battery state prediction is taken as the pre-training model.
9. The battery state prediction method according to claim 7 or 8, characterized by, The method further comprises: The data processing of the sample charge-discharge data comprises: The data normalization of the sample charge-discharge data comprises: The random probability corresponding to the normalized data is generated based on a preset random probability generation algorithm.
10. The battery state prediction method according to claim 9, characterized by, The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises:
11. The battery state prediction method according to claim 10, characterized by, The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises:
12. The battery state prediction method according to claim 10 or 11, characterized by, The random data augmentation of the normalized data based on the random probability comprises: The random data augmentation of the normalized data based on the random probability comprises:
13. A battery state prediction device characterized by comprising: The method further comprises: The method further comprises: The battery state prediction device comprises: The acquisition module is configured to acquire charge-discharge data of a battery to be measured. The feature extraction module is configured to extract features from the charge-discharge data by using a feature extraction module in a trained battery state prediction model, to obtain battery charge-discharge features. The prediction module is configured to perform battery state prediction based on the battery charge-discharge features by using a prediction module in the battery state prediction model, to obtain a health state of the battery to be measured. The parameters of the battery state prediction model are adjusted based on loss values corresponding to classification results of an experimental charge-discharge feature corresponding to charge-discharge data of a battery in a laboratory and a use charge-discharge feature corresponding to charge-discharge data of a battery in use in an electrical equipment when a discriminator having the same structure as the prediction module classifies the two features.
14. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the battery state prediction method of any one of claims 1 to 12.
15. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions, when executed by a processor, implement the steps of the battery state prediction method of any one of claims 1 to 12.