Medium-short-term load prediction method for smart power grid

Through the medium and short-term load prediction method of smart grids, data acquisition, time series feature extraction and multiple model construction methods are used to solve the problem of insufficient accuracy when dealing with complex nonlinear relationships, and achieve higher load prediction accuracy and adaptability.

CN120049402AInactive Publication Date: 2025-05-27GANSU ELECTRIC POWER INFORMATION COMM +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411886363.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional grid load prediction methods are difficult to deal with complex nonlinear relationships in load data. Faced with the multivariable, strong randomness and volatility of grid load, prediction accuracy is difficult to meet the needs of modern grid refined management.

Method used

The medium- and short-term load prediction method of smart grid is adopted, and time series characteristics are extracted through data acquisition and preliminary processing to construct medium-term and short-term load prediction models. Specific steps include data acquisition and preliminary processing, time series feature extraction, construction of a mid-term model of recurrent neural network and linear regression based on attention mechanism, and a mixed short-term model of convolutional neural network and long-term memory network.

Benefits of technology

Through multi-source data acquisition and comprehensive preliminary processing, combined with multiple feature extraction and dimensionality reduction methods, the accuracy of medium- and short-term load predictions of the power grid is effectively improved, and reliable prediction results can be provided at different time scales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120049402A_ABST
    Figure CN120049402A_ABST
Patent Text Reader

Abstract

The invention relates to the field of power grid load prediction, in particular to a smart power grid medium-short-term load prediction method, which comprises the steps of data acquisition and primary processing, historical load data acquisition from a power grid monitoring system, processing of checking missing values, abnormal values and repeated values for the acquired data, and time sequence feature extraction. Calculating an autocorrelation function of the load data, carrying out discretization processing on the meteorological data, then carrying out principal component analysis, and respectively constructing a medium-term load prediction model and a short-term load prediction model; according to the medium-short-term load prediction method for the smart power grid, the data quality is ensured through multi-source data acquisition and comprehensive preliminary processing, and the inherent rule of data is effectively mined and the data complexity is reduced through a multi-feature extraction and dimension reduction method in feature engineering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power grid load forecasting, and specifically to a medium - and short - term load forecasting method for smart grids. Background Art

[0002] In the operation and management of modern power systems, power grid load forecasting is an extremely crucial link. Medium - term load forecasting (generally covering several weeks, months to one year) plays a decisive role in the long - term planning of the power grid, equipment maintenance arrangements, and strategic allocation of power resources. Short - term load forecasting (usually from several hours to one week) is the core basis for the daily operation and dispatching of the power grid, which is directly related to the formulation of power generation plans, real - time load balancing, and stable trading in the power market.

[0003] There are many traditional power grid load forecasting methods. The time - series analysis method is based on the time - series characteristics of historical load data, such as the simple moving average method. However, these traditional methods often have difficulty dealing with the complex non - linear relationships in load data. Facing the multi - variable, strong randomness, and volatility of power grid loads, the forecasting accuracy is difficult to meet the requirements of refined management of modern power grids. Summary of the Invention

[0004] In order to overcome the above - mentioned technical problems, the purpose of the present invention is to provide a medium - and short - term load forecasting method for smart grids to solve the problems raised in the background art.

[0005] The purpose of the present invention can be achieved through the following technical solutions:

[0006] A medium - and short - term load forecasting method for smart grids, which specifically includes the following steps:

[0007] S1. Data collection and preliminary processing: Collect historical load data from the power grid monitoring system, and for the collected data, check and process missing values, outliers, and duplicate values;

[0008] S2. Time - series feature extraction: Calculate the autocorrelation function of load data. For meteorological data, perform discretization processing, and then perform principal component analysis;

[0009] S3. Construct a medium - term load forecasting model and a short - term load forecasting model respectively;

[0010] S4. For both the medium - term and short - term load forecasting models, use the root - mean - square error (RMSE), mean absolute error (MAE), and coefficient of determination (R 2 ) as evaluation indicators for evaluation.

[0011] As a further solution of the present invention: The specific processing steps of S1 are as follows:

