A method for predicting short-term building electricity load based on seasonal load adaptive partitioning

By using seasonal load adaptive partitioning and the CatBoost-LSTM model, the problem of not considering climate differences and temporal correlations in the short-term electricity load forecasting of buildings is solved, improving the forecast accuracy and adaptability, and making it applicable to building and other time series with obvious seasonal characteristics.

CN118367542BActive Publication Date: 2025-10-31SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410498763.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2025-10-31
Estimated Expiration
2044-04-24

AI Technical Summary

Technical Problem

Existing methods for predicting short-term building electricity loads fail to adequately consider climate differences and building electricity consumption characteristics, resulting in low prediction accuracy. Time-series forecasting methods show decreased accuracy when external conditions change, and driving factor methods do not utilize the temporal correlation of historical data.

Method used

A seasonal load adaptive segmentation method is adopted, which divides the seasons through multi-source data processing and Toeplitz inverse covariance clustering algorithm. Combined with CatBoost and LSTM models, a load prediction model is constructed, taking into account external factors and time series correlations, and selecting the best influencing factors for prediction.

Benefits of technology

It improves the accuracy of electricity load forecasting, adapts to complex and ever-changing external environments, and enhances the accuracy and applicability of forecasts. It is suitable for forecasting building and regional power loads and other time series with obvious seasonal characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118367542B_ABST
    Figure CN118367542B_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting short-term building electricity load based on seasonal load adaptive segmentation, comprising: constructing a multi-source dataset; preprocessing the multi-source dataset; using the preprocessed building electricity load data and dry-bulb temperature data to construct a seasonal load adaptive segmentation model, obtaining the seasonal load adaptive segmentation result; determining different prediction scenarios based on the seasonal load adaptive segmentation result and performing correlation analysis to select the optimal set of influencing factors under different prediction scenarios, constructing a feature dataset; inputting the feature datasets under different prediction scenarios into the electricity load prediction models for different prediction scenarios for model training; and obtaining the electricity load prediction result for the time point to be predicted based on the feature data and the trained electricity load prediction model. This invention fully utilizes the seasonal knowledge and internal and external information of building electricity load, which is beneficial to improving the accuracy of electricity load prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of load forecasting, specifically relating to a method for forecasting short-term building electricity load based on seasonal load adaptive division. Background Technology

[0002] Building short-term electricity load forecasting refers to the prediction of building electricity load over a future period based on historical data analysis. By forecasting building short-term electricity load, managers can understand the patterns and trends of building energy consumption, thereby developing targeted energy-saving and management measures to optimize building energy use. It can also support demand-side management in the building sector, ensuring accurate assessment of the effectiveness of demand response implementation; and by comparing the difference between actual and predicted energy consumption, it can monitor building operating status in real time, ensuring energy-efficient, high-performance, and safe building operation.

[0003] Building electricity load is influenced by meteorological conditions, date attributes, human behavior, and unforeseen events, exhibiting distinct seasonality, periodicity, nonlinearity, and non-stationarity. The degree of influence varies across seasons; therefore, appropriate seasonal load segmentation and modeling using samples from similar seasons can significantly improve prediction accuracy. Currently, commonly used seasonal segmentation methods include fixed-time and fixed-temperature segmentation. However, these methods fail to consider regional climate differences and the specific electricity consumption characteristics of buildings, making it difficult to accurately extract the seasonal features of building electricity load. Existing prediction methods mainly include time-series forecasting and driver-factor forecasting. Time-series forecasting only considers the impact of historical load data from a time-series perspective, failing to fully utilize external information, and its accuracy often suffers when external conditions change significantly. Driver-factor forecasting treats each sample as independent data, using external factors to fit short-term building electricity load, adapting to changing external environments. However, due to the strong temporal correlation of building electricity load, this approach does not consider the crucial information provided by historical data for future load forecasting, leaving room for improvement in the accuracy of short-term building load forecasting. Summary of the Invention

[0004] The main objective of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a method for predicting short-term building electricity load based on seasonal load adaptive division. By accurately dividing seasonal loads, extracting the main driving factors of building electricity load in different seasons, and considering the temporal correlation of building electricity load, the prediction accuracy is improved.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] This invention provides a method for predicting short-term building electricity load based on seasonal load adaptive partitioning, comprising the following steps:

[0007] S1: Obtain historical building electricity load data, outdoor meteorological data, and date attribute data to construct a multi-source dataset;

[0008] S2: Perform data preprocessing on multi-source datasets;

[0009] S3: Using the preprocessed building electricity load data and dry-bulb temperature data, construct a seasonal load adaptive partitioning model to obtain the seasonal load adaptive partitioning results;

[0010] S4: Based on the seasonal load adaptive division results, different prediction scenarios are determined, correlation analysis is performed on the factors affecting electricity load under different prediction scenarios, the best set of influencing factors under different prediction scenarios is selected, and a feature dataset is constructed.

[0011] S5: Input the feature datasets under different prediction scenarios into the electricity load prediction models for different prediction scenarios for model training;

[0012] S6: Based on the characteristic data of the time point to be predicted and the trained electricity load prediction model, obtain the electricity load prediction result for the time point to be predicted.

[0013] As a preferred technical solution, step S1 specifically includes:

