CN117251705A - Daily natural gas load prediction method - Google Patents
Daily natural gas load prediction method Download PDFInfo
- Publication number
- CN117251705A CN117251705A CN202311283186.1A CN202311283186A CN117251705A CN 117251705 A CN117251705 A CN 117251705A CN 202311283186 A CN202311283186 A CN 202311283186A CN 117251705 A CN117251705 A CN 117251705A
- Authority
- CN
- China
- Prior art keywords
- natural gas
- data
- gas load
- prediction
- load data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 title claims abstract description 182
- 239000003345 natural gas Substances 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000000354 decomposition reaction Methods 0.000 claims abstract description 25
- 238000013461 design Methods 0.000 claims abstract description 21
- 238000010606 normalization Methods 0.000 claims abstract description 12
- 238000007781 pre-processing Methods 0.000 claims abstract description 9
- 238000012545 processing Methods 0.000 claims abstract description 9
- 238000001583 randomness test Methods 0.000 claims abstract description 4
- 238000012360 testing method Methods 0.000 claims description 14
- 238000005457 optimization Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000004458 analytical method Methods 0.000 claims description 6
- 238000012549 training Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 claims description 5
- 238000013528 artificial neural network Methods 0.000 claims description 4
- 238000010998 test method Methods 0.000 claims description 3
- 238000013277 forecasting method Methods 0.000 claims description 2
- 230000007774 longterm Effects 0.000 abstract description 3
- 230000002159 abnormal effect Effects 0.000 abstract description 2
- 238000013136 deep learning model Methods 0.000 abstract 1
- 230000006870 function Effects 0.000 description 6
- 239000011159 matrix material Substances 0.000 description 5
- 238000005065 mining Methods 0.000 description 5
- 230000007246 mechanism Effects 0.000 description 4
- 239000013598 vector Substances 0.000 description 4
- 230000004913 activation Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000015572 biosynthetic process Effects 0.000 description 1
- 229910052799 carbon Inorganic materials 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000007789 gas Substances 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 238000012731 temporal analysis Methods 0.000 description 1
- 238000000700 time series analysis Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/10—Pre-processing; Data cleansing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/10—Pre-processing; Data cleansing
- G06F18/15—Statistical pre-processing, e.g. techniques for normalisation or restoring missing data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
- G06N3/0455—Auto-encoder networks; Encoder-decoder networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2123/00—Data types
- G06F2123/02—Data types in the time domain, e.g. time-series data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- Human Resources & Organizations (AREA)
- General Health & Medical Sciences (AREA)
- Strategic Management (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Biomedical Technology (AREA)
- Marketing (AREA)
- Computing Systems (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Water Supply & Treatment (AREA)
- Quality & Reliability (AREA)
- Operations Research (AREA)
- Entrepreneurship & Innovation (AREA)
- Game Theory and Decision Science (AREA)
- Development Economics (AREA)
- Primary Health Care (AREA)
- Public Health (AREA)
- Probability & Statistics with Applications (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明公开了一种每日天然气负荷预测方法,包括:设计天然气历史负荷数据及特征选择预处理模块,该模块完成了对负荷、特征数据的异常值、缺失值、重复值处理,进行平稳性、随机性检验,并完成了数据归一化;设计天然气负荷数据分解及特征选择模块,该模块将天然气原始数据分解为多个不同的子序列,并对分解数量进行优化,随后对各子序列进行特征选择;设计天然气负荷数据预测模块,该模块首先对不同子序列进行预测,将预测结果进行信号重构,最终得到第二日的天然气负荷数据预测结果。本发明针对复杂度高、非线性非稳定性的天然气数据进行分解及深度挖掘特征,并通过深度学习模型构建序列的长短期依赖,提高天然气负荷的预测精度。
The invention discloses a daily natural gas load prediction method, which includes: designing a natural gas historical load data and feature selection preprocessing module. This module completes the processing of abnormal values, missing values, and repeated values of the load and feature data, and performs stationarity , randomness test, and completed data normalization; designed the natural gas load data decomposition and feature selection module, which decomposes the original natural gas data into multiple different subsequences, optimizes the number of decompositions, and then Carry out feature selection; design a natural gas load data prediction module. This module first predicts different sub-sequences, reconstructs the signal of the prediction results, and finally obtains the natural gas load data prediction results for the second day. This invention decomposes and deeply mines features of highly complex, nonlinear and unstable natural gas data, and builds long-term and short-term dependencies of the sequence through a deep learning model to improve the prediction accuracy of natural gas load.
Description
技术领域Technical field
本发明属于时间序列分析和能源领域,具体涉及一种每日天然气负荷预测方法。The invention belongs to the fields of time series analysis and energy, and specifically relates to a daily natural gas load prediction method.
背景技术Background technique
随着全球气候变化对人类生存环境产生的影响,越来越多的国家开始重视低碳绿色能源的发展,天然气作为一种绿色清洁能源在清洁能源体系中起到了关键支撑作用。天然气用量的增长要求燃气公司及时准确地预测不同时间段的天然气消耗量。预测天然气消耗量的模型主要分为以下三种:传统模型、人工智能模型、混合模型。传统模型难以处理具有非线性特征的天然气消耗量,且仅能对天然气消耗量做长期预测,无法进行短期预测。人工智能模型提高了对于非线性数据的处理能力,但其泛化能力和可解释性依然有待提升。单一的算法针对具体问题时难以避免存在缺陷,因此混合模型通过结合不同算法来进行算法优化,弥补单个预测算法存在的问题。目前常用的序列分解方法主要包括小波变换(WT)、经验模态分解(EMD)、VMD,与其他模型相比,VMD能够有效避免预测的延迟现象。Transformer模型是由谷歌在2017年提出的,在NLP领域其表现出对时间序列数据的强大建模能力,越来越多的学者将其用于时间序列数据预测中。With the impact of global climate change on the human living environment, more and more countries are beginning to pay attention to the development of low-carbon green energy. Natural gas, as a green and clean energy, plays a key supporting role in the clean energy system. The growth of natural gas consumption requires gas companies to timely and accurately predict natural gas consumption in different time periods. There are three main models for predicting natural gas consumption: traditional models, artificial intelligence models, and hybrid models. Traditional models are difficult to handle natural gas consumption with nonlinear characteristics, and can only make long-term predictions of natural gas consumption, not short-term predictions. Artificial intelligence models have improved their processing capabilities for nonlinear data, but their generalization capabilities and interpretability still need to be improved. It is difficult to avoid defects when a single algorithm is used to target specific problems. Therefore, the hybrid model optimizes the algorithm by combining different algorithms to make up for the problems of a single prediction algorithm. Currently, commonly used sequence decomposition methods mainly include wavelet transform (WT), empirical mode decomposition (EMD), and VMD. Compared with other models, VMD can effectively avoid prediction delays. The Transformer model was proposed by Google in 2017. In the field of NLP, it has shown powerful modeling capabilities for time series data, and more and more scholars are using it for time series data prediction.
发明内容Contents of the invention
为解决上述技术问题,本发明提供一种每日天然气负荷预测方法,该方法涵盖了天然气历史负荷数据及特征选择预处理模块、天然气负荷数据分解及特征选择模块和天然气负荷数据预测模块的设计,能够在负荷数据复杂度较高的情况下,实现对数据的预处理及深入特征挖掘,并对分解后的各子序列分别进行预测得到预测值,实现对每日天然气负荷数据的精准预测。In order to solve the above technical problems, the present invention provides a daily natural gas load prediction method, which covers the design of natural gas historical load data and feature selection preprocessing module, natural gas load data decomposition and feature selection module, and natural gas load data prediction module. It can realize data preprocessing and in-depth feature mining when the complexity of the load data is high, and predict each decomposed sub-sequence to obtain the predicted value, thereby achieving accurate prediction of daily natural gas load data.
为达到上述目的,本发明采用如下技术方案:In order to achieve the above objects, the present invention adopts the following technical solutions:
一种每日天然气负荷预测方法,包括如下步骤:A daily natural gas load forecasting method includes the following steps:
步骤(1)、设计天然气历史负荷数据及特征数据预处理模块,完成负荷、特征数据的异常值、缺失值、重复值处理,进行平稳性、随机性检验,并完成数据归一化,包括:Step (1): Design the natural gas historical load data and characteristic data preprocessing module to complete the processing of outliers, missing values, and repeated values of load and characteristic data, conduct stationarity and randomness tests, and complete data normalization, including:
步骤(1.1)对数据的异常值、缺失值、重复值进行处理包括首先剔除检测到的重复值,计算天然气负荷数据的标准差σ,然后根据3σ原则对异常值进行检测并删除异常值,最后采用插值填充法对缺失值进行处理,取前后值的均值进行填充;Step (1.1) Processing outliers, missing values, and duplicate values in the data includes first eliminating detected duplicate values, calculating the standard deviation σ of the natural gas load data, then detecting and deleting outliers according to the 3σ principle, and finally The interpolation filling method is used to process missing values, and the average of the previous and later values is used to fill in;
步骤(1.2)对天然气负荷数据的平稳性和随机性进行检验,采用ADF检验方法对数据进行平稳性检验,若结果大于0则判定为非平稳序列,构造Q统计量对天然气负荷数据进行随机性检验,若检验结果小于0.05则判定为非纯随机序列,证明天然气负荷数据具有分析和预测的意义;Step (1.2) tests the stationarity and randomness of the natural gas load data, and uses the ADF test method to test the stationarity of the data. If the result is greater than 0, it is determined to be a non-stationary sequence, and a Q statistic is constructed to test the randomness of the natural gas load data. Test, if the test result is less than 0.05, it is determined to be a non-pure random sequence, proving that the natural gas load data has the significance of analysis and prediction;
步骤(1.3)对天然气负荷数据和特征数据进行归一化处理,采用最值归一化,将不同量纲的数据映射到[0-1]之间,加快后续神经网络训练速度;Step (1.3) normalizes the natural gas load data and characteristic data, uses maximum value normalization, and maps data of different dimensions to [0-1] to speed up subsequent neural network training;
步骤(2)、设计天然气分解及特征选择模块,将预处理后的天然气负荷数据分解为多个不同的子序列,并对分解数量进行优化,随后对各子序列进行特征选择,包括:Step (2): Design a natural gas decomposition and feature selection module to decompose the preprocessed natural gas load data into multiple different subsequences, optimize the number of decompositions, and then perform feature selection on each subsequence, including:
步骤(2.1)采用变分模态分解对天然气负荷数据进行分解,将其分解为多个不同的子序列后再进行分析和预测,降低天然气负荷数据的复杂度;Step (2.1) uses variational mode decomposition to decompose the natural gas load data, decompose it into multiple different sub-sequences and then analyze and predict it to reduce the complexity of the natural gas load data;
步骤(2.2)设计特征匹配度最大化优化算法对子序列的数量进行优化,将天然气原始数据从2到特征数量的范围内进行循环,分别进行分解并计算特征匹配度,循环结束后进行特征匹配度的比较,取最大值为优化结果;Step (2.2) Design a feature matching degree maximization optimization algorithm to optimize the number of subsequences, loop the natural gas raw data from 2 to the number of features, decompose and calculate the feature matching degree respectively, and perform feature matching after the cycle ends Compare the degrees, and take the maximum value as the optimization result;
步骤(2.3)将分解后的子序列分别结合特征数据计算皮尔森相关系数,计算结果大于0.3的为相关特征;Step (2.3) combines the decomposed subsequences with feature data to calculate the Pearson correlation coefficient. If the calculation result is greater than 0.3, it is a relevant feature;
步骤(3)、设计天然气负荷数据预测模块,首先对不同子序列进行预测,将预测结果进行信号重构,最终得到第二日的天然气负荷数据预测结果,包括:Step (3): Design the natural gas load data prediction module. First, predict different sub-sequences, reconstruct the signal of the prediction results, and finally obtain the natural gas load data prediction results for the second day, including:
步骤(3.1)构建改进的Transformer模型对子序列进行预测,将Transformer模型原有的Decoder模块用全连接层进行代替获得Transformer预测模型,并根据分解后的子序列分别训练Transformer预测模型,并对每个子序列进行预测;Step (3.1) Construct an improved Transformer model to predict subsequences, replace the original Decoder module of the Transformer model with a fully connected layer to obtain a Transformer prediction model, and train the Transformer prediction model based on the decomposed subsequences, and perform each Subsequence prediction;
步骤(3.2)将各个子序列的预测结果进行重构,得到最终的第二日天然气负荷预测结果,实现对每日天然气负荷数据的精准预测。Step (3.2) reconstructs the prediction results of each sub-sequence to obtain the final natural gas load prediction results for the second day, achieving accurate prediction of daily natural gas load data.
进一步地,适用于不同城市、地区、企业的天然气负荷数据。Furthermore, it is applicable to the natural gas load data of different cities, regions, and enterprises.
本发明与现有技术相比的有益效果在于:Compared with the prior art, the beneficial effects of the present invention are:
(1)目前针对分解数量的优化方案大多是基于启发式搜索算法,优化效率较低且不适用于预测算法。本发明设计的特征匹配度最大化优化算法能够使每个分解后的子序列的特征数量尽量小且接近于一个,有利于提高后续深度学习算法的训练速度和精确度。(1) Most of the current optimization solutions for the number of decompositions are based on heuristic search algorithms, which have low optimization efficiency and are not suitable for prediction algorithms. The feature matching degree maximization optimization algorithm designed by the present invention can make the number of features of each decomposed subsequence as small as possible and close to one, which is beneficial to improving the training speed and accuracy of subsequent deep learning algorithms.
(2)当城市或地区位于亚热带甚至热带时,天然气负荷数据与气温相关性不大,影响因素难以评估,负荷数据呈现出非线性非稳定的特性,难以有效进行数据分析及特征挖掘。已有的研究中,大多数算法针对的是温带地区与温度相关性大的数据,所达到的预测精度较高。但当算法应用于亚热带或热带地区时,精度会出现明显下降。本发明方法通过对原始数据进行分解降低其数据复杂度,并设计改进的Transformer模型提高子序列的长期依赖建模能力,最终针对不同地区都能实现较高的预测精度。(2) When a city or region is located in the subtropics or even the tropics, natural gas load data has little correlation with temperature, and the influencing factors are difficult to evaluate. The load data exhibits nonlinear and unstable characteristics, making it difficult to effectively perform data analysis and feature mining. In existing research, most algorithms target data with a large correlation with temperature in temperate regions, and achieve higher prediction accuracy. But when the algorithm is applied to subtropical or tropical regions, the accuracy drops significantly. The method of the present invention reduces the data complexity by decomposing the original data, and designs an improved Transformer model to improve the long-term dependency modeling ability of subsequences, and ultimately achieves higher prediction accuracy for different regions.
综上所述,本发明先对天然气负荷历史数据进行预处理,再利用模态分解方法对原始序列进行分解,并设计一种分解数量优化算法,实现高复杂度数据的分析及特征挖掘,并设计了改进Transformer模型对子序列进行预测并进行信号合成,实现第二日天然气负荷数据的精准预测。To sum up, the present invention first preprocesses the natural gas load historical data, then uses the modal decomposition method to decompose the original sequence, and designs a decomposition quantity optimization algorithm to realize the analysis and feature mining of high-complexity data, and An improved Transformer model is designed to predict sub-sequences and perform signal synthesis to achieve accurate prediction of natural gas load data for the second day.
附图说明Description of drawings
图1为本发明的一种每日天然气负荷预测方法框图;Figure 1 is a block diagram of a daily natural gas load prediction method of the present invention;
图2为VMD算法流程图;Figure 2 is the flow chart of the VMD algorithm;
图3为特征匹配度最大化优化算法流程图;Figure 3 is a flow chart of the feature matching degree maximization optimization algorithm;
图4为Transformer模型的结构图。Figure 4 is the structure diagram of the Transformer model.
具体实施方式Detailed ways
下面结合附图对本发明做进一步详细的描述。The present invention will be described in further detail below in conjunction with the accompanying drawings.
如图1所示,本发明涉及一种每日天然气负荷预测方法,包括天然气历史负荷数据及特征选择预处理模块1的设计、天然气负荷数据分解及特征选择模块2的设计和天然气负荷数据预测模块3的设计,能够在负荷数据复杂度较高的情况下,实现对数据的预处理及深入特征挖掘,并对分解后的各子序列分别进行预测得到预测值,实现对每日天然气负荷数据的精准预测。As shown in Figure 1, the present invention relates to a daily natural gas load prediction method, including the design of the natural gas historical load data and feature selection preprocessing module 1, the design of the natural gas load data decomposition and feature selection module 2, and the natural gas load data prediction module. The design of 3 can realize data preprocessing and in-depth feature mining when the load data complexity is high, and predict each decomposed sub-sequence to obtain the predicted value, so as to realize the analysis of daily natural gas load data. Accurate predictions.
如图1所示,本发明的一种每日天然气负荷预测方法包括如下步骤:As shown in Figure 1, a daily natural gas load prediction method of the present invention includes the following steps:
步骤(1)设计天然气历史负荷数据及特征数据预处理模块1,其完成负荷、特征数据的异常值、缺失值、重复值处理,进行平稳性、随机性检验,并完成了数据归一化,具体实现如下:Step (1) Design the natural gas historical load data and characteristic data preprocessing module 1, which completes the processing of outliers, missing values, and repeated values of load and characteristic data, conducts stationarity and randomness tests, and completes data normalization. The specific implementation is as follows:
①针对传感器采集的天然气负荷数据质量无法直接分析的问题,对数据的异常值、缺失值、重复值进行处理。首先剔除检测到的重复值,计算天然气负荷数据的标准差σ,然后根据3σ原则对异常值进行检测并删除异常值,最后采用插值填充法对缺失值进行处理,取前后值的均值进行填充;① Aiming at the problem that the quality of natural gas load data collected by sensors cannot be directly analyzed, abnormal values, missing values, and repeated values in the data are processed. First, the detected duplicate values are eliminated, and the standard deviation σ of the natural gas load data is calculated. Then the outliers are detected and deleted according to the 3σ principle. Finally, the interpolation filling method is used to process the missing values, and the average of the before and after values is taken to fill in;
②对天然气负荷数据的平稳性和随机性进行检验,采用ADF检验方法对数据进行平稳性检验,若结果大于0则判定为非平稳序列,Q统计量是服从自由度为s的卡方分布,构造Q统计量对天然气负荷数据进行随机性检验,若检验结果小于0.05则判定为非纯随机序列,证明数据具有分析和预测的意义;② Test the stationarity and randomness of the natural gas load data. Use the ADF test method to test the stationarity of the data. If the result is greater than 0, it is determined to be a non-stationary sequence. The Q statistic obeys the chi-square distribution with the degree of freedom s. Construct the Q statistic to test the randomness of the natural gas load data. If the test result is less than 0.05, it is determined to be a non-pure random sequence, proving that the data has the significance of analysis and prediction;
③对天然气负荷数据和特征数据进行归一化处理,采用最值归一化,将不同量纲的数据映射到[0-1]之间,加快后续神经网络训练速度;③ Normalize the natural gas load data and characteristic data, use maximum value normalization, and map data of different dimensions to [0-1] to speed up subsequent neural network training;
其中,x是负荷数据,min和max分别是负荷数据中的最大值和最小值,x*是归一化处理后的负荷数据。Among them, x is the load data, min and max are the maximum and minimum values in the load data respectively, and x * is the normalized load data.
步骤(2)设计天然气分解及特征选择模块2,其将天然气原始数据分解为多个不同的子序列,并对分解数量进行优化,随后对各子序列进行特征选择,具体实现如下:Step (2) Design the natural gas decomposition and feature selection module 2, which decomposes the original natural gas data into multiple different subsequences, optimizes the number of decompositions, and then performs feature selection on each subsequence. The specific implementation is as follows:
①针对天然气负荷数据复杂度高及非线性非稳定的特性,采用变分模态分解(VMD)对天然气负荷数据进行分解,将其分解为多个不同的子序列后再进行分析和预测,能够有效降低数据的复杂度,VMD算法流程如图2所示。VMD的核心思想是构建和求解变分问题,首先构造变分问题,假设天然气负荷数据被分解为多个分量,分量序列为具有中心频率的有限带宽的模态分量,同时各模态的估计带宽之和最小,约束条件为所有模态之和与原始信号相等,引入拉格朗日乘法算子将约束变分问题转变为非约束变分问题,不断更新各模态分量和中心频率,直至满足收敛条件,将天然气负荷数据分解为多个模态;① In view of the high complexity and nonlinear and unstable characteristics of natural gas load data, variational mode decomposition (VMD) is used to decompose the natural gas load data and decompose it into multiple different sub-sequences for analysis and prediction, which can Effectively reducing the complexity of data, the VMD algorithm flow is shown in Figure 2. The core idea of VMD is to construct and solve a variational problem. First, a variational problem is constructed. It is assumed that the natural gas load data is decomposed into multiple components. The component sequence is a modal component with a limited bandwidth with a central frequency. At the same time, the estimated bandwidth of each modal is The sum is minimum, and the constraint condition is that the sum of all modes is equal to the original signal. The Lagrangian multiplier operator is introduced to transform the constrained variation problem into an unconstrained variation problem, and each modal component and central frequency are continuously updated until they are satisfied Convergence conditions to decompose natural gas load data into multiple modes;
②VMD分解的序列数量是手动选择的,因此设计特征匹配度最大化优化算法对天然气分解序列数量进行优化,算法流程如图3所示。首先选定影响天然气负荷的特征,初始化分解序列数为2,将负荷数据进行分解,计算子序列与各特征之间的皮尔森相关系数并进行归一化处理,拉大最大值与最小值之间的差距,随后根据子序列中最大相关系数占所有相关系数之和的比例计算特征匹配度,分解数量从2递增到特征的数量,依次进行上述特征匹配度计算,得到的最大特征匹配度对应的分解数量即为优化后的分解序列数量;②The number of sequences for VMD decomposition is manually selected, so a feature matching degree maximization optimization algorithm is designed to optimize the number of natural gas decomposition sequences. The algorithm flow is shown in Figure 3. First, select the characteristics that affect the natural gas load, initialize the number of decomposition sequences to 2, decompose the load data, calculate the Pearson correlation coefficient between the subsequences and each feature, and perform normalization processing to increase the value between the maximum and minimum values. Then calculate the feature matching degree based on the ratio of the maximum correlation coefficient in the subsequence to the sum of all correlation coefficients. The number of decompositions increases from 2 to the number of features. The above feature matching degree calculation is performed in sequence. The maximum feature matching degree obtained corresponds to The number of decompositions is the number of optimized decomposition sequences;
其中,ui是负荷数据分解得到的子序列,Yj是特征数据,ρij是子序列与特征之间的皮尔森相关系数,Pk是每个序列的特征匹配度值,m是特征的数量,n是每个特征包含的数据量,i是子序列的索引,q是子序列中数据的索引,j是特征的索引,表示第i组子序列的第q个数据,/>表示第i组子序列的平均值,/>表示第j组特征的第q个数据,/>表示第j组特征的平均值,softmax是归一化指数函数,zij是经过归一化后的第i组子序列与第j组特征的皮尔森相关系数,Max()是最大值函数,k是天然气负荷数据分解的子序列数量。Among them, u i is the subsequence obtained by decomposing the load data, Y j is the feature data, ρ ij is the Pearson correlation coefficient between the subsequence and the feature, P k is the feature matching value of each sequence, and m is the characteristic Quantity, n is the amount of data contained in each feature, i is the index of the subsequence, q is the index of the data in the subsequence, j is the index of the feature, Represents the q-th data of the i-th group of subsequences,/> Represents the average value of the i-th group of subsequences,/> Represents the q-th data of the j-th group of features,/> Represents the average value of the j-th group of features, softmax is the normalized exponential function, z ij is the Pearson correlation coefficient between the normalized i-th group subsequence and the j-th group of features, Max() is the maximum value function, k is the number of subsequences into which the natural gas load data is decomposed.
③将分解后的子序列分别结合特征数据计算皮尔森相关系数,计算结果大于0.3的为相关特征。③ Combine the decomposed subsequences with the feature data to calculate the Pearson correlation coefficient. If the calculation result is greater than 0.3, it is a relevant feature.
步骤(3)设计天然气负荷数据预测模块3,首先对不同子序列进行预测,将预测结果进行信号重构,最终得到第二日的天然气负荷数据预测结果,具体实现如下:Step (3) Design the natural gas load data prediction module 3. First, predict different sub-sequences, reconstruct the signal of the prediction results, and finally obtain the natural gas load data prediction results for the second day. The specific implementation is as follows:
①构建改进的Transformer模型对子序列进行预测,将Transformer模型原有的Decoder(解码器)模块用全连接层进行代替获得Transformer预测模型,并根据分解后的子序列分别训练Transformer预测模型,并对每个子序列进行预测;①Construct an improved Transformer model to predict subsequences, replace the original Decoder module of the Transformer model with a fully connected layer to obtain the Transformer prediction model, and train the Transformer prediction model separately based on the decomposed subsequences, and Make predictions for each subsequence;
Transformer模型的结构如图4所示,首先是位置编码层,将天然气负荷数据划分为不同的输入序列并添加位置信息,接着是编码器,编码器中进行多头注意力的计算,生成一个维度为(窗口大小,批量大小,向量维度)的张量,接着经过残差连接和层归一化、前馈连接,同时会对张量进行随机失活处理,最后解码器由一层全连接层组成,生成最终的预测结果。The structure of the Transformer model is shown in Figure 4. The first is the position encoding layer, which divides the natural gas load data into different input sequences and adds position information. Next is the encoder. The multi-head attention is calculated in the encoder to generate a dimension of (window size, batch size, vector dimension) tensor, and then undergoes residual connection, layer normalization, and feed-forward connection. At the same time, the tensor will be randomly deactivated. Finally, the decoder consists of a fully connected layer. , to generate the final prediction result.
相比于传统的循环神经网络和卷积神经网络,Transformer模型提出全新的位置编码机制来捕获输入数据之间的时间序列信息,其原理是将不同频率的正弦函数和余弦函数作为位置编码添加到归一化之后的输入序列内。位置编码公式如下所示:Compared with traditional recurrent neural networks and convolutional neural networks, the Transformer model proposes a new position encoding mechanism to capture the time series information between input data. The principle is to add sine functions and cosine functions of different frequencies as position encodings to within the input sequence after normalization. The position encoding formula is as follows:
其中,pos是索引序列的长度,i是维度的索引,dmodel是词向量维度,PE表示序列的位置。Among them, pos is the length of the index sequence, i is the index of the dimension, d model is the word vector dimension, and PE represents the position of the sequence.
自注意力机制可以看作在一个线性投影空间中建立输入向量不同形式之间的交互关系。核心过程就是通过查询矩阵Q和键值矩阵K计算得到注意力权重,然后作用于值矩阵V得到权重与输出。对于输入的Q、K和V来说,其输出向量的计算公式如下:The self-attention mechanism can be viewed as establishing an interactive relationship between different forms of input vectors in a linear projection space. The core process is to calculate the attention weight through the query matrix Q and the key-value matrix K, and then act on the value matrix V to obtain the weight and output. For the input Q, K and V, the calculation formula of the output vector is as follows:
其中,T表示对矩阵进行转置,dk表示词嵌入维度,Attention()表示注意力计算值。Among them, T represents transposing the matrix, d k represents the word embedding dimension, and Attention() represents the attention calculation value.
多头注意力机制就是将原始的输入序列进行多组的自注意力处理,再将每一组的自注意力结果拼接在一起。其计算公式如下:The multi-head attention mechanism performs multiple sets of self-attention processing on the original input sequence, and then splices together the self-attention results of each set. The calculation formula is as follows:
MultiHead(Q,K,V)=Concat(head1,head2,...,headh)WO MultiHead(Q,K,V)=Concat(head 1 ,head 2 ,...,head h )W O
其中,headi表示第i组注意力的值,分别表示第i组注意力Q、K、V对应的线性变换矩阵,MultiHead()表示多头注意力机制输出值,Concat()表示将多组注意力进行拼接,WO表示拼接过程中的线性变换矩阵。Among them, head i represents the value of the i-th group of attention, Represents the linear transformation matrices corresponding to the i-th group of attention Q, K, and V respectively. MultiHead() represents the output value of the multi-head attention mechanism. Concat() represents the splicing of multiple groups of attention. W O represents the linear transformation in the splicing process. matrix.
编码器主要由多头注意力、残差连接与层归一化、前馈连接组成。多头注意力可以避免引入未来信息。残差连接主要用于解决多层网络训练的问题。层归一化使每一层神经元的输入均值方差一致,加快收敛。前馈连接是一个两层的全连接层。第一层的激活函数是Relu,第二次不使用激活函数。用一个线性层代替原始的解码器结构,直接输出天然气消费量的预测值。这样做能够减少约一半规模的训练参数,在一定程度上避免过拟合和减少预测的累积误差。The encoder mainly consists of multi-head attention, residual connections, layer normalization, and feed-forward connections. Multi-headed attention avoids the introduction of future information. Residual connections are mainly used to solve the problem of multi-layer network training. Layer normalization makes the input mean variance of each layer of neurons consistent and accelerates convergence. The feedforward connection is a two-layer fully connected layer. The activation function of the first layer is Relu, and no activation function is used in the second layer. A linear layer is used to replace the original decoder structure and directly output the predicted value of natural gas consumption. This can reduce the number of training parameters by about half, avoid overfitting and reduce the cumulative error of prediction to a certain extent.
②将各个子序列的预测结果进行重构,得到最终的第二日天然气负荷预测结果,实现对每日天然气负荷数据的精准预测。②Reconstruct the prediction results of each sub-sequence to obtain the final natural gas load prediction results for the second day, achieving accurate prediction of daily natural gas load data.
综上所述,本发明包括天然气历史负荷数据及特征选择预处理模块设计、天然气负荷数据分解及特征选择模块设计和天然气负荷数据预测模块设计,能够在负荷数据复杂度较高的情况下,实现对数据的预处理及深入特征挖掘,并对分解后的各子序列分别进行预测得到预测值,实现对每日天然气负荷数据的精准预测。To sum up, the present invention includes the design of the natural gas historical load data and feature selection preprocessing module, the natural gas load data decomposition and feature selection module design, and the natural gas load data prediction module design, which can achieve high load data complexity. Preprocess the data and conduct in-depth feature mining, and predict each decomposed sub-sequence to obtain the predicted value to achieve accurate prediction of daily natural gas load data.
本发明说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。Contents not described in detail in the specification of the present invention belong to the prior art known to those skilled in the art.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above are only preferred embodiments of the present invention. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of the present invention. These improvements and modifications can also be made. should be regarded as the protection scope of the present invention.
Claims (2)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311283186.1A CN117251705A (en) | 2023-10-07 | 2023-10-07 | Daily natural gas load prediction method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311283186.1A CN117251705A (en) | 2023-10-07 | 2023-10-07 | Daily natural gas load prediction method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117251705A true CN117251705A (en) | 2023-12-19 |
Family
ID=89129052
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311283186.1A Pending CN117251705A (en) | 2023-10-07 | 2023-10-07 | Daily natural gas load prediction method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117251705A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117808175A (en) * | 2024-03-01 | 2024-04-02 | 南京信息工程大学 | Short-term multi-energy load prediction method based on DTformer |
CN118333225A (en) * | 2024-05-06 | 2024-07-12 | 湖北工业大学 | Deep learning-based power load prediction method and device and electronic equipment |
-
2023
- 2023-10-07 CN CN202311283186.1A patent/CN117251705A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117808175A (en) * | 2024-03-01 | 2024-04-02 | 南京信息工程大学 | Short-term multi-energy load prediction method based on DTformer |
CN117808175B (en) * | 2024-03-01 | 2024-05-17 | 南京信息工程大学 | A short-term multi-energy load forecasting method based on DTformer |
CN118333225A (en) * | 2024-05-06 | 2024-07-12 | 湖北工业大学 | Deep learning-based power load prediction method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Tan et al. | Multi-node load forecasting based on multi-task learning with modal feature extraction | |
WO2024000852A1 (en) | Data processing method and apparatus, device, and storage medium | |
CN117251705A (en) | Daily natural gas load prediction method | |
CN112990556A (en) | User power consumption prediction method based on Prophet-LSTM model | |
CN111832825B (en) | Wind power prediction method and system integrating long-term memory network and extreme learning machine | |
CN111814956B (en) | A multi-task learning air quality prediction method based on multi-dimensional quadratic feature extraction | |
CN115146700A (en) | Runoff prediction method based on Transformer sequence-to-sequence model | |
CN115310674A (en) | Long-time sequence prediction method based on parallel neural network model LDformer | |
CN117094451B (en) | Power consumption prediction method, device and terminal | |
CN113627070A (en) | Short-term photovoltaic power prediction method | |
CN117315381B (en) | Hyperspectral image classification method based on second-order biased random walk | |
CN115511162A (en) | A Short-term Electric Load Forecasting Method Based on CVMD-GRU-DenseNet Hybrid Model | |
CN116596150A (en) | Event Prediction Method Based on Multi-Branch Self-Attention Transformer Hawkes Process Model | |
Kumar et al. | Real-time prediction of multiple output states in diesel engines using a deep neural operator framework | |
CN116307211A (en) | Wind power digestion capability prediction and optimization method and system | |
CN115660167A (en) | Short-term air quality prediction method based on sparrow search algorithm and decomposition error correction | |
CN113673774A (en) | Prediction method of aircraft engine residual life based on autoencoder and time series convolutional network | |
CN118917475A (en) | PM (particulate matter)2.5Concentration prediction method, device and system and storage medium | |
Sim et al. | Temporal attention gate network with temporal decomposition for improved prediction accuracy of univariate time-series data | |
CN117390502A (en) | Resiofnn network-based voltage data missing value filling method and system | |
Wang et al. | Research on traffic speed prediction based on wavelet transform and ARIMA-GRU hybrid model | |
CN117094431A (en) | DWTfar meteorological data time sequence prediction method and equipment for multi-scale entropy gating | |
CN116882538A (en) | A training method and related device for a marine environment prediction model | |
CN113835964B (en) | Cloud data center server energy consumption prediction method based on small sample learning | |
CN115809725A (en) | A multi-factor short-term electricity forecasting method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |