Smart power grid new energy load prediction system based on Transform structure

By improving the Sinkhorn-Transformer model and the hierarchical pyramid attention mechanism, the problems of insufficient feature correlation and high computational complexity in renewable energy load forecasting are solved, achieving high-precision and low-latency renewable energy load forecasting and supporting the stable operation of the smart grid.

CN121766530APending Publication Date: 2026-03-31GUANGDONG HEHONGDA ELECTRIC POWER ENGINEERING DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-25
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing methods for predicting new energy loads struggle to effectively utilize the potential coupling relationships between multidimensional features when dealing with heterogeneous input data from multiple sources. Furthermore, traditional models suffer from gradient vanishing or exploding problems in long-sequence predictions, resulting in low prediction accuracy and computational efficiency.

Method used

An improved Sinkhorn-Transformer prediction model is adopted, which combines a hierarchical pyramid attention mechanism and backpropagation gradient optimization to construct a multi-dimensional feature input matrix and update the parameters, thereby achieving high-precision prediction of renewable energy load.

Benefits of technology

It improves the accuracy and efficiency of new energy load forecasting, enabling high-precision, low-latency load forecasting in a multi-source, high-dimensional data environment, and providing reliable power grid operation decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121766530A_ABST
    Figure CN121766530A_ABST
Patent Text Reader

Abstract

The invention discloses a smart power grid new energy load prediction system based on a Transform structure, and the system comprises a data collection module which is used for collecting multi-source data of a smart power grid and carrying out the preprocessing of the multi-source data; the feature processing module is used for constructing a multi-dimensional feature input matrix; the data division module is used for dividing the multi-dimensional feature input matrix into a training data set and a test data set, and generating an input sequence and a prediction target sequence; the prediction module is used for generating a context feature vector of hierarchical aggregation in the improved Sinkhorn-Transform prediction module; the model training module is used for obtaining a convergent improved Sinkhorn-Transformer prediction model, and the model training module is used for obtaining the convergent improved Sinkhorn-Transformer prediction model; the load prediction module is used for generating a new energy load prediction result set in the target prediction time period; the result evaluation module is used for outputting a new energy load prediction graph and a new energy load prediction error evaluation result set, high-precision prediction of the new energy load is achieved, and the method has the advantages of being low in prediction error and high in response speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system dispatching technology, and in particular to a smart grid renewable energy load forecasting system based on the Transformer architecture. Background Technology

[0002] As the proportion of new energy sources in the power system continues to increase, the operation and dispatch of smart grids are gradually shifting from a centralized control mode dominated by traditional thermal power to a distributed control mode dominated by new energy sources such as wind and solar power. New energy power generation is characterized by significant intermittency and randomness, with its output power greatly affected by factors such as weather, geography, and seasons, leading to a significant increase in the complexity of grid load forecasting. To achieve safe, stable, and economical operation of the power system, accurate forecasting of new energy loads has become a crucial aspect of smart grid dispatching and planning.

[0003] Existing methods for predicting renewable energy loads mainly include those based on statistical models and those based on machine learning or deep learning. Traditional statistical models, such as autoregressive moving average models and support vector machines, rely on the linear relationship between historical loads and meteorological characteristics, making it difficult to capture complex temporal nonlinear features and resulting in low prediction accuracy in highly volatile renewable energy scenarios. Furthermore, these methods have limited ability to mine feature correlations when processing multi-source heterogeneous input data, making it difficult to effectively utilize the potential coupling relationships between multi-dimensional features. In recent years, deep learning technology has been widely used in load forecasting. Recurrent neural networks and their variant, Long Short-Term Memory networks, can model time dependencies, but they are prone to gradient vanishing or exploding problems when processing long sequences and are difficult to parallelize, leading to low model training efficiency. Convolutional neural networks, while capable of extracting local features, lack the ability to express global temporal dependencies. Summary of the Invention

[0004] One objective of this invention is to propose a smart grid renewable energy load forecasting system based on the Transformer structure. This invention fully utilizes the differentiable permutation mechanism and hierarchical pyramid attention mechanism of the improved Sinkhorn-Transformer forecasting model to address the problems of insufficient utilization of feature correlation, weak time series dependency modeling ability, and high model computational complexity in renewable energy load forecasting in smart grids, and constructs a high-precision and high-efficiency forecasting model.