[0014] The building's historical hourly electricity load data and outdoor meteorological data for the past N years are obtained from the building energy consumption monitoring platform, where N≥1; the outdoor meteorological data includes: dry bulb temperature, wet bulb temperature, dew point temperature, relative humidity, wind speed and solar radiation intensity. If the energy consumption monitoring platform cannot obtain outdoor meteorological data, it is obtained from the local meteorological department; the date attribute data includes: monthly / weekly attribute information, holiday attribute information and time attribute information.

[0015] As a preferred technical solution, step S2 specifically includes:

[0016] S21: Perform data cleaning on continuous data from multiple sources, including missing value detection and processing, and abrupt change value detection and processing. The continuous data includes electricity load data and outdoor weather data. Missing values ​​are those where data at a certain point in time is missing; imputation is performed using the mean of data before and after the missing point. Abrupt changes are those where data at a certain point in time deviates significantly from other data; the quartile method is used to detect abrupt changes at different times, as shown in the following formula:

[0017] IQR i =Q 3,i -Q 1,i

[0018] T u,i =Q 3,i +1.5*IQRi

[0019] T d,i =Q 1,i -1.5*IQR i

[0020] In the formula, Q 3,i Q is the 75th percentile value of each attribute data in the dataset at time i after sorting them from smallest to largest; 1,i IQR is the 25th percentile value of each attribute data in the dataset at time i, arranged from smallest to largest; i T is the interquartile range of the data at time i; u,i T represents the upper limit for determining the anomaly threshold at time i; d,i It is the lower limit of the abnormal threshold for time i; the criterion for judging mutation value is that the sample value is less than the lower limit of the abnormal threshold for time i or greater than the upper limit of the abnormal threshold for time i.

[0021] S22: Encode the discrete feature data in the multi-source dataset, wherein the discrete feature is date attribute data; the data encoding method is mean encoding, and the mean of the electricity load data under different values ​​of the discrete feature is calculated as the feature encoding value under that value.

[0022] As a preferred technical solution, step S3 specifically includes:

[0023] S31: Filter the preprocessed building electrical load data and dry-bulb temperature data;

[0024] S32: Normalize the filtered data;

[0025] S33: Based on the Toeplitz inverse covariance clustering algorithm, a seasonal load adaptive partitioning model is constructed to obtain the seasonal load adaptive partitioning results; wherein, the input of the Toeplitz inverse covariance clustering algorithm is the processed binary time series data of building electricity load and dry-bulb temperature; the seasonal load adaptive partitioning results represent the seasonal labels to which the historical data of different time periods belong, including but not limited to spring, summer, autumn and winter.

[0026] As a preferred technical solution, the construction of the seasonal load adaptive partitioning model in step S33 is specifically as follows:

[0027] S331: Divide the input data into several subsequences of length w, as follows:

[0028] X new =[X′1, X′ x ,…,X′ i ,…,X′ T ]

[0029] X′ i =[X i-w-1 , ..., X i ]

[0030] In the formula, X new It is the segmented dataset, a 2w×T dimensional matrix; X′ i It is a subsequence of length w, and is a 2×w dimensional vector; X i It is the original data, a 2-dimensional vector;

[0031] S332: Using the K-Means clustering algorithm to cluster X new Perform initial clustering to obtain the initial clustering assignment result P and the corresponding Toeplitz matrix Θ = {Θ1,…Θ} i ,…,Θ K}, P = {P e1 ,…P i ,…,P K} indicates that X new Clustered into K classes, Θ i The definition is as follows:

[0032]

[0033] In the formula, Θ i ∈R 2w×2w It is the Toeplitz inverse covariance matrix; A (0) A (1) ,…,A (w-1) ∈R 2×2 , is the inverse covariance matrix between building electricity load data and dry-bulb temperature data at different times;

[0034] S333: Fixed Θ i The following equation is used to update P by solving the dynamic programming algorithm. i :

[0035]

[0036]

[0037] In the formula, ll(X) t ,Θ i ) refers to X t Log-likelihood of being assigned to cluster i; μ i is the empirical average value of cluster i; β is the time consistency parameter, which imposes a penalty when adjacent subsequences do not belong to the same class. It is an indicator function for determining whether adjacent subsequences belong to the same cluster;

[0038] S334: Fixed P iThe alternating direction multiplier method (ADMM) is used to solve the following equation to update Θ. i :

[0039]

[0040] subject to Θ i ∈Γ

[0041] In the formula, tr() is the trace of the matrix; S i For P i The empirical covariance of all subsequences in the sequence;

[0042] S335: Alternately execute S333 and S334 until the preset number of iterations or error is reached to obtain the seasonal load adaptive partitioning result.

[0043] As a preferred technical solution, step S33 further includes:

[0044] The hyperparameters of the Toeplitz inverse covariance clustering algorithm were debugged and determined. These hyperparameters include the number of clusters K and the subsequence length w. A grid search method was used for debugging. The specific debugging method is as follows:

[0045] Initialize hyperparameter values ​​and set the hyperparameter variation range; calculate the clustering effect under different hyperparameter combinations, and select the hyperparameter combination with the best clustering effect as the debugging result; the clustering effect is calculated through clustering effect evaluation indicators, including DBI, and the calculation method is as follows:

[0046]

[0047] In the formula, K is the number of clusters; d(C i ) represents cluster C i The average distance from each point in the cluster to the centroid; μ i For cluster C i The center of mass; d(μ) i ,μ j ) represents cluster C i Centroid and Cluster C j The distance between the centers of mass.

