Multi-energy system supply and storage space-time matching prediction method and system based on STGCN-LSTM attention enhancement algorithm
By using the STGCN-LSTM attention enhancement algorithm, the problems of insufficient spatiotemporal fusion and poor scenario adaptability in the spatiotemporal matching prediction of supply, storage and use of multi-energy systems in hot and humid regions are solved. It realizes high-precision, low-cost and real-time response spatiotemporal matching decision-making for supply, storage and use, and improves the operating efficiency and risk controllability of multi-energy systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies for predicting the spatiotemporal matching of energy supply, storage and use in multi-energy systems in hot and humid regions suffer from problems such as insufficient spatiotemporal fusion depth, poor scenario adaptability, weak data processing and generalization capabilities, lack of uncertainty quantification, and insufficient real-time dynamic adaptation. These issues result in low prediction accuracy, high cost, uncontrollable risks, and untimely response.
The STGCN-LSTM attention enhancement algorithm is adopted to achieve spatiotemporal matching prediction of multi-energy system supply, storage and use through spatiotemporal deep fusion, key feature enhancement, uncertainty quantification and dynamic iterative optimization. This includes data preprocessing, spatiotemporal feature extraction, attention enhancement and probability prediction, and dynamic iterative optimization of model parameters.
It improves the accuracy and reliability of spatiotemporal matching of power supply, storage and utilization in multi-energy systems, reduces model deployment and maintenance costs, enhances scenario adaptability and real-time response capabilities, can quantify uncertainty risks, and supports the efficient and low-carbon operation of multi-energy systems.
Smart Images