[0005] According to an embodiment of the present invention, a smart grid renewable energy load forecasting system based on a Transformer architecture includes: The data acquisition module is used to collect multi-source data from the smart grid and perform preprocessing. The feature processing module is used to perform feature normalization, temporal feature encoding, and feature correlation analysis on the preprocessed multi-source data, and to construct a multi-dimensional feature input matrix. The data partitioning module is used to divide the multidimensional feature input matrix into training and testing datasets in chronological order, and to generate input and prediction target sequences using a sliding time window. The prediction module is used to input the input sequence and the prediction target sequence into the improved Sinkhorn-Transformer prediction module for embedding mapping, feature substitution and hierarchical attention feature extraction, and to generate a hierarchically aggregated context feature vector. The model training module is used to update the parameters of the improved Sinkhorn-Transformer prediction module based on the context feature vector, using backpropagation and gradient optimization methods, to complete the model training and obtain a converged improved Sinkhorn-Transformer prediction model. The load forecasting module is used to input the test dataset into the convergent improved Sinkhorn-Transformer forecasting model and generate a set of new energy load forecasting results for the target forecasting period through forward propagation calculation. The results evaluation module is used to evaluate and visualize the results set of new energy load forecasts, and outputs new energy load forecast graphs and the corresponding new energy load forecast error evaluation results set.

[0006] Optionally, modules can be integrated using the following methods: Collect and preprocess multi-source data from the smart grid; Feature processing is performed on the preprocessed multi-source data to construct a multi-dimensional feature input matrix; The multidimensional feature input matrix is ​​divided into training and testing datasets in chronological order, and a sliding time window is used to generate the input sequence and the prediction target sequence. The input sequence and the target prediction sequence are input into the improved Sinkhorn-Transformer prediction model, and a hierarchical pyramid attention mechanism is introduced to generate contextual feature vectors. Based on context feature vectors, backpropagation and gradient optimization methods are used to update parameters, complete model parameter training, and obtain a converged improved Sinkhorn-Transformer prediction model. The test dataset is input into the converged improved Sinkhorn-Transformer prediction model to generate a set of new energy load prediction results. The system performs error assessment and visualization on the new energy load forecast result set, and outputs the new energy load forecast error assessment result set and new energy load forecast graph.

[0007] Optionally, the multi-source data includes historical load data, meteorological data, photovoltaic power generation output data, wind power output data, and power grid operation status data, and the preprocessing includes time alignment, outlier removal, and missing value filling.

[0008] Optionally, the construction of the multidimensional feature input matrix specifically includes: Normalize the preprocessed multi-source data to construct a normalized feature data matrix. The construction process involves subtracting the minimum value of the feature from the original value of the preprocessed multi-source data, dividing by the difference between the maximum and minimum values ​​of the feature, to obtain the multi-source input features, and uniformly mapping the values ​​of the multi-source input features to a standardized range of 0 to 1 to form a normalized feature data matrix. The normalized feature data matrix is ​​encoded with time features to obtain a time feature encoding matrix. The time feature encoding matrix is ​​formed by introducing a time position representation based on sine and cosine functions for each time step, embedding the sequential and periodic information of the time series into the feature vector. The normalized feature data matrix and the time feature encoding matrix are aligned along the time step dimension and then concatenated column by column to form an initial feature matrix. Based on the initial feature matrix, the linear correlation between the two columns of features across all time steps is calculated to generate a correlation coefficient matrix. The multi-source input features are weighted based on the correlation coefficient matrix to obtain a fusion weight matrix. The initial feature matrix is ​​then weighted and combined using the fusion weight matrix while maintaining time step alignment to generate a multi-dimensional feature input matrix.

[0009] Optionally, the generation of the input sequence and the predicted target sequence specifically includes: The multidimensional feature input matrix is ​​divided into training and testing datasets according to time order. In the training dataset, a sliding time window method is used to extract the input sequence. The sliding window length is set to L. Each input sequence is defined as a combination of L consecutive feature vectors starting from the i-th time step to form the input sequence. The actual load value of the next time step after the end of the input sequence is taken as the target value, and the target values ​​are aggregated in chronological order to form the prediction target sequence.

[0010] Optionally, the generation of the context feature vector specifically includes: The input sequence and the target sequence are fed into an improved Sinkhorn-Transformer prediction model. The improved Sinkhorn-Transformer prediction model includes an input embedding module, a permutation cost construction module, a Sinkhorn iterative normalization module, and a differentiable permutation attention module. The input embedding module obtains the input embedding matrix by using linear mapping and superimposed temporal position encoding information. The permutation cost construction module obtains the permutation cost matrix by using a weighted fusion method of Euclidean distance and cosine similarity. The Sinkhorn iterative normalization module performs multiple rounds of row and column normalization iterations with temperature parameters to generate a differentiable permutation matrix. The differentiable permutation attention module introduces a hierarchical pyramid attention mechanism to generate a context feature vector. In the input embedding module, the input sequence and the predicted target sequence are linearly mapped, and time position encoding information is superimposed to generate the input embedding matrix; In the permutation cost construction module, the permutation cost matrix between time steps is calculated based on the input embedding matrix using a weighted fusion method of Euclidean distance and cosine similarity. In the Sinkhorn iterative normalization module, the permutation cost matrix is ​​subjected to multiple rounds of row and column normalization iterations with temperature parameters to generate a differentiable permutation matrix with double random constraints. The differentiable permutation matrix is ​​obtained by applying exponential weights to the matrix elements, performing row and column normalization operations in sequence, and repeating the iteration until convergence. In the differentiable permutation attention module, the input embedding matrix is ​​temporally permuted using a differentiable permutation matrix to obtain a permuted embedding matrix. A hierarchical pyramid attention mechanism is then introduced onto the permuted embedding matrix. Local attention and global attention are calculated and weighted by a multi-level temporal resolution structure to generate a hierarchically fused context feature vector.