[0012] S11. Collect historical load data from the power grid monitoring system with a time resolution of 1 hour to obtain fine-grained load change information. Collect meteorological data from the meteorological monitoring station, including temperature, humidity, wind speed, and air pressure. The collection frequency is synchronized with the load data to ensure corresponding meteorological information at the same time point. Obtain date-related data from the calendar information system, such as whether it is a working day (Monday to Friday are working days, Saturday and Sunday are rest days), holiday types (statutory holidays, compensatory leave days, etc.), and the season (spring, summer, autumn, winter), etc.

[0013] S12. For the collected data, check for missing values, outliers, and duplicate values. For missing values, if the missing proportion is less than 5%, use the mean filling method, that is, calculate the historical mean of the variable and replace the missing value with the mean. If the missing proportion is greater than 5%, use the filling method based on similar days. When determining similar days, comprehensively consider factors such as date type and meteorological conditions. For example, if a missing data day is a working day and the temperature is between 20 - 25°C and the humidity is between 40% - 60%, select a set of dates in history with the same date type and similar meteorological conditions (temperature deviation within ±2°C, humidity deviation within ±10%), and then select appropriate values from the similar day data for filling. For outliers, use the 3σ principle to identify, that is, if the data value exceeds the range of the mean ± 3 times the standard deviation, it is determined as an outlier, and the outlier is replaced with the median of adjacent data. For duplicate values, directly delete them.

[0014] S13. Use the Min - Max normalization formula to map the data to the 0 - 1 interval, making data of different magnitudes comparable and facilitating subsequent calculations and analyses, where is the result after normalization, min(x j ) and max(x j ) are the minimum and maximum values of variable j respectively. For example, for load data, if the historical minimum value is 500 MW and the maximum value is 2000 MW, and the load value at a certain moment is 1200 MW, then the normalized value is (1200 - 500) / (2000 - 500) = 0.467.

[0015] As a further solution of the present invention: The specific processing steps of S2 are as follows:

[0016] S21. Calculate the autocorrelation function of the load data, and extract the peak value of the autocorrelation function and its corresponding lag order as features. The formula is: where, L t is the load value at time t, is the load mean value, k is the lag order. For example, if the autocorrelation function shows a peak at a lag order of 24 hours, this may indicate that the load has a daily cycle characteristic. This peak and the lag order of 24 are used as an important feature to calculate the partial autocorrelation function PACF of the load data k , by analyzing its characteristics such as truncation, extracting characteristic information such as the truncation point. If the partial autocorrelation function truncates at a lag order of 3, this means that there is no significant autocorrelation relationship after the lag of 3 orders. The truncation point 3 can be used as a feature for subsequent model construction;

[0017] S22. For meteorological data, perform discretization processing. Divide the temperature into intervals of every 5 °C. Temperatures less than 5 °C are in the low-temperature interval and are marked as 0, 5 - 10 °C are in the relatively low-temperature interval and are marked as 1, and so on. For humidity, divide it into intervals of 20%. Humidity less than 20% is in the dry interval and is marked as 0, 20% - 40% is in the relatively dry interval and is marked as 1. For date-related data, perform one-hot encoding. Mark weekdays as [1, 0], weekends as [0, 1]. For holiday types, the Spring Festival is marked as [1, 0, 0, 0,...], National Day is marked as [0, 1, 0, 0,...]. For seasons, spring is marked as [1, 0, 0, 0], summer is marked as [0, 1, 0, 0];

[0018] S23. Construct the covariance matrix of the data and solve the eigenvalues λ k (k = 1, 2,..., n) and the corresponding eigenvectors υ k , and the formula is: where, x i is the i-th sample vector, is the sample mean vector. Sort the eigenvalues from largest to smallest, and select the eigenvectors corresponding to the top p eigenvalues with a cumulative contribution rate reaching 85% to form the eigenvector matrix V = (υ 1 , υ 2 ,..., υ P ). The principal component Y of the original data X = XV. For example, if the original data has 10 feature variables, after PCA analysis, select the first 6 principal components. These 6 principal components can retain more than 85% of the information of the original data, thereby reducing the data dimension and the computational complexity of the model.

