A physical orientation-based source-load interval prediction method, storage medium and device thereof

By employing a physics-guided source-load interval prediction method, key factors are screened using maximum mean difference and Spearman rank correlation analysis. Combined with long short-term memory networks and particle swarm optimization algorithm, a PGA-LSTM model is constructed, which solves the problem of lack of physical constraints in existing technologies. This achieves high-precision and interpretable source-load interval prediction, improving the reliability and robustness of the prediction.

CN122198272BActive Publication Date: 2026-07-21XIAN HIRATE NET ELECTRIC EQUIP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN HIRATE NET ELECTRIC EQUIP CO LTD
Filing Date
2026-05-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing deep learning-based methods for predicting the source-load interval of building energy systems lack physical constraints, resulting in prediction results that violate physical common sense and cannot collaboratively optimize statistical performance, thus affecting the reliability and application value of the prediction results.

Method used

A physics-guided source-load interval prediction method is adopted. Key influencing factors are screened through maximum mean difference, random forest and Spearman rank correlation analysis. Combined with long short-term memory network and particle swarm optimization algorithm, a physics-guided long short-term memory network (PGA-LSTM) is constructed. A physical constraint loss function is introduced to generate the upper and lower bound prediction intervals of source and load.

Benefits of technology

It achieves high-coverage, narrow-width, and physically reliable source-load uncertainty quantification, providing a more reliable basis for energy system scheduling and risk perception decision-making, and improving the interpretability and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122198272B_ABST
    Figure CN122198272B_ABST
Patent Text Reader

Abstract

The application discloses a source-load interval prediction method based on physical orientation, a storage medium and equipment thereof, according to the nonlinear dependence of the quantitative influence factors and the source load analyzed by the maximum mean difference, the key influence factor screening and the extraction of the physical constraint relationship are completed by using the random forest and the Spearman rank correlation analysis; the PGA-LSTM source-load interval prediction model based on the physical variable tracking and the conditional monotonicity constraint mechanism is established. A composite loss function integrating point prediction, physical constraint and interval coverage is designed, and the optimal hyperparameters of the model are sought through the particle swarm optimization algorithm; finally, the source-load prediction interval containing the upper bound and the lower bound is output. The prediction method based on the physical orientation effectively solves the problems of the lack of physical consistency and the weak generalization ability of the pure data-driven model in building energy prediction. Through the embedded physical mechanism constraint, the coverage and compactness of the prediction interval are significantly improved, and reliable quantitative basis is provided for the robust scheduling and risk management of the building energy system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of building energy prediction technology, specifically relating to a physical-guided source-load interval prediction method and its storage medium and device. Background Technology

[0002] In the context of the global energy transition, building energy efficiency is crucial. Integrated building energy systems, such as those encompassing photovoltaic power generation, cooling, heating, and electricity consumption, rely heavily on accurate predictions of future source-side output and load-side conditions for efficient scheduling and optimized operation. However, the intermittency of renewable energy sources, the randomness of user energy consumption, and the uncertainty of meteorological conditions make source-load prediction challenging. Interval prediction can quantify this uncertainty by outputting upper and lower bounds covering the true values, providing a risk basis for operational decisions. Current deep learning-based interval prediction methods are mostly purely data-driven and have significant shortcomings: first, they lack physical constraints, potentially leading to prediction results that violate basic physical principles such as the monotonicity of photovoltaic output changes with solar irradiance; second, they fail to synergistically optimize physical consistency with interval statistical quality, such as coverage probability and interval width. These shortcomings limit the reliability and application value of prediction results in practical engineering. Summary of the Invention

[0003] The technical problem to be solved by this invention is to address the difficulty of quantifying the uncertainty of source load in building energy systems in the prior art. It provides a physical-guided source load interval prediction method, its storage medium and device, and aims to solve the technical problems of lack of physical consistency and difficulty in coordinating the optimization of statistical performance and physical laws in pure data-driven interval prediction methods, so as to achieve high coverage, narrow width and physical reliability of source load uncertainty quantification.

[0004] The present invention adopts the following technical solution:

[0005] A physics-guided source-load interval prediction method includes the following steps:

[0006] S1. Obtain historical source-load time series data of the building energy system and corresponding meteorological influencing factors time series data to construct the original dataset;

[0007] S2. Clean and handle outliers from the data obtained in step S1 to form a preprocessed dataset.

[0008] S3. The data processed in step S2 is quantified by maximum mean difference analysis to determine the nonlinear dependence of influencing factors on source load. The importance of each influencing factor is evaluated by random forest model to screen key influencing factors. The monotonic physical constraint relationship between the key influencing factors and source load output is determined by Spearman rank correlation analysis.

[0009] S4. Based on the key influencing factors and physical constraints extracted in step S3, and combined with the long short-term memory network architecture, a physical-guided long short-term memory network prediction model is constructed. The model explicitly ensures that the network output conforms to physical laws by introducing physical variable tracking and conditional monotonicity constraint mechanisms, and adopts a dual-output layer structure to generate the upper and lower bounds of the prediction interval respectively.

[0010] S5. Divide the data processed in step S2 into training set, validation set and test set. Use the training set to train the model constructed in step S4. Design a composite loss function that combines point prediction loss, physical constraint loss and interval prediction loss for optimization. Use the validation set in combination with particle swarm optimization algorithm to automatically optimize the model hyperparameters. Use the test set to verify the model performance.

[0011] S6. Input the key influencing factor data for the period to be predicted into the physical guided long short-term memory network prediction model trained and optimized in step S5, and output the prediction range of the source load of the building energy system for the future period.

[0012] Specifically, in step S1, the historical source-load time series data includes photovoltaic power generation, building heating load and cooling load; the meteorological influencing factor time series data includes global horizontal radiation, dry-bulb temperature, relative humidity, wet-bulb temperature, total cloud cover, opaque cloud cover, direct radiation, and horizontal visibility.

[0013] Specifically, in step S2, the sliding window anomaly detection method is used for data cleaning and outlier handling.

[0014] Specifically, step S3 is as follows:

[0015] S301. Calculate the distributional difference between influencing factors and source loads using the Maximum Mean Difference (MMD) to capture nonlinear correlations. The MMD formula is:

[0016]

[0017] Here, k(x,y) is the kernel function, with the Gaussian kernel being a commonly used one. P and Q are the distributions of two variables, such as solar radiation intensity and heat pump efficiency, respectively, while x and y are the sample data. A MMD value close to 1 indicates a strong nonlinear relationship between P and Q.

[0018] S302. Construct multiple decision trees using random forest regression and vote on the results to quantify the contribution of each influencing factor to the source load change, and filter the core influencing factors by ranking them by importance.

[0019] S303. The correlation between variable rankings is calculated using the Spearman rank correlation coefficient to measure the monotonicity between key influencing factors and source loads. The correlation coefficient formula is as follows:

[0020]

[0021] in, It is the correlation coefficient. Let be the ranking difference of the i-th pair of samples, and n be the number of samples. If the correlation coefficient is close to 1, it indicates a positive monotonically increasing relationship, such as solar radiation intensity and photovoltaic heat collection; if the correlation coefficient is close to 0, it indicates no significant monotonically increasing relationship; if the correlation coefficient is close to -1, it indicates a negative monotonically increasing relationship, such as winter outdoor temperature and building heat load. Such monotonically increasing relationships serve as the main physical constraints for the source-load prediction physical information neural network.

[0022] Specifically, in step S4, the physically guided long short-term memory network prediction model mainly consists of two basic components:

