Short-term power load prediction method based on secondary feature value extraction

By adopting the combination method of CASTGCN, improved iTransformer and BiGRU in grid load prediction, the problem of poor prediction effect when grid load is in the face of holidays and external factors is solved, and higher prediction accuracy and stability are achieved.

CN119891161APending Publication Date: 2025-04-25HUANGGANG POWER SUPPLY COMPANY HUBEI ELECTRIC POWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411834249.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art shows that when the power grid load faces the interference of holiday load fluctuations and external factors such as weather, seasons, population density and other factors, the prediction effect is poor and the error is high.

Method used

The short-term power load prediction method based on quadratic eigenvalue extraction is adopted, and the first feature extraction is performed through CASTGCN, combining the cross attention mechanism to capture the influence of dynamic and static factors; then the improved iTransformer is used for quadratic feature extraction, and the axial attention mechanism is used to reduce the computational complexity and improve the timing feature extraction ability; finally, BiGRU is used for timing prediction to mine the timing relationship in the data.

Benefits of technology

It improves the accuracy and stability of load prediction, reduces the interference of holiday factors on prediction, and enhances the model's understanding and processing ability of complex space-time dynamics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119891161A_ABST
    Figure CN119891161A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of multi-node short-term load prediction of a power system, in particular to a short-term power load prediction method based on secondary feature value extraction, in a feature extraction stage, first, a primary feature extraction network CASTGCN is used for performing primary feature extraction on a data feature unit, in a CASTGCN structure, a traditional STGCN is improved, and in the CASTGCN structure, a secondary feature extraction network is used for performing secondary feature extraction on a data feature unit; a cross attention mechanism is introduced, the influence of dynamic factor data and static factor data on load data is respectively captured by using cross attention, load characteristics after being influenced by external factors are calculated, then secondary characteristic extraction is performed by using an improved iTransform, and the input load characteristics are encoded in a time sequence dimension by the iTransform and are independent into different tokens; the method solves the problems of poor prediction effect and high error when a power grid load is interfered by festival and holiday load fluctuation and external factors such as weather, seasons and population density in a current load prediction algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of multi-node short-term load forecasting in an electric power system, and in particular to a short-term electric power load forecasting method based on secondary eigenvalue extraction. Background Art

[0002] With the rapid development of the domestic economy and the continuous improvement of people's living standards, the production scale of various enterprises has been continuously expanded, and the demand for electricity in all parts of society has been increasing. This demand growth is not only reflected in the total amount, but also in the refined and personalized requirements for power supply. At the same time, the management and dispatching of the power system are also facing new challenges, and it is necessary to respond to the fluctuations and changes in power load more accurately and efficiently. Multi-node spatiotemporal load forecasting, as an important tool for power system operation and management, is becoming increasingly important. By predicting the power load of multiple nodes in both time and space dimensions, we can have a more comprehensive understanding of the operating status and future trends of the power system, and provide strong support for the safe, economical and efficient operation of the power system.

[0003] Traditional power load forecasting methods are mainly based on time series analysis, focusing on statistical and regression analysis of historical data to predict the power load at a certain point in the future. However, this method ignores the spatial distribution characteristics of power load and the mutual influence between different nodes, and it is difficult to accurately reflect the overall operation status of the power system. In addition, with the access of new energy and the development of distributed energy, the volatility and uncertainty of power load have further increased, and traditional methods are even more difficult to cope with this complex and changeable situation.

[0004] Multi-node spatiotemporal load forecasting can more accurately predict the changing trend of future power load by comprehensively considering the time series characteristics and spatial distribution characteristics of power load, as well as the influence of external factors. This forecasting method can not only improve the accuracy and stability of the forecast, but also provide more refined decision-making support for the dispatching and control of the power system. For example, in power system dispatching, the power generation plan and transmission plan can be reasonably arranged according to the multi-node spatiotemporal load forecasting results to balance the power supply and demand and reduce operating costs. In power system control, the control strategy can be adjusted according to the forecast results to cope with the fluctuations and changes in power load.

[0005] However, compared with single-node load forecasting, multi-node power networks have complex coupling characteristics of node networks, and there are strong spatiotemporal relationships between different nodes. In addition, external factors such as weather, population density, and season also affect the accuracy of multi-node load forecasting. In addition, holiday effects also have strong uncertainties, which may cause the performance of the prediction model to drop sharply. Therefore, how to better explore the coupling characteristics of multi-node networks at different scales, while taking into account the influence of external factors and holiday effects, so as to improve the accuracy and stability of load forecasting, needs further research. Summary of the invention

[0006] In order to solve the above technical problems, the present invention provides a short-term power load forecasting method based on secondary eigenvalue extraction to solve the problem that the current load forecasting algorithm has poor prediction effect and high error when the power grid load faces holiday load fluctuations and interference from external factors such as weather, season, population density, etc.