[0011] Optionally, obtaining the convergent improved Sinkhorn-Transformer prediction model specifically includes: The context feature vector is input into the improved Sinkhorn-Transformer prediction model, and the predicted load value is output. The prediction loss function is constructed based on the difference between the predicted load value and the actual load value. The prediction loss function consists of a mean squared error term and a parameter regularization term. The gradient derivative of the prediction loss function is calculated using the backpropagation algorithm, and the gradient information of each parameter in the improved Sinkhorn-Transformer prediction model is calculated. Based on gradient information, gradient optimization algorithms are used for iterative updates to generate an optimized model parameter matrix. The optimized model parameter matrix is ​​reloaded into the improved Sinkhorn-Transformer prediction model and trained iteratively for multiple rounds. When the change in the prediction loss function is less than the preset convergence threshold, the converged improved Sinkhorn-Transformer prediction model is obtained.

[0012] Optionally, the generation of the new energy load forecast result set specifically includes: The test dataset is input into the convergent improved Sinkhorn-Transformer prediction model with the time step length and feature dimension synchronized with the training phase. The input test data is embedded and mapped and time-position encoded to form the input feature matrix for the test phase; The input feature matrix in the testing phase is calculated through forward propagation to obtain the predicted load value at the corresponding time step. The predicted load value is obtained by sequentially passing through the embedding layer, attention calculation layer and feedforward network layer, mapping the input features to the load prediction space, and forming it through parameter weighted summation and activation function transformation. The predicted output values ​​at each time step are combined in chronological order to form a new energy load prediction result set, which includes predicted load values ​​and time index information.

[0013] Optionally, the output of the new energy load forecasting error assessment result set and the new energy load forecasting graph specifically includes: The new energy load forecast result set is matched with the corresponding time index to generate a new energy load forecast result dataset. Align the new energy load forecast result dataset with the real-time collected load dataset in the time dimension, and perform difference calculation on the predicted load value and the real-time collected load value at the same time step to obtain the new energy load forecast error data sequence. The performance of the new energy load forecast error data series is evaluated by using three indicators: mean absolute error, mean square error, and root mean square error to form an error evaluation result. The mean absolute error is the average of the absolute values ​​of the forecast error at each time step, the mean square error is the average of the squares of the forecast error at each time step, and the root mean square error is the result of taking the square root of the mean square error. The error assessment results are summarized and organized according to the time dimension and the prediction period to generate a set of new energy load prediction error assessment results. The new energy load forecast result set is associated with the new energy load forecast error assessment result set. The visualization module is used to generate a comparison graph between the new energy load forecast result curve and the real-time load curve, and outputs the new energy load forecast graph and the corresponding new energy load forecast error assessment result set.

[0014] The beneficial effects of this invention are: This invention achieves high accuracy and robustness in smart grid renewable energy load forecasting by introducing an improved Sinkhorn-Transformer prediction model. The system systematically improves upon the shortcomings of traditional Transformer models in renewable energy load forecasting tasks, such as insufficient feature correlation mining, limited time series modeling capabilities, high computational complexity, and poor model convergence. Firstly, in the feature processing stage, this invention utilizes multi-source data normalization and correlation-weighted fusion methods to fully explore the inherent coupling relationships between multi-dimensional information such as historical load, meteorological characteristics, photovoltaic and wind power output, and grid operating status, thereby constructing a multi-dimensional feature input matrix that comprehensively reflects the operating status of the power system.

[0015] Secondly, regarding the prediction model structure, this invention introduces an improved differentiable permutation mechanism for the Sinkhorn-Transformer prediction model. This mechanism enables the model to dynamically adjust the ordering and matching relationships of the input sequence across time steps through a permutation cost matrix and a row-column normalization iterative process, thereby achieving adaptive modeling of complex temporal dependency structures. Unlike traditional Transformers that rely solely on fixed-position encoding, this mechanism captures temporal dependency features while maintaining the model's sensitivity to temporal changes and differentiability, effectively enhancing the expressive power of temporal features. Furthermore, by combining a hierarchical pyramid attention mechanism, local and global attention are calculated and weighted at different time resolutions, allowing the model to simultaneously focus on short-term fluctuations and long-term trends, thus enhancing its ability to characterize the multi-scale dynamic features of renewable energy loads.

