A power prediction method and system fusing physical constraint factors

By constructing a power prediction model that integrates physical constraints, the problems of ignoring physical laws and being unable to quantify uncertainties in existing technologies are solved. This enables high-precision power prediction and reliability assessment across multiple time scales, supporting intelligent decision-making in the power grid.

CN121503824BActive Publication Date: 2026-04-28国网福建省电力有限公司营销服务中心 +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
国网福建省电力有限公司营销服务中心
Filing Date
2026-01-13
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing power system power forecasting methods rely on data-driven approaches, ignore physical laws, struggle to maintain optimal performance across multiple time scales, and cannot quantify forecast uncertainties, leading to difficulties in grid dispatching.

Method used

A power generation prediction method incorporating physical constraints is adopted. This method constructs a power generation prediction model with a physical information neural network as its core, which includes a recursive submodule and a trend submodule. It combines multi-task learning and uncertainty quantification, utilizes multi-source heterogeneous data for feature selection and preprocessing, adds a physical constraint loss term to ensure the physical feasibility of the prediction, and quantifies the uncertainty of the prediction results.

Benefits of technology

It improves the accuracy and robustness of power generation forecasting, provides the probability distribution and confidence interval of power generation forecast values, enhances the reliability and risk assessment capabilities of power grid dispatching, and meets the intelligent decision-making needs of modern power systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503824B_ABST
    Figure CN121503824B_ABST
Patent Text Reader

Abstract

The application provides a power prediction method and system fusing physical constraint factors, and relates to the technical field of power prediction. Historical load, weather, electricity price and calendar data are collected, preprocessed and subjected to feature selection to construct a key feature set; a prediction model with a physical information neural network as a core is constructed, which comprises a recursive submodule for short-term prediction and a trend submodule for long-term prediction, and a physical constraint loss term based on physical laws is introduced in model training to enhance the generalization ability; a multi-time granularity modeling framework is adopted, and Monte Carlo Dropout or a Bayesian neural network is used to realize uncertainty quantification, so that the confidence interval of the predicted value is output; finally, the Shapley value algorithm and counterfactual simulation are used for causal reasoning to identify key influencing factors. The application effectively improves the accuracy, stability and interpretability of power prediction, and provides reliable support for power grid dispatching and decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a power prediction method and system that incorporates physical constraints, belonging to the field of power prediction technology. Background Technology

[0002] Against the backdrop of global energy transition and the advancement of "dual-carbon" goals, building a new power system with new energy sources as the mainstay has become a core direction for the development of the power industry. Electricity demand forecasting, as a fundamental supporting technology for power system operation optimization and market decision-making, directly affects the security of grid regulation, the capacity for renewable energy absorption, and the efficiency of power resource allocation.

[0003] However, with the continuous development of power big data towards massive scale, heterogeneity, and high dimensionality, existing technologies face severe challenges. Currently, for example, Chinese invention patent application CN117521724A discloses a power load forecasting method and device based on an LSTM network model, representing a typical pure data-driven technical path in this field. This technical solution trains the LSTM model using historical load, meteorological, and economic data to predict future loads. However, its model relies entirely on statistical regularities in the data, ignoring the physical laws that the power system must follow (such as power balance). This can lead to predictions that violate physical principles when training data coverage is insufficient or extreme scenarios are encountered, limiting generalization ability and reliability. Secondly, the aforementioned technical solution uses a single model to address all forecasting needs, failing to fully consider the essential differences in characteristics between short-term fluctuations and long-term trends, making it difficult to maintain optimal performance simultaneously across multiple time scales. Furthermore, its prediction results are single, deterministic values, making it impossible to quantify the uncertainty of the prediction, thus making it difficult for grid dispatchers to assess forecast risks and make decisions.

[0004] In summary, there is an urgent need in this field for a power forecasting method that can integrate physical laws and data-driven approaches, take into account the forecasting needs of multiple time scales, and provide uncertainty quantification and causal explanation, so as to meet the urgent need of modern power systems for intelligent decision support. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention proposes a power prediction method and system that integrates physical constraint factors.

