Model and data driven distributed energy and load fluctuation prediction method and device

By integrating LSTM and attention mechanisms into a joint prediction model, and combining multi-source heterogeneous data processing and cross-regional transfer learning, the problem of weak generalization ability in existing technologies is solved, achieving high-precision prediction of distributed energy resources and load fluctuations, and improving the accuracy and stability of power grid dispatch.

CN121880798APending Publication Date: 2026-04-17国网河北省电力有限公司营销服务中心 +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
国网河北省电力有限公司营销服务中心
Filing Date
2025-12-31
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing methods for predicting distributed energy and load fluctuations rely on expert knowledge, have weak generalization ability, and are difficult to adapt to the complex prediction needs in scenarios with multi-source heterogeneous data. In particular, the prediction accuracy decreases when there is extreme weather and changes in user behavior.

Method used

We employ a model- and data-driven approach, combining a joint prediction model that integrates LSTM and attention mechanisms. By standardizing, cleaning, and constructing features from multi-source heterogeneous data, we perform abnormal scenario sample enhancement and cross-regional transfer learning to optimize the model and improve its predictive capabilities.

Benefits of technology

It achieves high-precision prediction of distributed energy resources and load fluctuations, can adapt to the differentiated characteristics and extreme events in different regions, provides more accurate grid dispatch support, optimizes power generation plans, reduces operational risks, and improves grid operation stability and economy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880798A_ABST
    Figure CN121880798A_ABST
Patent Text Reader

Abstract

The invention provides a model and data driven distributed energy and load fluctuation prediction method and device, and relates to the technical field of power dispatching. The method comprises the steps that distributed energy output data, load consumption data, meteorological data and power grid operation data are collected for format unification, a standardized original data set is formed, the standardized original data set is cleaned, a high-quality data set is formed, and a feature matrix is constructed; carrying out abnormal scene sample enhancement and model fine tuning on the joint prediction model fusing the LSTM and the attention mechanism, and carrying out differential training according to a target area; wherein the joint prediction model takes the feature matrix as input; and inputting the feature matrix of the target area into the trained joint prediction model to obtain a distributed energy output prediction result and a load fluctuation prediction result in a future preset time period. According to the method, accurate prediction of distributed energy and load fluctuation can be realized, and reliable data support is provided for power grid dispatching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power dispatching technology, and in particular to a model- and data-driven method and apparatus for predicting distributed energy resources and load fluctuations. Background Technology

[0002] At this critical stage of energy transition and grid intelligent upgrading, distributed energy (such as distributed photovoltaic, wind power, and micro gas turbines) has seen its penetration rate in the power grid continuously increase due to its advantages of being clean, low-carbon, and readily available. However, the output of this type of energy is easily affected by natural factors such as sunlight, wind speed, and temperature, exhibiting strong intermittency and randomness. At the same time, with the rapid growth of diversified electricity loads such as electric vehicles, energy storage devices, and smart buildings, as well as the personalized and dynamic changes in user electricity consumption behavior, grid load fluctuations are becoming increasingly severe. Both of these factors together pose serious challenges to the safe and stable operation of the power grid, the regulation of power supply and demand balance, and the optimization of dispatching decisions. Against this backdrop, research on distributed energy and load fluctuation prediction is of paramount importance.

[0003] Prior to this invention, existing methods for predicting distributed energy and load fluctuations mainly relied on traditional statistical methods and experience-driven models. Statistical methods often depend on time series analysis (such as ARIMA models and exponential smoothing), predicting by mining the linear patterns in historical output / load data. While these models are simple in structure and have low computational costs, they struggle to capture the nonlinear relationships of distributed energy influenced by meteorological factors and the complex dynamic characteristics of load fluctuations. Experience-driven models, on the other hand, are often based on expert experience to construct mechanism formulas (such as fitting formulas based on solar intensity, wind speed, and photovoltaic / wind power output, and load estimation models based on industry electricity consumption characteristics). These methods are highly dependent on expert knowledge and have weak generalization ability. When energy type, user structure, or external environment (such as extreme weather or policy adjustments) changes, the prediction accuracy drops significantly, and they are difficult to adapt to the complex prediction needs of multi-source heterogeneous data scenarios. Summary of the Invention

[0004] This invention provides a model- and data-driven method and apparatus for predicting distributed energy and load fluctuations, in order to solve the problems of strong reliance on expert knowledge and weak generalization ability in distributed energy and load fluctuation prediction methods.

[0005] In a first aspect, embodiments of the present invention provide a model- and data-driven method for predicting distributed energy resources and load fluctuations, including: Data on distributed energy output, load consumption, meteorological data, and power grid operation are collected and formatted to form a standardized raw dataset. The standardized raw dataset is then cleaned to form a high-quality dataset, and a feature matrix is ​​constructed. Anomaly scene sample augmentation and model fine-tuning are performed on the joint prediction model that integrates LSTM and attention mechanisms, and differential training is carried out according to the target region; the joint prediction model takes the feature matrix as input; By inputting the feature matrix of the target area into the trained joint prediction model, the distributed energy output prediction results and load fluctuation prediction results for the future preset time period are obtained.

[0006] In one possible implementation, distributed energy output data, load consumption data, meteorological data, and power grid operation data are collected and formatted to form a standardized raw dataset. This standardized raw dataset is then cleaned to create a high-quality dataset, and a feature matrix is ​​constructed, including: Deploy distributed energy equipment, including photovoltaic inverters and wind turbine controllers; Deploy user-side power terminals, including smart meters and charging piles; deploy a third-party platform to collect data from weather stations and power grid dispatching systems. Acquire distributed energy output data, load consumption data, meteorological data, and power grid operation data. Meteorological data includes light intensity, wind speed, and temperature, while power grid operation data includes voltage and frequency. Standardize the collected distributed energy output data; The standardized output value is calculated using the first calculation formula based on the actual and rated values ​​of the collected data. The first calculation formula is:

[0007] Among them, P std The standardized energy output value, P, ranges from 0 to 1. act The actual value of the collected energy output is expressed in kW (Power), P. min The minimum output unit for this type of distributed energy is kW, P rated This is the rated output value of this type of distributed energy source, in kW, and is determined by the equipment parameters; Based on the mean and standard deviation of historical data, a second calculation formula is used to determine the outlier threshold. When a data point in the data sequence exceeds the threshold... upper or less than Th lower When an outlier is detected, it is identified and removed to obtain a high-quality dataset. Useful features are calculated for data in high-quality datasets. These features include Pearson correlation coefficient, mutual information entropy, and strong correlation between light intensity and photovoltaic output. These features are then constructed into a feature matrix, which is used to transform and transfer data from its original state to its usable features. The second calculation formula is:

[0008] Among them, Th upper Th is the upper limit threshold for outliers. lower σ is the lower limit threshold for outliers, μ is the mean of the data sequence to be cleaned, and σ is the standard deviation of the data sequence to be cleaned.

[0009] In one possible implementation, the joint prediction model integrating LSTM and attention mechanisms undergoes abnormal scene sample augmentation and model fine-tuning, and differential training is performed based on the target region, including: The output of the joint prediction model that integrates LSTM and attention mechanism is set to the prediction results for a future preset time period, specifically including the predicted value of distributed energy output and the predicted value of load fluctuation. Based on the attention mechanism, the key feature weights are determined using the third calculation formula, and the temporal feature weights of the LSTM layer output are calculated. The third calculation formula is:

[0010] Where X is the temporal feature matrix output by the LSTM layer, and its dimension is the number of samples × time step × number of features, W q W k W v These are the weight matrices for the query vector, key vector, and value vector, respectively, obtained through model training. Q is the query matrix, K is the key matrix, V is the value matrix, and d is the variable. k The dimension of the key vector is used to alleviate the curse of dimensionality. Softmax is the activation function used to normalize the weights to the range of 0-1. Collect historical abnormal power output / load data corresponding to extreme weather and emergencies; Construct a comprehensive training set that includes both normal and abnormal scenarios; The comprehensive training set is input into the initially trained joint prediction model for secondary fine-tuning to improve the model's ability to predict abnormal fluctuations. To obtain the differentiated energy structure and load characteristics of the target area; The parameters of the general feature extraction layer of the joint prediction model after secondary fine-tuning are extracted as pre-training weights; The parameters are optimized using the fifth calculation formula based on the predicted loss of the target region samples; The fifth calculation formula is:

[0011] Wherein, the variable θ in the formula new For the updated output prediction layer parameters, θ oldThe output prediction layer parameters before the update are given, and the variable η is the learning rate, which ranges from 0.001 to 0.01. The gradient operator is used to evaluate the parameters of the output prediction layer, and the variable L is the loss function, specifically y. true Relative to y pred The mean square error, y true The actual force output to the target area, variable y pred This represents the model's predicted value for the target region.

[0012] In one possible implementation, a comprehensive training set containing both normal and abnormal scenarios is constructed, including: A dynamic weight w is assigned to each sample in the abnormal output / load data. The dynamic weight w is calculated based on the historical frequency of the abnormal event, the degree of power impact on the system, and the cooperative characteristics of source-load fluctuations during the event. For each anomalous event sample, extract the total output time series of distributed energy resources P={p_1, p_2, ..., p_m} and the total load fluctuation time series L={l_1, l_2, ..., l_n} within the event window, and calculate the minimum cumulative distance D_norm between the two series using the dynamic time warping algorithm. Then, use the formula Sim = exp- λ*D_norm Calculate the morphological similarity Sim, where λ is a preset positive scaling factor; The formula for calculating the dynamic weight w is: w=α*(1 / Freq)+β*(ΔP_max / P_nominal)+γ*Sim Where Freq is the historical frequency of this type of abnormal event, ΔP_max is the maximum deviation of the system net power from the baseline during this event, P_nominal is the system baseline capacity, and α, β and γ are adjustment coefficients; The specific calculation process for D_norm is as follows: For a distributed energy output sequence P (length m) and a load fluctuation sequence L (length n), construct an m×n distance matrix M, where the matrix element M[i][j] represents the absolute distance between p_i and l_j, i.e.: M[i][j] = |p_i - l_j| Construct an m×n cumulative distance matrix D, where D[i][j] represents the minimum cumulative distance from the starting point (1,1) of the sequence to the alignment point (i,j). Calculate this using dynamic programming: D[i][j] = M[i][j] + min( D[i-1][j], D[i][j-1], D[i-1][j-1]) where the boundary condition is: D[1][1] = M[1][1], and for the case of i=1 or j=1, only the defined adjacent elements are considered; Starting from D[m][n], trace backwards and select the adjacent element (top left, left or top) that minimizes the cumulative distance to obtain the optimal alignment path π. This path consists of a series of coordinate pairs {(i_1,j_1), (i_2,j_2), ..., (i_k,j_k)}, where k is the path length, and the minimum cumulative alignment distance D_min is D[m][n]. Calculate D_norm: D_norm = D_min / k, where k is the length of the optimal alignment path π; During the second fine-tuning process, the loss function used for model training is a dynamically weighted loss function.

[0013] In one possible implementation, differential training based on the target region is specifically performed through a model-agnostic meta-learning framework, including: Use the trained model parameters as the initial meta-parameters θ; Using a small amount of support set data of the target region, the initial meta parameter θ is updated by an inner loop gradient to obtain the adaptation parameter θ' corresponding to the region. Calculate the loss of the adaptation parameter θ' on the target region query set as the meta-loss; The initial parameters θ are optimized by minimizing the meta-loss through an outer loop. Among them, the initial parameter θ after optimization by the outer loop is used to obtain high-precision prediction capability through rapid fine-tuning when there is only a small amount of target area data.

[0014] In one possible implementation, after inputting the feature matrix of the target region into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset future time period, the method further includes: The prediction results are corrected by physical information constraints to obtain the corrected prediction results. The correction is achieved by solving a constrained optimization problem. The goal of the problem is to minimize the change in the prediction values ​​before and after the correction. The constraints include the upper and lower limits of the technical limit of distributed energy output and the approximate constraint of node power balance. The uncertainty of the forecast results or the corrected forecast results is quantified to generate a forecast range of load and output within a preset time period in the future. Uncertainty quantification is achieved through quantile regression, and the quantile regression loss function L_quantile is: L_quantile=Σ[max(τ*(y_true-y_pred_τ),(τ-1)*(y_true-y_pred_τ))] Where τ is the target quantile, y_true is the true value, and y_pred_τ is the predicted τ quantile value output by the model; Based on the prediction interval, several typical prediction scenarios are constructed; Using multiple typical prediction scenarios as input, a multi-objective robust scheduling optimization model is driven to generate corresponding day-ahead scheduling plans; The multi-objective robust scheduling optimization model aims to minimize the total expected operating cost and the system risk cost, where the system risk cost C_risk is calculated using the following formula: C_risk=Σ_s[ρ_s*Σ_t(κ*max(0,L_s,t-L_line_max))] Where s represents different prediction scenarios, ρ_s is the weight of scenario s, L_s,t is the predicted load value at time t under scenario s, L_line_max is the transmission capacity limit of the critical line, and κ is the unit overload penalty coefficient. The dispatch plan and forecast results were recently output to the power grid dispatch system.

[0015] In one possible implementation, the mathematical model of the constrained optimization problem is as follows: Minimize the objective function: f = ||P_c - P_p||² + ||L_c - L_p||² Subject to the following constraints: (1) P_min≤P_c≤P_max; (2)∑P_c+P_grid_inj≈∑L_c; (3) L_c≥0; Where P_p and L_p are the original output and load prediction vectors, respectively; P_c and L_c are the corrected prediction vectors to be determined; P_min and P_max are the equipment output limit vectors; and P_grid_inj is the grid-injected power.

[0016] In one possible implementation, the feature matrix of the target region is input into a trained joint prediction model to obtain distributed energy output prediction results and load fluctuation prediction results for a preset future time period, including: The feature matrix obtained by real-time acquisition and processing of the target region is input into the trained joint prediction model; The model calculates the predicted output of distributed energy resources for a predetermined time period. The fluctuation range is calculated using the sixth calculation formula based on the predicted load value and the baseline load value. The prediction results are output to the power grid dispatch system in XML format; The sixth calculation formula is:

[0017] In the formula, the variable ΔL represents the load fluctuation range, and its unit is %. pred The model predicts the load value for future periods, in kW, with variable L. base The baseline load value is measured in kW and is taken as the actual load value of the same period before the forecast period or the historical average load value for the same period.

[0018] Secondly, embodiments of the present invention provide a model- and data-driven distributed energy and load fluctuation prediction device, comprising: The data acquisition module is used to collect distributed energy output data, load consumption data, meteorological data, and power grid operation data, unify the format, form a standardized raw dataset, clean the standardized raw dataset to form a high-quality dataset, and construct a feature matrix. The training module is used to perform abnormal scene sample augmentation and model fine-tuning on the joint prediction model that integrates LSTM and attention mechanisms, and to perform differential training based on the target region; wherein, the joint prediction model takes the feature matrix as input; The prediction module is used to input the feature matrix of the target area into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset time period in the future.

[0019] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation thereof.

[0020] The model- and data-driven distributed energy and load fluctuation prediction method and apparatus provided in this invention firstly ensures the quality and consistency of input data from the source by uniformly standardizing and cleaning multi-source heterogeneous data, laying a reliable foundation for subsequent modeling. Secondly, it innovatively adopts a joint prediction model integrating LSTM and attention mechanisms. This structure can not only fully explore the long-term temporal dependence patterns in historical data, but also dynamically focus on the key historical moments and features most relevant to the current prediction through the attention mechanism, thereby accurately depicting the nonlinear and strongly coupled process of meteorological changes affecting energy output and complex factors driving load fluctuations. Furthermore, the scheme designs a model optimization mechanism that includes abnormal scenario enhancement and cross-regional transfer learning, enabling the model to not only learn conventional patterns, but also significantly improve its adaptability and prediction robustness to rare extreme events and regional differences. Finally, this method can output high-precision distributed energy output and load fluctuation prediction results, providing more accurate and reliable forward-looking data support for the power grid dispatching system, helping to optimize power generation plans, balance supply and demand, reduce operational risks, and significantly improve the stability and economy of power grid operation under high-proportion renewable energy access environments. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating the implementation of the model- and data-driven distributed energy and load fluctuation prediction method provided in this embodiment of the invention. Figure 2 This is a schematic diagram of the structure of the model- and data-driven distributed energy and load fluctuation prediction device provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0022] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0023] Prior to this invention, existing methods for predicting distributed energy and load fluctuations mainly relied on traditional statistical methods and experience-driven models. Statistical methods often depend on time series analysis (such as ARIMA models and exponential smoothing), predicting by mining the linear patterns in historical output / load data. While these models are simple in structure and have low computational costs, they struggle to capture the nonlinear relationships of distributed energy influenced by meteorological factors and the complex dynamic characteristics of load fluctuations. Experience-driven models, on the other hand, are often based on expert experience to construct mechanism formulas (such as fitting formulas based on solar intensity, wind speed, and photovoltaic / wind power output, and load estimation models based on industry electricity consumption characteristics). These methods are highly dependent on expert knowledge and have weak generalization ability. When energy type, user structure, or external environment (such as extreme weather or policy adjustments) changes, the prediction accuracy drops significantly, and they are difficult to adapt to the complex prediction needs of multi-source heterogeneous data scenarios.

