A micro-grid multi-scenario typical day generation method based on cross attention mechanism

By using a deep network architecture with a cross-attention mechanism, deep spatiotemporal features of microgrid data are extracted and combined with a dynamic noise model. This solves the problems of poor cluster representativeness and loss of high-frequency physical features in typical daily generation of microgrids, and realizes high-quality multi-scenario data reconstruction, supporting high-frequency operation simulation and extreme condition testing of microgrids.

CN122432993APending Publication Date: 2026-07-21CHINA UNIV OF MINING & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA UNIV OF MINING & TECH
Filing Date
2026-04-27
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively extract deep spatiotemporal features when generating typical days for microgrids, resulting in poor cluster representativeness and loss of high-frequency physical features. This fails to meet the needs of high-frequency operation simulation and extreme condition testing for microgrid equipment.

Method used

A deep network architecture based on cross-attention mechanism is adopted, which combines TCN and LSTM branches to extract local high-frequency fluctuations and global trend features. These features are then fused through cross-attention mechanism and combined with a dynamic noise model for high-resolution reconstruction to ensure the true physical characteristics of the data.

Benefits of technology

It achieves adaptive and accurate capture of deep spatiotemporal features, reconstructs high-quality multi-scenario data, and supports refined multi-energy complementarity and extreme condition simulation of microgrids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432993A_ABST
    Figure CN122432993A_ABST
Patent Text Reader

Abstract

The application discloses a micro-grid multi-scene typical day generation method based on a cross attention mechanism and belongs to the field of micro-grid energy management and planning operation. The method adopts a time convolution and a long short-term memory double-branch network, combines a cross attention mechanism to deeply fuse local high-frequency fluctuations and global time sequence evolution characteristics of data, and accurately selects a typical day by optimizing a feature space in a four-season set. In a high-frequency reconstruction stage, the system respectively injects Gaussian gust noise and a shape-preserving interpolation trend noise into wind and light output to simulate real meteorological transients, and simultaneously implements seasonal adaptive scaling of multiple loads under the constraint of a system multi-energy attribute. The method completely breaks the data "oversmoothing" limitation caused by a traditional interpolation algorithm, and effectively restores real physical high-frequency impact characteristics of multi-energy assets of the micro-grid under complex meteorological conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of microgrid energy management and planning operation technology, specifically involving a method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism. Background Technology

[0002] With the global energy structure transitioning towards clean and low-carbon technologies and the rapid development of distributed generation technologies, the penetration rate of renewable energy sources, such as wind power and photovoltaics, in combined power, heat, and hydrogen microgrids is increasing. However, the strong randomness and weather-coupled characteristics of such energy output, as well as the nonlinear energy consumption behavior of various heterogeneous loads, pose serious challenges to the coordinated planning and operation simulation of microgrid generation, grid, load, and storage. In the system evaluation and capacity configuration of microgrids, high-quality "typical daily" operation scenario data is the core foundation for characterizing the system's annual boundary conditions and ensuring the reliability and economy of planning schemes.

[0003] In traditional typical day generation and scene construction, static clustering algorithms based on Euclidean distance, such as K-means and FCM, are commonly used. However, these conventional methods often rely only on the basic statistical characteristics of power sequences or shallow temporal information for similarity measurement. If they are directly used to process massive, high-dimensional microgrid operation data with complex spatiotemporal coupling relationships throughout the year, they are prone to ignoring deep temporal dynamic features, resulting in the selected typical days lacking true physical representativeness.

[0004] To address this, a multi-scenario typical day generation scheme combining meteorological solar term division and data dimensionality reduction has emerged. This typically involves extracting features using principal component analysis or a simple deep autoencoder before clustering. Meanwhile, to meet the needs of high-frequency operation simulation for microgrid devices, existing technologies usually select hourly typical days, employ conventional interpolation algorithms to improve data resolution, and scale the load curve by a fixed ratio to simulate energy consumption differences across seasons.

[0005] Although existing multi-scenario clustering and resolution enhancement strategies meet the needs of basic simulation to some extent, they still face the following challenges in microgrid extreme condition testing and refined multi-energy complementary engineering applications: 1. Insufficient deep spatiotemporal feature extraction and poor cluster representativeness: Existing technologies often separate local transient fluctuations from global evolution trends when extracting sequence features. Faced with complex micronetwork environments with multivariate coupling, traditional methods struggle to adaptively measure the correlation weights between features of different dimensions, failing to achieve accurate similarity measurement from a global perspective. This results in the typical days selected for clustering often deviating from the true typical operating trajectory of the system.