[0007] The present invention discloses a short-term power load forecasting method based on secondary eigenvalue extraction, including: in the feature extraction stage, using a feature extraction network CASTGCN to extract features from data feature units, the CASTGCN structure improves the traditional STGCN, introduces a cross attention mechanism, uses cross attention to capture the influence of dynamic factor data and static factor data on load data, calculates the load characteristics after being affected by external factors, and then uses the improved iTransformer to perform secondary feature extraction, iTransformer encodes the input load characteristics in the time series dimension, independently into different tokens, and uses independent attention to model the correlation of features in different time series stages, and obtains better sequence time series representation, so as to solve the problem of performance degradation of traditional Transformer when processing a large time window, although iTransformer considers all input vectors through the self-attention mechanism, it ignores the potential correlation between vectors in different directions, and the amount of calculation is very large, so this paper replaces the self-attention mechanism in iTransformer with axial attention (Axial Attention (AA) allows the model to consider axial features separately, reducing the amount of model calculation while increasing the model's attention to the time dimension, so as to perform short-term prediction of load data. Axial attention can make the network pay more attention to the features in the time dimension, while reducing the network complexity and improving the network effect. In the prediction stage, BiGRU is used for time series prediction to mine the time series relationship in the data and perform short-term prediction of load data.

[0008] Preferably, the method comprises the following steps:

[0009] Step 1: Collect basic information, including node location information, historical load information of each node, grid topology information, and external information such as weather and population;

[0010] Step 1.1, use the Prophet algorithm to preprocess the data, fit the original data, fill in the missing data in the data set, and ensure that the missing holiday data in the data is consistent with the distribution of the original data set. Secondly, retain the data predicted by the Prophet algorithm as the input of the model. The Prophet algorithm can use its default holiday date, or use the input holiday date to overcome the impact of holidays on data prediction. Secondly, perform factor analysis and data modeling on load influencing factors, divide external factors into static factors and dynamic factors, and construct them together with load data as data feature units. Use this data and power supply node data as input to the model, and sample historical load data and environmental data in the target area at a frequency of 5 minutes. Specifically, historical load data includes time series data of real-time power consumption in the region, and environmental data includes population density data and weather and meteorological data. The data used contains a total of 210,000 historical data. These data are divided into training set and test set according to the ratio of 8:2. Select 59 days of data from February 1 to April 1, 2019 as the validation set for backward prediction of the model, and use the Z-Score method to normalize the data set for all data;

[0011]

[0012] Where, is the normalized value of the original node load X; mean(Xtrain) and std(Xtrain) are the mean and standard deviation of the training set respectively;

[0013] Step 1.2, use the Prophet algorithm to fill missing values ​​for abnormal data; the Prophet algorithm is an open source time series prediction algorithm developed by the Facebook team. It combines time series decomposition and machine learning algorithms and can process time series data with missing values ​​and abnormal values. The principle of the Prophet algorithm is mainly based on the decomposition of time series, decomposing the time series into several components such as trend, seasonality and holiday effects, and then modeling and predicting these parts separately. Finally, the prediction results of these parts are added together to obtain the final prediction value. The specific decomposition is shown in the following formula:

[0014] y(t)=g(t)+s(t)+h(t)+ε(t)

[0015] Where: y(t) represents the observed value of the time series at time t, g(t) represents the trend function, which represents the overall change trend of the time series data;

[0016] s(t) represents a periodic function, including daily and weekly characteristics, which represents the seasonal term of the time series;

[0017] h(t) represents the holiday function, which is related to the national calendar information built into Prophet and represents the holiday item of the time series;

[0018] ε(t) represents the residual term, which characterizes random and unpredictable fluctuations;

[0019] In the process of decomposing power load data, the modeling strategy for trend items needs to be closely based on the statistical analysis results of power load historical data. According to the characteristics of different load growth patterns, it is necessary to flexibly select an adaptive fitting model. Specifically, when the load increase and decrease trend shows a continuous and stable pattern, it is appropriate to use the linear model defined in the above formula for fitting to capture this constant change law. On the contrary, if the load growth trend shows a characteristic of gradually approaching a saturation state, the logistic regression model shown in the following formula should be selected to more accurately simulate this nonlinear growth and predict its final saturation level. Such a model selection strategy ensures the accuracy and adaptability of trend item fitting, thereby improving the accuracy of the overall power load forecast;

[0020] g(t)=(k+a(t) T δ)t+(m+a(t) T γ)

[0021]

[0022] Where: C(t) is the model asymptotic value that changes with time, k is the load growth rate, δ and γ are the changes in the growth rate, m is the offset parameter, a(t) is the indicator function, s j is the time when the jth change point of the power load data is located;

[0023] For the periodic data components in the power load data, Fourier series can be used for fitting. The fitting formula is shown as follows:

[0024]

[0025] Where: P is the period of the data component. The value of P in the weekly data component is 7, and the value of P in the daily data component is 1. n and b n is the weighting coefficient, N is the weighting coefficient a n and b n The number of

[0026] Compared with weekdays, holidays often significantly change the work and electricity consumption patterns in a region, which in turn causes fluctuations in load data. In order to improve the accuracy of short-term power load forecasting, the key feature of load fluctuations caused by holidays must be included. The Prophet algorithm, through its built-in calendar function, can construct a sparse vector Z(t) that is specifically used to capture and quantify the impact of holidays on load data, thereby achieving further optimization and adjustment of the forecasting model;

[0027] Z(t)=[I(t∈D1),...,I(t∈D L )]

[0028] Where: D i It is a holiday and some dates affected by holidays, where I represents a set of {0,1}. When a given date is a holiday, I is 1, otherwise it is 0;

[0029] By setting the holiday prior variation parameter k to satisfy the normal distribution, the holiday regression vector h(t) is constructed according to the following formula, which is the holiday data component;

[0030] h(t)=Z(t)k

[0031] Step 1.3, record the GPS coordinates of each load measurement point, take the bus unit in the distribution network as a node, and take the lines between different nodes including branches and tie switches as edges to construct the topological structure diagram of the power grid; in the data used, the target area can be divided into 10 different node areas, as shown in the attached figure. Figure 1 As shown, G = {V, E, A} is used to represent the connection relationship between nodes in the topology graph, where nodes are represented by V = {v1, v2, ..., vn}, n is the number of nodes, the edge set is recorded as E = {e1, e2, ...., em}, m is the number of edges, A is an n*n adjacency matrix, represented by A = {Aij|i∈[0,n], j∈[0,n]}, and the element in the i-th row and j-th column of the adjacency matrix is ​​represented by Aij, which represents the connection relationship between node vi and node vj;

[0032]

[0033] The load data is defined as the matrix X = {Xit,|i∈[0,n],t∈[0,T]}, where Xit represents the load at the i-th topological node at time t;

[0034] External factors such as weather and population density are used as auxiliary information, and K = {K1, K2, ...., Kl} is used, where l is the number of categories of external factors. The lth category of auxiliary information can be represented by the set Kl = {l1, l2, ..., lt}, and lti is the lth category of auxiliary information of the i-th node at time t;

[0035] Step 2: Load influencing factor analysis and data modeling; The fluctuation of power load is usually subject to time factors and environmental factors. In the time factor, it often shows regular fluctuations, which will present different patterns as the time axis progresses, such as the difference between weekdays and holidays. Environmental factors mainly involve factors such as population distribution and climatic conditions. Although these factors are not directly affected by the passage of time, their impact on power load cannot be ignored. Therefore, for these external influencing factors of non-load data, we can classify them into fixed factors and variable factors. Fixed factors S refer to those external conditions that do not change with the passage of time but still have an effect on power load, such as the impact of population density in a certain area on the power load of the area; variable factors D are mainly related to external factors closely related to power load such as meteorological conditions, which can directly have an immediate impact on the power load status. Therefore, for the attributes associated with a certain time t, the load influencing factor matrix I can be used t =[S1,S2,...,S m ; D1, D2, ..., D n ] t Indicates, where m and n represent different factor categories;

[0036] Step 2.1, construct the attribute joint unit F-Unit; In order to better integrate the two different factor features, construct the feature fusion unit F-Unit, and concatenate the load matrix Xt and the load influencing factors at time t to obtain the matrix Ft;

[0037] F t =[X t ,I t ]=[X t ,S t ,D t ]=[X;S1,S2,...,S m ; D1, D2, ..., D n ] t

[0038] Since the load data will be affected by the history of dynamic attributes, for each attribute joint unit at different times, the historical dynamic data of the current time t and the past m times are taken, that is,

[0039] F t―m,t =[F t―m ,F t―m+1 ,...,F t ]

[0040] Step 3: Construct a CASTGCN-iT-BiGRU network for secondary feature value extraction; CASTGCN-iT-BiGRU is mainly composed of a primary feature extraction network CASTGCN, a secondary feature extraction network improved iTransformer, and a classification network BiGRU, which will be constructed separately below;

[0041] Step 4: Construct the first feature extraction network CASTGCN; the power grid load data contains a lot of spatial information and temporal information. The spatial graph convolution model is used to extract spatial information, and the temporal convolution model is used to extract temporal information. In order to further integrate the influence of fixed factors and variable factors on load data, the cross attention mechanism is used to integrate these two different features;

[0042] Step 4.1: Build a spatial graph convolution model. The graph neural network GCN uses graph convolution to extract the feature data of the target non-Euclidean space, and updates the feature of the current node based on the high-dimensional features in the K-order neighborhood of different nodes in the data. This feature represents the spatial graph structure information in the target data. The basic process is as shown in the attached figure. Fig. 9 As shown;

[0043] Given a graph G, a graph signal Xt, and a convolution kernel gθ, graph convolution is defined as:

[0044] g θ *GX t =g θ (L)X t =g θ (UΛU T )X t =Ug θ (Λ)U T X t

[0045] Where L = VA is the Laplace matrix of the graph, and V = {v ij =Σ j a ij} is the degree matrix of the vertices (diagonal matrix), the elements on the diagonal are the degrees of each vertex in turn, A is the adjacency matrix of the graph, which describes the relationship between the nodes in the graph. The Laplace matrix can be spectrally decomposed and diagonalized to L = UΛU T , where G is the basis of eigenvectors, Λ∈R N *M is a diagonal matrix consisting of the eigenvalues ​​λ corresponding to the eigenvectors i , i∈[1,N], the process can be understood as converting the convolution kernel gθ and the image signal Xt to the frequency domain respectively, multiplying the transformed results, and performing inverse Fourier transform to obtain the convolution result. The present invention uses Chebyshev polynomials to implement the calculation process, which is as follows:

[0046]

[0047] Where θk is the convolution parameter, λ_max is the maximum eigenvalue of the Laplace matrix, IN is the identity matrix, L is the Laplace matrix, Tk is the Chebyshev polynomial, which is recursively defined as Tk(x)=2xT k―1 (x)―T k―2 (x), where T0(x) = 1, T1(x) = x, and is solved using the expansion formula of Chebyshev polynomials, which is equivalent to aggregating the high-dimensional features in the K-order neighborhood of the current node from 0 to (K-1) through the convolution kernel gθ;

[0048] Step 4.2: Construct a temporal convolution model. The model mainly consists of two parts: one-dimensional causal convolution and gated unit.

[0049] As shown in Figure A4, the calculation process is as follows:

[0050] Γ*X t =tanh(X t *Γ(θ1)+X t )Θsigmoid(X t *Γ(θ2))

[0051] Where, X t is the input feature vector, Γ is the convolution kernel, θ1 and θ2 represent the weight parameters of the convolution kernel, tanh and sigmoid are activation functions used to filter out useless information in the calculation results, θ is the Hadamard product, which means that the two vectors are element-by-element multiplied. Before the convolution, a 1*1 convolution is used to adjust the number of channels of the input data to ensure the alignment of the input and output dimensions. In addition, a residual connection is used to ensure the stability of the temporal convolution during the fitting process and to improve the generalization ability of the model on different data. The specific operation of the one-dimensional causal convolution is shown in the attached figure. Figure 5 As shown in the figure, the convolution operation is used to capture the time information between adjacent nodes, enhance the influence between adjacent time nodes, and fully capture the nonlinear relationship of features in the time dimension; Step 4.3, build the CA-STGCN model; Based on the spatial graph convolution model and the temporal convolution model, the CA-STGCN model is constructed, as shown in the attached figure. Figure 7 As shown in the figure, this module is the basic unit for mining spatiotemporal dynamic information in load data. The CA-STGCN model consists of two spatiotemporal graph convolutions GCN-a and GCN-b, and a temporal convolution model. The input data is the power grid topology data A and the attribute joint unit Ft described above.

[0052] Two spatial graph convolution GCNs are used to capture the spatial correlation and dynamic temporal characteristics of power grid topology data respectively. Specifically, for the fixed factor S and the variable factor D in the attribute joint unit Ft, the original formula F t =[X t ,S t ,D t ] is split into [X t ,S t ] and [X t ,D t ] are used as two identical GCN inputs, that is, the input processing process for GCN-a and CCN-b is as follows:

[0053]

[0054] Where θk is the convolution parameter, λmax is the maximum eigenvalue of the Laplace matrix, IN is the unit matrix, L is the Laplace matrix, and Tk is the Chebyshev polynomial. The process is to calculate the high-dimensional features of the current node in the K-order neighborhood from 0 to (K-1). In order to avoid the disappearance of the gradient, the ReLU activation function is used for data mapping. GCN-a captures the spatial information of load data and fixed factors from the power grid topology, and GCN-b mines spatial information from the changing factors with dynamic uncertainty. Since the features in the same data are fixed, we use the cross-attention mechanism to combine the features of the two. Cross-attention is similar to self-attention. The difference is that two features are used for linear dot product mapping. GCN-a and GCN-b respectively obtain the feature h GCN-a and h GCN-b , then use the linear transformation matrix W a q , W a k , W a v For feature h GCN-a Calculate Q a , K a , V a ,Right now:

[0055]

[0056] Similarly, the same operation is performed on feature hGCN-b;

[0057]

[0058] This operation is to map feature Qa to Qb to calculate the position mapping between two different features, thereby calculating the correlation, obtaining the correlation characteristics of load data and environmental factors, and finally summing the results of the two to obtain the final graph embedding information:

[0059] h g =Hab+Hba

[0060] Finally, the information is input into the temporal convolutional network to extract the temporal information in the features. After one-dimensional causal convolution and gating unit processing, the output result h is obtained. st―gcn , the process is as follows:

[0061] h st―gcn =tanh(h g *Γ(θ1)+h g )Θsigmoid(h g *Γ(θ_2))

[0062] In the formula, X t is the input feature vector, Γ is the convolution kernel, θ1 and θ2 represent the weight parameters of the convolution kernel, tanh and sigmoid are activation functions used to filter out useless information in the calculation results, Θ is the Hadamard product, which represents the element-by-element product of two vectors; Step 5, construct a secondary feature extraction network to improve iTransformer; the features extracted by CASTGCN are all local information. In order to better predict future load data, more global information is needed. Therefore, iTransformer with longer attention acquisition ability is used to capture the global dependencies in the data;

[0063] Different from the more complex encoder-decoder structure used in previous Transformer prediction models, the improved iTransformer only uses the encoder, as shown in the attached figure. Figure 6 As shown, it mainly consists of three parts: embedding layer, projection layer and L stackable TrmBlock blocks;

[0064] For a multidimensional time series with a time length of T and a number of variables of N Using X t,: It represents the time point recorded at the same time as t steps, and is represented by X :,n Represented as the entire time series of each variable indexed by n, since X :,n X t,: It has stronger semantics and relatively consistent measurement units, which is different from the traditional X t,: Compared with the feature embedding method, TrmBlock uses the embedding layer to embed each X :,nPerform feature mapping independently to obtain feature representations of N variables with dimension D in Indicates the changes of variables in historical time. These features are represented in the TrmBlock block. First, the information between variables is interacted through the axial attention mechanism, and the feature distribution of different variables is unified by layer normalization. Fully connected feature encoding is performed in the feedforward network, and finally mapped to the prediction result through the projection layer. The entire model implementation process can be expressed as:

[0065]

[0066] H l+1 =TrmBlock(H l ),l=0,…,L-1

[0067]

[0068] In the formula, The predicted results for each variable;

[0069] Among them, the position embedding module uses function transformation to obtain the relative position of each node in the data compared to the input sequence. The position encoding equation is defined as:

[0070]

[0071] Where d is the embedding size of the node load, i is the i-th time step, and p is the position encoding sequence number. The position information is concatenated to the back of the original input feature, expressed as:

[0072]

[0073] Where: Et∈RT×d represents the load information of a single node, and then the linear transformation matrix Wq, Wk, Wv is used to calculate Q, K, V, that is:

[0074]

[0075] In the formula, Q and K are query vector and key vector respectively, which are used to calculate the correlation between data, and V is the value vector representing the load history data;

[0076] The TrmBlock block is composed of an axial attention module and a feedforward network model. The axial attention generates self-attention in the horizontal and vertical directions of the feature map. The two self-attention modules are connected in series, which can effectively simulate the original self-attention mechanism and effectively reduce the computational complexity from O(H2W2) to O(HW2+H2W) while ensuring accuracy. By performing a dot product between the query vector Q and the key vector K, the weight information in the vertical and horizontal directions at different positions is obtained. The calculation formula is:

[0077]

[0078] H att =H att―r +H att―c

[0079] In the formula, d is the dimension of the model, and softmax is a normalization function. The calculation results are normalized, which can efficiently capture the dependency between input feature vectors by highlighting key features. It is very targeted for the load of multi-node systems with strong coupling. The multi-head attention mechanism is an extension of the self-attention mechanism. Divide into n heads in dimension d, calculate in parallel and obtain the results:

[0080] H matt =W matt [H att1 ,H att2 ,...,H attn ]

[0081] Through the matrix W matt Summarize the rules existing in load correlation and infer the historical data H that the model should focus on when predicting matt , and finally summarized by a two-layer feedforward neural network:

[0082] H trans =ReLU(W f2 (ReLU(BN(W f2 ·H matt +b f1 ))+b f2 ))

[0083] Where H trans is the output of the TrmBlock block, and BN represents the batch normalization operation;

[0084] Step 6: Construct the classification network BiGRU; In order to better capture the time series prediction information in the features optimized by the improved iTransformer attention module, a bidirectional processing mechanism is implemented on the historical load data using BiGRU to capture the front-to-back dependencies in the time series data. Specifically, the BiGRU layer takes the output of the convolutional neural network (CNN) layer as its input, and then passes it to the forward and reverse GRU networks. In this architecture, two layers of bidirectional GRU networks are deployed, and the output feature dimension of each layer of GRU is set to 128. The relevant calculation process can be expressed as the following formula:

[0085]

[0086] Among them, hf and h b represents the output of the forward and backward GRU, W f and b f , W b and b b Represents the parameters of the forward and backward GRU;

[0087] Then concatenate the outputs of the forward and backward GRUs to get the output of the BiGRU as shown below:

[0088] h f =concatenate(f,b)

[0089] Perform a full connection operation on the output of BiGRU and use the ReLU activation function as shown in the formula;

[0090] h = ReLU(dot(h f ,W h )+b h )

[0091] Among them, dot represents the dot product operation, W h and b h Represents the parameters of the fully connected layer, and the output is filtered through the ReLU activation function to obtain the output of the model.

[0092] Step 7: Train the model.

[0093] Step 8: Use the trained CASTGCN-T model to perform load forecasting on the test set.

[0094] Preferably, the training set is used as the input of the CASTGCN-iT-BiGRU model, and the target loss function and the back propagation algorithm are used to solve the optimal parameters of the model. During the training process, the goal of the model prediction is to make the predicted value and the actual value as close as possible. Therefore, the mean square error value is used as the target loss function, which is described as follows:

[0095]

[0096] Where N is the number of samples, yi is the predicted value of the i-th sample, is the actual value of the i-th sample. This formula can ensure that all loss values ​​are positive and is more sensitive to values ​​with large errors. The back propagation algorithm and Adam optimization algorithm are then used to solve the optimal parameters of the model.

[0097] Preferably, in step 8, the trained CASTGCN-T model is used to perform load forecasting on the test set, and the forecast error is evaluated and analyzed based on the forecast results and actual load data. The evaluation indicators are the mean absolute percentage error (MAPE), the root mean square logarithmic error (RMSLE), and the mean absolute error (MAE). The calculation method is as follows:

[0098]

[0099] In the formula, yi and Respectively represent the true value and predicted value at time t, N is the length of the prediction sequence. These three indicators describe the gap between the predicted value and the true value from different perspectives. The smaller the value, the better the prediction effect of the model.

[0100] The results of this model are compared with those of other mainstream power grid load forecasting models on the experimental data set, and the results are shown in the following table:

[0101] Table 1 Prediction results of each model on the dataset

[0102]

[0103] The table contains a total of 8 different models. Among all the evaluation indicators, the CASTGCN-iT-BiGRU model proposed in the present invention achieved the best performance results. In the single-day prediction, the IMAPE, IRMSLE and IMAE of the model of the present invention were reduced by 0.072%, 0.0073 and 0.360MW respectively compared with the second best spatiotemporal graph convolutional network (ST-GCN). In the single-week prediction results, the three indicators of the model of the present invention were reduced by 0.083%, 0.0074 and 1.042MW respectively compared with the second best structured graph convolutional network (HGCN).

[0104] Table 2 Prediction results of each model on US holidays

[0105]

[0106] In addition, in order to verify the prediction effect of the model during holidays, the prediction results of the model during holidays are specially counted. Since the data set is from the New York area of ​​the United States, the load forecast results of Halloween (November 23), Christmas (December 25), and New Year (January 1) are selected respectively. The specific results are shown in Table 2. From Table 2, it can be seen that the single model TCN has the worst performance. The CASTGCN-iT-BiGRU multi-node prediction method based on secondary eigenvalue extraction proposed in this paper has the best prediction results during holidays, which shows that this model has good prediction performance for holiday type data;

[0107] Therefore, it can be concluded that the multi-node load forecasting method of the power system based on the CASTGCN-iT-BiGRU model designed by the present invention, which is based on secondary eigenvalue extraction, can achieve better results in the multi-node load forecasting task. The model uses load data to extract the temporal and spatial information of load changes from fixed factors such as population density, variable factors such as weather and other additional factors, and uses the cross-attention module to improve the traditional STGCN, respectively calculate the influence of static factors and dynamic factors on the load data, perform the first feature extraction from the input data, and obtain the spatiotemporal features in the load data. Then, through the improved iTransformer model, the spatiotemporal features extracted in the previous step are finely encoded to effectively capture the long-distance temporal and spatial dependencies in the features, and combine with axial attention to reduce the network calculation complexity. Under the condition of low complexity, the network's feature extraction capability in the time dimension is effectively improved, and the potential time series information is deeply mined to enhance the model's understanding of complex spatiotemporal dynamics and obtain secondary extracted features. In the final stage of the model, we use a bidirectional gated recurrent unit (BiGRU) to perform time series prediction on the secondary extracted feature values ​​obtained in the previous step. With its unique bidirectional structure, BiGRU can simultaneously capture the forward and backward dependencies of sequence data, thereby more accurately predicting the trend of time series. In this process, we make full use of past load history data, and through the learning and memory capabilities of BiGRU, we conduct in-depth analysis of these data and then predict future load trends. This step not only provides an important reference for power system dispatching, but also provides a powerful tool for us to understand and predict energy consumption patterns.

[0108] The present invention mainly combines Cross-Attention, Spatial Temporal Graph Convolutional Network (STGCN) and iTransformer based on axial attention mechanism to fully explore the spatial correlation in multi-node networks and the temporal characteristics of load data, introduces the Prophet algorithm to preprocess and predict the input data, reduces the prediction interference of the model due to holiday factors, improves the traditional spatial temporal graph convolutional network STGCN, adds a cross-attention mechanism, fully integrates the characteristics of static factors and dynamic factors in environmental factors, further couples the network's feature mining capabilities in multi-node networks, and improves the accuracy and robustness of load forecasting.

[0109] Compared with the prior art, the beneficial effects of the present invention are as follows: compared with the deep learning model, the prediction accuracy is improved: the present invention introduces the Prophet algorithm, performs fitting analysis and preprocessing on the holiday data in the load data, and reduces the interference of holiday factors on model prediction. Secondly, the load data is subjected to two-stage feature extraction. In the first stage, a cross-attention mechanism is introduced to improve the STGCN model to overcome the problem that the feature extraction effect of STGCN is poor when facing multiple types of input features. Cross-attention is used to respectively mine the influence of static factors and dynamic factors on the load data. In the second stage, an improved iTransformer model is used to extract features. iTransformer can mine the characteristics of long-distance step length features, and the load features extracted in the first stage are subjected to load change feature extraction. In combination with axial attention, the network further pays attention to the load changes in the time series dimension. In the prediction stage, BiGRU is used for short-term load prediction. By combining these technologies, the problem of insufficient node network coupling feature mining capability in multi-node load prediction is solved, and external factors such as population and weather are comprehensively considered, so as to deeply mine the time-space correlation characteristics in the node load data.

[0110] Compared with traditional methods, the prediction accuracy of the present invention is significantly improved and the prediction error is reduced. Compared with traditional models, traditional short-term load forecasting methods are often based on statistical principles, which are easily affected by data noise and have difficulty in handling the complex nonlinear relationship between load and other characteristic factors. The present invention uses a deep learning model to better handle complex data, reduce the impact of noise, and improve prediction accuracy.

[0111] Improve the operating efficiency of the power system: Short-term load forecasting is the basis for formulating power system dispatching plans. The improvement of forecasting accuracy will directly affect the efficiency of unit start-up and shutdown, optimal combination, economic dispatch and other links, thereby improving the operating efficiency of the power system and providing a scientific basis for energy conservation and emission reduction. Accurate load forecasting results can provide a strong scientific basis for power companies to formulate energy-saving and emission reduction measures, help achieve energy-saving and emission reduction goals, and promote the development of environmental protection.

[0112] The present invention has made a significant breakthrough in the field of power load forecasting, improved the prediction accuracy, is suitable for processing complex data relationships, and improves the operating efficiency of the power system. At the same time, it provides a scientific basis for energy conservation and emission reduction, effectively reduces the risk of overfitting, and has significant practical value and economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0113] Figure 1 This is a structural framework diagram of the multi-node short-term load forecasting method based on the CASTGCN-iT-BiGRU model of secondary eigenvalue extraction;