[0006] The technical solution of the present invention is as follows:

[0007] On one hand, the present invention provides a power prediction method that incorporates physical constraints, the method comprising:

[0008] Collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data; after preprocessing the multi-source heterogeneous data, construct a key feature set using a feature selection algorithm;

[0009] A power prediction model with a physical information neural network as its core framework is constructed. The power prediction model includes a recursive submodule for short-term prediction and a trend submodule for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities. During the training process of the power prediction model, the loss function of the submodule consists of a data-driven loss term and a physical constraint loss term. The physical constraint loss term is constructed based on the physical laws of the power system.

[0010] The trained power prediction model outputs power prediction values ​​for a future target time period, and uncertainty quantification is used to process the power prediction values ​​to obtain the probability distribution and confidence interval of the power prediction values.

[0011] Preferably, the recursive submodule is an LSTM network or a Transformer network; the trend submodule is a Prophet model.

[0012] Preferably, the physical constraint loss term is constructed based on the physical laws of the power system, specifically as follows:

[0013] The load values ​​predicted by the recursive submodule and the trend submodule are taken as known quantities and substituted into the constraint equations corresponding to the physical laws, which include power balance constraints, node voltage constraints, and line and transformer capacity constraints. The calculated sum of squared residuals is used as the total physical constraint loss term for the recursive submodule and the trend submodule. .

[0014] Preferably, the power prediction model is trained using a multi-task learning framework; the total loss function of the power prediction model is composed of a weighted average of the total data-driven terms and the total physical constraint terms corresponding to the recursive submodule and the trend submodule.

[0015] Preferably, when constructing the key feature set, the timestamps and holiday markers in the multi-source heterogeneous data are Fourier feature encoded and then input into the recursive submodule.

[0016] Preferably, the uncertainty quantization specifically employs the Monte Carlo Dropout algorithm. A Dropout layer is configured in the fully connected layer of the recursive submodule. When the power prediction model performs predictions, the Dropout layer remains active, and the same input is processed... The second forward propagation yields... The prediction results are based on the The expected value and variance of the prediction results are calculated from the statistical distribution of each prediction result, and confidence intervals are constructed based on the expected value and variance.

[0017] Preferably, the method further includes, after obtaining the predicted power consumption value, using the Shapley value algorithm to calculate the contribution of each feature in the key feature set to the predicted power consumption value, and performing causal reasoning analysis to obtain key influencing factors.

[0018] On the other hand, the present invention also provides a power prediction system that incorporates physical constraints, the system comprising:

[0019] The data acquisition module is used to collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data;

[0020] The data preprocessing and feature selection module is used to preprocess the multi-source heterogeneous data and then construct a key feature set using a feature selection algorithm;

[0021] The power prediction module internally constructs a power prediction model with a physical information neural network as its core framework. This model includes a recursive submodule for short-term prediction and a trend submodule for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities. During the training process of the power prediction model, the loss function of the submodule consists of a data-driven loss term and a physical constraint loss term, wherein the physical constraint loss term is constructed based on the physical laws of the power system. The trained power prediction model outputs power prediction values ​​for future target time periods.

[0022] The prediction result reliability assessment module uses uncertainty quantification to process the predicted power consumption value to obtain the probability distribution and confidence interval of the predicted power consumption value;

[0023] The causal reasoning module is used to calculate the contribution of each feature in the key feature set to the predicted electricity value using the Shapley value algorithm, and to perform causal reasoning analysis to obtain key influencing factors.

[0024] In another aspect, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a power prediction method that incorporates physical constraints as described in the present invention.

[0025] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a power prediction method incorporating physical constraints as described in the present invention.

[0026] The present invention has the following beneficial effects:

[0027] 1. This invention provides a power generation prediction method and system that integrates physical constraints. It collects multi-source heterogeneous data from a power system, preprocesses it, and then uses a feature selection algorithm to construct a key feature set. Fourier feature encoding is applied to timestamps and holiday markers in the data. The multi-source heterogeneous data covers various factors affecting power generation, improving data quality. Preprocessing removes noise and missing values, enhancing data usability. The feature selection algorithm filters key features from a large amount of data, reducing computation and lowering the model input dimensionality, thus improving model training and prediction efficiency. Fourier feature encoding effectively converts time and holiday information, enabling the model to better capture the periodicity and seasonality of time series data, enhancing the model's generalization ability.