[0048] As a preferred technical solution, in step S4, the predicted scenarios include: spring prediction scenarios, summer prediction scenarios, autumn prediction scenarios, and winter prediction scenarios; the correlation analysis method is Pearson correlation coefficient analysis, and the calculation method is as follows:

[0049]

[0050] In the formula, cov(X,Y) is the covariance between variables X and Y; σ X and σY It is the standard deviation between variables X and Y.

[0051] As a preferred technical solution, step S5 includes the following steps:

[0052] S51: Construct a CatBoost-based electricity load prediction model, specifically:

[0053] S511: Normalize the input feature dataset. The normalized dataset is D = {X} i ,Y i}(i=1,2,…,T);

[0054] S512: Randomly sort D, and the sorting result is s={s(1),s(2),…s(i),…,s(T)};

[0055] S513: For each sample X i Train a decision tree model M i (i = 1, 2, ..., T), the residual estimation formula for each training iteration is:

[0056] r i =Y i -M s(i-1) (X i )

[0057] In the formula, M s(i-1) (X i X is trained using samples contained in s(i-1). i The corresponding decision tree model;

[0058] S514: Use the residual estimate from each training iteration as the gradient estimate, and use this gradient to train the weak learner to obtain the final prediction result.

[0059] S52: Based on the output of the CatBoost model, construct an LSTM-based electricity load prediction model; specifically:

[0060] S521: Normalize the prediction results of the CatBoost model and input the feature dataset as new features to form the input sequence x = x1, x2, ..., x t-1 ;

[0061] S522: Solving the hidden layer output sequence h = h1, h2, ..., h of the LSTM network through iterative methods t ;

[0062] S523: Based on the hidden layer output sequence h obtained in S522, the model output sequence y = y1, y2, ..., y2 is obtained after transformation. t .

[0063] As a preferred technical solution, step S51 further includes the following step:

[0064] The hyperparameters of the CatBoost algorithm were debugged and determined using a grid search method. These hyperparameters included: number of iterations, learning rate, sample sampling ratio, column sampling ratio, and maximum tree depth. The specific debugging method was as follows:

[0065] Initialize hyperparameter values ​​and set the hyperparameter variation range; the goal of debugging is to minimize the model's loss function. The resulting hyperparameter combination is considered the optimal hyperparameter set. Let the loss function be MSE, and its calculation formula is as follows:

[0066]

[0067] In the formula, y i The actual value; n represents the model's predicted value; n is the number of samples.

[0068] In step S522, the LSTM memory unit outputs the hidden layer output sequence through three control gates, namely the forget gate f. t Input gate i t and output gate o t , using C t To describe the cell state at time t;

[0069] The f t Used to control whether and how much is forgotten at the current moment. t-1 The information in the calculation method is as follows:

[0070] f t =σ(W f (x t h t-1 )+b f )

[0071] Where σ is the sigmoid activation function; W f b is the forget gate weight matrix; f Forget gate bias term;

[0072] The i t The degree of cell state that should be updated at the current moment is calculated as follows:

[0073] i t =o(W i (x t h t-1 )+b i )

[0074] Among them, W i b is the input gate weight matrix;i For input gate bias terms;

[0075] The o t This is used to control how cell states are transformed into hidden layer output values, and the calculation method is as follows:

[0076] o t =σ(W o (x t h t-1 )+b o )

[0077] Among them, W o b is the output gate weight matrix; o This is the output gate bias term;

[0078] The unit state update method is as follows:

[0079] C′ t-1 =f t C t-1

[0080]

[0081]

[0082] Among them, C′ t-1 The state of the unit after forgetting information; The candidate cell state is represented by tanh; the activation function is W. c The weight matrix for controlling the state transitions of candidate cells; b c These are candidate state bias terms.

[0083] As a preferred technical solution, step S6 specifically includes the following steps:

[0084] S61: Based on the seasonal load division results in step S3, determine the forecast scenario to which the time point to be predicted belongs;

[0085] S62: Extract the feature data of the time point to be predicted in the current prediction scenario, input the feature data into the power load prediction model of the prediction scenario trained in step S5, and obtain the power load prediction result of the time point to be predicted.

[0086] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0087] This invention uses an adaptive seasonal load segmentation method to accurately extract the seasonal characteristics of the load and segment seasonal scenarios. It fully considers the climate differences in different regions and the differences in energy consumption characteristics between different buildings. The segmented seasonal scenarios are more in line with the actual situation, effectively enhancing the similarity of similar seasonal samples and the differences between dissimilar seasonal samples, which is conducive to improving the accuracy of electricity load prediction.

[0088] This invention establishes a load forecasting model for each seasonal scenario by dividing it into different seasonal scenarios and selecting the optimal set of influencing factors for each seasonal scenario. It fully considers the changes in the degree of influence of load influencing factors in different seasons, and the established load forecasting model is more targeted and more in line with the actual situation.

[0089] In the process of load forecasting, this invention takes into account both the influence of typical external driving factors and the temporal correlation of internal data. It fully leverages the advantages of CatBoost in handling multiple types of discontinuous features, model training speed, and handling large-scale datasets, as well as the advantages of LSTM in solving gradient vanishing, capturing long-term dependencies between variables, and learning temporal features, thereby further improving the forecasting accuracy of electricity load. At the same time, the method also has strong adaptability and can adapt to complex and ever-changing external environments.

[0090] This invention is applicable to short-term building power load forecasting, as well as regional and sub-system power load forecasting. It can also be extended to time series forecasting fields with obvious "seasonal" characteristics, such as wind power, traffic flow, and finance. Through deeper data mining, it can improve the accuracy of data forecasting and has good applicability. Attached Figure Description

[0091] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0092] Figure 1 This is a flowchart of the building electricity load forecasting method based on seasonal load adaptive partitioning, as described in an embodiment of the present invention.

[0093] Figure 2 This is a flowchart of the seasonal load adaptive partitioning method according to an embodiment of the present invention;

[0094] Figure 3 This is a flowchart of the CatBoost-LSTM-based power load combination prediction method according to an embodiment of the present invention;

[0095] Figure 4 This is a schematic diagram of the seasonal load adaptive partitioning result according to another embodiment of the present invention. Detailed Implementation

[0096] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0097] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0098] like Figure 1 As shown, this embodiment of the building short-term electricity load forecasting method based on seasonal load adaptive partitioning includes the following steps:

[0099] S1: Obtain historical building electricity load data, outdoor meteorological data, and date attribute data to construct a multi-source dataset.

[0100] Further, step S1 specifically involves: obtaining hourly electricity load data and outdoor meteorological data for the past N years from the building energy consumption monitoring platform, where N≥1; the outdoor meteorological data includes, but is not limited to: dry-bulb temperature, wet-bulb temperature, dew point temperature, relative humidity, wind speed, and solar radiation intensity. If the energy consumption monitoring platform cannot obtain outdoor meteorological data, it can be obtained from the local meteorological department; the date attribute data includes, but is not limited to: monthly / weekly attribute information, holiday attribute information, and time attribute information.

[0101] S2: Perform data preprocessing on multi-source datasets.

[0102] Further, step S2 includes the following steps:

[0103] S21: Perform data cleaning on continuous data from multiple sources, including missing value detection and processing, and abrupt change value detection and processing. The continuous data includes electricity load data and outdoor weather data. Missing values ​​are those where data at a certain point in time is missing; imputation is performed using the mean of data before and after the missing point. Abrupt changes are those where data at a certain point in time deviates significantly from other data; the quartile method is used to detect abrupt changes at different times, as shown in the following formula:

[0104] IQR i =Q 3,i -Q 1,i

[0105] T u,i =Q 3,i +1.5*IQR i

[0106] T d,i =Q 1,i -1.5*IQR i

[0107] In the formula, Q 3,i Q is the 75th percentile value of each attribute data in the dataset at time i after sorting them from smallest to largest; 1,i IQR is the 25th percentile value of each attribute data in the dataset at time i, arranged from smallest to largest; i T is the interquartile range of the data at time i; u,i T represents the upper limit for determining the anomaly threshold at time i; d,i It is the lower limit of the abnormal threshold for time i; the criterion for judging mutation value is that the sample value is less than the lower limit of the abnormal threshold for time i or greater than the upper limit of the abnormal threshold for time i.

[0108] Furthermore, for the detected mutation values, the average of the data before and after the mutation is used for replacement processing;

[0109] S22: Encode the discrete feature data in the multi-source dataset, wherein the discrete feature is date attribute data; the data encoding method is mean encoding, and the mean of the electricity load data under different values ​​of the discrete feature is calculated as the feature encoding value under that value.

[0110] S3: Using preprocessed building electricity load data and dry-bulb temperature data, construct a seasonal load adaptive partitioning model to obtain the seasonal load adaptive partitioning results.

[0111] Furthermore, such as Figure 2 As shown, step S3 includes the following steps:

[0112] S31: Filter the preprocessed building electrical load data and dry-bulb temperature data using the following formula:

[0113]

[0114]

[0115] In the formula, L′ i and T′ i These are the filtered values ​​for the building's electrical load and dry-bulb temperature at time t, respectively; L t-iand T t-i These are the building's electrical load and dry-bulb temperature data at time ti;

[0116] S32: Normalize the filtered data using the following formula:

[0117]

[0118] In the formula, X norm It is the normalized data; X max and X min These are the maximum and minimum values ​​in the original data;

[0119] S33: Based on the Toeplitz inverse covariance clustering algorithm, a seasonal load adaptive partitioning model is constructed to obtain the seasonal load adaptive partitioning results; wherein, the input of the Toeplitz inverse covariance clustering algorithm is the processed binary time series data of building electricity load and dry-bulb temperature; the seasonal load adaptive partitioning results represent the seasonal labels to which the historical data of different time periods belong, including but not limited to spring, summer, autumn and winter.

[0120] Furthermore, in step S33, the construction of the seasonal load adaptive partitioning model also includes the following steps:

[0121] S331: Divide the input data into several subsequences of length w, as follows:

[0122] X new = [X′1, X, ..., X′] i ,…,X′ T ]

[0123] X′1=[X i-w-1 , ..., X i ]

[0124] In the formula, X new It is the segmented dataset, a 2w×T dimensional matrix; X′ i It is a subsequence of length w, and is a 2×w dimensional vector; X i It is the original data, a 2-dimensional vector;