[0023] One is a time feature extraction self-encoder / decoder framework based on Long Short-Term Memory (LSTM) networks. This framework treats source payload prediction modeling as a spatiotemporal sequence prediction problem, aiming to efficiently extract and condense temporal dependency features from historical sequences. Its core consists of an encoder LSM network and a decoder LSM network. Specifically, it constructs the input time series by expanding the feature vectors of the source payload prediction target date and time n days prior with the feature vector of the target date and time. Then it is fed into the encoder, which generates a hidden representation for the target date and time. The decoder then needs to determine the hidden representation of the target date and time. To reconstruct the entire source load input time series.

[0024] Another is the Long Short-Term Memory network, which maintains monotonicity by embedding physical constraints into the neural network. and additional source load influencing factor characteristics X t,1:d To predict source load changes, where X t,1:d This could be a time series of data such as solar radiation intensity and outdoor temperature. As the physical driving factors increase, i.e., X... t,1:d > X t,1:d-1 At that time, the forced increment ΔG d > 0; when the physical driving factors decrease, i.e., X t,1:d < X t,1:d-1 When forced ΔG d < 0. Simultaneously, a physical loss function is introduced:

[0025]

[0026] By incorporating a penalty term for monotonicity constraints into the loss function, the objective function simultaneously minimizes prediction error and monotonicity loss. The second term penalizes any behavior that does not conform to monotonicity. By establishing LSTM networks with physical guidance capabilities to map solar radiation intensity to photovoltaic power generation and outdoor temperature to building heating and cooling loads, the system ultimately predicts changes in building photovoltaic power generation, cooling load, and heating load.

[0027] Specifically, in step S4, the dual-output layer structure of the prediction model is based on the PGA-LSTM network structure, which is modified to have two output layers, starting from the hidden state H of the LSTM. d The output layer is divided into two parts with upper and lower limits. The lower limit output layer represents the minimum change in the predicted output, and the upper limit output layer represents the maximum change in the predicted output. For photovoltaic power generation, building heat load, and cooling load in a building energy system, PGA-LSTM neural networks with two upper and lower limit outputs are constructed respectively. For example, for photovoltaic power generation, the input layer is a time series. Each time step x t It contains n features, such as solar radiation intensity, outdoor temperature and historical photovoltaic power generation, with an input layer dimension of n×T and an input vector dimension of n×1 at each time step.

[0028] Specifically, in step S5, the composite loss function L total The specific form is:

[0029]

[0030] in, As a weight hyperparameter, L needs to be optimized using an optimization algorithm. total Let L be the total loss function. point For point prediction loss, L phy The two loss functions, which penalize violations of the physical constraints extracted in step S3, have already been given in research on monotonic long short-term memory neural networks. interval The specific formula for calculating the interval prediction loss based on the predicted interval coverage probability (PICP) and the normalized average predicted interval width (NMPIW) is as follows:

[0031] The Probability of Predicted Interval Coverage (PICP) measures the proportion of actual observations that fall within the predicted interval.

[0032]

[0033] Average Prediction Interval Width (MPIW) represents the percentage of the average width of the prediction interval relative to the potential target range.

[0034]

[0035] Normalized average prediction interval width (NMPIW) is the tightness of the quantization interval:

[0036]

[0037] Interval loss function (L interval Taking into account the trade-off between coverage probability and interval width:

[0038]

[0039] in, For indicator functions, if If the value falls within the interval, the value is 1; otherwise, the value is 0. and These are the lower and upper bounds of the prediction interval for the i-th sample, respectively; g max and g min These represent the maximum and minimum values ​​of the predicted target, respectively; constants η and μ are two hyperparameters used to determine how much penalty to impose on prediction intervals with low coverage probabilities. μ corresponds to the nominal confidence level associated with the prediction interval. η amplifies any small differences between PICP and μ. interval L is nonlinear, complex, and nondifferentiable, making gradient descent-based algorithms unsuitable for minimizing it. Therefore, a stochastic gradient-free method is needed to minimize L. total The total loss function is globally optimized to train an interval prediction model based on a physical information neural network. When PICP is less than μ, The function takes a value of 1 to apply a penalty, ensuring sufficient coverage of the prediction interval; when PICP is greater than or equal to μ, A function value of 0 indicates no penalty.

[0040] Specifically, in step S5, the automatic optimization of model hyperparameters using the particle swarm optimization algorithm involves constructing a parameter search space using the number of layers in the long short-term memory network, the number of neurons in each layer, the dropout rate, the learning rate, the training batch size, and the weight coefficients in the composite loss function.

[0041] A computer-readable storage medium for storing one or more programs, characterized in that the one or more programs include instructions that, when executed by a computing device, cause the computing device to perform any of the methods described above.

[0042] A source-load interval prediction device, characterized in that it comprises: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing any of the methods described above.

[0043] Compared with the prior art, the present invention has at least the following beneficial effects:

[0044] This invention presents a physics-guided source-load interval prediction method, its storage medium, and device. Addressing key challenges of existing purely data-driven interval prediction methods in building energy systems, such as the lack of physical consistency and the difficulty in co-optimizing statistical performance with physical laws, this invention innovatively proposes an interval prediction framework that deeply integrates physics guidance and deep learning. By establishing a systematic physical constraint extraction mechanism, designing a network architecture to ensure physical consistency, and constructing a multi-objective collaborative loss function, this method achieves high-coverage, narrow-width, and physically reliable quantification of source-load uncertainty, providing a more reliable basis for robust scheduling and risk-aware decision-making in integrated energy systems.

[0045] Furthermore, to accurately capture the key factors influencing source load changes and extract physical laws, this invention establishes a physical constraint extraction method based on maximum mean difference-random forest-Spearman regression. Maximum mean difference is used to quantify the nonlinear dependence of influencing factors on source load distribution, capturing complex correlations; random forest regression is used to assess the importance of each factor, screening core influencing variables and eliminating redundant features; and then Spearman's rank correlation coefficient is used to determine the monotonic physical constraint relationship between key factors and source load output. This hierarchical feature engineering ensures the physical meaning and effectiveness of the model input.

[0046] Furthermore, the constructed PGA-LSTM model adopts a structure combining an encoder-decoder framework with a physical constraint module. The encoder-decoder effectively extracts the temporal features of the source payload data, while the physical constraint module explicitly forces the network output to conform to physical laws by introducing a conditional monotonicity constraint mechanism. This solves the problem that traditional "black box" models may generate prediction results that violate physical common sense, significantly improving the model's interpretability and generalization ability, especially in extreme cases where the training data is not covered.

[0047] Furthermore, to address the limitation of single-point prediction in reflecting uncertainty, this invention designs a dual-output layer structure that simultaneously generates the upper and lower bounds of the prediction interval. By splitting the output from the LSTM hidden state, the fluctuation range of future source-load states can be directly quantified. Compared to traditional deterministic prediction, this interval prediction method can cover the potential range of changes in future true values, providing a more comprehensive decision-making basis for robust optimization and risk assessment of energy systems.

[0048] Furthermore, to improve prediction quality while ensuring physical validity, this invention proposes a composite loss function that integrates point prediction loss, physical constraint loss, and interval prediction loss. The interval prediction loss comprehensively considers the predicted interval coverage probability (PICP) and the normalized average interval width (NMPIW). By introducing a nonlinear penalty mechanism, this loss function can maximize PICP while compressing NMPIW as much as possible, avoiding the generation of invalid wide intervals. Simultaneously, the physical constraint loss term penalizes any output that violates monotonicity, ensuring that the model optimizes statistical metrics without sacrificing physical consistency.

[0049] Furthermore, a stochastic gradient-free optimization algorithm—Particle Swarm Optimization (PSO)—is employed to automatically optimize the hyperparameters in the composite loss function. Because the composite loss function is nonlinear and nondifferentiable, traditional gradient descent methods struggle to solve it directly. The global optimization algorithm balances the weights of point prediction accuracy, physical constraint strength, and interval quality, enabling the model to converge quickly to its optimal state.

[0050] Furthermore, to comprehensively evaluate the model's performance, multi-dimensional evaluation metrics were established. In addition to the traditional root mean square error (RMSE) used to measure point prediction accuracy, interval coverage probability (PICP) and normalized interval width (NMPIW) were introduced to evaluate the reliability and clarity of interval predictions. Experimental results show that this method maintains high point prediction accuracy while improving PICP and effectively compressing NMPIW, achieving a dual improvement in prediction accuracy and physical reliability.

[0051] In summary, this invention, building upon traditional data-driven prediction, introduces a physics-guided learning paradigm. Through a PGA-LSTM architecture and a composite loss function, it achieves high-precision, physically interpretable interval prediction of source-load uncertainties. The prediction results not only exhibit superior statistical performance but also conform to the actual physical operating laws of building energy systems, providing more reliable data support for the optimized operation and control of multi-energy complementary systems.

[0052] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0053] Figure 1 This is a diagram of a self-written decoder structure based on a long short-term memory network.

[0054] Figure 2 To maintain the monotonicity of the long short-term memory network architecture;

[0055] Figure 3 For interval prediction based on physical information neural networks;

[0056] Figure 4To maintain the monotonicity of the interval prediction LSTM;

[0057] Figure 5 This is a plot of PGA-LSTM interval prediction results for a typical day during the cooling season.

[0058] Figure 6 This is a graph showing the PGA-LSTM interval prediction results for a typical day during the heating season.

[0059] Figure 7 A plot showing the PGA-LSTM interval prediction results for a typical day during the transition season;

[0060] Figure 8 A comparison chart of the comprehensive performance of interval prediction under different source load types;

[0061] Figure 9 For Scenario I: Comparison of forecast results for consecutive snowfall periods in winter;

[0062] Figure 10 For Scenario II: Comparison of forecast results for the continuous rainfall period in summer. Detailed Implementation

[0063] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0064] This invention provides a physics-guided source-load interval prediction method, its storage medium, and device. It reliably and physically consistently predicts the source-load fluctuation range of a cooling, heating, and electric building energy system, improving the interpretability and robustness of the prediction. Addressing the strong nonlinearity of source-load time-series signals and the lack of physical constraints in traditional models, this method constructs an interval prediction framework that integrates physical constraints. Physical laws are endogenously embedded into the deep learning model, achieving a synergistic guarantee of statistical performance and physical meaning. First, historical source-load data and meteorological influencing factor data of the building energy system are acquired, and further data cleaning and normalization preprocessing are performed. Then, a physical constraint extraction mechanism based on maximum mean difference-random forest-Spearman is established to quantify nonlinear dependencies and screen key variables, determining their monotonicity physical rules. Time-series features are extracted using an encoder-decoder structure, and a PGA-LSTM network is trained using a physical constraint module and a composite loss function. Particle swarm optimization is used to automatically optimize hyperparameters. Finally, the source-load prediction interval is generated, and the upper and lower bounds of the prediction are output, providing risk awareness information for system scheduling. This physics-guided interval prediction method deeply integrates data-driven approaches with physical mechanisms. First, it solves the problem that traditional "black box" models violate physical common sense and have weak generalization ability due to the non-stationarity of source and load data. Second, it solves the problem that single "point prediction" cannot effectively quantify uncertainty risks, resulting in a lack of robust basis for energy system scheduling decisions.

[0065] This invention provides a physics-guided source-load interval prediction method, comprising the following steps:

[0066] S1. Obtain historical source-load time-series data and corresponding meteorological influencing factor time-series data of the building energy system to construct the original dataset. Specifically, the historical source-load time-series data includes historical operating data such as building cooling load, heating load, electrical load, and distributed photovoltaic power generation. The meteorological influencing factor time-series data includes meteorological parameters such as ambient temperature, relative humidity, solar irradiance, and wind speed. The data sampling frequency can be set according to actual needs, such as once every 15 minutes, hourly, or daily.

[0067] S2. The data obtained in step S1 is cleaned and outlier processed to form a preprocessed dataset. Specifically, data cleaning includes removing missing values ​​and obvious outliers caused by sensor malfunctions or transmission errors. For missing data, linear interpolation or nearest-neighbor mean imputation can be used to complete the data; for outliers, the 3σ principle is used for identification and correction. Furthermore, in order to eliminate the influence of differences in the scale and magnitude of different variables on model training, the minimax normalization method is used to map all data to the [0, 1] region.

[0068] S3. The data processed in step S2 is analyzed using maximum mean difference analysis to quantify the nonlinear dependence of influencing factors on source loads. The importance of each influencing factor is assessed using a random forest model to screen key influencing factors. Finally, Spearman rank correlation analysis is used to determine the monotonic physical constraint relationship between the key influencing factors and the source load output. This step aims to establish a physical constraint library and includes the following sub-steps:

[0069] S301. Nonlinear association analysis based on maximum mean difference (MMD):

[0070] The difference between the distribution of each influencing factor and the source load distribution is calculated to capture the complex nonlinear relationship between them. The formula for calculating MMD is as follows:

[0071]

[0072] Where P and Q represent the probability distributions of the influencing factor variable and the source load variable, respectively; x, x' are samples sampled from distribution P, and y, y' are samples sampled from distribution Q; k(x,y) is the kernel function, and in this embodiment, a Gaussian kernel function is preferably used. The larger the MMD value, the greater the difference between the two distributions; in this invention, when the MMD value is close to 1 or other set thresholds, it indicates that there is a strong nonlinear statistical dependency between P and Q.

[0073] S302. Importance selection based on random forest:

[0074] Multiple decision trees are constructed using a random forest regression algorithm, and the prediction results are ensembled and voted on. The contribution of each feature to reducing prediction error within the random forest is calculated, quantifying the contribution of each influencing factor to source load changes. All influencing factors are ranked according to their contribution, redundant features with importance below a set threshold are removed, and the core key influencing factors are selected.

[0075] S303. Measuring monotonicity based on Spearman's rank correlation coefficient:

[0076] The Spearman rank correlation coefficients between the selected key influencing factors and the source load variables were calculated to determine their monotonic physical relationships. (Correlation coefficients) The calculation formula is:

[0077]

[0078] in, It is the correlation coefficient. It represents the ranking difference of the i-th pair of samples, where n is the number of samples.

[0079] like If the value is close to 1, it indicates the existence of a positive monotonicity physical constraint, such as: as solar irradiance increases, photovoltaic output increases; if... If the value is close to -1, it indicates the existence of a negative monotonicity physical constraint, such as: as outdoor temperature increases, heating load decreases. These monotonic relationships will be encoded into physical rules to guide the construction of subsequent models.

[0080] S4. Based on the key influencing factors and physical constraints extracted in step S3, and combined with the long short-term memory network architecture, a Physically Guided Long Short-Term Memory (PGA-LSTM) prediction model is constructed. The PGA-LSTM model adopts a sequence-to-sequence deep learning framework and embeds the physical mechanism into the neuron computation and network structure.

[0081] Please see Figure 1 The invention presents a self-encoded decoder framework for temporal feature extraction based on a Long Short-Term Memory (LSTM) network. This framework treats source payload prediction modeling as a spatiotemporal sequence prediction problem, aiming to efficiently extract and condense temporal dependency features from historical sequences. Its core consists of an encoder LSM network and a decoder LSM network. Specifically, the input time series is constructed by expanding the feature vectors of the source payload prediction target date and time n days prior with the feature vector of the target date and time. Then it is fed into the encoder, which generates a hidden representation for the target date and time. The decoder then needs to determine the hidden representation of the target date and time. This is used to reconstruct the entire source-load input time series, thereby ensuring that the model can capture deep temporal evolution patterns.

[0082] Please see Figure 2 The diagram shows the monotonicity of the Long Short-Term Memory (LSTM) network architecture. To ensure the model adheres to physical laws during future projections, a physical state variable G is introduced into the computational units of the LSM network. d This variable is derived from the strongly monotonic physical factors selected in step S3. At each time step, the physical state G... d With the current input X d and the hidden state H at the previous moment d-1 They jointly participate in the computation of all gating mechanisms and directly control the information flow. The PGA-LSTM forward propagation process is calculated using the following set of equations:

[0083]

[0084]

[0085]

[0086]

[0087]

[0088] , , , These are the weight matrices for the forget gate, input gate, cell update, and output gate, respectively. , , , For the corresponding bias term; It is the Sigmoid activation function. This is element-wise multiplication. Through this mechanism, physical states... Directly control the flow of information along the timeline to ensure the memory units The updates are always explicitly guided by physical laws.

[0089] Please see Figure 2 The red component in the middle represents the newly added physical information module. This module constructs a monotonic Long Short-Term Memory network designed to embed physical constraints into the neural network. It utilizes additional source charge influencing factor features X. t,1:d To predict source load changes, where X t,1:d The data is a time series such as solar radiation intensity or outdoor temperature. The model constrains the output by judging the changing trend of physical driving factors: when the physical driving factors increase, X satisfies... t,1:d > Xt,1:d-1 At that time, the forced source load increment ΔG d > 0; When physical driving factors decrease, X satisfies t,1:d < X t,1:d-1 At that time, the forced source load increment ΔG d < 0. Simultaneously, a physical loss function is introduced:

[0090]

[0091] By adding a penalty term for the monotonicity constraint to the loss function, the objective function will simultaneously minimize the prediction error and the monotonicity loss. The second term penalizes any behavior that does not conform to monotonicity.

[0092] Please see Figure 3 This diagram illustrates interval prediction based on a physical information neural network. Based on the aforementioned physically enhanced hidden state features, this invention constructs a dual-output layer interval prediction mechanism. Please refer to... Figure 4 The complete flowchart of the monotonic interval prediction LSTM is shown below. The final output layer of the model is designed with two parallel branches, corresponding to the upper and lower bounds of the prediction interval, respectively. The upper bound output branch will output the hidden state H from the decoder. d The upper bound is obtained through mapping using a fully connected layer, and the lower bound output branch also maps the hidden state H. d The lower bound is obtained through mapping using a fully connected layer. Simultaneously, a logic verification layer is introduced at the output to ensure that the upper bound is always greater than or equal to the lower bound, thus guaranteeing the physical validity of the prediction interval.

[0093] S5. Divide the data processed in step S2 into a training set, a validation set, and a test set. Use the training set to train the model constructed in step S4. Design and optimize a composite loss function that combines point prediction loss, physical constraint loss, and interval prediction loss. Use the validation set in conjunction with the particle swarm optimization algorithm to automatically optimize the model's hyperparameters. Use the test set to verify the model's performance.

[0094] This embodiment employs differentiated dataset partitioning strategies for different application scenarios:

[0095] Basic performance evaluation scenario: For evaluating the interval prediction performance of PGA-LSTM under different loads, the training set, validation set, and test set are divided into 70%, 15%, and 15% proportions, respectively, for each prediction object. Model parameters are determined based on the training set and validation set, and prediction and performance evaluation are finally performed on the test set.

[0096] Cross-weather generalization scenario: Weather type clustering is performed based on hourly data throughout the year, and the dataset is constructed according to the principle of inconsistency between training and test weather. The training set consists of data on some typical weather types, and a validation set is partitioned within the training set in chronological order to adjust the model's hyperparameters. The test set includes weather types not seen during the training phase to evaluate the model's interval prediction performance under unseen weather conditions. This partitioning method ensures the difference in weather distribution between the training and test data, thus effectively reflecting the model's cross-weather generalization ability.

[0097] To ensure statistical reliability and physical consistency, a composite loss function L was designed. total :

[0098]

[0099] in, As a weight hyperparameter, L needs to be optimized using an optimization algorithm. total Let L be the total loss function. point For point prediction loss, L phy The two loss functions, which penalize violations of the physical constraints extracted in step S3, have already been given in research on monotonic long short-term memory neural networks. interval For interval prediction loss.

[0100] The interval prediction loss L interval The prediction interval coverage probability (PICP) and the normalized average prediction interval width (NMPIW) are used to construct the prediction interval. The specific calculation formula is as follows:

[0101]

[0102]

[0103]

[0104] in, For indicator functions, if If the value falls within the interval, the value is 1; otherwise, the value is 0. and These are the lower and upper bounds of the prediction interval for the i-th sample, respectively; g max and g min These represent the maximum and minimum values ​​of the predicted target, respectively; constants η and μ are two hyperparameters used to determine how much penalty to impose on prediction intervals with low coverage probabilities; when PICP is less than μ, The function takes a value of 1 to apply a penalty, ensuring sufficient coverage of the prediction interval; when PICP is greater than or equal to μ, A function value of 0 indicates no penalty.

[0105] The particle swarm optimization algorithm is used to automatically optimize the model's hyperparameters globally. The number of layers in the long short-term memory network, the number of neurons in each layer, the dropout rate, the learning rate, the batch size, and the weight factors in the composite loss function constitute a multi-dimensional parameter search space. By simulating the collaborative search of the particle swarm, the comprehensive loss function value and fitness function on the validation set are used to automatically obtain the parameter combination that achieves the best balance between point prediction, interval quality, and physical error rate.

[0106] The optimized model was validated using a test set across multiple dimensions. The specific evaluation metrics and calculation formulas are as follows:

[0107] Predicted Interval Coverage Probability (PICP): The proportion of the instantaneous actual initial value falling into the predicted interval, reflecting the interval probability.

[0108]

[0109] Average Prediction Interval Width (MPIW): Represents the percentage of the average width of the prediction interval relative to the potential target range.

[0110] Normalized average forecast interval width (NMPIW): quantifies the tightness of the forecast interval, reflecting the level of forecast uncertainty.

[0111]

[0112] Step S6: Input the key influencing factor data for the period to be predicted into the Physically Guided Long Short-Term Memory (PSTM) prediction model trained and optimized in Step S5, and output the prediction range of the building's energy system's source load for future periods. Finally, using the trained PGA-LSTM model and inputting future weather forecast data, the model can output the range of changes in the building's cooling, heating, or photovoltaic output at future times, providing a reliable basis including risk information for the energy management system's scheduling decisions.

[0113] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0114] Taking typical rural buildings in the Guanzhong region as an example, a physical-guided source-load interval prediction method is adopted, including the following steps:

[0115] 1. Using a dynamic simulation platform, construct the building energy system simulation model and the original dataset; construct a simulation model of typical rural buildings in the Guanzhong region based on the TRNSYS 18 dynamic simulation platform. Some traditional Guanzhong dwellings are used as prototypes. The buildings are located in Xi'an, are single-story courtyard houses with a total area of ​​180m². The original dataset collection principles are: the simulation uses typical meteorological data from Xi'an, with a time step of 1 hour and a simulation period of one full year. The collected data mainly includes: source-load index data: building photovoltaic power generation (kW), building heating load (kW), building cooling load (kW); meteorological influencing factor data: global horizontal radiation (kJ / hr·m²), dry-bulb temperature (°C), relative humidity (%), wet-bulb temperature (°C), total cloud cover, opaque cloud cover, direct radiation (kJ / hr·m²), and horizontal visibility (km). A total of 11 feature dimensions are formed, creating the original dataset.

[0116] 2. The acquired data is cleaned and outlier-handled to form a preprocessed dataset. Specifically, data cleaning includes removing missing values ​​and obvious outliers caused by sensor malfunctions or transmission errors. For missing data, linear interpolation or nearest-neighbor mean imputation can be used to complete the data; for outliers, the 3σ principle is used for identification and correction. Furthermore, to eliminate the impact of differences in the scale and magnitude of different variables on model training, the min-max normalization method is used to map all data to the [0, 1] region.

[0117] 3. Extract the monotonic physical constraint relationship between key influencing factors and source load output;

[0118] To screen key input variables and establish physical constraints, a combination of maximum mean difference, random forest regression, and Spearman rank correlation coefficient was used for in-depth data analysis. The analysis process is as follows:

[0119] Nonlinear association analysis based on maximum mean difference (MMD):

[0120] The difference between the distribution of each influencing factor and the source load distribution is calculated to capture the complex nonlinear relationship between them. The formula for calculating MMD is as follows:

[0121]

[0122] Where P and Q represent the probability distributions of the influencing factor variable and the source load variable, respectively; x, x' are samples sampled from distribution P, and y, y' are samples sampled from distribution Q; k(x,y) is the kernel function, and in this embodiment, a Gaussian kernel function is preferably used. The larger the MMD value, the greater the difference between the two distributions; in this invention, when the MMD value is close to 1 or other set thresholds, it indicates that there is a strong nonlinear statistical dependency between P and Q.

[0123] Importance filtering based on random forest:

[0124] Multiple decision trees are constructed using a random forest regression algorithm, and the prediction results are ensembled and voted on. The contribution of each feature to reducing prediction error within the random forest is calculated, quantifying the contribution of each influencing factor to source load changes. All influencing factors are ranked according to their contribution, redundant features with importance below a set threshold are removed, and the core key influencing factors are selected.

[0125] Physical constraint extraction based on Spearman rank correlation coefficient:

[0126] The Spearman rank correlation coefficients between the selected key influencing factors and the source load variables were calculated to determine their monotonic physical relationships. (Correlation coefficients) The calculation formula is:

[0127]

[0128] in, It is the correlation coefficient. It represents the ranking difference of the i-th pair of samples, where n is the number of samples.

[0129] like If the value is close to 1, it indicates the existence of a positive monotonicity physical constraint, such as: as solar irradiance increases, photovoltaic output increases; if... If the value is close to -1, it indicates the existence of a negative monotonicity physical constraint, such as: as outdoor temperature increases, heating load decreases. These monotonic relationships will be encoded into physical rules to guide the construction of subsequent models.

[0130] The analysis results for each source load type are shown in Table 1:

[0131] Table 1. Correlation analysis results between different energy types and meteorological parameters

[0132] Considering its highest feature importance, extremely strong monotonic positive correlation, and relatively clear linear relationship characteristics, this study ultimately extracts global horizontal radiation as the monotonic physical constraint for the photovoltaic power generation model; extracts dry-bulb temperature as the time-segmented monotonic physical constraint for the cooling load prediction model; and extracts dry-bulb temperature as the time-segmented monotonic physical constraint for the heating load prediction model.

[0133] To explicitly embed the physical relationship into the prediction model, curve fitting was further performed on solar radiation intensity and photovoltaic power generation data, resulting in physical constraint curves describing the relationship between the two, which serve as the core physical constraint conditions. The building actually employs a time-of-use and zoned cooling strategy, and its cooling load varies with temperature across different time periods throughout the day. Therefore, the day was further divided into four typical time periods: 0-12:00, 13-16:00, 17-19:00, and 20-24:00. Piecewise curve fitting was performed on the observed data of dry-bulb temperature and cooling load for each time period, resulting in a set of physical constraint curves describing the monotonic relationship between "dry-bulb temperature and cooling load" under different time periods, serving as the core physical constraint condition set for the cooling load prediction model. The building actually employs a time-of-use and zoned heating strategy, and its heat load varies with temperature across different time periods throughout the day. Therefore, the entire day was further divided into three typical time periods: 0-9:00, 10-22:00, and 23-24:00. Piecewise curve fitting was performed on the observed data of dry-bulb temperature and heat load for each time period to obtain a set of physical constraint curves describing the monotonic relationship between "dry-bulb temperature and heat load" under different time periods. This set serves as the core physical constraint set for the heat load prediction model. The physical constraints for each source load type are shown in Table 2.

[0134] Table 2 Physical constraints for different energy types

[0135] 4. Construct a Physically Guided Long Short-Term Memory Network (PGA-LSTM) prediction model.

[0136] The PGA-LSTM model employs a sequence-to-sequence deep learning framework and embeds physical mechanisms into neuron computation and network structure.

[0137] The structure diagram of the self-written decoder based on the Long Short-Term Memory network is as follows: Figure 1 As shown, this invention constructs a time feature extraction self-encoder / decoder framework based on a Long Short-Term Memory (LSTM) network. This framework treats source load prediction modeling as a spatiotemporal sequence prediction problem, aiming to efficiently extract and condense the temporal dependency features in historical sequences. Its core consists of an encoder LSM network and a decoder LSM network. Specifically, the input time series is constructed by expanding the feature vectors of the source load prediction target date and time n days prior to the target date and time with the feature vector of the target date and time. Then it is fed into the encoder, which generates a hidden representation for the target date and time. The decoder then needs to determine the hidden representation of the target date and time. This is used to reconstruct the entire source-load input time series, thereby ensuring that the model can capture deep temporal evolution patterns.

[0138] The long short-term memory network architecture diagram that maintains monotonicity is as follows: Figure 2 As shown. To ensure that the model always follows physical laws when extrapolating the future, a physical state variable G is introduced into the computational unit of the Long Short-Term Memory network. d This variable is derived from the strongly monotonic physical factors selected in step S3. At each time step, the physical state G... d With the current input X d and the hidden state H at the previous moment d-1 They jointly participate in the computation of all gating mechanisms and directly control the information flow. The PGA-LSTM forward propagation process is calculated using the following set of equations:

[0139]

[0140]

[0141]

[0142]

[0143]

[0144] , , , These are the weight matrices for the forget gate, input gate, cell update, and output gate, respectively. , , , For the corresponding bias term; It is the Sigmoid activation function. This is element-wise multiplication. Through this mechanism, physical states... Directly control the flow of information along the timeline to ensure the memory units The updates are always explicitly guided by physical laws.

[0145] Please see Figure 2 The red component in the middle represents the newly added physical information module. This module constructs a monotonic Long Short-Term Memory network designed to embed physical constraints into the neural network. It utilizes additional source charge influencing factor features X. t,1:d To predict source load changes, where Xt,1:d The data is a time series such as solar radiation intensity or outdoor temperature. The model constrains the output by judging the changing trend of physical driving factors: when the physical driving factors increase, X satisfies... t,1:d > X t,1:d-1 At that time, the forced source load increment ΔG d > 0; When physical driving factors decrease, X satisfies t,1:d < X t,1:d-1 At that time, the forced source load increment ΔG d < 0. Simultaneously, a physical loss function is introduced:

[0146]

[0147] By adding a penalty term for the monotonicity constraint to the loss function, the objective function will simultaneously minimize the prediction error and the monotonicity loss. The second term penalizes any behavior that does not conform to monotonicity.

[0148] A schematic diagram of interval prediction based on physical information neural networks is shown below. Figure 3 As shown, based on the physically enhanced hidden state features described above, this invention constructs a dual-output layer interval prediction mechanism. The complete flowchart of the monotonic interval prediction LSTM is shown below. Figure 4 As shown, the final output layer of the model is designed with two parallel branches, corresponding to the upper and lower bounds of the prediction interval, respectively. The upper bound output branch will output the hidden state H from the decoder. d The upper bound is obtained through mapping using a fully connected layer, and the lower bound output branch also maps the hidden state H. d The lower bound is obtained through mapping using a fully connected layer. Simultaneously, a logic verification layer is introduced at the output to ensure that the upper bound is always greater than or equal to the lower bound, thus guaranteeing the physical validity of the prediction interval.

[0149] 5. Model Training and Optimization Based on Composite Loss Function and Particle Swarm Optimization

[0150] The data is divided into training, validation, and test sets. The model is trained using the training set. A composite loss function that combines point prediction loss, physical constraint loss, and interval prediction loss is designed for optimization. The model hyperparameters are automatically optimized using the validation set combined with the particle swarm optimization algorithm. The model performance is verified using the test set.

[0151] This embodiment employs differentiated dataset partitioning strategies for different application scenarios:

[0152] Basic performance evaluation scenario: For evaluating the interval prediction performance of PGA-LSTM under different loads, the training set, validation set, and test set are divided into 70%, 15%, and 15% proportions, respectively, for each prediction object. Model parameters are determined based on the training set and validation set, and prediction and performance evaluation are finally performed on the test set.

[0153] Cross-weather generalization scenario: Weather type clustering is performed based on hourly data throughout the year, and the dataset is constructed according to the principle of inconsistency between training and testing weather. The training set consists of data on sunny weather types, and a validation set is partitioned within the training set in chronological order to adjust the model's hyperparameters. The test set consists of weather types other than sunny weather to evaluate the model's interval prediction performance under unseen weather conditions. This partitioning method ensures the difference in weather distribution between training and testing data, thus effectively reflecting the model's cross-weather generalization ability.

[0154] To ensure statistical reliability and physical consistency, a composite loss function L was designed. total :

[0155]

[0156] in, As a weight hyperparameter, L needs to be optimized using an optimization algorithm. total Let L be the total loss function. point For point prediction loss, L phy The two loss functions, which penalize violations of the physical constraints extracted in step S3, have already been given in research on monotonic long short-term memory neural networks. interval For interval prediction loss.

[0157] The interval prediction loss L interval The prediction interval coverage probability (PICP) and the normalized average prediction interval width (NMPIW) are used to construct the prediction interval. The specific calculation formula is as follows:

[0158]

[0159]

[0160]

[0161] in, For indicator functions, if If the value falls within the interval, the value is 1; otherwise, the value is 0. and These are the lower and upper bounds of the prediction interval for the i-th sample, respectively; g max and g min These represent the maximum and minimum values ​​of the predicted target, respectively; constants η and μ are two hyperparameters used to determine how much penalty to impose on prediction intervals with low coverage probabilities; when PICP is less than μ, The function takes a value of 1 to apply a penalty, ensuring sufficient coverage of the prediction interval; when PICP is greater than or equal to μ, A function value of 0 indicates no penalty. The parameter μ is chosen to be 0.99 to achieve a high confidence level prediction interval, and η is set to 100 to provide a moderate penalty strength, effectively constraining coverage bias without excessively affecting the optimization of interval width.

[0162] A particle swarm optimization algorithm is used to automatically optimize the model's hyperparameters globally. The multidimensional parameter search space is constructed by considering the number of layers in the Long Short-Term Memory network, the number of neurons in each layer, the dropout rate, the learning rate, the batch size, and the weighting factors in the composite loss function. Through simulated collaborative search by the particle swarm, the optimal parameter combination that achieves the best balance between point prediction, interval quality, and physics error rate is automatically obtained using the comprehensive loss function and fitness function on the validation set. Details of the model's parameter settings are shown in Table 3.

[0163] Table 3 Model Parameter Settings

[0164] The optimized model was validated using a test set across multiple dimensions. The specific evaluation metrics and calculation formulas are as follows:

[0165] Predicted Interval Coverage Probability (PICP): The proportion of the instantaneous actual initial value falling into the predicted interval, reflecting the interval probability.

[0166]

[0167] Average Prediction Interval Width (MPIW): Represents the percentage of the average width of the prediction interval relative to the potential target range.

[0168] Normalized average forecast interval width (NMPIW): quantifies the tightness of the forecast interval, reflecting the level of forecast uncertainty.

[0169]

[0170] 6. Model Prediction

[0171] After performing maximum mean difference nonlinear correlation analysis, random forest importance screening, and Spearman rank correlation coefficient to measure monotonicity of the collected data, the input variables are subjected to physical constraint extraction and preprocessing, and the physical mechanisms are encoded into the network structure. The processed key influencing factors are then input into the trained PGA-LSTM prediction model, which outputs the source-load prediction interval for the building energy system.

[0172] This is a typical rural building in Xi'an. It is a single-story courtyard house with a total floor area of ​​180m², featuring traditional adobe walls and a pitched roof. The building faces south. A simulation model was built using the TRNSYS 18 dynamic simulation platform, and its performance was validated using typical meteorological data from Xi'an. To systematically evaluate the interval prediction performance of PGA-LSTM under different seasonal conditions, representative typical days were extracted from each season using k-means clustering analysis for validation. Based on the k-means clustering results, the typical days for the cooling season were August 9th and August 12th, designated as Typical Day 1 and Typical Day 2, respectively; the typical days for the heating season were December 2nd and December 23rd, designated as Typical Day 1 and Typical Day 2, respectively; and the typical days for the transition season were April 17th, March 19th, and May 24th, designated as Typical Day 1, Typical Day 2, and Typical Day 3, respectively. The data includes: building cooling load (kW), heating load (kW), photovoltaic power generation (kW), and meteorological parameters such as global horizontal radiation (kJ / hr·m²), dry bulb temperature (°C), relative humidity (%), and wet bulb temperature (°C), with a data collection period of one hour.

[0173] The trained PGA-LSTM model was used to predict the cooling load, heating load, and photovoltaic power generation on typical days in different seasons. The experimental results are shown in Table 4.

[0174] Table 4. PGA-LSTM Interval Prediction Performance

[0175] Based on the results in Table 4, we can further analyze the interval prediction performance of PGA-LSTM under different seasons and load types. Overall, the prediction interval coverage probability for each typical day in both the cooling and heating seasons reaches 100%, indicating that the model can still achieve complete coverage of the actual load under high load fluctuations and strong nonlinear conditions, demonstrating high interval reliability. Meanwhile, its average prediction interval width and normalized average prediction interval width remain at low levels, indicating that the prediction interval is not excessively wide while ensuring coverage, reflecting good interval compactness. During the transition season, due to frequent changes in meteorological conditions and relatively complex load characteristics, the photovoltaic prediction coverage probability for typical day 1 decreases slightly, but remains high for other typical days, indicating that PGA-LSTM has a certain robustness to unstable conditions. The combined results from different seasons show that PGA-LSTM can achieve a good balance between interval reliability and interval width under the main operating conditions throughout the year, verifying its applicability and stability in building load and photovoltaic output interval prediction tasks.

