Electric power material warehouse-out quantity prediction method based on LSTM and exponential smoothing method

By combining LSTM and index smoothing method, the problems of high information loss and data stability requirements in power material demand prediction are solved, and more accurate and robust prediction results are achieved, providing more reliable support for power material demand planning and supply chain management.

CN119623678APending Publication Date: 2025-03-14STATE GRID GANSU ELECTRIC POWER CO MATERIALS CO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311850128.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The prior art has problems of information loss and high data stationarity requirements in the prediction of power material demand. The ARIMA model performs poorly when processing nonlinear and non-stationary data, while the BP neural network relies on a large amount of training data and has poor generalization ability when lacking sufficient data.

Method used

The power material outbound volume prediction method based on LSTM and exponential smoothing method is used to predict the preprocessed data through the LSTM model, and the prediction results of the two are combined with the exponential smoothing method.

Benefits of technology

Overcoming the limitations of ARIMA and BP neural networks, achieving a more comprehensive capture of nonlinear features in the data, improving prediction accuracy and robustness, and providing more reliable decision support for the reasonable planning of power material demand and supply chain management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623678A_ABST
    Figure CN119623678A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power material ex-warehouse quantity prediction method based on LSTM and an exponential smoothing method, and the method comprises the steps: obtaining material ex-warehouse data, carrying out the preprocessing of the material ex-warehouse data, carrying out the prediction of the preprocessed material ex-warehouse data based on an LSTM model, and obtaining a first prediction result; predicting the preprocessed material ex-warehouse data based on an exponential smoothing method to obtain a second prediction result; and performing linear regression weighting on the first prediction result and the second prediction result to obtain a final prediction result. According to the invention, the nonlinear features in the data can be captured more comprehensively. As the LSTM and the exponential smoothing method are excellent in performance in different aspects, the combination of the LSTM and the exponential smoothing method can obtain a better comprehensive effect in processing demand prediction tasks with relatively large fluctuation such as electric power materials and the like. According to the method, the prediction accuracy and robustness are improved, and more reliable decision support is provided for reasonable planning of electric power material demands and supply chain management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of demand forecasting for electric power materials, and in particular relates to a method for forecasting the outbound quantity of electric power materials based on LSTM and exponential smoothing method. Background Art

[0002] The purpose of material outbound forecasting is to reasonably estimate and predict the quantity of materials required by the enterprise in the future to meet the needs of production, sales and services. Through accurate material outbound forecasting, enterprises can manage inventory levels more effectively and avoid excessive inventory and inventory shortages. The main purpose of inventory control is to minimize inventory costs while meeting customer needs. Effective inventory management helps maintain the balance of the supply chain, ensuring that enterprises have sufficient inventory to cope with demand fluctuations, while avoiding excessive inventory leading to waste of resources. In the current development environment, power material enterprises need to effectively deal with a series of problems such as procurement and inventory control of power materials on the basis of ensuring the supply of materials for power enterprises, so as to ensure that they remain competitive in the tide of economic development. ARIMA is a statistical model for time series analysis and forecasting, which consists of three parts: autoregression, integration and moving average. The model is suitable for relatively stable time series data, models historical data, and then uses the model to predict future values. Although ARIMA is a classic time series analysis method, other more complex models may need to be considered when dealing with nonlinear, non-stationary or dynamically changing time series data.

[0003] When using ARIMA to forecast power material demand, it is necessary to consider whether the power material demand time series contains nonlinear trends or relationships. In fact, the power material demand time series data has seasonality and needs to be differentiated or other preprocessing steps to make it stable. This may lead to information loss, especially when long-term trends or complex seasonality are involved.

[0004] Backpropagation Neural Network (BP Neural Network) is an artificial neural network based on supervised learning. It consists of an input layer, a hidden layer, and an output layer. The weights are adjusted through the backpropagation algorithm to minimize the error between the network output and the actual target.

[0005] When using BP neural network to predict power material demand, it is necessary to consider whether the amount of historical data is large enough. BP neural network usually requires a large amount of training data to achieve good performance. In the case of less data, the model may be overly dependent on training data and have poor generalization ability.

[0006] The ARIMA model has relatively weak fitting ability when dealing with nonlinear time series and non-stationary time series, and has high requirements for the stability and integrity of the data. On the contrary, the BP neural network can handle nonlinear relationships and complex patterns, but it relies on a large amount of training data, and the lack of sufficient data can easily lead to underfitting of the model. For situations such as power materials where demand fluctuates greatly and data is relatively limited, the above problems are particularly significant. Summary of the invention

[0007] In order to solve the above technical problems, the present invention proposes a method for predicting the outbound quantity of electric power materials based on LSTM and exponential smoothing method to solve the problems existing in the above-mentioned prior art.

[0008] To achieve the above object, the present invention provides a method for predicting the outbound quantity of electric power materials based on LSTM and exponential smoothing method, comprising:

[0009] Obtaining material outbound data and preprocessing the material outbound data, and predicting the preprocessed material outbound data based on the LSTM model to obtain a first prediction result;

[0010] Predicting the preprocessed material delivery data based on an exponential smoothing method to obtain a second prediction result;

[0011] Perform linear regression weighting on the first prediction result and the second prediction result to obtain a final prediction result.

[0012] Optionally, the material outbound data includes: year, warehouse code, warehouse name, usage order number, outbound order number, outbound time, material name, material code, material category, outbound quantity and unit of measurement.

[0013] Optionally, the process of preprocessing the material outbound data includes:

[0014] Detect whether there are missing values ​​in the material outbound data, and if so, fill in the missing values ​​by interpolation;

[0015] The material outbound data that has completed interpolation filling is normalized to complete preprocessing.

[0016] Optionally, the process of normalizing the interpolated and filled material outbound data includes:

[0017]

[0018] Among them, data(i) normalizedrepresents a certain data after normalization, data(i) represents a certain data before normalization, min(data) represents the minimum value of all data before normalization, and max(data) represents the maximum value of all data before normalization.

[0019] Optionally, the process of predicting the preprocessed material delivery data based on the LSTM model to obtain a first prediction result includes:

[0020] Build an LSTM model based on the Sequential model in the Keras library;

[0021] Then, the pre-processed material delivery data is divided into a training set and a test set;

[0022] The number of preset training cycles is used to input the training set into the LSTM model for training, and the training is completed when the number of training cycles is reached;

[0023] The test set is input into the trained LSTM model for prediction to obtain a first prediction result.

[0024] Optionally, the LSTM model includes neurons, a fully connected layer, an Adam optimizer and a mean square error loss function.

[0025] Optionally, the process of predicting the preprocessed material delivery data based on the exponential smoothing method includes: predicting the preprocessed material delivery data based on the simple exponential smoothing method.

[0026] Optionally, the process of predicting the pre-processed material delivery data based on a simple exponential smoothing method includes:

[0027]

[0028] in, represents the predicted value at time t+1, and Ft represents the actual observed value at time t. It represents the predicted value at the tth moment, α is the smoothing coefficient, and its value range is between 0 and 1.

[0029] Optionally, before performing linear regression weighting on the first prediction result and the second prediction result, the method further includes:

[0030] Actual observation values ​​are obtained, and a feature matrix is ​​constructed based on the first prediction result and the second prediction result.

[0031] Optionally, the process of performing linear regression weighting on the first prediction result and the second prediction result to obtain a final prediction result includes:

[0032] Based on the feature matrix, respectively calculating weights of the first prediction result and the second prediction result, and obtaining a prediction value based on the weight results;

[0033] Comparing the predicted value with the actual observed value to obtain a comparison result;

[0034] Adjusting the weights of the first prediction result and the second prediction result based on the comparison result to obtain an optimal weight value;

[0035] The final prediction result is obtained based on the optimal weight value.

