Load demand prediction method based on space-time attention LSTM, model and construction method

By combining the spatiotemporal attention LSTM model and LSTM network, the problem of insufficient load forecasting accuracy in high-proportion renewable energy scenarios is solved, achieving accurate forecasting of system load demand, adapting to multi-scale spatiotemporal dynamic changes, and providing reliable decision-making basis for power systems.

CN121546554AActive Publication Date: 2026-02-17山东智源电力设计咨询有限公司 +2
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511737725.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-02-17
Estimated Expiration
2045-11-25

AI Technical Summary

Technical Problem

Traditional load forecasting methods struggle to effectively mine spatiotemporal multidimensional information in scenarios with a high proportion of renewable energy, leading to a significant decrease in forecast accuracy.

Method used

A load demand forecasting method based on spatiotemporal attention LSTM is adopted. The spatiotemporal attention model adaptively captures the multidimensional correlation characteristics of new energy output, charging and discharging regulation and load demand changes, and uses LSTM network to learn long-term time-series dependencies to build a forecasting model.

Benefits of technology

It significantly improves the accuracy of load forecasting, provides a more reliable basis for power system dispatch and energy management, and adapts to multi-scale spatiotemporal dynamic changes in scenarios with a high proportion of new energy sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121546554A_ABST
    Figure CN121546554A_ABST
Patent Text Reader

Abstract

The invention provides a load demand prediction method based on space-time attention LSTM, a model and a construction method. The prediction method comprises the steps of obtaining new energy output data and charging and discharging adjustment data; obtaining a load demand prediction result according to the new energy output data, the charging and discharging adjustment data and the prediction model; the prediction model is obtained by training an initial prediction model according to historical data and a loss function; the initial prediction model is constructed based on a space-time attention model and an LSTM network; the historical data comprises historical new energy output data, historical charging and discharging adjustment data and historical load demand data; the space-time attention model is constructed based on historical data. According to the method, space-time correlation characteristics of multi-dimensional factors such as new energy output, charging and discharging adjustment and load demand change are adaptively captured through a space-time attention model, and a long-term time sequence dependency relationship of the multi-dimensional factors such as the new energy output, the charging and discharging adjustment and the load demand change is learned by using an LSTM network, so that accurate prediction of the load demand is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of load demand forecasting technology for integrated source-grid-load-storage systems, specifically to a load demand forecasting method, model, and construction method for source-grid-load-storage systems based on spatiotemporal attention LSTM under a high proportion of renewable energy access. Background Technology

[0002] In the field of power system load forecasting, the widespread integration of high-proportion renewable energy sources has fundamentally altered the dynamic patterns of traditional loads, posing unprecedented challenges to accurate forecasting. The core of this challenge lies in the complex spatiotemporal coupling and dynamic correlation characteristics exhibited by the operational data of the power generation, grid, load, and storage system. In the temporal dimension, both load demand and renewable energy output exhibit strong non-stationary time-series characteristics. Photovoltaic power generation follows a pattern of high solar radiation intensity during the day and low at night, while wind power is closely related to wind speed variations, exhibiting significant intermittency and volatility. Simultaneously, the charging and discharging regulation of energy storage systems to smooth out these fluctuations further introduces rapidly changing temporal elements. These factors collectively lead to a highly nonlinear and dynamically evolving nature of the system's net load sequence over time. Spatially, the system comprises numerous geographically dispersed and mutually influential units. Data from units located in different regions exhibit significant spatial differences. This cross-regional spatiotemporal interaction between the power generation, load, and storage systems means that local data contains information about the global system's operational status, forming a complex spatial correlation network.

[0003] However, most traditional load forecasting methods struggle to effectively mine the aforementioned spatiotemporal multidimensional information. They either focus on time series analysis of a single site, neglecting spatial correlations, or simply aggregate data from the entire region, failing to analyze the complex dynamic spatiotemporal dependencies, thus leading to a significant decrease in forecast accuracy in scenarios with a high proportion of renewable energy. Summary of the Invention

[0004] This invention addresses the problems existing in the prior art by providing a load demand forecasting method based on spatiotemporal attention LSTM. This method can effectively adapt to multi-scale spatiotemporal dynamic changes in high-proportion renewable energy scenarios, significantly improve the accuracy of load forecasting, and provide a more reliable decision-making basis for power system dispatching and energy management. The method can adaptively capture the temporal and spatial correlation characteristics of multi-dimensional factors such as renewable energy output, charge and discharge regulation, and load demand changes through a spatiotemporal attention model. It also uses an LSTM network to learn the long-term temporal dependencies of these factors, thereby achieving accurate forecasting of system load demand.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention proposes a load demand forecasting method based on spatiotemporal attention LSTM, characterized in that it includes: Acquire new energy power output data and charge / discharge regulation data; The load demand forecast results are obtained based on the new energy output data, the charge and discharge regulation data, and the prediction model. The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is constructed based on the historical data.

[0006] In some embodiments, constructing the spatiotemporal attention model includes: Obtain the historical data; A training sequence matrix is ​​obtained by processing the historical data using a sliding window method. The training sequence matrix includes an input sequence matrix and a result sequence matrix. The input sequence matrix is ​​obtained based on the historical renewable energy output data and the historical charge and discharge regulation data. The result sequence matrix is ​​obtained based on the historical load demand data. The spatiotemporal attention model is constructed based on the training sequence matrix.

[0007] In some embodiments, constructing the initial prediction model includes: The spatiotemporal attention matrix is ​​calculated based on the spatiotemporal attention model. The feature encoding set is obtained based on the spatiotemporal attention matrix and the input sequence matrix; The initial prediction model is constructed based on the spatiotemporal attention model, the feature encoding set, and the LSTM network.

[0008] In some embodiments, the spatiotemporal attention model includes a query matrix, a value matrix, and a key matrix; the query matrix and the value matrix are constructed based on the input sequence matrix, and the key matrix is ​​constructed based on the result sequence matrix; The spatiotemporal attention matrix calculated based on the aforementioned spatiotemporal attention model includes: The trend term and period term are extracted from the query matrix and the key matrix, respectively, using filters. Obtain a trend similarity matrix based on the trend terms; obtain a periodic similarity matrix based on the periodic terms; The time attention matrix is ​​obtained based on the trend similarity matrix and the periodic similarity matrix; The linear space similarity matrix and the nonlinear space similarity matrix are calculated based on the query matrix and the key matrix. The spatial attention matrix is ​​obtained based on the linear spatial similarity matrix and the nonlinear spatial similarity matrix; The spatiotemporal attention matrix is ​​obtained based on the temporal attention matrix and the spatial attention matrix.

[0009] In some embodiments, the DTW algorithm is used to obtain a trend similarity matrix based on the trend terms.

[0010] In some embodiments, the autocorrelation coefficient is calculated using fast Fourier transform and inverse fast Fourier transform, and a periodic similarity matrix is ​​obtained based on the periodic terms.

[0011] In some embodiments, the Pearson correlation coefficient and maximum information coefficient algorithms are used to calculate the linear spatial similarity matrix and the nonlinear spatial similarity matrix based on the query matrix and the key matrix.

[0012] In some embodiments, the prediction model is obtained by training the initial prediction model based on the historical data and the loss function, including: Step S1: Initialize the initial prediction model to obtain the current model parameter set, initial latent vector, and initial unit state; Step S2: Let , Let the initial latent vector be the same as the latent vector of the previous time step, let the initial unit state be the same as the unit state of the previous time step, and obtain the current prediction model based on the current model parameter set; Step S3: Obtain the current feature code, wherein the current feature code is the first... The feature encoding at time step; Step S4: Run the current prediction model based on the current feature encoding, the previous time step's latent vector, and the previous time step's cell state to obtain the current cell state and the current latent vector; Step S5: When hour, Let be the total number of times corresponding to the feature encoding set. The current latent vector is added to the latent vector set, the current latent vector is set to the latent vector of the previous time step, and the current unit state is set to the unit state of the previous time step. Steps S3-S5 are then repeated. when When the current latent vector is added to the latent vector set, step S6 is executed. Step S6: Obtain the prediction result set based on the latent vector set; Step S7: Determine whether the current prediction model has converged based on the prediction result set, the loss function, and the current model parameter set; If the current prediction model does not converge, the current model parameter set is updated according to the change of the loss function, and steps S3-S7 are repeated. If the current prediction model converges, then the prediction model is obtained based on the current prediction model.

[0013] Secondly, this invention proposes a load demand prediction model based on spatiotemporal attention LSTM, including a data acquisition unit and a prediction unit. The data acquisition unit is used to acquire new energy output data and charge / discharge regulation data; The prediction unit is used to obtain load demand prediction results based on the new energy output data, the charge and discharge regulation data, and the prediction model. The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is constructed based on the historical data.

[0014] Thirdly, this invention proposes a method for constructing a load demand forecasting model based on spatiotemporal attention LSTM, comprising: Acquire historical data; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. A spatiotemporal attention model is constructed based on the historical data; An initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; The initial prediction model is trained based on historical data and loss function to obtain the prediction model.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The load demand forecasting method proposed in this invention adaptively captures the temporal and spatial correlation characteristics of multi-dimensional factors such as renewable energy output, charge-discharge regulation, and load demand changes using a spatiotemporal attention model. It then utilizes an LSTM network to learn the long-term temporal dependencies of these factors, thereby achieving accurate forecasting of system load demand. Compared with existing technologies, the load demand forecasting method proposed in this invention can effectively adapt to multi-scale spatiotemporal dynamic changes in scenarios with a high proportion of renewable energy, significantly improving the accuracy of load forecasting and providing a more reliable decision-making basis for power system dispatching and energy management. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the load demand forecasting method based on spatiotemporal attention LSTM of the present invention. Figure 2 This is a schematic diagram illustrating the construction process of the prediction model in the single-head attention scenario of this invention; Figure 3 This is a schematic diagram of the process of training an initial prediction model based on historical data and a loss function to obtain a prediction model in this invention. Figure 4 This is a schematic diagram of the connection relationship in the load demand prediction model based on spatiotemporal attention LSTM in this invention. Detailed Implementation

[0017] To clearly illustrate the technical features of this solution, the implementation methods of this application will be described in detail below with reference to the accompanying drawings and embodiments. This will allow for a full understanding and implementation of how this application uses technical means to solve technical problems and achieve corresponding technical effects. The embodiments of this application and the various features within them can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of this application.

[0018] See Figure 1 In a first aspect, the present invention proposes a load demand forecasting method based on spatiotemporal attention LSTM, characterized in that it includes: Acquire new energy power output data and charge / discharge regulation data; Load demand forecasting results are obtained based on new energy output data, charge and discharge regulation data, and forecasting models. The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is built based on a spatiotemporal attention model and an LSTM network; historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is built based on historical data.

[0019] Beneficially, this load demand forecasting method adaptively captures the temporal and spatial correlation characteristics of multi-dimensional factors such as renewable energy output, charge-discharge regulation, and load demand changes through a spatiotemporal attention model. It also utilizes an LSTM network to learn the long-term temporal dependencies of these factors, thereby achieving accurate forecasting of system load demand. Compared with existing technologies, the load demand forecasting method proposed in this invention can effectively adapt to multi-scale spatiotemporal dynamic changes in scenarios with a high proportion of renewable energy, significantly improving the accuracy of load forecasting and providing a more reliable decision-making basis for power system dispatching and energy management.

[0020] In some embodiments, constructing a spatiotemporal attention model includes: Obtain historical data; specifically: A simulation model of a source-grid-load-storage system with a high proportion of renewable energy access is constructed. Initial historical data at different times in the source-grid-load-storage system under the scenario of high proportion of renewable energy access are obtained based on the simulation model. The initial historical data is preprocessed, including missing value imputation and data regularization, to obtain the historical data.

