A load prediction method and system based on GCN-LSTM and frequency domain disturbance enhancement
Patent Information
- Application Number
- CN202611057208.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]发明目的:本发明提供一种基于GCN-LSTM与频域扰动增强的负荷预测方法及系统,旨在解决现有技术负荷预测方法存在的对于多元耦合关系、非线性波动和突发性尖峰等场景表现有限且对异常值敏感,在高维冗余特征、小样本及强相关变量场景下易出现过拟合,缺乏对负荷时序长期-短期动态的显式建模支持,未科学筛选特征导致模型输入维度过高,受设备检修等影响导致历史数据有限,易加剧过拟合,单一时序建模或单一空间结构建模难以兼顾复杂动态耦合与时空依赖特性等问题
[0028]1、降维提效,消除冗余:通过随机森林特征重要性评估,剔除冗余与弱相关气象变量,降低模型输入维度与复杂度;
Smart Images

Figure CN123018775A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of load forecasting technology, and particularly relates to a load forecasting method and system based on GCN-LSTM and frequency domain perturbation enhancement. Background Technology
[0002] Load forecasting, as a core supporting technology for the operation of smart grids and future energy systems, is directly related to the safe and stable operation of the power system. Traditional load forecasting methods mainly include statistical models and shallow machine learning models. Statistical methods, such as ARIMA and multiple linear regression, have limited performance in scenarios involving multiple coupling relationships, nonlinear fluctuations, and sudden peaks, and are sensitive to outliers.
[0003] While shallow machine learning methods, such as support vector machines and random forests, have advantages in nonlinear fitting, they are prone to overfitting in scenarios with high-dimensional redundant features, small samples, and strongly correlated variables, and lack explicit modeling support for long-term to short-term dynamics of load time series. Deep learning and graph neural network models, such as STGCN-Transformer and GCN-DABiLSTM, still face multiple challenges in practical applications: first, the lack of scientific feature selection leads to excessively high input dimensionality; second, limited historical data due to equipment maintenance and other factors can exacerbate overfitting; and third, single-time series modeling or single-spatial structure modeling cannot simultaneously account for complex dynamic coupling and spatiotemporal dependencies. Summary of the Invention
[0004] Purpose of the Invention: This invention provides a load forecasting method and system based on GCN-LSTM and frequency domain perturbation enhancement, aiming to solve the problems of existing load forecasting methods, such as limited performance in scenarios with multiple coupling relationships, nonlinear fluctuations and sudden spikes, sensitivity to outliers, overfitting in scenarios with high-dimensional redundant features, small samples and strongly correlated variables, lack of explicit modeling support for long-term and short-term dynamics of load time series, excessively high model input dimensionality due to unscientific feature selection, limited historical data due to equipment maintenance and other factors that easily exacerbate overfitting, and difficulty in taking into account complex dynamic coupling and spatiotemporal dependence characteristics by single time series modeling or single spatial structure modeling.
[0005] Technical solution: The load forecasting method based on GCN-LSTM and frequency domain disturbance enhancement described in this invention includes:
[0006] Step 1: Obtain multi-region building data, including meteorological data and load values at each time stamp; use the random forest regression method to assess the importance of meteorological features in the meteorological data, select the top-ranked meteorological features as input features, and construct an input feature set based on multi-region building data;
[0007] Step 2: Preprocess the input feature set to obtain a multidimensional feature set; use the sliding window method to generate a continuous-time sample library from the multidimensional feature set, and convert the continuous-time sample library into a graph-structured sample library, which is then divided into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio.
[0008] Step 3: Apply frequency domain random phase perturbation enhancement to each training sample in the graph structured training sample library with a preset probability to obtain the enhanced training sample library;
[0009] Step 4: Concatenate the graph convolutional network and the long short-term memory network to construct a GCN-LSTM neural network model. Iteratively train the GCN-LSTM neural network model using the enhanced training sample library to obtain the trained GCN-LSTM neural network model. Input the graph structured test sample library into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
[0010] Furthermore, the importance assessment includes: using a random forest regression method to assess the importance of the meteorological feature based on the reduction in the mean squared error before and after node splitting. The importance formula for all decision tree split nodes in a random forest is:
[0011] ;
[0012] in, Meteorological characteristics Importance score The number of decision trees in the random forest; For the first All features used in a decision tree The set of nodes to be split. For nodes Mean square error before splitting For nodes Weighted mean square error after splitting.
[0013] Furthermore, the preprocessing includes: deleting all samples in the input feature set that contain any missing items, parsing each timestamp in the input feature set after missing value processing into hours and months, performing periodic encoding using sine and cosine functions to determine time features; concatenating the input features, loading values, and time features of each sample in the input feature set after missing value processing, and scaling the data using the min-max normalization method to obtain a multidimensional feature set.
[0014] Furthermore, the step of generating a continuous-time sample library from a multi-dimensional feature set using the sliding window method includes: setting the sliding window length. Extracting the first feature from the multidimensional feature set Time step to the 1st The multidimensional feature vectors at each time step are used as the input sequence, with the first... The load value at each time step is used as the forecast target to form the first... Continuous time samples at time steps; a continuous time sample library is generated by traversing the full-time data in the multidimensional feature set using the sliding window method.
[0015] Furthermore, the conversion of the continuous-time sample library into a graph-structured sample library includes: for each continuous-time sample in the continuous-time sample library, constructing a chained directed graph to connect the continuous-time samples... Each time step corresponds to There are 1, 2, 3 nodes, and each node is defined as a multi-dimensional feature vector corresponding to the time step. The nodes are numbered 1-1 in chronological order. Construct a chained adjacency matrix The chain adjacency matrix is defined as the edge relationship of the chain directed graph, with only 1s taken at the first secondary diagonal above the main diagonal and all other elements being 0s. This transforms continuous-time samples into graph-structured samples; all graph-structured samples form a graph-structured sample library.
[0016] Furthermore, the frequency domain random phase perturbation enhancement includes: performing a Fast Fourier Transform on all feature dimensions of the training samples to obtain the amplitude spectrum and phase spectrum of each feature dimension; keeping the amplitude spectrum of each feature dimension unchanged, adding Gaussian noise that satisfies a normal distribution only to the phase spectrum of each feature dimension to obtain a new phase distribution for each feature dimension; performing an Inverse Fourier Transform on each feature dimension to reconstruct the time-domain sequence and obtain a new sample feature sequence, expressed as:
[0017] ;
[0018] in, For the first The time series reconstructed by frequency domain phase perturbation of each feature dimension For the first The amplitude spectrum of each feature dimension For the first A new phase distribution for each feature dimension.
[0019] Furthermore, the step of constructing a GCN-LSTM neural network model by concatenating a graph convolutional network and a long short-term memory network includes: concatenating two layers of graph convolutional networks and two layers of long short-term memory networks, followed by three layers of fully connected networks to construct a GCN-LSTM neural network model; the graph convolutional network aggregates features from adjacent time steps through a chained adjacency matrix, performing feature dimensionality upscaling and downscaling layer by layer to obtain a node feature sequence; the long short-term memory network extracts the dependencies of the node feature sequences layer by layer, selecting the hidden state of the last time step of the output sequence as the temporal feature representation; the fully connected network maps the temporal feature representation into a one-dimensional regression output to obtain the predicted load value.
[0020] Furthermore, the iterative training includes: dividing the enhanced training sample library into a training set and a validation set according to a preset ratio; setting an upper limit for the number of training rounds; in each iteration, inputting the training set into the GCN-LSTM neural network model, performing forward propagation, calculating the mean square error between the predicted load value and the actual load value as the training set loss for that round, performing backpropagation through the Adam optimizer to update the network parameters, and obtaining the GCN-LSTM neural network model after that round of training; after the end of that round of training, inputting the validation set into the GCN-LSTM neural network model after that round of training, and calculating the validation set loss; recording the training set loss and validation set loss for each round; setting an early stopping mechanism: if the validation set loss does not decrease for a preset number of consecutive rounds, the iteration is terminated early; otherwise, the iteration is terminated after reaching the upper limit for the number of training rounds; loading the network parameters with the lowest validation set loss as the trained GCN-LSTM neural network model.
[0021] The load forecasting system based on GCN-LSTM and frequency domain perturbation enhancement described in this invention includes:
[0022] The feature selection module is used to acquire multi-region building data, including meteorological data and load values at each time stamp; it uses the random forest regression method to evaluate the importance of meteorological features in the meteorological data, selects the top-ranked meteorological features as input features, and constructs an input feature set based on multi-region building data;
[0023] The graph construction module is used to preprocess the input feature set to obtain a multidimensional feature set; a continuous-time sample library is generated from the multidimensional feature set using the sliding window method, and the continuous-time sample library is converted into a graph-structured sample library, which is divided into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio.
[0024] The graph enhancement module is used to perform frequency domain random phase perturbation enhancement on each training sample in the graph structured training sample library with a preset probability to obtain an enhanced training sample library.
[0025] The offline learning module is used to construct a GCN-LSTM neural network model by concatenating a graph convolutional network and a long short-term memory network. The GCN-LSTM neural network model is iteratively trained using an enhanced training sample library to obtain the trained GCN-LSTM neural network model. The graph structured test sample library is input into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
[0026] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method.
[0027] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0028] 1. Dimensionality reduction and efficiency improvement, and elimination of redundancy: By evaluating the importance of features through random forest, redundant and weakly correlated meteorological variables are eliminated, thereby reducing the dimensionality and complexity of the model input;
[0029] 2. Enhanced generalization ability and noise resistance: By introducing a frequency domain random phase perturbation data enhancement strategy, the distribution of training samples is enriched while maintaining the amplitude spectrum structure. Compared with no enhancement, time domain noise addition and wavelet transform perturbation methods, this invention can alleviate the overfitting problem in small sample scenarios and improve the robustness of the model to local fluctuations and abnormal events.
[0030] 3. High accuracy in spatiotemporal feature extraction: By fusing the chain-oriented directed graph structure with GCN-LSTM, compared with a single GCN or LSTM model, it can simultaneously mine the spatial dependence and load temporal variation characteristics between multiple physical features, achieving lower root mean square error and higher coefficient of determination on the test set, thus improving the accuracy of complex load temporal prediction. Attached Figure Description
[0031] Figure 1 This is a flowchart of the method of the present invention.
[0032] Figure 2 The results are the screening results for the importance of features in this invention.
[0033] Figure 3 This is a flowchart of the frequency domain enhancement process of the present invention.
[0034] Figure 4 This is a graph of the loss function of the algorithm of this invention. Detailed Implementation
[0035] like Figure 1 As shown, the load forecasting method based on GCN-LSTM and frequency domain disturbance enhancement according to the present invention includes:
[0036] Step 1: Obtain multi-region building data, including meteorological data and load values at each time stamp; use the random forest regression method to assess the importance of meteorological features in the meteorological data, select the top-ranked meteorological features as input features, and construct an input feature set based on multi-region building data;
[0037] Specifically, step 1 includes:
[0038] Step 1-1, Feature Selection: Acquire multi-region building data, including meteorological data and load values at each time stamp. The meteorological data at each time stamp includes meteorological data for each region. The meteorological features in the meteorological data for each region include temperature (T2M), humidity (QV2M), rainfall (TQL), and wind speed (W2M). Let the multi-region building data be... ,in For the first The meteorological feature vector of each sample, For the first The load value corresponding to each sample's timestamp. This represents the total number of samples in the multi-region building data;
[0039] Steps 1-2: Importance Assessment: Using the random forest regression method, the importance of the meteorological features is assessed by the reduction in the mean squared error (MSE) before and after node splits. The importance of all decision tree split nodes in a random forest can be expressed as:
[0040] ;
[0041] in, Meteorological characteristics Importance score The number of decision trees in the random forest is 100 in this embodiment, and the random seed is set to 42. For the first All features used in a decision tree The set of nodes to be split. For nodes Mean square error before splitting For nodes Weighted mean square error after splitting;
[0042] Steps 1-3: Feature Selection: Based on the importance scores of each meteorological feature, select the top 8 features as input features, such as... Figure 2As shown, the top 8 features are: T2M_dav, T2M_toc, T2M_san, W2M_san, QV2M_san, QV2M_dav, TQL_toc, and TQL_san; based on multi-region building data, an input feature set is constructed with timestamps as rows and input features and load values as columns;
[0043] Step 2: Preprocess the input feature set to obtain a multidimensional feature set; use the sliding window method to generate a continuous-time sample library from the multidimensional feature set, convert the continuous-time sample library into a graph-structured sample library, and divide it into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio.
[0044] Specifically, step 2 includes:
[0045] Step 2-1: Delete all samples in the input feature set that contain any missing items (NaN or null values);
[0046] Step 2-2: Based on the periodicity of the time field, parse each timestamp in the input feature set after handling missing values into hours and months, and then perform periodic encoding using sine and cosine functions to transform it into... , as well as , Four temporal features; concatenate the eight input features, loading values and four temporal features of each sample in the input feature set after missing values are processed to obtain a 13-dimensional preliminary feature set; use the min-max normalization method to scale each feature vector in the preliminary feature set to the interval [0,1] to obtain a multi-dimensional feature set, including the multi-dimensional feature vector of each time step.
[0047] Steps 2-3: Set the length of the sliding window (In this embodiment, it is 24), extracting the first feature from the multidimensional feature set. Time step to the 1st The 13-dimensional multidimensional feature vectors at each time step are used as the input sequence, with the 13-dimensional feature vectors at the 1st time step as the input sequence. The load value at each time step is used as the forecast target to form the first... Continuous time samples at each time step; a continuous time sample library is generated by traversing the full-time data in the multidimensional feature set using the sliding window method.
[0048] Constructing a multidimensional feature matrix based on the input sequence The expression is:
[0049] :
[0050] in, For the first in the multidimensional feature set The first multidimensional feature vector at time step One data point;
[0051] Steps 2-4: Transform each continuous-time sample in the continuous-time sample library into a graph structure to obtain a graph-structured sample library: This is done by constructing a chained directed graph, connecting each continuous-time sample... Each time step corresponds to There are 1, 2, 3 nodes, and each node's feature is defined as a multi-dimensional feature vector corresponding to the node's time step. The nodes are numbered 1-100000 according to the time sequence. Construct a chained adjacency matrix Only the elements on the first secondary diagonal above the main diagonal are set to 1, and all other elements are set to 0, forming a strictly upper triangular sparse structure. The chained adjacency matrix is defined as the edge relationship of a chained directed graph, where the edge direction represents the information from the current time step to the next time step. This transforms continuous time samples into graph-structured samples. All graph-structured samples constitute a graph-structured sample library.
[0052] The graph structure sample library is divided into a graph structured training sample library and a graph structured test sample library according to a preset ratio. Each graph structure sample in the graph structured training sample library is a training sample; each graph structure sample in the graph structured test sample library is a test sample.
[0053] Step 3: Apply frequency domain random phase perturbation enhancement to each training sample in the graph structured training sample library with a preset probability to obtain the enhanced training sample library;
[0054] Specifically, such as Figure 3 As shown, step 3, which enhances the frequency domain random phase perturbation of each training sample in the training sample library, includes:
[0055] Step 3-1: Perform Fast Fourier Transform (FFT) on all feature dimensions of the training samples to obtain the amplitude and phase spectra of each feature dimension. Assume the training samples contain N time steps and d features. For the time series data of the j-th feature dimension... First, perform a Fourier transform to obtain the amplitude spectrum of each feature dimension. Phase spectrum ;
[0056] Step 3-2: Keep the amplitude spectrum of each feature dimension unchanged, and add Gaussian noise with a mean of 0 and a standard deviation of σ (0.03 in this example) only to the phase spectrum of each feature dimension. This yields new phase distributions for each feature dimension. ;
[0057] Step 3-3: Perform Inverse Fourier Transform (IFFT) on each feature dimension to reconstruct the time-domain sequence and generate a new sample feature sequence, expressed as:
[0058] ;
[0059] in, For the first The time series reconstructed by frequency domain phase perturbation of each feature dimension.
[0060] Steps 3-1 to 3-3 are performed on each training sample in the graph-structured training sample library with a preset probability p=0.8. If the training sample is enhanced with the preset probability, the enhanced training sample is obtained. If the training sample is not enhanced with the preset probability, the enhanced training sample remains unchanged. All enhanced training samples constitute the enhanced training sample library.
[0061] The frequency domain random phase perturbation enhancement introduces Gaussian noise with zero mean and controllable standard deviation into the phase spectrum while keeping the amplitude spectrum unchanged. The time domain sequence is reconstructed by inverse Fourier transform, generating enhanced samples that combine the original frequency domain characteristics with distribution diversity. This strategy expands the frequency domain expression space of the training samples, improves the model's adaptability to samples that exceed historical distributions and its robustness to local fluctuations, reduces the model's dependence on specific historical samples, thereby alleviating the overfitting problem in small sample scenarios and improving the generalization performance and prediction stability of the load prediction model.
[0062] Step 4: Concatenate the graph convolutional network and the long short-term memory network to construct a GCN-LSTM neural network model. Iteratively train the GCN-LSTM neural network model using the enhanced training sample library to obtain the trained GCN-LSTM neural network model. Input the graph structured test sample library into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
[0063] Specifically, step 4 includes:
[0064] Step 4-1: Concatenate two layers of Graph Convolutional Network (GCN) with two layers of Long Short-Term Memory Network (LSTM), and then connect three layers of fully connected network to construct the GCN-LSTM neural network model. The input dimension of GCN is 24×13. The first layer of GCN aggregates the features of adjacent nodes through graph convolution operations, increasing the feature dimension to 128 dimensions. The second layer of GCN further aggregates neighborhood information, reducing the feature dimension to 64 dimensions. It aggregates the features of adjacent time steps through a chained adjacency matrix to obtain the node feature sequence. The 24×64-dimensional node feature sequence output by GCN is input into the two layers of LSTM in chronological order. The number of hidden units in each layer is set to 64, and Dropout (dropout rate 0.2) is introduced between layers. The temporal features of the hidden state (64-dimensional) window at the last time step of the LSTM output sequence are selected for representation. The temporal features are then input into a fully connected layer. The first fully connected layer is mapped to 32 dimensions, the second layer to 16 dimensions, and the third layer to a 1-dimensional regression output to obtain the predicted load value. The activation function is ReLU, and Dropout (dropout rate 0.2) is added between fully connected layers.
[0065] Step 4-2: Divide the enhanced training sample library into training and validation sets according to a preset ratio. Set the batch size to 64 and the maximum number of training epochs to 200. In each iteration, input the training set into the GCN-LSTM neural network model, perform forward propagation, calculate the mean squared error between the predicted load value and the actual load value as the training set loss for that epoch, and perform backpropagation through the Adam optimizer with a learning rate of 5e-4 to update the network parameters, obtaining the GCN-LSTM neural network model after that epoch training. After the training epoch is completed, input the validation set into the GCN-LSTM neural network model after that epoch training, and calculate the validation set loss. Repeat the above training and validation phases in each iteration, continuously recording the training set loss and validation set loss for each epoch. Set an early stopping mechanism: if the validation set loss does not decrease for 30 consecutive epochs, terminate the iteration early; otherwise, terminate the iteration after reaching the maximum number of training epochs. During training, continuously save the network parameters corresponding to the lowest validation set loss. When early stopping is triggered or the maximum number of training epochs is reached, the network parameters that minimize the loss on the validation set are loaded as the trained GCN-LSTM neural network model. The losses on the training and validation sets are as follows: Figure 4 As shown. All experiments were conducted with random seeds to ensure reproducibility of results.
[0066] Step 4-3: Input the test samples from the graph structured test sample library into the trained GCN-LSTM neural network model to obtain the predicted load value for each test sample.
[0067] Example 2
[0068] The load forecasting system based on GCN-LSTM and frequency domain perturbation enhancement described in this invention includes: a feature selection module, a graph construction module, a graph enhancement module, and an offline learning module;
[0069] The feature selection module is used to acquire multi-region building data, including meteorological data and load values at each time stamp; it uses the random forest regression method to evaluate the importance of meteorological features in the meteorological data, selects the top-ranked meteorological features as input features, and constructs an input feature set based on multi-region building data;
[0070] Specifically, the feature filtering module includes a feature selection module, an importance assessment module, and a feature selection module;
[0071] The feature selection module is used to acquire multi-region building data, including meteorological data and load values at each time stamp. The meteorological data at each time stamp includes meteorological data for each region, and the meteorological features in the meteorological data for each region include temperature (T2M), humidity (QV2M), rainfall (TQL), and wind speed (W2M). Let the multi-region building data be... ,in For the first The meteorological feature vector of each sample, For the first The load value corresponding to each sample's timestamp. This represents the total number of samples in the multi-region building data;
[0072] The importance assessment module uses a random forest regression method to assess the importance of meteorological features by measuring the reduction in mean squared error (MSE) before and after node splits. The importance of all decision tree split nodes in a random forest can be expressed as:
[0073] ;
[0074] in, Meteorological characteristics Importance score The number of decision trees in the random forest is 100 in this embodiment, and the random seed is set to 42. For the first All features used in a decision tree The set of nodes to be split. For nodes Mean square error before splitting For nodes Weighted mean square error after splitting;
[0075] The feature selection module is used to rank meteorological features based on their importance scores and select the top 8 features as input features, such as... Figure 2 As shown, the top 8 features are: T2M_dav, T2M_toc, T2M_san, W2M_san, QV2M_san, QV2M_dav, TQL_toc, and TQL_san; based on multi-region building data, an input feature set is constructed with timestamps as rows and input features and load values as columns;
[0076] The graph construction module is used to preprocess the input feature set to obtain a multidimensional feature set; a continuous-time sample library is generated from the multidimensional feature set using the sliding window method, and the continuous-time sample library is converted into a graph-structured sample library, which is divided into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio.
[0077] Specifically, the graph construction module includes a deletion module, a time encoding module, a sample generation module, and a graph structuring transformation module;
[0078] The deletion module is used to delete all samples in the input feature set that contain any missing items (NaN or null values).
[0079] The time encoding module is used to analyze the periodic patterns of time fields. It parses each timestamp in the input feature set after handling missing values into hours and months, and then performs periodic encoding using sine and cosine functions to transform it into... , as well as , Four temporal features; concatenate the eight input features, loading values and four temporal features of each sample in the input feature set after missing values are processed to obtain a 13-dimensional preliminary feature set; use the min-max normalization method to scale each feature vector in the preliminary feature set to the interval [0,1] to obtain a multi-dimensional feature set, including the multi-dimensional feature vector of each time step.
[0080] The sample generation module is used to set the sliding window length. (In this embodiment, it is 24), extracting the first feature from the multidimensional feature set. Time step to the 1st The 13-dimensional multidimensional feature vectors at each time step are used as the input sequence, with the 13-dimensional feature vectors at the 1st time step as the input sequence. The load value at each time step is used as the forecast target to form the first... Continuous time samples at each time step; a continuous time sample library is generated by traversing the full-time data in the multidimensional feature set using the sliding window method.
[0081] Constructing a multidimensional feature matrix based on the input sequence The expression is:
[0082] :
[0083] in, For the first in the multidimensional feature set The first multidimensional feature vector at time step One data point;
[0084] The graph structuring transformation module is used to transform each continuous-time sample in the continuous-time sample library into a graph structured sample library: by constructing a chained directed graph, the graph structure of each continuous-time sample is transformed into a graph structured sample library. Each time step corresponds to There are 1, 2, 3 nodes, and each node's feature is defined as a multi-dimensional feature vector corresponding to the node's time step. The nodes are numbered 1-100000 according to the time sequence. Construct a chained adjacency matrix Only the elements on the first secondary diagonal above the main diagonal are set to 1, and all other elements are set to 0, forming a strictly upper triangular sparse structure. The chained adjacency matrix is defined as the edge relationship of a chained directed graph, where the edge direction represents the information from the current time step to the next time step. This transforms continuous time samples into graph-structured samples. All graph-structured samples constitute a graph-structured sample library.
[0085] The graph structure sample library is divided into a graph structured training sample library and a graph structured test sample library according to a preset ratio. Each graph structure sample in the graph structured training sample library is a training sample; each graph structure sample in the graph structured test sample library is a test sample.
[0086] The graph enhancement module is used to perform frequency domain random phase perturbation enhancement on each training sample in the graph structured training sample library with a preset probability to obtain an enhanced training sample library.
[0087] Specifically, such as Figure 3 As shown, the graph enhancement module enhances the frequency domain random phase perturbation of each training sample in the training sample library, including a fast Fourier transform module, a Gaussian noise module, and an inverse Fourier transform module.
[0088] The Fast Fourier Transform (FFT) module performs FFT on all feature dimensions of the training samples to obtain the amplitude and phase spectra of each feature dimension. Assume the training samples contain N time steps and d features. For the time series data of the j-th feature dimension... First, perform a Fourier transform to obtain the amplitude spectrum of each feature dimension. Phase spectrum ;
[0089] The Gaussian noise module is used to keep the amplitude spectrum of each feature dimension unchanged, and only adds Gaussian noise with a mean of 0 and a standard deviation of σ (0.03 in this embodiment) to the phase spectrum of each feature dimension. This yields new phase distributions for each feature dimension. ;
[0090] The Inverse Fourier Transform (IFFT) module is used to perform an IFFT on each feature dimension to reconstruct the time-domain sequence and generate a new sample feature sequence. The expression is:
[0091] ;
[0092] in, For the first The time series reconstructed by frequency domain phase perturbation of each feature dimension.
[0093] With a preset probability p=0.8, frequency domain random phase perturbation enhancement is performed on each training sample in the graph-structured training sample library using the Fast Fourier Transform (FFT) to Inverse Fourier Transform (IFT) modules. If the training sample is enhanced with the preset probability, the enhanced training sample is obtained; if it is not enhanced with the preset probability, the enhanced training sample remains unchanged. All enhanced training samples constitute the enhanced training sample library.
[0094] The frequency domain random phase perturbation enhancement introduces Gaussian noise with zero mean and controllable standard deviation into the phase spectrum while keeping the amplitude spectrum unchanged. The time domain sequence is reconstructed by inverse Fourier transform, generating enhanced samples that combine the original frequency domain characteristics with distribution diversity. This strategy expands the frequency domain expression space of the training samples, improves the model's adaptability to samples that exceed historical distributions and its robustness to local fluctuations, reduces the model's dependence on specific historical samples, thereby alleviating the overfitting problem in small sample scenarios and improving the generalization performance and prediction stability of the load prediction model.
[0095] The offline learning module is used to construct a GCN-LSTM neural network model by concatenating a graph convolutional network and a long short-term memory network. The GCN-LSTM neural network model is iteratively trained using an enhanced training sample library to obtain the trained GCN-LSTM neural network model. The graph structured test sample library is input into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
[0096] Specifically, the offline learning module includes a model building module, an iterative training module, and a testing module;
[0097] The model building module is used to concatenate two layers of Graph Convolutional Network (GCN) and two layers of Long Short-Term Memory Network (LSTM), and then connect them to three layers of fully connected network to construct a GCN-LSTM neural network model. The GCN input dimension is 24×13. The first layer of GCN aggregates the features of adjacent nodes through graph convolution operations, increasing the feature dimension to 128 dimensions. The second layer of GCN further aggregates neighborhood information, reducing the feature dimension to 64 dimensions. It aggregates the features of adjacent time steps through a chained adjacency matrix to obtain the node feature sequence. The 24×64-dimensional node feature sequence output by GCN is input into the two layers of LSTM in chronological order. The number of hidden units in each layer is set to 64, and Dropout (dropout rate 0.2) is introduced between layers. The temporal features of the hidden state (64-dimensional) window at the last time step of the LSTM output sequence are selected for representation. The temporal features are then input into a fully connected layer. The first fully connected layer is mapped to 32 dimensions, the second layer to 16 dimensions, and the third layer to a 1-dimensional regression output to obtain the predicted load value. The activation function is ReLU, and Dropout (dropout rate 0.2) is added between fully connected layers.
[0098] The iterative training module divides the enhanced training sample library into training and validation sets according to a preset ratio. The batch size is set to 64, and the maximum number of training epochs is 200. In each iteration, the training set is input into the GCN-LSTM neural network model, forward propagation is performed, and the mean squared error between the predicted and actual load values is calculated as the training set loss for that epoch. Backpropagation is then performed using the Adam optimizer with a learning rate of 5e-4 to update the network parameters, resulting in the GCN-LSTM neural network model after that epoch. After the training epoch, the validation set is input into the GCN-LSTM neural network model, and the validation set loss is calculated. Each iteration repeats the training and validation phases, continuously recording the training and validation set losses for each epoch. An early stopping mechanism is implemented: if the validation set loss does not decrease for 30 consecutive epochs, the iteration is terminated early; otherwise, it terminates after reaching the maximum number of training epochs. During training, the network parameters corresponding to the lowest validation set loss are continuously saved. When early stopping is triggered or the maximum number of training epochs is reached, the network parameters that minimize the loss on the validation set are loaded as the trained GCN-LSTM neural network model. The losses on the training and validation sets are as follows: Figure 4 As shown. All experiments were conducted with random seeds to ensure reproducibility of results.
[0099] The testing module is used to input test samples from the graph-structured test sample library into the trained GCN-LSTM neural network model to obtain the predicted load value for each test sample.
[0100] Example 3
[0101] The present invention discloses a load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement.
[0102] The load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement may include, but is not limited to, a processor and a memory. The processor may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits (ASICs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The memory can be used to store the computer program and / or modules. The processor implements various functions of the load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement by running or executing the computer program and / or modules stored in the memory, and by calling data stored in the memory. If the modules / units integrated in the load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process of the load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement. This can also be accomplished by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of the load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0103] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement, characterized in that, include: Step 1: Obtain building data for multiple regions, including meteorological data and load values for each time stamp; The importance of meteorological features in meteorological data is assessed using the random forest regression method. Several meteorological features with the highest importance assessment are selected as input features. An input feature set is constructed based on multi-regional building data. Step 2: Preprocess the input feature set to obtain a multidimensional feature set; A continuous-time sample library is generated from a multi-dimensional feature set using the sliding window method, and then the continuous-time sample library is converted into a graph-structured sample library, which is divided into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio. Step 3: Apply frequency domain random phase perturbation enhancement to each training sample in the graph structured training sample library with a preset probability to obtain the enhanced training sample library; Step 4: Concatenate the graph convolutional network and the long short-term memory network to construct a GCN-LSTM neural network model. Iteratively train the GCN-LSTM neural network model using the enhanced training sample library to obtain the trained GCN-LSTM neural network model. Input the graph structured test sample library into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
2. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 1, characterized in that, The importance assessment includes: using a random forest regression method, assessing the importance of the meteorological feature by the reduction in the mean squared error before and after node splitting; the meteorological feature... The importance formula for all decision tree split nodes in a random forest is: ; in, Meteorological characteristics Importance score The number of decision trees in the random forest; For the first All features used in a decision tree The set of nodes to be split. For nodes Mean square error before splitting For nodes Weighted mean square error after splitting.
3. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 1, characterized in that, The preprocessing includes: deleting all samples in the input feature set that contain any missing items, parsing each timestamp in the input feature set after missing value processing into hours and months, and periodically encoding them using sine and cosine functions to determine time features; concatenating the input features, loading values, and time features of each sample in the input feature set after missing value processing, and scaling the data using the min-max normalization method to obtain a multidimensional feature set.
4. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 1, characterized in that, The method of generating a continuous-time sample library from a multidimensional feature set using the sliding window method includes: setting the sliding window length. Extracting the first feature from the multidimensional feature set Time step to the 1st The multidimensional feature vectors at each time step are used as the input sequence, with the first... The load value at each time step is used as the forecast target to form the first... Continuous time samples at time steps; a continuous time sample library is generated by traversing the full-time data in the multidimensional feature set using the sliding window method.
5. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 4, characterized in that, The process of converting the continuous-time sample library into a graph-structured sample library includes: for each continuous-time sample in the continuous-time sample library, constructing a chained directed graph to connect the continuous-time samples... Each time step corresponds to There are 1, 2, 3 nodes, and each node is defined as a multi-dimensional feature vector corresponding to the time step. The nodes are numbered 1-1 in chronological order. Construct a chained adjacency matrix The chain adjacency matrix is defined as the edge relationship of the chain directed graph, with only 1s taken at the first secondary diagonal above the main diagonal and all other elements being 0s. This transforms continuous-time samples into graph-structured samples; all graph-structured samples form a graph-structured sample library.
6. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 1, characterized in that, The frequency domain random phase perturbation enhancement includes: performing a Fast Fourier Transform on all feature dimensions of the training samples to obtain the amplitude spectrum and phase spectrum of each feature dimension; keeping the amplitude spectrum of each feature dimension unchanged, adding Gaussian noise that satisfies a normal distribution only to the phase spectrum of each feature dimension to obtain a new phase distribution for each feature dimension; performing an Inverse Fourier Transform on each feature dimension to reconstruct the time-domain sequence and obtain a new sample feature sequence, expressed as: ; in, For the first The time series reconstructed by frequency domain phase perturbation of each feature dimension For the first The amplitude spectrum of each feature dimension For the first A new phase distribution for each feature dimension.
7. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 1, characterized in that, The method of constructing a GCN-LSTM neural network model by concatenating a graph convolutional network and a long short-term memory network includes: concatenating two layers of graph convolutional networks and two layers of long short-term memory networks, followed by three layers of fully connected networks to construct the GCN-LSTM neural network model; the graph convolutional network aggregates features from adjacent time steps through a chained adjacency matrix, performs feature dimensionality upscaling and downscaling layer by layer to obtain a node feature sequence; the long short-term memory network extracts the dependencies of the node feature sequences layer by layer, and selects the hidden state of the last time step of the output sequence as the temporal feature representation; the fully connected network maps the temporal feature representation into a one-dimensional regression output to obtain the predicted load value.
8. The load forecasting method based on GCN-LSTM and frequency domain perturbation enhancement according to claim 7, characterized in that, The iterative training includes: dividing the enhanced training sample library into a training set and a validation set according to a preset ratio; setting an upper limit for the number of training rounds; in each iteration, inputting the training set into the GCN-LSTM neural network model, performing forward propagation, calculating the mean square error between the predicted load value and the actual load value as the training set loss for that round, performing backpropagation through the Adam optimizer to update the network parameters, and obtaining the GCN-LSTM neural network model after that round of training; after the end of that round of training, inputting the validation set into the GCN-LSTM neural network model after that round of training, and calculating the validation set loss; recording the training set loss and validation set loss for each round; setting an early stopping mechanism: if the validation set loss does not decrease for a preset number of consecutive rounds, the iteration is terminated early; otherwise, the iteration is terminated after reaching the upper limit for the number of training rounds; loading the network parameters with the lowest validation set loss as the trained GCN-LSTM neural network model.
9. A load forecasting system based on GCN-LSTM and frequency domain perturbation enhancement, characterized in that, include: The feature filtering module is used to obtain building data from multiple regions, including meteorological data and load values at each time stamp; The importance of meteorological features in meteorological data is assessed using the random forest regression method. Several meteorological features with the highest importance assessment are selected as input features. An input feature set is constructed based on multi-regional building data. The graph construction module is used to preprocess the input feature set to obtain a multidimensional feature set; A continuous-time sample library is generated from a multi-dimensional feature set using the sliding window method, and then the continuous-time sample library is converted into a graph-structured sample library, which is divided into a graph-structured training sample library and a graph-structured test sample library according to a preset ratio. The graph enhancement module is used to perform frequency domain random phase perturbation enhancement on each training sample in the graph structured training sample library with a preset probability to obtain an enhanced training sample library. The offline learning module is used to construct a GCN-LSTM neural network model by concatenating a graph convolutional network and a long short-term memory network. The GCN-LSTM neural network model is iteratively trained using an enhanced training sample library to obtain the trained GCN-LSTM neural network model. The graph structured test sample library is input into the trained GCN-LSTM neural network model to obtain the predicted load value of each test sample.
10. A load forecasting device based on GCN-LSTM and frequency domain perturbation enhancement, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