[0016] During model training, this invention employs an adaptive parameter update strategy based on backpropagation and gradient optimization. By optimizing the prediction loss function through multiple constraints, the model achieves rapid convergence and stable training. This strategy effectively avoids overfitting while ensuring prediction accuracy, thus improving the model's generalization ability in complex scenarios. In the testing phase, the model generates a set of new energy load prediction results through forward propagation and combines error assessment and visualization modules to provide an intuitive comparison between the prediction results and the actual load, thereby providing interpretable decision-making basis for power grid operation.

[0017] Therefore, the smart grid renewable energy load forecasting system based on the Transformer structure proposed in this invention not only significantly outperforms traditional methods in terms of forecasting accuracy and computational efficiency, but also achieves breakthroughs in model structure interpretability and application stability. This system can achieve high-precision, low-latency, and interpretable renewable energy load forecasting in a multi-source, high-dimensional data environment, providing reliable technical support for smart grid operation scheduling, load balancing, and renewable energy consumption, and has significant engineering application value and promotional significance. Attached Figure Description

[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0019] Figure 1 This is an overall flowchart of a smart grid renewable energy load forecasting system based on the Transformer structure proposed in this invention; Figure 2 This is a schematic diagram of the module structure of an improved Sinkhorn-Transformer prediction model for a smart grid renewable energy load prediction system based on a Transformer structure proposed in this invention. Detailed Implementation

[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0021] refer to Figure 1-2 A smart grid renewable energy load forecasting system based on Transformer architecture, comprising: The data acquisition module is used to collect multi-source data from the smart grid and perform preprocessing. The feature processing module is used to perform feature normalization, temporal feature encoding, and feature correlation analysis on the preprocessed multi-source data, and to construct a multi-dimensional feature input matrix. The data partitioning module is used to divide the multidimensional feature input matrix into training and testing datasets in chronological order, and to generate input and prediction target sequences using a sliding time window. The prediction module is used to input the input sequence and the prediction target sequence into the improved Sinkhorn-Transformer prediction module for embedding mapping, feature substitution and hierarchical attention feature extraction, and to generate a hierarchically aggregated context feature vector. The model training module is used to update the parameters of the improved Sinkhorn-Transformer prediction module based on the context feature vector, using backpropagation and gradient optimization methods, to complete the model training and obtain a converged improved Sinkhorn-Transformer prediction model. The load forecasting module is used to input the test dataset into the convergent improved Sinkhorn-Transformer forecasting model and generate a set of new energy load forecasting results for the target forecasting period through forward propagation calculation. The results evaluation module is used to evaluate and visualize the results set of new energy load forecasts, and outputs new energy load forecast graphs and the corresponding new energy load forecast error evaluation results set.

[0022] In this embodiment, the modules are interconnected using the following method: Collect and preprocess multi-source data from the smart grid; Feature processing is performed on the preprocessed multi-source data to construct a multi-dimensional feature input matrix; The multidimensional feature input matrix is ​​divided into training and testing datasets in chronological order, and a sliding time window is used to generate the input sequence and the prediction target sequence. The input sequence and the target prediction sequence are input into the improved Sinkhorn-Transformer prediction model, and a hierarchical pyramid attention mechanism is introduced to generate contextual feature vectors. Based on context feature vectors, backpropagation and gradient optimization methods are used to update parameters, complete model parameter training, and obtain a converged improved Sinkhorn-Transformer prediction model. The test dataset is input into the converged improved Sinkhorn-Transformer prediction model to generate a set of new energy load prediction results. The system performs error assessment and visualization on the new energy load forecast result set, and outputs the new energy load forecast error assessment result set and new energy load forecast graph.

[0023] In this embodiment, the multi-source data includes historical load data, meteorological data, photovoltaic power generation output data, wind power output data, and power grid operation status data. The preprocessing includes time alignment, outlier removal, and missing value filling.