[0114] Figure 2It is a spatiotemporal information diagram of the power grid topology;

[0115] Figure 3 It is the attribute joint modeling unit F-Unit;

[0116] Figure 4 It is a gated causal convolution;

[0117] Figure 5 It is causal convolution;

[0118] Figure 6 It is the iTransformer structure based on axial attention;

[0119] Figure 7 It is the CASTGCN module;

[0120] Figure 8 It is the CASTGCN-iT-BiGRU model structure based on secondary eigenvalue extraction;

[0121] Fig. 9 It is a graph convolutional network. DETAILED DESCRIPTION

[0122] In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. The present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0123] Example 1

[0124] A short-term power load forecasting method based on secondary eigenvalue extraction of the present invention is as follows: Figures 1 to 9As shown in the figure, in the feature extraction stage, a feature extraction network CASTGCN is used to extract features from the data feature unit. The CASTGCN structure improves the traditional STGCN and introduces a cross-attention mechanism (CrossAttention). The cross-attention is used to capture the influence of dynamic factor data and static factor data on load data respectively, and the load characteristics after being affected by external factors are calculated. Then, the improved iTransformer is used for secondary feature extraction. iTransformer encodes the input load characteristics in the time series dimension and independently forms different tokens. Independent attention is used to model the correlation of features in different time series stages to obtain better sequence time series representation, so as to solve the problem of performance degradation of traditional Transformer when the processing time window is large. Although iTransformer considers all input vectors through the self-attention mechanism, it ignores the potential correlation between vectors in different directions, and the amount of calculation is very large. Therefore, this paper replaces the self-attention mechanism in iTransformer with axial attention (Axial Attention (AA) allows the model to consider the axial features separately, reducing the amount of model calculation while increasing the model's attention to the time dimension, so as to perform short-term prediction of load data. Axial attention can make the network pay more attention to the features in the time series dimension, improving the network effect while reducing network complexity. In the prediction stage, BiGRU is used for time series prediction, mining the time series relationship in the data, and performing short-term prediction of load data.

[0125] In this embodiment, the problems of poor prediction performance and high error of the current load forecasting algorithm when the power grid load faces holiday load fluctuations and interference from external factors such as weather, season, population density, etc. are solved.

[0126] Example 2

[0127] On the basis of Example 1, a short-term power load forecasting method based on secondary eigenvalue extraction of the present invention is as follows: Figures 1 to 9 As shown, the following steps are included:

[0128] Step 1: Collect basic information, including node location information, historical load information of each node, grid topology information, and external information such as weather and population;

[0129] Step 1.1, use the Prophet algorithm to preprocess the data, fit the original data, fill in the missing data in the data set, and ensure that the missing holiday data in the data is consistent with the distribution of the original data set. Secondly, retain the data predicted by the Prophet algorithm as the input of the model. The Prophet algorithm can use its default holiday date, or use the input holiday date to overcome the impact of holidays on data prediction. Secondly, perform factor analysis and data modeling on load influencing factors, divide external factors into static factors and dynamic factors, and construct them together with load data as data feature units. Use this data and power supply node data as input to the model, and sample historical load data and environmental data in the target area at a frequency of 5 minutes. Specifically, historical load data includes time series data of real-time power consumption in the region, and environmental data includes population density data and weather and meteorological data. The data used contains a total of 210,000 historical data. These data are divided into training set and test set according to the ratio of 8:2. Select 59 days of data from February 1 to April 1, 2019 as the validation set for backward prediction of the model, and use the Z-Score method to normalize the data set for all data;

[0130]

[0131] Where, is the normalized value of the original node load X; mean(Xtrain) and std(Xtrain) are the mean and standard deviation of the training set respectively;

[0132] Step 1.2, use the Prophet algorithm to fill missing values ​​for abnormal data; the Prophet algorithm is an open source time series prediction algorithm developed by the Facebook team. It combines time series decomposition and machine learning algorithms and can process time series data with missing values ​​and abnormal values. The principle of the Prophet algorithm is mainly based on the decomposition of time series, decomposing the time series into several components such as trend, seasonality and holiday effects, and then modeling and predicting these parts separately. Finally, the prediction results of these parts are added together to obtain the final prediction value. The specific decomposition is shown in the following formula:

[0133] y(t)=g(t)+s(t)+h(t)+ε(t)

[0134] Where: y(t) represents the observed value of the time series at time t, g(t) represents the trend function, which represents the overall change trend of the time series data;

[0135] s(t) represents a periodic function, including daily and weekly characteristics, which represents the seasonal term of the time series;

[0136] h(t) represents the holiday function, which is related to the national calendar information built into Prophet and represents the holiday item of the time series;

[0137] ε(t) represents the residual term, which characterizes random and unpredictable fluctuations;

[0138] In the process of decomposing power load data, the modeling strategy for trend items needs to be closely based on the statistical analysis results of power load historical data. According to the characteristics of different load growth patterns, it is necessary to flexibly select an adaptive fitting model. Specifically, when the load increase and decrease trend shows a continuous and stable pattern, it is appropriate to use the linear model defined in the above formula for fitting to capture this constant change law. On the contrary, if the load growth trend shows a characteristic of gradually approaching a saturation state, the logistic regression model shown in the following formula should be selected to more accurately simulate this nonlinear growth and predict its final saturation level. Such a model selection strategy ensures the accuracy and adaptability of trend item fitting, thereby improving the accuracy of the overall power load forecast;

[0139] g(t)=(k+a(t) T δ)t+(m+a(t) T γ)

[0140]

[0141] Where: C(t) is the model asymptotic value that changes with time, k is the load growth rate, δ and γ are the changes in the growth rate, m is the offset parameter, a(t) is the indicator function, s j is the time when the jth change point of the power load data is located;

[0142] For the periodic data components in the power load data, Fourier series can be used for fitting. The fitting formula is shown as follows:

[0143]

[0144] Where: P is the period of the data component. The value of P in the weekly data component is 7, and the value of P in the daily data component is 1. n and b n is the weighting coefficient, N is the weighting coefficient a n and b n The number of

[0145] Compared with weekdays, holidays often significantly change the work and electricity consumption patterns in a region, which in turn causes fluctuations in load data. In order to improve the accuracy of short-term power load forecasting, the key feature of load fluctuations caused by holidays must be included. The Prophet algorithm, through its built-in calendar function, can construct a sparse vector Z(t) that is specifically used to capture and quantify the impact of holidays on load data, thereby achieving further optimization and adjustment of the forecasting model;

[0146] Z(t)=[I(t∈D1),...,I(t∈D L )]

[0147] Where: D i It is a holiday and some dates affected by holidays, where I represents a set of {0,1}. When a given date is a holiday, I is 1, otherwise it is 0;

[0148] By setting the holiday prior variation parameter k to satisfy the normal distribution, the holiday regression vector h(t) is constructed according to the following formula, which is the holiday data component;

[0149] h(t)=Z(t)k

[0150] Step 1.3, record the GPS coordinates of each load measurement point, take the bus unit in the distribution network as a node, and take the lines between different nodes including branches and tie switches as edges to construct the topological structure diagram of the power grid; in the data used, the target area can be divided into 10 different node areas, as shown in the attached figure. Figure 1 As shown, G = {V, E, A} is used to represent the connection relationship between nodes in the topology graph, where nodes are represented by V = {v1, v2, ..., vn}, n is the number of nodes, the edge set is recorded as E = {e1, e2, ...., em}, m is the number of edges, A is an n*n adjacency matrix, represented by A = {Aij|i∈[0,n], j∈[0,n]}, and the element in the i-th row and j-th column of the adjacency matrix is ​​represented by Aij, which represents the connection relationship between node vi and node vj;

[0151]

[0152] The load data is defined as the matrix X = {Xit,|i∈[0,n],t∈[0,T]}, where Xit represents the load at the i-th topological node at time t;

[0153] External factors such as weather and population density are used as auxiliary information, and K = {K1, K2, ...., Kl} is used, where l is the number of categories of external factors. The lth category of auxiliary information can be represented by the set Kl = {l1, l2, ..., lt}, and lti is the lth category of auxiliary information of the i-th node at time t;

[0154] Step 2: Load influencing factor analysis and data modeling; The fluctuation of power load is usually subject to time factors and environmental factors. In the time factor, it often shows regular fluctuations, which will present different patterns as the time axis progresses, such as the difference between weekdays and holidays. Environmental factors mainly involve factors such as population distribution and climatic conditions. Although these factors are not directly affected by the passage of time, their impact on power load cannot be ignored. Therefore, for these external influencing factors of non-load data, we can classify them into fixed factors and variable factors. Fixed factors S refer to those external conditions that do not change with the passage of time but still have an effect on power load, such as the impact of population density in a certain area on the power load of the area; variable factors D are mainly related to external factors closely related to power load such as meteorological conditions, which can directly have an immediate impact on the power load status. Therefore, for the attributes associated with a certain time t, the load influencing factor matrix I can be used t =[S1,S2,...,S m ; D1, D2, ..., D n ] t Indicates, where m and n represent different factor categories;

[0155] Step 2.1, construct the attribute joint unit F-Unit; In order to better integrate the two different factor features, construct the feature fusion unit F-Unit, and concatenate the load matrix Xt and the load influencing factors at time t to obtain the matrix Ft;

[0156] F t =[X t ,I t ]=[X t ,S t ,D t ]=[X;S1,S2,...,S m ;D1,2 D ,...,D n ] t

[0157] Since the load data will be affected by the history of dynamic attributes, for each attribute joint unit at different times, the historical dynamic data of the current time t and the past m times are taken, that is,

[0158] F t―m,t =[F t―m ,F t―m+1 ,...,F t ]

[0159] Step 3: Construct a CASTGCN-iT-BiGRU network for secondary feature value extraction; CASTGCN-iT-BiGRU is mainly composed of a primary feature extraction network CASTGCN, a secondary feature extraction network improved iTransformer, and a classification network BiGRU, which will be constructed separately below;

[0160] Step 4: Construct the first feature extraction network CASTGCN; the power grid load data contains a lot of spatial information and temporal information. The spatial graph convolution model is used to extract spatial information, and the temporal convolution model is used to extract temporal information. In order to further integrate the influence of fixed factors and variable factors on load data, the cross attention mechanism is used to integrate these two different features;

[0161] Step 4.1: Build a spatial graph convolution model. The graph neural network GCN uses graph convolution to extract the feature data of the target non-Euclidean space, and updates the feature of the current node based on the high-dimensional features in the K-order neighborhood of different nodes in the data. This feature represents the spatial graph structure information in the target data. The basic process is as shown in the attached figure. Fig. 9 As shown;

[0162] Given a graph G, a graph signal Xt, and a convolution kernel gθ, graph convolution is defined as:

[0163] g θ *GX t =g θ (L)X t =g θ (UΛU T )X t =Ug θ (Λ)U T X t

[0164] Where L = VA is the Laplace matrix of the graph, and V = {v ij =Σ j a ij} is the degree matrix of the vertices (diagonal matrix), the elements on the diagonal are the degrees of each vertex in turn, A is the adjacency matrix of the graph, which describes the relationship between the nodes in the graph. The Laplace matrix can be spectrally decomposed and diagonalized to L = UΛU T , where G is the basis of eigenvectors, Λ∈R N *M is a diagonal matrix consisting of the eigenvalues ​​λ corresponding to the eigenvectors i , i∈[1,N], the process can be understood as converting the convolution kernel gθ and the image signal Xt to the frequency domain respectively, multiplying the transformed results, and performing inverse Fourier transform to obtain the convolution result. The present invention uses Chebyshev polynomials to implement the calculation process, which is as follows:

[0165]

[0166] Where θk is the convolution parameter, λ_max is the maximum eigenvalue of the Laplace matrix, IN is the identity matrix, L is the Laplace matrix, Tk is the Chebyshev polynomial, which is recursively defined as Tk(x)=2xTk ―1 (x)―Tk ―2 (x), where T0(x) = 1, T1(x) = x, and is solved using the expansion formula of Chebyshev polynomials, which is equivalent to aggregating the high-dimensional features in the K-order neighborhood of the current node from 0 to (K-1) through the convolution kernel gθ;

[0167] Step 4.2: Construct a temporal convolution model. The model mainly consists of two parts: one-dimensional causal convolution and gated unit.

[0168] As shown in Figure A4, the calculation process is as follows:

[0169] Γ*X t =tanh(X t *Γ(θ1)+X t )Θsigmoid(X t *Γ(θ2))

[0170] Where, X t is the input feature vector, Γ is the convolution kernel, θ1 and θ2 represent the weight parameters of the convolution kernel, tanh and sigmoid are activation functions used to filter out useless information in the calculation results, θ is the Hadamard product, which means that the two vectors are element-by-element multiplied. Before the convolution, a 1*1 convolution is used to adjust the number of channels of the input data to ensure the alignment of the input and output dimensions. In addition, a residual connection is used to ensure the stability of the temporal convolution during the fitting process and to improve the generalization ability of the model on different data. The specific operation of the one-dimensional causal convolution is shown in the attached figure. Figure 5 As shown in the figure, the convolution operation is used to capture the time information between adjacent nodes, enhance the influence between adjacent time nodes, and fully capture the nonlinear relationship of features in the time dimension; Step 4.3, build the CA-STGCN model; Based on the spatial graph convolution model and the temporal convolution model, the CA-STGCN model is constructed, as shown in the attached figure. Figure 7 As shown in the figure, this module is the basic unit for mining spatiotemporal dynamic information in load data. The CA-STGCN model consists of two spatiotemporal graph convolutions GCN-a and GCN-b, and a temporal convolution model. The input data is the power grid topology data A and the attribute joint unit Ft described above.

[0171] Two spatial graph convolution GCNs are used to capture the spatial correlation and dynamic temporal characteristics of power grid topology data respectively. Specifically, for the fixed factor S and the variable factor D in the attribute joint unit Ft, the original formula F t =[X t ,S t ,D t ] is split into [X t ,S t ] and [X t ,D t ] are used as two identical GCN inputs, that is, the input processing process for GCN-a and GCN-b is as follows:

[0172]

[0173] Where θk is the convolution parameter, λmax is the maximum eigenvalue of the Laplace matrix, IN is the unit matrix, L is the Laplace matrix, and Tk is the Chebyshev polynomial. The process is to calculate the high-dimensional features of the current node in the K-order neighborhood from 0 to (K-1). In order to avoid the disappearance of the gradient, the ReLU activation function is used for data mapping. GCN-a captures the spatial information of load data and fixed factors from the power grid topology, and GCN-b mines spatial information from the changing factors with dynamic uncertainty. Since the features in the same data are fixed, we use the cross-attention mechanism to combine the features of the two. Cross-attention is similar to self-attention. The difference is that two features are used for linear dot product mapping. GCN-a and GCN-b respectively obtain the feature h GCN-a and h GCN-b , then use the linear transformation matrix W a q , W a k , W a v For feature h GCN-a Calculate Q a , K a , V a ,Right now:

[0174]

[0175] Similarly, the same operation is performed on feature hGCN-b;

[0176]

[0177] This operation is to map feature Qa to Qb to calculate the position mapping between two different features, thereby calculating the correlation, obtaining the correlation characteristics of load data and environmental factors, and finally summing the results of the two to obtain the final graph embedding information:

[0178] h g =Hab+Hba

[0179] Finally, the information is input into the temporal convolutional network to extract the temporal information in the features. After one-dimensional causal convolution and gating unit processing, the output result h is obtained. st―gcn , the process is as follows:

[0180] h st―gcn =tanh(h g *Γ(θ1)+h g )Θsigmoid(h g *Γ(θ_2))

[0181] Where, X t is the input feature vector, Γ is the convolution kernel, θ1 and θ2 represent the weight parameters of the convolution kernel, tanh and sigmoid are activation functions used to filter out useless information in the calculation results, Θ is the Hadamard product, which represents the element-by-element product of two vectors; Step 5, construct a secondary feature extraction network to improve iTransformer; the features extracted by CASTGCN are all local information. In order to better predict future load data, more global information is needed. Therefore, iTransformer with longer attention acquisition ability is used to capture the global dependencies in the data;

[0182] Different from the more complex encoder-decoder structure used in previous Transformer prediction models, the improved iTransformer only uses the encoder, as shown in the attached figure. Figure 6 As shown, it mainly consists of three parts: embedding layer, projection layer and L stackable TrmBlock blocks;

[0183] For a multidimensional time series with a time length of T and a number of variables of N Using X t,: It represents the time point recorded at the same time as t steps, and is represented by X :,n Represented as the entire time series of each variable indexed by n, since X :,n X t,: It has stronger semantics and relatively consistent measurement units, which is different from the traditional X t,: Compared with the feature embedding method, TrmBlock uses the embedding layer to embed each X :,nPerform feature mapping independently to obtain feature representations of N variables with dimension D in Indicates the changes of variables in historical time. These features are represented in the TrmBlock block. First, the information between variables is interacted through the axial attention mechanism, and the feature distribution of different variables is unified by layer normalization. Fully connected feature encoding is performed in the feedforward network, and finally mapped to the prediction result through the projection layer. The entire model implementation process can be expressed as:

[0184]

[0185] H l+1 =TrmBlock(H l ),l=0,…,L-1

[0186]

[0187] In the formula, The predicted results for each variable;

[0188] Among them, the position embedding module uses function transformation to obtain the relative position of each node in the data compared to the input sequence. The position encoding equation is defined as:

[0189]

[0190] Where d is the embedding size of the node load, i is the i-th time step, and p is the position encoding sequence number. The position information is concatenated to the back of the original input feature, expressed as:

[0191]

[0192] Where: Et∈RT×d represents the load information of a single node, and then the linear transformation matrix Wq, Wk, Wv is used to calculate Q, K, V, that is:

[0193]

[0194] In the formula, Q and K are query vector and key vector respectively, which are used to calculate the correlation between data, and V is the value vector representing the load history data;

[0195] The TrmBlock block is composed of an axial attention module and a feedforward network model. The axial attention generates self-attention in the horizontal and vertical directions of the feature map. The two self-attention modules are connected in series, which can effectively simulate the original self-attention mechanism and effectively reduce the computational complexity from O(H2W2) to O(HW2+H2W) while ensuring accuracy. By performing a dot product between the query vector Q and the key vector K, the weight information in the vertical and horizontal directions at different positions is obtained. The calculation formula is:

[0196]

[0197] H att =H att―r +H att―c

[0198] In the formula, d is the dimension of the model, and softmax is a normalization function. The calculation results are normalized, which can efficiently capture the dependency between input feature vectors by highlighting key features. It is very targeted for the load of multi-node systems with strong coupling. The multi-head attention mechanism is an extension of the self-attention mechanism. Divide into n heads in dimension d, calculate in parallel and obtain the results:

[0199] H matt =W matt [H att1 ,H att2 ,...,H attn ]

[0200] Through the matrix W matt Summarize the rules existing in load correlation and infer the historical data H that the model should focus on when predicting matt , and finally summarized by a two-layer feedforward neural network:

[0201] H trans =ReLU(W f2 (ReLU(BN(W f2 ·H matt +b f1 ))+b f2 ))

[0202] Where H trans is the output of the TrmBlock block, and BN represents the batch normalization operation;

[0203] Step 6: Construct the classification network BiGRU; In order to better capture the time series prediction information in the features optimized by the improved iTransformer attention module, a bidirectional processing mechanism is implemented on the historical load data using BiGRU to capture the front-to-back dependencies in the time series data. Specifically, the BiGRU layer takes the output of the convolutional neural network (CNN) layer as its input, and then passes it to the forward and reverse GRU networks. In this architecture, two layers of bidirectional GRU networks are deployed, and the output feature dimension of each layer of GRU is set to 128. The relevant calculation process can be expressed as the following formula:

[0204]

[0205]

[0206] Among them, h f and h b represents the output of the forward and backward GRU, W f and b f , W b and b b Represents the parameters of the forward and backward GRU;

[0207] Then concatenate the outputs of the forward and backward GRUs to get the output of the BiGRU as shown below:

[0208] h f =concatenate(f,b)

[0209] Perform a full connection operation on the output of BiGRU and use the ReLU activation function as shown in the formula;

[0210] h = ReLU(dot(h f ,W h )+b h )

[0211] Among them, dot represents the dot product operation, W h and b h Represents the parameters of the fully connected layer, and the output is filtered through the ReLU activation function to obtain the output of the model.

[0212] Step 7: Train the model.

[0213] Step 8: Use the trained CASTGCN-T model to perform load forecasting on the test set;

[0214] The training set is used as the input of the CASTGCN-iT-BiGRU model, and the target loss function and back propagation algorithm are used to solve the optimal parameters of the model. During the training process, the goal of the model prediction is to make the predicted value and the actual value as close as possible. Therefore, the mean square error value is used as the target loss function, which is described as follows:

[0215]

[0216] Where N is the number of samples, yi is the predicted value of the i-th sample, is the actual value of the i-th sample. This formula can ensure that all loss values ​​are positive and is more sensitive to values ​​with large errors. The back propagation algorithm and Adam optimization algorithm are then used to solve the optimal parameters of the model.

[0217] In step 8, the trained CASTGCN-T model is used to perform load forecasting on the test set, and the forecast error is evaluated and analyzed based on the forecast results and actual load data. The mean absolute percentage error (MAPE), root mean square logarithmic error (RMSLE), and mean absolute error (MAE) are used as evaluation indicators, and the calculation method is as follows:

[0218]

[0219] In the formula, yi and Respectively represent the true value and predicted value at time t, N is the length of the prediction sequence. These three indicators describe the gap between the predicted value and the true value from different perspectives. The smaller the value, the better the prediction effect of the model.

[0220] The results of this model are compared with those of other mainstream power grid load forecasting models on the experimental data set, and the results are shown in the following table:

[0221] Table 1 Prediction results of each model on the dataset

[0222]

[0223]

[0224] The table contains a total of 8 different models. Among all the evaluation indicators, the CASTGCN-iT-BiGRU model proposed in the present invention achieved the best performance results. In the single-day prediction, the IMAPE, IRMSLE and IMAE of the model of the present invention were reduced by 0.072%, 0.0073 and 0.360MW respectively compared with the second best spatiotemporal graph convolutional network (ST-GCN). In the single-week prediction results, the three indicators of the model of the present invention were reduced by 0.083%, 0.0074 and 1.042MW respectively compared with the second best structured graph convolutional network (HGCN).

[0225] Table 2 Prediction results of each model on US holidays

[0226]

[0227] In addition, in order to verify the prediction effect of the model during holidays, the prediction results of the model during holidays are specially counted. Since the data set is from the New York area of ​​the United States, the load forecast results of Halloween (November 23), Christmas (December 25), and New Year (January 1) are selected respectively. The specific results are shown in Table 2. From Table 2, it can be seen that the single model TCN has the worst performance. The CASTGCN-iT-BiGRU multi-node prediction method based on secondary eigenvalue extraction proposed in this paper has the best prediction results during holidays, which shows that this model has good prediction performance for holiday type data;

[0228] In this embodiment, better results can be achieved in multi-node load forecasting tasks. The model uses load data to extract temporal and spatial information of load changes from fixed factors such as population density, variable factors such as weather and other additional factors, and uses the cross-attention module to improve the traditional STGCN, respectively calculating the impact of static factors and dynamic factors on load data, performing the first feature extraction from the input data, and obtaining the spatiotemporal features in the load data. Then, the spatiotemporal features extracted in the previous step are finely encoded through the improved iTransformer model, effectively capturing the long-distance temporal and spatial dependencies in the features, and combining axial attention to reduce the network computational complexity, effectively improving the network's feature extraction capability in the time dimension. Deeply explore the potential time series information to enhance the model's understanding of complex spatiotemporal dynamics and obtain secondary extracted features. In the final stage of the model, we use a bidirectional gated recurrent unit (BiGRU) to perform time series prediction on the secondary extracted feature values ​​obtained in the previous step. With its unique bidirectional structure, BiGRU can simultaneously capture the forward and backward dependencies of sequence data, thereby more accurately predicting the trend of time series. In this process, we make full use of past load history data, and through the learning and memory capabilities of BiGRU, we conduct in-depth analysis of these data and then predict future load trends. This step not only provides an important reference for power system dispatching, but also provides a powerful tool for us to understand and predict energy consumption patterns.

[0229] It mainly combines Cross-Attention, SpatialTemporal Graph Convolutional Network (STGCN) and iTransformer based on axial attention mechanism to fully explore the spatial correlation in multi-node networks and the temporal characteristics of load data. It introduces the Prophet algorithm to preprocess and predict the input data, reduce the prediction interference of the model due to holiday factors, improve the traditional spatial-temporal graph convolutional network STGCN, add cross-attention mechanism, fully integrate the characteristics of static factors and dynamic factors in environmental factors, further couple the network's feature mining capabilities in multi-node networks, and improve the accuracy and robustness of load forecasting.

[0230] The main function achieved by the present invention is to solve the problems of poor prediction effect and high error of current load forecasting algorithms when the power grid load faces holiday load fluctuations and interference from external factors such as weather, season, population density, etc.

[0231] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A short-term power load forecasting method based on secondary eigenvalue extraction, characterized in that: In the feature extraction stage, the first feature extraction network CASTGCN is used to extract features from the data feature unit, and then the improved iTransformer is used for secondary feature extraction.

2. A short-term power load forecasting method based on secondary eigenvalue extraction as claimed in claim 1, characterized in that: The following steps are involved: Step 1: Collect basic information, including node location information, historical load information of each node, grid topology information, and external information such as weather and population; Step 1.1: Use the Prophet algorithm to preprocess the data; Step 1.2: Use the Prophet algorithm to fill missing values ​​for abnormal data; Step 1.3, record the GPS coordinates of each load measurement point, take the bus units in the distribution network as nodes, and take the lines between different nodes including branches and tie switches as edges to construct a topological structure diagram of the power grid; Step 2: Load influencing factor analysis and data modeling; Step 2.1, construct the attribute joint unit F-Unit; Step 3: Construct a CASTGCN-iT-BiGRU network for secondary eigenvalue extraction; Step 4: Construct the first feature extraction network CASTGCN; Step 4.1: Build a spatial graph convolution model; Step 4.2: Build a temporal convolution model; Step 4.3: Build the CA-STGCN model; Step 5: Construct a secondary feature extraction network to improve iTransformer; Step 6: Build the classification network BiGRU; Step 7: Train the model. Step 8: Use the trained CASTGCN-T model to perform load forecasting on the test set.

3. A short-term power load forecasting method based on secondary eigenvalue extraction as claimed in claim 2, characterized in that: In step 7, the training set is used as the input of the CASTGCN-iT-BiGRU model, and the target loss function and the back propagation algorithm are used to solve the optimal parameters of the model. During the training process, the goal of the model prediction is to make the predicted value and the actual value as close as possible, so the mean square error value is used as the target loss function, which is described as follows: Where N is the number of samples, yi is the predicted value of the i-th sample, is the actual value of the i-th sample. This formula can ensure that all loss values ​​are positive and is more sensitive to values ​​with large errors. The back propagation algorithm and Adam optimization algorithm are then used to solve the optimal parameters of the model.

4. A short-term power load forecasting method based on secondary eigenvalue extraction as claimed in claim 2, characterized in that: In step 8, the trained CASTGCN-T model is used to perform load forecasting on the test set, and the forecast error is evaluated and analyzed based on the forecast results and actual load data. The mean absolute percentage error (MAPE), root mean square logarithmic error (RMSLE), and mean absolute error (MAE) are used as evaluation indicators, and the calculation method is as follows: In the formula, yi and Respectively represent the true value and predicted value at time t, N is the length of the prediction sequence. These three indicators describe the gap between the predicted value and the true value from different perspectives. The smaller the value, the better the prediction effect of the model. The results of this model are compared with those of other mainstream power grid load forecasting models on the experimental data set, and the results are shown in the following table: Table 1 Prediction results of each model on the dataset The table contains a total of 8 different models. Among all the evaluation indicators, the CASTGCN-iT-BiGRU model proposed in the present invention achieved the best performance results. In the single-day prediction, the IMAPE, IRMSLE and IMAE of the model of the present invention were reduced by 0.072%, 0.0073 and 0.360MW respectively compared with the second best spatiotemporal graph convolutional network (ST-GCN). In the single-week prediction results, the three indicators of the model of the present invention were reduced by 0.083%, 0.0074 and 1.042MW respectively compared with the second best structured graph convolutional network (HGCN). Table 2 Prediction results of each model on US holidays In addition, in order to verify the prediction effect of the model during holidays, the prediction results of the model during holidays are specially counted. Since the data set is from the New York area of ​​the United States, the load forecast results of Halloween (November 23), Christmas (December 25), and New Year (January 1) are selected respectively. The specific results are shown in Table 2. It can be seen from Table 2 that the single model TCN has the worst performance. The CASTGCN-iT-BiGRU multi-node prediction method based on secondary eigenvalue extraction proposed in this paper has the best prediction results during holidays, which shows that this model has good prediction performance for holiday type data.