[0024] This invention provides a model- and data-driven method and system for predicting distributed energy resources and load fluctuations. This approach achieves accurate prediction of distributed energy resources and load fluctuations by acquiring, cleaning, and constructing multi-source heterogeneous data, combining a joint prediction model integrating LSTM and attention mechanisms, and implementing steps such as abnormal scenario sample enhancement and cross-regional transfer learning adaptation. This provides reliable data support for power grid dispatching.

[0025] See Figure 1 The document illustrates a flowchart of the implementation of the model- and data-driven distributed energy and load fluctuation prediction method provided in this embodiment of the invention, detailed below: Step 101: Collect distributed energy output data, load consumption data, meteorological data, and power grid operation data, unify their formats to form a standardized raw dataset, clean the standardized raw dataset to form a high-quality dataset, and construct a feature matrix.

[0026] Step 102: Perform abnormal scene sample augmentation and model fine-tuning on the joint prediction model that integrates LSTM and attention mechanism, and perform differentiated training according to the target region; wherein, the joint prediction model takes the feature matrix as input.

[0027] Step 103: Input the feature matrix of the target area into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for the future preset time period.

[0028] In this embodiment, multi-source heterogeneous data is first collected and standardized, then the data is cleaned and a feature matrix is ​​constructed. Next, a joint prediction model integrating LSTM and attention mechanism is constructed. After abnormal scenario sample enhancement and cross-regional transfer learning adaptation, real-time data is input to obtain prediction results and output to the power grid dispatching system, which effectively solves the shortcomings of traditional methods.

[0029] This invention first standardizes and cleans multi-source heterogeneous data to ensure the quality and consistency of input data from the source, laying a reliable foundation for subsequent modeling. Secondly, it innovatively employs a joint prediction model integrating LSTM and an attention mechanism. This structure not only fully mines long-term temporal dependencies in historical data but also dynamically focuses on key historical moments and features most relevant to the current prediction through the attention mechanism. This accurately depicts the nonlinear, strongly coupled process of how meteorological changes affect energy output and how complex factors drive load fluctuations. Furthermore, the scheme designs a model optimization mechanism that includes abnormal scenario enhancement and cross-regional transfer learning. This enables the model to not only learn conventional patterns but also significantly improves its adaptability and predictive robustness to rare extreme events and regionally differentiated characteristics. Finally, this method outputs high-precision distributed energy output and load fluctuation prediction results, providing more accurate and reliable forward-looking data support for the power grid dispatching system. This helps optimize power generation plans, balance supply and demand, reduce operational risks, and significantly improve the stability and economy of power grid operation under a high proportion of renewable energy integration.

[0030] In one possible implementation, distributed energy output data, load consumption data, meteorological data, and power grid operation data are collected and formatted to form a standardized raw dataset. This standardized raw dataset is then cleaned to create a high-quality dataset, and a feature matrix is ​​constructed, including: Deploy distributed energy equipment, including photovoltaic inverters and wind turbine controllers; Deploy user-side power terminals, including smart meters and charging piles; deploy a third-party platform to collect data from weather stations and power grid dispatching systems. Acquire distributed energy output data, load consumption data, meteorological data, and power grid operation data. Meteorological data includes light intensity, wind speed, and temperature, while power grid operation data includes voltage and frequency. Standardize the collected distributed energy output data; The standardized output value is calculated using the first calculation formula based on the actual and rated values ​​of the collected data. The first calculation formula is:

[0031] Among them, P std The standardized energy output value, P, ranges from 0 to 1. act The actual value of the collected energy output is expressed in kW (Power), P. min The minimum output unit for this type of distributed energy is kW, P ratedThis is the rated output value of this type of distributed energy source, in kW, and is determined by the equipment parameters; Based on the mean and standard deviation of historical data, a second calculation formula is used to determine the outlier threshold. When a data point in the data sequence exceeds the threshold... upper or less than Th lower When an outlier is detected, it is identified and removed to obtain a high-quality dataset. Useful features are calculated for data in high-quality datasets. These features include Pearson correlation coefficient, mutual information entropy, and strong correlation between light intensity and photovoltaic output. These features are then constructed into a feature matrix, which is used to transform and transfer data from its original state to its usable features. The second calculation formula is:

[0032] Among them, Th upper Th is the upper limit threshold for outliers. lower σ is the lower limit threshold for outliers, μ is the mean of the data sequence to be cleaned, and σ is the standard deviation of the data sequence to be cleaned.

[0033] In this embodiment, taking a small-scale distributed energy project as an example, the implementation process first involves deploying distributed energy equipment. Several photovoltaic inverters are installed on rooftops with ample sunlight, and wind turbine controllers are placed in open areas with abundant wind resources to collect distributed energy output data. Simultaneously, smart meters are installed on the user side to monitor each user's electricity consumption, and charging piles are deployed in public areas and parking lots to obtain charging load consumption data. A third-party platform is also connected to obtain meteorological data such as light intensity, wind speed, and temperature from weather stations, and grid operation data such as voltage and frequency from the grid dispatch system. After acquiring various types of data, the collected distributed energy output data is standardized. For example, if a photovoltaic inverter has a rated output value Prated of 50kW and a minimum output value Pmin of 0kW, and the actual energy output value Pact collected at a certain moment is 30kW, the standardized energy output value can be calculated as 0.6 according to the first calculation formula, with a value ranging from 0 to 1. All collected distributed energy output data are standardized in this way to form a standardized raw dataset, which provides a foundation for subsequent data cleaning and model building.

[0034] After constructing the standardized raw dataset, the data needs to be cleaned to obtain a high-quality dataset and construct a feature matrix. Suppose we have a set of distributed energy output data collected hourly for a week. First, we determine the outlier threshold based on historical data. By calculating the mean μ and standard deviation σ of this historical data set, we use a second calculation formula to determine the upper and lower limits of outlier thresholds. For example, if the calculated mean μ is 20kW and the standard deviation σ is 5kW, then the upper limit of outlier threshold is 35kW and the lower limit is 5kW. In the data sequence, when the energy output data collected at a certain moment is greater than 35kW or less than 5kW, it is judged as an outlier and removed. After this step, a high-quality dataset is obtained. Next, usable features are calculated from the data in the high-quality dataset. For example, the Pearson correlation coefficient is calculated to measure the degree of linear correlation between two variables. Suppose we want to analyze the relationship between light intensity and distributed energy (such as photovoltaic power generation) output; by calculating the Pearson correlation coefficient, we can clarify the degree of correlation between the two. Then, we calculate the mutual information entropy, which reflects the degree of interdependence between two random variables. Simultaneously, strong correlation features between light intensity and photovoltaic output are extracted. These usable features are integrated to construct a feature matrix, which is like an ordered data table, where each row represents a sample data and each column represents a feature. Through this construction, the data is transformed from its raw state to usable features, providing more effective data support for the subsequent model construction.

[0035] In one possible implementation, the joint prediction model integrating LSTM and attention mechanisms undergoes abnormal scene sample augmentation and model fine-tuning, and differential training is performed based on the target region, including: The output of the joint prediction model that integrates LSTM and attention mechanism is set to the prediction results for a future preset time period, specifically including the predicted value of distributed energy output and the predicted value of load fluctuation. Based on the attention mechanism, the key feature weights are determined using the third calculation formula, and the temporal feature weights of the LSTM layer output are calculated. The third calculation formula is:

[0036] Where X is the temporal feature matrix output by the LSTM layer, and its dimension is the number of samples × time step × number of features, W q W k W v These are the weight matrices for the query vector, key vector, and value vector, respectively, obtained through model training. Q is the query matrix, K is the key matrix, V is the value matrix, and d is the variable. kThe dimension of the key vector is used to alleviate the curse of dimensionality. Softmax is the activation function used to normalize the weights to the range of 0-1. Collect historical abnormal power output / load data corresponding to extreme weather and emergencies; Construct a comprehensive training set that includes both normal and abnormal scenarios; The comprehensive training set is input into the initially trained joint prediction model for secondary fine-tuning to improve the model's ability to predict abnormal fluctuations. To obtain the differentiated energy structure and load characteristics of the target area; The parameters of the general feature extraction layer of the joint prediction model after secondary fine-tuning are extracted as pre-training weights; The parameters are optimized using the fifth calculation formula based on the predicted loss of the target region samples; The fifth calculation formula is:

[0037] Wherein, the variable θ in the formula new For the updated output prediction layer parameters, θ old The output prediction layer parameters before the update are given, and the variable η is the learning rate, which ranges from 0.001 to 0.01. The gradient operator is used to evaluate the parameters of the output prediction layer, and the variable L is the loss function, specifically y. true Relative to y pred The mean square error, y true The actual force output to the target area, variable y pred This represents the model's predicted value for the target region.

[0038] In this embodiment, after constructing the feature matrix, it can be used as input to build a joint prediction model integrating LSTM and attention mechanisms. Taking the scenario of predicting distributed energy output and load fluctuations in a certain region as an example, the previously obtained feature matrix is ​​used as the input to the joint prediction model integrating LSTM and attention mechanisms. This input data is like the "raw materials" provided to the model, which will process it. The model output is set to the prediction results for a preset time period in the future. Assuming we set the next 24 hours as the preset time period, the model output will include the predicted values ​​of distributed energy output and load fluctuations within these 24 hours. For example, predicting the hourly power generation output of a photovoltaic power station in the next 24 hours, and the fluctuation of user electricity load in the region within these 24 hours. The model uses the attention mechanism to determine the weights of key features. Its core lies in the third calculation formula, whose dimensions are number of samples × time step × number of features, like a three-dimensional data table, where different dimensions represent the number of samples, time series, and feature categories, respectively. Wq, Wk, and Wv are the weight matrices for the query vector, key vector, and value vector, respectively. These are learned during model training and used to adjust the relationships between different vectors. Q is the query matrix, K is the key matrix, and V is the value matrix. They are obtained by linearly transforming X and are used to calculate the attention weights. The variable dk is the dimension of the key vector. Dividing by dk prevents the QKT from becoming too large, causing softmax overflow, and also ensures that the QKT results have a mean of 0 and a variance of 1, thus mitigating the curse of dimensionality. Softmax is the activation function that normalizes the calculated weights to the range of 0 to 1. This clearly shows the importance of different features in the prediction, and then calculates the temporal feature weights output by the LSTM layer, helping the model to make more accurate predictions.

[0039] During model training, to improve the model's predictive ability for abnormal fluctuations, it is necessary to perform abnormal scenario sample augmentation and secondary fine-tuning on the initially trained model. Taking energy data from a certain region as an example, historical abnormal output / load data corresponding to extreme weather (such as heavy rain, heavy snow, and high temperatures) and emergencies (such as equipment failure and power repair) are first collected. For example, during a heavy rain, distributed energy (such as photovoltaic power generation) output drops significantly due to insufficient sunlight, while residential electricity load increases due to the use of air conditioning and other equipment; these data must be collected in detail. This abnormal data is then integrated with previous normal data to construct a comprehensive training set containing both normal and abnormal scenarios. The comprehensive training set is like a "large database," containing both energy data under normal and abnormal conditions, providing the model with more comprehensive learning materials. The comprehensive training set is then input into the previously initially trained prediction model for secondary fine-tuning. During the process of learning from the comprehensive training set, the model continuously adjusts its parameters, such as the weights in the neural network, to better adapt to the data characteristics under abnormal scenarios, thereby improving its predictive ability for abnormal fluctuations. For example, after secondary fine-tuning, the model can more accurately predict the output and load fluctuations of distributed energy resources when facing similar abnormal scenarios that may occur in the future, providing a more reliable basis for energy dispatch and management.

[0040] In one possible implementation, a comprehensive training set containing both normal and abnormal scenarios is constructed, including: A dynamic weight w is assigned to each sample in the abnormal output / load data. The dynamic weight w is calculated based on the historical frequency of the abnormal event, the degree of power impact on the system, and the cooperative characteristics of source-load fluctuations during the event. For each anomalous event sample, extract the total output time series of distributed energy resources P={p_1, p_2, ..., p_m} and the total load fluctuation time series L={l_1, l_2, ..., l_n} within the event window, and calculate the minimum cumulative distance D_norm between the two series using the dynamic time warping algorithm. Then, use the formula Sim = exp- λ*D_norm Calculate the morphological similarity Sim, where λ is a preset positive scaling factor; The formula for calculating the dynamic weight w is: w=α*(1 / Freq)+β*(ΔP_max / P_nominal)+γ*Sim Where Freq is the historical frequency of this type of abnormal event, ΔP_max is the maximum deviation of the system net power from the baseline during this event, P_nominal is the system baseline capacity, and α, β and γ are adjustment coefficients; The specific calculation process for D_norm is as follows: For a distributed energy output sequence P (length m) and a load fluctuation sequence L (length n), construct an m×n distance matrix M, where the matrix element M[i][j] represents the absolute distance between p_i and l_j, i.e.: M[i][j] = |p_i - l_j| Construct an m×n cumulative distance matrix D, where D[i][j] represents the minimum cumulative distance from the starting point (1,1) of the sequence to the alignment point (i,j). Calculate this using dynamic programming: D[i][j] = M[i][j] + min( D[i-1][j], D[i][j-1], D[i-1][j-1]) where the boundary condition is: D[1][1] = M[1][1], and for the case of i=1 or j=1, only the defined adjacent elements are considered; Starting from D[m][n], trace backwards and select the adjacent element (top left, left or top) that minimizes the cumulative distance to obtain the optimal alignment path π. This path consists of a series of coordinate pairs {(i_1,j_1), (i_2,j_2), ..., (i_k,j_k)}, where k is the path length, and the minimum cumulative alignment distance D_min is D[m][n]. Calculate D_norm: D_norm = D_min / k, where k is the length of the optimal alignment path π; During the second fine-tuning process, the loss function used for model training is a dynamically weighted loss function.

[0041] In this embodiment, the weight w consists of three parts: the reciprocal of the historical frequency (1 / Freq), where lower frequency events are rarer and should have higher weights; the normalized power impact (ΔP_max / P_nominal), where larger impacts have a greater impact on system safety and deserve more attention; and the source-load morphological similarity (Sim), calculated by the dynamic time warping algorithm to convert the morphological distance between the force sequence and the load sequence, where high similarity indicates the typicality of the anomalous pattern. The adjustment coefficients α, β, and γ can be set according to the importance of frequency, impact, and morphological similarity in the actual system (e.g., through grid search optimization). In the training loss calculation for secondary fine-tuning, the loss of each sample is multiplied by its respective weight w, causing the model optimization process to favor these important, high-weight anomalous samples. Compared to simply copying anomalous samples, this method can more intelligently and evenly utilize limited anomalous data, improving the model's generalization ability in extreme cases.

[0042] In one possible implementation, differential training based on the target region is specifically performed through a model-agnostic meta-learning framework, including: Use the trained model parameters as the initial meta-parameters θ; Using a small amount of support set data of the target region, the initial meta parameter θ is updated by an inner loop gradient to obtain the adaptation parameter θ' corresponding to the region. Calculate the loss of the adaptation parameter θ' on the target region query set as the meta-loss; The initial parameters θ are optimized by minimizing the meta-loss through an outer loop. Among them, the initial parameter θ after optimization by the outer loop is used to obtain high-precision prediction capability through rapid fine-tuning when there is only a small amount of target area data.

[0043] In this embodiment, the goal of meta-learning is to enable the model to quickly adapt to new tasks. Model parameters θ, enhanced and fine-tuned through abnormal scenarios, are used as "meta-initial parameters." These parameters already possess the ability to extract general temporal patterns and common anomaly features. To achieve rapid adaptation to the target region, the meta-learning process consists of two loops: an inner loop and an outer loop. In the inner loop, using a small amount of "support set" data provided by the target region (e.g., only output and load data from the past week), several gradient descent steps are performed on the meta-initial parameters θ to obtain "adaptation parameters" θ' that are only applicable to this region. This process simulates a scenario of fine-tuning with a small amount of data in a new region. The outer loop evaluates the effectiveness of this rapid adaptation: it calculates the prediction loss of the adaptation parameters θ' on another part of the "query set" data in the target region, called the "meta-loss." This meta-loss is minimized using an optimizer (such as Adam), and the initial meta-initial parameters θ are updated through backpropagation. After multiple rounds of training on "tasks" (i.e., simulations of different regions or time periods), the final meta-initial parameters θ exhibit extremely strong generalization and rapid adaptation capabilities. When a model is deployed to a completely new target area with a short data history, a high-precision prediction model can be obtained by performing a quick fine-tuning loop using only a small amount of new data from that area. This solves the "cold start" problem in distributed energy prediction caused by the commissioning of new projects or the lack of data in remote areas, significantly reducing the data threshold and time cost of model deployment, and enabling rapid migration and reuse of prediction capabilities.