[0036] Compared with the prior art, the present invention has the following advantages and technical effects:

[0037] The present invention proposes a method for predicting the outbound quantity of power materials based on LSTM and exponential smoothing, which organically combines the long short-term memory network (LSTM) model and the exponential smoothing method. The prediction process of the combined model is to use the LSTM model to predict the demand, then predict it through the exponential smoothing method, and finally merge the prediction results of the two through the weighted method of linear regression to obtain the final comprehensive prediction result.

[0038] Through this innovative method, the present invention overcomes some limitations of the ARIMA model and the BP neural network model, and achieves a more comprehensive capture of nonlinear characteristics in the data. Since LSTM and exponential smoothing methods perform well in different aspects, their combination can achieve better comprehensive results in dealing with demand forecasting tasks with large fluctuations such as power materials. The present invention improves the accuracy and robustness of forecasts, and provides more reliable decision support for the rational planning of power material demand and supply chain management. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0040] Figure 1 This is a schematic diagram of LSTM prediction of material “500009917” in an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram of LSTM prediction of material "500023645" in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram of exponential smoothing prediction of material “500009917” according to an embodiment of the present invention;

[0043] Figure 4 This is a schematic diagram of exponential smoothing prediction of material "500023645" according to an embodiment of the present invention;

[0044] Figure 5 This is a weighted prediction diagram of material "500009917" in an embodiment of the present invention;

[0045] Figure 6 This is a schematic diagram of weighted prediction of material "500023645" in an embodiment of the present invention;

[0046] Figure 7 The figure is a schematic diagram of a method flow of an embodiment of the present invention. DETAILED DESCRIPTION

[0047] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0048] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0049] Embodiment 1

[0050] like Figure 1-2 As shown, in this embodiment, a method for predicting the outbound quantity of electric power materials based on LSTM and exponential smoothing method is provided, including:

[0051] This method proposes to use a deep learning model based on the long short-term memory network (LSTM) and the exponential smoothing method to make a weighted forecast of the power material outbound volume, determine the power material demand of Company G in the future, and provide a reference for the formulation of the subsequent power material inventory control strategy. While conducting a weighted forecast of the power material outbound volume, we will focus on two different but complementary methods: the long short-term memory network (LSTM) and the exponential smoothing method, and use the multivariate linear regression model to determine the weights to obtain the final forecast results. The method flowchart is shown in the figure below: Figure 7 shown.

[0052] Long Short-Term Memory (LSTM) is a deep learning model commonly used to process and learn sequence data. It is designed to solve the defects of traditional recurrent neural networks (RNN) that are prone to gradient vanishing or gradient exploding when processing long sequences, so as to more effectively capture and remember long-term dependencies in sequences. Its core is to build a memory cell that has the function of selectively memorizing information, enabling it to filter and store key information while filtering out noise information, thereby effectively reducing the memory burden. To achieve this network function, LSTM introduces the design of forget gate, input gate and output gate.

[0053] The forget gate is responsible for determining how much previous information is retained in the memory cell, and its output generated by a sigmoid activation function determines the degree of forgetting the previous information. The input gate is responsible for updating the information in the memory cell, and the output generated by the sigmoid activation function determines which information needs to be updated, while the output generated by the tanh activation function provides new candidate values. Finally, the output gate controls which parts of the information will be passed to the next moment through the output generated by the sigmoid activation function. The design of this series of gates enables LSTM to efficiently capture and memorize long-term dependencies in sequence data by carefully regulating the flow of information.

[0054] Exponential smoothing is a method for smoothing and forecasting time series data, especially for data with trends and seasonal changes. The method is based on the weighted average of past observations, so that the predicted value at time t+1 is equal to the weighted average of the actual observation at time t and the predicted value at time t. The further the observation time is, the exponentially lower the weight is. Specifically, the update formula of simple exponential smoothing is as follows:

[0055]