[0028] 2. This invention provides a power generation prediction method and system that integrates physical constraints. It constructs a power generation prediction model with a physical information neural network as its core framework. This model also includes a recursive sub-module for short-term prediction and a trend sub-module for long-term prediction. During training, the sub-module loss function consists of a data-driven loss term and a physical constraint loss term constructed based on the physical laws of power system power balance. The addition of the physical constraint loss term allows the model to consider the physical laws of the power system, avoiding unreasonable prediction results. This invention also employs a multi-task learning framework to train the model, simultaneously optimizing the losses of different sub-modules, thereby improving the model's prediction performance at different time scales. This step improves prediction accuracy. By combining different sub-modules and fully leveraging their respective advantages, it accurately predicts power generation changes at different time scales.

[0029] 3. This invention provides a power generation prediction method and system that integrates physical constraints. By employing Monte Carlo Dropout or Bayesian networks to quantify the uncertainty of power generation predictions, and by modifying the fully connected layer of the recursive submodule, multiple forward propagations are performed on the same input during prediction to obtain multiple prediction results. Based on these results, the expected value and variance of the prediction are calculated, and confidence intervals are constructed, providing the probability distribution and confidence intervals of the power generation predictions, allowing users to understand the degree of uncertainty of the prediction results. Furthermore, multiple forward propagations can capture model uncertainty, reduce prediction errors caused by data fluctuations or model biases, and enhance model robustness. The calculated confidence intervals help in risk assessment, enabling users to evaluate the reliability of prediction results and formulate risk management strategies based on their range. Attached Figure Description

[0030] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] It should be understood that the step numbers used in the text are for ease of description only and are not intended to limit the order in which the steps are performed.

[0033] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0034] The terms “comprising” and “including” indicate the presence of the described feature, whole, step, operation, element and / or component, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0035] The term “and / or” refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes these combinations.

[0036] Example 1:

[0037] like Figure 1 As shown, this embodiment provides a power prediction method that incorporates physical constraints. The method includes:

[0038] S1. Collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data. Specifically, in this embodiment:

[0039] S11. The historical load data is mainly obtained from the power grid dispatch automation system. In order to ensure that the complete seasonal change cycle is covered, the time span of historical load data collection is 3 years past the current time point, and the collection frequency is set to one data point per hour. It includes the total regional load, the load of each voltage level, and the electricity consumption data of key industrial users.

[0040] S12. The meteorological data is obtained through a professional API interface provided by the meteorological bureau, including key meteorological elements such as temperature, humidity, wind speed, precipitation and sunshine intensity. The collection frequency is aligned with the timestamp of the load data, which is once per hour.

[0041] S13. The electricity price data is policy data, collected from documents and announcements issued by the power trading center. It mainly includes the time-of-use electricity price period division, the electricity price level of each period, and the effective time of future electricity price adjustments. The electricity price data is collected when the policy is issued or changed.

[0042] S14. The calendar data includes statutory holidays, weekend markers, and special event days (such as major events and industrial shutdown and maintenance periods). The calendar data is date-marked data and is collected and updated when the annual calendar is determined or when a special event occurs.

[0043] S2. After preprocessing the multi-source heterogeneous data, a key feature set is constructed using a feature selection algorithm. Specifically:

[0044] S21. The data preprocessing is used to integrate the multi-source data with varying frequencies and types collected in S1 into a unified, clean, standardized input feature matrix with hourly time granularity. This includes time alignment, data cleaning, data imputation, and data normalization, wherein:

[0045] S211. The time alignment uses the hour as the base time axis, integrating data from all sources for each hour timestamp. Specifically:

[0046] For historical load data and meteorological data, since they are already at an hourly frequency, the time alignment addresses the microsecond-level offset of timestamps caused by system delays or communication interruptions. For example, 2024-01-01 10:05:23 is normalized to 2024-01-01 10:00:00.