[0044] In one possible implementation, after inputting the feature matrix of the target region into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset future time period, the method further includes: The prediction results are corrected by physical information constraints to obtain the corrected prediction results. The correction is achieved by solving a constrained optimization problem. The goal of the problem is to minimize the change in the prediction values ​​before and after the correction. The constraints include the upper and lower limits of the technical limit of distributed energy output and the approximate constraint of node power balance. The uncertainty of the forecast results or the corrected forecast results is quantified to generate a forecast range of load and output within a preset time period in the future. Uncertainty quantification is achieved through quantile regression, and the quantile regression loss function L_quantile is: L_quantile=Σ[max(τ*(y_true-y_pred_τ),(τ-1)*(y_true-y_pred_τ))] Where τ is the target quantile, y_true is the true value, and y_pred_τ is the predicted τ quantile value output by the model; Based on the prediction interval, several typical prediction scenarios are constructed; Using multiple typical prediction scenarios as input, a multi-objective robust scheduling optimization model is driven to generate corresponding day-ahead scheduling plans; The multi-objective robust scheduling optimization model aims to minimize the total expected operating cost and the system risk cost, where the system risk cost C_risk is calculated using the following formula: C_risk=Σ_s[ρ_s*Σ_t(κ*max(0,L_s,t-L_line_max))] Where s represents different prediction scenarios, ρ_s is the weight of scenario s, L_s,t is the predicted load value at time t under scenario s, L_line_max is the transmission capacity limit of the critical line, and κ is the unit overload penalty coefficient. The dispatch plan and forecast results were recently output to the power grid dispatch system.

[0045] In this embodiment [Yi Sun 1], purely data-driven model predictions sometimes violate physical laws, such as predicting that the photovoltaic power station will have a large output at night, or that the total power generation and total load are severely unbalanced. To solve this problem, this step constructs the post-prediction processing as a constrained optimization problem. The decision variables of this problem are the corrected output prediction vector P_c and the load prediction vector L_c. The objective function f = ||P_c – P_p||² + ||L_c – L_p||² aims to minimize the magnitude of the correction to the original model prediction values ​​(P_p, L_p) to preserve the core information of data-driven prediction. The constraints are embedded with physical common sense: (1) Equipment output upper and lower limit constraints P_min ≤ P_c ≤ P_max, ensuring that the corrected output value is within the range of equipment technical capabilities (e.g., photovoltaic output is not less than 0 and not greater than the rated capacity); (2) Node power balance approximation constraint ∑P_c +P_grid_inj ≈ ∑L_c, where P_grid_inj is the known or estimated grid injection power, and this constraint forces the total power generation and total power consumption of the system to be basically balanced; (3) Load non-negativity constraint L_c ≥ 0. This is a standard quadratic programming problem, which can be solved efficiently using optimization algorithms such as the interior point method. For example, if the model predicts that the photovoltaic output is -5kW at a certain moment, after this correction, the value will be raised to the lower limit of 0kW, while other related prediction values ​​are slightly adjusted to meet the power balance. This step is equivalent to putting a "physical common sense" constraint on data-driven predictions, ensuring that the prediction results output to the scheduling system are technically feasible, avoiding scheduling command errors caused by unreasonable model outputs, and improving the practicality and reliability of the prediction results.

[0046] Recognizing the limitations of point prediction, this step employs quantile regression to quantify the uncertainty of prediction. Specifically, the model needs to be modified or multiple copies trained so that it can directly output predicted values ​​y_pred^τ corresponding to different quantiles τ (e.g., 5%, 50%, 95%). During training, the quantile loss function L_quantile is used, which asymmetrically penalizes prediction errors above and below quantiles, thereby driving the model to learn to output predicted values ​​at specific quantiles. This yields prediction intervals for each future time step (e.g., a 90% confidence interval consisting of the interval from the 5% quantile to the 95% quantile). Based on these prediction intervals, a set of "typical prediction scenarios" covering adverse conditions can be constructed using scenario generation techniques (e.g., Latin hypercube sampling), such as the worst-case scenario of "high load - low output". These scenarios are then input into a "multi-objective robust scheduling optimization model". This model not only considers economics (expected operating costs) but also explicitly penalizes potential unsafe conditions, such as line overload, through a risk cost C_risk. In the C_risk formula, κ is set as a large penalty coefficient to reflect the strict emphasis on safety constraints. Solving this optimization problem yields a set of "day-ahead dispatch plans," which includes conventional dispatch instructions and pre-control measures to cope with different adverse scenarios. Finally, the point prediction results, prediction intervals, and robust dispatch plans are output together. This realizes an upgrade of the decision chain from "what is the prediction" to "what might the prediction be" and then to "how should we respond to various possibilities," directly transforming the uncertainty of prediction into an executable and defensive dispatch strategy, greatly enhancing the resilience and economy of the power grid in dealing with both source and load uncertainties.

[0047] By utilizing the forecast interval, multiple "typical forecast scenarios" can be constructed by sampling or selecting boundary values ​​(such as the lower bound of output forecast and the upper bound of load forecast), representing different potential adverse situations in the future. These scenarios are then input into a "multi-objective robust scheduling optimization model." This model aims to minimize the total expected operating cost (fuel cost, maintenance cost, etc.) and system risk cost. In the formula for calculating the risk cost C_risk, L_s,t is the load forecast value of scenario s at time t, L_line_max is the capacity limit of the critical line, max(0, L_s,t - L_line_max) calculates the overload, κ is the unit overload penalty coefficient (set to a large value to reflect the importance of safety), and ρ_s is the preset probability weight of scenario s. By solving this optimization problem, a set of economical and safe "day-ahead scheduling plans" can be obtained, such as the start-up and shutdown plans of each unit and the charging and discharging strategies of energy storage. This makes the forecast results not just a prediction, but directly drives defensive scheduling decisions, proactively incorporating the uncertainty of forecasts into management and improving the resilience of the power grid in the face of risks.

[0048] In one possible implementation, the mathematical model of the constrained optimization problem is as follows: Minimize the objective function: f = ||P_c - P_p||² + ||L_c - L_p||² Subject to the following constraints: (1) P_min≤P_c≤P_max; (2)∑P_c+P_grid_inj≈∑L_c; (3) L_c≥0; Where P_p and L_p are the original output and load prediction vectors, respectively; P_c and L_c are the corrected prediction vectors to be determined; P_min and P_max are the equipment output limit vectors; and P_grid_inj is the grid-injected power.

[0049] In this embodiment, the model formalizes the correction process as a convex optimization problem, ensuring the existence of a globally optimal solution and efficient solution. The squared term (L2 norm) in the objective function imposes a higher penalty on large correction amounts, prompting the solver to be as faithful as possible to the original model's predictions while satisfying physical constraints. The P_min and P_max vectors can be directly obtained from the equipment asset management database, with personalized limits set for each distributed power source. The "≈" in the power balance constraint can be treated as an equality constraint allowing a very small deviation ε in the actual solution, or transformed into a penalty term added to the objective function. P_grid_inj (grid injected power) can be obtained from the scheduling plan or the measured value at the previous time step. By solving this model, the obtained P_c and L_c are mathematically a set of solutions within the physically feasible region that are closest to the original prediction point. This process can be viewed as a "projection" operation, "projecting" the original prediction point, which may fall outside the feasible region, onto the boundary of the feasible region enclosed by physical constraints. Its implementation has yielded significant benefits: it automates the work of checking and correcting the rationality of prediction results, which previously required manual judgment, and seamlessly integrates physical rules into the end of the data-driven process in a computable and scalable manner, so that the final prediction results have both data insights and physical consistency, providing a solid and reliable input foundation for subsequent prediction-based automatic scheduling decisions.

[0050] In one possible implementation, the feature matrix of the target region is input into a trained joint prediction model to obtain distributed energy output prediction results and load fluctuation prediction results for a preset future time period, including: The feature matrix obtained by real-time acquisition and processing of the target region is input into the trained joint prediction model; The model calculates the predicted output of distributed energy resources for a predetermined time period. The fluctuation range is calculated using the sixth calculation formula based on the predicted load value and the baseline load value. The prediction results are output to the power grid dispatch system in XML format; The sixth calculation formula is:

[0051] In the formula, the variable ΔL represents the load fluctuation range, and its unit is %. pred The model predicts the load value for future periods, in kW, with variable L. base The baseline load value is measured in kW and is taken as the actual load value of the same period before the forecast period or the historical average load value for the same period.

[0052] In this embodiment, the energy structure and load characteristics of different regions differ significantly. For example, in the old city area of ​​a certain city, the buildings are mostly old residential buildings, and the residents' electricity load is mainly for daily life, such as lighting, television, and refrigerators, with distributed energy mainly consisting of small rooftop photovoltaic systems; while the new city area consists mostly of modern buildings, equipped with a large number of smart home appliances and commercial facilities, resulting in a larger electricity load, and also features large-scale centralized photovoltaic power stations and wind farms. After obtaining the differentiated energy structure and load characteristics of the target area, the general feature extraction layer parameters of the previously trained prediction model are extracted as pre-training weights. These pre-training weights are like the model's "experience base," containing the general knowledge acquired by the model during previous learning. The parameters are optimized using the fifth calculation formula based on the prediction loss of the target area samples. The variable θ in the formula... new The updated output prediction layer parameters will determine the model's future predictive performance; θ old The output prediction layer parameters before the update represent the current state of the model; the variable η is the learning rate, ranging from 0.001 to 0.01. It controls the step size of parameter updates during the optimization process, much like the stride length of a person walking. If the step size is too large, the model may miss the optimal solution; if the step size is too small, the model's convergence speed will be very slow. This is the gradient operator for the output prediction layer parameters, indicating the direction of model parameter updates. The model updates its parameters in the direction that reduces the loss function L. Variable L is the loss function, specifically the mean squared error of ytrue relative to ypred, where ytrue is the actual output of the target region, ypred is the model's predicted value for the target region, and N is the number of samples in the target region. By continuously optimizing the parameters according to this formula, the model can better adapt to the characteristics of the target region and improve prediction accuracy.

[0053] In this embodiment of the invention, taking the actual operation of a city power grid as an example, when managing energy in a target area, the feature data collected in real time from the target area and processed in steps 1-2 are input into the prediction model optimized in step 5. This processed feature data is like "essential information" that has been filtered and organized, allowing the model to analyze it more effectively. The model calculates the predicted output of distributed energy resources for a future preset time period. Assuming the preset time period is 12 hours, the model outputs the predicted output value of distributed energy resources (such as photovoltaic power generation, wind power generation, etc.) per hour within these 12 hours. The fluctuation range is calculated using the sixth calculation formula based on the predicted load value and the baseline load value. For example, if the predicted load value for a future period is 800kW, and the baseline load value is the actual load value of the same period before the predicted period (700kW), then the load fluctuation range... The unit is %, which reflects the degree of load fluctuation relative to the baseline load. Finally, the forecast results are output to the power grid dispatching system in XML format. XML is a universal data exchange format with good readability and scalability. The power grid dispatching system can easily read and parse these forecast results, thereby making reasonable power dispatching arrangements based on the forecast results and ensuring the stable operation of the power grid.

[0054] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0055] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0056] Figure 2 The diagram illustrates the structure of a model- and data-driven distributed energy and load fluctuation prediction device provided in an embodiment of the present invention. For ease of explanation, only the parts relevant to the embodiments of the present invention are shown, and are described in detail below: like Figure 2 As shown, the model- and data-driven distributed energy and load fluctuation prediction device 2 includes: The data acquisition module 21 is used to collect distributed energy output data, load consumption data, meteorological data and power grid operation data, unify the format to form a standardized raw dataset, clean the standardized raw dataset to form a high-quality dataset, and construct a feature matrix. Training module 22 is used to perform abnormal scene sample augmentation and model fine-tuning on the joint prediction model that integrates LSTM and attention mechanism, and to perform differential training based on the target region; wherein, the joint prediction model takes the feature matrix as input; The prediction module 23 is used to input the feature matrix of the target area into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset time period in the future.

[0057] In one possible implementation, the acquisition module 21 is specifically used for: Deploy distributed energy equipment, including photovoltaic inverters and wind turbine controllers; Deploy user-side power terminals, including smart meters and charging piles; deploy a third-party platform to collect data from weather stations and power grid dispatching systems. Acquire distributed energy output data, load consumption data, meteorological data, and power grid operation data. Meteorological data includes light intensity, wind speed, and temperature, while power grid operation data includes voltage and frequency. Standardize the collected distributed energy output data; The standardized output value is calculated using the first calculation formula based on the actual and rated values ​​of the collected data. The first calculation formula is:

[0058] Among them, P std The standardized energy output value, P, ranges from 0 to 1. act The actual value of the collected energy output is expressed in kW (Power), P. min The minimum output unit for this type of distributed energy is kW, P rated This is the rated output value of this type of distributed energy source, in kW, and is determined by the equipment parameters; Based on the mean and standard deviation of historical data, a second calculation formula is used to determine the outlier threshold. When a data point in the data sequence exceeds the threshold... upper or less than Th lower When an outlier is detected, it is identified and removed to obtain a high-quality dataset. Useful features are calculated for data in high-quality datasets. These features include Pearson correlation coefficient, mutual information entropy, and strong correlation between light intensity and photovoltaic output. These features are then constructed into a feature matrix, which is used to transform and transfer data from its original state to its usable features. The second calculation formula is:

[0059] Among them, Th upper Th is the upper limit threshold for outliers. lower σ is the lower limit threshold for outliers, μ is the mean of the data sequence to be cleaned, and σ is the standard deviation of the data sequence to be cleaned.

[0060] In one possible implementation, training module 22 is specifically used for: The output of the joint prediction model that integrates LSTM and attention mechanism is set to the prediction results for a future preset time period, specifically including the predicted value of distributed energy output and the predicted value of load fluctuation. Based on the attention mechanism, the key feature weights are determined using the third calculation formula, and the temporal feature weights of the LSTM layer output are calculated. The third calculation formula is:

[0061] Where X is the temporal feature matrix output by the LSTM layer, and its dimension is the number of samples × time step × number of features, W q W k W v These are the weight matrices for the query vector, key vector, and value vector, respectively, obtained through model training. Q is the query matrix, K is the key matrix, V is the value matrix, and d is the variable. k The dimension of the key vector is used to alleviate the curse of dimensionality. Softmax is the activation function used to normalize the weights to the range of 0-1. Collect historical abnormal power output / load data corresponding to extreme weather and emergencies; Construct a comprehensive training set that includes both normal and abnormal scenarios; The comprehensive training set is input into the initially trained joint prediction model for secondary fine-tuning to improve the model's ability to predict abnormal fluctuations. To obtain the differentiated energy structure and load characteristics of the target area; The parameters of the general feature extraction layer of the joint prediction model after secondary fine-tuning are extracted as pre-training weights; The parameters are optimized using the fifth calculation formula based on the predicted loss of the target region samples; The fifth calculation formula is:

[0062] Wherein, the variable θ in the formula new For the updated output prediction layer parameters, θ old The output prediction layer parameters before the update are given, and the variable η is the learning rate, which ranges from 0.001 to 0.01. The gradient operator is used to evaluate the parameters of the output prediction layer, and the variable L is the loss function, specifically y. true Relative to y pred The mean square error, y true The actual force output to the target area, variable y pred This represents the model's predicted value for the target region.