[0006] 2. Loss of High-Frequency Physical Characteristics and Distortion of Multi-Energy Regulation Characteristics: In existing high-frequency data reconstruction schemes, conventional methods such as interpolation significantly obliterate the physical high-frequency impact characteristics of wind and solar power output, resulting in overly smooth high-resolution data. Furthermore, for multi-energy complementary microgrids involving electricity, heat, and hydrogen, traditional methods for statically and uniformly scaling the load completely deviate from the actual environmental thermodynamics and hydrogen utilization physics, neglecting the differentiated nonlinear evolution correlations between electricity, heat, and hydrogen loads in different seasons. This essentially limits the depth and reliability of the generated data in high-frequency control and emergency response verification of microgrid equipment. Summary of the Invention

[0007] The purpose of this invention is to provide a method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism. It directly utilizes neural networks to autonomously extract deep fusion features of temporal fluctuations and global trends from massive operational data with random seasonal meteorological characteristics. Furthermore, it introduces a dynamic noise model that conforms to actual physical characteristics during the high-frequency data reconstruction stage, thereby restoring the real operating environment of the microgrid to the greatest extent possible.

[0008] To achieve the above objectives, the present invention provides the following technical solution: a method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism, comprising the following specific steps: S1. Data Acquisition and Preprocessing: Read the annual historical operation data of the electrothermal hydrogen microgrid, interpolate and fill in missing values, and convert the power units of photovoltaic and other equipment to standard units (e.g., kW). Perform range normalization on the data and construct a multidimensional environmental state tensor.

[0009] S2. Deep Feature Extraction Based on Cross-Attention: Construct a deep network architecture including TCN and LSTM branches. The TCN branch uses one-dimensional convolution to capture local high-frequency fluctuations and uses them as the key and value of the attention mechanism; the LSTM branch extracts the global state evolution trend over 24 hours as the query. Weights are calculated through the cross-attention mechanism and combined with residual connections to output a high-dimensional fused daily feature vector.

[0010] S3. Selection of typical days for each season based on time-series features: The annual data is divided into four subsets: spring, summer, autumn and winter, according to the physical solar terms. The distance from all samples in each season to its center is calculated in the extracted high-dimensional feature space. The actual operating day with the smallest distance is selected as the benchmark typical day for that season.

[0011] S4. High-resolution physical reconstruction and dynamic load adjustment: The hourly benchmark typical day is extended to minute-level data through algorithms such as conformal cubic interpolation (pchip). Customized physical constraints are applied according to different energy attributes: Gaussian smoothed gust noise is applied to wind power injection and upper and lower limits are set for output; trend noise with extended period is applied to photovoltaic utilization to simulate cloud shading and non-negative constraints are applied; seasonal dynamic rate adjustment factors are introduced for electricity and hydrogen loads to reconstruct high-resolution operating data of microgrids that approximate real operating conditions.

[0012] Preferably, in step S2, a high-dimensional daily feature vector is output through a cross-attention mechanism. The specific steps are as follows: S21. Map the local temporal fluctuation features extracted by the Temporal Convolutional Network (TCN) into a key and value vector for the attention mechanism; S22. Map the system global state features extracted by the Long Short-Term Memory (LSTM) network into a query vector; S23. Calculate the approximate dot product score between the query vector and the key vector, normalize it using the Softmax function to obtain the attention weight, and apply the attention weight to the value vector to obtain the cross feature output. S24. Introduce residual connections, add the cross-feature output to the global state features of the system, and output the final feature vector after dimensionality reduction by a fully connected layer.

[0013] Preferably, the minute-level high-resolution data in step S4 includes high-resolution data of physically reconstructed wind power and photovoltaic output.

[0014] Preferably, the high resolution of the physically reconstructed wind power output specifically refers to: Wind power reconfiguration involves superimposing physical gust noise, which has been Gaussian smoothed, onto a minute-level interpolation curve. The noise amplitude is proportional to the wind turbine output, and an absolute value truncation threshold and physical maximum / minimum output boundary constraints are set.

[0015] Preferably, the high resolution of the physically reconstructed photovoltaic output specifically refers to: Photovoltaic reconfiguration employs a conformal cubic interpolation algorithm to smooth the sparse noise of photovoltaics, generating a wave-like undulating trend noise that simulates the slow obstruction of clouds. This trend noise is then proportionally superimposed onto the photovoltaic output curve, and a non-negative constraint is applied.