[0047] For electricity price data, based on the effective time of the electricity price data, each point on the hourly time axis is labeled with the corresponding electricity price. For example, if the peak electricity price is from 08:00 to 12:00, then the electricity price period characteristics of all hourly timestamps within this period are marked as peak, and the electricity price level characteristics are marked as peak price.

[0048] For calendar data, the dates corresponding to holidays and weekends are marked and extended to the timestamps of each hour contained on that date. For example, if October 1, 2024 is National Day, then the 24 hours from 00:00 to 23:00 on that day will all be marked as holidays.

[0049] S212. Perform data cleaning on the aligned multi-source heterogeneous data, including using 3 The principles are to filter out obvious outliers, such as outliers in load data that exceed historical maximum or minimum values; remove duplicate data based on normalized timestamps; and smooth instantaneous fluctuations in meteorological data using moving average filtering.

[0050] S213. Data imputation is performed on the multi-source heterogeneous data after data cleaning. In this embodiment, a linear interpolation algorithm is used to imput short-term missing data such as those that are continuously missing for less than 3 hours, while a time series-based ARIMA model is used to predict and imput long-term missing data that are missing for more than 24 hours.

[0051] S214. Normalize the complete data after data filling, including using the Min-Max scaling method to map all numerical features (such as load, temperature, humidity, and electricity price level) to the [0,1] interval, and perform one-hot encoding on categorical features (such as electricity price period and whether it is a holiday); and concatenate the normalized features in the time dimension to form a standardized feature matrix with hourly granularity.

[0052] S22. In this embodiment, using the standardized feature matrix as input, the maximum correlation minimum redundancy feature selection algorithm is used to remove redundant features from all features and retain the main variables, thereby obtaining the key feature set. Specifically:

[0053] S221. To measure the correlation between each feature and the target load value, the Pearson correlation coefficient is used to calculate the correlation between the feature and the target load value. The Pearson correlation coefficient ranges from -1 to 1. The closer the absolute value is to 1, the stronger the correlation; the closer it is to 0, the weaker the correlation. Positive values ​​indicate positive correlation, and negative values ​​indicate negative correlation. For example, an increase in temperature leads to increased use of cooling equipment such as air conditioners, which in turn increases the electricity load. In this case, temperature and load value are positively correlated. However, during off-peak hours when electricity prices are low at night, some adjustable electrical equipment chooses to operate at this time, resulting in a negative correlation between electricity price and load value. By calculating the Pearson correlation coefficient between each feature and the target load value, the correlation score of each feature is obtained.

[0054] S222. Use mutual information to measure the redundancy between features. The larger the mutual information value, the higher the redundancy between the two features. For example, wind speed and wind force level are both related to wind conditions. A large mutual information value indicates that there is a high degree of redundancy. Calculate the mutual information between each pair of features in all features and construct a redundancy matrix.

[0055] S223. Select the feature with the highest correlation to the target load value from all features as the initial feature subset. For example, if the correlation score between temperature and the target load value is the highest, then the initial feature subset will only contain the feature of temperature.

[0056] In each iteration, one feature is selected from the remaining features of all features to be added to the current feature subset. The selection criterion is to make the new feature subset satisfy the principle of maximum relevance and minimum redundancy. Specifically, the relevance of each remaining feature to the target load value and the sum of the redundancy of that feature with all features in the current feature subset are calculated. The feature with high relevance and minimum redundancy is selected to be added to the current feature subset. For example, in the first iteration, the remaining features are humidity, wind speed, electricity price level, etc. The relevance of each feature to the target load value and the sum of the redundancy with temperature are calculated. If humidity has a high relevance and the minimum redundancy with temperature, then humidity is added to the current feature subset.

[0057] The iterative search stops when the termination condition is met. The feature subset at this point is the optimized key feature set. The termination condition is set according to user needs or specific circumstances, such as reaching a preset upper limit on the number of features, or when the performance improvement of the feature subset is no longer significant after adding new features.