[0021] A sliding window approach is used to process historical data to obtain a training sequence matrix. The training sequence matrix includes an input sequence matrix and a result sequence matrix. The input sequence matrix is ​​obtained based on historical renewable energy output data and historical charge and discharge regulation data, while the result sequence matrix is ​​obtained based on historical load demand data. Input sequence matrix for: , For the first sequence in the input sequence matrix, For the second sequence in the input sequence matrix, For the first sequence in the input sequence matrix A sequence, The sequence number is the sequence index in the input sequence matrix. For the first sequence in the input sequence matrix A sequence, Given the total number of sequences in the input sequence matrix, This also represents the total number of sequence pairs in the training sequence matrix. Each sequence pair includes one sequence from the input sequence matrix and one sequence from the corresponding result sequence matrix. This also represents the total number of sequences in the resulting sequence matrix; ; In the formula, For the first sequence in the input sequence matrix The historical renewable energy output data sequence in the sequence. For the first sequence in the input sequence matrix Historical charge-discharge regulation data sequences in a series, For the first sequence in the input sequence matrix The first historical renewable energy output data in the sequence of historical renewable energy output data. For the first sequence in the input sequence matrix The second historical renewable energy output data in the sequence of historical renewable energy output data. For the first sequence in the input sequence matrix The first of the historical renewable energy output data sequences in the sequence. Historical data on new energy output The length of the sliding window. For the first sequence in the input sequence matrix The first historical charge-discharge regulation data in the sequence of historical charge-discharge regulation data. For the first sequence in the input sequence matrix The second historical charge-discharge regulation data in the historical charge-discharge regulation data sequence. For the first sequence in the input sequence matrix The first of the historical charge-discharge regulation data sequences in the sequence. Historical charge and discharge regulation data; Result sequence matrix for: , The first sequence in the resulting sequence matrix. The second sequence in the resulting sequence matrix. For the resulting sequence matrix, the first... A sequence, For the resulting sequence matrix, the first... A sequence; ; In the formula, This refers to the historical load demand data in the first sequence of the resulting sequence matrix. This refers to the historical load demand data in the second sequence of the resulting sequence matrix. For the resulting sequence matrix, the first... Historical load demand data in each sequence; Construct a spatiotemporal attention model based on the training sequence matrix; For single-head attention scenarios, the spatiotemporal attention model includes a query matrix. Value matrix Bond matrix ; Construct query matrices based on the input sequence matrices respectively Sum matrix Construct a key matrix based on the result sequence matrix ;Specifically: ; ; ; In the formula, For querying the matrix, , To query the first sequence in the matrix, To query the second sequence in the matrix, To query the first element in the matrix A sequence, To query the first element in the matrix A sequence, Let be the first linear projection matrix. The key matrix, , The first sequence in the key matrix, The second sequence in the key matrix. The first in the key matrix A sequence, The first in the key matrix A sequence, This is the second linear projection matrix. For value matrices, The third linear projection matrix, and These are the linear projection matrices of the input sequence matrix, respectively. It is the linear projection matrix of the resulting sequence matrix.

[0022] In some embodiments, constructing the initial prediction model includes: The spatiotemporal attention matrix is ​​calculated based on a spatiotemporal attention model. In fact, in the time domain, downstream load demand exhibits both trend-dependent and periodic dependence; that is, the changing trend of downstream load demand directly affects the output of the renewable energy sector. Furthermore, the diurnal periodic charging and discharging patterns of energy storage power stations also influence downstream load demand forecasting. In some embodiments, the spatiotemporal attention matrix is ​​calculated based on the spatiotemporal attention model, including: The trend term and period term are extracted from the query matrix and key matrix respectively using filters. Preferably, the Hodrick Prescott filter is used to extract the trend term and period term from the query matrix and key matrix respectively. Obtain a trend similarity matrix based on the trend terms; obtain a periodic similarity matrix based on the periodic terms; In some embodiments, the DTW algorithm is used to obtain a trend similarity matrix based on the trend term. The trend similarity matrix is ​​as follows: ; In the formula, For trend similarity matrix, for The function represents dynamic time warping calculation, used to measure the similarity between two time series. for The function represents the extraction of the trend term from a time series. for The data in the first row and first column of the middle, for The Middle The data in the first column of the row, for The data in the first row and second column, for The Middle The data in the second column of the row, for The data in the first row and first column of the middle, for The Middle The data in the first column of the row, for The data in the first row and second column, for The Middle The data in the second column of the row.