[0019] As a further solution of the present invention: in S3, the construction of the medium-term load forecasting model adopts a model combining a recurrent neural network (RNN) based on an attention mechanism and linear regression, specifically as follows:

[0020] S31. First, the basic calculation formula of the RNN unit is h t = tanh(W h h t-1+W x x t +b h ), where W h and W x are weight matrices, b h is a bias vector, h t-1 is the hidden state at time t-1, x t is the input feature vector at time t. For example, for an RNN with 3 hidden layer nodes, W h is a 3×3 matrix, W x is a 3×n (n is the dimension of the input feature vector) matrix, and b h is a 3-dimensional vector;

[0021] S32. Calculate using the attention mechanism to calculate the attention score e t,i = υ T tanh(W e h i + U e h t + b e ), where υ T and W e and U e are weight matrices, b e is a bias vector, h i is the hidden state at the i-th time. Let h i and h t both be 3-dimensional vectors, W e be a 3×3 matrix, U e be a 3×3 matrix, υ T be a 1×3 vector, and b e be a 3-dimensional vector. Then the attention score e t,i can be calculated. Then, the attention distribution is obtained by normalizing the attention score through the softmax function Finally, calculate the attention-weighted hidden state

[0022] S33. Linear regression model. Let y mid = β 0 + β 1 c t + ∈, where y mid is the medium-term load prediction value, β 0 and β 1 are regression coefficients, and ∈ is the error term. The output c t of the attention mechanism RNN is used as the input for linear regression for prediction. During training, the stochastic gradient descent algorithm is used to optimize the model parameters, and the mean squared error function is used as the loss function where y i is the actual medium-term load value, is the predicted value, m is the number of samples. The parameters of the RNN and linear regression are adjusted through backpropagation. For example, the learning rate is set to 0.01 and the number of iterations is 1000. During each iteration, the gradient is calculated according to the loss function, and then the model parameters are updated.

[0023] As a further solution of the present invention: in S3, a hybrid model of a convolutional neural network (CNN) and a long short-term memory network (LSTM) is used to construct the short-term load prediction model, specifically as follows:

[0024] S34. Convolution layer calculation. Let the input data be X ∈ R H×W×D , where H is the height, W is the width, D is the depth, and the convolutional kernel is with its k h being the height of the convolutional kernel and k w being the width of the convolutional kernel. Then the output of the convolutional layer where b c is the bias of the convolutional layer. For example, if the input data is 10×10×3, indicating that the time series length is 10 and the feature dimension is 3, and the convolutional kernel is 3×3×3 with a stride of 1, the output of the convolutional layer can be calculated;