[0058] S3. Construct a power prediction model with a physical information neural network as the core framework. In this embodiment, the power prediction model is an integrated architecture, which consists of a physical information neural network as the data-driven main network, combined with a recursive sub-module for short-term prediction and a trend sub-module for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities.

[0059] S31. Before inputting the key feature set into the power prediction model, Fourier feature encoding is performed on the periodic category features (such as the hour of the day or the day of the year) to convert them into sine and cosine components, while non-periodic category features such as holiday markers are directly input as discrete signals.

[0060] S32. In this embodiment, the physical information neural network adopts a 5-8 layer fully connected neural network structure, with each layer containing 50-200 neurons. The activation function is Swish or Tanh to improve the nonlinear fitting ability.

[0061] S33. Further, in this embodiment, the recursive submodule is an LSTM network or a Transformer network. When an LSTM network is selected, the LSTM network takes the output of the physical information neural network as its input. Its structure includes two LSTM layers, each with 128 hidden units, followed by a fully connected layer containing 50 neurons, and finally outputs a short-term power prediction value. When a Transformer network is selected, the Transformer network also takes the output of the physical information neural network as its input. Its structure includes an encoder, which consists of three layers, each using eight attention heads. Each attention head has a dimension of 64, and the feedforward network has a dimension of 256. After the encoder output is passed through a global average pooling layer and a fully connected layer, it finally outputs a short-term power prediction value.

[0062] S34. Further, in this embodiment, the trend submodule is a Prophet model. In long-term prediction, the input of the Prophet model includes two parts:

[0063] S341. Extract and aggregate feature information from the output of the physical information neural network, for example, calculate the daily average from the hourly granularity;

[0064] S342. Use, for example, STL decomposition or the decomposition algorithm of the Prophet model itself to decompose the historical load data of the past 3 years into a time series and directly extract the long-term trend components.

[0065] S343. The Prophet model utilizes its built-in additive model (including trend, seasonal and holiday effects) to fit and extrapolate long-term electricity forecast values ​​based on the data extracted in steps S341 and S342. Since the Prophet model is an existing model, it will not be described in detail here.

[0066] S35. The power prediction model is trained. In this embodiment, the training process is as follows:

[0067] A multi-task learning framework is adopted, simultaneously optimizing sub-modules for short-term and long-term predictions. The loss function of each sub-module consists of a data-driven loss term and a physical constraint loss term. The data-driven loss term measures the deviation between the model's predicted values ​​and the actual observed values, and is constructed based on common statistical error measures (MSE, MAE). The physical constraint loss term measures whether the model's prediction results violate the physical feasible region of the power system, and is constructed based on the physical laws of the power system, including power balance, node voltage limits, and line and transformer capacity safety limits. For ease of explanation, this embodiment mainly uses power balance constraints as an example for construction. Specifically:

[0068] The load values ​​predicted by the recursive submodule and the trend submodule are taken as known quantities and substituted into the power balance equation. The sum of squared residuals of the calculated power balance equation is taken as the physical constraint loss term, expressed by the formula:

[0069] ;

[0070] In the formula, This represents the residual loss value corresponding to the power balance constraint. The physical constraint is the number of samples; For the first Known power generation data for each sample; For the first Load forecast values ​​for each sample; For the first The network loss power of each sample is calculated based on the network topology and impedance parameters;

[0071] It is worth noting that the power balance constraint described above is only a specific implementation example of the physical constraint loss term. In practical applications, other physical constraint loss terms can be similarly introduced and constructed according to specific prediction requirements and system modeling depth, for example:

[0072] When constructing with node voltage constraints:

[0073] ;

[0074] In the formula, This represents the residual loss value corresponding to the node voltage constraint. This represents the total number of power grid nodes. For the first Voltage amplitude at each node; and These are the maximum and minimum allowable voltage limits for the node, respectively.

[0075] When constructing a system constrained by line and transformer capacity:

[0076] ;

[0077] In the formula, This represents the residual loss value corresponding to the capacity constraints of the line and transformer. and These refer to the total number of lines and the number of transformers, respectively. For the first The amplitude of the apparent power of the line; For the first The maximum rated capacity of each line; For the first Apparent power load of the transformer; For the first The rated capacity of the transformer;

