A method and system for load forecasting of substation equipment based on segmented attention mechanism
Through the segmented attention mechanism, the data segmented feature learning is performed using the time covariate embedding layer and attention network module, which solves the problem of insufficient utilization of local trends of data and long calculation time in the prior art. , achieving higher prediction accuracy and simplified calculation process.
Patent Information
- Application Number
- CN202311657674.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-12-04
AI Technical Summary
The existing substation equipment load prediction methods fail to make full use of the local trend of data, resulting in a decrease in the accuracy of the prediction results, and the network structure is too complex and the calculation time is long.
Using the load prediction method of substation equipment based on segmented attention mechanism, data is carried out through the time covariate embedding layer, linear module, intra- and inter-segment attention network module, routing attention network module and encoder-decoder architecture Segmentation and feature learning improve the robustness and generalization of prediction models.
It effectively improves the accuracy and calculation efficiency of load prediction, simplifies the system structure, and is suitable for the load prediction of substation equipment in various scenarios.
Smart Images

Figure CN117937425B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of load prediction for substation equipment, and in particular to a method and system for load prediction for substation equipment based on a segmented attention mechanism. Background Art
[0002] Substation equipment is an indispensable and important link in the power network system. It is mainly responsible for converting and adjusting voltage, receiving and distributing power resources, and controlling the overall flow of electricity. Substation equipment connects power grids of various voltage levels through transformers to build a complete power network system, and its application range is quite wide. At the same time, substation equipment is expensive and has a large workload. Once overloaded, it will cause a large impact area, high maintenance costs, and a long recovery cycle. Therefore, the reliability of substation equipment operation is related to the stability and safety of the entire power grid. Therefore, it is a hot issue in current research to reasonably and accurately predict the load of substation equipment, analyze its seasonal trend characteristics, and implement precise monitoring and early warning, which can greatly improve the safe operation capability of the power grid and assist power practitioners in effective management.
[0003] The load data set of substation equipment is a typical multivariate time series data type. Due to its many data features, large data volume, and uncertain change characteristics, the traditional statistical analysis model performs poorly, so the time series prediction model based on deep learning is preferred to model and analyze it. Prior to this, a large number of scholars have conducted detailed research on the time series prediction problem. It is mainly based on the supervised learning paradigm, decomposing the sequence, and learning the neighborhood and global features of the sequence.
[0004] Existing prediction methods have achieved good results, but the feature learning of data is limited to a single batch size or the entire sequence length. Even after segmentation and reducing the granularity, only the dependencies between segments are captured, ignoring the local trends of the data. In addition, the network structure used is too complex and the calculation time is too long, which reduces the accuracy of the prediction results of the substation load. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a substation load prediction method and system based on a segmented attention mechanism, which solves the problem that the existing methods do not fully utilize the local trend of data and the network structure used is too complex and the calculation time is too long, resulting in a decrease in the accuracy of the substation load prediction results.
[0006] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0007] A method for load forecasting of substation equipment based on a segmented attention mechanism is provided, which comprises the following steps:
[0008] S1. Obtain historical load data of the substation equipment and corresponding characteristic information; normalize the historical load data of the substation equipment to obtain normalized historical load data;
[0009] S2. Construct a load forecasting model; input the normalized historical load data and characteristic information into the load forecasting model and train it to obtain a trained load forecasting model;
[0010] S3. The load data to be predicted is normalized and then input into the trained load prediction model to obtain the corresponding prediction result, thereby completing the prediction of the load of the substation equipment.
[0011] Furthermore, the characteristic information of the substation equipment in step S1 includes timestamp, high available load, high useless load, medium available load, medium useless load, low available load, low useless load and oil temperature.
[0012] Furthermore, the load forecasting model in step S2 includes a time covariate embedding layer, a linear module, an intra-segment attention network module, an inter-segment attention network module, a routing attention network module, and an output result prediction module connected in series in sequence;
[0013] The linear module consists of two linear insertion layers connected in series;
[0014] The intra-segment attention network module includes an activation function layer, an intra-segment additive attention layer, and an activation function layer connected in series;
[0015] The inter-segment attention network module includes an inter-segment scaled dot product attention layer, a normalization layer, a multi-layer feedforward neural network, and a normalization layer connected in series;
[0016] The routing attention network module includes two routing attention mechanism layers, a normalization layer, a multi-layer feedforward neural network, and a normalization layer connected in series;
[0017] The output result prediction module adopts an encoder-decoder architecture.
[0018] Furthermore, step S2 further comprises:
[0019] S2-1, input the normalized historical load data and characteristic information into the time covariate embedding layer, extract the normalized historical load data, obtain the time information and fuse it with the characteristic information to obtain the fused time characteristic data;
[0020] S2-2, inputting the fused time feature data into a linear module for linear transformation and combination to obtain transformed time feature data;
[0021] S2-3, inputting the transformed time feature data into the intra-segment attention network module for segmentation to obtain segmented time feature data; processing the segmented time feature data to obtain corresponding first output data;
[0022] S2-4, inputting the first output data and the transformed time feature data into the inter-segment attention network module to obtain corresponding second output data;
[0023] S2-5, inputting the second output data into the routing attention network module to obtain prediction vector representation data;
[0024] S2-6, input the prediction vector representation data into the encoder-decoder to obtain a prediction result;
[0025] S2-7, iterating the load forecasting model according to the forecasting results until the target loss function is minimized;
[0026] S2-8. Adjust the parameters of the load forecasting model according to minimizing the objective loss function to obtain a trained load forecasting model.
[0027] Furthermore, the formula of the time covariate embedding layer in step S2-1 is:
[0028]
[0029]
[0030] Among them, T represents the time covariate matrix, that is, the fused time feature data, et 11 、et 1n 、et m1 、et mn They represent the time index of the 1st row and 1st column of the time covariate matrix T, the time index of the 1st row and nth column, the time index of the mth row and 1st column, and the time index of the mth row and nth column, respectively. i represents the vector representation of the i-th column embedding of the time covariate matrix, i.e., the output of the time covariate embedding layer, T i represents the i-th column of the time covariate matrix, Min(T i ) represents the minimum value of the i-th column of the time covariate matrix, Max(T i ) represents the maximum value of the i-th column of the time covariate matrix.
[0031] Furthermore, the formula of step S2-2 is:
[0032]
[0033]
[0034] in, represents the output of the second linear insertion layer, that is, the transformed temporal feature data, represents the output of the first linear insertion layer, T represents the fused temporal feature data, that is, the output of the temporal covariate embedding layer, W1 and W2 represent the weight parameters of the linear insertion layer, and b1 and b2 represent the bias parameters of the linear insertion layer.
[0035] Furthermore, the formula of the intra-segment additive attention layer in the intra-segment attention network module of step S2-3 is:
[0036]
[0037] X' t =RELU(WX seg +b)
[0038] X' t =W v X' t tanh(W Q X' t +(W K X' t )
[0039] X=Xseg+RELU(X't)
[0040] Among them, X l Represents the output of the linear module, that is, the transformed time feature data, L seg Indicates the size of each segment, X seg Represents the time characteristic data of each segment after segmentation, X' t represents the intermediate vector of the transformation, W represents the weight parameter of the intra-segment additive attention layer, b represents the bias parameter of the intra-segment additive attention layer, RELU(·) represents the activation function, and W v represents the weight matrix of the value vector v, tanh(·) represents the hyperbolic tangent function, WQ represents the weight matrix of the query vector Q, and W K represents the weight matrix of the key vector K, and X represents the vector representation of each segment after intra-segment feature learning, that is, the first output data.
[0041] Furthermore, the formula of step S2-4 is:
[0042]
[0043]
[0044]
[0045] Among them, t represents the time domain dimension, represents the output of the first normalized layer of the inter-segment attention network module on the f-th time feature data dimension, represents the output of the first normalized layer of the inter-segment attention network module on the first time feature data dimension, X :,f Represents the vector representation of the time feature data f at all time steps, that is, the first output data, the transformed time feature data, MSA t (·) represents the multi-head self-attention mechanism in the time domain dimension, that is, the output of the inter-segment scaled dot product attention layer, LayerNorm(·) represents the normalization function, represents the output of the normalized layer of the inter-segment attention network module on all temporal feature dimensions, i.e., the input of the multi-layer feedforward neural network. MLP(·) represents the multi-layer feedforward neural network. X t Represents the output of the inter-segment attention network module, that is, the second output data.
[0046] Furthermore, the formula of step S2-5 is:
[0047]
[0048]
[0049]
[0050]
[0051] Among them, A i,: represents the aggregate information of all features at the i-th moment, that is, the output of the first routing attention mechanism layer, C i,: represents the learnable matrix in the routing attention mechanism layer, Represents all feature information processed by the inter-segment attention mechanism at the i-th moment, MSA f (·) represents the multi-head self-attention mechanism on the feature dimension, X t represents the second output data, represents all feature information at the i-th moment, i.e., the output of the second routing attention mechanism layer. LayerNorm(·) represents the normalization function. represents the output of the first normalized layer of the routing attention network module, X f Denotes the prediction vector representing the data, and MLP(·) denotes a multi-layer feedforward neural network.
[0052] A substation load forecasting system based on a segmented attention mechanism is provided, which includes a data acquisition and preprocessing module, an embedded time covariate module, a linear insertion adjustment module, a time domain dimension intra-segment feature learning module, a time domain dimension inter-segment feature learning module, a variable dimension feature learning module, and an output prediction result module;
[0053] The data collection and preprocessing module is used to collect the historical load data and characteristic information of the substation equipment, normalize the historical load data of the substation equipment, and obtain the normalized historical load data;
[0054] The embedded time covariate module is used to extract the time dimension characteristics of the normalized historical load data, embed them from the time granularity of month, week, day, hour, minute, second, etc., and fuse the embedded data and feature information to obtain the fused time feature data;
[0055] A linear insertion adjustment module is used to linearly transform and combine the fused time feature data and introduce noise to obtain the transformed time feature data;
[0056] A time domain dimension segment feature learning module, used to segment the transformed time feature data, and input the segmented data for processing to obtain first output data;
[0057] A time domain dimension inter-segment feature learning module, used for processing the first output data to obtain second output data;
[0058] A variable dimension feature learning module, used for processing the second output data to obtain corresponding prediction vector representation data;
[0059] The output prediction result module is used to process the prediction vector representation data to obtain the prediction result of the substation equipment load.
[0060] The beneficial effects of the present invention are as follows: the prediction method utilizes feature data and combines it with time information of smaller granularity to effectively enhance the overall characterization capability of the data and improve the robustness of the load prediction model; two continuous weight parameter shared linear layers, namely linear modules, are introduced to linearly change and combine the vectors that incorporate time information, adjust the input of the load prediction model, introduce noise, and improve the generalization of the method; after the data is segmented, an additive self-attention mechanism is used for each small segment, and the overall characteristics of the sequence can be learned through segmentation, and the local dependencies of the variables that are lost due to increased sampling intensity are avoided, which effectively improves the prediction accuracy of the load of the substation equipment; the prediction system has a simple structure and short calculation time, and can be widely used in various scenarios to predict substation equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 is a flow chart of the method of the present invention;
[0062] Figure 2 is a specific structural diagram of the load forecasting model of the present invention;
[0063] Figure 3This is a system structure diagram of the present invention. DETAILED DESCRIPTION
[0064] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0065] like Figure 1 As shown, a substation load forecasting method based on segmented attention mechanism includes the following steps:
[0066] S1. Obtain the historical load data of the substation equipment and the corresponding characteristic information; normalize the historical load data of the substation equipment to obtain the normalized historical load data, and the formula is:
[0067]
[0068] in, represents the normalized historical load data of the ith column, x i represents the historical load data of the ith item, represents the average value of the historical load data in the i-th column, δ i represents the standard deviation of the historical load data in the i-th column;
[0069] S2. Construct a load forecasting model; input the normalized historical load data and characteristic information into the load forecasting model and train it to obtain a trained load forecasting model;
[0070] S3. The load data to be predicted is normalized and then input into the trained load prediction model to obtain the corresponding prediction result, thereby completing the prediction of the load of the substation equipment.
[0071] The characteristic information of the substation equipment in step S1 includes timestamp, high available load, high useless load, medium available load, medium useless load, low available load, low useless load and oil temperature; wherein, high available load and high useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is higher than 35kV; medium available load and medium useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is between 1kV and 35kV; low available load and low useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is lower than 1kV.
[0072] like Figure 2As shown, the load forecasting model in step S2 includes a time covariate embedding layer, a linear module, an intra-segment attention network module, an inter-segment attention network module, a routing attention network module, and an output result prediction module connected in series in sequence;
[0073] The linear module consists of two linear insertion layers connected in series;
[0074] The intra-segment attention network module includes an activation function layer, an intra-segment additive attention layer, and an activation function layer connected in series;
[0075] The inter-segment attention network module includes an inter-segment scaled dot product attention layer, a normalization layer, a multi-layer feedforward neural network, and a normalization layer connected in series;
[0076] The routing attention network module includes two routing attention mechanism layers, a normalization layer, a multi-layer feedforward neural network, and a normalization layer connected in series;
[0077] The output result prediction module adopts an encoder-decoder architecture.
[0078] Step S2 further comprises:
[0079] S2-1, input the normalized historical load data and characteristic information into the time covariate embedding layer, extract the normalized historical load data, obtain the time information and fuse it with the characteristic information to obtain the fused time characteristic data;
[0080] S2-2, inputting the fused time feature data into a linear module for linear transformation and combination to obtain transformed time feature data;
[0081] S2-3, inputting the transformed time feature data into the intra-segment attention network module for segmentation to obtain segmented time feature data; processing the segmented time feature data to obtain corresponding first output data;
[0082] S2-4, inputting the first output data and the transformed time feature data into the inter-segment attention network module to obtain corresponding second output data;
[0083] S2-5, inputting the second output data into the routing attention network module to obtain prediction vector representation data;
[0084] S2-6, input the prediction vector representation data into the encoder-decoder to obtain a prediction result;
[0085] S2-7, iterating the load forecasting model according to the forecasting results until the target loss function is minimized; the target loss function is the mean square error loss function;
[0086] S2-8. Adjust the parameters of the load forecasting model according to minimizing the objective loss function to obtain a trained load forecasting model.
[0087] The formula for the temporal covariate embedding layer in step S2-1 is:
[0088]
[0089]
[0090] Among them, T represents the time covariate matrix, that is, the fused time feature data, et 11 、et 1n 、et m1 、et mn They represent the time index of the 1st row and 1st column of the time covariate matrix T, the time index of the 1st row and nth column, the time index of the mth row and 1st column, and the time index of the mth row and nth column, respectively. i represents the vector representation of the i-th column embedding of the time covariate matrix, i.e., the output of the time covariate embedding layer, T i represents the i-th column of the time covariate matrix, Min(T i ) represents the minimum value of the i-th column of the time covariate matrix, Max(T i ) represents the maximum value of the i-th column of the time covariate matrix.
[0091] The formula of step S2-2 is:
[0092]
[0093]
[0094] in, represents the output of the second linear insertion layer, that is, the transformed temporal feature data, represents the output of the first linear insertion layer, T represents the fused temporal feature data, i.e., the output of the temporal covariate embedding layer, W1 and W2 represent the weight parameters of the linear insertion layer, and b1 and b2 represent the bias parameters of the linear insertion layer. b2∈R d , d represents the number of features of the fused temporal feature data, d model represents the mapping dimension of the linear layer, and R represents a constant.
[0095] The formula of the intra-segment additive attention layer in the intra-segment attention network module of step S2-3 is:
[0096]
[0097] X' t =RELU(WXseg +b)
[0098] X' t =W v X' t tanh(W Q X' t +(W K X' t )
[0099] X=X seg +RELU(X' t )
[0100] Among them, X l Represents the output of the linear module, that is, the transformed time feature data, L seg Indicates the size of each segment, X seg Represents the time characteristic data of each segment after segmentation, X' t represents the intermediate vector of the transformation, W represents the weight parameter of the intra-segment additive attention layer, b represents the bias parameter of the intra-segment additive attention layer, RELU(·) represents the activation function, and W v represents the weight matrix of the value vector v, tanh(·) represents the hyperbolic tangent function, W Q represents the weight matrix of the query vector Q, W K represents the weight matrix of the key vector K, and X represents the vector representation of each segment after intra-segment feature learning, that is, the first output data.
[0101] The formula for step S2-4 is:
[0102]
[0103]
[0104]
[0105] Among them, t represents the time domain dimension, represents the output of the first normalized layer of the inter-segment attention network module on the f-th time feature data dimension, represents the output of the first normalized layer of the inter-segment attention network module on the first time feature data dimension, X :,f Represents the vector representation of the time feature data f at all time steps, that is, the first output data, the transformed time feature data, MSA t (·) represents the multi-head self-attention mechanism in the time domain dimension, that is, the output of the inter-segment scaled dot product attention layer, LayerNorm(·) represents the normalization function, represents the output of the normalized layer of the inter-segment attention network module on all temporal feature dimensions, i.e., the input of the multi-layer feedforward neural network. MLP(·) represents the multi-layer feedforward neural network. X t Represents the output of the inter-segment attention network module, that is, the second output data.
[0106] The formula for step S2-5 is:
[0107]
[0108]
[0109]
[0110]
[0111] Among them, A i,: represents the aggregate information of all features at the i-th moment, that is, the output of the first routing attention mechanism layer, C i,: represents the learnable matrix in the routing attention mechanism layer, Represents all feature information processed by the inter-segment attention mechanism at the i-th moment, MSA f (·) represents the multi-head self-attention mechanism on the feature dimension, X t represents the second output data, represents all feature information at the i-th moment, i.e., the output of the second routing attention mechanism layer. LayerNorm(·) represents the normalization function. represents the output of the first normalized layer of the routing attention network module, X f Denotes the prediction vector representing the data, and MLP(·) denotes a multi-layer feedforward neural network.
[0112] like Figure 3 As shown, a substation load prediction system based on a segmented attention mechanism includes a data acquisition and preprocessing module, an embedded time covariate module, a linear insertion adjustment module, a time domain dimension intra-segment feature learning module, a time domain dimension inter-segment feature learning module, a variable dimension feature learning module, and an output prediction result module;
[0113] The data collection and preprocessing module is used to collect the historical load data and characteristic information of the substation equipment, and normalize the historical load data of the substation equipment to obtain the normalized historical load data;
[0114] The embedded time covariate module is used to extract the time dimension characteristics of the normalized historical load data, embed them from the time granularity of month, week, day, hour, minute, second, etc., and fuse the embedded data and feature information to obtain the fused time feature data;
[0115] A linear insertion adjustment module is used to linearly transform and combine the fused time feature data and introduce noise to obtain the transformed time feature data; linearly transform and combine the fused time feature data and controllably introduce noise to increase the generalization ability of the prediction method and obtain the transformed time feature data;
[0116] The feature learning module in the time domain dimension segment is used to segment the transformed time feature data, and input the segmented data for processing, learn the local features of the feature variables, and obtain the first output data; wherein the segment size is set to 6;
[0117] The time domain dimension inter-segment feature learning module is used to process the first output data, capture the local connection of the variables within the segment, and obtain the second output data;
[0118] A variable dimension feature learning module is used to process the second output data, capture the feature relationship and dependency between different variables, and obtain corresponding prediction vector representation data;
[0119] The output prediction result module is used to process the prediction vector representation data to obtain the prediction result of the substation equipment load.
[0120] In one embodiment of the present invention, the present invention has at least one central processing unit; at least one readable computer storage medium for storing at least one program; the readable computer storage medium is used to store program codes and modules, and transfer the program codes and modules to the central processing unit; the central processing unit is used to execute instructions in the program code.
[0121] The acquired historical load data is divided into training set, validation set and test set, and the division ratio is 3:1:1. Among them, the historical load data is 69680, and the sampling frequency is 15min. The historical load data is predicted by this method to obtain the corresponding prediction results of the substation load, and the mean square error MSE and mean absolute error MAE are used as evaluation indicators to evaluate the prediction results.
[0122] The formula for mean square error (MSE) is as follows:
[0123]
[0124] Among them, m represents the total length of data, y i represents the true value, Represents the predicted value.
[0125] The formula for mean absolute error MAE is as follows:
[0126]
[0127] in, Represents the true value y i and predicted values The absolute value of the difference.
[0128] When the mean square error MSE and mean absolute error MAE are smaller, it means that the true value y i and predicted values The closer the difference is to zero, the higher the accuracy of the prediction result.
[0129] Table 1 is the evaluation data of the method of the present invention; Table 2 is the comparison data of the method of the present invention with other methods when the prediction time is 24*15min; Table 3 is the comparison data of the method of the present invention with other methods when the prediction time is 288*15min.
[0130] Table 1 Evaluation data of the method of the present invention
[0131] Prediction (unit: 15min) MSE MAE 24 0.232 0.299 48 0.295 0.357 96 0.365 0.411 288 0.458 0.472 672 0.658 0.623
[0132] Table 2 Comparison data of the method of the present invention and other methods under the prediction time of 24*15min
[0133] Model MSE MSE This method 0.232 0.299 Crossformer(2022) 0.234 0.302 Pyraformer(2022) 0.310 0.371 Autoformer(2021) 0.410 0.428 Informer(2021) 0.323 0.369 Transformer (2017) 0.306 0.371
[0134] Table 3 Comparison data of the method of the present invention and other methods under the prediction time of 288*15min
[0135] Model MSE MSE This method 0.458 0.472 Crossformer(2022) 0.517 0.517 Pyraformer(2022) 0.729 0.657 Autoformer(2021) 0.604 0.522 Informer(2021) 1.056 0.786 Transformer (2017) 1.162 0.879
[0136] As shown in Table 1, the load prediction results of substation equipment predicted by this method have a minimum mean square error (MSE) and a mean absolute error (MAE) of 0.232 and 0.299, respectively, which shows that the prediction results of this method are close to the real results and have high accuracy.
[0137] As shown in Table 2, under the condition that the prediction time is 24*15min, the mean square error MSE and mean absolute error MAE of this method are smaller than those of other methods, and their values are 0.232 and 0.299, respectively, indicating that the accuracy of the prediction results obtained by this method is higher than that obtained by other methods.
[0138] As shown in Table 3, under the condition that the prediction time is 288*15min, the mean square error MSE and mean absolute error MAE of this method are smaller than those of other methods, and their values are 0.458 and 0.472, respectively, indicating that the accuracy of the prediction results obtained by this method is higher than that of the prediction results obtained by other methods.
[0139] In summary, the prediction method of the present invention utilizes feature data and combines it with time information of smaller granularity to effectively enhance the overall characterization ability of the data and improve the robustness of the load prediction model; introduces two continuous weight parameter shared linear layers, namely linear modules, to linearly change and combine the vectors that incorporate time information, adjust the input of the load prediction model, introduce noise, and improve the generalization of the method; after the data is segmented, an additive self-attention mechanism is used in each small segment, which can learn the overall characteristics of the sequence through segmentation, and avoid the local dependencies of the variables that are lost due to increased sampling intensity, thereby effectively improving the prediction accuracy of the load of the substation equipment; the prediction system of the present invention has a simple structure, short calculation time, and can be widely used in various scenarios to predict substation equipment.
Claims
1. A method for load forecasting of substation equipment based on segmented attention mechanism, characterized in that: The following steps are involved: S1. Obtain historical load data of substation equipment and corresponding characteristic information; Normalizing the historical load data of the substation equipment to obtain normalized historical load data; The characteristic information of the substation equipment in step S1 includes timestamp, high available load, high useless load, medium available load, medium useless load, low available load, low useless load and oil temperature; wherein, high available load and high useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is higher than 35kV; medium available load and medium useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is between 1kV and 35kV; low available load and low useless load represent the active load and reactive load of the substation equipment under the condition that the voltage is lower than 1kV; S2. Construct a load forecasting model; input the normalized historical load data and characteristic information into the load forecasting model and train it to obtain a trained load forecasting model; The load forecasting model in step S2 includes a time covariate embedding layer, a linear module, an intra-segment attention network module, an inter-segment attention network module, a routing attention network module, and an output result prediction module connected in series; The linear module includes two linear insertion layers connected in series; The intra-segment attention network module includes an activation function layer, an intra-segment additive attention layer, and an activation function layer connected in series in sequence; The inter-segment attention network module includes an inter-segment scaled dot product attention layer, a first normalization layer, a multi-layer feedforward neural network, and a second normalization layer connected in series in sequence; The routing attention network module includes two routing attention mechanism layers, a third normalization layer, a multi-layer feedforward neural network, and a fourth normalization layer connected in series; wherein the first to fourth normalization layers adopt the same structure; The output result prediction module adopts an encoder-decoder architecture; The step S2 further comprises: S2-1, input the normalized historical load data and characteristic information into the time covariate embedding layer, extract the normalized historical load data, obtain the time information and fuse it with the characteristic information to obtain the fused time characteristic data; The formula for the temporal covariate embedding layer in step S2-1 is: Wherein, T represents the time covariate matrix, i.e., the fused time feature data; et11, et1n, etm1, and etmn represent the time index of the 1st row and 1st column, the time index of the 1st row and the nth column, the time index of the mth row and the 1st column, and the time index of the mth row and the nth column of the time covariate matrix T, respectively; Ei represents the vector representation of the i-th column embedding of the time covariate matrix, i.e., the output of the time covariate embedding layer; Ti represents the i-th column of the time covariate matrix; Min(Ti) represents the minimum value of the i-th column of the time covariate matrix; and Max(Ti) represents the maximum value of the i-th column of the time covariate matrix; S2-2, inputting the fused time feature data into a linear module for linear transformation and combination to obtain transformed time feature data; The formula of step S2-2 is: in, represents the output of the second linear insertion layer, that is, the transformed temporal feature data, represents the output of the first linear insertion layer, T represents the fused temporal feature data, that is, the output of the temporal covariate embedding layer, W1 and W2 represent the weight parameters of the linear insertion layer, and b1 and b2 represent the bias parameters of the linear insertion layer; S2-3, inputting the transformed time feature data into the intra-segment attention network module for segmentation to obtain segmented time feature data; processing the segmented time feature data to obtain corresponding first output data; The formula of the intra-segment additive attention layer in the intra-segment attention network module of step S2-3 is: X't=RELU(WXseg+b) X't=WvX't·tanh(WQX't+(WKX't) X=Xseg+RELU(X't) Among them, Xl represents the output of the linear module, that is, the transformed time feature data Lseg represents the size of each segment, Xseg represents the temporal feature data in each segment after segmentation, X't represents the intermediate vector of the transformation, W represents the weight parameter of the intra-segment additive attention layer, b represents the bias parameter of the intra-segment additive attention layer, RELU(·) represents the activation function, Wv represents the weight matrix of the value vector v, tanh(·) represents the hyperbolic tangent function, WQ represents the weight matrix of the query vector Q, WK represents the weight matrix of the key vector K, and X represents the vector representation of each segment after intra-segment feature learning, that is, the first output data; S2-4, inputting the first output data and the transformed time feature data into the inter-segment attention network module to obtain corresponding second output data; The formula of step S2-4 is: Among them, t represents the time domain dimension, represents the output of the first normalized layer of the inter-segment attention network module on the f-th time feature data dimension, represents the output of the first normalized layer of the inter-segment attention network module on the first temporal feature data dimension, X:,f represents the vector representation of the temporal feature data f at all time steps, i.e., the first output data, the transformed temporal feature data, MSAt(·) represents the multi-head self-attention mechanism on the temporal dimension, i.e., the output of the inter-segment scaled dot product attention layer, LayerNorm(·) represents the normalization function, represents the output of the normalized layer of the inter-segment attention network module on all time feature dimensions, i.e., the input of the multi-layer feedforward neural network, MLP(·) represents the multi-layer feedforward neural network, Xt represents the output of the inter-segment attention network module, i.e., the second output data; S2-5, inputting the second output data into the routing attention network module to obtain prediction vector representation data; The formula of step S2-5 is: Among them, Ai,: represents the aggregate information of all features at the i-th moment, that is, the output of the first routing attention mechanism layer, Ci,: represents the learnable matrix in the routing attention mechanism layer, represents all feature information processed by the inter-segment attention mechanism at the i-th moment, MSAf(·) represents the multi-head self-attention mechanism on the feature dimension, Xt represents the second output data, represents all feature information at the i-th moment, i.e., the output of the second routing attention mechanism layer. LayerNorm(·) represents the normalization function. represents the output of the first normalized layer of the routing attention network module, Xf represents the predicted vector representation data, and MLP(·) represents a multi-layer feedforward neural network; S2-6, input the prediction vector representation data into the encoder-decoder to obtain the prediction result; S2-7, iterating the load forecasting model according to the forecasting results until the target loss function is minimized; S2-8, adjusting the parameters of the load forecasting model according to minimizing the objective loss function to obtain a trained load forecasting model; S3. The load data to be predicted is normalized and then input into the trained load prediction model to obtain the corresponding prediction result, thereby completing the prediction of the load of the substation equipment.
2. A prediction system based on the substation load prediction method based on the segmented attention mechanism according to claim 1, characterized in that: It includes data collection and preprocessing module, time covariate embedding module, linear insertion adjustment module, feature learning module within time domain dimension segment, feature learning module between time domain dimension segments, feature learning module of variable dimension, and output prediction result module; The data collection and preprocessing module is used to collect the historical load data and characteristic information of the substation equipment, and normalize the historical load data of the substation equipment to obtain the normalized historical load data; The embedded time covariate module is used to extract the time dimension features of the normalized historical load data, embed them from the time granularity of month, week, day, hour, minute, second, etc., and fuse the embedded data and feature information to obtain the fused time feature data; The linear interpolation adjustment module is used to perform linear transformation and combination on the fused time feature data and introduce noise to obtain transformed time feature data; The time domain dimension segment feature learning module is used to segment the transformed time feature data and input the segmented data for processing to obtain first output data; The time domain dimension inter-segment feature learning module is used to process the first output data to obtain second output data; The variable dimension feature learning module is used to process the second output data to obtain corresponding prediction vector representation data; The output prediction result module is used to process the prediction vector representation data to obtain the prediction result of the substation equipment load.