[0024] In this embodiment, the construction of the multidimensional feature input matrix specifically includes: Normalize the preprocessed multi-source data to construct a normalized feature data matrix. The construction process involves subtracting the minimum value of the feature from the original value of the preprocessed multi-source data, dividing by the difference between the maximum and minimum values ​​of the feature, to obtain the multi-source input features, and uniformly mapping the values ​​of the multi-source input features to a standardized range of 0 to 1 to form a normalized feature data matrix. The normalized feature data matrix is ​​encoded with time features to obtain a time feature encoding matrix. The time feature encoding matrix is ​​formed by introducing a time position representation based on sine and cosine functions for each time step, embedding the sequential and periodic information of the time series into the feature vector. The normalized feature data matrix and the time feature encoding matrix are aligned along the time step dimension and then concatenated column by column to form an initial feature matrix. Based on the initial feature matrix, the linear correlation between the two columns of features across all time steps is calculated to generate a correlation coefficient matrix. The multi-source input features are weighted based on the correlation coefficient matrix to obtain a fusion weight matrix. The initial feature matrix is ​​then weighted and combined using the fusion weight matrix while maintaining time step alignment to generate a multi-dimensional feature input matrix.

[0025] In this embodiment, the generation of the input sequence and the predicted target sequence specifically includes: The multidimensional feature input matrix is ​​divided into training and testing datasets according to time order. In the training dataset, a sliding time window method is used to extract the input sequence. The sliding window length is set to L. Each input sequence is defined as a combination of L consecutive feature vectors starting from the i-th time step to form the input sequence. The actual load value of the next time step after the end of the input sequence is taken as the target value, and the target values ​​are aggregated in chronological order to form the prediction target sequence.

[0026] In this embodiment, the generation of the context feature vector specifically includes: The input sequence and the target sequence are fed into an improved Sinkhorn-Transformer prediction model. The improved Sinkhorn-Transformer prediction model includes an input embedding module, a permutation cost construction module, a Sinkhorn iterative normalization module, and a differentiable permutation attention module. The input embedding module obtains the input embedding matrix by using linear mapping and superimposed temporal position encoding information. The permutation cost construction module obtains the permutation cost matrix by using a weighted fusion method of Euclidean distance and cosine similarity. The Sinkhorn iterative normalization module performs multiple rounds of row and column normalization iterations with temperature parameters to generate a differentiable permutation matrix. The differentiable permutation attention module introduces a hierarchical pyramid attention mechanism to generate a context feature vector. In the input embedding module, the input sequence and the predicted target sequence are linearly mapped, and time position encoding information is superimposed to generate the input embedding matrix; In the permutation cost construction module, based on the input embedding matrix, the permutation cost matrix between time steps is calculated using a weighted fusion method of Euclidean distance and cosine similarity. ; in, The permutation cost matrix, and These are the time steps in the input embedding matrix. With time step Embedded vector, This is a balance coefficient between similarity and distance metrics. Let L be the L2 norm of the vector. For transpose; In the Sinkhorn iterative normalization module, the permutation cost matrix is ​​subjected to multiple rounds of row and column normalization iterations with temperature parameters to generate a differentiable permutation matrix with double random constraints. The differentiable permutation matrix is ​​obtained by applying exponential weights to the matrix elements, performing row and column normalization operations in sequence, and repeating the iteration until convergence. In the differentiable permutation attention module, the input embedding matrix is ​​temporally permuted using a differentiable permutation matrix to obtain a permuted embedding matrix. A hierarchical pyramid attention mechanism is then introduced onto the permuted embedding matrix. Local attention and global attention are calculated and weighted by a multi-level temporal resolution structure to generate a hierarchically fused context feature vector.

[0027] In this embodiment, obtaining the convergent improved Sinkhorn-Transformer prediction model specifically includes: The context feature vector is input into the improved Sinkhorn-Transformer prediction model, and the predicted load value is output. The prediction loss function is constructed based on the difference between the predicted load value and the actual load value. The prediction loss function consists of a mean squared error term and a parameter regularization term. The gradient derivative of the prediction loss function is calculated using the backpropagation algorithm, and the gradient information of each parameter in the improved Sinkhorn-Transformer prediction model is calculated. Based on gradient information, gradient optimization algorithms are used for iterative updates to generate an optimized model parameter matrix. The optimized model parameter matrix is ​​reloaded into the improved Sinkhorn-Transformer prediction model and trained iteratively for multiple rounds. When the change in the prediction loss function is less than the preset convergence threshold, the converged improved Sinkhorn-Transformer prediction model is obtained.

[0028] In this embodiment, the generation of the new energy load forecast result set specifically includes: The test dataset is input into the convergent improved Sinkhorn-Transformer prediction model with the time step length and feature dimension synchronized with the training phase. The input test data is embedded and mapped and time-position encoded to form the input feature matrix for the test phase; The input feature matrix in the testing phase is calculated through forward propagation to obtain the predicted load value at the corresponding time step. The predicted load value is obtained by sequentially passing through the embedding layer, attention calculation layer and feedforward network layer, mapping the input features to the load prediction space, and forming it through parameter weighted summation and activation function transformation. The predicted output values ​​at each time step are combined in chronological order to form a new energy load prediction result set, which includes predicted load values ​​and time index information.