[0016] Preferably, the adaptive scaling of the load based on seasonal characteristics in step S4 includes adaptive scaling of multiple loads: wherein the electrical load is uniformly scaled according to a preset amplification factor and superimposed with low-frequency real fluctuation noise filtered by a wide window Gaussian filter; the hydrogen load is subjected to nonlinear scaling adjustment according to seasonal characteristics, maintaining a first preset high scaling factor in spring and winter, and converting to a second preset scaling factor in summer and autumn based on the electrical load amplification factor, and superimposed with small high-frequency fluctuations with Gaussian smoothing.

[0017] Compared with the prior art, the beneficial effects of the present invention are: (1) Achieving adaptive and accurate capture of deep spatiotemporal features: This invention effectively overcomes the shortcomings of traditional clustering methods that rely excessively on shallow basic statistical features. By constructing a dual-branch deep network architecture containing TCN and LSTM and introducing a cross-attention mechanism, the system can adaptively extract and fuse local high-frequency transient fluctuation features and global low-frequency temporal evolution patterns from multi-source data, significantly improving the accuracy and real physical representativeness of selecting typical days in complex high-dimensional nonlinear state spaces.

[0018] (2) In the high-resolution data reconstruction stage, this invention creatively designs differentiated dynamic noise models that conform to the respective physical properties of wind power, photovoltaics and heterogeneous loads. While realizing the expansion of data frequency bands, this mechanism accurately reproduces the high-frequency transient power impact under real complex meteorological conditions, providing high-quality underlying data support for microgrid extreme operating condition simulation and energy management strategy verification.

[0019] (3) This invention fully considers the seasonal and time-varying characteristics of heterogeneous loads in the electrothermal-hydrogen combined microgrid and introduces a nonlinear dynamic rate adjustment mechanism. This mechanism effectively breaks the limitations of the traditional fixed-ratio uniform scaling, enabling the reconstructed multi-scenario data to deeply match the actual cross-seasonal energy balance law and physical evolution characteristics of the multi-energy complementary system. Attached Figure Description

[0020] Figure 1 The flowchart illustrates a method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism, as provided in this embodiment of the invention. Detailed Implementation

[0021] The technical solutions of the 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.

[0022] Please see Figure 1This invention provides a technical solution: a method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism, specifically including the following steps: Step 1: Multidimensional Heterogeneous Data Acquisition and Normalization Preprocessing: During the system initialization phase, the raw historical operating data of the electrothermal hydrogen microgrid throughout the year is read to construct a comprehensive environmental state observation matrix. Subsequently, the cleaned data is filled with missing values ​​using linear interpolation and processed using the Min-Max Normalization formula. The construction steps and calculation formulas are as follows: ; In the formula, x (i) For the first in the original sequence i Feature data at each time point; x min and x max These are the minimum and maximum values ​​of this feature in the entire year's historical data, respectively; This is data normalized and mapped to the [0,1] interval. Through the above steps, a 24×... N The sequence of comprehensive environmental state tensors. For example... Figure 1 As shown in the input on the left, the processed state tensor specifically includes: wind power output, photovoltaic power output, thermal load, electrical load, and hydrogen load.

[0023] Step 2, Signal Processing and High-Frequency Fluctuation Retention Decision Step: For microgrid systems containing highly volatile resources such as wind power, the input data enters the mode decomposition decision logic. When the system receives the "Retain Fluctuation Characteristics (SAC Mode)" command for extreme condition testing, the system actively skips the denoising stage of Empirical Mode Decomposition (EMD) or Variational Mode Decomposition (VMD) and directly outputs a normalized tensor containing the original high-frequency gust characteristics and meteorological transient information. This provides undistorted underlying physical boundary data for subsequent energy storage collaborative mitigation strategies.