[0078] In this embodiment, the physical constraint loss term It can be regarded as a weighted sum or combination of the above-mentioned specific physical constraint loss terms;

[0079] Preferably, when the constraints on which the construction is based are different, the multi-source heterogeneous data obtained in step S1 will also be different. For example, to construct node voltage constraints, it is necessary to obtain network topology and impedance parameters, and to construct capacity constraints, it is necessary to obtain the rated parameters of lines and transformers, etc. The process of obtaining multi-source heterogeneous data in S1 and the corresponding data preprocessing in S2 will not be described in detail here.

[0080] It is worth noting that the physical constraint residual loss term in the above formula is the total physical constraint residual loss value corresponding to the recursive submodule and the trend submodule.

[0081] S4. Utilize the trained power prediction model to output the power prediction value for the target time period in the future. Specifically, for short-term predictions (such as the next 24 hours), input the key feature set of the current moment and output the short-term power prediction value through the recursive submodule; for long-term predictions (such as the next month), input the key feature set and historical trend items and output the long-term power prediction value through the trend submodule.

[0082] S5. The predicted power consumption value is processed using uncertainty quantization. In this embodiment, the uncertainty quantization is implemented based on a Bayesian neural network or Monte Carlo Dropout to obtain the probability distribution and confidence interval of the predicted power consumption value. Specifically:

[0083] S51. When choosing Monte Carlo Dropout for uncertainty quantification, configure a Dropout layer in the fully connected layer of the recursive submodule, setting the Dropout rate to 0.1-0.3. Keep the Dropout layer active while the power prediction model is making predictions, and apply the same input... Second forward propagation (in this embodiment) ),get The prediction results are based on the The statistical distribution of each prediction result is used to calculate the expected value and variance of the prediction, expressed by the following formula:

[0084] ;

[0085] ;

[0086] In the formula, For the first The prediction result; for Predicted expectations at any given time; for The variance of the prediction at any given time;

[0087] Based on the predicted expectation and variance, a 95% confidence interval is constructed, expressed by the formula:

[0088] ;

[0089] In the formula, for The confidence interval at time; for The standard deviation of the forecast at any given time;

[0090] The confidence interval is used to assess the risk of predicted volatility.

[0091] S52. When choosing to implement uncertainty quantification based on Bayesian neural networks, the fully connected layer of the recursive submodule is transformed into a Bayesian fully connected layer. Specifically, when the recursive submodule is an LSTM network, the transformation target is the 50-neuron fully connected layer at the end; when it is a Transformer network, the transformation target is the fully connected layer at the end.

[0092] The weights in the fully connected layer and bias To transform a deterministic value into a probability distribution, this embodiment sets a prior distribution for it. For example, it assumes that the weights follow a Gaussian prior with zero mean. The prior standard deviation Set to 1.0; learn an approximate posterior distribution through variational inference. In this embodiment, the approximate posterior is also assumed to be a Gaussian distribution with a mean of . and standard deviation Constructing trainable parameters ;

[0093] Preferably, the total loss function for power prediction is a weighted sum of the recursive submodule loss and the trend submodule loss. In this embodiment, it is specifically composed of the weighted sum of the total data-driven terms and total physical constraint terms corresponding to the recursive submodule and the trend submodule. The weights are dynamically adjusted according to the importance of the prediction granularity. For example, the short-term prediction weight is set to 0.6, and the long-term prediction weight is set to 0.4. The Adam optimizer is used during training, the initial learning rate is 0.001, and a cosine annealing strategy is used for adjustment. The batch size is set to 32, the number of training rounds is 100-200, and an early stopping method is used to prevent overfitting.

[0094] To improve the generalization ability of the power consumption prediction model and reduce the risk of overfitting, this embodiment adds a regularization term from a Bayesian neural network, namely the KL divergence, to the total loss function of the power consumption prediction model. This is expressed by the following formula:

[0095] ;

[0096] In the formula, The equilibrium coefficient of the KL divergence; This is the total loss function of the power prediction model; For total data-driven loss; and These are the balance coefficients for the total data-driven terms and the total physical constraint terms, respectively. It is a variational distribution; It is the prior distribution;