[0056] in, represents the predicted value at time t+1, F t represents the actual observation value at time t, Represents the predicted value at time t. α is the smoothing coefficient, which ranges from 0 to 1. The closer the smoothing coefficient is to 1, the greater the weight given to the more recent observations, and the weight of the more distant observations drops sharply. It is suitable for sequences with large random fluctuations. The closer the smoothing coefficient is to 0, the slower the model responds to changes in the time series, and the smoother the model. Generally speaking, when the time series has large random fluctuations, it is advisable to choose a larger α, but in actual applications, multiple α can be selected for prediction, and the one with the smallest prediction error can be found as the final α value.

[0057] The advantage of LSTM is that it can capture long-term dependencies. LSTM can better learn and understand the complex, nonlinear dynamic patterns contained in time series. This makes it perform well in time series data with long-term memory dependencies. By introducing LSTM into the combined model, the model can better cope with long-term dynamic changes in time series data. Exponential smoothing can capture trends and seasonal changes in the sequence, especially for relatively stable time series data. Exponential smoothing is suitable for some relatively simple time series data problems. By introducing exponential smoothing into the combined model, the model can better cope with medium- and short-term changes in time series data. By weighted combination of these two models, their advantages in different aspects can be utilized to improve the overall prediction performance. Therefore, this method uses a weighted combination algorithm based on LSTM-exponential smoothing to predict the outbound volume of power materials. Different power material demands have different trends, and a single algorithm has errors in predicting different materials. Therefore, the two algorithms are weighted for prediction, and different weights are used for prediction of different materials to obtain more accurate results.

[0058] After obtaining the prediction results of the above two algorithms, it is necessary to weight the two algorithms to obtain the final prediction results. In the calculation weight part, select the multivariate linear regression model, and assign appropriate weights to each model by modeling the impact of different models on the target variable. The form of the model is as follows:

[0059] Y=ω1X1+ω2X2+b (2)

[0060] Among them, Y is the final demand forecast value, X1 is the forecast value of the LSTM model, X2 is the forecast value of the exponential smoothing method, ω1 is the weight of the LSTM model, ω2 is the weight of the exponential smoothing method, and b is the intercept. When calculating the weight, the intercept is set to 0 to measure the optimal weights ω1 and ω2.

[0061] Data preparation process:

[0062] The data used in the present invention comes from the warehouse delivery order and details of G Company. The data includes all warehouse delivery data from January 3, 2023 to August 30, 2023, including year, warehouse code, warehouse name, usage order number, warehouse delivery order number, delivery time, material name, material code, material category, quantity delivered and measurement unit. This part mainly predicts the delivery quantity of materials, and the main extracted data are delivery time, material number, and quantity delivered for further processing. In view of the fact that the delivery of some materials does not occur every day, but in a longer time interval, this method chooses to accumulate the delivery quantity of materials in a two-week time window and use it as the delivery quantity to be predicted. The 415 power material delivery situations provided by G Company were screened to obtain 95 power material delivery quantities. Each material includes 17 delivery quantities, and each delivery quantity is the sum of the delivery quantities of the material in two weeks. The weighted combination prediction analysis of LSTM-exponential smoothing method will be performed based on the above data.

[0063] Data preprocessing process:

[0064] Detect and handle missing values ​​in the data, and fill in missing values ​​by using interpolation and other methods. At the same time, detect and handle outliers in the data, which can prevent outliers from having a bad impact on the model.

[0065] When using LSTM for prediction, normalization must be performed first, because LSTM is based on the gradient descent algorithm for parameter optimization. Normalization can reduce the numerical differences between different features, thereby speeding up the convergence of the gradient descent algorithm. The specific conversion formula is as follows:

[0066]

[0067] Among them, data(i) normalized represents a certain data after normalization, data(i) represents a certain data before normalization, min(data) represents the minimum value of all data before normalization, and max(data) represents the maximum value of all data before normalization.

[0068] Model evaluation process:

[0069] The present invention uses three indicators, namely, mean absolute percentage error (MAPE), mean absolute error (MAE) and root mean square error (RMSE), to evaluate the model.

[0070] Mean Absolute Percent Error (MAPE):

[0071] MAPE (Mean Absolute Percentage Error) is a metric used to measure prediction error, especially for regression problems. MAPE calculates the average of the percentage errors between the predicted value and the actual value. The smaller the MAPE value, the better, indicating that the model has a smaller prediction error. The calculation formula is as follows:

[0072]

[0073] Where n represents the number of samples, Y i represents the actual value of the ith observation, represents the predicted value of the ith observation, and the final result is multiplied by 100% error expressed as a percentage.

[0074] Mean Absolute Error (MAE):

[0075] MAE (Mean Absolute Error) is an indicator used to measure prediction error, usually used for regression problems. MAE calculates the average of the absolute errors between the predicted value and the actual value. The smaller the MAE value, the better, indicating that the prediction error of the model is smaller. The calculation formula is as follows:

[0076]

[0077] Where n represents the number of samples, Y i represents the actual value of the ith observation, represents the predicted value of the ith observation.

[0078] Root Mean Square Error (RMSE):

[0079] RMSE (Root Mean Squared Error) is an indicator used to measure prediction error, usually used for regression problems. RMSE calculates the root mean square of the square error between the predicted value and the actual value. The smaller the RMSE value, the better, indicating that the prediction error of the model is smaller. The calculation formula is as follows:

[0080]

[0081] Where n represents the number of samples, Y i represents the actual value of the ith observation, represents the predicted value of the ith observation.

[0082] Model prediction process:

[0083] The present invention uses LSTM and exponential smoothing method to predict the outbound quantity of power materials, and then uses the multivariate linear regression model to determine the weights to obtain the final prediction results. In the present invention, power materials with material numbers "500009917" (infrared thermal imager, 110kv) and "500023645" (insulated electrician tool set) are selected for prediction and the results are displayed.

[0084] LSTM prediction:

[0085] The Sequential model in the Keras library of the present invention creates an LSTM model, specifies the number of neurons in the LSTM layer as 64, adds a fully connected layer for regression tasks, specifies the optimizer as Adam, and specifies the loss function as mean square error. Set epochs to 1000 so that the model will be trained in 1000 training cycles. Set batch_size to 1, and use stochastic gradient descent to consider only one sample per update. Other parameters are calculated using default values.

[0086] The prediction results of the two materials using LSTM are as follows: Figure 1 and 2 shown.

[0087] Exponential smoothing forecast:

[0088] When using exponential smoothing method for prediction, there are simple exponential smoothing method, first exponential smoothing method and second exponential smoothing method. This invention uses simple exponential smoothing method for prediction, and the exponential smoothing coefficient is 0.8. The comparison between the predicted value and the true value of the two materials is as follows: Figure 3 and Figure 4 shown.

[0089] Weighted combination model prediction:

[0090] After using LSTM and exponential smoothing methods for prediction, the weights of the two models are calculated using a multivariate linear regression model. After combining the prediction results of the two models into a feature matrix, the multivariate linear regression model attempts to find the best weight value to minimize the difference between the predicted value and the actual observed value. For the material "500009917", the final weight values ​​obtained are ω1=0.15619124, ω2=0.85789608. The comparison between the predicted value and the actual value is shown in Figure 2. Figure 5 As shown. For the material "500023645", the final weight values ​​are ω1 = 0.34041678, ω2 = 0.67930561, and the comparison between the predicted value and the true value is Figure 6 shown.