[0125] S332: Using the K-Means clustering algorithm to cluster X new Perform initial clustering to obtain the initial clustering assignment result P and the corresponding Toeplitz matrix Θ = {Θ1,…Θ} i ,…,Θ K}, P = {P1, ..., P} i ,…,P K} indicates that X new Clustered into K classes, Θ i The definition is as follows:

[0126]

[0127] In the formula, Θ i ∈R 2w×2w It is the Toeplitz inverse covariance matrix; A (0) A (1) ,…,A (w-1) ∈R 2×2 , is the inverse covariance matrix between building electricity load data and dry-bulb temperature data at different times;

[0128] S333: Fixed Θ i The following equation is used to update P by solving the dynamic programming algorithm. i :

[0129]

[0130]

[0131] In the formula, ll(X) t ,Θ i ) refers to X t Log-likelihood of being assigned to cluster i; μ i is the empirical average value of cluster i; β is the time consistency parameter, which imposes a penalty when adjacent subsequences do not belong to the same class. It is an indicator function for determining whether adjacent subsequences belong to the same cluster;

[0132] S334: Fixed P i The alternating direction multiplier method (ADMM) is used to solve the following equation to update Θ. i :

[0133]

[0134] subject to Θ i ∈F

[0135] In the formula, tr() is the trace of the matrix; S i For P i The empirical covariance of all subsequences in the sequence;

[0136] S335: Alternately execute S333 and S334 until the preset number of iterations or error is reached to obtain the seasonal load adaptive partitioning result.

[0137] Furthermore, step S33 also includes the tuning and determination of hyperparameters for the Toeplitz inverse covariance clustering algorithm. The hyperparameters include the number of clusters K and the subsequence length w. Tuning is performed using a grid search method, specifically as follows:

[0138] Initialize hyperparameter values ​​and set the hyperparameter variation range; calculate the clustering effect under different hyperparameter combinations, and select the hyperparameter combination with the best clustering effect as the debugging result; the clustering effect is calculated through clustering effect evaluation indicators, which include but are not limited to DBI, and the calculation method is as follows:

[0139]

[0140] In the formula, K is the number of clusters; d(C i ) represents cluster C i The average distance from each point in the cluster to the centroid; μ i For cluster C i The center of mass; d(μ) i ,μ j ) represents cluster C i Centroid and Cluster C j The distance between the centers of mass.

[0141] S4: Based on the seasonal load adaptive division results, different prediction scenarios are determined, correlation analysis is performed on the factors affecting electricity load under different prediction scenarios, the best set of influencing factors under different prediction scenarios is selected, and a feature dataset is constructed.

[0142] Furthermore, in step S4, the predicted scenarios include, but are not limited to: spring prediction scenarios, summer prediction scenarios, autumn prediction scenarios, and winter prediction scenarios; the correlation analysis method is Pearson correlation coefficient analysis, calculated as follows:

[0143]

[0144] In the formula, cov(X,Y) is the covariance between variables X and Y; σ X and σ Y It is the standard deviation between variables X and Y.

[0145] S5: Input the feature datasets under different prediction scenarios into the electricity load prediction models for different prediction scenarios for model training.

[0146] Furthermore, such as Figure 3 As shown, step S5 further includes the following steps:

[0147] S51: Construct a CatBoost-based electricity load prediction model;

[0148] S52: Based on the output results of the CatBoost model, construct an LSTM-based electricity load prediction model;

[0149] Furthermore, step S51 also includes the following steps:

[0150] S511: Normalize the input feature dataset. The normalized dataset is D = {X} i ,Y i}(i=1,2,…,T);

[0151] S512: Randomly sort D, and the sorting result is s={s(1),s(2),…s(i),…,s(T)};

[0152] S513: For each sample X i Train a decision tree model M i (i = 1, 2, ..., T), the residual estimation formula for each training iteration is:

[0153] r i =Y i -M s(t-1) (X i )