[0097] When performing power prediction after training, the same input is used... Second forward propagation (in this embodiment) Each forward propagation starts from the learned posterior distribution. By sampling a new set of weights and biases, we can obtain For each different prediction result, the corresponding confidence interval is obtained in step S51.

[0098] S6. Use the Shapley value algorithm to calculate the contribution of each feature in the key feature set to the predicted electricity value, and perform causal reasoning analysis to obtain key influencing factors. Specifically:

[0099] A representative sample (e.g., 1000 time points) is extracted from the key feature set. For the prediction result of each sample, its Shapley value is calculated using the SHAP library. Specifically:

[0100] The power prediction model is viewed as a cooperative game, where the power prediction value is the total payoff of the game. Each feature is a player. By enumerating the marginal contribution of the feature in all possible feature subsets and taking the average, the Shapley value of the feature is obtained. The Shapley value is the contribution of the feature to the prediction. A positive value indicates an increase in the prediction load, and a negative value indicates a decrease in the prediction load.

[0101] Aggregate the Shapley values ​​of all samples, calculate the mean absolute Shapley value of each feature, sort them from largest to smallest according to the mean absolute Shapley value, and identify the top 10% of features as key influencing factors.

[0102] Furthermore, based on the aforementioned key influencing factors, the input change scenarios to be evaluated are defined. For example, to evaluate the effectiveness of adjusting time-of-use electricity pricing policies during periods of high summer temperatures, the following scenario can be set up:

[0103] This means that the numerical characteristic of peak electricity price level will be increased by 10%, and in the category characteristic of electricity price period, a certain number of hours that were originally normal (such as 11:00-12:00) will be remarked as peak hours; This means that the numerical characteristic of temperature is uniformly increased by 2°C during the simulation period to simulate more extreme hot weather;

[0104] Input features and changes in the power prediction model in step S31 Add them together to form a new scene input. It should be noted that changes in categorical features (such as electricity price periods) require re-encoding using one-hot encoding.

[0105] Will The data is input into the pre-trained power prediction model to obtain the power prediction value for the scenario. By comparing the preset benchmark prediction value with the power prediction value for the scenario, the changes in key indicators are calculated. For example, the key indicators in this embodiment include the daily peak load change and the total power consumption change.

[0106] The changes in the key influencing factors and key indicators are transmitted to users to optimize power decision-making.

[0107] Example 2:

[0108] This embodiment provides a power prediction system that incorporates physical constraints, the system comprising:

[0109] The data acquisition module is used to collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data;

[0110] The data preprocessing and feature selection module is used to preprocess the multi-source heterogeneous data and then construct a key feature set using a feature selection algorithm;

[0111] The power prediction module internally constructs a power prediction model with a physical information neural network as its core framework. This model includes a recursive submodule for short-term prediction and a trend submodule for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities. During the training process of the power prediction model, the loss function of the submodule consists of a data-driven loss term and a physical constraint loss term, wherein the physical constraint loss term is constructed based on the physical laws of the power system. The trained power prediction model outputs power prediction values ​​for future target time periods.

[0112] The prediction result reliability assessment module uses uncertainty quantification to process the predicted power consumption value to obtain the probability distribution and confidence interval of the predicted power consumption value;

[0113] The causal reasoning module is used to calculate the contribution of each feature in the key feature set to the predicted electricity value using the Shapley value algorithm, and to perform causal reasoning analysis to obtain key influencing factors.

[0114] Example 3:

[0115] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements a power prediction method that incorporates physical constraints as described in any embodiment of the present invention.

[0116] Example 4:

[0117] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a power prediction method incorporating physical constraints as described in any embodiment of the present invention.

[0118] It is worth noting that the system, electronic device, and computer-readable storage medium described in this invention are all based on the same inventive concept as the method described in this invention, and will not be described again here.

