Battery discharge prediction method and system based on machine learning
By combining machine learning methods with multinomial regression and LSTM neural networks, the problems of large errors and difficulty in identifying outliers in data center battery discharge prediction are solved, achieving efficient and accurate battery discharge voltage prediction and fault alarm.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies have significant errors in predicting battery discharge in data centers and cannot accurately locate faults. In particular, they lack scientific methods for batteries without historical data and cannot scientifically determine abnormal voltage values.
A machine learning-based approach was adopted, using discharge data with discharge durations H1 and H2. Segmented prediction was performed using a multinomial regression algorithm and an LSTM neural network model. Combined with a Gaussian distribution outlier detection algorithm, the discharge curve was fitted and outliers were detected.
It improves the accuracy of discharge voltage prediction, can detect battery faults in a timely manner and issue alarms, reduces errors, and is suitable for battery discharge prediction in different scenarios.
Smart Images

Figure CN115542163B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, in particular to a battery discharge prediction method and system based on machine learning. BACKGROUND
[0002] The prediction of machine room batteries lacks scientific means, mainly relying on the regular measurement and collection of basic data by operation and maintenance personnel, and determining the discharge voltage at different times through artificial analysis techniques. The general practice is as follows:
[0003] 1. Manually collect parameters such as voltage, internal resistance, and temperature of the battery.
[0004] 2. After obtaining the basic data, perform data analysis through artificial methods, mainly including analog method and point drawing method.
[0005] 3. If an anomaly is found, take measures such as telephone and voice alarms to replace the battery. Generally, it is not possible to immediately pinpoint the fault, resulting in missed optimal repair opportunities.
[0006] The existing technical solutions have the following shortcomings and deficiencies:
[0007] 1. Based on traditional means of prediction, the error is high. In the traditional prediction of battery voltage and time, analog method and proportional method are mainly used, and the fitting effect is not good and the error is large.
[0008] 2. For batteries without historical data, it is not possible to fit them through their known adjacent discharge curves. There is a lack of scientific technical means for this type of battery.
[0009] 3. There is a lack of scientific judgment for the existing battery discharge voltage, and it is not possible to give a reasonable voltage value, making it difficult to capture and judge abnormal voltage values.
[0010] How to predict the battery discharge voltage and output the relationship between the battery discharge voltage and the discharge duration is a technical problem to be solved. SUMMARY
[0011] The technical task of the present application is to provide a battery discharge prediction method and system based on machine learning to solve the problem of how to predict the battery discharge voltage and output the relationship between the battery discharge voltage and the discharge duration.
[0012] In a first aspect, the battery discharge prediction method based on machine learning of the present application predicts discharge data corresponding to discharge duration H3 based on discharge data of discharge duration H1 and discharge duration H2, the discharge data including discharge voltage and discharge time, H1 < H3 < H2, and the method includes the following steps:
[0013] For the discharge duration H1, a plurality of discharge times are selected from the discharge duration H1, the discharge voltage corresponding to each discharge time is obtained, and each discharge time and the discharge voltage corresponding thereto are discharge data of the discharge duration H1;
[0014] For the discharge duration H2, a plurality of discharge times are selected from the discharge duration H2, the discharge times selected in the first H1 duration of the discharge duration H2 are consistent with the discharge times selected in the H1, the discharge voltage corresponding to each discharge time is obtained, and each discharge time and the discharge voltage corresponding thereto are discharge data of the discharge duration H2;
[0015] The discharge data corresponding to the discharge duration H1 and the discharge duration H2 are respectively subjected to data preprocessing, the discharge data with abnormal discharge voltage is taken as abnormal discharge data, and the abnormal discharge data is cleaned or subjected to interpolation processing to obtain target discharge data;
[0016] The discharge duration H3 is divided into two time periods, the first H1 time period is taken as the first discharge duration, and the second H3-H1 time period is taken as the second discharge duration;
[0017] For the first discharge duration, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are used to fit a discharge curve of the first discharge duration by a polynomial regression algorithm, and the discharge curve is used to represent the relationship between the discharge time and the discharge voltage in the first discharge duration;
[0018] For the second discharge duration, the target discharge data corresponding to the second H2-H1 duration in the discharge duration H2 is taken as input data, and the input data is used to predict the discharge voltage corresponding to each discharge time in the second discharge duration by an LSTM neural network model.
[0019] Preferably, after the discharge data corresponding to the discharge duration H1 and the discharge duration H2 are respectively subjected to preprocessing, the discharge voltage in the discharge data is subjected to outlier detection by an outlier detection algorithm based on Gaussian distribution.
[0020] Preferably, for each discharge time and discharge voltage predicted and output by the LSTM neural network model, the discharge voltage is subjected to outlier detection by an outlier detection algorithm based on Gaussian distribution.
[0021] Preferably, the outlier detection algorithm based on Gaussian distribution is used to detect outliers in the discharge voltage in the discharge data, and includes the following steps:
[0022] The mean value of the discharge voltage in the discharge data is calculated;
[0023] The variance of the discharge voltage in the discharge data is calculated;
[0024] The standard deviation of the discharge voltage in the discharge data is calculated, and the standard deviation is the arithmetic square root of the variance, reflecting the dispersion degree of a data set;
[0025] Based on the standard deviation, the abnormal value of the discharge voltage is detected, and if the discharge voltage is not within the range of the mean value plus or minus 2 standard deviations, it is marked as abnormal data.
[0026] As a preferred, based on the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2, the discharge curve of the first discharge duration is fitted by a polynomial regression algorithm, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are taken as the given fitting data for polynomial curve fitting, and the polynomial is defined as:
[0027]
[0028] Wherein, M is the order of the polynomial, w is the coefficient of the polynomial, and is denoted as W.
[0029] The mean square error is taken as an error function to evaluate the polynomial, and the calculation formula of the mean square error is represented as:
[0030]
[0031] In the fitting process, a regularization factor is added for curve fitting.
[0032] In a second aspect, a battery discharge prediction system based on machine learning is used to predict the discharge voltage of the battery by the battery discharge prediction method based on machine learning in any one of the first aspect, and the system comprises:
[0033] The data acquisition module is used to acquire the discharge data of the discharge duration H1 and the discharge duration H2 for the discharge duration H3 to be predicted, and the discharge data includes the discharge voltage and the discharge time, H1
[0034] The data preprocessing module is configured to perform data preprocessing on the discharge data corresponding to the discharge duration H1 and the discharge duration H2 respectively, take the discharge data with abnormal discharge voltage as abnormal discharge data, and clean or interpolate the abnormal discharge data to obtain target discharge data.
[0035] The segmented prediction module is configured to divide the discharge duration H3 into two time periods, take the first H1 time period as a first discharge duration, and take the second H3-H1 time period as a second discharge duration.
[0036] For the first discharge duration, the segmented prediction module is configured to fit a discharge curve of the first discharge duration by a polynomial regression algorithm based on the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 time period in the discharge duration H2, where the discharge curve is configured to represent the relationship between the discharge time and the discharge voltage in the first discharge duration.
[0037] For the second discharge duration, the segmented prediction module is configured to take the target discharge data corresponding to the second H2-H1 time period in the discharge duration H2 as input data, and predict the discharge voltage corresponding to each discharge time in the second discharge duration based on the input data by an LSTM neural network model.
[0038] Preferably, the system further comprises an outlier detection module configured to perform outlier detection on the discharge voltage in the discharge data by an outlier detection algorithm based on Gaussian distribution.
[0039] Preferably, for each discharge time and discharge voltage predicted by the LSTM neural network model, the outlier detection module is further configured to perform outlier detection on the discharge voltage by the outlier detection algorithm based on Gaussian distribution.
[0040] Preferably, the outlier detection module is configured to perform outlier detection on the discharge voltage in the discharge data by the outlier detection algorithm based on Gaussian distribution by the following steps:
[0041] Calculate the mean of the discharge voltage in the discharge data.
[0042] Calculate the variance of the discharge voltage in the discharge data.
[0043] Calculate the standard deviation of the discharge voltage in the discharge data, where the standard deviation is the arithmetic square root of the variance and reflects the dispersion of a data set.
[0044] Perform outlier detection on the discharge voltage based on the standard deviation, and if the discharge voltage is not within the range of the mean plus or minus two standard deviations, mark it as abnormal data.
[0045] As preferred, the segmented prediction module is used to fit the discharge curve of the first discharge duration by the following steps:
[0046] The target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are taken as the given fitting data, and a polynomial curve fitting is performed, and the polynomial is defined as:
[0047]
[0048] Wherein, M is the order of the polynomial, w is the coefficient of the polynomial, and is denoted as W.
[0049] The mean square error is taken as the error function to evaluate the polynomial, and the calculation formula of the mean square error is:
[0050]
[0051] In the fitting process, a regularization factor is added for curve fitting.
[0052] The battery discharge prediction method and system based on machine learning have the following advantages:
[0053] 1. According to the discharge data corresponding to the existing two discharge durations, the discharge data of the to-be-predicted discharge duration is predicted, and in the prediction process, the to-be-predicted discharge duration is predicted in a segmented manner, and in the overlapping part of the to-be-predicted discharge duration and the adjacent two discharge durations, the discharge curve is fitted based on a polynomial regression algorithm, and in the part not overlapping with the adjacent two discharge durations, the discharge voltage of each discharge time is predicted by using an LSTM deep neural network algorithm, which can meet different scenes and improve the prediction accuracy.
[0054] 2. The influence of the discharge curve of the adjacent voltage on the predicted voltage value is fully considered, and the polynomial regression prediction algorithm is used in the overlapping part of the adjacent discharge durations, so that the loss function of the polynomial is as low as possible, and the real discharge curve is fully fitted.
[0055] 3. In the part not overlapping with the adjacent two discharge durations, the discharge voltage of each discharge time is predicted by using an LSTM deep neural network algorithm, which can accurately and efficiently predict the discharge voltage of each discharge time.
[0056] 4. The discharge time corresponding to the adjacent two discharge durations is preprocessed, which improves the accuracy of subsequent prediction.
[0057] 5. The predicted discharge voltage is detected by an abnormal value detection method based on Gaussian distribution, which improves the accuracy of discharge voltage prediction. BRIEF DESCRIPTION OF DRAWINGS
[0058] In order to make the technical solutions in the embodiments of the present application clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the accompanying drawings in the following description only constitute some embodiments of the present application, and other accompanying drawings can be obtained by those skilled in the art without any creative effort on the basis of these accompanying drawings.
[0059] The present application will be further described below in conjunction with the accompanying drawings.
[0060] Figure 1 A flow chart of a battery discharge prediction method based on machine learning for embodiment 1;
[0061] Figure 2 A prediction curve of discharge voltage in a battery discharge prediction method based on machine learning for embodiment 1;
[0062] Figure 3 A standard deviation curve in the discharge voltage anomaly detection process in a battery discharge prediction method based on machine learning for embodiment 1;
[0063] Figure 4 A discharge voltage prediction curve in a battery discharge prediction method based on machine learning for embodiment 1. DETAILED DESCRIPTION
[0064] The present application will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present application and implement it. However, the embodiments are not intended to limit the present application, and the technical features in the embodiments and the embodiments can be combined with each other without conflict.
[0065] The embodiments of the present application provide a battery discharge prediction method and system based on machine learning, which are used to solve the technical problem of how to predict the battery discharge voltage and output the relationship between the battery discharge voltage and the discharge duration.
[0066] Embodiment 1:
[0067] The present application provides a battery discharge prediction method based on machine learning, which predicts discharge data corresponding to discharge duration H3 based on discharge data of discharge duration H1 and discharge duration H2, the discharge data including discharge voltage and discharge time, H1
[0068] S100, for discharge duration H1, a plurality of discharge times are selected from discharge duration H1, and the discharge voltage corresponding to each discharge time is obtained, each discharge time and the discharge voltage corresponding thereto being the discharge data of the discharge duration H1;
[0069] For the discharge duration H2, a plurality of discharge times are selected from the discharge duration H2, the discharge times selected from the H1 duration in the discharge duration H2 are consistent with the discharge times selected from the H1, the discharge voltage corresponding to each discharge time is obtained, and each discharge time and the discharge voltage corresponding thereto are discharge data of the discharge duration H2;
[0070] S200, respectively, the discharge data corresponding to the discharge duration H1 and the discharge duration H2 is subjected to data preprocessing, the discharge data with abnormal discharge voltage is taken as abnormal discharge data, the abnormal discharge data is cleaned or subjected to interpolation processing, and target discharge data is obtained;
[0071] S300, the discharge duration H3 is divided into two time periods, the first discharge duration is taken as the H1 time period, and the second discharge duration is taken as the H3-H1 time period;
[0072] For the first discharge duration, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the H1 duration in the discharge duration H2 are fitted by a polynomial regression algorithm to obtain a discharge curve of the first discharge duration, and the discharge curve is used to represent the relationship between the discharge time and the discharge voltage in the first discharge duration;
[0073] For the second discharge duration, the target discharge data corresponding to the H2-H1 duration in the discharge duration H2 is taken as input data, and the discharge voltage corresponding to each discharge time in the second discharge duration is predicted based on the input data by an LSTM neural network model.
[0074] In the fitting of the discharge curve of the first discharge duration by the polynomial regression algorithm, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the H1 duration in the discharge duration H2 are taken as given fitting data, and a polynomial curve fitting is performed, and the polynomial is defined as:
[0075]
[0076] Wherein, M is the order of the polynomial, w is the coefficient of the polynomial, and W is denoted.
[0077] The mean square error is taken as an error function to evaluate the polynomial, and the calculation formula of the mean square error is represented as:
[0078]
[0079] In the fitting process, a regularization factor is added for curve fitting.
[0080] The following gives an explanation of segmented prediction: for example, fitting a 2-hour discharge curve with 1-hour and 3-hour discharge curves, then in 0 to 60 minutes, the 1-hour and 3-hour discharge curves both have discharge voltages in this time period. Therefore, in this 0 to 60 minute period, a polynomial regression algorithm is used for fitting and prediction; if there is no common discharge duration between adjacent discharge voltages, after the above prediction is completed, at this time in 61 to 120 minutes, only the 3-hour discharge battery has discharge voltage data, and the 1-hour discharge battery has no discharge voltage in this time period. Therefore, an LSTM neural network is used for prediction in this stage.
[0081] For the same type of base station battery, for the discharge duration to be predicted, the discharge data of the two adjacent discharge durations can be obtained, and the discharge curve of the discharge duration to be predicted is predicted by combining the polynomial fitting and the LSTM neural network model. The application scenario of this method is wide, for example, the discharge data of discharge durations of 1 hour, 3 hours, 10 hours and 20 hours are fitted and predicted to obtain the discharge voltage and discharge duration curve of discharge durations of 2 hours, 4 hours to 20 hours. Through the function relationship between the predicted discharge voltages and discharge durations of different batteries, the method of predicting the future base unit storage battery judges, and alarms for abnormal voltages to inform the operation and maintenance personnel to replace the battery in time to eliminate the fault.
[0082] The specific case of the embodiment is as follows:
[0083] Step 1, data collection, collect the discharge data (discharge time and discharge voltage) corresponding to the discharge durations of 1 hour, 3 hours, 10 hours and 20 hours as historical discharge data, and support user input of any battery discharge time and discharge voltage. The historical discharge data is shown in Table 1, and the discharge curve of each discharge duration is shown in FIG. 1. Figure 2
[0084] Table 1, historical discharge data
[0085]
[0086]
[0087] Step 2, data cleaning process, pre-process the above historical discharge data, clean the abnormal discharge voltage and the corresponding discharge time, or interpolate the discharge voltage with null value to obtain target discharge data;
[0088] Step 3, based on the historical data obtained above, the discharge curve of the duration to be predicted is segmented and predicted, as follows:
[0089] For the discharge duration of 2 hours, the adjacent one is the discharge duration of 1 hour and the discharge duration of 3 hours, the overlapping part is the first 1 hour duration, and the non-overlapping part is the last 1 hour duration; for the first 1 hour duration, the discharge data corresponding to the discharge duration of 1 hour and the discharge data in the first 1 hour duration within the discharge duration of 3 hours are fitting data, and the discharge curve of the first 1 hour duration is fitted by a polynomial regression algorithm; for the last 1 hour duration, the discharge voltage at each discharge time is predicted based on the discharge data in the last 2 hours duration within the discharge duration of 3 hours by an LSTM deep neural network model.
[0090] By the same principle, for the discharge duration of 4 hours, the adjacent one is the discharge duration of 3 hours and the discharge duration of 10 hours, the overlapping part is the first 3 hours duration, and the non-overlapping part is the last 1 hour duration; for the first 3 hours duration, the discharge data corresponding to the discharge duration of 3 hours and the discharge data in the first 3 hours duration within the discharge duration of 10 hours are fitting data, and the discharge curve of the first 3 hours duration is fitted by a polynomial regression algorithm; for the last 1 hour duration, the discharge voltage at each discharge time is predicted based on the discharge data in the last 7 hours duration within the discharge duration of 10 hours by an LSTM deep neural network model.
[0091] In turn, any to-be-predicted discharge duration within the discharge duration of 1 hour to the discharge duration of 20 hours can be discharged and predicted.
[0092] In order to improve the accuracy, after the data cleaning in step 2, the historical data is detected for abnormal values by an abnormal value detection method based on Gaussian distribution, and the abnormal data is removed.
[0093] At the same time, the discharge voltage predicted and output by the LSTM deep neural network model can be detected for abnormal values by an abnormal value detection method based on Gaussian distribution, and an alarm is given for the abnormal values.
[0094] Traditional neural networks are generally fully connected structures, and there is no connection between non-adjacent two layers. It cannot solve the input of time series samples, so RNN is introduced, but there will be gradient disappearance (there will be past time influence factors on current time between different hidden layers, but this influence will weaken as the time span increases). Therefore, LSTM is introduced. LSTM combines the advantages of RNN neural network, fully plays the role of increasing the number of network layers and parameters to increase the fitting of the network, and the use of long and short memory neurons makes the LSTM model very suitable for prediction scenarios. The LSTM neural network method controls the influence of previous information on current information through different three gates.
[0095] The application scenario of the embodiment is suitable for processing and predicting important events with relatively long intervals and delays in time series, such as controlling chat robots, fault prediction, traffic prediction, and the like. Advantages are as follows:
[0096] 1) high accuracy of classification;
[0097] 2) strong parallel distributed processing capability, strong distributed storage and learning capability;
[0098] 3) strong robustness and fault tolerance to noise neurons, and can fully approximate complex nonlinear relationships; 4) has the function of associative memory.
[0099] Through data training model, the API encapsulation in tensorflow is used in the construction process of the network. A simple LSTM network is trained for data prediction. The trained model can be saved and called when used. Finally, the running result is optimized. The prediction sample of the variable is as shown in the formula (1). Figure 4 .
[0100] Embodiment 2
[0101] The application discloses a battery discharge prediction system based on machine learning, comprising a data acquisition module, a data preprocessing module and a segmented prediction module. The system can predict the discharge voltage of the battery by the battery discharge prediction method based on machine learning disclosed in embodiment 1.
[0102] For the to-be-predicted discharge duration H3, the data acquisition module is configured to acquire discharge data of the discharge duration H1 and the discharge duration H2, wherein the discharge data comprises discharge voltage and discharge time, and H1 < H3 < H2; for the discharge duration H1, the data acquisition module is configured to select a plurality of discharge times from the discharge duration H1, and acquire discharge voltage corresponding to each discharge time, wherein each discharge time and the discharge voltage corresponding thereto are discharge data of the discharge duration H1; for the discharge duration H2, the data acquisition module is configured to select a plurality of discharge times from the discharge duration H2, wherein the discharge times selected from the first H1 duration in the discharge duration H2 are consistent with the discharge times selected from the discharge duration H1, and the data acquisition module is configured to acquire discharge voltage corresponding to each discharge time, wherein each discharge time and the discharge voltage corresponding thereto are discharge data of the discharge duration H2.
[0103] The data preprocessing module is configured to perform data preprocessing on the discharge data corresponding to the discharge duration H1 and the discharge duration H2 respectively, to take the discharge data with abnormal discharge voltage as abnormal discharge data, and to clean or interpolate the abnormal discharge data to obtain target discharge data.
[0104] The segmented prediction module is used to divide the discharge duration H3 into two time periods, with the duration of the first H1 time period as the first discharge duration and the duration of the second H3-H1 time period as the second discharge duration.
[0105] For the first discharge duration, the segmented prediction module is used to fit the discharge curve of the first discharge duration based on the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 segment within the discharge duration H2 using a multinomial regression algorithm. The discharge curve is used to represent the relationship between the discharge time and the discharge voltage within the first discharge duration.
[0106] For the second discharge duration, the segmented prediction module is used to take the target discharge data corresponding to the last H2-H1 segment within the discharge duration H2 as input data, and based on the input data, predict and output the discharge voltage corresponding to each discharge time within the second discharge duration through the LSTM neural network model.
[0107] The outlier detection module is used to detect outliers in the discharge voltage in the discharge data using a Gaussian distribution-based outlier detection algorithm through the following steps:
[0108] (1) Calculate the mean value of the discharge voltage in the discharge data;
[0109] (2) Calculate the variance of the discharge voltage in the discharge data;
[0110] (3) Calculate the standard deviation of the discharge voltage in the discharge data. The standard deviation is the arithmetic square root of the variance, which reflects the dispersion of a dataset.
[0111] (4) Detect outliers in discharge voltage based on standard deviation. If the discharge voltage is not within two standard deviations of the mean, it is marked as abnormal data.
[0112] Standard deviation (σ) is the square root of the squared deviations from the mean. It is most commonly used in probability and statistics as a measure of the degree of statistical distribution.
[0113] The standard deviation is the square root of the variance. It reflects the dispersion of a dataset. Two datasets with the same mean may not have the same standard deviation.
[0114] The sum of squares of all numbers minus their mean, divided by the number of numbers in the set (or the number minus one, i.e., the variance), and then the square root of the result, is the standard deviation of the data set.
[0115] like Figure 3 As shown, this embodiment uses plus or minus 2 standard deviations, and its alarm data accuracy is 95%.
[0116] The segmented prediction module is used to fit the discharge curve of the first discharge duration by the following steps:
[0117] The target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are taken as the given fitting data, and a polynomial curve fitting is performed, and the polynomial is defined as:
[0118]
[0119] Where M is the order of the polynomial, w is the coefficient of the polynomial, and W is the coefficient of the polynomial.
[0120] The mean square error is taken as the error function to evaluate the polynomial, and the calculation formula of the mean square error is:
[0121]
[0122] In the fitting process, a regularization factor is added for curve fitting.
[0123] In the segmented prediction module of the present embodiment, the polynomial regression algorithm and the LSTM neural network model are encapsulated as a prediction model. When predicting the discharge voltage, the interface of the prediction model is called, and the output of the prediction model is returned through the interface.
[0124] The interface is implemented as follows:
[0125] The system interface design uses post request for http interface, and only English can be contained in the URL, using English words or abbreviations. The request and response body use UTF-8 encoding, JSON format. If there is an encryption function, the normal JSON can be encrypted and encoded using Base64. This proposal provides two interfaces:
[0126] 1. Known discharge battery type (discharge voltage for how many hours), provide discharge voltage at any time.
[0127] Request URL: http: / / xxx.xx.xx.xx:5000 / predictVoltage
[0128] The request content JSON format is as follows:
[0129]
[0130] Response success content:
[0131]
[0132] Response failure content:
[0133]
[0134] The code field represents the business processing code, and "200" represents success. "400" represents failure.
[0135] 2. The type of discharge battery is known (discharge voltage for how many hours), the discharge voltage and discharge time are provided, and it is determined whether the discharge voltage at this time is normal.
[0136] Request URL: http: / / xxx.xx.xx.xx:5000 / anomalyDetection
[0137] The request content JSON format is as follows:
[0138]
[0139] Response success content:
[0140]
[0141]
[0142] Response failure content:
[0143]
[0144] The code field represents the business processing code, and "200" represents success. "400" represents failure.
[0145] As an improvement, the system further comprises an anomaly value detection module for performing anomaly value detection on the discharge voltage in the discharge data through a Gaussian distribution-based anomaly value detection algorithm. For each discharge time and discharge voltage predicted and output by the LSTM neural network model, the anomaly value detection module is further configured to perform anomaly value detection on the discharge voltage through a Gaussian distribution-based anomaly value detection algorithm.
[0146] The above has been described in detail by the drawings and preferred embodiments, but the present application is not limited to these disclosed embodiments, and those skilled in the art can know that the code review means in the above different embodiments can be combined to obtain more embodiments of the present application, and these embodiments are also within the protection scope of the present application.
Claims
1. A method for predicting battery discharge based on machine learning, characterized by Based on the discharge data of the discharge duration H1 and the discharge duration H2, the discharge data corresponding to the discharge duration H3 is predicted, the discharge data including the discharge voltage and the discharge time, H1 < H3 < H2, and the method includes the following steps: For the discharge duration H1, a plurality of discharge times are selected from the discharge duration H1, the discharge voltage corresponding to each discharge time is obtained, and each discharge time and the discharge voltage corresponding thereto are the discharge data of the discharge duration H1; For the discharge duration H2, a plurality of discharge times are selected from the discharge duration H2, the discharge times selected from the first H1 duration in the discharge duration H2 are consistent with the discharge times selected from the H1, the discharge voltage corresponding to each discharge time is obtained, and each discharge time and the discharge voltage corresponding thereto are the discharge data of the discharge duration H2; The discharge data corresponding to the discharge duration H1 and the discharge duration H2 is respectively preprocessed, the discharge data with abnormal discharge voltage is taken as abnormal discharge data, the abnormal discharge data is cleaned or interpolated, and target discharge data is obtained; The discharge duration H3 is divided into two time periods, the first H1 time period is taken as the first discharge duration, and the second H3-H1 time period is taken as the second discharge duration; For the first discharge duration, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are used as input data, and a discharge curve of the first discharge duration is fitted by a polynomial regression algorithm, the discharge curve being used to represent the relationship between the discharge time and the discharge voltage in the first discharge duration; For the second discharge duration, the target discharge data corresponding to the H2-H1 duration in the discharge duration H2 is taken as input data, and the discharge voltage corresponding to each discharge time in the second discharge duration is predicted based on the input data by an LSTM neural network model.
2. The machine learning based battery discharge prediction method of claim 1, wherein After the discharge data corresponding to the discharge duration H1 and the discharge duration H2 is respectively preprocessed, the discharge voltage in the discharge data is detected by an abnormal value detection algorithm based on Gaussian distribution.
3. The machine learning based battery discharge prediction method of claim 1, wherein For each discharge time and discharge voltage predicted by the LSTM neural network model, the discharge voltage is detected by an abnormal value detection algorithm based on Gaussian distribution.
4. The machine learning-based prediction method of battery discharge according to claim 2 or 3, characterized in that The abnormal value detection algorithm based on Gaussian distribution detects the discharge voltage in the discharge data, including the following steps: The mean of the discharge voltage in the discharge data is calculated; The variance of the discharge voltage in the discharge data is calculated; The standard deviation of the discharge voltage in the discharge data is calculated, and the standard deviation is the arithmetic square root of the variance, reflecting the dispersion degree of a data set; The discharge voltage is detected based on the standard deviation, and if the discharge voltage is not within 2 standard deviations of the mean, it is marked as abnormal data.
5. The machine learning based battery discharge prediction method according to any one of claims 1-3, characterized in that When the discharge curve of the first discharge duration is fitted by a polynomial regression algorithm based on the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2, the target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration in the discharge duration H2 are taken as given fitting data, and a polynomial curve fitting is performed, the polynomial being defined as: Wherein, M is the order of the polynomial, w is the coefficient of the polynomial, denoted as W; The mean square error is used as an error function to evaluate the polynomial, and the mean square error calculation formula is represented as: In the fitting process, a regularization factor is added for curve fitting.
6. A machine learning based battery discharge prediction system, characterized by The system for predicting the discharge voltage of the battery by the machine learning-based battery discharge prediction method according to any one of claims 1-5, the system comprising: The data acquisition module is configured to acquire discharge data of the discharge time H1 and the discharge time H2 for the to-be-predicted discharge time H3, the discharge data including discharge voltages and discharge times, and H1 < H3 < H2; for the discharge time H1, the data acquisition module is configured to select a plurality of discharge times from the discharge time H1, and acquire a discharge voltage corresponding to each of the discharge times, each of the discharge times and the corresponding discharge voltage being the discharge data of the discharge time H1; for the discharge time H2, the data acquisition module is configured to select a plurality of discharge times from the discharge time H2, the discharge times selected from the first H1 time duration of the discharge time H2 being consistent with the discharge times selected from the discharge time H1, and acquire a discharge voltage corresponding to each of the discharge times, each of the discharge times and the corresponding discharge voltage being the discharge data of the discharge time H2; The data preprocessing module is configured to perform data preprocessing on the discharge data corresponding to the discharge time H1 and the discharge time H2, respectively, and to acquire target discharge data by cleaning or interpolating abnormal discharge data with abnormal discharge voltages. The segmented prediction module is configured to divide the discharge time H3 into two time durations, the first H1 time duration being the first discharge time, and the second H3-H1 time duration being the second discharge time. For the first discharge time, the segmented prediction module is configured to fit a discharge curve of the first discharge time by a polynomial regression algorithm based on the target discharge data corresponding to the discharge time H1 and the target discharge data corresponding to the first H1 time duration of the discharge time H2, the discharge curve being configured to represent a relationship between discharge times and discharge voltages in the first discharge time. For the second discharge time, the segmented prediction module is configured to acquire the target discharge data corresponding to the second H2-H1 time duration of the discharge time H2 as input data, and to predict and output a discharge voltage corresponding to each of the discharge times in the second discharge time by an LSTM neural network model based on the input data.
7. The machine learning-based battery discharge prediction system of claim 6, wherein The system further comprises an outlier detection module configured to detect outliers in the discharge voltages of the discharge data by an outlier detection algorithm based on a Gaussian distribution.
8. The machine learning based battery discharge prediction system of claim 6, wherein For each of the discharge times and the discharge voltages predicted and output by the LSTM neural network model, the outlier detection module is further configured to detect outliers in the discharge voltages by the outlier detection algorithm based on the Gaussian distribution.
9. The machine learning based battery discharge prediction system of claim 7 or 8, wherein The outlier detection module is configured to detect outliers in the discharge voltages of the discharge data by the outlier detection algorithm based on the Gaussian distribution by the following steps: calculating a mean value of the discharge voltages of the discharge data; Calculate the variance of the discharge voltage in the discharge data; Calculate the standard deviation of the discharge voltage in the discharge data, which is the arithmetic square root of the variance, reflecting the degree of dispersion of a data set; Based on the standard deviation, the discharge voltage is detected for outliers, and if the discharge voltage is not within 2 standard deviations of the mean, it is marked as abnormal data.
10. The machine learning based battery discharge prediction system of any of claims 6-8, wherein The segmented prediction module is used to fit the discharge curve of the first discharge duration by the following steps: The target discharge data corresponding to the discharge duration H1 and the target discharge data corresponding to the first H1 duration within the discharge duration H2 are taken as the given fitting data, and a polynomial curve fitting is performed, and the polynomial is defined as: Where M is the order of the polynomial, w is the coefficient of the polynomial, and W is the coefficient of the polynomial. The mean square error is used as the error function to evaluate the polynomial, and the calculation formula of the mean square error is: In the fitting process, a regularization factor is added for curve fitting.
Citation Information
Patent Citations
Analysis method for predicting discharge time of storage battery
CN108072848A
Early warning method and system for battery of energy storage power station
CN114400738A