[0023] In some embodiments, the autocorrelation coefficient is calculated using Fast Fourier Transform (FFT) and Inverse Fast Fourier Transform (IFT), and a periodic similarity matrix is ​​obtained based on the trend term; the periodic similarity matrix is ​​as follows: ; In the formula, It is a periodic similarity matrix. For correlation calculation, it represents the correlation of the periodic terms in the time series. for Pe The function calculates the periodic term extraction from the time series. The time attention matrix is ​​obtained based on the trend similarity matrix and the periodic similarity matrix. In actual calculation, the trend similarity matrix and the periodic similarity matrix are first summed column-wise, and then normalized using the SoftMax function. ; ; In the formula, For periodic similarity normalization and matrix, for The function represents a matrix that represents the probability distribution of each data point in the matrix. The first row of the periodic similarity matrix The data in the column, The second row of the periodic similarity matrix The data in the column, For the periodic similarity matrix, the first... Line number The data in the column, This represents the column index of the periodic similarity matrix, and also the column index of the trend similarity matrix. For trend similarity normalization and matrix, The first row of the trend similarity matrix The data in the column, For the trend similarity matrix, the second row, the... The data in the column, For the trend similarity matrix, the first... Line number Column data; The time attention matrix is ​​obtained by combining the periodic similarity normalization matrix and the trend similarity normalization matrix. ; In the formula, This is the time attention matrix.

[0024] The linear and nonlinear spatial similarity matrices are calculated based on the query and key matrices. In some embodiments, the Pearson correlation coefficient and maximum information coefficient algorithms are used to calculate the linear and nonlinear spatial similarity matrices based on the query and key matrices. ; ; In the formula, The similarity matrix is ​​a linear space. It is the sum of the absolute values ​​of all data in the matrix, used to characterize changes in spatial correlation. This is used to calculate the linear spatial correlation matrix between process variables. It is a nonlinear spatial similarity matrix. This is used to calculate the nonlinear spatial correlation matrix between process variables; The spatial attention matrix is ​​obtained from the linear and nonlinear spatial similarity matrices; the SoftMax function is used to normalize the linear and nonlinear spatial similarity matrices respectively. ; ; In the formula, This is the linear space similarity normalization matrix. This is the nonlinear spatial similarity normalization matrix.

[0025] The spatial attention matrix is ​​obtained based on the linear spatial similarity normalization matrix and the nonlinear spatial similarity normalization matrix: ; In the formula, This is the spatial attention matrix.

[0026] Obtain the spatiotemporal attention matrix based on the temporal attention matrix and the spatial attention matrix: ; In the formula, The spatiotemporal attention matrix represents the spatiotemporal attention that downstream load demand pays to the different proportions of output from various new energy sources and the regulating effect of energy storage.

[0027] The feature encoding set is obtained based on the spatiotemporal attention matrix and the input sequence matrix: ; In the formula, For feature encoding set, For spatiotemporal attention models; For multi-head attention scenarios, when constructing the spatiotemporal attention model, the query matrix in the single-head attention scenario should be considered. Value matrix Bond matrix Each linear matrix is ​​projected multiple times based on the projection matrix of multi-head attention, assuming a total number of projections. This allows the spatiotemporal attention model to be extended to a multi-head version, thus obtaining a spatiotemporal attention model for multi-head attention scenarios.

[0028] In multi-head attention scenarios, computation within the spatiotemporal attention model is parallel: ; In the formula, For the first An independent computing unit of size The sequence number of the head. For attention, , The first The learnable parameter matrix of the size, , , Query matrix for a single attention Value matrix Dimensions Key matrix K The dimension; Ultimately, the spatiotemporal attention model in multi-head attention scenarios is obtained by concatenating multiple single attention heads: ; In the formula, For the bulls, For splicing, As the first independent computational unit, For the first An independent computing unit of size The projection matrix of multi-head attention is a linear matrix. ; An initial prediction model is constructed based on the feature encoding set and the LSTM network.