[0119] In this embodiment of the invention, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0120] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0121] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0122] In several embodiments provided by this invention, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0123] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for predicting electricity consumption by incorporating physical constraints, characterized in that, The method includes: Collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data; after preprocessing the multi-source heterogeneous data, construct a key feature set using a feature selection algorithm; A power prediction model with a physical information neural network as its core framework is constructed. The power prediction model includes a recursive submodule for short-term prediction and a trend submodule for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities. During the training process of the power prediction model, the loss function of the submodule consists of a data-driven loss term and a physical constraint loss term. The physical constraint loss term is constructed based on the physical laws of the power system. The trained power prediction model outputs power prediction values ​​for a future target time period, and uncertainty quantification is used to process the power prediction values ​​to obtain the probability distribution and confidence interval of the power prediction values.

2. The power prediction method incorporating physical constraints according to claim 1, characterized in that, The recursive submodule is an LSTM network or a Transformer network; the trend submodule is a Prophet model.

3. The power prediction method incorporating physical constraints according to claim 2, characterized in that, The physical constraint loss term is constructed based on the physical laws of the power system, specifically as follows: The load values ​​predicted by the recursive submodule and the trend submodule are taken as known quantities and substituted into the constraint equations corresponding to the physical laws, which include power balance constraints, node voltage constraints, and line and transformer capacity constraints. The calculated sum of squared residuals is used as the total physical constraint loss term for the recursive submodule and the trend submodule. .

4. The power prediction method incorporating physical constraints according to claim 3, characterized in that, The power prediction model is trained using a multi-task learning framework; the total loss function of the power prediction model is composed of a weighted sum of the total data-driven terms and the total physical constraint terms corresponding to the recursive submodule and the trend submodule.

5. The power prediction method incorporating physical constraints according to claim 1, characterized in that, When constructing the key feature set, the timestamps and holiday markers in the multi-source heterogeneous data are Fourier feature encoded and then input into the recursive submodule.

6. The power prediction method incorporating physical constraints according to claim 1, characterized in that, The uncertainty quantification specifically employs the Monte Carlo Dropout algorithm. A Dropout layer is configured in the fully connected layer of the recursive submodule. When the power prediction model performs predictions, the Dropout layer remains active, and the same input is processed... The second forward propagation yields... The prediction results are based on the The expected value and variance of the prediction results are calculated from the statistical distribution of each prediction result, and confidence intervals are constructed based on the expected value and variance.

7. The power prediction method incorporating physical constraints according to claim 1, characterized in that, The method also includes, after obtaining the predicted power consumption value, using the Shapley value algorithm to calculate the contribution of each feature in the key feature set to the predicted power consumption value, and performing causal reasoning analysis to obtain key influencing factors.

8. A power prediction system incorporating physical constraints, characterized in that, The system includes: The data acquisition module is used to collect multi-source heterogeneous data related to the power system, including historical load data, meteorological data, electricity price data, and calendar data; The data preprocessing and feature selection module is used to preprocess the multi-source heterogeneous data and then construct a key feature set using a feature selection algorithm; The power prediction module internally constructs a power prediction model with a physical information neural network as its core framework. This model includes a recursive submodule for short-term prediction and a trend submodule for long-term prediction. It takes a key feature set as input and outputs power prediction values ​​at different time granularities. During the training process of the power prediction model, the loss function of the submodule consists of a data-driven loss term and a physical constraint loss term, wherein the physical constraint loss term is constructed based on the physical laws of the power system. The trained power prediction model outputs power prediction values ​​for future target time periods. The prediction result reliability assessment module uses uncertainty quantification to process the predicted power consumption value to obtain the probability distribution and confidence interval of the predicted power consumption value; The causal reasoning module is used to calculate the contribution of each feature in the key feature set to the predicted electricity value using the Shapley value algorithm, and to perform causal reasoning analysis to obtain key influencing factors.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a power prediction method that incorporates physical constraints as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements a power prediction method that incorporates physical constraints as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Electric power load prediction method and prediction device based on LSTM network model

    CN117521724A

  • Solar radiation space-time prediction method and system based on physical information constraint and neural network

    CN120951237A

  • Method and processing system for use with an asset of an electric power system, and method of providing a physics informed machine learning model

    WO2025103630A1