[0176] Figure 5The image shows the PGA-LSTM interval prediction results for a typical day during the cooling season. The results of the PGA-LSTM model were compared experimentally with those of the LSTM and Transformer models. The experimental results show that the PGA-LSTM prediction interval best matches the actual value and has the narrowest interval. Table 5 shows that different methods exhibit significant differences in interval coverage probability, average predicted interval width, normalized interval width, and interval loss index. Regarding interval coverage probability, both PGA-LSTM and QR-LSTM achieved 100%, completely covering the actual cooling load value, while the coverage probabilities of LSTM, PINN, and TCN-LSTM were 95.83%, and Transformer had the lowest at only 83.33%. Regarding interval width, PGA-LSTM has the smallest average prediction interval width at only 1.292 kW, compared to 1.938 kW, 1.776 kW, and 2.193 kW for LSTM, PINN, and TCN-LSTM, respectively. Transformer has an average interval width of 2.298 kW, while QR-LSTM, although achieving complete coverage, has an interval width of 2.943 kW, which is significantly wider. Further analysis of normalized interval width and interval loss reveals that PGA-LSTM also achieves the minimum values ​​for both, at 0.1575 and 0.1575 respectively, indicating that it maintains optimal interval compactness and overall prediction quality while ensuring high coverage. In summary, PGA-LSTM performs best across all four categories of indicators in building cooling load interval prediction, fully demonstrating the significant advantages of physical guidance mechanisms in improving the reliability and accuracy of interval predictions.

[0177] Table 5 Comparison of Predicted Cooling Load Ranges on Typical Days During the Cooling Season

[0178] The evaluation metrics used in this paper include MPIW, NMPIW, and All other metrics follow the principle that smaller values ​​indicate better performance, while the PICP metric is the opposite; a higher PICP value indicates better coverage quality for the interval prediction. This is because the Transformer's PICP is much lower than the confidence level μ.

[0179] Figure 6The table shows the PGA-LSTM interval prediction results for a typical day 2 during the heating season. Experimental results indicate that all models can capture the trend of heat load changes, but the PGA-LSTM prediction model shows the best convergence effect on the uncertainty boundary. Table 6 shows that, in terms of interval coverage probability, PGA-LSTM, Transformer, and QR-LSTM all achieved 100% coverage, completely covering the actual heat load variation range; LSTM and TCN-LSTM had a coverage probability of 95.83%; PINN's coverage probability was only 79.17%, significantly insufficient. Regarding interval width, PGA-LSTM achieved the smallest average prediction interval width of 1.106 kW while ensuring complete coverage; in contrast, LSTM and TCN-LSTM had slightly increased interval widths of 1.143 kW and 1.128 kW respectively, while Transformer and QR-LSTM further expanded their interval widths, indicating significant interval redundancy. Although PINN had the smallest prediction interval width, its coverage probability was significantly lower than the confidence level, making this result insufficient to reflect effective interval prediction performance. Furthermore, looking at the normalized interval width and interval loss metrics, PGA-LSTM achieves the minimum values ​​for both metrics, indicating that it achieves optimal interval compactness and overall prediction quality while ensuring high coverage.

[0180] Table 6 Comparison of Predicted Heat Load Ranges on Typical Days During the Heating Season

[0181] Figure 7 The table shows the prediction interval curves for building-integrated photovoltaic (BIPV) power generation on a typical day during the transition season. On this typical day, solar radiation exhibits a typical single-peak distribution, with the peak occurring at noon. Table 7 shows that, in terms of interval coverage probability, both PGA-LSTM and LSTM achieve 100%, completely covering the actual power generation value. Transformer's coverage probability is 95.83%, slightly lower than the other two, while PINN has the lowest coverage probability at only 79.17%. Regarding interval width, PGA-LSTM has the smallest average prediction interval width at 0.796 kW, followed by LSTM at 0.850 kW, Transformer at 0.846 kW (slightly larger), and QR-LSTM at the largest at 1.306 kW. Further analysis of normalized interval width and interval loss reveals that PGA-LSTM also performs best in both metrics, both at 0.1423, indicating that it achieves optimal interval compactness and overall prediction quality while maintaining high coverage. Overall, PGA-LSTM performed best across all metrics in photovoltaic power generation interval forecasting, fully demonstrating the significant advantages of physical guidance mechanisms in improving the reliability and accuracy of interval forecasting.

[0182] Table 7 Comparison of Predicted Performance of Photovoltaic Power Generation Zones on Typical Days During the Transition Season

[0183] Figure 8 This chart compares the overall performance of interval predictions under different source load types. A biaxial bar chart visually illustrates the comparison of the prediction coverage probability (PICP) and normalized average prediction interval width (NMPIW) for each model in the tasks of predicting cooling load, heating load, and photovoltaic output. In the chart, blue bars represent coverage probability, and red bars represent interval width. Ideally, the higher the blue bars, the lower the red bars. The chart clearly shows that the proposed PGA-LSTM model exhibits the best overall performance under all three different source load scenarios. Its blue bars consistently reach 100% full height, indicating complete interval coverage. Meanwhile, its red bars remain at a relatively low level, significantly lower than other models with the same coverage rate. This demonstrates that PGA-LSTM can accurately capture the fluctuation range of the true value without blindly expanding the prediction interval, exhibiting extremely high prediction tightness. In contrast, although QR-LSTM performs well in reliability, its red bars are significantly higher than those of PGA-LSTM, indicating that its prediction interval is generally too wide and its accuracy is relatively insufficient. While the PINN model has the tightest intervals, its blue bars are significantly shorter than other models, indicating that its coverage is severely sacrificed due to excessive physical constraints. Pure data-driven models such as LSTM, Transformer, and TCN-LSTM fall somewhere in between, struggling to balance high coverage and narrow interval width with limited samples, and lacking the performance gains from physical interpretability. In conclusion, through the analysis of prediction results on representative dates of three typical seasons, PGA-LSTM demonstrates excellent and stable performance across all prediction tasks.

[0184] To verify the adaptability of the PGA-LSTM model to changes in weather distribution, a cross-weather generalization experiment was designed. This experiment trained the model solely on a pure sunny day dataset and tested it across various weather domains throughout the year, including cloudy, overcast, rainy, and snowy days. Table 8 shows that the prediction performance of the baseline LSTM model declined significantly as the difference between the test and training weather domains increased. Particularly in photovoltaic (PV) power generation prediction, the LSTM model's coverage rate gradually decreased from 69.26% on cloudy days and further to 48.12% on snowy days. In contrast, the PGA-LSTM model demonstrated better robustness, maintaining PV coverage rates of 82.63% and 86.79% on rainy and snowy days, respectively, where weather deviations were higher. Overall, the PGA-LSTM model outperformed traditional models in cross-weather domain prediction, indicating that embedding physical mechanisms into deep learning networks can effectively improve the uncertainty quantification problem of traditional models on out-of-distribution data.

[0185] Table 8. Statistical Comparison of Inter-regional Forecasting Performance under Different Weather Domains

[0186] Figure 9 This table shows the prediction interval curves for a sudden weather change scenario during the continuous snow and wind period from January 18th to January 22nd. During this period, meteorological conditions alternated between light and moderate snow, with low ambient temperatures and solar radiation obstruction. As shown in Table 9, under the dual disturbances of low temperature and low radiation, the photovoltaic interval coverage of the LSTM model decreased to 30.00%, and the prediction results showed divergence. Further analysis of the performance of the PGA-LSTM model reveals that, under the influence of physical boundary constraints, it increased the photovoltaic interval coverage to 75.83%, suppressed prediction divergence, maintained prediction stability under high heat load conditions, and ensured prediction quality under extreme conditions.