[0029] See Figure 3 In some embodiments, an initial prediction model is trained based on historical data and a loss function to obtain a prediction model, including: Step S1: Initialize the initial prediction model to obtain the current model parameter set, initial latent vectors, and initial unit states; Step S2: Let , Let the initial latent vector be the same as the latent vector of the previous time step, and let the initial unit state be the same as the unit state of the previous time step. Then, obtain the current prediction model based on the current model parameter set. Step S3: Obtain the current feature code, the current feature code is the first... Feature encoding at any given time; Step S4: Run the current prediction model based on the current feature encoding, the previous time step's latent vector, and the previous time step's cell state to obtain the current cell state and the current latent vector; Among them, the forgetting weight is obtained in the forgetting gate: ; In the formula, For the first The weight of forgetting at any given moment For activation function, For the first Feature encoding at time, i.e. Encode the current feature. As the first weight of the Forgotten Gate, for The latent vector at time t, i.e. This is the latent vector from the previous time step. As the second weight of the forgetting gate, For the bias term of the forget gate; The input weights, candidate vectors, and current cell state are obtained at the input gate: ; ; In the formula, For the first Input weights at time step The first weight of the input gate, The second weight of the input gate, For the bias term of the input gate, For the first Candidate vectors at time step 1 As the first candidate weight, As the candidate second weight, Candidate bias terms; ; In the formula, For the first The state of the cell at a given time is the current state of the cell. For cyclic multiplication calculation, For the first The cell state at time t, i.e. This refers to the cell state at the previous moment; Obtain the output weights and the current latent vector at the output gate: ; In the formula, For the first Output weights at time 10:00 As the first weight of the output gate, As the second weight of the output gate, The output model parameter set includes the first weight of the output gate, the second weight of the output gate, and the bias term of the output gate. ; In the formula, For the first The latent vector at time t, i.e. This is the current latent vector; Step S5: When hour, Let be the total number of times corresponding to the feature encoding set. Add the current latent vector to the latent vector set, set the current latent vector to the latent vector of the previous time step, and set the current cell state to the cell state of the previous time step, and repeat steps S3-S5. when When the time comes, add the current latent vector to the latent vector set and execute step S6; Figure 3 middle, ,and , An integer indicates that the latent vector set includes the first to last vector. The latent vector at time step; Step S6: Obtain the prediction result set based on the latent vector set; latent vector set , Let be the latent vector at time 1. This is the latent vector at time 2. For the first The latent vector at time step, This represents the total number of latent vectors in the latent vector set. Also the total number of moments; Step S7: Determine whether the current prediction model has converged based on the prediction result set, loss function, and current model parameter set; the loss function is: ; In the formula, For loss function, The total number of moments. For the first Historical load demand data at any given time For the first Load demand forecast results at any given time.

[0030] If the current prediction model does not converge, update the current model parameter set according to the change of the loss function, and repeat steps S3-S7. If the current prediction model converges, then a new prediction model is obtained based on the current prediction model.

[0031] Calculation example: The load demand forecasting method based on spatiotemporal attention LSTM is applied to a specific example of a source-grid-load-storage system simulation model under a typical high proportion of renewable energy access to demonstrate its technical effectiveness.

[0032] In this example, taking the simulation model of a source-grid-load-storage system under a high proportion of renewable energy access as an example, three typical renewable energy access scenarios with low, medium, and high proportions are given, and are described in detail below: Low proportion of renewable energy: renewable energy accounts for 50% of power output.

[0033] Medium proportion of new energy access: New energy accounts for 70% of power output.

[0034] High proportion of renewable energy: renewable energy accounts for 90% of power output.

[0035] In this example, the GLSTM method, MOGPR method, CNN-GRU method, and the load demand forecasting method based on spatiotemporal attention LSTM proposed in this invention are implemented respectively. The GLSTM method is the method disclosed in the literature Shahid F, Zameer A, Muneeb MA novel genetic LSTM model for wind power forecast, Energy. 223 (2021); the MOGPR method is the method disclosed in the literature Zhang RH, Gao LD, Chen XB. Optimization design of centrifugal pump impeller based on multi-output Gaussian process regression, Modern Physics Letters B. 35 (21) (2021); the CNN-GRU method is the method disclosed in the literature Zhang HT, Lo TM, Zhang WY, Chen HS, Xiong J, Yu C, Lan T, Hybrid Convolutional-gated Recurrent Unit Neural Network Model for Prediction of WeatherIndicators, Sensors and Materials. 37 (5) (2025) 2013-2026.