[0029] In this embodiment, the output of the new energy load forecasting error assessment result set and the new energy load forecasting graph specifically includes: The new energy load forecast result set is matched with the corresponding time index to generate a new energy load forecast result dataset. Align the new energy load forecast result dataset with the real-time collected load dataset in the time dimension, and perform difference calculation on the predicted load value and the real-time collected load value at the same time step to obtain the new energy load forecast error data sequence. The performance of the new energy load forecast error data series is evaluated by using three indicators: mean absolute error, mean square error, and root mean square error to form an error evaluation result. The mean absolute error is the average of the absolute values ​​of the forecast error at each time step, the mean square error is the average of the squares of the forecast error at each time step, and the root mean square error is the result of taking the square root of the mean square error. The error assessment results are summarized and organized according to the time dimension and the prediction period to generate a set of new energy load prediction error assessment results. The new energy load forecast result set is associated with the new energy load forecast error assessment result set. The visualization module is used to generate a comparison graph between the new energy load forecast result curve and the real-time load curve, and outputs the new energy load forecast graph and the corresponding new energy load forecast error assessment result set.

[0030] Example 1: This embodiment uses a smart grid renewable energy dispatch center in a prefecture-level city in a coastal region as an application scenario. In this region, wind and solar power account for approximately 42% of the installed capacity, with solar power accounting for about 24% and wind power about 18%. Renewable energy generation is significantly affected by fluctuating weather conditions, resulting in a load curve with distinct morning and evening peaks and midday troughs. Traditional forecasting models such as LSTM and GRU often exhibit prediction lag and decreased accuracy when processing such nonlinear, highly fluctuating multi-source data, especially in short-term load forecasting with high-frequency changes, where errors are significant and it is difficult to meet the accuracy requirements of smart grids for real-time dispatch and power balance.

[0031] To overcome the aforementioned shortcomings, this invention proposes a smart grid renewable energy load forecasting system based on an improved Sinkhorn-Transformer forecasting model. This system integrates the Sinkhorn differentiable permutation mechanism with a hierarchical pyramid attention mechanism, achieving dual modeling of temporal relationships and feature correlations within the Transformer framework, thereby significantly improving forecast accuracy and stability.

[0032] In the experiment, data on new energy power generation and grid operation over a one-month period were selected as the research sample. Data sampling intervals were 15 minutes, resulting in 2880 data samples collected, encompassing 12 feature dimensions including historical load, temperature, humidity, wind speed, wind direction, solar irradiance, air pressure, and photovoltaic and wind power output. After time alignment, outlier removal, and linear interpolation of missing values, the data underwent min-max normalization. Subsequently, time information was embedded through time feature encoding, and a multi-dimensional feature input matrix was generated using a correlation-weighted strategy.

[0033] The system employs a sliding time window method to generate the input sequence and the target sequence for prediction, with a window length of 8 time steps. The training set to test set ratio is 7:3, the optimizer is AdamW, the learning rate is 0.001, the batch size is 32, and the training epochs are 100. During the training phase, the model uses backpropagation and gradient optimization to dynamically adjust parameters, ultimately obtaining a converged prediction model.

[0034] To verify the predictive performance of the system of this invention, LSTM, GRU, standard Transformer, and Informer were selected as comparative models, and the experiments were conducted under the same hardware and data conditions. Evaluation metrics included mean absolute error, mean square error, root mean square error, coefficient of determination, and prediction time. Experimental results are shown in Table 1.

[0035] Table 1. Performance comparison results of the improved Sinkhorn-Transformer model with other models.

[0036] As shown in Table 1, the improved Sinkhorn-Transformer model proposed in this invention has significant advantages in prediction performance. Compared with the standard Transformer, the mean absolute error is reduced by approximately 24.2%, the root mean square error is reduced by approximately 17.8%, and the coefficient of determination is increased by approximately 1.8 percentage points, indicating that the model has a stronger ability to fit complex nonlinear load changes. Meanwhile, the prediction time of this model is only 4.5 seconds, which is about 27% shorter than LSTM, significantly improving real-time performance while maintaining accuracy.

[0037] The experiments further validated the model's stability in multi-timescale predictions. When the prediction duration was extended to 3 hours, the error increase was only 11%, far lower than the average increase of 23% for traditional recurrent neural network models. This indicates that the Sinkhorn differentiable permutation mechanism effectively improves the dependency representation between time steps, enabling the model to maintain high accuracy in long-term predictions. The hierarchical pyramid attention mechanism further enhances the model's ability to perceive the fluctuating characteristics of new energy power generation by fusing local fluctuations and global trends at different time resolutions.