[0063] In one possible implementation, training module 22 is specifically used for: A dynamic weight w is assigned to each sample in the abnormal output / load data. The dynamic weight w is calculated based on the historical frequency of the abnormal event, the degree of power impact on the system, and the cooperative characteristics of source-load fluctuations during the event. For each anomalous event sample, extract the total output time series of distributed energy resources P={p_1, p_2, ..., p_m} and the total load fluctuation time series L={l_1, l_2, ..., l_n} within the event window, and calculate the minimum cumulative distance D_norm between the two series using the dynamic time warping algorithm. Then, use the formula Sim = exp- λ*D_norm Calculate the morphological similarity Sim, where λ is a preset positive scaling factor; The formula for calculating the dynamic weight w is: w=α*(1 / Freq)+β*(ΔP_max / P_nominal)+γ*Sim Where Freq is the historical frequency of this type of abnormal event, ΔP_max is the maximum deviation of the system net power from the baseline during this event, P_nominal is the system baseline capacity, and α, β and γ are adjustment coefficients; The specific calculation process for D_norm is as follows: For a distributed energy output sequence P (length m) and a load fluctuation sequence L (length n), construct an m×n distance matrix M, where the matrix element M[i][j] represents the absolute distance between p_i and l_j, i.e.: M[i][j] = |p_i - l_j| Construct an m×n cumulative distance matrix D, where D[i][j] represents the minimum cumulative distance from the starting point (1,1) of the sequence to the alignment point (i,j). Calculate this using dynamic programming: D[i][j] = M[i][j] + min( D[i-1][j], D[i][j-1], D[i-1][j-1]) where the boundary condition is: D[1][1] = M[1][1], and for the case of i=1 or j=1, only the defined adjacent elements are considered; Starting from D[m][n], trace backwards and select the adjacent element (top left, left or top) that minimizes the cumulative distance to obtain the optimal alignment path π. This path consists of a series of coordinate pairs {(i_1,j_1), (i_2,j_2), ..., (i_k,j_k)}, where k is the path length, and the minimum cumulative alignment distance D_min is D[m][n]. Calculate D_norm: D_norm = D_min / k, where k is the length of the optimal alignment path π; During the second fine-tuning process, the loss function used for model training is a dynamically weighted loss function.

[0064] In one possible implementation, training module 22 is specifically used for: Use the trained model parameters as the initial meta-parameters θ; Using a small amount of support set data of the target region, the initial meta parameter θ is updated by an inner loop gradient to obtain the adaptation parameter θ' corresponding to the region. Calculate the loss of the adaptation parameter θ' on the target region query set as the meta-loss; The initial parameters θ are optimized by minimizing the meta-loss through an outer loop. Among them, the initial parameter θ after optimization by the outer loop is used to obtain high-precision prediction capability through rapid fine-tuning when there is only a small amount of target area data.

[0065] In one possible implementation, the prediction module 23 is also used for: After inputting the feature matrix of the target region into the trained joint prediction model, the predicted results of distributed energy output and load fluctuation for the future preset time period are obtained. Then, the prediction results are corrected by physical information constraints to obtain the corrected prediction results. The correction is achieved by solving a constrained optimization problem. The goal of the problem is to minimize the change of the predicted values ​​before and after the correction. The constraints include the upper and lower limits of the technical output of distributed energy and the approximate constraints of node power balance. The uncertainty of the forecast results or the corrected forecast results is quantified to generate a forecast range of load and output within a preset time period in the future. Uncertainty quantification is achieved through quantile regression, and the quantile regression loss function L_quantile is: L_quantile=Σ[max(τ*(y_true-y_pred_τ),(τ-1)*(y_true-y_pred_τ))] Where τ is the target quantile, y_true is the true value, and y_pred_τ is the predicted τ quantile value output by the model; Based on the prediction interval, several typical prediction scenarios are constructed; Using multiple typical prediction scenarios as input, a multi-objective robust scheduling optimization model is driven to generate corresponding day-ahead scheduling plans; The multi-objective robust scheduling optimization model aims to minimize the total expected operating cost and the system risk cost, where the system risk cost C_risk is calculated using the following formula: C_risk=Σ_s[ρ_s*Σ_t(κ*max(0,L_s,t-L_line_max))] Where s represents different prediction scenarios, ρ_s is the weight of scenario s, L_s,t is the predicted load value at time t under scenario s, L_line_max is the transmission capacity limit of the critical line, and κ is the unit overload penalty coefficient. The dispatch plan and forecast results were recently output to the power grid dispatch system.

[0066] In one possible implementation, the mathematical model of the constrained optimization problem is as follows: Minimize the objective function: f = ||P_c - P_p||² + ||L_c - L_p||² Subject to the following constraints: (1) P_min≤P_c≤P_max; (2)∑P_c+P_grid_inj≈∑L_c; (3) L_c≥0; Where P_p and L_p are the original output and load prediction vectors, respectively; P_c and L_c are the corrected prediction vectors to be determined; P_min and P_max are the equipment output limit vectors; and P_grid_inj is the grid-injected power.

[0067] In one possible implementation, prediction module 23 is specifically used for: The feature matrix obtained by real-time acquisition and processing of the target region is input into the trained joint prediction model; The model calculates the predicted output of distributed energy resources for a predetermined time period. The fluctuation range is calculated using the sixth calculation formula based on the predicted load value and the baseline load value. The prediction results are output to the power grid dispatch system in XML format; The sixth calculation formula is:

[0068] In the formula, the variable ΔL represents the load fluctuation range, and its unit is %. pred The model predicts the load value for future periods, in kW, with variable L. base The baseline load value is measured in kW and is taken as the actual load value of the same period before the forecast period or the historical average load value for the same period.

[0069] This invention first standardizes and cleans multi-source heterogeneous data to ensure the quality and consistency of input data from the source, laying a reliable foundation for subsequent modeling. Secondly, it innovatively employs a joint prediction model integrating LSTM and an attention mechanism. This structure not only fully mines long-term temporal dependencies in historical data but also dynamically focuses on key historical moments and features most relevant to the current prediction through the attention mechanism. This accurately depicts the nonlinear, strongly coupled process of how meteorological changes affect energy output and how complex factors drive load fluctuations. Furthermore, the scheme designs a model optimization mechanism that includes abnormal scenario enhancement and cross-regional transfer learning. This enables the model to not only learn conventional patterns but also significantly improves its adaptability and predictive robustness to rare extreme events and regionally differentiated characteristics. Finally, this method outputs high-precision distributed energy output and load fluctuation prediction results, providing more accurate and reliable forward-looking data support for the power grid dispatching system. This helps optimize power generation plans, balance supply and demand, reduce operational risks, and significantly improve the stability and economy of power grid operation under a high proportion of renewable energy integration.

[0070] Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 3 As shown, the electronic device 3 in this embodiment includes a processor 30 and a memory 31. The memory 31 stores a computer program 32. When the processor 30 executes the computer program 32, it implements the steps in the various method embodiments described above. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the various device embodiments described above.

[0071] For example, computer program 32 may be divided into one or more modules / units, which are stored in memory 31 and executed by processor 30 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 32 in electronic device 3.

[0072] Electronic device 3 may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 3 may also include input / output devices, network access devices, buses, etc.

[0073] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.

[0074] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0075] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A model- and data-driven method for predicting distributed energy resources and load fluctuations, characterized in that, include: Data on distributed energy output, load consumption, meteorological data, and power grid operation are collected and formatted to form a standardized raw dataset. The standardized raw dataset is then cleaned to form a high-quality dataset, and a feature matrix is ​​constructed. Anomaly scene sample augmentation and model fine-tuning are performed on the joint prediction model that integrates LSTM and attention mechanisms, and differential training is carried out according to the target region; wherein, the joint prediction model takes the feature matrix as input; By inputting the feature matrix of the target area into the trained joint prediction model, the distributed energy output prediction results and load fluctuation prediction results for the future preset time period are obtained.

2. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 1, characterized in that, The collected distributed energy output data, load consumption data, meteorological data, and power grid operation data are formatted to form a standardized raw dataset. This standardized raw dataset is then cleaned to create a high-quality dataset, and a feature matrix is ​​constructed, including: Deploy distributed energy equipment, including photovoltaic inverters and wind turbine controllers; Deploy user-side power terminals, including smart meters and charging piles; deploy a third-party platform, which collects data from weather stations and power grid dispatching systems. Acquire distributed energy output data, load consumption data, meteorological data, and power grid operation data, wherein the meteorological data includes light intensity, wind speed, and temperature, and the power grid operation data includes voltage and frequency; Standardize the collected distributed energy output data; The standardized output value is calculated using the first calculation formula based on the actual and rated values ​​of the collected data. The first calculation formula is: P std is the normalized energy output value, whose value range is 0-1, P act is the actual value of the collected energy output unit is kW, P min is the minimum output value of the type of distributed energy unit is kW, P rated is the rated output value of the type of distributed energy, whose unit is kW, which is determined by the device parameters; Based on the mean and standard deviation of historical data, a second calculation formula is used to determine the outlier threshold. When a data point in the data sequence exceeds the threshold... upper or less than Th lower When an outlier is detected, it is identified and removed to obtain a high-quality dataset. The available features are calculated from the data in the high-quality dataset. The available features include Pearson correlation coefficient, mutual information entropy, and strong correlation between light intensity and photovoltaic output. These are constructed into a feature matrix, which is used to complete the transformation and transfer of data from its original state to available features. The second calculation formula is: Among them, Th upper Th is the upper limit threshold for outliers. lower σ is the lower limit threshold for outliers, μ is the mean of the data sequence to be cleaned, and σ is the standard deviation of the data sequence to be cleaned.

3. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 1, characterized in that, The method involves performing abnormal scene sample augmentation and model fine-tuning on the joint prediction model that integrates LSTM and attention mechanisms, and performing differentiated training based on the target region, including: The output of the joint prediction model that integrates LSTM and attention mechanism is set to the prediction results for a future preset time period, specifically including the predicted value of distributed energy output and the predicted value of load fluctuation. Based on the attention mechanism, the key feature weights are determined using the third calculation formula, and the temporal feature weights of the LSTM layer output are calculated. The third calculation formula is: Where X is the temporal feature matrix output by the LSTM layer, and its dimension is the number of samples × time step × number of features, W q W k W v These are the weight matrices for the query vector, key vector, and value vector, respectively, obtained through model training. Q is the query matrix, K is the key matrix, V is the value matrix, and d is the variable. k The dimension of the key vector is used to alleviate the curse of dimensionality. Softmax is the activation function used to normalize the weights to the range of 0-1. Collect historical abnormal power output / load data corresponding to extreme weather and emergencies; Construct a comprehensive training set that includes both normal and abnormal scenarios; The comprehensive training set is input into the initially trained joint prediction model for secondary fine-tuning to improve the model's ability to predict abnormal fluctuations. To obtain the differentiated energy structure and load characteristics of the target area; The parameters of the general feature extraction layer of the joint prediction model after secondary fine-tuning are extracted as pre-training weights; The parameters are optimized using the fifth calculation formula based on the predicted loss of the target region samples; The fifth calculation formula is: Wherein, the variable θ in the formula new For the updated output prediction layer parameters, θ old The output prediction layer parameters before the update are given, and the variable η is the learning rate, which ranges from 0.001 to 0.

01. The gradient operator is used to evaluate the parameters of the output prediction layer, and the variable L is the loss function, specifically y. true Relative to y pred The mean square error, y true The actual force output to the target area, variable y pred This represents the model's predicted value for the target region.

4. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 3, characterized in that, The construction of a comprehensive training set including normal and abnormal scenarios includes: A dynamic weight w is assigned to each sample in the abnormal power output / load data. The dynamic weight w is calculated based on the historical frequency of the abnormal event, the degree of power impact on the system, and the cooperative characteristics of source-load fluctuations during the event. For each anomalous event sample, extract the total output time series of distributed energy resources P={p_1, p_2,..., p_m} and the total load fluctuation time series L={l_1, l_2, ..., l_n} within the event window, and calculate the minimum cumulative distance D_norm between the two series using the dynamic time warping algorithm. Then, use the formula Sim = exp- λ*D_norm Calculate the morphological similarity Sim, where λ is a preset positive scaling factor; The formula for calculating the dynamic weight w is: w=α*(1 / Freq)+β*(ΔP_max / P_nominal)+γ*Sim Where Freq is the historical frequency of this type of abnormal event, ΔP_max is the maximum deviation of the system net power from the baseline during this event, P_nominal is the system baseline capacity, and α, β and γ are adjustment coefficients; The specific calculation process for D_norm is as follows: For a distributed energy output sequence P (length m) and a load fluctuation sequence L (length n), construct an m×n distance matrix M, where the matrix element M[i][j] represents the absolute distance between p_i and l_j, i.e.: M[i][j] = |p_i - l_j| Construct an m×n cumulative distance matrix D, where D[i][j] represents the minimum cumulative distance from the starting point (1,1) of the sequence to the alignment point (i,j). Calculate this using dynamic programming: D[i][j] = M[i][j] + min( D[i-1][j], D[i][j-1], D[i-1][j-1] ) where the boundary condition is: D[1][1] = M[1][1], and for the case of i=1 or j=1, only the defined adjacent elements are considered; Starting from D[m][n], trace backwards and select the adjacent element (top left, left or top) that minimizes the cumulative distance to obtain the optimal alignment path π. This path consists of a series of coordinate pairs {(i_1,j_1), (i_2,j_2), ..., (i_k,j_k)}, where k is the path length, and the minimum cumulative alignment distance D_min is D[m][n]. Calculate D_norm: D_norm = D_min / k, where k is the length of the optimal alignment path π; During the second fine-tuning process, the loss function used for model training is the loss function weighted by the dynamic weights.

5. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 3, characterized in that, The differential training based on the target region is specifically performed through a model-independent meta-learning framework, including: Use the trained model parameters as the initial meta-parameters θ; Using a small amount of support set data of the target region, the meta-initial parameter θ is updated by an inner loop gradient to obtain the adaptation parameter θ' corresponding to the region. Calculate the loss of the adaptation parameter θ' on the target region query set as the meta-loss; The initial parameters θ of the meta-loss are optimized by an outer loop; Among them, the initial parameter θ after optimization by the outer loop is used to obtain high-precision prediction capability through rapid fine-tuning when there is only a small amount of target area data.

6. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 1, characterized in that, After inputting the feature matrix of the target region into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset future time period, the method further includes: The prediction results are corrected by physical information constraints to obtain the corrected prediction results. The correction is achieved by solving a constrained optimization problem. The goal of the problem is to minimize the change in the prediction values ​​before and after the correction. The constraints include the upper and lower limits of the technical power output of distributed energy sources and the approximate constraints of node power balance. The uncertainty of the prediction result or the corrected prediction result is quantified to generate a prediction range of load and output within a preset time period in the future. The uncertainty quantification is achieved through quantile regression, and the quantile regression loss function L_quantile is: L_quantile=Σ[max(τ*(y_true-y_pred_τ),(τ-1)*(y_true-y_pred_τ))] Where τ is the target quantile, y_true is the true value, and y_pred_τ is the predicted τ quantile value output by the model; Based on the prediction interval, several typical prediction scenarios are constructed; Using the aforementioned typical prediction scenarios as input, a multi-objective robust scheduling optimization model is driven to generate corresponding day-ahead scheduling plans; The multi-objective robust scheduling optimization model aims to minimize the total expected operating cost and the system risk cost, where the system risk cost C_risk is calculated using the following formula: C_risk=Σ_s[ρ_s*Σ_t(κ*max(0,L_s,t-L_line_max))] Where s represents different prediction scenarios, ρ_s is the weight of scenario s, L_s,t is the predicted load value at time t under scenario s, L_line_max is the transmission capacity limit of the critical line, and κ is the unit overload penalty coefficient. The day-ahead dispatch plan and the forecast results are output to the power grid dispatch system.

7. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 6, characterized in that, The mathematical model for the constrained optimization problem is: Minimize the objective function: f = ||P_c - P_p||² + ||L_c - L_p||² Subject to the following constraints: (1) P_min≤P_c≤P_max; (2)∑P_c+P_grid_inj≈∑L_c; (3) L_c≥0; Where P_p and L_p are the original output and load prediction vectors, respectively; P_c and L_c are the corrected prediction vectors to be determined; P_min and P_max are the equipment output limit vectors; and P_grid_inj is the grid-injected power.

8. The model- and data-driven method for predicting distributed energy resources and load fluctuations according to claim 1, characterized in that, The step of inputting the feature matrix of the target region into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset future time period includes: The feature matrix obtained by real-time acquisition and processing of the target region is input into the trained joint prediction model; The model calculates the predicted output of distributed energy resources for a predetermined time period. The fluctuation range is calculated using the sixth calculation formula based on the predicted load value and the baseline load value. The prediction results are output to the power grid dispatch system in XML format; The sixth calculation formula is: In the formula, the variable ΔL represents the load fluctuation range, and its unit is %. pred The model predicts the load value for future periods, in kW, with variable L. base The baseline load value is measured in kW and is taken as the actual load value of the same period before the forecast period or the historical average load value for the same period.

9. A model- and data-driven distributed energy and load fluctuation prediction device, characterized in that, include: The data acquisition module is used to collect distributed energy output data, load consumption data, meteorological data, and power grid operation data, unify their formats to form a standardized raw dataset, clean the standardized raw dataset to form a high-quality dataset, and construct a feature matrix. The training module is used to perform abnormal scene sample augmentation and model fine-tuning on the joint prediction model that integrates LSTM and attention mechanisms, and to perform differential training based on the target region; wherein, the joint prediction model takes the feature matrix as input; The prediction module is used to input the feature matrix of the target area into the trained joint prediction model to obtain the distributed energy output prediction results and load fluctuation prediction results for a preset time period in the future.

10. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 8.