[0024] Step 3, Deep Feature Extraction Based on Dual-Branch Network and MHCA: Input the state tensor output from Step 2 into... Figure 1 In the designed deep network shown, which includes a Temporal Convolutional Network (TCN) and a Long Short-Term Memory Network (LSTM), the specific feature extraction and fusion rules are as follows: (a) Independent extraction of local and global features: such as Figure 1 As shown in the lower branch, the TCN branch utilizes a one-dimensional dilated causal convolutional network structure (i.e., the tree-like connection in the figure), sequentially passing through a nonlinear activation function and a global average pooling layer, to capture the local high-frequency transient fluctuation features of wind and solar power output, and outputs a feature vector. H TCNAnd linearly map it to the key vector of the cross-attention mechanism ( K ) and value vector ( V );like Figure 1 As shown in the upper branch, the LSTM branch utilizes its internal Sigmoid activation function (i.e., the one in the figure). ), tanh function, and element-wise multiplication ( ) and addition ( The complex gating mechanism is unfolded sequentially in time, as shown in the figure. The structure extracts the global state evolution trend of the system over a 24-hour period and outputs a feature vector. H LSTM The formula for calculating its internal temporal characteristics is: ; ; ; ; ; ; In the formula, x t for t Input characteristics at any given time; h t and h t-1 These are the current and previous hidden states, respectively; c t and c t-1 These represent the current and previous cellular memory states, respectively. i t , f t , o t These are the input gate, the forget gate, and the output gate, respectively. W and U Weight matrix for network training b For bias terms; It is the Sigmoid activation function. This represents element-wise multiplication. H LSTM That is, the last moment of the day. T Hidden state h T .

[0025] Then, the feature vector is mapped to a query vector. Q The calculation formula is: ; In the formula, W Q and b Q These are the weight matrix and bias term of the query vector mapping layer, respectively.

[0026] (b) Cross-fusion and residual connection: such as Figure 1 The "Cross-Attention Feature Fusion" module, shown in the dashed box in the middle, is where the system calculates the query vector. Q With key vector K (in K = W K H TCN + b K The dot product score of () is normalized to generate attention weights. A The calculation formula is as follows: ; In the formula, K T Let be the transpose of the key vectors; d k is the dimension of the key vector, used here as a scaling factor to prevent gradient vanishing during network training; Softmax is the normalized exponential function used to convert the scores into probability weights that sum to 1. This weight is then... A AND value vector V (in V = W V H TCN + b V Perform the multiplication operation again to obtain the fused features. H attn The calculation formula is as follows: ; In the formula, V This is the mapped value vector. Subsequently, a residual connection from the Transformer architecture is introduced to extract the cross-output features. H attn Compared with the original LSTM global features H LSTM Directly add elements one by one (i.e., in the diagram) Finally, the data is fed into a fully connected layer that fuses features, outputting a high-dimensional deep feature vector representing the comprehensive operational characteristics of a single day. H deep The formulas for feature dimensionality reduction and fusion calculation are as follows: ; In the formula, W deep and b deep These are the weight matrix and bias term of the fully connected layer, respectively; This is the activation function for the fully connected layer.

[0027] (c) Anomaly rollback protection mechanism: Before inputting the fully connected layer, the system monitors the deep learning environment status in real time. If the environment is determined to be unready, an automatic switching logic is triggered to replace the deep features with basic daily-dimensional statistical features, ensuring the system's robustness when high-dimensional computation is limited.

[0028] Step 4: Selection of typical days for each season based on meteorological boundaries: (e.g.) Figure 1 As shown in the rightmost module, this step corresponds to the "Seasonal Prior and Deep Feature Matching" stage in the system. It abandons the traditional global static clustering that relies on Euclidean distance and adopts a forced seasonal clustering mode. Based on the time boundaries of the physical natural seasons, it uses high-dimensional feature vectors from all 365 days of the year. H deep The system is strictly divided into four natural season subsets: spring, summer, autumn, and winter. Within the high-dimensional feature space of each seasonal subset, the Euclidean distance deviation from the feature vector of each actual running day to the mean center of that season is calculated. Finally, the actual running day with the smallest deviation from the mean center is selected, and the output is as follows: Figure 1 The rightmost cube shows the "typical day of the four seasons," which serves as the benchmark typical day that best represents the physical evolution of that season.

[0029] (5) Multi-energy asset high-resolution physical reconstruction and load dynamic adjustment steps: The typical daily hourly curves selected in step 4 are expanded into a high-resolution sequence of one data point per minute (1440 points per day) using the conformal cubic interpolation (pchip) algorithm, and customized physical reconstruction is performed: (a) Wind turbine output reconstruction: Dynamic Gaussian gust noise, smoothed by Gaussian filtering, is superimposed on the base interpolation curve. A smoothing window is set to preserve wind speed autocorrelation, ensuring that the noise amplitude is proportional to the wind turbine base output, and a hard constraint is applied to the final output based on the absolute maximum / minimum output of the physical equipment.

[0030] (b) Photovoltaic output reconstruction: To avoid spike distortion caused by linear interpolation, sparse random noise with a long period step is extracted and smoothed into a continuous wave-like undulating trend noise using the pchip algorithm. This trend noise is superimposed on the photovoltaic output and strict non-negative boundary constraints are applied to accurately simulate the physical process of slow cloud shading in actual operation.

[0031] (c) Seasonal Adaptive Adjustment of Multiple Loads: For electrical loads, the load is uniformly amplified by a preset fixed factor, and a wide-window Gaussian filter is superimposed to filter out low-frequency real fluctuations and remove high-frequency glitches. For hydrogen loads, a cross-seasonal nonlinear dynamic adjustment factor is introduced: the first preset high factor is maintained in spring and winter, while in summer and autumn, the load parameters are converted to a second preset derating factor in conjunction with the load parameters. Finally, a small-amplitude high-frequency fluctuation with a narrow-window Gaussian smoothing is uniformly superimposed. This outputs multi-scenario minute-level source-load operating boundary data that approximates real physical operating conditions.

[0032] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for generating typical days in multiple scenarios of microgrids based on a cross-attention mechanism, characterized in that, The specific steps include the following: S1. Obtain historical annual operation data of the combined electric-thermal-hydrogen microgrid, and perform data cleaning and unit unification processing to construct a raw dataset containing wind power output, photovoltaic power output, outdoor temperature, electrical load and hydrogen load; S2. Input the normalized original dataset into the constructed deep learning network based on the cross-attention mechanism, use the Temporal Convolutional Network (TCN) to extract local fluctuation features, use the Long Short-Term Memory Network (LSTM) to extract the global state trend throughout the day, and fuse and output a high-dimensional daily feature vector through the cross-attention mechanism. S3. Based on meteorological time and solar terms, the feature vector of the whole day is divided into four natural season sets: spring, summer, autumn and winter. The Euclidean distance of the daily feature vector to the center is calculated within each season set, and the actual operating day closest to the center is selected as the typical day of that season. S4. The typical daily data of the four seasons is extended from hourly interpolation to minute-level high-resolution data, and dynamic Gaussian filter noise with physical constraints and autocorrelation is applied to different energy types. At the same time, the load is adaptively scaled according to seasonal characteristics, and the final source-load multi-scenario high-frequency typical daily data is output.

2. The method for generating typical days in multiple scenarios of microgrids based on cross-attention mechanism according to claim 1, characterized in that, In step S2, a high-dimensional daily feature vector is output through cross-attention mechanism. The specific steps are as follows: S21. Map the local temporal fluctuation features extracted by the Temporal Convolutional Network (TCN) into a key and value vector for the attention mechanism; S22. Map the system global state features extracted by the Long Short-Term Memory (LSTM) network into a query vector; S23. Calculate the approximate dot product score between the query vector and the key vector, normalize it using the Softmax function to obtain the attention weight, and apply the attention weight to the value vector to obtain the cross feature output. S24. Introduce residual connections, add the cross-feature output to the global state features of the system, and output the final feature vector after dimensionality reduction by a fully connected layer.

3. The method for generating typical days in multiple scenarios of microgrids based on cross-attention mechanism according to claim 1, characterized in that, The minute-level high-resolution data in step S4 includes high-resolution physical reconstruction of wind power and photovoltaic output.

4. The method for generating typical days in multiple scenarios of microgrids based on cross-attention mechanism according to claim 3, characterized in that, The high resolution of the physically reconstructed wind power output specifically refers to: Wind power reconfiguration involves superimposing physical gust noise, which has been Gaussian smoothed, onto a minute-level interpolation curve. The noise amplitude is proportional to the wind turbine output, and an absolute value truncation threshold and physical maximum / minimum output boundary constraints are set.

5. The method for generating typical days in multiple scenarios of microgrids based on cross-attention mechanism according to claim 3, characterized in that, The high resolution of the physically reconstructed photovoltaic output specifically refers to: Photovoltaic reconfiguration employs a conformal cubic interpolation algorithm to smooth the sparse noise of photovoltaics, generating a wave-like undulating trend noise that simulates the slow obstruction of clouds. This trend noise is then proportionally superimposed onto the photovoltaic output curve, and a non-negative constraint is applied.

6. The method for generating typical days in multiple scenarios of microgrids based on cross-attention mechanism according to claim 1, characterized in that, The adaptive scaling of the load based on seasonal characteristics in step S4 includes adaptive scaling of multiple loads: the electrical load is uniformly scaled according to a preset amplification factor, and low-frequency real fluctuation noise filtered by a wide window Gaussian is superimposed. The hydrogen load is adjusted nonlinearly according to seasonal characteristics. In spring and winter, the first preset high rate is maintained, while in summer and autumn, the rate is converted to the second preset rate based on the electrical load amplification factor, and a small high-frequency fluctuation with Gaussian smoothing is superimposed.