[0154] In the formula, M s(i-1) (X i X is trained using samples contained in s(i-1). i The corresponding decision tree model.

[0155] S514: Use the residual estimate from each training iteration as the gradient estimate, and use this gradient to train the weak learner to obtain the final prediction result.

[0156] Furthermore, step S51 also includes the following steps:

[0157] The hyperparameters of the CatBoost algorithm were debugged and determined using a grid search method. These hyperparameters include, but are not limited to, the number of iterations, learning rate, sample sampling ratio, column sampling ratio, and maximum tree depth. The specific debugging method is as follows:

[0158] Initialize hyperparameter values ​​and set the hyperparameter variation range; the goal of debugging is to minimize the model's loss function. The resulting hyperparameter combination is considered the optimal hyperparameter set. Let the loss function be MSE, and its calculation formula is as follows:

[0159]

[0160] In the formula, y i The actual value; is the model's predicted value; n is the number of samples.

[0161] Furthermore, step S52 also includes the following steps:

[0162] S521: Normalize the prediction results of the CatBoost model and input the feature dataset as new features to form the input sequence x = x1, x2, ..., xt-1 ;

[0163] S522: Solving the hidden layer output sequence h = h1, h2, ..., h of the LSTM network through iterative methods t ;

[0164] S523: Based on the hidden layer output sequence h obtained in S522, the model output sequence y = y1, y2, ..., y2 is obtained after transformation. t

[0165] Furthermore, in step S522, the LSTM memory unit outputs the hidden layer output sequence through three control gates, namely the forget gate f t Input gate i t and output gate o t , using C t To describe the cell state at time t;

[0166] The f t Used to control whether and how much is forgotten at the current moment. t-1 The information in the calculation method is as follows:

[0167] f t =σ(W f (x t h t-1 )+b f )

[0168] Where σ is the sigmoid activation function; W f b is the forget gate weight matrix; f Forget gate bias term;

[0169] The i t The degree of cell state that should be updated at the current moment is calculated as follows:

[0170] i t =σ(W i (x t h t-1 )+b i )

[0171] Among them, W i b is the input gate weight matrix; i For input gate bias terms;

[0172] The o t This is used to control how cell states are transformed into hidden layer output values, and the calculation method is as follows:

[0173] o t =σ(W o (x t h t-1)+b o )

[0174] Among them, W o b is the output gate weight matrix; o This is the output gate bias term;

[0175] The unit state update method is as follows:

[0176] C′ t-1 =f t C t-1

[0177]

[0178]

[0179] Among them, C′ t-1 The state of the unit after forgetting information; The candidate cell state is represented by tanh; the activation function is W. c The weight matrix for controlling the state transitions of candidate cells; b c Candidate state bias terms;

[0180] Furthermore, the hidden layer output value is calculated as follows:

[0181] h t =o t tanhC t

[0182] Furthermore, in step S523, the model output value is calculated as follows:

[0183] y t =W y h t +b y

[0184] Furthermore, step S52 also includes the following steps:

[0185] The hyperparameters of the LSTM algorithm are debugged and determined using a grid search method. These hyperparameters include, but are not limited to, the number of hidden layers, the number of neurons in the hidden layer, the time step, and the batch size. The hyperparameter values ​​are initialized, the hyperparameter variation range is set, and the combination of hyperparameters that minimizes the MSE is selected as the result of the hyperparameter debugging.

[0186] S6: Based on the characteristic data of the time point to be predicted and the trained electricity load prediction model, obtain the electricity load prediction result for the time point to be predicted.

[0187] Furthermore, in step S6, the specific steps are as follows:

[0188] S61: Based on the seasonal load division results in step S3, determine the forecast scenario to which the time point to be predicted belongs;

[0189] S62: Extract the feature data of the time point to be predicted in the current prediction scenario, input the feature data into the power load prediction model of the prediction scenario trained in step S5, and obtain the power load prediction result of the time point to be predicted.

[0190] In another specific embodiment of this application, the building short-term electricity load forecasting method based on seasonal load adaptive partitioning includes the following steps:

[0191] S1: Obtain historical electricity load data, outdoor meteorological data, and date attribute data for a certain office building. Specific data includes electricity load data at time t, time t-1, time t-2, dry-bulb temperature at time t, dry-bulb temperature at time t-1, dry-bulb temperature at time t-2, wet-bulb temperature at time t, wet-bulb temperature at time t-1, wet-bulb temperature at time t-2, dew point temperature at time t, relative humidity at time t, wind speed at time t, month, week type, day type, and time value; a total of 13,896 data points from 0:00 on June 1, 2021 to 23:00 on December 31, 2022 are used as samples.

[0192] S2: Perform data preprocessing on multi-source datasets, including data cleaning and data encoding;

[0193] S3: Using preprocessed building electricity load data and dry-bulb temperature data, a seasonal load adaptive partitioning model is constructed after data filtering and normalization. The grid search range is set as follows: K = 3–8, w = 1–8, and the step size is 1. The grid search result is: K = 3, w = 2. The clustering result is 3, and the seasonal load adaptive partitioning result is: summer, transition season, winter, as shown below. Figure 4 As shown.

[0194] S4: Based on the seasonal load adaptive segmentation results, three prediction scenarios are determined: summer prediction scenario, transitional season prediction scenario, and winter prediction scenario. Correlation analysis is performed on the factors affecting electricity load under different prediction scenarios to select the optimal set of influencing factors for each scenario and construct a feature dataset. The feature dataset for the summer prediction scenario includes: electricity load data at time t-1, electricity load data at time t-2, dry-bulb temperature at time t-2, relative humidity at time t, week type, day type, and time value. The feature dataset for the transitional season prediction scenario includes: electricity load data at time t-1, electricity load data at time t-2, dry-bulb temperature at time t-2, wet-bulb temperature at time t, dew point temperature at time t, relative humidity at time t, week type, day type, and time value. The feature dataset for the winter prediction scenario includes: electricity load data at time t-1, electricity load data at time t-2, relative humidity at time t, week type, day type, and time value.

[0195] S5: Input the feature datasets from different prediction scenarios into the electricity load prediction models for different prediction scenarios for model training; set the CatBoost model hyperparameter grid search range as follows: number of iterations 50–2000, step size 50, learning rate 0.001–0.1, step size 0.001, maximum tree depth 3–16, step size 1, sample sampling ratio 0.6–0.8, step size 0.1, column sampling ratio 0.6–0.8, step size 0.1; grid search result: number of iterations 1450, learning rate 0.0 12. The maximum tree depth is 8, the sample sampling ratio is 0.8, and the column sampling ratio is 0.8. The hyperparameter search range of the LSTM model is set as follows: number of hidden layers 1-3, step size 1, number of hidden layer neurons 32-128, step size 32; time step 1, 24, 168, batch size 16-64, step size 16. The grid search results are: number of hidden layers 2, number of hidden layer neurons 64 or 128, time step 24, batch size 16. The above hyperparameter combination is used as the hyperparameter setting result of the electricity load prediction model.

[0196] S6: Based on the characteristic data of the time point to be predicted and the trained electricity load prediction model, obtain the electricity load prediction result for the time point to be predicted.

[0197] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0198] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0199] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for predicting short-term building electricity load based on seasonal load adaptive partitioning, characterized in that, Includes the following steps: S1: Obtain historical building electricity load data, outdoor meteorological data, and date attribute data to construct a multi-source dataset; S2: Perform data preprocessing on multi-source datasets; S3: Using the preprocessed building electricity load data and dry-bulb temperature data, construct a seasonal load adaptive partitioning model to obtain the seasonal load adaptive partitioning results; S4: Based on the seasonal load adaptive division results, different prediction scenarios are determined, correlation analysis is performed on the factors affecting electricity load under different prediction scenarios, the best set of influencing factors under different prediction scenarios is selected, and a feature dataset is constructed. S5: Input the feature datasets under different prediction scenarios into the electricity load prediction models for different prediction scenarios for model training, including the following steps: S51: Construct an electricity load forecasting model based on CatBoost, specifically: S511: Normalize the input feature dataset. The normalized dataset is D = {X} i ,Y i }(i=1,2,…,T); S512: Randomly sort D, and the sorting result is s={s(1),s(2),…s(i),…,s(T)}; S513: For each sample X i Train a decision tree model M i (i = 1, 2, ..., T), the residual estimation formula for each training iteration is: r i =Y i -M s(i-1) (X i ) In the formula, M s(k-1) (X i X is trained using samples contained in s(i-1). i The corresponding decision tree model; S514: Use the residual estimate from each training iteration as the gradient estimate, and use this gradient estimate to train the weak learner to obtain the final prediction result. S52: Based on the output of the CatBoost model, construct an LSTM-based electricity load prediction model; specifically: S521: Normalize the prediction results of the CatBoost model and input the feature dataset as new features to form the input sequence x = x1, x2, ..., x t-1 ; S522: Solving the hidden layer output sequence h = h1, h2, ..., j of the LSTM network iteratively t ; S523: Based on the hidden layer output sequence h obtained in S522, the model output sequence y = y1, y2, ..., y2 is obtained after transformation. t ; S6: Based on the characteristic data of the time point to be predicted and the trained electricity load prediction model, obtain the electricity load prediction result for the time point to be predicted.

2. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning as described in claim 1, characterized in that, Step S1 specifically involves: The building's historical hourly electricity load data and outdoor meteorological data for the past N years are obtained from the building energy consumption monitoring platform, where N≥1; the outdoor meteorological data includes: dry bulb temperature, wet bulb temperature, dew point temperature, relative humidity, wind speed and solar radiation intensity. If the energy consumption monitoring platform cannot obtain outdoor meteorological data, it is obtained from the local meteorological department; the date attribute data includes: monthly / weekly attribute information, holiday attribute information and time attribute information.

3. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 1, characterized in that, Step S2 specifically involves: S21: Perform data cleaning on continuous data from multiple sources, including missing value detection and processing, and abrupt change value detection and processing. The continuous data includes electricity load data and outdoor weather data. Missing values ​​are those where data at a certain point in time is missing; imputation is performed using the mean of data before and after the missing point. Abrupt changes are those where data at a certain point in time deviates significantly from other data; the quartile method is used to detect abrupt changes at different times, as shown in the following formula: IQR i JQ 3,i -Q 1,i T u,i JQ 3,i +1.5*IQR i T 3,i JQ 1,i -1.5*IQR i In the formula, Q 3,i Q is the 75th percentile value of each attribute data in the dataset at time i after sorting them from smallest to largest; 1,i IQR is the 25th percentile value of each attribute data in the dataset at time i, arranged from smallest to largest; i It is the interquartile range of the data at time i; T u,i This is the upper limit for determining the anomaly threshold at time i; T d,i It is the lower limit of the abnormal threshold for time i; the criterion for judging mutation value is that the sample value is less than the lower limit of the abnormal threshold for time i or greater than the upper limit of the abnormal threshold for time i. S22: Encode the discrete feature data in the multi-source dataset, wherein the discrete feature is date attribute data; the data encoding method is mean encoding, and the mean of the electricity load data under different values ​​of the discrete feature is calculated as the feature encoding value under that value.

4. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 1, characterized in that, Step S3 specifically involves: S31: Filter the preprocessed building electrical load data and dry-bulb temperature data; S32: Normalize the filtered data; S33: Based on the Toeplitz inverse covariance clustering algorithm, a seasonal load adaptive partitioning model is constructed to obtain the seasonal load adaptive partitioning results; wherein, the input of the Toeplitz inverse covariance clustering algorithm is the processed binary time series data of building electricity load and dry-bulb temperature; the seasonal load adaptive partitioning results represent the seasonal labels to which the historical data of different time periods belong, including but not limited to spring, summer, autumn and winter.

5. The building short-term electricity load forecasting method based on seasonal load adaptive partitioning according to claim 4, characterized in that, In step S33, the construction of the seasonal load adaptive partitioning model is specifically as follows: S331: Divide the input data into several subsequences of length w, as follows: X new =[X′1,X′ x ,…,X′ i ,…,X′ T ] X′ i =[X i-w-1 ,…,X i ] In the formula, X new It is the segmented dataset, a 2w×T dimensional matrix; X i ′ is a subsequence of length w, and is a 2×w dimensional vector; X i It is the original data, a 2-dimensional vector; S332: Using the K-Means clustering algorithm to cluster X new Perform initial clustering to obtain the initial clustering assignment result P and the corresponding Toeplitz matrix Θ = {Θ1,…Θ} i ,…,Θ K }, P = {P1, ..., P} i ,…,P K } indicates that X new Clustered into K classes, Θ i The definition is as follows: In the formula, Θ i ∈R 2w×2w It is the Toeplitz inverse covariance matrix; A (0) A (1) ,…,A (w-1) ∈R 2×2 , is the inverse covariance matrix between building electricity load data and dry-bulb temperature data at different times; S333: Fixed Θ i The following equation is used to update P by solving the dynamic programming algorithm. i : In the formula, ll(X) t ,Θ i ) refers to X t Log-likelihood of being assigned to cluster i; μ i is the empirical average value of cluster i; β is the time consistency parameter, which imposes a penalty when adjacent subsequences do not belong to the same class. It is an indicator function for determining whether adjacent subsequences belong to the same cluster; S334: Fixed P i The alternating direction multiplier method (ADMM) is used to solve the following equation to update Θ. i : subject to Θ i ∈Γ In the formula, tr() is the trace of the matrix; S i For P i The empirical covariance of all subsequences in the sequence; S335: Alternately execute S333 and S334 until the preset number of iterations or error is reached to obtain the seasonal load adaptive partitioning result.

6. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 4, characterized in that, Step S33 further includes: The hyperparameters of the Toeplitz inverse covariance clustering algorithm were debugged and determined. These hyperparameters include the number of clusters K and the subsequence length w. A grid search method was used for debugging. The specific debugging method is as follows: Initialize hyperparameter values ​​and set the hyperparameter variation range; calculate the clustering effect under different hyperparameter combinations, and select the hyperparameter combination with the best clustering effect as the debugging result; the clustering effect is calculated through clustering effect evaluation indicators, including DBI, and the calculation method is as follows: In the formula, K is the number of clusters; d(C i ) represents cluster C i The average distance from each point in the cluster to the centroid; μ i For cluster C i The center of mass; d(μ) i ,μ j ) represents cluster C i Centroid and Cluster C j The distance between the centers of mass.

7. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 1, characterized in that, In step S4, the predicted scenarios include: spring, summer, autumn, and winter prediction scenarios; the correlation analysis method is Pearson correlation coefficient analysis, calculated as follows: In the formula, cov(X,Y) is the covariance between variables X and Y; σ X and σ Y It is the standard deviation between variables X and Y.

8. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 1, characterized in that, Step S51 further includes the following steps: The hyperparameters of the CatBoost algorithm were debugged and determined using a grid search method. These hyperparameters included: number of iterations, learning rate, sample sampling ratio, column sampling ratio, and maximum tree depth. The specific debugging method was as follows: Initialize hyperparameter values ​​and set the hyperparameter variation range; the goal of debugging is to minimize the model's loss function. The resulting hyperparameter combination is considered the optimal hyperparameter set. Let the loss function be MSE, and its calculation formula is as follows: In the formula, y i The actual value; n represents the model's predicted value; n is the number of samples. In step S522, the LSTM memory unit outputs the hidden layer output sequence through three control gates, namely the forget gate f. t Input gate i t and output gate o t , using C t To describe the cell state at time t; The f t Used to control whether and how much is forgotten at the current moment. t-1 The information in the calculation method is as follows: f t =σ(W f (x t ,h t-1 )+b f ) Where σ is the sigmoid activation function; W f b is the forget gate weight matrix; f Forget gate bias term; The i t The degree of cell state that should be updated at the current moment is calculated as follows: i t =σ(W i (x t ,h t-1 )+b i ) Among them, W i b is the input gate weight matrix; i For input gate bias terms; The o t This is used to control how cell states are transformed into hidden layer output values, and the calculation method is as follows: the t =σ(W o (x t ,h t-1 )+b o ) Among them, W o b is the output gate weight matrix; o This is the output gate bias term; The unit state update method is as follows: C′ t-1 =f t C t-1 Among them, C′ t-1 The state of the unit after forgetting information; The candidate cell state is represented by tanh; the activation function is W. c The weight matrix for controlling the state transitions of candidate cells; b c These are candidate state bias terms.

9. The method for predicting short-term building electricity load based on seasonal load adaptive partitioning according to claim 1, characterized in that, In step S6, the specific steps are as follows: S61: Based on the seasonal load division results in step S3, determine the forecast scenario to which the time point to be predicted belongs; S62: Extract the feature data of the time point to be predicted in the current prediction scenario, input the feature data into the power load prediction model of the prediction scenario trained in step S5, and obtain the power load prediction result of the time point to be predicted.

Citation Information

Patent Citations

  • Multi-energy system multi-type load joint prediction method and system

    CN114548509A

  • Power load prediction method for realizing error correction mechanism based on LSTM-XGBoost

    CN116739118A