Figure CN121809766A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of space-time matching prediction for storage, in particular to a multi-energy system space-time matching prediction method and system based on an STGCN-LSTM attention enhancement algorithm. BACKGROUND
[0002] In high-heat and high-humidity areas, multi-energy systems of buildings integrating photovoltaic "sources", building air conditioners and electric vehicles "loads", and energy storage and cold storage "storage" become the core carriers of urban energy low-carbon transformation. As a key to the efficient operation of the system, space-time matching prediction technology for storage directly affects the efficiency of renewable energy consumption and the effect of power grid impact prevention and control, and therefore has become a research hotspot in the industry.
[0003] The closest prior art to the present application at present is mainly three types of algorithmic solutions for time series modeling, spatial modeling, and simple space-time fusion for multi-energy system prediction. Among them, time series prediction algorithms such as LSTM and GRU achieve power prediction by mining the time series dependence of historical data; spatial modeling algorithms such as GCN depict the energy correlation between regions with a spatial adjacency matrix; and simple space-time fusion algorithms such as STGCN and LSTM+GCN in series attempt to combine the first two types of algorithms, taking into account both time and space characteristics. These technologies are widely used in energy system prediction scenarios in ordinary climate zones, and the core idea is to capture the operation rules through data-driven modeling to provide decision-making reference for supply and storage matching.
[0004] However, the existing technology generally has the problems of insufficient depth of space-time fusion, poor scene adaptability, weak data processing and generalization ability, lack of uncertainty quantification, and insufficient real-time dynamic adaptation, which are specifically manifested as follows: the time and space characteristics are mostly processed separately or simply concatenated, without realizing deep interactive fusion, which cannot simultaneously depict the synergistic relationship between regional energy flow and time series dynamic fluctuation, resulting in low matching accuracy; for the special climate and random energy consumption factors in high-heat and high-humidity areas, there is a lack of key feature enhancement mechanism, and the general design is difficult to adapt to the scene specificity demand, resulting in large prediction deviation; there is a lack of unified preprocessing and fusion framework for multi-source heterogeneous data, the data value utilization rate is low, and the model parameters are fixed, which requires large-scale debugging after scene switching, resulting in high adaptation cost; there is no embedded probability modeling module, only deterministic prediction values are output, and the uncertainty risks such as meteorological fluctuations and random energy consumption behaviors in the operation process cannot be quantified, resulting in a lack of risk reference for decision-making; at the same time, there is a lack of real-time feedback iteration mechanism, which cannot quickly adjust parameters to correct the results when the system encounters sudden scenes causing prediction deviation, making it difficult to support real-time regulation and control requirements. SUMMARY
[0005] In order to overcome the above-mentioned prior art cannot meet the comprehensive demand of high heat and high humidity area building group multi-energy system for prediction accuracy, scene adaptation, risk controllability and real-time response, the application provides a multi-energy system supply and storage space-time matching prediction method and system based on STGCN-LSTM attention enhancement algorithm, through "spatial depth fusion + key feature enhancement + uncertainty quantification + dynamic iterative optimization", the operation law of multi-energy system source, load and storage in high heat and high humidity area is accurately captured, the supply and storage space-time matching prediction accuracy and decision reliability are improved, and the efficient and low-carbon operation of multi-energy system is supported.
[0006] According to an aspect of the specification, a multi-energy system supply and storage space-time matching prediction method based on STGCN-LSTM attention enhancement algorithm is provided, comprising: step S1, collecting multi-source data and preprocessing to obtain standardized time series data set and spatial adjacency matrix; step S2, based on the standardized time series data set and the spatial adjacency matrix, spatial feature extraction module and time series feature extraction module are used for spatial feature depth extraction to obtain spatial fusion feature vector; step S3, based on the spatial fusion feature vector, attention enhancement module and Bayesian probability prediction module are used for attention enhancement and probability prediction to obtain probability prediction result; step S4, based on the probability prediction result, the space-time matching degree of each region is calculated, and the corresponding space-time matching scheme is generated, the actual operation data of the multi-energy system corresponding to the space-time matching scheme is collected, and the dynamic iterative optimization of the space-time matching scheme is carried out based on the actual operation data of the multi-energy system.
[0007] Further, step S1 includes: collecting multi-source data, including original time series data and spatial topology data; the time series data includes meteorological data, energy consumption data time series data and equipment state data; the abnormal data in the original time series data is removed, and the missing data in the original time series data is filled by linear interpolation method, and the standardized time series data set is obtained after standardization processing; based on the spatial topology data, the correlation strength between regions is calculated by combining distance weight and pipe network connectivity weight, and then the spatial adjacency matrix is constructed.
[0008] Further, based on the spatial topology data, the correlation strength between regions is calculated by using distance weight and pipe network connectivity weight, and then the spatial adjacency matrix is constructed, and the corresponding calculation formula is:
[0009] ,
[0010] Among them, is the matrix element of the spatial adjacency matrix, which represents the correlation weight between the i-th region and the j-th region; is the distance between the centers of two regions, is the pipe network connectivity identifier.
[0011] Further, step S2 includes: inputting the standardized time-series dataset and spatial adjacency matrix into the spatial feature extraction module to extract spatial features, including: performing convolution operations on the standardized time-series dataset based on the spatial adjacency matrix, and using a time sliding window to extract the spatial feature changes of the features generated by the convolution operation in different time segments, and outputting a spatial feature map; inputting the spatial feature map into the time-series feature extraction module to perform deep interactive fusion of spatiotemporal features, including: mining time-series trends along the forward time direction through the forward time-series feature extraction module, mining historical dependencies along the reverse time direction through the backward time-series feature extraction module, and obtaining a spatiotemporal fusion feature vector by splicing the output features of the forward time-series feature extraction module and the backward time-series feature extraction module.
[0012] Furthermore, based on the spatial adjacency matrix, a convolution operation is performed on the standardized time-series dataset, and a time sliding window is used to extract the spatial feature changes of the features generated by the convolution operation within different time segments, outputting a spatial feature map. The corresponding formula is:
[0013] ,
[0014] Where X is the time series data matrix; These are spatial convolution weights; σ is the bias term; σ is the ReLU activation function; is the feature generated by convolution operation; A is the adjacency matrix.
[0015] Further, step S3 includes: inputting the spatiotemporal fusion feature vector into the attention enhancement module for attention enhancement, including: strengthening key features of the spatiotemporal fusion feature vector through a multi-head self-attention mechanism to obtain an attention-enhanced feature vector; inputting the attention-enhanced feature vector into the Bayesian probability prediction module for probability prediction, including: generating several sets of prediction samples through Monte Carlo simulation to fit the probability distribution of the prediction values and outputting the probability prediction results.
[0016] Furthermore, the spatiotemporal fusion feature vector is enhanced with a multi-head self-attention mechanism, including: calculating the attention weights of climate features, energy consumption features, and equipment features in the spatiotemporal fusion feature vector using an attention score formula, and assigning importance to the climate features, energy consumption features, and equipment features based on these attention weights to obtain the attention-enhanced feature vector. The attention score formula is as follows:
[0017]
[0018] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively; dk is the feature dimension; Attention weights
[0019] Further, step S4 includes: calculating the spatiotemporal matching degree of each region based on the probability prediction result, and generating a corresponding spatiotemporal matching scheme; collecting actual operating data of the multi-energy system corresponding to the spatiotemporal matching scheme, and calculating the prediction deviation based on the actual operating data of the multi-energy system and the probability prediction result; if the prediction deviation is less than or equal to a preset deviation, continuing to execute the current spatiotemporal matching scheme; if the prediction deviation is greater than the preset deviation, updating the convolution weights of the spatial feature extraction module and the hidden layer weights of the temporal feature extraction module using the gradient descent method, and re-executing step S2.
[0020] According to one aspect of this invention, a spatiotemporal matching prediction system for a multi-energy system based on the STGCN-LSTM attention enhancement algorithm is provided, comprising: a data acquisition and preprocessing module for acquiring and preprocessing multi-source data to obtain a standardized time-series dataset and a spatial adjacency matrix; a spatiotemporal feature depth extraction module for performing spatiotemporal feature depth extraction based on the standardized time-series dataset and the spatial adjacency matrix through a spatial feature extraction module and a temporal feature extraction module to obtain a spatiotemporal fusion feature vector; an attention enhancement and probability prediction module for performing attention enhancement and probability prediction based on the spatiotemporal fusion feature vector through an attention enhancement module and a Bayesian probability prediction module to obtain a probability prediction result; and a spatiotemporal matching decision module for calculating the spatiotemporal matching degree of each region based on the probability prediction result, generating a corresponding spatiotemporal matching scheme, acquiring actual operating data of the multi-energy system corresponding to the execution of the spatiotemporal matching scheme, and performing dynamic iterative optimization of the spatiotemporal matching scheme based on the actual operating data of the multi-energy system.
[0021] According to one aspect of the present invention, a non-transitory computer-readable storage medium is provided, the non-transitory computer-readable storage medium storing computer instructions that cause the computer to execute the aforementioned spatiotemporal matching prediction method for multi-energy system power supply and storage based on the STGCN-LSTM attention enhancement algorithm.
[0022] The above technical solution, through "deep spatiotemporal fusion + key feature enhancement + uncertainty quantification + dynamic iterative optimization", accurately captures the operating rules of the source, load and storage of multi-energy systems in high-heat and high-humidity areas, and supports spatiotemporal matching decision-making for supply, storage and use: (1) Data preprocessing: First, the multi-source data is cleaned and standardized, and at the same time, a regional association adjacency matrix is constructed to eliminate data noise and dimensional differences, laying the foundation for feature extraction; (2) Spatiotemporal feature dual-dimensional extraction: The spatial association of energy coupling / complementarity between regions is modeled through the time series feature extraction module (i.e. STGCN module), and then the long-term and short-term dependencies of power time series fluctuations are captured through the time series feature extraction module (i.e. bidirectional LSTM module), realizing spatiotemporal integration. Deep interaction and fusion of features break through the limitations of traditional algorithm "spatiotemporal separation"; (3) Attention enhancement focuses on key points: introduce multi-head self-attention mechanism, dynamically give higher weight to specific features of high heat and humidity climate, random energy use and other scenarios, suppress irrelevant interference and improve scenario adaptability; (4) Probability quantification controls risks: embed Bayesian neural network, quantify uncertainties such as meteorological fluctuations and random energy use through Monte Carlo simulation, output probability prediction results, avoid decision risk of deterministic prediction; real-time iterative dynamic adaptation: compare the predicted power with the actual power at preset time intervals, update the model parameters dynamically through gradient descent method, correct deviation, ensure long-term prediction accuracy is stable, and support real-time control of multi-energy system.
[0023] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0024] (1) Deeper spatiotemporal fusion and significantly improved matching accuracy: Traditional methods usually process spatiotemporal features separately or simply splice them together, making it difficult to simultaneously depict the energy correlation and temporal variation patterns between regions. This scheme adopts a collaborative architecture of "STGCN modeling spatial coupling relationships + bidirectional LSTM mining long- and short-term temporal dependencies", which enables deep fusion of spatial and temporal features at the bottom layer of the model, fundamentally breaking through the limitation of "spatiotemporal separation". In practical applications, the global spatiotemporal matching accuracy reaches a high level, effectively avoiding the problem of local energy supply idleness or overload, and is significantly better than the coarse-grained matching effect of existing technologies.
[0025] (2) Enhanced scene adaptability and more accurate key feature identification: General-purpose models often struggle to cope with special environments such as high heat and humidity, and lack sufficient sensitivity to key variables such as temperature and humidity. This solution introduces a multi-head self-attention mechanism, which can dynamically focus on the core influencing factors in different scenarios, ensuring that the weights of key features meet actual needs. At the same time, by dynamically adjusting the model parameters, it can quickly adapt to different types of building complexes such as office, commercial, and industrial buildings. The decrease in prediction accuracy after scene switching is controlled within a reasonable range, effectively solving the problems of weak generalization ability and large prediction bias in traditional methods.
[0026] (3) Higher data processing efficiency and significantly reduced model deployment costs: Existing methods lack a unified data fusion framework and have fixed model parameters, resulting in extensive retraining required when migrating across scenarios. This solution constructs a full-process preprocessing mechanism of "data cleaning - standardization - spatial adjacency matrix generation", which effectively eliminates the dimensional differences and noise interference of multi-source heterogeneous data. Combined with the dynamic parameter update mechanism in the feedback iteration, the model can quickly adapt to new scenarios without repeated training, greatly reducing deployment and maintenance costs, while improving data utilization efficiency.
[0027] (4) More controllable decision-making risks, achieving uncertainty quantification for the first time: Traditional prediction models only provide a single deterministic result and cannot assess the reliability of predictions. This solution embeds a Bayesian probability module, which can quantify uncertainties such as weather fluctuations and energy consumption behavior, and output prediction results with confidence intervals. Verification has shown that the risk assessment accuracy meets the expected standard, the dispatching error rate has decreased significantly, providing a reliable decision-making basis for energy dispatching and filling a technological gap in this field.
[0028] (5) Enhanced real-time response capability to meet dynamic control requirements: Most existing models are static in structure and lack the ability to correct actual operational deviations in real time. This solution designs a periodic feedback iteration mechanism to continuously compare predicted and measured values. Once the deviation exceeds a preset threshold, online parameter updates are triggered. The entire correction process is rapid, ensuring that model predictions can quickly return to the accurate range in scenarios such as sudden load changes or extreme weather, effectively supporting the real-time optimization and control of multi-energy systems. Attached Figure Description
[0029] Fig. 1 The flowchart below shows the overall architecture of a spatiotemporal matching prediction method for multi-energy system power supply and storage based on the STGCN-LSTM attention enhancement algorithm, which is provided in an embodiment of the present invention.
[0030] Fig. 2 The flowchart illustrates the steps of a spatiotemporal matching prediction method for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm, as provided in this embodiment of the invention. Detailed Implementation
[0031] The technical solutions of various embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0033] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows for communication; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0034] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.
[0035] Please refer to the appendix. Figs. 1-2 This invention provides a method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm, comprising the following steps:
[0036] Step S1: Collect multi-source data and perform preprocessing.
[0037] In step S1, the multi-source data includes raw time-series data and spatial topology data. The raw time-series data consists of source-load-storage data for each region, including meteorological data, energy consumption data, and equipment status data. This invention collects the above four types of input data through a multi-source data interface. Meteorological data includes, but is not limited to, temperature, humidity, and irradiance (sampling frequency 15 min / time); energy consumption data includes, but is not limited to, building electrical load, air conditioning cooling load, and electric vehicle charging pile power (sampling frequency 1 min / time); equipment status data includes, but is not limited to, energy storage SOC, cold storage equipment capacity, and photovoltaic inverter efficiency (sampling frequency 5 min / time); spatial topology data (i.e., static structured data) includes, but is not limited to, building functional zoning boundaries, energy network connection relationships, and equipment distribution coordinates.
[0038] The following section will further describe the steps for preprocessing multi-source data:
[0039] The first step is data cleaning: The 3σ principle is used to remove outliers caused by meteorological extremes or equipment malfunctions from the original time-series data. Missing data is then filled in using linear interpolation to ensure data integrity ≥99%. The 3σ principle refers to the following: for a normally distributed dataset (in this application, the original time-series data), the data values are mainly concentrated within the range of "mean ± 3 standard deviations (μ ± 3σ)," covering approximately 99.73% of the normal data. The probability of data exceeding this range (i.e., data < μ - 3σ or data > μ + 3σ) is only 0.27%. Such data is considered outliers and can be removed or processed separately. Here, μ (mean) is the average level of the dataset, and σ (standard deviation) is a measure of data dispersion (the larger the σ, the more volatile the data).
[0040] The second step is standardization: All time-series data after data cleaning are converted into standardized data within the [0, 1] interval, eliminating dimensional differences between different time-series data (such as temperature in °C, power in kW), and converting them into standardized values within the [0, 1] interval. The corresponding formula is:
[0041] ,
[0042] Where x represents the time-series data after data cleaning. , These are the minimum and maximum values among all time-series data after data cleaning; Standardized time series data are obtained through standardization processing, and all standardized time series data constitute a standardized time series dataset.
[0043] The third step is the construction of the spatial adjacency matrix: Based on spatial topology data, a two-factor method of "distance weight + network connectivity weight" is used to calculate the correlation strength between regions, constructing an N×N spatial adjacency matrix A (where N is the number of building cluster regions) to characterize the "static correlation strength" between different regions. The spatial adjacency matrix A consists of all... Together constitute This represents the specific value of the intersection position of the i-th row and j-th column in the spatial adjacency matrix A. The calculation formula is:
[0044] ,
[0045] in, Let be the matrix element of the spatial adjacency matrix A, representing the association weight between the i-th region and the j-th region; The distance between the centers of the two regions. This is the identifier for pipeline connectivity; it is set to 1 if the pipeline is connected, and 0 otherwise.
[0046] Step S2: Based on the standardized time-series dataset and spatial adjacency matrix, spatiotemporal features are deeply extracted through the spatial feature extraction module and the temporal feature extraction module to obtain the spatiotemporal fusion feature vector.
[0047] In step S2, the standardized time-series dataset and spatial adjacency matrix are input to the spatial feature extraction module for spatial feature extraction. This includes: performing convolution operations on the source-load-storage data of each region in the standardized time-series dataset based on the spatial adjacency matrix, and using a time sliding window to extract the spatial feature changes of the features generated by the convolution operation in different time segments, outputting a spatial feature map. Next, the spatial feature map is input to the time-series feature extraction module for deep interactive fusion of spatiotemporal features. This includes: mining the time-series trend along the forward time direction through the forward time-series feature extraction module, mining historical dependencies along the reverse time direction through the backward time-series feature extraction module, and obtaining a spatiotemporal fusion feature vector by concatenating the output features of the forward and backward time-series feature extraction modules.
[0048] (1) Spatial Feature Extraction Module (STGCN Module (i.e., Spatial-Temporal Graph Convolutional Network)): The STGCN module achieves spatial feature extraction through a dual operation of "spatial convolution + temporal sliding window". The spatial convolution step performs convolution operations on the source-load storage data of each region in the standardized time-series dataset based on the spatial adjacency matrix, and the formula is:
[0049] ,
[0050] Where X is the time series data matrix (that is, the structured mathematical carrier formed by organizing the "standardized time series dataset" according to the "region × time × feature" dimension, which is the "standardized input format" adapted to the convolution operation of the STGCN module, and corresponds to the calculation object of the spatial convolution formula in the technical solution). These are spatial convolution weights; σ is the bias term; σ is the ReLU activation function, which captures the energy complementarity relationship between regions (such as the spatial correlation between photovoltaic surplus areas and charging load concentrated areas). The features generated by convolution (i.e., features that integrate "regional spatial correlation" and "source-load-storage data characteristics") are represented by A, and A is the spatial adjacency matrix. The time sliding window stage uses a preset duration (e.g., 1 hour) to extract the spatial feature changes of the features generated by convolution within different time segments, outputting N×T× Spatial feature map of dimensionality (N is the number of regions, T is the time step, (For spatial feature dimensions).
[0051] (2) Temporal Feature Extraction Module (Bidirectional LSTM Module (i.e., Long Short-Term Memory Network)): The temporal feature extraction module consists of two parallel units: a forward temporal feature extraction module and a backward LSTM module. The forward LSTM mines temporal trends (e.g., the growth pattern of air conditioning load with increasing temperature in the next 24 hours) along the positive time direction (from history to the future), while the backward LSTM mines historical dependencies (e.g., load fluctuation characteristics under high-temperature weather in the same period of history) along the negative time direction. The N×T× value is obtained by splicing the outputs of the two units. Dimensional spatiotemporal fusion feature vector ( (as a spatiotemporal fusion feature dimension), to achieve deep interactive fusion of spatiotemporal features.
[0052] Step S3: Based on the spatiotemporal fusion feature vector, attention enhancement and probability prediction are performed through the attention enhancement module and the Bayesian probability prediction module to obtain the probability prediction result.
[0053] In step S3, the spatiotemporal fusion feature vector is input to the attention enhancement module for attention enhancement, including: strengthening key features of the spatiotemporal fusion feature vector through a multi-head self-attention mechanism, and calculating the attention weights of each dimension of the feature vector to output the attention-enhanced feature vector. Next, the attention-enhanced feature vector is input to the Bayesian probability prediction module for probability prediction, including: generating several sets of prediction samples through Monte Carlo simulation to fit the probability distribution of the predicted values, and outputting the probability prediction result.
[0054] (1) Attention Enhancement Module: A multi-head self-attention mechanism is introduced to enhance key features of the spatiotemporal fusion feature vector. By calculating the attention weights of each dimension of the feature vector, the core influencing factors of high-heat and high-humidity scenarios are dynamically focused. Specifically, three attention heads are constructed to focus on climate features (temperature, humidity), energy consumption features (air conditioning load increment, charging power), and equipment features (energy storage SOC, photovoltaic output). The attention weights of climate features, energy consumption features, and equipment features in the spatiotemporal fusion feature vector are calculated using the attention score formula. The importance of climate features, energy consumption features, and equipment features is assigned to the attention weights to obtain the attention-enhanced feature vector. The attention score formula is as follows:
[0055] ,
[0056] Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively; As a feature dimension, key features such as high temperature and high humidity load increment are assigned a weight of ≥0.7, while irrelevant features are assigned a weight of ≤0.3; These are attention weights normalized using the softmax function. It should be noted that the three types of features (i.e., climate features, energy consumption features, and equipment features) are the actual information content, and the three matrices (i.e., query matrix, key matrix, and value matrix) are containers for this actual information content. The three matrices share a set of query matrix, key matrix, and value matrix.
[0057] (2) Bayesian Probabilistic Prediction Module: The attention-enhanced feature vector is input into the Bayesian neural network, and 1000 sets of prediction samples are generated through Monte Carlo simulation. The probability distribution of the predicted values is fitted, and two core results are output: ① Predicted power points for power supply, storage and consumption (source power supply, load power consumption, and storage regulation power at the granular level of the next 24 hours and every 10 minutes); ② 95% confidence interval (such as the predicted value of photovoltaic output). ±8%, predicted air conditioning load ±10%), to achieve uncertainty quantification.
[0058] Step S4: Calculate the spatiotemporal matching degree of each region based on the probability prediction results, generate the corresponding spatiotemporal matching scheme, collect the actual operation data of the multi-energy system corresponding to the spatiotemporal matching scheme, and perform dynamic iterative optimization of the spatiotemporal matching scheme based on the actual operation data of the multi-energy system.
[0059] In step S4, the spatiotemporal matching degree of each region is calculated based on the probability prediction results, and a corresponding spatiotemporal matching scheme is generated; the actual operating data of the multi-energy system corresponding to the spatiotemporal matching scheme is collected, and the prediction deviation is calculated based on the actual operating data of the multi-energy system and the probability prediction results; if the prediction deviation is less than or equal to the preset deviation, the current spatiotemporal matching scheme is continued to be executed; if the prediction deviation is greater than the preset deviation, the convolution weights of the spatial feature extraction module and the hidden layer weights of the temporal feature extraction module are updated by the gradient descent method, and step S2 is re-executed.
[0060] (1) Spatiotemporal matching decision: Based on the probability prediction results, the spatiotemporal matching degree of each region is calculated, and the corresponding formula is:
[0061] ,
[0062] in, Let be the available power supply for region i at time t. Predict the energy consumption power of region j at time t. and All of these are derived from the power supply, storage, and utilization point prediction values mentioned earlier. This represents the spatiotemporal matching degree of each region. In this embodiment, when... When ≥1.05, a matching scheme is generated for "energy supply area i to energy consumption area j"; when 0.95 < When <1.05, maintain the current energy allocation; when When the value is ≤0.95, a matching scheme of "calling the energy storage device in region j to release energy" is generated, and the region-level spatiotemporal matching decision instruction is finally output. It is understandable that the corresponding spatiotemporal matching scheme generated according to the spatiotemporal matching degree of each region can be adjusted according to actual needs, and no limitation is imposed here.
[0063] (2) Real-time feedback iteration: Collect actual operating data of the multi-energy system at preset intervals (e.g., 10 minutes) and calculate the prediction deviation ε. The corresponding formula is:
[0064] ,
[0065] in, This is the actual power. To predict power, in this embodiment, if ε≤10%, the current matching scheme is continued; if ε>10%, the convolutional weights of STGCN are updated using gradient descent. The hidden layer weights W of the LSTM module are used to re-execute the feature extraction and prediction process, enabling the algorithm to dynamically adapt to changes in system operating status and ensuring stable long-term prediction accuracy. Understandably, the preset bias can be adjusted according to actual needs and is not limited here. It should be noted that the hidden layer weights W of the LSTM module are core parameters in the bidirectional LSTM module used to pass and filter temporal features. Their role is to regulate the degree of influence of historical time-series information on the current prediction result, supporting the forward LSTM in exploring future trends and the backward LSTM in capturing historical dependencies.
[0066] Based on the same technical concept as the aforementioned embodiments, this invention also provides a spatiotemporal matching prediction system for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm, comprising: a data acquisition and preprocessing module for acquiring and preprocessing multi-source data to obtain a standardized time-series dataset and a spatial adjacency matrix; a spatiotemporal feature depth extraction module for performing spatiotemporal feature depth extraction based on the standardized time-series dataset and the spatial adjacency matrix through a spatial feature extraction module and a temporal feature extraction module to obtain a spatiotemporal fusion feature vector; an attention enhancement and probability prediction module for performing attention enhancement and probability prediction based on the spatiotemporal fusion feature vector through an attention enhancement module and a Bayesian probability prediction module to obtain a probability prediction result; and a spatiotemporal matching decision module for calculating the spatiotemporal matching degree of each region based on the probability prediction result, generating a corresponding spatiotemporal matching scheme, acquiring actual operating data of the multi-energy system corresponding to the execution of the spatiotemporal matching scheme, and performing dynamic iterative optimization of the spatiotemporal matching scheme based on the actual operating data of the multi-energy system.
[0067] Based on the same technical concept as the foregoing embodiments, the present invention also provides a non-transitory computer-readable storage medium storing computer instructions that cause the computer to execute the aforementioned spatiotemporal matching prediction method for multi-energy system power supply and storage based on the STGCN-LSTM attention enhancement algorithm.
[0068] In summary, to address the shortcomings of existing technologies in meeting the comprehensive requirements of multi-energy systems in high-heat and high-humidity areas for prediction accuracy, scenario adaptability, risk control, and real-time response, this invention proposes a spatiotemporal matching prediction method for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm. This prediction method can deeply integrate spatiotemporal features, accurately capture key factors, efficiently process multi-source data, and has dynamic adaptability. The core principle is to accurately capture the operating rules of the source, load and storage of multi-energy systems in high-heat and high-humidity areas through "deep spatiotemporal fusion + key feature enhancement + uncertainty quantification + dynamic iterative optimization", and support spatiotemporal matching decision-making for supply, storage and use: (1) Data preprocessing: First, clean and standardize multi-source data such as meteorology, energy use, equipment status and spatial topology, and at the same time construct a regional association adjacency matrix to eliminate data noise and dimensional differences, laying the foundation for feature extraction; (2) Two-dimensional extraction of spatiotemporal features: Model the spatial association of energy coupling / complementarity between regions through the time series feature extraction module (i.e. STGCN module), and then capture the long-term and short-term dependencies of power time series fluctuations through the time series feature extraction module (i.e. bidirectional LSTM module), realize the deep interaction and fusion of spatiotemporal features, and break through the traditional algorithm. "Spatial-temporal separation" limitations; (3) Attention enhancement to focus on key points: introduce a multi-head self-attention mechanism, dynamically assign higher weights to specific features of hot and humid climate (temperature, humidity), random energy consumption and other scenarios, suppress irrelevant interference, and improve scenario adaptability; (4) Probability quantification to control risks: embed Bayesian neural network, quantify uncertainties such as weather fluctuations and random energy consumption through Monte Carlo simulation, output prediction results with 95% confidence interval, avoid decision-making risks of deterministic prediction; Real-time iterative dynamic adaptation: compare the predicted power with the actual power at preset intervals, and dynamically update the model parameters (i.e., the convolution weights of the spatial feature extraction module and the hidden layer weights of the temporal feature extraction module) through gradient descent method, correct deviations, ensure long-term prediction accuracy stability, and support real-time control of multi-energy systems.
[0069] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the technical solutions of the embodiments of the present invention.
Claims
1. A spatiotemporal matching prediction method for power supply, storage, and utilization in a multi-energy system based on the STGCN-LSTM attention enhancement algorithm, characterized in that, include: Step S1: Collect multi-source data and preprocess it to obtain a standardized time-series dataset and a spatial adjacency matrix; Step S2: Based on the standardized time series dataset and spatial adjacency matrix, perform deep extraction of spatiotemporal features through the spatial feature extraction module and the temporal feature extraction module to obtain a spatiotemporal fusion feature vector; Step S3: Based on the spatiotemporal fusion feature vector, attention enhancement and probability prediction are performed through the attention enhancement module and the Bayesian probability prediction module to obtain the probability prediction result; Step S4: Calculate the spatiotemporal matching degree of each region based on the probability prediction results, generate the corresponding spatiotemporal matching scheme, collect the actual operating data of the multi-energy system corresponding to the spatiotemporal matching scheme, and perform dynamic iterative optimization of the spatiotemporal matching scheme based on the actual operating data of the multi-energy system.
2. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 1, characterized in that, Step S1 includes: Collect multi-source data, including raw time-series data and spatial topology data; the time-series data includes meteorological data, energy consumption time-series data, and equipment status data; Abnormal data in the original time series data are removed, and missing data in the original time series data are filled in by linear interpolation. After standardization, a standardized time series dataset is obtained. Based on the spatial topology data, the correlation strength between regions is calculated by combining distance weight and pipeline connectivity weight, and then a spatial adjacency matrix is constructed.
3. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 2, characterized in that, Based on the aforementioned spatial topology data, the inter-regional correlation strength is calculated using distance weight and network connectivity weight, thereby constructing a spatial adjacency matrix. The corresponding calculation formula is as follows: , in, The matrix elements are the spatial adjacency matrix elements, representing the association weights between the i-th region and the j-th region; The distance between the centers of the two regions. This is an identifier for pipeline connectivity.
4. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 1, characterized in that, Step S2 includes: The standardized time-series dataset and spatial adjacency matrix are input into the spatial feature extraction module to extract spatial features, including: performing convolution operation on the standardized time-series dataset based on the spatial adjacency matrix, using a time sliding window to extract the spatial feature changes of the features generated by the convolution operation in different time segments, and outputting a spatial feature map; The spatial feature map is input into the temporal feature extraction module to perform deep interactive fusion of spatiotemporal features, including: mining temporal trends along the positive time direction through the forward temporal feature extraction module, mining historical dependencies along the negative time direction through the backward temporal feature extraction module, and obtaining a spatiotemporal fusion feature vector by splicing the output features of the forward and backward temporal feature extraction modules.
5. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 4, characterized in that, Based on the spatial adjacency matrix, a convolution operation is performed on the standardized time-series dataset. A time sliding window is used to extract the spatial feature changes of the features generated by the convolution operation within different time segments, and a spatial feature map is output. The corresponding formula is: , Where X is the time series data matrix; These are spatial convolution weights; σ is the bias term; σ is the ReLU activation function; is the feature generated by convolution operation; A is the adjacency matrix.
6. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 1, characterized in that, Step S3 includes: The spatiotemporal fusion feature vector is input into the attention enhancement module to perform attention enhancement, including: strengthening the key features of the spatiotemporal fusion feature vector through a multi-head self-attention mechanism to obtain the attention-enhanced feature vector; The attention-enhanced feature vector is input into the Bayesian probability prediction module for probability prediction, including: generating several sets of prediction samples through Monte Carlo simulation to fit the probability distribution of the prediction values and outputting the probability prediction results.
7. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 6, characterized in that, The spatiotemporal fusion feature vector is enhanced with a multi-head self-attention mechanism, including: calculating the attention weights of climate features, energy consumption features, and equipment features in the spatiotemporal fusion feature vector using an attention score formula, and assigning importance to the climate features, energy consumption features, and equipment features based on these attention weights to obtain the attention-enhanced feature vector. The attention score formula is as follows: Where Q, K, and V are the query matrix, key matrix, and value matrix, respectively; dk is the feature dimension; This represents the attention weight.
8. The method for predicting the spatiotemporal matching of power supply and storage for multi-energy systems based on the STGCN-LSTM attention enhancement algorithm according to claim 1, characterized in that, Step S4 includes: Based on the probability prediction results, the spatiotemporal matching degree of each region is calculated, and the corresponding spatiotemporal matching scheme is generated. Collect actual operating data of the multi-energy system corresponding to the spatiotemporal matching scheme, and calculate the prediction deviation based on the actual operating data of the multi-energy system and the probability prediction results; If the prediction deviation is less than or equal to the preset deviation, continue to execute the current spatiotemporal matching scheme; if the prediction deviation is greater than the preset deviation, update the convolution weights of the spatial feature extraction module and the hidden layer weights of the temporal feature extraction module using the gradient descent method, and re-execute step S2.
9. A spatiotemporal matching prediction system for power supply and storage of multi-energy systems based on the STGCN-LSTM attention enhancement algorithm, characterized in that, include: The data acquisition and preprocessing module is used to acquire multi-source data and preprocess it to obtain a standardized time-series dataset and a spatial adjacency matrix. The spatiotemporal feature depth extraction module is used to perform spatiotemporal feature depth extraction based on the standardized time series dataset and spatial adjacency matrix, through the spatial feature extraction module and the time series feature extraction module, to obtain a spatiotemporal fusion feature vector; The attention enhancement and probability prediction module is used to perform attention enhancement and probability prediction based on the spatiotemporal fusion feature vector through the attention enhancement module and the Bayesian probability prediction module to obtain the probability prediction result. The spatiotemporal matching decision module is used to calculate the spatiotemporal matching degree of each region based on the probability prediction results, generate corresponding spatiotemporal matching schemes, collect actual operating data of the multi-energy system corresponding to the spatiotemporal matching schemes, and perform dynamic iterative optimization of the spatiotemporal matching schemes based on the actual operating data of the multi-energy system.
10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer instructions that cause the computer to execute the spatiotemporal matching prediction method for multi-energy system power supply and storage based on the STGCN-LSTM attention enhancement algorithm as described in any one of claims 1 to 8.