[0091] Because the range of the adopted data is too large, in order to more intuitively reflect and compare the advantages and disadvantages of the prediction model, the three evaluation criteria of MAPE, MAE and RMSE are calculated using standardized data, and the results are shown in Table 1. For material "500023645", after comprehensive prediction, the MAPE index is 1.927 lower than LSTM and 0.026 lower than the exponential smoothing method; the MAE index is 1.481 lower than LSTM; the RMSE index is 1.823 lower than LSTM and 0.54 lower than the exponential smoothing method. For material "500009917", after comprehensive prediction, the MAPE index is 0.595 lower than the exponential smoothing method; the MAE index is 0.163 lower than the exponential smoothing method; the RMSE index is 1.553 lower than LSTM and 0.254 lower than the exponential smoothing method. From the above data, it can be seen that the weighted prediction of the exponential smoothing method and LSTM has a certain improvement on both individual algorithms, making inventory prediction more accurate.

[0092] Table 1

[0093]

[0094] In terms of the forecast of the outbound volume, the present invention uses a deep learning model based on the long short-term memory network (LSTM) and a weighted combination model of the exponential smoothing method to forecast the outbound volume of power materials. LSTM is suitable for processing sequence data, and the exponential smoothing method shows excellent effects on smoothing trends and seasonal changes.

[0095] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for predicting the outbound quantity of electric power materials based on LSTM and exponential smoothing method, characterized in that: The following steps are involved: Obtaining material outbound data and preprocessing the material outbound data, and predicting the preprocessed material outbound data based on the LSTM model to obtain a first prediction result; Predicting the preprocessed material delivery data based on an exponential smoothing method to obtain a second prediction result; Perform linear regression weighting on the first prediction result and the second prediction result to obtain a final prediction result.

2. The method according to claim 1, characterized in that The material outbound data includes: year, warehouse code, warehouse name, usage order number, outbound order number, outbound time, material name, material code, material category, outbound quantity and unit of measurement.

3. The method according to claim 2, characterized in that The process of preprocessing the material outbound data includes: Detect whether there are missing values ​​in the material outbound data, and if so, fill in the missing values ​​by interpolation; The material outbound data that has completed interpolation filling is normalized to complete preprocessing.

4. The method according to claim 3, characterized in that The process of normalizing the interpolated and filled material outbound data includes: Among them, data(i) normalized represents a certain data after normalization, data(i) represents a certain data before normalization, min(data) represents the minimum value of all data before normalization, and max(data) represents the maximum value of all data before normalization.

5. The method according to claim 1, characterized in that The process of predicting the preprocessed material delivery data based on the LSTM model to obtain the first prediction result includes: Build an LSTM model based on the Sequential model in the Keras library; Then, the pre-processed material delivery data is divided into a training set and a test set; The number of preset training cycles is used to input the training set into the LSTM model for training, and the training is completed when the number of training cycles is reached; The test set is input into the trained LSTM model for prediction to obtain a first prediction result.

6. The method according to claim 5, characterized in that The LSTM model includes neurons, a fully connected layer, an Adam optimizer and a mean square error loss function.

7. The method according to claim 1, characterized in that The process of predicting the preprocessed material delivery data based on the exponential smoothing method includes: predicting the preprocessed material delivery data based on the simple exponential smoothing method.

8. The method according to claim 7, characterized in that The process of predicting the pre-processed material delivery data based on the simple exponential smoothing method includes: in, represents the predicted value at time t+1, F t represents the actual observation value at time t, It represents the predicted value at the tth moment, α is the smoothing coefficient, and its value range is between 0 and 1.

9. The method according to claim 1, characterized in that: Before performing linear regression weighting on the first prediction result and the second prediction result, the method further includes: Actual observation values ​​are obtained, and a feature matrix is ​​constructed based on the first prediction result and the second prediction result.

10. The method according to claim 9, characterized in that The process of performing linear regression weighting on the first prediction result and the second prediction result to obtain a final prediction result includes: Based on the feature matrix, respectively calculating weights of the first prediction result and the second prediction result, and obtaining a prediction value based on the weight results; Comparing the predicted value with the actual observed value to obtain a comparison result; Adjusting the weights of the first prediction result and the second prediction result based on the comparison result to obtain an optimal weight value; The final prediction result is obtained based on the optimal weight value.