A short-term load forecasting method for buildings
Through the combination of adaptive integrated clustering and edRVFL model, cluster weight parameters are optimized, and the accuracy and reliability of short-term load prediction of buildings in the prior art are solved, achieving more efficient and accurate load prediction.
Patent Information
- Application Number
- CN202411859024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2044-12-17
AI Technical Summary
In the face of dynamic and complex load changes, existing short-term load prediction methods are difficult to improve the accuracy and reliability of predictions, and fail to fully tap data potential and combine the physical characteristics of the building.
Adaptive integrated clustering method is adopted to combine historical load data with weather and date data, unsupervised and supervised learning is performed through OPTICS and KNN algorithms, clustering labels are generated and classified predictions are performed. Then, the clustering of target and neighboring days is predicted using the edRVFL model, and the cluster weight parameters are optimized through the improved PSO algorithm, and dynamic weighting is finally performed to output the load prediction value.
It improves the accuracy and reliability of short-term load prediction of buildings, can better capture the deep-seated characteristics of load changes, and adapt to the actual operating environment of buildings, providing more accurate prediction support.
Smart Images

Figure CN119312115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building energy consumption prediction, and particularly relates to a short-term load prediction method for buildings. Background Art
[0002] Short-term load prediction plays a key role in building energy consumption prediction. However, due to the dynamic characteristics of building load fluctuations, it is easy to cause load overestimation, which seriously affects the accuracy of prediction. The traditional short-term load prediction neural network identifies potential features in load data through an improved clustering method, providing a more accurate basis for weight adjustment in the dynamic weighting method. Therefore, the dynamic weighting method based on the development of clustering algorithms can effectively improve the accuracy of short-term load prediction.
[0003] Under the background of power market reform and smart grid construction, current short-term load prediction for buildings faces many challenges. First, with the large-scale access of renewable energy and the increasing load volatility, the uncertainty of load prediction has increased significantly, and traditional prediction methods are difficult to flexibly cope with dynamic and complex load changes. Second, although traditional methods rely on a large amount of historical data for training and prediction, the potential information in these data is often not fully exploited, resulting in the model being unable to capture the deep features of load changes. At the same time, these methods fail to effectively integrate the physical characteristics of buildings and system operation constraints, limiting the prediction accuracy. Finally, traditional prediction methods lack adaptability to the building environment and its unique characteristics, restricting their application in building energy management. Generally speaking, improving the accuracy and reliability of building load prediction requires a more intelligent prediction model that can fully exploit data potential, combine physical models, and adapt to the actual operating environment of buildings, providing a more supportive prediction tool for decision-makers.
[0004] The Chinese patent with the application number CN202311481491.1 discloses a short-term building load forecasting method. This method first selects a building from a dataset, extracts the load data of the building within a certain time period as the original data, processes the original data for outliers and missing values to obtain feature data; establishes a TCN-LSTM model based on the residual self-attention mechanism, uses the feature data to train the model to obtain the predicted load value; uses an improved sparrow search algorithm to optimize the hyperparameters of the RSA-TCN-LSTM model; and uses the optimized RSA-TCN-LSTM prediction model to predict the building load. This method specifically adopts a long short-term memory network, but does not consider that there is still room for further optimization at the hyperparameter level of the model. When considering the historical electricity load, it does not fully consider multi-dimensional influencing factors such as meteorological factors and holiday days, thus being unable to better capture the relevant factors in load forecasting. The Chinese patent with the application number CN201811101491.3 discloses a building daily electricity load forecasting method and storage medium based on a clustering algorithm. This method provides a building daily electricity load forecasting method based on a clustering algorithm, and respectively obtains the electricity load values of a pre-determined building on each day within a pre-defined time period; performs clustering processing on the electricity consumption values of each day within a pre-defined unit time according to the pre-determined clustering algorithm to obtain a first electricity load cluster and a second electricity load cluster; if it is necessary to predict the electricity load of the building on a certain working day, then according to the clustering center of the first electricity load cluster, predict the electricity load value of this working day; if it is necessary to predict the electricity load of the building on a certain non-working day, then according to the clustering center of the second electricity load cluster, predict the electricity load value of this non-working day. This method relatively independently processes the clustering information of working days and non-working days, and fails to fully utilize the correlation between these two types of clusters. There may be a certain correlation between the electricity loads of working days and non-working days, such as similar seasonal or periodic factors, and this information can be better utilized to enhance the accuracy of the prediction model. Therefore, there is an urgent need to introduce a more comprehensive load data analysis and forecasting strategy that can establish a connection between the load clusters of working days and non-working days. By fully utilizing the information in these two types of clustering datasets and deeply exploring the correlation between them, it will help to improve the overall accuracy and robustness of load forecasting and provide a more accurate basis for building electricity energy-saving management. Summary of the Invention
[0005] The object of the present invention is to provide a short-term building load forecasting method, which is beneficial to improving the accuracy, reliability, robustness and efficiency of short-term building load forecasting.
[0006] To achieve the above object, the technical solution adopted by the present invention is: a short-term building load forecasting method, including the following steps:
[0007] Step 1: Collect historical load data for load forecasting, including historical load, weather, and date data, and preprocess the collected historical load data;
[0008] Step 2: Combine historical load data with weather and date data through adaptive integrated clustering, apply the historical load data to the unsupervised learning algorithm OPTICS to obtain clustering labels for the training data; use the clustering labels for classification through supervised learning KNN, and classify and predict future date types;
[0009] Step 3: After clustering, use the edRVFL model to predict two different clusters of the target day and adjacent days, and generate corresponding predicted values respectively and ;
[0010] Step 4: According to the obtained predicted values and , the label to which the target day belongs, and the actual load value at the corresponding t moment , construct dynamic weighting strategies e1 and e2 based on relative error;
[0011] Step 5: Use the improved PSO algorithm to optimize the weight parameters of the clustering;
[0012] Step 6: Combine the optimized weight parameters, perform dynamic weighting processing on the building load, and output the final load prediction value.
[0013] Further, in the above Step 1, preprocessing the collected historical load data includes the following steps:
[0014] Step 1.1: Use Lagrange interpolation method to fill in the missing values in the historical load data. By constructing a polynomial function and using the known load data for interpolation, estimate the missing load data;
[0015] Step 1.2: Use One - Hot encoding to process discrete features, map the values of different discrete features to points in the Euclidean space, and then convert them into recognizable digital signals.
[0016] Further, the above Step 1.1 includes the following steps:
[0017] Step 1.1.1: Use n + 1 discrete points , where represents the i - th discrete point, and obtain the Lagrange interpolation polynomial L n ( x ) as shown in Formulas (1 - 1) and (1 - 2):
[0018] (1-1)
[0019] (1-2)
[0020] Wherein, w n+1 ( x ) is an interpolation polynomial;
[0021] Using the known load data to obtain the Lagrange interpolation polynomial, and then substituting the node to be calculated into the Lagrange interpolation polynomial to estimate the missing data and complete the filling of the missing value of the load data;
[0022] Step 1.1.2, identifying outliers using a box plot, where the outlier is defined as greater than Q U +1.5 IQR or less than Q L -1.5 IQR value; Q U + is the upper quartile, indicating that 1 / 4 of all observed values are greater than it, Q L is the lower quartile, indicating that 1 / 4 of all data are less than it; IQR is the interquartile range, which is Q U and Q L difference, which contains half of the observed values;
[0023] Step 1.1.3, converting the original data to the range of [0,1] through a linear function normalization method, as shown in formula (1-3):
[0024] (1-3)
[0025] Wherein, x is the original data, x min and x max are the minimum and maximum values of the original data respectively, x nor is the normalized standard data.
[0026] Furthermore, the step 2 includes the following steps:
[0027] Step 2.1, for non-prediction day data, that is, historical load data X1. Select the historical load time series, apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series, identify the clustering structure by detecting the density changes in the data points without a predetermined number of clusters, and obtain the clustering data sets of different categories, Cluster Type A, …, Cluster Type N;
[0028] Step 2.2. For the data of the prediction day, i.e., the target data X 2. Apply the KNN algorithm to perform supervised learning on the target day, use the weather and date feature columns as the model input, obtain the label type to which the target day belongs, and complete the classification of the prediction day.
[0029] Furthermore, in the said Step 3, according to the clustering data sets obtained by the adaptive ensemble clustering in Step 2, use the edRVFL model based on the Bayesian optimization algorithm to predict the two different clustering data sets of the target day and the adjacent days, and generate the corresponding predicted values and ; wherein, the Bayesian optimization algorithm consists of five elements: a surrogate function, a hyperparameter search space, an acquisition function, an objective function, and an evaluation history; the objective function uses the tree-based Parzen window estimation algorithm to model the surrogate function and uses the expected improvement as the acquisition function, as shown in formula (3-1):
[0030] (3-1)
[0031] Wherein, f is the objective function, is the threshold of the objective function for the given hyperparameter v .
[0032] Furthermore, the said Step 3 includes the following steps:
[0033] Step 3.1. Input parameter initialization: objective function f , TPE method , hyperparameter space , acquisition function verification , initialized memory ; output parameter initialization: memory , the best hyperparameter in v * ;
[0034] Step 3.2. For each iteration from 1 to N l , use the TPE method to fit the memory , and calculate the probability distribution of the objective function under the given hyperparameters ;
[0035] Step 3.3: Find the next hyperparameter by maximizing the acquisition function to find a new hyperparameter combination from the hyperparameter space; v i+1
[0036] Step 3.4: Evaluate the objective function to calculate the objective function value corresponding to the new hyperparameter v i+1 ;
[0037] Step 3.5: Add the new hyperparameter combination and its corresponding objective function value (estimated objective function ) to the memory , that is ;
[0038] Step 3.6: Repeat the above steps 3.2 to 3.5 until all N iterations are completed, and finally output the best hyperparameter found in the memory v * ;
[0039] Step 3.7: After completing the hyperparameter optimization iteration process, build the edRVFL model, initialize the neural network parameters of the input layer, hidden layer, and output layer, and pre-load the optimal parameter model; make predictions on the dataset where the target day is located and the dataset where the adjacent day is located respectively, and generate the corresponding predicted values and .
[0040] Furthermore, step 4 includes the following steps:
[0041] Step 4.1: Optimize the weights based on the relative error marked as e according to the actual value and the predicted value, as shown in formula (4-1):
[0042] (4-1)
[0043] where and are the weights of the clusters to which the target day and the adjacent day belong respectively;
[0044] Step 4.2: Considering different electricity consumption scenarios, construct a dynamic weighting strategy based on the relative error e j , where represents two different situations based on the clustered data;
[0045] Step 4.3: For the target day being a working day, the error e 1 The average relative error from all past load data, and the corresponding formulas are shown in (4-2) and (4-3):
[0046] (4-2)
[0047] (4-3)
[0048] Among them, the length of the weighted window is k , , the length of the input data is w , r represents the median value of the weighted window change;
[0049] Step 4.4. For the target day being a non-working day, the error e 2 is calculated from the relative error of the load data at the previous time step, and the corresponding formulas are shown in (4-4) and (4-5):
[0050] (4-4)
[0051] (4-5).
[0052] Furthermore, in the said Step 5, according to the dynamic weighting strategy based on relative error e j , , using the improved PSO algorithm to optimize and , including the following steps:
[0053] Step 5.1. Initialize the required parameters, including the particle swarm size , the maximum number of iterations U and the learning factor σ ; for each particle i , initialize the position and velocity of the particle, and the corresponding formulas are shown in (5-1) and (5-2):
[0054] (5-1)
[0055] (5-2)
[0056] Step 5.2. For M constraints, particles and U iterations, the unconstrained optimization function F ( x ) of the particle is shown in (5-3):
[0057] (5 - 3)
[0058] Wherein, τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) represents the total penalty including M constraints;
[0059] Calculate the fitness function of each particle i , calculate the specific value of the position and and obtain the fitness ; Evaluate the current fitness of the particle and set its individual optimal position i and the corresponding fitness p i and F ( p i );
[0060] Step 5.3, Record the global optimal position p g and its corresponding fitness value F ( p g );
[0061] Step 5.4, Perform loop iteration, loop from 1 to the maximum number of iterations U ; Update the velocity and position of each particle i;
[0062] Step 5.5, For each particle i , calculate the updated and and calculate the new fitness ; If the fitness of the new position is better than the current individual optimal F ( p i ), then the individual optimal position of the new particle ;
[0063] Step 5.6, Check whether the individual optimal fitness of the current particle F ( p i ) is better than the global optimal F ( p g ), if so, update the global optimal position ;
[0064] Step 5.7: Repeat steps 5.2 to 5.6 until the maximum number of iterations is reached U , and finally output the global optimal position and fitness value;
[0065] Step 5.8: According to the dynamic weighting strategy based on relative error e j , , complete the dynamic weighting process of load forecasting; use the improved PSO algorithm to optimize the objective function through different updated weights. The dynamic weighting objectives of load forecasting are shown in formulas (5-4) and (5-5):
[0066] (5-4)
[0067] (5-5)
[0068] Substitute the objective function into step 5.7 to output the optimized weights and .
[0069] Furthermore, in step 6, combine the optimized weights and , and use the edRVFL model optimized by hyperparameters to predict different clustering datasets to obtain and ; finally, according to the weighting formula (6-1), perform dynamic weighting processing on the building load and output the final load forecasting value;
[0070] (6-1).
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] 1) The present invention innovatively combines adaptive integrated clustering with OPTICS and KNN to identify unknown load patterns, improving the classification accuracy of building load electricity consumption. On this basis, by designing a dynamic weighting strategy, the effective information in these two types of clusters, namely working days and non-working days, is deeply mined to establish a correlation relationship, further improving the accuracy and reliability of load forecasting. Through this dynamic weighting strategy, not only can the change characteristics under different load patterns be better captured, but also the robustness of the prediction can be improved, providing more accurate support for load management.
[0073] 2) In the present invention, the edRVFL model significantly reduces the training time of the model by randomizing weights and directly calculating the weights of the output layer. Compared with traditional neural networks, it does not require complex iterative training and can quickly process a large amount of building load data, thereby improving the prediction efficiency and meeting the requirements of real-time prediction. When facing complex load fluctuations, the model exhibits good generalization ability through multi-layer random vector mapping; in addition, the model can capture complex non-linear relationships in the load data, effectively respond to the dynamic changes of the load, and provide more accurate prediction results. Description of the Drawings
[0074] Figure 1 is the schematic diagram of the method implementation of the embodiment of the present invention;
[0075] Figure 2 is the schematic diagram of box plot outlier detection in the embodiment of the present invention;
[0076] Figure 3 is the flowchart of the OPTICS algorithm in the embodiment of the present invention;
[0077] Figure 4 is the flowchart of the KNN algorithm in the embodiment of the present invention;
[0078] Figure 5 is the classification result diagram of adaptive integrated clustering in the embodiment of the present invention;
[0079] Figure 6 is the flowchart of the improved PSO algorithm in the embodiment of the present invention; Detailed Embodiments
[0080] The present invention will be further described below in conjunction with the drawings and embodiments.
[0081] It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs.
[0082] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0083] As Figure 1 shown, this embodiment provides a short-term load prediction method for buildings, including the following steps:
[0084] Step 1: Collect historical load data for load forecasting, including historical load, weather, and date data, and preprocess the collected historical load data.
[0085] In the above Step 1, preprocessing the collected historical load data includes the following steps:
[0086] Step 1.1: Use Lagrange interpolation method to fill in the missing values in the historical load data. By constructing a polynomial function and using the known load data for interpolation, estimate the missing load data.
[0087] Step 1.1.1: Use n + 1 discrete points , where represents the i-th discrete point, and obtain the Lagrange interpolation polynomial through the Lagrange interpolation function L n ( x ), as shown in Formulas (1-1) and (1-2):
[0088] (1-1)
[0089] (1-2)
[0090] In the formula, w n+1 ( x ) is the interpolation polynomial.
[0091] Use the known load data to find the Lagrange interpolation polynomial, and then substitute the node to be calculated into the Lagrange interpolation polynomial to estimate the missing data, completing the filling of the missing values in the load data.
[0092] Step 1.1.2: As Figure 2 shown, use the box plot to identify outliers. Outliers are defined as values greater than Q U + 1.5 IQR or less than Q L - 1.5 IQR ; Q U + is the upper quartile, indicating that 1 / 4 of all observed values are larger than it, Q L is the lower quartile, indicating that 1 / 4 of all data are smaller than it; IQR is the interquartile range, which is the difference between Q U and Q L , and it contains half of the observed values.
[0093] Step 1.1.3: Convert the original data to the range [0, 1] through the linear function normalization method, as shown in formula (1-3):
[0094] (1-3)
[0095] where x is the original data, x min and x max are the minimum and maximum values of the original data respectively, x nor is the normalized standard data.
[0096] Step 1.2: Use One-Hot encoding to process discrete features, map the values of different discrete features to points in the Euclidean space, and then convert them into recognizable digital signals.
[0097] Step 2: Combine the historical load data with weather and date data through adaptive ensemble clustering, apply the historical load data to the unsupervised learning algorithm OPTICS to obtain the clustering labels of the training data; use the clustering labels for classification through supervised learning KNN, and classify and predict the future date types.
[0098] Specifically, step 2 includes the following steps:
[0099] Step 2.1: For non-prediction day data, that is, historical load data X 1, select the historical load time series, apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series, identify the clustering structure by detecting the density changes in the data points, without a predefined number of clusters, and obtain clustering data sets of different categories Cluster Type A,..., ClusterType N.
[0100] Step 2.2: For prediction day data, that is, target data X 2, apply the KNN algorithm to perform supervised learning on the target day, use the weather and date feature columns as the model input, obtain the label type to which the target day belongs, and complete the classification of the prediction day.
[0101] Step 3: After clustering, use the edRVFL model to predict two different clusters of the target day and adjacent days, and generate corresponding predicted values and .
[0102] In step 3, according to the clustering data sets obtained by adaptive integrated clustering in step 2, the edRVFL model based on the Bayesian optimization algorithm is used to predict two different clustering data sets of the target day and adjacent days, and the corresponding predicted values are generated respectively. and ; among them, the Bayesian optimization algorithm consists of five elements: a surrogate function, a hyperparameter search space, an acquisition function, an objective function, and an evaluation history; the objective function uses the tree-based Parzen window estimation algorithm to model the surrogate function, and uses the expected improvement as the acquisition function, as shown in formula (3-1):
[0103] (3-1)
[0104] where f is the objective function, is the threshold of the objective function for the given hyperparameter v .
[0105] Specifically, step 3 includes the following steps:
[0106] Step 3.1, Input parameter initialization: objective function f , TPE method , hyperparameter space , acquisition function verification , initialized memory ; Output parameter initialization: memory , the best hyperparameter in v * .
[0107] Step 3.2, For each iteration from 1 to N l , use the TPE method to fit the memory , and calculate the probability distribution of the objective function under the given hyperparameters .
[0108] Step 3.3, By maximizing the acquisition function , find the next hyperparameter v i+1 , used to find a new combination of hyperparameters from the hyperparameter space.
[0109] Step 3.4, Evaluate the objective function , calculate the objective function value corresponding to the new hyperparameter v i+1 .
[0110] Step 3.5, Estimate the objective function with the new combination of hyperparameters and its corresponding objective function value and add them to the memory , namely .
[0111] Step 3.6: Repeat the above steps 3.2 to 3.5 until all N iterations are completed, and finally output the best hyperparameters found in the memory v * .
[0112] Step 3.7: After completing the hyperparameter optimization iteration process, build the edRVFL model, initialize the neural network parameters of the input layer, hidden layer and output layer, and pre-load the optimal parameter model; make predictions on the dataset where the target day is located and the dataset where the adjacent day is located respectively, and generate the corresponding predicted values and .
[0113] Step 4: Based on the obtained predicted values and , the label to which the target day belongs, and the actual load value at the corresponding t moment , construct the dynamic weighted strategies e1 and e2 based on the relative error.
[0114] Specifically, the said Step 4 includes the following steps:
[0115] Step 4.1: Optimize the weights based on the relative error marked as e according to the actual value and the predicted value, as shown in formula (4-1):
[0116] (4-1)
[0117] where and are the weights of the clusters to which the target day and the adjacent day belong respectively.
[0118] Step 4.2: Considering different electricity consumption scenarios, construct the dynamic weighted strategy based on the relative error e j , where represents two different situations based on the clustered data.
[0119] Step 4.3: For the target day being a working day, the error e 1 is the average relative error from all past load data, and the corresponding formulas are as shown in (4-2), (4-3):
[0120] (4-2)
[0121] (4-3)
[0122] where the length of the weighted window isk , , the input data length is w , r represents the intermediate value of the weighted window change.
[0123] Step 4.4. For the target day being a non-working day, the error e 2 is calculated from the relative error of the load data in the previous time step, and the corresponding formulas are shown in (4-4) and (4-5) as follows:
[0124] (4-4)
[0125] (4-5).
[0126] Step 5. Optimize the clustering weight parameters using the improved PSO algorithm.
[0127] In the said Step 5, according to the dynamic weighting strategy based on relative error e j , , use the improved PSO algorithm to and for optimization, including the following steps:
[0128] Step 5.1. Initialize the required parameters, including the particle swarm size , the maximum number of iterations U and the learning factor σ ; for each particle i , initialize the position and velocity of the particle, and the corresponding formulas are shown in (5-1) and (5-2) as follows:
[0129] (5-1)
[0130] (5-2)
[0131] Step 5.2. For M constraints, particles and U iterations, the unconstrained optimization function F ( x ) of the particle is shown in (5-3) as follows:
[0132] (5-3)
[0133] where τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P (x ) means including M The total penalty for each constraint;
[0134] Calculate each particle i The fitness function , calculate the specific value of the position and And get fitness ; Evaluate particles i The current fitness of and sets its individual optimal position p i and the corresponding fitness F ( p i );
[0135] Step 5.3: Record the global optimal position p g and its corresponding fitness value F ( p g );
[0136] Step 5.4: Perform loop iterations from 1 loop iteration to the maximum number of iterations U ; Update the velocity of each particle i and location ;
[0137] Step 5.5: For each particle i , calculate the updated and And calculate the new fitness ; If the fitness of the new position Better than the current individual optimal F ( p i ), then the individual optimal position of the new particle ;
[0138] Step 5.6: Check the individual optimal fitness of the current particle F ( p i ) is better than the global optimal F ( p g ), if yes, then update the global optimal position ;
[0139] Step 5.7: Repeat steps 5.2 to 5.6 until the maximum number of iterations is reached. U , and finally output the global optimal position and fitness value;
[0140] Step 5.8: Dynamic weighting strategy based on relative error ej , , complete the dynamic weighting process of load forecasting; use the improved PSO algorithm to optimize the objective function by different updated weights. The dynamic weighting objectives of load forecasting are shown in Formulas (5-4) and (5-5):
[0141] (5-4)
[0142] (5-5)
[0143] Substitute the objective function into Step 5.7 to output the optimized weights and .
[0144] Step 6: Combine the optimized weight parameters to perform dynamic weighting on the building load and output the final load forecasting value.
[0145] In the said Step 6, combine the optimized weights and , and use the edRVFL model optimized by hyperparameters to predict different clustering datasets to obtain and ; finally, according to the weighting formula (6-1), perform dynamic weighting on the building load and output the final load forecasting value;
[0146] (6-1).
[0147] The following elaborates on the method of the present invention in detail in combination with the building data example. The short-term load forecasting process of the building is as Figure 1 shown, mainly covering the following steps:
[0148] Step 1: Determine the historical load, weather, date, etc. collected by the cloud service data acquisition system as sample features, complement the missing values by Lagrange interpolation method, and select and eliminate the outliers.
[0149] Step 1.1 Select the building data for four months from June to September 2023, including feature columns such as historical load, meteorological factors, and date (sampled at a frequency of every 15 minutes), and perform data preprocessing on all data. Complement the missing values and select and eliminate the outliers in turn by methods such as discarding, complementing, and truth value conversion. Part of the preprocessed building data (5 entries) is shown in Table 1.
[0150] Table 1 Part of the preprocessed building data
[0151]
[0152] Step 1.2 uses One-Hot encoding to process discrete features, so that the values of different discrete features can correspond to a certain point in the Euclidean space. For meteorological factors, consider features such as weather conditions (e.g., sunny is weather 0, cloudy is weather 1, light rain is weather 2, moderate rain is weather 3, heavy rain is weather 4), maximum temperature, minimum temperature, relative humidity, wind direction (e.g., northeast wind is 1, southeast wind is 2, northwest wind is 3, southwest wind is 4, due north wind is 5, due south wind is 6, due west wind is 7, due east wind is 8), etc.; for holiday factors, decompose and extract features such as "week number" (e.g., Monday is 1,..., Sunday is 7), "whether it is a weekend" (e.g., weekday is 0, holiday is 1), etc., and convert them into recognizable digital signals. The input features of this adaptive integrated clustering model prediction model are shown in Table 2.
[0153] Table 2 Input Features of the Adaptive Integrated Clustering Model
[0154]
[0155] Step 2: Use the adaptive integrated clustering algorithm to combine historical load with meteorological and date type data, that is, the historical load data is applied to the unsupervised learning algorithm OPTICS to obtain the clustering labels of the training data. Then, through the supervised learning KNN, these labels are used for classification, and the future date types are accurately classified and predicted.
[0156] Step 2.1 For non-prediction day (historical) data X1, select the historical load time series, apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series, identify the clustering structure by detecting the density change in the data points, without a predetermined number of clusters, and obtain the load dataset labels of different categories, Cluster Type A, Cluster Type B, Cluster Type C. In addition, the specific demonstration of the OPTICS algorithm for identifying the clustering structure by detecting the density change in the data points is as Figure 3 shown.
[0157] Step 2.2 For prediction day (target) data X2, apply the KNN algorithm to perform supervised learning on the target day, use feature columns such as weather and date as the model input, obtain the label type to which the target day belongs, and complete the classification of the prediction day. The flow chart of the KNN algorithm and the corresponding adaptive integrated clustering classification results are as Figure 4 、 5 shown.
[0158] Step 3: According to the clustering datasets obtained by the adaptive integrated clustering in Step 2, use the edRVFL model based on the Bayesian optimization algorithm to predict the two different clustering datasets of the target day and the adjacent day, and generate the corresponding predicted values respectively and Among them, the Bayesian optimization algorithm consists of five elements: a surrogate function, a hyperparameter search space, an acquisition function, an objective function, and an evaluation history. In the research, the objective function is defined as the prediction performance on the validation set. The popular Tree-based Parzen Window Estimation (TPE) algorithm is used to model the surrogate function, and the expected improvement is used as the acquisition function.
[0159] Step 3.1. Input parameter initialization: objective function f , TPE method , hyperparameter space , acquisition function verification , initialized memory ; Output parameter initialization: memory , the best hyperparameters in v * .
[0160] Step 3.2. For each iteration from 1 to N l , use the TPE method to fit the memory , and calculate the probability distribution of the objective function for the given hyperparameters .
[0161] Step 3.3. By maximizing the acquisition function , find the next hyperparameter v i+1 , to find a new combination of hyperparameters from the hyperparameter space.
[0162] Step 3.4. Evaluate the objective function , calculate the objective function value corresponding to the new hyperparameter v i+1 .
[0163] Step 3.5. Add the new combination of hyperparameters and its corresponding objective function value estimated objective function to the memory , that is .
[0164] Step 3.6. Repeat the above steps 3.2 to 3.5 until all N iterations are completed, and finally output the best hyperparameters found in the memory v * .
[0165] Step 3.7: After completing the hyperparameter optimization iteration process, build the edRVFL model, initialize the neural network parameters of the input layer, hidden layer, and output layer, and pre-load the optimal parameter model; perform predictions on the dataset where the target day is located and the dataset where the adjacent day is located respectively, and generate the corresponding predicted values and 。
[0166] Table 3 edRVFL Hyperparameter Search Space
[0167]
[0168] Step 4: According to the obtained predicted values and , the label to which the target day belongs, and the actual load value at the corresponding t moment , construct the dynamic weighting strategies e1 and e2 based on the relative error
[0169] Step 4.1: For the target day being a working day, the error e 1 is the average relative error from all past load data. Utilize the strong consistency observed in building loads, that is
[0170]
[0171]
[0172] Step 4.4: For the target day being a non-working day, the error e 2 is calculated from the relative error of the load data at the previous time step, ensuring a high prediction accuracy, that is
[0173]
[0174]
[0175] Step 5: According to the dynamic weighting strategy of the relative error in Step 4 e j , , use the improved PSO algorithm to optimize and .
[0176] Step 5.1: Initialize the required parameters, including the particle swarm size , the maximum number of iterations U and the learning factor σ ; for each particle i , initialize the position and velocity of the particle, and the corresponding formulas are shown as follows;
[0177]
[0178]
[0179] Step 5.2. For M constraints, particles, and U iterations, the unconstrained optimization function of the particles F ( x ) is as follows:
[0180]
[0181] Where τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) represents the total penalty including M constraints;
[0182] Calculate the fitness function i of each particle , calculate the specific values of the positions and and obtain the fitness ; Evaluate the current fitness of the particle i and set its individual best position p i and the corresponding fitness F ( p i );
[0183] Step 5.3. Record the global best position p g and its corresponding fitness value F ( p g );
[0184] Step 5.4. Perform loop iterations, looping from 1 to the maximum number of iterations U ; Update the velocity and position of each particle i;
[0185] Step 5.5. For each particle i , calculate the updated and and calculate the new fitness ; If the fitness of the new position is better than the current individual best F ( p i ), then the individual best position of the new particle ;
[0186] Step 5.6, check the individual optimal fitness of the current particle F ( p i ) whether it is better than the global optimum F ( p g ), if so, update the global optimal position ;
[0187] Step 5.7, repeat Step 5.2 to Step 5.6 until the maximum number of iterations is reached U , and finally output the global optimal position and fitness value;
[0188] Step 5.8, according to the dynamic weighting strategy based on relative error e j , , complete the dynamic weighting process of load forecasting; use the improved PSO algorithm to optimize the objective function through different updated weights, and the dynamic weighting objective of load forecasting is as follows:
[0189]
[0190]
[0191] Substitute the objective function into Step 5.7 to output the optimized weights and .
[0192] Step 6, combine the optimized weights and , use the edRVFL model optimized by hyperparameters to predict different clustering datasets to obtain and ; finally, according to the weighting formula , perform dynamic weighting on the building load and output the final load forecasting value.
[0193] We select the optimal edRVFL hyperparameter configuration as follows: the number of hidden nodes is 200, the number of layers is 10, the number of enhancement nodes is 160, the regularization parameter is 0.5, the input scale change is 1, the neuron forgetting ratio is 0.05, and the activation function is sigmoid function. The parameter configuration of the improved PSO algorithm: the number of particles , the number of iterations , the inertia factor , the learning factor , and are random numbers in. The length of the input historical load data is 96, that is (One day), predict the next moment's load point in the future.
[0194] After completing the parameter configuration, in order to verify our prediction method, it is necessary to construct different clustering datasets to test the corresponding prediction results. Five types of datasets are outlined as follows:
[0195] Type 1: A set of continuous load datasets containing the target day;
[0196] Type 2: A set of load datasets with a one-week interval containing the target day;
[0197] Type 3: An adaptive clustering load dataset based on K-Means (a distance-based partitioning clustering algorithm) and KNN;
[0198] Type 4: An adaptive clustering load dataset based on OPTICS (a density-based hierarchical clustering algorithm) and KNN;
[0199] Type 5: The method proposed in this study, a dynamic weighted prediction method based on Type 4.
[0200] Among them, Table 4 gives the error evaluation indicators for the short-term load prediction of buildings under various clustering methods.
[0201] Table 4 Prediction Results of Various Clustering Methods
[0202]
[0203] Through the result analysis, compared with other clustering methods, the short-term load prediction method for buildings proposed by the present invention can more accurately predict the accuracy requirements for short-term load prediction of buildings under the background of power market reform and smart grid construction.
[0204] Compared with the two patents of "Short-term Building Load Prediction Method" and "Electronic Device, Building Daily Power Load Prediction Method Based on Clustering Algorithm and Storage Medium", the present invention aims to provide a short-term building load prediction method. First, data collection is carried out, mainly including historical load, meteorological conditions (such as weather conditions), and date types and other data. These data need to be downsampled, preprocessed, and time-aligned by cloud services to ensure the integrity and consistency of the data, laying a foundation for the subsequent prediction model. Secondly, an adaptive integrated clustering method is adopted to combine historical load data with meteorological and date type data. Specifically, the historical load data is first applied to the unsupervised learning algorithm OPTICS to identify the clustering structure and obtain clustering labels. Then, the supervised learning algorithm KNN is used to classify these labels, and the future date types are accurately predicted based on the labels. After clustering, the edRVFL model is used to predict different clusters, and corresponding predicted values are generated respectively. Next, the weight parameters of the clusters are optimized by an improved PSO algorithm, where, represents the cluster weight matching the predicted load pattern, represents the weight of the previous day's cluster. This optimization process aims to further improve the accuracy and robustness of the prediction. Finally, based on the optimized weights, dynamic weighting processing is performed on the building load, and the short-term load prediction result of the building is finally output. This method can not only effectively capture the dynamic change characteristics of the load, but also improve the prediction accuracy and reliability, providing intelligent and accurate technical support for building energy consumption management.
[0205] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented 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.
[0206] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing the process in Figure 1 one process or multiple processes and / or blocks Figure 1means for the functions specified in one or more boxes.
[0207] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.
[0208] These computer program instructions may also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 or more boxes.
[0209] As mentioned above, it is only the preferred embodiment of the present invention, and it is not a limitation of the present invention in other forms. Any person skilled in the art may use the disclosed technical content to make changes or modifications into equivalent embodiments with equivalent changes. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the technical solution content of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims
1. A method for forecasting short-term load of a building, characterized in that: The following steps are involved: Step 1: Collect historical load data for load forecasting, including historical load, weather and date data, and pre-process the collected historical load data; Step 2: Combine historical load data with weather and date data through adaptive ensemble clustering, apply historical load data to the unsupervised learning algorithm OPTICS to obtain cluster labels for training data; use the cluster labels for classification through supervised learning KNN, and perform classification prediction on the forecast day type; Step 3: After clustering is completed, the edRVFL model is used to predict the two different clusters of the target day and the neighboring day, and the corresponding prediction values are generated respectively. and Step 4: Based on the predicted value and The label of the target day and the actual load value y corresponding to time t i,1 (t), construct dynamic weighting strategies e1 and e2 based on relative error; Step 5: Use the improved PSO algorithm to optimize the clustering weight parameters; Step 6: Combine the optimized weight parameters to dynamically weight the building load and output the final load forecast value; The step 4 comprises the following steps: Step 4.1: According to the actual value and the predicted value, the weight is optimized based on the relative error marked as e, as shown in formula (4-1): Among them, w i,1 (t) and w i,2 (t) are the weights of the clusters to which the target day and neighboring day belong respectively; Step 4.2: Considering different electricity usage scenarios, construct a dynamic weighted strategy based on relative error j , where j∈{1,2}, represents two different situations based on clustering data; Step 4.3: When the target day is a working day, the error e1 comes from the average relative error of all past load data. The corresponding formulas are shown in (4-2) and (4-3): Wherein, the length of the weighted window is k, k∈P1,2,...,w-1}, the length of the input data is w, and r represents the intermediate value of the weighted window change; Step 4.4: If the target day is a non-working day, the error e2 is calculated by the relative error of the load data of the previous time step. The corresponding formulas are shown in (4-4) and (4-5):
2. A method for short-term building load forecasting according to claim 1, characterized in that: In step 1, the collected historical load data is preprocessed, including the following steps: Step 1.1: Use the Lagrange interpolation method to fill in the missing values in the historical load data. By constructing a polynomial function and interpolating the known load data, the missing load data can be estimated. Step 1.2: Use One-Hot encoding to process discrete features, correspond the values of different discrete features to points in Euclidean space, and then convert them into recognizable digital signals.
3. A method for short-term building load forecasting according to claim 2, characterized in that: The step 1.1 comprises the following steps: Step 1.1.1: Use n+1 discrete points Where (x i ,y i ) represents the i-th discrete point, and the Lagrange interpolation function is used to obtain the Lagrange interpolation polynomial L n (x), as shown in formulas (1-1) and (1-2): w n+1 (x)=(x-x0)(x-x1)…(xx n ) =(x i -x0)…(x i -x i-1 )(x i -x i+1 )…(x i -x n ) (1-2) In the formula, w n+1 (x) is the interpolation polynomial; Use the known load data to find the Lagrange interpolation polynomial, then substitute the node to be found into the Lagrange interpolation polynomial, estimate the missing data, and complete the filling of the vacant values of the load data; Step 1.1.2: Use box plots to identify outliers. Outliers are defined as values greater than Q. U +1.5IQR or less than Q L -1.5IQR value; Q U It is the upper quartile, indicating that 1 / 4 of all observations are larger than it. L is the lower quartile, indicating that 1 / 4 of all data are smaller than it; IQR is the interquartile range, which is Q U With Q L , which contains half of the observed values; Step 1.1.3: Convert the original data to the range of [0, 1] by linear function normalization method, as shown in formula (1-3): Among them, x is the original data, x min and x max are the minimum and maximum values of the original data, respectively, nor It is the normalized standard data.
4. A method for forecasting short-term load of a building according to claim 1, characterized in that: The step 2 comprises the following steps: Step 2.1, for the non-forecast day data, that is, the historical load data X1, select the historical load time series, apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series, and identify the clustering structure by detecting the density change in the data points without a predetermined number of clusters, and obtain different categories of cluster data sets ClusterTypeA, ..., Cluster TypeN; Step 2.2: For the predicted day data, i.e., the target data X2, the KNN algorithm is applied to perform supervised learning on the target day, and the weather and date feature columns are used as model inputs to obtain the label type of the target day to complete the classification of the predicted day.
5. A method for short-term building load forecasting according to claim 1, characterized in that: In step 3, according to the clustering data set obtained by adaptive ensemble clustering in step 2, the edRVFL model based on the Bayesian optimization algorithm is used to predict the two different clustering data sets of the target day and the neighboring day, and the corresponding prediction values are generated respectively. and The Bayesian optimization algorithm consists of five elements: agent function, hyperparameter search space, acquisition function, objective function and evaluation history; the objective function uses the tree-based Parzen window estimation algorithm to model the agent function and uses the expected improvement as the capture function, as shown in formula (3-1): Where f is the objective function, f * is the threshold of the objective function given the hyperparameter v, and P(f|v) represents the probability distribution of the objective function under the given hyperparameter.
6. A method for short-term building load forecasting according to claim 5, characterized in that: The step 3 comprises the following steps: Step 3.
1. Input parameter initialization: objective function f, TPE method Hyperparameter Space Collection function Initialized memory Output parameter initialization: memory The best hyperparameter v* within Step 3.2: For each iteration from 1 to N, use the TPE method Fitting Memory And calculate the probability distribution P(f|v) of the objective function under given hyperparameters; Step 3.3: By maximizing the acquisition function Find the next hyperparameter v i+1 , used to find a new hyperparameter combination from the hyperparameter space; Step 3.4: Evaluate the objective function f(v i+1 ), calculate the new hyperparameter v i+1 The corresponding objective function value; Step 3.5: Combine the new hyperparameter combination and its corresponding objective function evaluation result f(v i+1 )Add storage Right now Step 3.6: Repeat steps 3.2 to 3.5 above until all N iterations are completed and the memory is finally output. The best hyperparameter v* found in Step 3.7: After completing the hyperparameter optimization iteration process, build the edRVFL model, initialize the neural network parameters of the input layer, hidden layer, and output layer, and preload the optimal parameter model; perform predictions on the target day dataset and the neighboring day dataset, and generate corresponding prediction values. and 7. A method for short-term building load forecasting according to claim 1, characterized in that: In step 5, according to the dynamic weighting strategy based on relative error j , j∈{1,2}, using the improved PSO algorithm to i,1 (t) and w i,2 (t) Optimization is performed, including the following steps: Step 5.1, initialize the required parameters, including the particle swarm size Np, the maximum number of iterations U and the learning factor; for each particle i, initialize the particle position and speed The corresponding formulas are shown in (5-1) and (5-2); Step 5.2: For M c constraints, N p particles and U iterations, the unconstrained optimization function F(x) of the particle is shown in (5-3): F(x)=τ(x)+σP(x) (5-3) Among them, τ(x) represents the initial constraint fitness function, σ represents the penalty factor, and P(x) represents the number of nodes including M c The total penalty for each constraint; Calculate the fitness function of each particle i Calculate a specific value at a position and And get fitness Evaluate the current fitness of particle i and set its individual optimal position p i And the corresponding fitness F(p i ); Step 5.3: Record the global optimal position p g And its corresponding fitness value F(p g ); Step 5.4, perform loop iteration, from 1 loop iteration to the maximum number of iterations U; update the speed of each particle i and location Step 5.5: For each particle i, calculate the updated and And calculate the new fitness If the fitness of the new position Better than the current individual optimal F(p i ), then the individual optimal position of the new particle Step 5.6: Check the individual optimal fitness F(p i ) is better than the global optimal F(p g ), if yes, then update the global optimal position p g =p i ; Step 5.7, repeat steps 5.2 to 5.6 until the maximum number of iterations U is reached, and finally output the global optimal position and fitness value; Step 5.8: According to the dynamic weighting strategy based on relative error j , j∈{1,2}, the dynamic weighting process of load forecasting is completed; the improved PSO algorithm is used to optimize the objective function through different update weights. The dynamic weighted objectives of load forecasting are shown in formulas (5-4) and (5-5): Substitute the objective function into step 5.7 and output the optimized weight w i,1 (t) and w i,2 (t).
8. A method for short-term building load forecasting according to claim 1, characterized in that: In step 6, combined with the optimized weight w i,1 (t) and w i,2 (t), the edRvFL model after hyperparameter optimization is used to predict different clustering data sets to obtain and Finally, according to the weighting formula (6-1), the building load is dynamically weighted and the final load forecast value is output;
Citation Information
Patent Citations
Electronic device, method for forecasting daily load of buildings based on clustering algorithm, and storage medium
CN109409570A
Short-term building load prediction method
CN117526294A
Power distribution network short-term load prediction model establishment method based on BR-SOM clustering algorithm
CN116108975A
Transformer area distributed photovoltaic load probability prediction method and system based on clustering characteristics
CN116632842A