[0038] In actual grid dispatch system deployment, the average power deviation rate predicted by the system of this invention after one month of operation decreased from ±6.7% of the traditional algorithm to ±3.2%, the wind and solar curtailment rate decreased by about 11.6%, and the energy storage system charging and discharging dispatch error decreased by about 15%. These results fully demonstrate that the system has good generalization and engineering feasibility in complex new energy scenarios, and can effectively improve the new energy absorption rate and grid operation security.

[0039] In summary, the smart grid renewable energy load forecasting system based on the Transformer structure of this invention, by introducing Sinkhorn permutation normalization and hierarchical attention fusion mechanism, achieves accurate modeling of temporal correlation and feature coupling in a multi-source feature environment. It has significant advantages such as high prediction accuracy, strong real-time performance and good stability, and provides important technical support for the efficient operation of smart grids.

Claims

1.A smart grid new energy load forecasting system based on a Transformer structure, characterized in that, The method comprises the following steps: a data acquisition module for collecting and preprocessing multi-source data of a smart grid; a feature processing module for feature normalization, time feature coding and feature correlation analysis of the preprocessed multi-source data, and constructing a multi-dimensional feature input matrix; a data division module for dividing the multi-dimensional feature input matrix into a training data set and a test data set according to time sequence, and generating an input sequence and a prediction target sequence by using a sliding time window; a prediction module for inputting the input sequence and the prediction target sequence into an improved Sinkhorn-Transformer prediction module for embedding mapping, feature replacement and hierarchical attention feature extraction, and generating a hierarchical aggregated context feature vector; a model training module for updating parameters of the improved Sinkhorn-Transformer prediction module based on the context feature vector by using a back propagation and gradient optimization method, completing model training and obtaining a converged improved Sinkhorn-Transformer prediction model; a load prediction module for inputting the test data set into the converged improved Sinkhorn-Transformer prediction model to generate a new energy load prediction result set in a target prediction period through forward propagation calculation; a result evaluation module for error evaluation and visual display of the new energy load prediction result set, and outputting a new energy load prediction graph and a corresponding new energy load prediction error evaluation result set. 2.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 1, characterized in that, The modules are realized by the following methods: collecting and preprocessing multi-source data of a smart grid; performing feature processing on the preprocessed multi-source data to construct a multi-dimensional feature input matrix; dividing the multi-dimensional feature input matrix into a training data set and a test data set according to time sequence, and generating an input sequence and a prediction target sequence by using a sliding time window; inputting the input sequence and the prediction target sequence into an improved Sinkhorn-Transformer prediction model, introducing a hierarchical pyramid attention mechanism to generate a context feature vector; updating parameters based on the context feature vector by using a back propagation and gradient optimization method to complete model parameter training and obtain a converged improved Sinkhorn-Transformer prediction model; inputting the test data set into the converged improved Sinkhorn-Transformer prediction model to generate a new energy load prediction result set; error evaluation and visual display of the new energy load prediction result set, and outputting a new energy load prediction error evaluation result set and a new energy load prediction graph. 3.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The multi-source data includes historical load data, weather data, photovoltaic power generation output data, wind power output data and grid operation state data, and the preprocessing includes time alignment, outlier removal and missing value filling. 4.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The construction of the multi-dimensional feature input matrix specifically comprises: The pre-processed multi-source data is normalized to construct a normalized feature data matrix, the construction process being subtracting the minimum value of the pre-processed multi-source data from the original value of the feature, dividing by the difference between the maximum and minimum values of the feature to obtain multi-source input features, and uniformly mapping the values of the multi-source input features to the standardized interval of 0 to 1 to form the normalized feature data matrix; The normalized feature data matrix is time feature encoded to obtain a time feature encoding matrix, the time feature encoding matrix being formed by introducing a time position representation based on a sine function and a cosine function for each time step to embed the order and periodicity information of the time sequence into the feature vector; After aligning the normalized feature data matrix and the time feature encoding matrix in the time step dimension, the initial feature matrix is formed by concatenating columns, the linear correlation degree of two columns of features at all time steps is calculated based on the initial feature matrix to generate a correlation coefficient matrix; According to the correlation coefficient matrix, the multi-source input features are weighted to obtain a fusion weight matrix, and the initial feature matrix is weighted and combined using the fusion weight matrix while keeping the time step alignment to generate a multi-dimensional feature input matrix. 5.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The generation of the input sequence and the predicted target sequence specifically includes: The multi-dimensional feature input matrix is divided into a training data set and a test data set in chronological order; In the training data set, an input sequence is extracted using a sliding time window method, the sliding window length is set to L, each input sequence is defined as a combination of continuous L feature vectors starting from the i-th time step, and an input sequence is formed; The actual load value of the adjacent time step after the end time step of the input sequence is taken as a target value, and the target values are collected in chronological order to form a predicted target sequence. 6.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The generation of the context feature vector specifically includes: The input sequence and the predicted target sequence are input into an improved Sinkhorn-Transformer prediction model, the improved Sinkhorn-Transformer prediction model including an input embedding module, a permutation cost construction module, a Sinkhorn iterative normalization module, and a differentiable permutation attention module, the input embedding module being an input embedding matrix obtained by using linear mapping and superimposing time position encoding information, the permutation cost construction module being a permutation cost matrix obtained by a weighted fusion method of Euclidean distance and cosine similarity, the Sinkhorn iterative normalization module being a differentiable permutation matrix generated by multiple rounds of row and column normalization iteration processing with a temperature parameter, and the differentiable permutation attention module being a context feature vector generated by introducing a hierarchical pyramid attention mechanism; In the input embedding module, the input sequence and the predicted target sequence are linearly mapped and superimposed with time position encoding information to generate an input embedding matrix; In the permutation cost construction module, the permutation cost matrix between time steps is calculated using a weighted fusion method of Euclidean distance and cosine similarity based on the input embedding matrix; and In the Sinkhorn iterative normalization module, a differentiable permutation matrix is generated by multiple rounds of row and column normalization iteration processing with a temperature parameter. In the Sinkhorn iteration normalization module, multiple rounds of row and column normalization iterations with a temperature parameter are performed on the permutation cost matrix to generate a differentiable permutation matrix with double random constraints, which is obtained by applying exponential weighting on the matrix elements, sequentially performing row and column normalization operations, and repeating iterations until convergence is achieved. In the differentiable permutation attention module, the input embedding matrix is sequentially permuted using the differentiable permutation matrix to obtain a permuted embedding matrix, and a hierarchical pyramid attention mechanism is introduced on the permuted embedding matrix to calculate local and global attention respectively through a multi-level time resolution structure and to aggregate them with weights to generate a hierarchical fused context feature vector. 7.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The improved Sinkhorn-Transformer prediction model obtained after convergence specifically includes: The context feature vector is input into the improved Sinkhorn-Transformer prediction model to output a predicted load value, and a prediction loss function is constructed based on the difference between the predicted load value and the actual load value, which consists of an average square error term and a parameter regularization term. The gradient information of each parameter in the improved Sinkhorn-Transformer prediction model is calculated by performing gradient derivation on the prediction loss function using the backpropagation algorithm. Based on the gradient information, the gradient optimization algorithm is used for iterative updating to generate an optimized model parameter matrix. The optimized model parameter matrix is reloaded into the improved Sinkhorn-Transformer prediction model for multiple rounds of iterative training, and when the change of the prediction loss function is less than a preset convergence threshold, the converged improved Sinkhorn-Transformer prediction model is obtained. 8.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The generation of the new energy load prediction result set specifically includes: The test data set is input into the converged improved Sinkhorn-Transformer prediction model according to the time step length and feature dimension synchronized with the training phase; The input test data is embedded and mapped and time position encoded to form a test phase input feature matrix; The test phase input feature matrix is calculated by forward propagation to obtain the predicted load value at the corresponding time step, which is obtained by sequentially passing through the embedding layer, the attention calculation layer and the feedforward network layer, mapping the input feature to the load prediction space, and forming it through parameter weighted summation and activation function transformation; The predicted output values at each time step are combined in chronological order to form a new energy load prediction result set, which includes predicted load values and time index information. 9.The intelligent power grid new energy load forecasting system based on the Transformer structure according to claim 2, characterized in that, The output of the new energy load prediction error evaluation result set and the new energy load prediction graph specifically includes: The new energy load prediction result set is matched with the corresponding time index to generate a new energy load prediction result data set; The new energy load prediction result data set and the real-time collected load data set are aligned in the time dimension, and the predicted load value and the real-time collected load value at the same time step are operated by difference to obtain a new energy load prediction error data sequence; The performance of the new energy load prediction error data sequence is evaluated, three indexes of mean absolute error, mean square error and root mean square error are used for calculation to form error evaluation results, the mean absolute error is the average value of the absolute values of the prediction errors at each time step, the mean square error is the average value of the squares of the prediction errors at each time step, and the root mean square error is the result after taking the square root of the mean square error; The error evaluation results are summarized and arranged according to the time dimension and the prediction period to generate a new energy load prediction error evaluation result set; The new energy load prediction result set and the new energy load prediction error evaluation result set are associated, a comparison graph of the new energy load prediction result curve and the real-time load curve is generated by using a visual display module, and the new energy load prediction graph and the corresponding new energy load prediction error evaluation result set are output.