Building short-term load prediction method
Through the combination of adaptive integrated clustering and OPTICS/KNN algorithm, the weight is optimized using the edRVFL model and the PSO algorithm to construct a dynamic weighting strategy, which solves the shortcomings of load prediction accuracy and reliability in the existing technology, and realizes a more efficient building Short-term load forecast.
Patent Information
- Application Number
- CN202411859024.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Existing short-term load prediction methods for buildings are difficult to flexibly respond to dynamic and complex load changes in the face of increased renewable energy access and load volatility, fail to fully tap potential information in historical data, and lack the physical characteristics and environment of the building. The adaptability of the prediction is insufficient and the reliability of the prediction.
Adaptive integrated clustering combined with OPTICS and KNN algorithms are used to identify load patterns through unsupervised and supervised learning, use edRVFL model to predict, and optimize weight parameters through improved PSO algorithm to construct dynamic weighting strategies to improve prediction accuracy and robustness. .
It improves the accuracy and reliability of short-term load prediction of buildings, can better capture load changes characteristics, quickly process large amounts of data, adapt to complex load fluctuations, and provide more accurate load management support.
Smart Images

Figure CN119312115A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of building energy consumption prediction, and in particular to a method for predicting short-term load of a building. Background Art
[0002] Short-term load forecasting plays a key role in building energy consumption forecasting, but due to the dynamic characteristics of building load fluctuations, it is easy to overestimate the load, which seriously affects the accuracy of the forecast. The traditional short-term load forecasting neural network uses an improved clustering method to identify potential features in load data, providing a more accurate basis for weight adjustment in the dynamic weighting method. Therefore, the development of dynamic weighting methods based on clustering algorithms can effectively improve the accuracy of short-term load forecasting.
[0003] In the context of power market reform and smart grid construction, current short-term load forecasting for buildings faces many challenges. First, with the large-scale access of renewable energy and the increasing volatility of load, the uncertainty of load forecasting has increased significantly, and traditional forecasting methods are difficult to flexibly respond to dynamic and complex load changes. Secondly, although traditional methods rely on a large amount of historical data for training and forecasting, the potential information in these data is often not fully mined, resulting in the model's inability to capture the deep-level characteristics of load changes. At the same time, these methods fail to effectively integrate the physical characteristics of buildings and system operation constraints, which limits the accuracy of prediction. Finally, traditional forecasting methods lack adaptability to the building environment and its unique characteristics, which limits their application in building energy management. In summary, improving the accuracy and reliability of building load forecasting requires more intelligent forecasting models that can fully tap the potential of data, combine physical models, and adapt to the actual operating environment of buildings, providing decision makers with more supportive forecasting tools.
[0004] The Chinese patent application number CN202311481491.1 discloses a short-term building load forecasting method. The method first selects a building from the data set, extracts the load data of the building within a certain period of time as the original data, processes the original data for outliers and missing values, and obtains feature data; establishes a TCN-LSTM model based on the residual self-attention mechanism, trains the model using feature data, and obtains the predicted load value; optimizes the hyperparameters of the RSA-TCN-LSTM model using an improved sparrow search algorithm; and uses the optimized RSA-TCN-LSTM prediction model to predict the building load. This method uses long and short-term memory networks in a targeted manner, and does not take into account that the model has room for further optimization at the hyperparameter level. When considering the historical electricity load, multi-dimensional influencing factors such as meteorological factors and holidays are not fully considered, so that the relevant factors in load forecasting cannot be better captured. The Chinese patent application number CN201811101491.3 discloses a method and storage medium for predicting the daily electricity load of a building based on a clustering algorithm. The method provides a method for predicting the daily electricity load of a building based on a clustering algorithm, respectively obtaining the electricity load values of a predetermined building on each day within a predefined time period; clustering the power consumption values of each day in a predefined unit time according to a predetermined clustering algorithm to obtain a first electricity load cluster and a second electricity load cluster; if the electricity load of a building on a certain working day needs to be predicted, the electricity load value of the working day is predicted according to the cluster center of the first electricity load cluster; if the electricity load of a building on a non-working day needs to be predicted, the electricity load value of the non-working day is predicted according to the cluster center of the second electricity load cluster. This method processes the clustering information of working days and non-working days relatively independently, and fails to make full use of the correlation between the 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, it is urgent to introduce a more comprehensive load data analysis and forecasting strategy that can establish connections between load clusters on working days and non-working days. By making full use of the information in these two types of clustering data sets and deeply exploring the correlation between the two, it will help 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 method for short-term load forecasting of a building, which is beneficial to improving the accuracy, reliability, robustness and efficiency of short-term load forecasting of a building.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is: a method for short-term load forecasting of a building, comprising the following steps: 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 for future date types; 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 at time 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.
[0007] Furthermore, 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.
[0008] Furthermore, the step 1.1 includes the following steps: Step 1.1.1: Use n+1 discrete points ,in Represents the i-th discrete point, and the Lagrange interpolation polynomial is obtained through the Lagrange interpolation function L n ( x ), as shown in formulas (1-1) and (1-2): (1-1) (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.5 IQR or less than Q L -1.5 IQR The value of Q U + is the upper quartile, which means that 1 / 4 of all observations are larger than it. Q L It is the lower quartile, which means that 1 / 4 of all data are smaller than it; IQR is the interquartile range, Q U and 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): (1-3) in, x is the original data, x min and x max are the minimum and maximum values of the original data, x nor It is the normalized standard data.
[0009] Furthermore, the step 2 comprises the following steps: Step 2.1: For non-forecast day data, that is, historical load data X 1. Select the historical load time series and apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series. The cluster structure is identified by detecting the density changes in the data points without a predetermined number of clusters, and different types of cluster data sets Cluster Type A, ..., Cluster Type N are obtained; Step 2.2: For the forecast day data, 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 model input, obtain the label type of the target day, and complete the classification of the predicted day.
[0010] Furthermore, 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 ; Among them, 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): (3-1) in, f is the objective function, is a given hyperparameter v The threshold of the objective function.
[0011] Furthermore, the step 3 comprises the following steps: 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 within v * ; Step 3.2: For each iteration from 1 to N l , using the TPE method Fitting Memory , and calculate the probability distribution 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 , calculate the new hyperparameters v i+1 The corresponding objective function value; Step 3.5: Estimate the objective function using the new hyperparameter combination and its corresponding objective function value Add storage ,Right now ; Step 3.6: Repeat steps 3.2 to 3.5 until all NIterates and finally outputs the best hyperparameters found in the memory v * ; 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 .
[0012] Furthermore, step 4 includes the following steps: Step 4.1: Based on the actual value and the predicted value, e The relative error is used to optimize the weights, as shown in formula (4-1): (4-1) in, and 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 e j ,in , representing two different situations based on clustering data; Step 4.3: If the target day is a working day, the error e 1 is the average relative error from all past load data. The corresponding formulas are shown in (4-2) and (4-3): (4-2) (4-3) Among them, the length of the weighted window is k , , the input data length is w , r represents the median value of the weighted window change; Step 4.4: If the target day is a non-working day, the error e 2 is calculated based on the relative error of the load data in the previous time step. The corresponding formulas are shown in (4-4) and (4-5): (4-4) (4-5).
[0013] Furthermore, in step 5, according to the dynamic weighting strategy based on relative error e j , , using the improved PSO algorithm and The optimization process includes the following steps: Step 5.1: Initialize the required parameters, including the particle swarm size , maximum number of iterations U and learning factor σ ; For each particle i , initialize the particle position and speed , the corresponding formulas are shown in (5-1) and (5-2); (5-1) (5-2) Step 5.2: For M Constraints, Particles and U Iterations, unconstrained optimization function of particles F ( x )As shown in (5-3): (5-3) in, τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) means including M The total penalty for each constraint; 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 ); Step 5.3: Record the global optimal position p g and its corresponding fitness value F ( p g ); 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 ; 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 of the current particle F ( p i ) is better than the global optimal F ( p g ), if yes, then update the global optimal position ; 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; Step 5.8: 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 update weights, and the dynamic weighted objective of load forecasting is shown in formulas (5-4) and (5-5): (5-4) (5-5) Substitute the objective function into step 5.7 and output the optimized weights and .
[0014] Furthermore, in step 6, combined with the optimized weight and , the edRVFL model after hyperparameter optimization is used to predict different clustering data sets and obtain and ; Finally, according to the weighting formula (6-1), the building load is dynamically weighted and the final load forecast value is output; (6-1).
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1) This paper innovatively combines adaptive ensemble clustering with OPTICS and KNN to identify unknown load patterns, thereby improving the classification accuracy of building load electricity consumption. On this basis, by designing a dynamic weighting strategy, the effective information in the two clusters of working days and non-working days is deeply mined, and the association relationship is established to further improve the accuracy and reliability of load forecasting. Through this dynamic weighting strategy, not only can the changing characteristics under different load modes be better captured, but also the robustness of the prediction can be improved, providing more accurate support for load management.
[0016] 2) In the present invention, the edRVFL model significantly reduces the training time of the model by randomizing the weights and directly calculating the output layer weights. 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 prediction efficiency and meeting the needs of real-time prediction. The model shows good generalization ability through multi-layer random vector mapping when facing complex load fluctuations; in addition, the model can capture the complex nonlinear relationship in the load data, effectively respond to the dynamic changes of the load, and provide more accurate prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A schematic diagram of a method implementation of an embodiment of the present invention; Figure 2 This is a schematic diagram of the box plot outlier detection principle in an embodiment of the present invention; Figure 3 This is a flow chart of the OPTICS algorithm in an embodiment of the present invention; Figure 4 This is a flow chart of the KNN algorithm in an embodiment of the present invention; Figure 5 This is a diagram of the adaptive integrated clustering classification result in an embodiment of the present invention; Figure 6 This is a flow chart of the improved PSO algorithm in an embodiment of the present invention; DETAILED DESCRIPTION
[0018] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0019] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0020] 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 form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0021] like Figure 1 As shown, this embodiment provides a method for forecasting short-term load of a building, comprising the following steps: Step 1: Collect historical load data for load forecasting, including historical load, weather and date data, and pre-process the collected historical load data.
[0022] 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.
[0023] Step 1.1.1: Use n+1 discrete points ,in Represents the i-th discrete point, and the Lagrange interpolation polynomial is obtained through the Lagrange interpolation function L n ( x ), as shown in formulas (1-1) and (1-2): (1-1) (1-2) In the formula, w n+1 ( x ) is the interpolation polynomial.
[0024] The Lagrange interpolation polynomial is obtained using the known load data, and then the nodes to be calculated are substituted into the Lagrange interpolation polynomial to estimate the missing data and complete the filling of the missing values of the load data.
[0025] Step 1.1.2: Figure 2 As shown, the box plot is used to identify outliers, and outliers are defined as values greater than Q U +1.5 IQR or less than Q L -1.5 IQR The value of Q U+ is the upper quartile, which means that 1 / 4 of all observations are larger than it. Q L It is the lower quartile, which means that 1 / 4 of all data are smaller than it; IQR is the interquartile range, Q U and Q L , which contains half of the observed values.
[0026] 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): (1-3) in, x is the original data, x min and x max are the minimum and maximum values of the original data, x nor It is the normalized standard data.
[0027] 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.
[0028] 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 predictions for future date types.
[0029] Specifically, the step 2 includes the following steps: Step 2.1: For non-forecast day data, that is, historical load data X 1. Select the historical load time series and apply the OPTICS algorithm to perform unsupervised clustering on the historical load time series. The clustering structure is identified by detecting the density changes in the data points without a predetermined number of clusters, and different types of clustering data sets Cluster Type A, ..., Cluster Type N are obtained.
[0030] Step 2.2: For the forecast day data, 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 model input, obtain the label type of the target day, and complete the classification of the predicted day.
[0031] 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 .
[0032] 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 ; Among them, 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): (3-1) in, f is the objective function, is a given hyperparameter v The threshold of the objective function.
[0033] Specifically, step 3 includes the following steps: 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 within v * .
[0034] Step 3.2: For each iteration from 1 to N l , using the TPE method Fitting Memory , and calculate the probability distribution of the objective function under given hyperparameters .
[0035] Step 3.3: By maximizing the acquisition function , find the next hyperparameter v i+1 , which is used to find a new hyperparameter combination from the hyperparameter space.
[0036] Step 3.4: Evaluate the objective function , calculate the new hyperparameters v i+1 The corresponding objective function value.
[0037] Step 3.5: Estimate the objective function using the new hyperparameter combination and its corresponding objective function value Add storage ,Right now .
[0038] Step 3.6: Repeat steps 3.2 to 3.5 until all N Iterates and finally outputs the best hyperparameters 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 preload the optimal parameter model; perform predictions on the target day dataset and the neighboring day dataset, and generate corresponding prediction values. and .
[0040] Step 4: Based on the predicted value and , the label of the target day and the actual load value at time t , construct dynamic weighting strategies e1 and e2 based on relative error.
[0041] Specifically, step 4 includes the following steps: Step 4.1: Based on the actual value and the predicted value, e The relative error is used to optimize the weights, as shown in formula (4-1): (4-1) in, and are the weights of the clusters to which the target day and neighboring day belong, respectively.
[0042] Step 4.2: Considering different electricity usage scenarios, construct a dynamic weighted strategy based on relative error e j ,in , representing two different situations based on clustering data.
[0043] Step 4.3: If the target day is a working day, the error e 1 is the average relative error from all past load data. The corresponding formulas are shown in (4-2) and (4-3): (4-2) (4-3) Among them, the length of the weighted window is k , , the input data length is w , r Indicates the median value of the weighted window variation.
[0044] Step 4.4: If the target day is a non-working day, the error e 2 is calculated based on the relative error of the load data in the previous time step. The corresponding formulas are shown in (4-4) and (4-5): (4-4) (4-5).
[0045] Step 5: Use the improved PSO algorithm to optimize the clustering weight parameters.
[0046] In step 5, according to the dynamic weighting strategy based on relative error e j , , using the improved PSO algorithm and The optimization process includes the following steps: Step 5.1: Initialize the required parameters, including the particle swarm size , maximum number of iterations U and learning factor σ ; For each particle i , initialize the particle position and speed , the corresponding formulas are shown in (5-1) and (5-2); (5-1) (5-2) Step 5.2: For M Constraints, Particles and U Iterations, unconstrained optimization function of particles F ( x )As shown in (5-3): (5-3) in, τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) means including M The total penalty for each constraint; 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 ); Step 5.3: Record the global optimal position p g and its corresponding fitness value F ( p g ); 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 ; 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 of the current particle F ( p i ) is better than the global optimal F ( p g ), if yes, then update the global optimal position ; 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; Step 5.8: 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 update weights, and the dynamic weighted objective of load forecasting is shown in formulas (5-4) and (5-5): (5-4) (5-5) Substitute the objective function into step 5.7 and output the optimized weights and .
[0047] Step 6: Combine the optimized weight parameters to dynamically weight the building load and output the final load forecast value.
[0048] In step 6, combined with the optimized weight and , the edRVFL model after hyperparameter optimization is used to predict different clustering data sets and obtain and ; Finally, according to the weighting formula (6-1), the building load is dynamically weighted and the final load forecast value is output; (6-1).
[0049] The following is a detailed description of the method of the present invention with reference to a building data example. Figure 1 As shown, it mainly covers the following steps: Step 1: Determine the historical load, weather, date and other factors collected by the cloud service data collection system as sample characteristics, use the Lagrange interpolation method to fill in the missing values, and select and eliminate outliers.
[0050] 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 (adopted every 15 minutes), and preprocess all the data. Use methods such as discarding, completing, and true value conversion to fill in the missing values and select and eliminate the outliers. The preprocessed building data (including 5 entries) are shown in Table 1.
[0051] Table 1 Preprocessed data of some buildings Step 1.2 uses One-Hot encoding to process discrete features, and the values of different discrete features can correspond to a certain point in the Euclidean space. For meteorological factors, consider weather conditions (for example, sunny is weather 0, cloudy is weather 1, light rain is weather 2, moderate rain is weather 3, and heavy rain is weather 4), maximum temperature, minimum temperature, relative humidity, wind force and direction (for example, northeast wind is 1, southeast is divided into 2, northwest wind is 3, southwest wind is 4, north wind is 5, south wind is 6, west wind is 7, east wind is 8) and other features; for holiday factors, decompose and extract "week number" (for example, Monday is 1,..., Sunday is 7), "whether it is a weekend" (for example, weekday is 0, holiday is 1) and other features, and convert them into recognizable digital signals. The input features of the adaptive ensemble clustering model prediction model are shown in Table 2.
[0052] Table 2 Input features of the adaptive ensemble clustering model Step 2: The historical load is combined with the meteorological and date type data using an adaptive ensemble clustering algorithm, that is, the historical load data is applied to the unsupervised learning algorithm OPTICS to obtain cluster labels for the training data. Then, these labels are used for classification through supervised learning KNN, and accurate classification predictions of future date types are made.
[0053] Step 2.1 For the non-forecast day (historical) 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 cluster structure by detecting the density changes in the data points without a predetermined number of clusters, and obtain the load data set labels of different categories Cluster Type A, Cluster Type B, and Cluster Type C. In addition, the OPTICS algorithm for identifying the cluster structure by detecting the density changes in the data points is specifically demonstrated as follows Figure 3 shown.
[0054] Step 2.2: For the forecast day (target) data X2, the KNN algorithm is used to conduct supervised learning on the target day. The feature columns such as weather and date are used as model input to obtain the label type of the target day to complete the classification of the forecast day. The KNN algorithm flow chart and the corresponding adaptive ensemble clustering classification results are shown in Figure 2. Figure 4 , 5 shown.
[0055] Step 3: Based on 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 Among them, the Bayesian optimization algorithm consists of five elements: surrogate function, hyperparameter search space, acquisition function, objective function and evaluation history. In the study, the objective function is defined as the prediction performance on the validation set, and the popular Tree-based Parzen Window Estimation (TPE) algorithm is used to model the surrogate function, and the expected improvement is used as the capture function.
[0056] 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 within v * .
[0057] Step 3.2: For each iteration from 1 to N l , using the TPE method Fitting Memory , and calculate the probability distribution of the objective function under given hyperparameters .
[0058] Step 3.3: By maximizing the acquisition function , find the next hyperparameter v i+1 , which is used to find a new hyperparameter combination from the hyperparameter space.
[0059] Step 3.4: Evaluate the objective function , calculate the new hyperparameters v i+1 The corresponding objective function value.
[0060] Step 3.5: Estimate the objective function using the new hyperparameter combination and its corresponding objective function value Add storage ,Right now .
[0061] Step 3.6: Repeat steps 3.2 to 3.5 until all N Iterates and finally outputs the best hyperparameters found in the memory v * .
[0062] 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 .
[0063] Table 3 edRVFL hyperparameter optimization space Step 4: Based on the predicted value and , the label of the target day and the actual load value at time t , construct dynamic weighting strategies e1 and e2 based on relative error.
[0064] Step 4.1: For the target day as a working day, the errore 1 is the average relative error from all past load data, using the strong consistency observed in building loads, i.e. Step 4.4: If the target day is a non-working day, the error e 2 is calculated by the relative error of the load data of the previous time step, which ensures a high prediction accuracy, that is, Step 5: Dynamic weighting strategy based on relative error in step 4 e j , , using the improved PSO algorithm and Conduct optimization.
[0065] Step 5.1: Initialize the required parameters, including the particle swarm size , maximum number of iterations U and learning factor σ ; For each particle i , initialize the particle position and speed , the corresponding formula is as follows; Step 5.2: For M Constraints, Particles and U Iterations, unconstrained optimization function of particles F ( x ) is as follows: in, τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) means including M The total penalty for each constraint; 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 iand 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 iterations from 1 loop iteration to the maximum number of iterations U ; Update the velocity 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 of the current particle F ( p i ) is better than the global optimal F ( p g ), if yes, then update the global optimal position ; 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; Step 5.8: 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 update weights, and the dynamic weighted objective of load forecasting is as follows: Substitute the objective function into step 5.7 and output the optimized weights and .
[0066] Step 6: Combine the optimized weights and , the edRVFL model after hyperparameter optimization is used to predict different clustering data sets and obtain and ; Finally, according to the weighted formula , dynamically weight the building load and output the final load forecast value.
[0067] We choose the optimal edRVFL hyperparameter configuration as follows: 200 hidden nodes, 10 layers, 160 enhancement nodes, 0.5 regularization parameter, 1 input scale change, 0.05 neuron forgetting ratio, and activation function. sigmoid Function. Improve the PSO algorithm related parameter configuration: number of particles , number of iterations , inertia factor , learning factor , and for The length of the input historical load data is 96, that is, (One day), predict the load point at the next moment in the future.
[0068] After completing the parameter configuration, in order to verify our prediction method, it is necessary to construct different clustering data sets to test the corresponding prediction results. The five data set types are outlined as follows: Type 1: A set of continuous load data sets containing the target day; Type 2: A set of one-week interval load data sets containing the target day; Type 3: Adaptive clustering load dataset based on K-Means (a distance-based partitioning clustering algorithm) and KNN; Type 4: Adaptive clustering load dataset based on OPTICS (a density-based hierarchical clustering algorithm) and KNN; Type 5: The method proposed by this study is based on the dynamic weighted prediction method of Type 4.
[0069] Among them, Table 4 gives the error evaluation indicators of short-term building load forecasting under various clustering methods.
[0070] Table 4 Prediction results of various clustering methods Through the analysis of the results, it is found that the building short-term load forecasting method proposed in the present invention can more accurately predict the accuracy requirements of building short-term load forecasting under the background of power market reform and smart grid construction compared with other clustering methods.
[0071] Compared with the two patents of "Short-term building load forecasting method" and "Electronic device, building daily electricity load forecasting method based on clustering algorithm and storage medium", the present invention aims to provide a short-term load forecasting method for buildings. First, data collection is carried out, mainly including historical load, meteorological conditions (such as weather conditions) and date type data. These data need to be downsampled, preprocessed and time-aligned by cloud services to ensure the integrity and consistency of the data, laying the foundation for subsequent prediction models. Secondly, an adaptive integrated clustering method is used 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 cluster labels. Then, these labels are classified in combination with the supervised learning algorithm KNN, and the future date types are accurately predicted based on the labels. After clustering is completed, the edRVFL model is used to predict different clusters and generate corresponding prediction values respectively. Then, the weight parameters of the clustering are optimized by the improved PSO algorithm, in which, represents the cluster weight that matches the forecasted load pattern, represents the weight of the clustering on the previous day. The optimization process aims to further improve the accuracy and robustness of the prediction. Finally, based on the optimized weights, the building load is dynamically weighted, 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 accuracy and reliability of the prediction, providing intelligent and accurate technical support for building energy consumption management.
[0072] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt 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 codes.
[0073] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0076] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to 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 for future date types; 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 at time 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.
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 forecasting short-term load of a building according to claim 2, characterized in that: The step 1.1 comprises the following steps: Step 1.1.1: Use n+1 discrete points ,in Represents the i-th discrete point, and the Lagrange interpolation polynomial is obtained through the Lagrange interpolation function L n ( x ), as shown in formulas (1-1) and (1-2): (1-1) (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.5 IQR or less than Q L -1.5 IQR The value of Q U + is the upper quartile, which means that 1 / 4 of all observations are larger than it. Q L It is the lower quartile, which means that 1 / 4 of all data are smaller than it; IQR is the interquartile range, Q U and 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): (1-3) in, x is the original data, x min and x max are the minimum and maximum values of the original data, x 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 non-forecast 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 cluster structure by detecting the density change in the data points, without a predetermined number of clusters, and obtain different types of cluster data sets Cluster Type A, ..., Cluster Type N; Step 2.2: For the forecast day data, 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 model input, obtain the label type of the target day, and 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 ; Among them, 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): (3-1) in, f is the objective function, is a given hyperparameter v The threshold of the objective function.
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 , acquisition function verification , initialized memory ; Output parameter initialization: memory , the best hyperparameters within v * ; Step 3.2: For each iteration from 1 to N l , using the TPE method Fitting Memory , and calculate the probability distribution 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 , calculate the new hyperparameters v i+1 The corresponding objective function value; Step 3.5: Estimate the objective function using the new hyperparameter combination and its corresponding objective function value Add storage ,Right now ; Step 3.6: Repeat steps 3.2 to 3.5 until all N Iterates and finally outputs the best hyperparameters found in the memory v * ; 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: The step 4 comprises the following steps: Step 4.1: Based on the actual value and the predicted value, e The relative error is used to optimize the weights, as shown in formula (4-1): (4-1) in, and 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 e j ,in , representing two different situations based on clustering data; Step 4.3: If the target day is a working day, the error e 1 is the average relative error from all past load data. The corresponding formulas are shown in (4-2) and (4-3): (4-2) (4-3) Among them, the length of the weighted window is k , , the input data length is w , r represents the median value of the weighted window change; Step 4.4: If the target day is a non-working day, the error e 2 is calculated based on the relative error of the load data in the previous time step. The corresponding formulas are shown in (4-4) and (4-5): (4-4) (4-5)。 8. A method for forecasting short-term load of a building according to claim 1, characterized in that: In step 5, according to the dynamic weighting strategy based on relative error e j , , using the improved PSO algorithm and The optimization process includes the following steps: Step 5.1: Initialize the required parameters, including the particle swarm size , maximum number of iterations U and learning factor σ ; For each particle i , initialize the particle position and speed , the corresponding formulas are shown in (5-1) and (5-2); (5-1) (5-2) Step 5.2: For M Constraints, Particles and U Iterations, unconstrained optimization function of particles F ( x )As shown in (5-3): (5-3) in, τ ( x ) represents the initial constraint fitness function, σ represents the penalty factor, P ( x ) means including M The total penalty for each constraint; 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 ); Step 5.3: Record the global optimal position p g and its corresponding fitness value F ( p g ); 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 ; 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 of the current particle F ( p i ) is better than the global optimal F ( p g ), if yes, then update the global optimal position ; 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; Step 5.8: 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 update weights, and the dynamic weighted objective of load forecasting is shown in formulas (5-4) and (5-5): (5-4) (5-5) Substitute the objective function into step 5.7 and output the optimized weights and .
9. A method for short-term building load forecasting according to claim 8, characterized in that: In step 6, combined with the optimized weight and , the edRVFL model after hyperparameter optimization is used to predict different clustering data sets and obtain and ; Finally, according to the weighting formula (6-1), the building load is dynamically weighted and the final load forecast value is output; (6-1)。
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
Multi-dimensional short-term power load prediction method based on improved K-means clustering CCA-BiLSTM
CN114358185A
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