[0187] Figure 10 This table shows the predicted interval curves for a sudden weather change scenario during the continuous rainy season from August 14th to August 18th. This period coincides with the cooling season, and continuous rainfall leads to a drop in dry-bulb temperature and high relative humidity, creating a complex building thermal-humidity boundary. As shown in Table 9, the PGA-LSTM model achieves 100.00% coverage in cooling load prediction, overcoming the limitations of purely data-driven algorithms that overly rely on a single temperature feature, and accurately quantifying the sudden change interval of cooling load. Regarding interval width, compared to the baseline model, the normalized interval width of PGA-LSTM is further reduced, and it accurately tracks the decline in photovoltaic output. The comparative performance of these two extreme scenarios demonstrates that introducing prior physical knowledge can effectively improve the reliability and tightness of the model's interval prediction under sudden weather changes.

[0188] Table 9 Comparison of Inter-regional Prediction Performance under Extreme Weather Change Scenarios

[0189] In summary, this invention presents a physics-guided source-load interval prediction method. Building upon traditional deep learning prediction, it introduces maximum mean difference and Spearman rank correlation analysis to extract physical constraints, which are then embedded into the LSTM network architecture, improving the physical interpretability and accuracy of source-load prediction. The prediction interval generated by the PGA-LSTM model can provide a reliable basis, including risk boundaries, for day-ahead scheduling of microgrids. Through a dual-output layer structure, the upper and lower bounds of future source-load changes can be directly obtained, providing decision support for optimized operation strategies such as energy storage configuration and flexible load peak shaving in building energy systems. Furthermore, the improved PGA-LSTM prediction model utilizes prior physical knowledge to constrain the search space of the neural network, effectively avoiding overfitting and improving the model's robustness in small sample or noisy data environments.

[0190] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0191] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0192] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0193] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0194] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.

Claims

1. A physical-guided source-load interval prediction method, characterized in that, Includes the following steps: S1. Acquire and preprocess historical source-load time series data and meteorological influencing factor data of building energy system, extract key influencing factors and determine the physical constraint relationship between the key influencing factors and source-load output; S2. Based on the key influencing factors and physical constraints extracted in step S1, and combined with the long short-term memory network architecture, a physical-guided long short-term memory network prediction model is constructed. The model ensures that the network output conforms to physical laws by introducing physical variable tracking and conditional monotonicity constraint mechanisms, and adopts a dual-output layer structure to generate the upper and lower bounds of the prediction interval respectively. In step S2, a physical state variable G is introduced into the computational unit of the long short-term memory network. d Achieve physical variable tracking; at each time step, the physical state G... d With the current input X d and the hidden state H at the previous moment d-1 They jointly participate in the calculation of all gating and directly control the information flow; the PGA-LSTM forward propagation process is calculated through the following set of equations: , , , These are the weight matrices for the forget gate, input gate, cell update, and output gate, respectively. , , , For the corresponding bias term; It is the Sigmoid activation function. This is element-wise multiplication; through this mechanism, physical states... Directly control the flow of information along the timeline to ensure the memory units The updates are always explicitly guided by physical laws; S3. Divide the data processed in step S1 into training set, validation set and test set. Use the training set to train the model constructed in step S2. Design a composite loss function that combines point prediction loss, physical constraint loss and interval prediction loss for optimization. Use the validation set and optimization algorithm to automatically optimize the model hyperparameters. Use the test set to verify the model performance. S4. Input the key influencing factor data for the period to be predicted into the physical guided long short-term memory network prediction model trained and optimized in step S3, and output the prediction range of the source load of the building energy system for the future period.

2. The physical-guided source-load interval prediction method according to claim 1, characterized in that, In step S2, the physically guided long short-term memory network prediction model mainly consists of two basic components: One is a time feature extraction self-encoder framework based on long short-term memory network. This framework treats source load prediction modeling as a spatiotemporal sequence prediction problem, and efficiently extracts and condenses the temporal dependency features in historical sequences. Its core consists of an encoder long short-term memory network and a decoder long short-term memory network; it predicts the target date and time point by source payload. n The feature vectors of the day and the feature vectors of the target date and time are expanded to construct the input time series. Then it is fed into the encoder, which generates a hidden representation for the target date and time. ; The decoder then needs to determine the hidden representation of the target date and time. To reconstruct the entire source-load input time series, thereby ensuring that the model can capture deep temporal evolution patterns; Another is the Long Short-Term Memory network, which maintains monotonicity by embedding physical constraints into the neural network. and additional source load influencing factor characteristics X t,1:d To predict source load changes, where X t,1:d It is a time series of solar radiation intensity and outdoor temperature; G d It is a physical state variable, derived from the strongly monotonic physical factors selected in step S1; when the physical driving factors increase, i.e., X t,1:d > X t,1:d-1 At that time, the forced increment ΔG d > 0; when the physical driving factors decrease, i.e., X t,1:d < X t,1:d-1 When forced ΔG d < 0.

3. The physical-guided source-load interval prediction method according to claim 1, characterized in that, In step S2, the prediction model has a dual-output layer structure. Based on the PGA-LSTM network structure, the final output layer of the model is designed as two parallel branches, which correspond to the upper and lower bounds of the prediction interval, respectively. The upper bound output branch will output the hidden state H from the decoder. d The upper bound is obtained through mapping using a fully connected layer, and the lower bound output branch also maps the hidden state H. d The lower bound is obtained through mapping by a fully connected layer; at the same time, a logic verification layer is introduced at the output to ensure that the upper bound is always greater than or equal to the lower bound, thereby guaranteeing the physical validity of the prediction interval.

4. The physical-guided source-load interval prediction method according to claim 1, characterized in that, In step S3, the composite loss function L total The specific form is as follows: in, As a weight hyperparameter, L needs to be optimized using an optimization algorithm. total Let L be the total loss function. point For point prediction loss, L phy As a penalty for violating the physical constraints extracted in step S1, L interval For interval prediction loss.

5. The physical-guided source-load interval prediction method according to claim 1, characterized in that, In step S3, the physical constraint loss L phy A penalty term for the monotonicity constraint is added, which penalizes any behavior that does not conform to the monotonicity constraint mechanism, so that the objective function simultaneously minimizes the prediction error and the monotonicity loss. The physical constraint loss L phy The specific calculation formula is as follows: 。 6. The physical-guided source-load interval prediction method according to claim 1, characterized in that, In step S3, the interval prediction loss L interval The prediction interval coverage probability (PICP) and the normalized average prediction interval width (NMPIW) are used to construct the prediction interval. The specific calculation formula is as follows: in, For indicator functions, if If the value falls within the interval, the value is 1; otherwise, the value is 0. and These are the lower and upper bounds of the prediction interval for the i-th sample, respectively; g max and g min These represent the maximum and minimum values ​​of the predicted target, respectively; constants η and μ are two hyperparameters used to determine how much penalty to impose on prediction intervals with low coverage probabilities; when PICP is less than μ, The function takes a value of 1 to apply a penalty, ensuring sufficient coverage of the prediction interval; when PICP is greater than or equal to μ, A function value of 0 indicates no penalty.

7. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the method according to any one of claims 1 to 6.

8. A source-load interval prediction device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the method according to any one of claims 1 to 6.