[0036] Two evaluation metrics were selected: root mean square error and model fit goodness of fit. ; ; In the formula, For model fit, This is the arithmetic mean of the historical load demand data in the historical load demand dataset. This is the root mean square error; The load demand forecasting results of the four methods were compared, and the evaluation results are shown in Tables 1 and 2.

[0037] Table 1 Comparison of MAE Indicators Table 2 R 2 Indicator Comparison Therefore, the load demand forecasting method based on spatiotemporal attention LSTM adopted in this invention can better adapt to the spatiotemporal coupling characteristics of source-grid-load-storage system data under proportional renewable energy access by using the idea of ​​spatiotemporal correlation calculation, thus achieving more accurate load demand forecasting. The method adopted in this invention can be directly deployed in the source-grid-load-storage system, well meeting the real-time and rapid requirements of downstream load demand forecasting.

[0038] See Figure 4 Secondly, this invention proposes a load demand prediction model based on spatiotemporal attention LSTM, including a data acquisition unit and a prediction unit. The data acquisition unit is used to acquire new energy output data and charge / discharge regulation data; The forecasting unit is used to obtain load demand forecasting results based on new energy output data, charge and discharge regulation data, and forecasting models; The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is built based on a spatiotemporal attention model and an LSTM network; historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is built based on historical data.

[0039] In some embodiments, the prediction unit includes a modeling block and a prediction block; Modeling Blocks: Used to acquire historical data, to build an initial prediction model based on the spatiotemporal attention model and LSTM network, and to train the initial prediction model based on historical data and loss function to obtain the prediction model; The forecasting block is used to obtain load demand forecasting results based on new energy output data, charge and discharge regulation data, and forecasting models.

[0040] In some embodiments, the modeling block includes a historical data acquisition module, a modeling module, and a training module; The historical data acquisition module is used to acquire historical data; The modeling module is used to build an initial prediction model based on the spatiotemporal attention model and the LSTM network; The training module is used to train an initial prediction model based on historical data and a loss function to obtain the prediction model.

[0041] See Figure 2 Thirdly, this invention proposes a method for constructing a load demand forecasting model based on spatiotemporal attention LSTM, comprising: Acquire historical data; historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. Construct a spatiotemporal attention model based on historical data; An initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; The initial prediction model is trained based on historical data and loss function to obtain the prediction model.

[0042] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions made by those skilled in the art to the technical solution of the present invention do not depart from the essence and scope of the technical solution of the present invention.

Claims

1. A load demand forecasting method based on spatiotemporal attention LSTM, characterized in that, include: Acquire new energy power output data and charge / discharge regulation data; The load demand forecast results are obtained based on the new energy output data, the charge and discharge regulation data, and the prediction model. The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is constructed based on the historical data.

2. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 1, characterized in that, Constructing the spatiotemporal attention model includes: Obtain the historical data; A training sequence matrix is ​​obtained by processing the historical data using a sliding window method. The training sequence matrix includes an input sequence matrix and a result sequence matrix. The input sequence matrix is ​​obtained based on the historical renewable energy output data and the historical charge and discharge regulation data. The result sequence matrix is ​​obtained based on the historical load demand data. The spatiotemporal attention model is constructed based on the training sequence matrix.

3. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 2, characterized in that, Constructing the initial prediction model includes: The spatiotemporal attention matrix is ​​calculated based on the spatiotemporal attention model. The feature encoding set is obtained based on the spatiotemporal attention matrix and the input sequence matrix; The initial prediction model is constructed based on the spatiotemporal attention model, the feature encoding set, and the LSTM network.

4. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 3, characterized in that, The spatiotemporal attention model includes a query matrix, a value matrix, and a key matrix; the query matrix and the value matrix are constructed based on the input sequence matrix, and the key matrix is ​​constructed based on the result sequence matrix. The spatiotemporal attention matrix calculated based on the aforementioned spatiotemporal attention model includes: The trend term and period term are extracted from the query matrix and the key matrix, respectively, using filters. Obtain a trend similarity matrix based on the trend terms; obtain a periodic similarity matrix based on the periodic terms; The time attention matrix is ​​obtained based on the trend similarity matrix and the periodic similarity matrix; The linear space similarity matrix and the nonlinear space similarity matrix are calculated based on the query matrix and the key matrix. The spatial attention matrix is ​​obtained based on the linear spatial similarity matrix and the nonlinear spatial similarity matrix; The spatiotemporal attention matrix is ​​obtained based on the temporal attention matrix and the spatial attention matrix.

5. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 4, characterized in that, The trend similarity matrix is ​​obtained based on the trend terms using the DTW algorithm.

6. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 4, characterized in that, The autocorrelation coefficient is calculated using Fast Fourier Transform and Inverse Fast Fourier Transform, and the periodic similarity matrix is ​​obtained based on the periodic terms.

7. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 4, characterized in that, The linear spatial similarity matrix and the nonlinear spatial similarity matrix are calculated using the Pearson correlation coefficient and maximum information coefficient algorithms based on the query matrix and the key matrix.

8. The load demand forecasting method based on spatiotemporal attention LSTM according to claim 3, characterized in that, The prediction model is obtained by training the initial prediction model based on the historical data and the loss function, including: Step S1: Initialize the initial prediction model to obtain the current model parameter set, initial latent vector, and initial unit state; Step S2: Let , Let the initial latent vector be the same as the latent vector of the previous time step, let the initial unit state be the same as the unit state of the previous time step, and obtain the current prediction model based on the current model parameter set; Step S3: Obtain the current feature code, wherein the current feature code is the first... The feature encoding at time step; Step S4: Run the current prediction model based on the current feature encoding, the previous time step's latent vector, and the previous time step's cell state to obtain the current cell state and the current latent vector; Step S5: When hour, Let be the total number of times corresponding to the feature encoding set. The current latent vector is added to the latent vector set, the current latent vector is set to the latent vector of the previous time step, and the current unit state is set to the unit state of the previous time step. Steps S3-S5 are then repeated. when When the current latent vector is added to the latent vector set, step S6 is executed. Step S6: Obtain the prediction result set based on the latent vector set; Step S7: Determine whether the current prediction model has converged based on the prediction result set, the loss function, and the current model parameter set; If the current prediction model does not converge, the current model parameter set is updated according to the change of the loss function, and steps S3-S7 are repeated. If the current prediction model converges, then the prediction model is obtained based on the current prediction model.

9. A load demand forecasting model based on spatiotemporal attention LSTM, characterized in that, It includes a data acquisition unit and a prediction unit; The data acquisition unit is used to acquire new energy output data and charge / discharge regulation data; The prediction unit is used to obtain load demand prediction results based on the new energy output data, the charge and discharge regulation data, and the prediction model. The prediction model is obtained by training an initial prediction model based on historical data and a loss function; the initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. The spatiotemporal attention model is constructed based on the historical data.

10. A method for constructing a load demand forecasting model based on spatiotemporal attention LSTM, characterized in that, include: Acquire historical data; the historical data includes historical renewable energy output data, historical charge and discharge regulation data, and historical load demand data. A spatiotemporal attention model is constructed based on the historical data; An initial prediction model is constructed based on a spatiotemporal attention model and an LSTM network; The initial prediction model is trained based on historical data and loss function to obtain the prediction model.

Citation Information

Patent Citations

  • User side optical storage dynamic optimization control method and system based on load prediction

    CN118472912A

  • Distributed photovoltaic output prediction and energy storage optimization method

    CN120566517A

  • CNN-LSTM-AM-based microgrid power load prediction and dynamic control method

    CN120613787A

  • Port energy and operation system cooperative load prediction method

    CN120654892A

  • Electrical load prediction method and device based on spatial-temporal correlation

    WO2025092993A1