Training method, prediction method, device and medium for battery low voltage prediction model
By using the backtracking labeling method in battery low voltage fault prediction, sample data is extracted from historical message information and labeled fault data, the problem of data labeling in the prior art is solved, and the training efficiency and prediction accuracy of the model are improved.
Patent Information
- Application Number
- CN202311066165.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2043-08-23
AI Technical Summary
In the prior art, training data labeling is difficult, especially in battery low-voltage fault prediction. The workload of labeling fault data is huge, which affects the training efficiency of machine learning models.
The backtrack annotation method is used to extract sample data from historical message information, and determine the data label based on the voltage value and time interval. The fault data is marked in just one traversal, which simplifies the data labeling process.
It greatly reduces the workload and time of data annotation, improves the quality of training data and the prediction accuracy of models, and reduces the cost of machine learning.
Smart Images

Figure CN117151243B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle monitoring technology, and in particular to a training method, a prediction method, a device and a medium for a battery low voltage prediction model. Background Art
[0002] The car battery is part of the electrical system of new energy vehicles, and is mainly used to power low-voltage electrical systems and other equipment. In actual use, the battery may have a low-voltage fault due to various reasons. At this time, the vehicle will be prohibited from high voltage, the range extender will be prohibited from starting, and even the power will be interrupted, affecting the car experience and driving safety.
[0003] At present, vehicle failures can be predicted using machine learning technology. In the supervised learning process, training data needs to be labeled, but the amount of training data is huge, and labeling fault data in it is a very complicated task. Summary of the invention
[0004] Based on this, a training method, prediction method, device and medium for a battery low voltage prediction model are provided to improve the problem of difficulty in labeling training data in the prior art.
[0005] On the one hand, a method for training a battery low voltage prediction model is provided, comprising:
[0006] Acquire multiple pieces of sample data according to historical message information of the vehicle, each piece of sample data at least including the voltage value of the battery and the sampling time of the voltage value, and the sample data also includes training features;
[0007] Determine the time interval according to the sampling moments of two adjacent sample data;
[0008] Determining the data label of the sample data includes: when the voltage value of the current sample data is less than the low voltage threshold, determining that the data label of the current sample data is a fault label; and when the data label of the current sample data is a fault label and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, determining that the data label of the previous sample data is a fault label, otherwise it is a normal label;
[0009] Based on the sample data with the data label, a battery low voltage prediction model is trained to predict a battery low voltage fault according to current message information.
[0010] In one embodiment, the step of obtaining multiple pieces of sample data of the battery according to the historical message information of the vehicle includes:
[0011] Determine the power supply status of the DC conversion module in the historical message information;
[0012] According to the invalid power supply state, it is determined that the battery state in the historical message information is a discharge state, so as to obtain the sample data according to the historical message information in the discharge state.
[0013] In one embodiment, the training to obtain a battery low voltage prediction model based on the sample data with the data label includes:
[0014] Inputting the sample data into an initial model, wherein the initial model includes a plurality of classification trees in series;
[0015] The output loss is obtained according to the following mathematical expression:
[0016]
[0017] Among them, L m is the output loss, N is the number of sample data, F k-1 (x i ,W k-1 ) represents the initial model composed of the first k-1 classification trees with model parameters W k-1 Under the condition of i The predicted value, L(y i ,F k-1 (x i ,W k-1 )) is the true value y i The error with the predicted value, λ is the regularization coefficient, is the regularization term;
[0018] α i is the weighting coefficient, and:
[0019]
[0020] Among them, y i =1 means input x i The data label of y is the fault label, i =0 means input x i The data label is a normal label, and c is a constant greater than 1.
[0021] Based on the minimization of the loss, the parameters of the initial model are adjusted to obtain the battery low voltage prediction model.
[0022] In one embodiment, the training to obtain a battery low voltage prediction model based on the sample data with the data label includes:
[0023] According to the feature dimension processing of the sample data, a first training set is obtained, including:
[0024] According to the mutually exclusive features in the sample data, mutually exclusive features are bundled to obtain dense features, so as to reduce the number of features in the sample data.
[0025] In one embodiment, the training to obtain a battery low voltage prediction model based on the sample data with the data label includes:
[0026] According to the sample dimension processing of the sample data, a second training set is obtained, including:
[0027] Obtaining a gradient value corresponding to each of the sample data according to the loss;
[0028] Sorting the sample data according to the absolute values of the gradient values, and determining large gradient sample data and small gradient sample data according to a preset ratio threshold;
[0029] The large gradient sample data are retained to obtain a first subset, the small gradient sample data are randomly sampled according to a preset sampling ratio to obtain a second subset, and the first subset and the second subset are combined to obtain the second training set.
[0030] In one embodiment, the training to obtain a battery low voltage prediction model based on the sample data with the data label includes:
[0031] Traversing the features in the sample data of the parent node of the classification tree, and constructing a histogram according to the values of the features;
[0032] Traverse each bucket of the histogram and obtain the split gain corresponding to each bucket;
[0033] The value of the bucket corresponding to the maximum splitting gain is determined as the optimal splitting point of the parent node.
[0034] In one embodiment, obtaining the splitting gain corresponding to each bucket includes:
[0035] The split gain is obtained according to the following mathematical expression:
[0036]
[0037] Among them, A l ={x i ∈A:x ij ≤d},A r ={x i ∈A:x ij >d}, B l ={x i ∈B:x ij ≤s}, B r ={x i ∈B:x ij >d};
[0038] Among them, x ij For sample data x i The value of feature j, d is the value of the split point, a is the preset ratio threshold, b is the preset sampling ratio, g i For sample data x i The corresponding negative gradient, n is the total number of samples of the node before splitting, A is the first subset, B is the second subset, is the number of samples of the left child node after the split point is divided, is the number of right child node samples after the split point, is the split gain.
[0039] In another aspect, a method for predicting low voltage of a battery is provided, comprising:
[0040] Obtaining input data according to current message information, wherein the input data includes prediction features;
[0041] Calling a pre-trained battery low voltage prediction model to input the input data into the battery low voltage prediction model to obtain a low voltage fault prediction result;
[0042] Wherein, the battery low voltage prediction model is trained using the training method.
[0043] On the other hand, a training device for a battery low voltage prediction model is provided, comprising:
[0044] An extraction module, used for acquiring a plurality of sample data according to the historical message information of the vehicle, each of the sample data at least including the voltage value of the battery and the sampling time of the voltage value, and the sample data also includes training features;
[0045] A calculation module, used to determine the time interval according to the sampling moments of two adjacent sample data;
[0046] A labeling module, used to determine the data label of the sample data, including: when the voltage value of the current sample data is less than the low voltage threshold, determining that the data label of the current sample data is a fault label; and when the data label of the current sample data is a fault label, and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, determining that the data label of the previous sample data is a fault label, otherwise it is a normal label;
[0047] A training module is used to train and obtain a battery low voltage prediction model based on the sample data with the data label.
[0048] A computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the battery low voltage prediction model is implemented, or the battery low voltage prediction method is executed.
[0049] The training method of the above-mentioned battery low voltage prediction model extracts sample data from historical message information. When the voltage value of the sample data is less than the low voltage threshold, the label of the sample data is a fault label. After determining that the label of the current sample data is a fault label, backtracking is performed. If the time interval between the previous sample data and the current sample data is less than the time threshold, it is determined that the data label of the previous sample data is also a fault label. The training method of the present application adopts a backtracking method and only requires one traversal to mark the sample data at the time of the fault and before the fault occurs as fault data. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A flowchart of a method for training a battery low voltage prediction model in one embodiment;
[0051] Figure 2 This is a connection diagram of the battery, DCDC module and low-voltage load;
[0052] Figure 3 A schematic diagram of the relationship between battery voltage and time in one embodiment;
[0053] Figure 4 A schematic diagram of model training in one embodiment;
[0054] Figure 5 A schematic diagram of mutually exclusive feature bundling in one embodiment;
[0055] Figure 6 A schematic diagram of a histogram of features constructed in one embodiment;
[0056] Figure 7 A schematic diagram of a flow chart of a method for predicting low voltage of a battery in one embodiment;
[0057] Figure 8 A schematic diagram of the process of model building and online detection in one embodiment;
[0058] Fig. 9 The figure is a structural block diagram of a training device for a battery low voltage prediction model in one embodiment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] Batteries play a vital role in the normal operation of new energy vehicles, mainly providing power for low-voltage electrical systems and equipment such as engine starting and acceleration. Due to the charging and discharging process of batteries, low-voltage failures are inevitable due to various reasons. At this time, the vehicle will be prohibited from high voltage, the engine will be prohibited from starting, and the power will be interrupted, seriously affecting the vehicle experience and driving safety.
[0061] In traditional technology, vehicle battery fault monitoring adopts real-time monitoring, that is, an alarm is issued when the voltage is detected to be lower than a certain threshold, and it is handled through post-maintenance and planned maintenance. However, this method has poor early warning ability for faults.
[0062] Machine learning can detect potential fault signs in advance by analyzing large amounts of historical data and identifying fault-related patterns and abnormal behaviors. The importance of data labeling to machine learning cannot be ignored. It is crucial to building high-quality training data sets and improving the performance of machine learning algorithms. However, when the amount of training data required is huge, the workload of data labeling is enormous. Labeling fault data is a very complicated task, and the cost of machine learning will inevitably increase.
[0063] The present application provides a method for training a battery low-voltage prediction model, which uses a backtracking method to annotate sample data and then trains to obtain a model.
[0064] like Figure 1 As shown, the training method includes the following steps:
[0065] Step 101, obtaining multiple sample data according to the historical message information of the vehicle.
[0066] The historical message information is exemplarily a CAN (Controller Area Network) message of the vehicle. Since CAN messages have the characteristics of high reliability, fast data transmission speed, strong flexibility and large amount of data, the historical data of the vehicle is stored in the data warehouse in the form of CAN messages. In order to obtain specific signal fields, the historical CAN messages are first parsed and cleaned to obtain the training features related to the vehicle and the battery within a certain period of time, including the battery voltage value, the battery SOC (State of Charge), the battery SOH (State of Health), the power battery system related signal field, the DCDC (Direct Current Converter) system related signal field, the time signal field and the basic status signal field of the vehicle.
[0067] It should be pointed out that when the vehicle is in sleep mode, the battery is also in a low-power discharge state, but no CAN signal is reported at this time. Therefore, the above data does not include the battery status when the vehicle is in sleep mode, thereby reducing some data that is not highly relevant to vehicle use.
[0068] New energy vehicles will automatically replenish electricity using power batteries to replenish the storage battery, such as Figure 2 The connection diagram of the battery, DCDC module and low-voltage load shown in the figure shows that according to the relationship between the DCDC module, low-voltage battery and low-voltage load, there are three states for the battery:
[0069] Discharge state: The DCDC module is not activated. At this time, the power of the low-voltage load is all provided by the battery. This scenario mainly occurs when the vehicle is asleep, and low-voltage faults mainly occur in this scenario;
[0070] Charging state: The DCDC module is activated. At this time, the vehicle is not in use but is awakened by the automatic charging mechanism. This scenario is mainly during the battery charging process. At this time, the low-voltage load is equivalent to the direct power supply of the DCDC module;
[0071] Standby state: The DCDC module is activated, and the low-voltage battery basically does not supply power to the outside. The entire low-voltage load is directly powered by the DCDC module. This scenario is mainly when the vehicle is driving normally or in high-voltage standby.
[0072] According to the above working principle, low voltage failure is likely to occur in the battery only when it is in the discharge process.
[0073] In order to further reduce the amount of data, this embodiment first checks the power supply status of the DC conversion module in the historical message information; determines that the battery in the historical message information is in a discharge state based on the invalid power supply state (that is, the DCDC module is not activated), and filters out the historical message information in the discharge state for obtaining the sample data.
[0074] Step 102: determine the time interval according to the sampling moments of two adjacent sample data.
[0075] The historical message information includes the voltage value of the battery and the sampling time of the voltage value. The sample data is arranged in reverse order, and the time interval between the sample data and the next data is calculated by polling.
[0076] Step 103: data labeling, determining the data label of the sample data.
[0077] For the battery status, the data tag includes a fault tag indicating that a low voltage fault has occurred and a normal tag indicating that the battery is normal and no low voltage fault has occurred.
[0078] like Figure 3The battery voltage of the vehicle in various states is shown, with the horizontal axis representing time and the vertical axis representing voltage value. The three dotted line segments perpendicular to the vertical axis represent the normal battery voltage value, automatic charging voltage threshold, and low voltage fault voltage threshold from top to bottom, respectively. The dotted lines perpendicular to the horizontal axis represent different time intervals (there is a large time interval between each segment), which are divided into 3 categories and 4 segments, namely normal discharge / automatic charging, DCDC power supply, low voltage fault, and DCDC power supply.
[0079] When the automatic power replenishment is working normally, the possibility of low voltage failure is small. Therefore, when a voltage failure occurs, the vehicle is mostly in a discharging state and the vehicle itself is in a special state. In this state, the automatic power replenishment cannot work normally due to various reasons.
[0080] Due to the capacity limitation of the battery itself, when the vehicle is in the wake-up state, the continuous discharge time is usually about 30 minutes, which is relatively short. At this time, the state of the DCDC power supply system except the battery can be understood as approximately unchanged, that is, it can be understood that the entire interval of segment 3 has similar vehicle states, and the area can be marked as a low voltage fault. Therefore, the model obtained based on this training can predict low voltage faults before the low voltage fault occurs.
[0081] When the sample data meets any of the following conditions, it is considered as low voltage fault data:
[0082] Condition 1: The voltage value of the sample data is less than the low voltage threshold (i.e. Figure 3 Medium and low voltage fault voltage threshold);
[0083] Condition 2: t i The time is marked as fault data, and |t i -t i-1 |≤S, then t i-1 The data at that time is also marked as fault data.
[0084] For example, as shown in Table 1, the sample data is grouped according to vin and sorted according to timestamps, the low voltage threshold is 10.5V, and the time threshold is 50000s.
[0085] Table 1:
[0086]
[0087]
[0088] The above-mentioned marking method can mark the data of a period of time before the failure occurs by backtracking, and the marking can be achieved by traversing only once, which greatly reduces the workload.
[0089] Step 104: Based on the sample data with the data label, a battery low voltage prediction model is trained.
[0090] In step 104, the machine learning algorithm analyzes a large amount of data to discover patterns and regularities, and uses these patterns and regularities to make predictions or decisions. After the sample data is prepared, appropriate features are selected to describe the data. Features are representative attributes in the data that can be used to distinguish different categories or patterns. Generally, a sample data can include multiple features. Select a suitable machine learning model and train the model using existing sample data. The goal of training the model is to adjust the parameters of the model so that it can learn accurate regularities and associations from the data. Then, use new data that has not participated in the training to evaluate the model's performance and accuracy, and train it to meet the usage requirements.
[0091] Machine learning methods mainly include decision trees, random forests, artificial neural networks, Bayesian learning, etc. In this embodiment, the labeled sample data is a binary classification data set. The data has the characteristics of many features and large data volume, and the probability of null values appearing in some fields of the CAN signal is relatively high. Therefore, the LightGBM (Light Gradient Boosting Machine) algorithm that can handle null values and has better performance is used in this application for classification model training.
[0092] LightGBM is a gradient boosting framework. In this embodiment, the CART classification tree is used as the LightGBM base learner. Each base learner predicts the input sample data, and then adds each prediction result as the final output. Equivalently, it can be understood as using the Kth base learner to predict the residuals of the previous K-1 base learners. A residual tree is fitted in each iteration and added to the current model. A certain number of CART trees are fitted, and an initial weight coefficient is assigned to each tree. The sum of the corresponding prediction values of the sample in each tree is the final prediction value of the sample. During training, the optimal solution of the weight vector when the loss is minimized is calculated, and the initial weight coefficient is replaced by the optimal solution.
[0093] The specific process of model training is as follows Figure 4 As shown in the figure, firstly, feature selection is performed on the input data set to obtain the optimal fault data set. In order to improve the training speed of the model in large data volume scenarios, the exclusive feature bundling technology (EFB) is used to reduce the number of features in the sample data, the gradient-based one-side sampling technology (GOSS) is used to reduce the number of samples, and the histogram difference technology is used to reduce the calculation and memory usage to accelerate the training.
[0094] The mutually exclusive feature bundling technology is exemplified. The EFB algorithm can solve the sparsity problem of high-dimensional data by bundling mutually exclusive features.
[0095] In the sample data obtained by parsing the message signal, from the perspective of features, there are sparse features containing a large number of 0 elements. From the perspective of samples, some features are not valid at the same time, which are called mutually exclusive features, such as Figure 5 As shown, mutually exclusive features are bundled, multiple sparse features are merged into dense features, feature dimensions and calculation of unnecessary 0 values are reduced without losing information, the speed of the algorithm is improved, and the data after mutually exclusive features are bundled becomes the first data set.
[0096] The sample data is bundled with mutually exclusive features and then unilaterally sampled with gradients. GOSS reduces the sample size by discarding some samples that are less helpful in calculating information gain and retaining samples that are more helpful, including first using the model to predict the predicted value of each sample data, calculating the loss based on the predicted value, and further calculating the sample gradient, where the gradient is obtained by calculating the derivative of the loss function with respect to the predicted value. The samples are sorted in descending order according to the absolute value of the gradient, and the first a×100% samples of the sorted sample data are retained as large gradient sample data according to the preset ratio threshold a×100%, and the remaining (1-a)×100% samples are randomly sampled and retained according to the preset sampling ratio b×100%.
[0097] The first subset consisting of large gradient sample data and the second subset obtained by sampling small gradient sample data are combined to obtain a second training set for inputting the model.
[0098] During the training process of the model, the histogram difference method is used to reduce the amount of calculation. In LightGBM, before each node of the base learner is split, a histogram of each feature of the sample data corresponding to the node is made. Through the histogram, the corresponding value is substituted into the gain formula to calculate the gain of each feature divided by each different value range. The segmentation point with the largest gain among all leaf nodes is found as the optimal segmentation point, and the process is continuously recursive until the stopping condition of the base learner is met.
[0099] Specifically, in this embodiment, the variance gain is used as the gain formula, and the splitting gain is obtained according to the following variance gain:
[0100]
[0101] Among them, A l ={x i ∈A:x ij ≤d},A r ={xi ∈A:x ij >d}, B l ={x i ∈B:x ij ≤d}, B r ={x i ∈B:x ij >d};
[0102] Among them, x ij For sample data x i The value of feature j, d is the value of the split point, a is the preset ratio threshold, b is the preset sampling ratio, g i For sample data x i The corresponding negative gradient, A is the first subset, B is the second subset, is the number of samples of the left child node after the split point is divided, is the number of samples of the right child node after the split point, and n is the total number of samples of the node before the split.
[0103] In the above-mentioned unilateral gradient sampling, since the sampling is only for small gradient samples, the original data distribution will be changed. Therefore, in the above mathematical expression, the negative gradient g of the loss function i Multiply by the coefficient To keep the data distributed.
[0104] In this embodiment, a histogram is used to find the optimal splitting point of the classification tree to maximize the splitting gain. The histogram "bins" the value of the feature, divides the data into different discrete areas, and then traverses the discrete data to find the optimal splitting point. Compared with the traditional traversal of all data on the node, the histogram difference only needs to traverse all the buckets of the histogram.
[0105] For example, each feature in the sample data corresponding to the parent node (the node to be split) is traversed, and the feature values are bucketed according to a certain width to obtain a histogram, such as Figure 6 As shown, each bucket corresponds to a number of sample data.
[0106] Traverse each bucket of the histogram, for example, for bucket [T2, T3), substitute the bucket value T2 into the gain formula to obtain the split gain corresponding to the bucket, and take the value of the bucket with the maximum split gain as the optimal split point of the parent node.
[0107] In the actual process of building a tree, LightGBM first calculates the leaf nodes with small histograms, and then uses the histogram difference to obtain the leaf nodes with large histograms, so that the histograms of its brother leaves can be obtained at a very small cost.
[0108] In one embodiment, since low voltage fault data in vehicle operation data is very scarce, the low voltage fault data is insufficiently recognized. Meanwhile, the various operating conditions of the vehicle increase the diversity of samples, which may cause the model to overfit.
[0109] In this embodiment, the overfitting problem is avoided by improving the loss function used for model training. Specifically:
[0110] For the k-th classification tree, the original loss function is:
[0111]
[0112] In the original loss function, N is the total number of samples, F k-1 (x i ; W k-1 ) indicates that the initial model composed of the first k-1 classification trees has a model parameter (or weight coefficient) of W k-1 Under the condition of i The predicted value of the model parameter W k-1 Includes the parameters ω of the first k-1 trees 1 ...ω k-1 ,L(y i ,F k-1 (x i ; W k-1 )) describes the true value y i The function of the error with the prediction value of a single sample, in this embodiment, is the logarithmic loss function for LightGBM.
[0113] It should be pointed out that L 0 As the sample overall loss, the derivative of the sample overall loss with respect to the predicted value is the gradient of the sample data.
[0114] In this embodiment, an L2 regularization term is introduced into the loss function to reduce overfitting, and a higher weight is given to unstable samples to deal with the sample imbalance problem.
[0115] The improved loss function of the Kth tree is:
[0116]
[0117] α i is the weighting coefficient, which is taken as follows:
[0118]
[0119] Among them, y i =1 means input x i The data label of y is the fault label, i =0 means input xi The data label is a normal label, and c is a constant greater than 1.
[0120] In the improved loss function, is the L2 regularization term, λ is the regularization coefficient, ω is the parameter of the model, M is the number of classification trees.
[0121] Based on the minimization of the loss, the parameters that minimize the function value of the loss function are selected to replace the parameters of the initial model.
[0122] In the above scheme, the model training is performed based on sample data extracted from historical message information, and the sample data is labeled in a backtracking manner. Through one traversal, the data within a certain period of time before the fault can be found and labeled as fault data, which greatly improves the efficiency of data labeling.
[0123] On the other hand, in view of the characteristics of a large number of null values and sparse data in message information, the LightGBM algorithm that can handle a large number of null values is adopted. The EFB technology and GOSS technology are used to process the samples to reduce the amount of calculation of the samples. The histogram difference is used to divide the data into discrete data to speed up the training. At the same time, the loss function of the original algorithm is improved accordingly to avoid the overfitting problem.
[0124] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0125] In one embodiment, a battery low voltage prediction method is provided, which can predict a battery low voltage fault based on a message information, without using a time series that requires a sequence of data for prediction, thereby improving the timeliness of the prediction.
[0126] like Figure 7 As shown, the battery low voltage prediction method includes the following steps:
[0127] Step 201, obtaining input data according to current message information.
[0128] After the model is trained, the LightGBM model is saved as a model file and deployed to the cloud platform through the model file. The features required for model prediction are obtained through real-time CAN message analysis. The prediction features include signal fields that are highly correlated with battery low-voltage prediction, such as battery voltage value, battery SOC, battery SOH, power battery system-related signal fields, DCDC system-related signal fields, time signal fields, and vehicle basic status signal fields.
[0129] Step 202 , calling a pre-trained battery low voltage prediction model to input the input data into the battery low voltage prediction model to obtain a low voltage fault prediction result in a numerical form.
[0130] In the above method, the model is deployed on the cloud, and low voltage faults can be predicted in real time at a lower computing cost through vehicle network data, and the prediction results can be pushed to the business system in real time. In another implementation method, the model is deployed on the vehicle side using edge computing. With the support of richer status information and higher-frequency signal sampling cycles, low voltage faults can be predicted more accurately and quickly, and the prediction results can be sent to the vehicle controller to perform related operations and reduce the probability of low voltage faults.
[0131] Based on the solutions in the above embodiments, Figure 8 As shown, the process of the battery low voltage prediction model of the present application from data labeling, model training to model use is described. During the training and use process, data is obtained through message parsing, and the data of the battery discharge process is screened for training or prediction to reduce the amount of data.
[0132] In one embodiment, Fig. 9 As shown, a training device for a battery low voltage prediction model is provided, comprising: an extraction module 301, a calculation module 302, a labeling module 303 and a training module 304, wherein:
[0133] An extraction module 301 is used to obtain a plurality of sample data according to the historical message information of the vehicle, each of the sample data at least includes the voltage value of the battery and the sampling time of the voltage value, and the sample data also includes training features;
[0134] A calculation module 302, configured to determine a time interval according to sampling moments of two adjacent sample data;
[0135] The labeling module 303 is used to determine the data label of the sample data, including: when the voltage value of the current sample data is less than the low voltage threshold, determining that the data label of the current sample data is a fault label; and when the data label of the current sample data is a fault label, and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, determining that the data label of the previous sample data is a fault label, otherwise it is a normal label;
[0136] The training module 304 is used to train and obtain a battery low voltage prediction model based on the sample data with the data label.
[0137] In one embodiment, the extraction module 301 in the training device determines the battery state through the power supply state of the DC conversion module in the historical message information. Specifically, when the DC conversion module is not activated, the battery state is a discharge state, and then the sample data is obtained from the historical message information in the discharge state.
[0138] In one embodiment, the training module 304 constructs a regularization term of the lightweight gradient boosting machine model, obtains the overall loss of the model training based on the regularization term, the error between the true value and the predicted value, and adjusts the parameters of the model based on minimization of the overall loss to obtain the battery low voltage prediction model. Specifically, the initial model includes a plurality of classification trees in series; during training, the output loss is obtained according to the following mathematical expression:
[0139]
[0140] Among them, L m is the output loss, N is the number of sample data, F k-1 (x i ,W k-1 ) represents the initial model composed of the first k-1 classification trees with model parameters W k-1 Under the condition of i The predicted value, L(y i ,F k-1 (x i ,W k-1 )) is the true value y i The error with the predicted value, λ is the regularization coefficient, is the regularization term;
[0141] α i is the weighting coefficient, and:
[0142]
[0143] Among them, y i =1 means input x iThe data label of y is the fault label, i =0 means input x i The data label is a normal label, and c is a constant greater than 1.
[0144] After constructing the loss function L m Finally, the model is iteratively trained according to the sample data, including the processing of the sample data.
[0145] Exemplarily, the processing of sample data includes reducing feature dimensions by using mutually exclusive feature bundling, and reducing the amount of sample data by using single-side gradient sampling.
[0146] During single-sided gradient sampling, the gradient value corresponding to each sample data is obtained according to the loss; the sample data are sorted according to the absolute value of the gradient value, and the large gradient sample data and the small gradient sample data are determined according to a preset ratio threshold; the large gradient sample data are retained to obtain a first subset, and the small gradient sample data are randomly sampled according to a preset sampling ratio to obtain a second subset, and the first subset and the second subset are combined to obtain a training set for inputting a model.
[0147] In one embodiment, the training module 304 discretizes the features of the sample data of the parent node of the classification tree, constructs a histogram of the features, traverses each bucket of the histogram, and determines the optimal segmentation features and optimal segmentation points for node splitting.
[0148] When traversing the histogram, the split gain is obtained according to the following mathematical expression:
[0149]
[0150] Among them, A l ={x i ∈A:x ij ≤d},A r ={x i ∈A:x ij >d}, B l ={x i ∈B:x ij ≤d}, B r ={x i ∈B:x ij >d};x ij For sample data x i The value of feature j, d is the value of the split point, a is the preset ratio threshold, b is the preset sampling ratio, g i For sample data x i The corresponding negative gradient, n is the total number of samples of the node before splitting, A is the first subset, B is the second subset, is the number of samples of the left child node after the split point is divided, is the number of right child node samples after the split point, is the split gain.
[0151] According to the optimal segmentation features and the optimal segmentation points, node splitting is performed in the direction of maximizing the splitting gain.
[0152] For the specific limitations on the training device for the battery low-voltage prediction model, please refer to the limitations on the training method for the battery low-voltage prediction model above, which will not be repeated here. Each module in the above-mentioned training device for the battery low-voltage prediction model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0153] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the training method of the battery low voltage prediction model provided by the embodiment of the present invention is implemented, for example, the following steps:
[0154] Acquire multiple pieces of sample data according to historical message information of the vehicle, each piece of sample data at least including the voltage value of the battery and the sampling time of the voltage value, and the sample data also includes training features;
[0155] Determine the time interval according to the sampling moments of two adjacent sample data;
[0156] Determining the data label of the sample data includes: when the voltage value of the current sample data is less than the low voltage threshold, determining that the data label of the current sample data is a fault label; and when the data label of the current sample data is a fault label and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, determining that the data label of the previous sample data is a fault label, otherwise it is a normal label;
[0157] Based on the sample data with the data label, a battery low voltage prediction model is trained to predict a battery low voltage fault according to current message information.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0159] Determine the power supply status of the DC conversion module in the historical message information;
[0160] According to the invalid power supply state, it is determined that the battery state in the historical message information is a discharge state, so as to obtain the sample data according to the historical message information in the discharge state.
[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0162] Inputting the sample data into an initial model, wherein the initial model includes a plurality of classification trees in series;
[0163] The output loss is obtained according to the following mathematical expression:
[0164]
[0165] Among them, L m is the output loss, N is the number of sample data, F k-1 (x i ,W k-1 ) represents the initial model composed of the first k-1 classification trees with model parameters W k-1 Under the condition of i The predicted value, L(y i ,F k-1 (x i ,W k-1 )) is the true value y i The error with the predicted value, λ is the regularization coefficient, is the regularization term;
[0166] α i is the weighting coefficient, and:
[0167]
[0168] Among them, y i =1 means input x i The data label of y is the fault label, i =0 means input x i The data label is a normal label, and c is a constant greater than 1.
[0169] Based on the minimization of the loss, the parameters of the initial model are adjusted to obtain the battery low voltage prediction model.
[0170] Alternatively, the multiple instructions included in the computer program can be loaded by the processor of the network device to execute the battery low voltage prediction method provided in the embodiment of the present invention, for example, obtaining input data based on current message information, the input data including prediction features; calling a pre-trained battery low voltage prediction model to input the input data into the battery low voltage prediction model to obtain a low voltage fault prediction result.
[0171] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0172] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A training method for a battery low voltage prediction model, characterized in that: include: Filtering historical message information of the battery in a discharge state, obtaining a plurality of sample data from the historical message information of the vehicle, each of the sample data at least including a voltage value of the battery and a sampling time of the voltage value, and the sample data also including training features; Determine the time interval according to the sampling moments of two adjacent sample data; Determining the data label of the sample data includes: when the voltage value of the current sample data is less than a low voltage threshold, determining that the data label of the current sample data is a fault label; And, when the data label of the current sample data is a fault label, and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, the data label of the previous sample data is determined to be a fault label, and the sample data is traced back and traversed. When T i The moment is marked as a fault label, and T i-1 When the time interval between the sample data at time T1 and the sample data at time Ti is less than or equal to the time threshold, it is determined that T i-1 The data label of the sample data at the time is a fault label, otherwise it is a normal label; Based on the sample data with the data label, a battery low voltage prediction model is trained to predict a battery low voltage fault according to current message information.
2. The training method of the battery low voltage prediction model according to claim 1, characterized in that: The screening of historical message information of the battery in a discharge state, and obtaining a plurality of sample data from the historical message information of the vehicle, includes: Determine the power supply status of the DC conversion module in the historical message information; According to the invalid power supply state, it is determined that the battery state in the historical message information is a discharge state, so as to obtain the sample data according to the historical message information in the discharge state.
3. The training method of the battery low voltage prediction model according to any one of claims 1-2 is characterized in that: The training to obtain a battery low voltage prediction model based on the sample data with the data label includes: Inputting the sample data into an initial model, wherein the initial model includes a plurality of classification trees in series; The output loss is obtained according to the following mathematical expression: Among them, L m is the output loss, N is the number of sample data, F k-1 (x i ,W k-1 ) represents the initial model composed of the first k-1 classification trees with model parameters W k-1 Under the condition of i The predicted value, L(y i ,F k-1 (x i ,W k-1 )) is the true value y i The error with the predicted value, λ is the regularization coefficient, is the regularization term; α i is the weighting coefficient, and: Among them, y i =1 means input x i The data label of y is the fault label, i =0 means input x i The data label of is a normal label, and c is a constant greater than 1; Based on the minimization of the loss, the parameters of the initial model are adjusted to obtain the battery low voltage prediction model.
4. The training method of the battery low voltage prediction model according to claim 3 is characterized in that: The training to obtain a battery low voltage prediction model based on the sample data with the data label includes: According to the feature dimension processing of the sample data, a first training set is obtained, including: According to the mutually exclusive features in the sample data, mutually exclusive features are bundled to obtain dense features, so as to reduce the number of features in the sample data.
5. The training method of the battery low voltage prediction model according to claim 3 is characterized in that: The training to obtain a battery low voltage prediction model based on the sample data with the data label includes: According to the sample dimension processing of the sample data, a second training set is obtained, including: Obtaining a gradient value corresponding to each of the sample data according to the loss; Sorting the sample data according to the absolute values of the gradient values, and determining large gradient sample data and small gradient sample data according to a preset ratio threshold; The large gradient sample data are retained to obtain a first subset, the small gradient sample data are randomly sampled according to a preset sampling ratio to obtain a second subset, and the first subset and the second subset are combined to obtain the second training set.
6. The training method of the battery low voltage prediction model according to claim 3 is characterized in that: The training to obtain a battery low voltage prediction model based on the sample data with the data label includes: Traversing the features in the sample data of the parent node of the classification tree, and constructing a histogram according to the values of the features; Traverse each bucket of the histogram and obtain the split gain corresponding to each bucket; The value of the bucket corresponding to the maximum splitting gain is determined as the optimal splitting point of the parent node.
7. The training method of the battery low voltage prediction model according to claim 6, characterized in that: The obtaining of the splitting gain corresponding to each bucket includes: The split gain is obtained according to the following mathematical expression: where A l = {x i ∈ A: x ij ≤ d}, A r = {x i ∈ A: x ij > d}, B l = {x i ∈ B: x ij ≤ d}, B r = {x i ∈ B: x ij > d}; Among them, x ij For sample data x i The value of feature j, d is the value of the split point, a is the preset ratio threshold, b is the preset sampling ratio, g i For sample data x i The corresponding negative gradient, n is the total number of samples of the node before splitting, A is the first subset, B is the second subset, is the number of samples of the left child node after the split point is divided, is the number of right child node samples after the split point, is the split gain.
8. A method for predicting low battery voltage, characterized in that: include: Obtaining input data according to current message information, wherein the input data includes prediction features; Calling a pre-trained battery low voltage prediction model to input the input data into the battery low voltage prediction model to obtain a low voltage fault prediction result; Wherein, the battery low voltage prediction model is trained using the training method described in any one of claims 1-7.
9. A training device for a battery low voltage prediction model, characterized in that: include: An extraction module, used for screening historical message information of the battery in a discharge state, and obtaining a plurality of sample data from the historical message information of the vehicle, each of the sample data at least including a voltage value of the battery and a sampling time of the voltage value, and the sample data also includes training features; A calculation module, used to determine the time interval according to the sampling moments of two adjacent sample data; The marking module is used to determine the data label of the sample data, including: when the voltage value of the current sample data is less than the low voltage threshold, the data label of the current sample data is determined to be a fault label; and when the data label of the current sample data is a fault label, and the time interval between the previous sample data and the current sample data is less than or equal to the time threshold, the data label of the previous sample data is determined to be a fault label, and the sample data is traced back and traversed. When T i The moment is marked as a fault label, and T i-1 When the time interval between the sample data at time T1 and the sample data at time Ti is less than or equal to the time threshold, it is determined that T i-1 The data label of the sample data at the time is a fault label, otherwise it is a normal label; A training module is used to train and obtain a battery low voltage prediction model based on the sample data with the data label.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the training method of the model described in any one of claims 1 to 7, or executes the battery low voltage prediction method described in claim 8.
Citation Information
Patent Citations
Hard disk fault prediction method and device, electronic equipment and storage medium
CN114758714A
PHM undervoltage fault prediction method for chemical energy storage battery
CN115128468A
Storage battery health state prediction method based on feedforward neural network
CN115372852A