REP criterion-based natural gas consumption prediction method, device and equipment
Through the method based on REP criteria, the prediction of natural gas consumption is solved, and the problem of insufficient prediction accuracy and reliability in the prior art is achieved, and the ability to consider external factors is achieved.
Patent Information
- Application Number
- CN202411694444.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-04
AI Technical Summary
The existing natural gas consumption forecasting methods have low accuracy and reliability, and have failed to effectively consider factors such as external environment and climate change.
Using a method based on REP criterion, the historical data of natural gas consumption and initial influencing factors are obtained, pre-processing and single-model prediction are performed, and the weight is optimized with the reciprocal mean square error method to combine the prediction results.
The accuracy and reliability of the prediction results of natural gas consumption are improved, and the representation of historical data by out-of-sample predictions is taken into account, thereby enhancing the accuracy of the prediction.
Smart Images

Figure CN119761685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural gas management, and more specifically, to a natural gas consumption prediction method, device and equipment based on REP criterion. Background Art
[0002] In recent years, many clean energy sources have attracted people's attention, and concepts such as green and environmental protection have been deeply rooted in people's minds and become an international trend. In this context, natural gas, as a high-quality, efficient, low-carbon clean energy, has attracted wide attention worldwide for its development and utilization. Natural gas has also become an important energy source for the country to adjust its energy structure and transform to low-carbon sustainable development. China's total natural gas consumption and consumption proportion have shown a trend of increasing year by year, and the industry has developed rapidly.
[0003] Natural gas consumption forecast is the basis for energy planning and resource allocation. By forecasting future natural gas demand, the government and energy companies can better plan the construction of natural gas supply networks, storage facilities and gas pipelines to ensure the stability and reliability of energy supply. The natural gas consumption forecast results will help the energy sector to rationally arrange natural gas extraction, import and storage plans to meet market demand and avoid economic losses caused by supply shortages or surpluses.
[0004] At present, the existing natural gas consumption forecasting methods are mainly based on simple linear extrapolation of historical natural gas supply data. The existing natural gas consumption forecasting mainly relies on a large amount of historical data. If the historical data is inaccurate, incomplete or biased, it will directly affect the accuracy and reliability of the forecast results. Moreover, the existing natural gas consumption forecasting methods do not consider the impact of various factors such as the external environment and climate change on natural gas consumption, resulting in a large deviation between the predicted natural gas consumption and the actual natural gas consumption. Summary of the invention
[0005] In view of this, the present invention provides a natural gas consumption prediction method, device and equipment based on the REP criterion, which are used to solve the problem of low accuracy and reliability of prediction results in existing natural gas consumption prediction methods.
[0006] To achieve the above objectives, the proposed solution is as follows:
[0007] A natural gas consumption forecasting method based on the REP criterion includes:
[0008] Obtain historical consumption data of natural gas consumption and a set of initial influencing factors;
[0009] Preprocess the historical consumption data and the initial influencing factor set to obtain the target influencing factor set;
[0010] Each prediction model in the single model prediction pool performs a single model prediction on natural gas consumption based on the target influencing factor set and historical consumption data. The single model prediction pool includes two types of prediction models: pre-trained statistical models and machine learning models.
[0011] Under the REP criterion, the reciprocal mean square error method is used to solve the weight optimization model, and the prediction results of the prediction models are combined based on the weights in the weight optimization model to obtain the combined prediction results.
[0012] Preferably, the process of preprocessing the historical consumption data and the initial influencing factor set includes:
[0013] Fill missing values in historical consumption data and initial influencing factor set by linear interpolation;
[0014] The mutual information method is used to calculate the dependence between each influencing factor in the initial influencing factor set and the natural gas consumption data;
[0015] The influencing factors in the initial influencing factor set are screened according to the dependency to obtain a target influencing factor set.
[0016] Preferably, the single model prediction pool includes a statistical model and a machine learning model;
[0017] Wherein, the statistical model includes at least one of a linear regression model and a ridge regression model;
[0018] The machine learning model includes at least one of a support vector machine, a long short-term memory network model, a back propagation neural network, and a recursive neural network model.
[0019] Preferably, the process of solving the weight optimization model by using the inverse mean square error method under the REP criterion and combining the prediction results of the prediction model based on the weights in the weight optimization model includes:
[0020] The REP value of each prediction model is calculated based on the prediction results of each prediction model on the validation set and the true value;
[0021] The sum of squares of the prediction errors of each prediction model in the reciprocal mean square error method is replaced by the REP value of each prediction model, and the optimal weight of each prediction model is calculated to obtain a weight optimization model;
[0022] The optimal weights and prediction results of each prediction model are combined to obtain a combined prediction result.
[0023] Preferably, the REP criterion includes a concurrent part representing the performance within the sample and an asynchronous part measuring the representativeness gap. The REP criterion formula is:
[0024]
[0025] in, is the performance error, is the representative error, ||,|| is the L1 norm between two vectors; n represents the data length in the sample, p represents the sample window length, and δ is between 0 and 1; y [i] is the i-th window of the true value y in the sample, and are the true values y in the sample [i] , Box-Cox transformation of the in-sample fitted value g and the out-of-sample predicted value f.
[0026] Preferably, the process of solving the weight optimization model by the inverse mean square error method includes:
[0027] The weights are defined as:
[0028]
[0029] Among them, ω i represents the weight of the i-th prediction model, is the prediction error sum of squares (PESS) of the ith prediction model, [x 1 , x 2 ,...,x n ] is the index sequence of the predicted object, x it Represents the time series x t The predicted output of the i-th prediction model at time point t, e it =(x t -x it ) is the residual of the i-th single prediction model at time t;
[0030] Calculate the sum of squares of prediction errors for each prediction model:
[0031]
[0032] Among them, y i is the true value of the i-th prediction model, is the fitted value of the ith prediction model.
[0033] Preferably, the initial set of influencing factors includes:
[0034] Whether it is a holiday, temperature, wind speed, air quality index, average wind speed, precipitation and accumulated sunshine.
[0035] A natural gas consumption prediction device based on REP criterion, comprising:
[0036] A data collection module is used to obtain historical consumption data of natural gas consumption and a set of initial influencing factors;
[0037] A data processing module is used to pre-process the historical consumption data and the initial influencing factor set to obtain a target influencing factor set;
[0038] A single model prediction module performs single model prediction on natural gas consumption based on each prediction model in the single model prediction pool according to the target influencing factor set and historical consumption data, wherein the single model prediction pool includes two types of prediction models: pre-trained statistical models and machine learning models;
[0039] The combined prediction module is used to solve the weight optimization model using the inverse mean square error method under the REP criterion, and to combine the prediction results of the prediction models based on the weights in the weight optimization model to obtain a combined prediction result.
[0040] A natural gas consumption prediction device based on the REP criterion, comprising: a memory and a processor;
[0041] The memory is used to store programs;
[0042] The processor is used to execute the program to implement the various steps of the aforementioned natural gas consumption prediction method based on the REP criterion.
[0043] It can be seen from the above technical scheme that the natural gas consumption prediction method based on the REP criterion provided by the present invention obtains the historical consumption data and the initial influencing factor set of natural gas consumption; pre-processes the historical consumption data and the initial influencing factor set; each prediction model in the single model prediction pool performs a single model prediction on the natural gas consumption according to the target influencing factor set and the historical consumption data, wherein the single model prediction pool includes two types of prediction models, namely, a statistical model and a machine learning model that have been pre-trained; the inverse mean square error method is used to solve the weight optimization model under the REP criterion, and the prediction results of the prediction models are combined based on the weights in the weight optimization model to obtain a combined prediction result. The present invention performs predictions by using different types of prediction models respectively, and then combines the prediction results of different prediction models according to the calculated optimal weights, thereby improving the accuracy of the natural gas consumption prediction results. The optimal weight is obtained by solving the REP criterion, and the REP criterion is applied to the natural gas consumption prediction, taking into account how the out-of-sample prediction can well represent the historical data, thereby improving the accuracy of the natural gas consumption prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0045] Figure 1 A flow chart of a natural gas consumption prediction method based on the REP criterion provided in an embodiment of the present invention;
[0046] Figure 2 A schematic diagram of the structure of a natural gas consumption prediction device based on the REP criterion provided in an embodiment of the present invention;
[0047] Figure 3 A hardware structure block diagram of a natural gas consumption prediction device based on the REP criterion provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] First, combine Figure 1 A natural gas consumption prediction method based on the REP criterion provided in an embodiment of the present invention is introduced. Figure 1 As shown, the method includes:
[0050] Step S1, data collection.
[0051] Specifically, historical consumption data of natural gas consumption and an initial influencing factor set are obtained. The initial influencing factors in the initial influencing factor set include at least two influencing factors such as whether it is a holiday, temperature (maximum temperature, minimum temperature, average temperature), wind speed, air quality index, average wind speed, precipitation, and accumulated sunshine.
[0052] Step S2: data preprocessing.
[0053] Specifically, the missing values of historical consumption data and the initial influencing factor set are filled by linear interpolation. The dependence between each influencing factor in the initial influencing factor set and the natural gas consumption data is calculated by the mutual information method. The influencing factors in the initial influencing factor set are screened according to the dependence to obtain the target influencing factor set.
[0054] First, the missing values of the initial influencing factor set and historical consumption data are filled by linear interpolation. Two data points close to the interpolation point are connected by a straight line, and the data corresponding to the interpolation point is determined based on the straight line, and the missing data is filled.
[0055] Then, feature selection is performed using the mutual information method. Given an influencing factor characteristic variable, determine the dependency between the natural gas consumption data and the given influencing factor characteristic variable. That is, given an influencing factor characteristic variable, determine how much the certainty of the occurrence of natural gas consumption will increase, and the increase in certainty is the amount of information. The value range of the dependency in the mutual information method is between [0,1]. When the value of the dependency is smaller, the dependency between the two variables is weaker, and when the value of the dependency is larger, the dependency between the two variables is stronger.
[0056] Finally, the influencing factors in the initial influencing factor set are screened according to the dependency to obtain the target influencing factor set. According to the dependency, the influencing factors related to natural gas consumption are selected as the target influencing factor set. That is, if the dependency between the influencing factor and the natural gas consumption is 0, it means that the variable is independent of the natural gas consumption and needs to be eliminated. In addition, the influencing factor variables with a dependency score higher than the preset value can be selected according to the dependency to obtain the target influencing factor set. For example, the natural gas consumption and influencing factor data of Zhejiang Province from January 1, 2016 to October 31, 2022 are obtained, where the initial influencing factor set includes whether it is a holiday, temperature (maximum temperature, minimum temperature, average temperature), average humidity, average wind speed, precipitation and cumulative sunshine data, etc. The mutual information method is used to select features. Since the average humidity and cumulative sunshine are calculated by the mutual information method, the scores of both are 0, indicating that these two variables are independent of natural gas consumption and need to be eliminated. Therefore, the target influencing set includes whether it is a holiday, temperature (maximum temperature, minimum temperature, average temperature), average wind speed and precipitation.
[0057] Step S3: single model prediction.
[0058] Specifically, each prediction model in the single model prediction pool performs a single model prediction on natural gas consumption based on a target influencing factor set and historical consumption data, wherein the single model prediction pool includes two types of prediction models: pre-trained statistical models and machine learning models.
[0059] A single model prediction pool of two types of models, statistical models and machine learning models, is pre-built. The single model prediction pool includes statistical models and machine learning models. The statistical model includes at least one of the linear regression model (LR) and the ridge regression model (Ridge); the machine learning model includes at least one of the support vector machine (SVR), the long short-term memory network model (LSTM), the back propagation neural network (BPNN) and the recursive neural network model (RNN). The single model prediction pool can include the above six models, or some of them.
[0060] The historical consumption data of natural gas consumption and the influencing factors in the target influencing factor set are used as the input of each prediction model in the single model prediction pool. The prediction models of the constructed single model prediction pool are used to perform predictions respectively to obtain the single model prediction results of each prediction model.
[0061] Step S4, combined prediction.
[0062] Specifically, the reciprocal mean square error method is used to solve the weight optimization model under the REP criterion, and the prediction results of the prediction models are combined based on the weights in the weight optimization model to obtain the combined prediction results. The prediction results of the validation set of each prediction model in the single model prediction pool are used as input, and the reciprocal mean square error method (RMSEM) under the REP criterion is considered, that is, the REP-RMSEM method is used to solve the weight optimization model, and the combined prediction is performed in combination with the optimal weights.
[0063] First, the REP value of each prediction model is calculated based on the prediction results of each prediction model on the validation set and the true value. Then, the sum of squares of the prediction errors of each prediction model in the reciprocal mean square error method is replaced with the REP value of each prediction model, and the optimal weight of each prediction model is calculated to obtain the weight optimization model. Finally, the optimal weights and prediction results of each prediction model are combined to obtain the combined prediction result.
[0064] The REP criterion is a weight determination criterion based on representativeness, which consists of a concurrent part representing the performance within the sample and an asynchronous part measuring the representativeness gap. The representative formula of the REP criterion is:
[0065]
[0066] in, is the performance error, is the representative error, ||,|| is the L1 norm (sum of absolute errors) between two vectors; n represents the data length in the sample, p represents the sample window length, and δ is between 0 and 1; y [i] is the i-th window of the true value y in the sample, for example, y [1] represents the first window closest to the predicted value, y[2] Indicates that [1] a non-overlapping second nearest window of equal length; and are the true values y in the sample [i] , the in-sample fitted values g, and the out-of-sample predicted values f. The Box-Cox transformation aims to change the shape of the data distribution to conform to the assumptions of a linear model.
[0067] The process of solving the weight optimization model using the inverse mean square error method includes:
[0068] The weights are defined as:
[0069]
[0070] Among them, ω i represents the weight of the i-th prediction model, is the prediction error sum of squares (PESS) of the ith prediction model, [x 1 , x 2 ,...,x n ] is the index sequence of the predicted object, x it Represents the time series x t The predicted output of the i-th prediction model at time point t, e it =(x t -x it ) is the residual of the i-th single prediction model at time t.
[0071] The prediction sum of squares (PESS) statistic can evaluate the prediction ability of each prediction model. PESS is similar to the residual sum of squares, which is the sum of squares of prediction errors. Calculate the sum of squares of prediction errors for each prediction model:
[0072]
[0073] Among them, y i is the true value of the i-th prediction model, is the fitted value of the ith prediction model.
[0074] In the present invention, E ii The value is replaced with the REP value of each prediction model, and the optimal weight of each prediction model is calculated. According to the formula in, represents the result of combined prediction, represents the optimal weight of the i-th prediction model, Represents the fitted value of the i-th model, and the result of the combined prediction is obtained.
[0075] The natural gas consumption prediction method based on the REP criterion provided in the embodiment of the present invention obtains historical consumption data and an initial influencing factor set of natural gas consumption; pre-processes the historical consumption data and the initial influencing factor set; each prediction model in the single model prediction pool performs a single model prediction on the natural gas consumption according to the target influencing factor set and the historical consumption data, wherein the single model prediction pool includes two types of prediction models, namely, a statistical model and a machine learning model that have been pre-trained; the weight optimization model is solved by the inverse mean square error method under the REP criterion, and the prediction results of the prediction models are combined based on the weights in the weight optimization model to obtain a combined prediction result. The embodiment of the present invention performs predictions respectively through different types of prediction models, and then combines the prediction results of different prediction models according to the calculated optimal weights, thereby improving the accuracy of the natural gas consumption prediction results. The optimal weight is obtained based on the REP criterion, and the REP criterion is applied to the natural gas consumption prediction, taking into account how the out-of-sample prediction well represents the historical data, thereby improving the accuracy of the natural gas consumption prediction.
[0076] The following is a description of a natural gas consumption prediction device based on the REP criterion provided in an embodiment of the present invention. The natural gas consumption prediction device based on the REP criterion described below and the natural gas consumption prediction method based on the REP criterion described above can refer to each other.
[0077] First combine Figure 2 , the natural gas consumption prediction device based on REP criterion is introduced, such as Figure 2 As shown, the natural gas consumption prediction device based on the REP criterion may include:
[0078] The data collection module 100 is used to obtain historical consumption data of natural gas consumption and a set of initial influencing factors;
[0079] The data processing module 200 is used to pre-process the historical consumption data and the initial influencing factor set to obtain a target influencing factor set;
[0080] A single model prediction module 300 performs single model prediction on natural gas consumption based on each prediction model in a single model prediction pool according to a target influencing factor set and historical consumption data, wherein the single model prediction pool includes two types of prediction models: a pre-trained statistical model and a machine learning model;
[0081] The combined prediction module 400 is used to solve the weight optimization model using the inverse mean square error method under the REP criterion, and to combine the prediction results of the prediction models based on the weights in the weight optimization model to obtain a combined prediction result.
[0082] The natural gas consumption prediction device based on the REP criterion provided in the embodiment of the present invention can be applied to the natural gas consumption prediction equipment based on the REP criterion. Figure 3 The hardware structure diagram of the natural gas consumption prediction device based on the REP criterion is shown. Figure 3 , the hardware structure of the device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0083] In the embodiment of the present invention, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0084] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0085] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0086] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to implement each processing flow in the aforementioned natural gas consumption prediction scheme based on the REP criterion.
[0087] An embodiment of the present invention further provides a storage medium, which can store a program suitable for execution by a processor, wherein the program is used to implement each processing flow in the aforementioned natural gas consumption prediction solution based on the REP criterion.
[0088] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0089] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0090] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A natural gas consumption prediction method based on the REP criterion, characterized in that: include: Obtain historical consumption data of natural gas consumption and a set of initial influencing factors; Preprocess the historical consumption data and the initial influencing factor set to obtain the target influencing factor set; Each prediction model in the single model prediction pool performs a single model prediction on natural gas consumption based on the target influencing factor set and historical consumption data. The single model prediction pool includes two types of prediction models: pre-trained statistical models and machine learning models. Under the REP criterion, the reciprocal mean square error method is used to solve the weight optimization model, and the prediction results of the prediction models are combined based on the weights in the weight optimization model to obtain the combined prediction results.
2. The natural gas consumption prediction method based on the REP criterion according to claim 1 is characterized in that: The process of preprocessing historical consumption data and the initial set of influencing factors includes: Fill missing values in historical consumption data and initial influencing factor set by linear interpolation; The mutual information method is used to calculate the dependence between each influencing factor in the initial influencing factor set and the natural gas consumption data; The influencing factors in the initial influencing factor set are screened according to the dependency to obtain a target influencing factor set.
3. The natural gas consumption prediction method based on the REP criterion according to claim 1 is characterized in that: The single model prediction pool includes statistical models and machine learning models; Wherein, the statistical model includes at least one of a linear regression model and a ridge regression model; The machine learning model includes at least one of a support vector machine, a long short-term memory network model, a back propagation neural network, and a recursive neural network model.
4. The natural gas consumption prediction method based on the REP criterion according to claim 1 is characterized in that: The process of solving the weight optimization model using the inverse mean square error method under the REP criterion and combining the prediction results of the prediction model based on the weights in the weight optimization model includes: The REP value of each prediction model is calculated based on the prediction results of each prediction model on the validation set and the true value; The sum of squares of the prediction errors of each prediction model in the reciprocal mean square error method is replaced by the REP value of each prediction model, and the optimal weight of each prediction model is calculated to obtain a weight optimization model; The optimal weights and prediction results of each prediction model are combined to obtain a combined prediction result.
5. The natural gas consumption prediction method based on the REP criterion according to claim 4 is characterized in that: The REP criterion includes a concurrent part representing the performance within the sample and an asynchronous part measuring the representativeness gap. The REP criterion formula is: in, is the performance error, is the representative error, ||,|| is the L1 norm between two vectors; n represents the data length in the sample, p represents the sample window length, and δ is between 0 and 1; y [i] is the i-th window of the true value y in the sample, and are the true values y in the sample [i] , Box-Cox transformation of the in-sample fitted value g and the out-of-sample predicted value f.
6. The natural gas consumption prediction method based on the REP criterion according to claim 5 is characterized in that: The process of solving the weight optimization model by the inverse mean square error method includes: The weights are defined as: Among them, ω i represents the weight of the i-th prediction model, is the prediction error sum of squares (PESS) of the ith prediction model, [x1, x2, ..., x n ] is the index sequence of the predicted object, x it Represents the time series x t The predicted output of the i-th prediction model at time point t, e it =(x t -x it ) is the residual of the i-th single prediction model at time t; Calculate the sum of squares of prediction errors for each prediction model: Among them, y i is the true value of the i-th prediction model, is the fitted value of the ith prediction model.
7. The natural gas consumption prediction method based on the REP criterion according to any one of claims 1 to 6, characterized in that: The initial set of influencing factors includes: Whether it is a holiday, temperature, wind speed, air quality index, average wind speed, precipitation and accumulated sunshine.
8. A natural gas consumption prediction device based on the REP criterion, characterized in that: include: A data collection module is used to obtain historical consumption data of natural gas consumption and a set of initial influencing factors; A data processing module is used to pre-process the historical consumption data and the initial influencing factor set to obtain a target influencing factor set; A single model prediction module performs single model prediction on natural gas consumption based on each prediction model in the single model prediction pool according to the target influencing factor set and historical consumption data, wherein the single model prediction pool includes two types of prediction models: pre-trained statistical models and machine learning models; The combined prediction module is used to solve the weight optimization model using the inverse mean square error method under the REP criterion, and to combine the prediction results of the prediction models based on the weights in the weight optimization model to obtain a combined prediction result.
9. A natural gas consumption prediction device based on the REP criterion, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the natural gas consumption prediction method based on the REP criterion as claimed in any one of claims 1 to 7.