[0025] S35. LSTM cell calculation formula. The forget gate f t = σ(W f [h t-1 , x t +b f ), the input gate i t = σ(W i [h t-1 , x t +b i ), the cell state update The cell state The output gate o t = σ(W o [h t-1 , x t +b o , and the hidden state h t = o t ⊙ tanh(C t ), where W f , W i , W c , W o are weight matrices, b f , b i , b c , b o are bias vectors, σ is the sigmoid function, ⊙ represents element-wise multiplication, x t is the input feature vector at time t, and h t-1is the hidden state at time t-1. The output result of the CNN is used as the input of the LSTM, and the LSTM further mines the time series features of the data to finally obtain the short-term load prediction value y short , during training, the stochastic gradient descent algorithm and the mean square error loss function are also used. The parameters of the CNN and the LSTM are adjusted according to backpropagation. For example, the convolution kernel size of the CNN is set to 3×3, the pooling step size is 2, the number of hidden layer nodes of the LSTM is 50, the learning rate is 0.005, and the number of iterations is 2000 for training.

[0026] As a further solution of the present invention: in S4, the RMSE calculation formula is The MAE calculation formula is where y i is the actual load value, m is the predicted load value, is the number of samples, is the mean value of the actual load value.

[0027] Advantages of the present invention:

[0028] Through multi-source data collection and comprehensive preliminary processing, the present invention ensures data quality. A variety of feature extraction and dimensionality reduction methods in feature engineering effectively mine the internal laws of data and reduce data complexity. In the medium term, the combination of RNN with attention mechanism and linear regression can focus on key time series information and perform effective regression prediction; in the short term, the hybrid model of CNN and LSTM takes into account both local features and time series characteristics of data, thus greatly improving the accuracy of medium-term and short-term load forecasting in the power grid. Different models are constructed according to the different characteristics of medium-term and short-term load forecasting. The medium-term model focuses on long-term trend and periodic analysis, and the short-term model focuses on short-term fluctuations and local feature capture, enabling this method to well adapt to load forecasting tasks at different time scales and providing reliable prediction results in various power grid operation scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The present invention will be further described below with reference to the accompanying drawings.

[0030] Figure 1 is the principle block diagram of a short-term load forecasting method in an intelligent power grid in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0031] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0032] Embodiment 1:

[0033] Please refer to Figure 1 As shown, this embodiment is a short-term load forecasting method for smart grids. The method specifically includes the following steps:

[0034] S1. Data collection and preliminary processing: Collect historical load data from the power grid monitoring system, and for the collected data, check and process missing values, outliers, and duplicate values;

[0035] S11. Collect historical load data from the power grid monitoring system with a time resolution of 1 hour to obtain detailed load change information. Collect meteorological data from the meteorological monitoring station, including temperature, humidity, wind speed, and air pressure. The collection frequency is synchronized with the load data to ensure that there is corresponding meteorological information at the same time point. Obtain date-related data from the calendar information system, such as whether it is a working day (Monday to Friday are working days, Saturday and Sunday are rest days), holiday types (statutory holidays, adjusted holidays, etc.), and the season (spring, summer, autumn, winter), etc.;

[0036] S12. For the collected data, check for missing values, outliers, and duplicate values. For missing values, if the missing proportion is less than 5%, use the mean filling method, that is, calculate the historical mean of the variable and replace the missing value with the mean. If the missing proportion is greater than 5%, use the filling method based on similar days. When determining similar days, comprehensively consider factors such as date type and meteorological conditions. For example, if a missing data day is a working day and the temperature is between 20 - 25°C and the humidity is between 40% - 60%, select a set of dates in history with the same date type and similar meteorological conditions (temperature deviation within ±2°C, humidity deviation within ±10%), and then select appropriate values from the similar day data for filling. For outliers, use the 3σ principle to identify, that is, if the data value exceeds the range of the mean ±3 times the standard deviation, it is determined as an outlier, and the outlier is replaced with the median of adjacent data. For duplicate values, directly delete them;

[0037] S13. Use the Min - Max normalization formula to map the data to the 0 - 1 interval to make data of different magnitudes comparable and facilitate subsequent calculation and analysis, where is the result after normalization, min(x j ) and max(x j ) are the minimum and maximum values of variable j respectively. For example, for load data, if the historical minimum value is 500MW and the maximum value is 2000MW, and the load value at a certain moment is 1200MW, then the normalized value is (1200 - 500) / (2000 - 500) = 0.467.

[0038] S2. Time series feature extraction: Calculate the autocorrelation function of the load data, and for meteorological data, perform discretization processing and then principal component analysis:

[0039] S21. Calculate the autocorrelation function of the load data, and extract the peak value of the autocorrelation function and its corresponding lag order as features. The formula is: where L t is the load value at time t, L is the load mean value, and k is the lag order. For example, if the autocorrelation function has a peak at a lag order of 24 hours, this may indicate that the load has a daily periodic characteristic. This peak value and the lag order of 24 are used as an important feature. Calculate the partial autocorrelation function PACF of the load data k . By analyzing its characteristics such as truncation, extract feature information such as the truncation point. If the partial autocorrelation function truncates at a lag order of 3, this means that there is no significant autocorrelation relationship after the lag of 3 orders. The truncation point 3 can be used as a feature for subsequent model construction;

[0040] S22. For meteorological data, perform discretization processing. Divide the temperature into intervals of every 5°C. Temperatures less than 5°C are in the low-temperature interval and are marked as 0, 5 - 10°C are in the relatively low-temperature interval and are marked as 1, and so on. For humidity, divide it into intervals of 20%. Humidity less than 20% is in the dry interval and is marked as 0, 20% - 40% is in the relatively dry interval and is marked as 1. For date-related data, perform one-hot encoding. Mark weekdays as [1, 0], weekends as [0, 1]. For holiday types, mark the Spring Festival as [1, 0, 0, 0,...], and National Day as [0, 1, 0, 0,...]. For seasons, mark spring as [1, 0, 0, 0], and summer as [0, 1, 0, 0];

[0041] S23. Construct the covariance matrix of the data, and solve the eigenvalues λ k (k = 1, 2,..., n) and the corresponding eigenvectors υ k . The formula is: where x i is the i-th sample vector, is the sample mean vector. Sort the eigenvalues from largest to smallest, and select the eigenvectors corresponding to the top p eigenvalues with a cumulative contribution rate reaching 85% to form the eigenvector matrix V = (υ 1 , υ 2 ,..., υ P ). The principal components Y of the original data X = XV. For example, if the original data has 10 feature variables, after PCA analysis, select the first 6 principal components. These 6 principal components can retain more than 85% of the information of the original data, thereby reducing the data dimension and the computational complexity of the model.

[0042] S3. Respectively construct a medium-term load forecasting model and a short-term load forecasting model. The medium-term load forecasting model is constructed using a model that combines a recurrent neural network (RNN) based on an attention mechanism with linear regression, specifically as follows:

[0043] S31. First, the basic calculation formula of the RNN unit is h t = tanh(W h h t-1 + W x x t + b h ), where W h , W x are weight matrices, b h is a bias vector, h t-1 is the hidden state at time t-1, x t is the input feature vector at time t. For example, for an RNN with 3 hidden layer nodes, W h is a 3×3 matrix, W x is a 3×n (n is the dimension of the input feature vector) matrix, and b h is a 3-dimensional vector;

[0044] S32. Attention mechanism calculation. Calculate the attention score e t,i = υ T tanh(W e h i + U e h t + b e ), where υ T , W e , U e are weight matrices, b e is a bias vector, h i is the hidden state at the i-th time. Assume that h i and h t are both 3-dimensional vectors, W e is a 3×3 matrix, U e is a 3×3 matrix, υ T is a 1×3 vector, and b e is a 3-dimensional vector. Then the attention score e t,i can be calculated. Then, normalize the attention score through the softmax function to obtain the attention distribution Finally, calculate the attention-weighted hidden state

[0045] S33. Linear regression model. Let y mid = β 0 + β 1 c t + ∈, where y midis the medium-term load prediction value, β 0 , β 1 are regression coefficients, ∈ is the error term, and the output c t of the attention mechanism RNN is used as the input for linear regression for prediction. During training, the stochastic gradient descent algorithm is used to optimize the model parameters, and the mean squared error function is used as the loss function where y i is the actual medium-term load value, is the predicted value, m is the number of samples, and the parameters of the RNN and linear regression are adjusted through backpropagation. For example, the learning rate is set to 0.01 and the number of iterations is 1000. During each iteration, the gradient is calculated according to the loss function, and then the model parameters are updated.

[0046] The short-term load prediction model is constructed using a hybrid model of a convolutional neural network (CNN) and a long short-term memory network (LSTM), as follows:

[0047] S34. Convolution layer calculation. Let the input data be X ∈ R H×W×D , where H is the height, W is the width, D is the depth, and the convolutional kernel is whose k h is the height of the convolutional kernel, k w is the width of the convolutional kernel. Then the output of the convolutional layer where b c is the bias of the convolutional layer. For example, if the input data is 10×10×3, indicating that the time series length is 10 and the feature dimension is 3, and the convolutional kernel is 3×3×3 with a stride of 1, the output of the convolutional layer can be calculated;

[0048] S35. LSTM cell calculation formula. The forget gate f t = σ(W f [h t-1 , x t + b f ), the input gate i t = σ(W i [h t-1 , x t + b i ), the cell state update Cell state Output gate o t = σ(W o [h t-1 , x t + b o , and the hidden state h t = o t ⊙ tanh(C t ), where W f , W i , W c , Wo is the weight matrix, b f , b i , b c , b o is the bias vector, σ is the sigmoid function, ⊙ represents element-wise multiplication, x t is the input feature vector at time t, h t-1 is the hidden state at time t-1. The output result of the CNN is used as the input of the LSTM, and the LSTM further mines the time series features of the data to finally obtain the short-term load prediction value y short , and the stochastic gradient descent algorithm and the mean square error loss function are also used during training. The parameters of the CNN and the LSTM are adjusted according to backpropagation. For example, the convolution kernel size of the CNN is set to 3×3, the pooling stride is 2, the number of hidden layer nodes of the LSTM is 50, the learning rate is 0.005, and the number of iterations is 2000 for training.

[0049] S4. For the medium-term and short-term load prediction models, the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R 2 ) are used as evaluation metrics for evaluation. The calculation formula of RMSE is The calculation formula of MAE is where y i is the actual load value, m is the predicted load value, is the number of samples, is the mean value of the actual load values.

[0050] In the description of this specification, the descriptions referring to terms such as "an embodiment", "example", "specific example", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0051] The above content is only an example and illustration of the present invention. Those skilled in the art of this technology can make various modifications or supplements to the described specific embodiments or use similar methods for substitution, as long as they do not deviate from the invention or exceed the scope defined by the claims of this patent, they should fall within the protection scope of the present invention.

Claims

1. A method for forecasting short-term and medium-term loads in a smart grid, characterized in that: The method specifically comprises the following steps: S1. Data collection and preliminary processing: Collect historical load data from the power grid monitoring system, and check the processing of missing values, abnormal values ​​and duplicate values ​​for the collected data; S2, extract time series features, calculate the autocorrelation function of load data, discretize meteorological data, and then perform principal component analysis; S3, constructing a medium-term load forecasting model and a short-term load forecasting model respectively; S4. For both medium-term and short-term load forecasting models, the root mean square error (RMSE), mean absolute error (MAE) and determination coefficient (R 2 ) is used as the evaluation indicator for evaluation.

2. A method for forecasting short-term and medium-term loads in a smart grid according to claim 1, characterized in that: The specific processing steps of S1 are as follows: S11. Collect historical load data from the power grid monitoring system with a time resolution of 1 hour to obtain detailed load change information. Collect meteorological data from the meteorological monitoring station, including temperature, humidity, wind speed, and air pressure. The collection frequency is synchronized with the load data to ensure that there is corresponding meteorological information at the same time point. Obtain date-related data from the calendar information system. S12. Check missing values, abnormal values ​​and duplicate values ​​for the collected data. For missing values, if the missing ratio is less than 5%, use the mean filling method, that is, calculate the historical mean of the variable and replace the missing value with the mean. If the missing ratio is greater than 5%, use the filling method based on similar days. When determining similar days, comprehensively consider factors such as date type and meteorological conditions; S13, using the Min-Max normalization formula Mapping the data to the 0-1 interval makes data of different magnitudes comparable, facilitating subsequent calculations and analysis. is the normalized result, min(x j ) and max(x j ) are the minimum and maximum values ​​of variable j, respectively.

3. A method for forecasting short-term and medium-term loads in a smart grid according to claim 1, characterized in that: The specific processing steps of S2 are as follows: S21. Calculate the autocorrelation function of the load data, extract the peak value of the autocorrelation function and its corresponding lag order as features, the formula is: Among them, L t is the load value at time t, is the load mean, k is the lag order; S22. For meteorological data, discretization processing is performed, and the temperature is divided into intervals of 5°C. Less than 5°C is a low temperature interval, marked as 0, 5-10°C is a relatively low temperature interval, marked as 1, and so on. For humidity, it is divided into intervals of 20%. Less than 20% is a dry interval, marked as 0, 20%-40% is a relatively dry interval, marked as 1. For date-related data, unique hot encoding processing is performed, and working days are marked as [1,0], and rest days are marked as [0,1]. For holiday types, Spring Festival is marked as [1,0,0,0,…], and National Day is marked as [0,1,0,0,…]. For seasons, spring is marked as [1,0,0,0], and summer is marked as [0,1,0,0]; S23. Construct the covariance matrix of the data and solve the eigenvalue λ of the covariance matrix C k (k=1,2,...,n) and the corresponding eigenvector υ k , the formula is: Among them, x i is the i-th sample vector, The sample mean vector is sorted from large to small, and the eigenvalues ​​corresponding to the first p eigenvalues ​​whose cumulative contribution rate reaches 85% are selected to form the eigenvector matrix V = (υ1,υ2,...,υ P ), the principal component Y=XV of the original data X.

4. A method for forecasting short-term and medium-term loads in a smart grid according to claim 1, characterized in that: In S3, the medium-term load forecasting model is constructed by combining a recurrent neural network (RNN) based on an attention mechanism with a linear regression model, as follows: S31. First, the basic calculation formula of the RNN unit is h t =tanh(W h h t-1 +W x x t +b h ), where W h , W x is the weight matrix, b h is the bias vector, h t-1 is the hidden state at time t-1, x t is the input feature vector at time t; S32, attention mechanism calculation, calculation of attention score e t,i =υ T tanh(W e h i +U e h t +b e ), where υ T , W e , U e is the weight matrix, b e is the bias vector, h i is the hidden state at the ith moment, let h i and h t are all 3D vectors, W e is a 3×3 matrix, U e is a 3×3 matrix, υ T is a 1×3 vector, b e is a 3-dimensional vector, then the attention score e can be calculated t,i , and then normalize the attention score through the softmax function to get the attention distribution Finally, the attention-weighted hidden state is calculated S33, linear regression model, let y mid =β0+β1c t +∈, where y mid is the medium-term load forecast value, β0 and β1 are regression coefficients, ∈ is the error term, and the output c of the attention mechanism RNN is t As the input of linear regression for prediction, during the training process, the stochastic gradient descent algorithm is used to optimize the model parameters, and the loss function uses the mean square error function where y i is the actual medium-term load value, is the predicted value, m is the number of samples, and the parameters of RNN and linear regression are adjusted through back propagation.

5. The method for forecasting short-term and medium-term loads in a smart grid according to claim 1, characterized in that: In S3, the short-term load forecasting model is constructed by using a hybrid model of a convolutional neural network (CNN) and a long short-term memory network (LSTM), as follows: S34, convolution layer calculation, assuming the input data is X∈R H×W×D , where H is the height, W is the width, D is the depth, and the convolution kernel is Its h In is the convolution kernel height, k w is the convolution kernel width, then the output of the convolution layer where b c is the convolution layer bias; S35, LSTM unit calculation formula, forget gate f t =σ(W f [h t-1 ,x t ]+b f ), input gate i t =σ(W i [h t-1 ,x t ]+b i ), cell state update Cell state Output gate o t =σ(W o [h t-1 ,x t ]+b o , hidden state h t =o t ⊙tanh(C t ), where W f , W i , W c , W o is the weight matrix, b f 、b i 、b c 、b o is the bias vector, σ is the sigmoid function, ⊙ represents element-wise multiplication, x t is the input feature vector at time t, h t-1 is the hidden state at time t-1. The output of CNN is used as the input of LSTM. LSTM further mines the time series characteristics of the data and finally obtains the short-term load forecast value y short ,The stochastic gradient descent algorithm and mean square error loss function are also used during ,training, and the parameters of CNN and LSTM are adjusted according to ,backpropagation.

6. A method for forecasting short- and medium-term loads in a smart grid according to claim 1, characterized in that: In S4, the RMSE calculation formula is: The MAE calculation formula is: where y i is the actual load value, m is the predicted load value, is the number of samples, is the mean of the actual load values.

Citation Information

Cited By

  • Power grid load high-precision prediction method based on big data analysis and storage medium

    CN121117971A