Building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion
By employing CEEMDAN decomposition, sample entropy quantification, and hierarchical clustering adaptive grouping, combined with a heterogeneous model optimized by genetic algorithm, the nonlinearity and high volatility issues in building energy consumption prediction are resolved, achieving high-precision and high-generalization prediction results.
Patent Information
- Application Number
- CN202611635994.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-22
- Publication Date
- 2026-11-20
AI Technical Summary
Existing technologies struggle to effectively handle the nonlinearity and high volatility of building energy consumption, leading to mixed training objectives, reduced generalization ability, and a lack of adaptive complexity grouping mechanisms in traditional models.
We employ CEEMDAN decomposition, sample entropy quantification, hierarchical clustering adaptive grouping, and genetic algorithm independent optimization to adaptively match the most suitable model structure and construct a heterogeneous model for building energy consumption prediction.
It improves the accuracy and generalization ability of building energy consumption prediction, reduces mutual interference between different frequency characteristics, and achieves full-process optimization.
Smart Images

Figure CN123138808A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of building energy consumption prediction, and in particular to a building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion. Background Technology
[0002] Building energy consumption forecasting is a crucial foundation for building energy management systems, demand response, equipment start-up and shutdown control, air conditioning load optimization, peak-valley electricity pricing, and carbon emission accounting. Accurate short-term energy consumption forecasting enables energy management systems to identify peak energy demand in advance and rationally plan the operation strategies of energy storage, heating and cooling sources, air conditioning units, and lighting systems, thereby reducing energy waste and lowering operating costs.
[0003] However, building energy consumption is not a simple stationary sequence. For office buildings, occupancy during weekdays and weekends, air conditioning system start-up and shutdown strategies, changes in outdoor temperature and humidity, solar radiation, and equipment operating status all contribute to the energy consumption curve. For commercial buildings, operating hours, cold chain equipment, and lighting equipment cause energy consumption to exhibit nonlinearity and sudden fluctuations. For public buildings, seasonal trends, intraday cycles, weekly cycles, and holiday effects are coupled together, resulting in the original energy consumption sequence simultaneously containing high-frequency noise, mid-frequency cycles, and low-frequency trends.
[0004] Traditional linear models such as ARIMA, exponential smoothing, or multiple linear regression offer good interpretability when data is nearly stationary and has few influencing factors. However, their ability to represent nonlinear, highly volatile energy consumption sequences is limited, often requiring manual feature engineering and lacking explicit modeling capabilities for time-dependent structures. Directly modeling the original building energy consumption sequence requires fitting noise, periodicity, and trend simultaneously, easily leading to mixed training objectives and decreased generalization ability. Signal decomposition techniques, such as Empirical Mode Decomposition (EMD), Ensemble Empirical Mode Decomposition (EEMD), Variational Mode Decomposition (VMD), or Adaptive Noise-Complete Ensemble Empirical Mode Decomposition (CEEMDAN), can decompose complex energy consumption sequences into several components (IMFs) at different time scales. However, these techniques often simply input all components into the same model after decomposition, or rely on empirical rules to treat the first few IMFs as high-frequency and the later ones as low-frequency, lacking a repeatable, interpretable, and adaptive complexity grouping mechanism.
[0005] Therefore, adopting differentiated prediction models for different frequency band components is the key to improving prediction accuracy and engineering efficiency. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, this invention provides a building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion. The method adaptively matches the most suitable model structure according to the complexity of the energy consumption components, effectively reducing the mutual interference between different frequency features and realizing the optimization of the entire building energy consumption prediction process.
[0007] This invention provides a building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion, including a training phase and a prediction phase: The training phase includes the following steps: Step S1: Obtain historical energy consumption data of the target building and preprocess it, dividing it into training set and test set in chronological order; Step S2: Decompose the energy consumption sequence contained in the training set to obtain several intrinsic mode components and one residual component; calculate the sample entropy of each component to form a complexity vector. Step S3: Using the sample entropy of each component as the clustering feature, hierarchical clustering is used to adaptively group each component into high-frequency, mid-frequency, and low-frequency sets; the frequency band labels and cluster centers of each component are recorded to construct the model registry. Step S4: Construct a temporal convolutional network model for the high-frequency set, a long short-term memory network model for the mid-frequency set, and an artificial neural network model for the low-frequency set. Use a genetic algorithm to independently optimize the hyperparameters of each model and save the optimal model after training. The prediction phase includes the following steps: Step S5: Perform the same decomposition as in the training phase on the historical window data before the prediction time and calculate the entropy of each component sample; determine the frequency band label based on the distance between the entropy of each component sample and the cluster center in the model registry; call the corresponding frequency band model saved in the training phase to make a prediction, accumulate the prediction results of each component, and output the predicted building energy consumption value.
[0008] As a further technical solution, step S2, the process of decomposing the energy consumption sequence contained in the training set includes: Pre-set decomposition parameters, including the total number of noise additions and the noise amplitude coefficient; Adaptive white noise is added to the original energy consumption sequence one by one to generate multiple sets of noisy sequences; Decompose all the noisy sequences and take the mean to obtain the first-order intrinsic mode components, and calculate the first-order residuals; The higher-order intrinsic mode components are generated iteratively, and the corresponding order residuals are updated synchronously. Decomposition stops when the total number of residual extreme points is less than a preset threshold or when the preset maximum number of modes is reached. The intrinsic mode components and the final residual components of each order are obtained.
[0009] As a further technical solution, the specific methods for dividing the high-frequency set, mid-frequency set, and low-frequency set in step S3 include: Using the absolute value of the difference between the entropies of any two sample components as the distance, hierarchical clustering is used to construct a clustering tree; The number of clusters is determined by the silhouette coefficient. The number of clusters that maximizes the average silhouette coefficient is taken as the final number of clusters, and the number of clusters is greater than or equal to the preset number of clusters. Calculate the sample entropy for each cluster and take the mean. Define the cluster with the highest mean as the high-frequency set, the cluster with the lowest mean as the low-frequency set, and merge the remaining clusters to define the mid-frequency set.
[0010] As a further technical solution, methods for calculating sample entropy include: For any component sequence, construct A dimensional vector is defined by any two... The distance between two vectors is the maximum difference between their corresponding elements; Statistics for each The number of vectors whose distance to other vectors is less than a preset similarity tolerance is calculated by dividing the number of vectors in each dimension by the total number of vectors. The first matching probability of the m-dimensional vector is obtained, and the average matching probability in the m-dimensional vector is obtained. Increase the dimension to m+1, and in the same way, obtain the second matching probability for each m+1 dimensional vector, and obtain the average matching probability under m+1 dimensions; The negative logarithm of the ratio of the average matching probability in m dimensions to the average matching probability in m+1 dimensions is used as the sample entropy.
[0011] As a further technical solution, the contour coefficient is defined as follows: ; in, For the sample Profile coefficient, For the sample The average distance to all samples from the nearest heterogeneous cluster. For the sample The average distance to the remaining samples in the same cluster.
[0012] As a further technical solution, in step S4, the method for independently optimizing the hyperparameters of each model includes: The kernel size, dilation rate, and number of training rounds of a temporal convolutional network model are encoded as the first chromosome; the number of layers, hidden units, and training rounds of a long short-term memory network model are encoded as the second chromosome; and the number of hidden layers, neurons per layer, and training rounds of an artificial neural network model are encoded as the third chromosome. Genetic algorithms are applied to the first chromosome, the second chromosome, and the third chromosome respectively to optimize the fitness. The prediction error is used as the fitness evaluation criterion, and the hyperparameter combination that optimizes the fitness is output. The fitness function includes: ; in, For fitness value, The hyperparameter combination to be evaluated. The normalized root mean square error, The normalized mean absolute error, The normalized mean absolute percentage error. To prevent small constants with a denominator of zero, , , All of these are error weighting coefficients.
[0013] As a further technical solution, in step S5, the frequency band label is determined as follows: The frequency band with the smallest distance between the component sample entropy and the cluster center is selected as the frequency band label of the component to be predicted.
[0014] As a further technical solution, the method for obtaining the predicted building energy consumption value in step S5 includes: Extract energy consumption data with a preset historical window length before the prediction time, perform the same decomposition as in step S2, and obtain several intrinsic mode components and one residual component. Calculate the sample entropy of each component, and determine the frequency band label of each component based on the distance between the sample entropy of each component and the cluster center of each frequency band during the training phase. The components belonging to the high-frequency set are input into the trained temporal convolutional network model for prediction, the components belonging to the mid-frequency set are input into the trained long short-term memory network model for prediction, and the components belonging to the low-frequency set are input into the trained artificial neural network model for prediction. The predicted value of each component with a preset prediction step size is output respectively. The predicted building energy consumption value is obtained by summing the predicted values using the following formula: ; in, This is the predicted value of building energy consumption. For the current predicted time, To predict the step size, For high-frequency sets, For mid-frequency sets, It is a low-frequency set. For the first The future component is predicted by the temporal convolutional network model. The predicted value of the step, For the first The future component is predicted by the long short-term memory network model. The predicted value of the step, For the first The future component is predicted by an artificial neural network model. The predicted value of the step.
[0015] An electronic device is characterized in that it includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion.
[0016] A computer program product, characterized in that it includes a computer program / instruction, which, when executed by a processor, implements a building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion.
[0017] In summary, the present invention has at least one of the following beneficial technical effects: 1. This invention achieves full-process optimization of building energy consumption prediction by combining CEEMDAN decomposition, sample entropy quantification, hierarchical clustering adaptive grouping, frequency band heterogeneous modeling, and independent optimization by genetic algorithms. It can adaptively match the most suitable model structure according to the complexity of energy consumption components, effectively reduce mutual interference between different frequency features, and improve the accuracy and generalization ability of building energy consumption prediction without increasing computational redundancy.
[0018] 2. This invention uses sample entropy as a quantitative indicator of component complexity and combines it with hierarchical clustering to achieve adaptive frequency band grouping. It quantifies complexity based on the data characteristics of each component, without pre-assuming the correspondence between component number and frequency band. It has stronger adaptability and generalization ability for energy consumption data of different buildings. At the same time, by merging samples step by step to construct a dendrogram, it does not depend on the selection of the initial cluster center, avoiding the problem of unstable results caused by pre-specifying the number of clusters and sensitivity to the initial center, making the grouping results more interpretable and robust.
[0019] 3. This invention constructs differentiated prediction models for components in different frequency bands and uses a genetic algorithm to optimize them independently. Different chromosome coding spaces are established and the genetic algorithm is executed independently to optimize each model. This ensures that the hyperparameters of each model are matched with the signal characteristics of the corresponding frequency band, avoids conflicts between optimization objectives of different frequency bands, and improves parameter search efficiency. Attached Figure Description
[0020] Figure 1 This is a flowchart of a building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion.
[0021] Figure 2 This is a flowchart of the CEEMDAN decomposition method.
[0022] Figure 3 This is a schematic diagram illustrating the process of adaptively grouping and predicting frequency bands for each component based on CEEMDAN decomposition and using the sample entropy of each component as the clustering feature. Detailed Implementation
[0023] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings.
[0024] In the description of this specification, the references to "certain embodiments," "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples" indicate that a specific feature, structure, material, or characteristic described in connection with the described embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0025] This invention discloses a building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion, including a training phase and a prediction phase: like Figure 1 As shown, the training phase includes the following steps: Step S1: Obtain historical energy consumption data of the target building and preprocess it, dividing it into training set and test set in chronological order; Acquire historical energy consumption data of the target building at continuous time points, wherein the energy consumption data is collected by smart meters, energy management systems, building automation systems or database interfaces; The original energy consumption observation sequence of the target building is The corresponding timestamp sequence is ,in Indicates the first Energy consumption value at each sampling time. Indicates the first The timestamp of each sampling moment, with sampling intervals of 5 minutes, 15 minutes, 1 hour, or 1 day; Sort the original records according to timestamps and delete duplicate records corresponding to duplicate timestamps; For outliers, a sliding window-based Hampel filtering method is used for identification; let... The center window is The median absolute deviation is When the following conditions are met, Mark as an outlier: ; in, For threshold coefficient, The preset threshold is used, and the value is taken as follows: , ; For points marked as outliers, treat them as missing values and fill them in using interpolation with adjacent valid points; For missing values, if the number of missing values is less than 3, linear interpolation is used for imputation: ; in, The interpolation result at the missing points. The most recent valid time point to the left of the missing point. The most recent valid time point to the right of the missing point. The timestamps of the missing points to be filled; where ; If three or more data points are missing, the energy consumption observation sequence of all sampling points for that day will be deleted.
[0026] When the number of missing data is small, linear interpolation is used to fill in the gaps and maintain the continuity of the data; when the number of missing data is large, the data for that day is deleted to avoid introducing excessive errors through interpolation.
[0027] After handling outliers and missing values, the data is standardized. In this embodiment, Z-score is used to standardize the data: ; in, This is the standardized energy consumption value. The mean of the energy consumption data in the training set. The standard deviation of the energy consumption data in the training set. This represents the original energy consumption value.
[0028] and Calculated only from the training set and reused in the test set and prediction window, the parameters of the training set are effectively avoided from being leaked during the training phase, ensuring the objectivity of the model's generalization ability assessment and the feasibility of deployment in the prediction phase.
[0029] The dataset is divided into training and test sets in chronological order, with a ratio of 8:2; the length of the training set is set to... The training set is The test set is Because building energy consumption is time-dependent, random partitioning is not used to avoid future samples from entering the training phase.
[0030] Supervised learning samples are constructed based on a sliding window, with the historical window length set to 1. The predicted step size is Then the first The input of each training sample is , tag as ; in, For the first The input vector of each training sample, For the first Energy consumption value at each sampling time. The starting moment of the historical window Energy consumption value, For the first Labels of each training sample For the future The actual energy consumption value, For training sample index; In hourly prediction scenarios Take 24 to represent the past 24 hours; in a 15-minute prediction scenario, Use 96 to represent the past 24 hours; in daily forecasting scenarios, Use 7, 14, or 30 to represent the past week, two weeks, or one month.
[0031] Step S2: Perform CEEMDAN decomposition (Complete Set Adaptive Noise Empirical Mode Decomposition) on the energy consumption sequences contained in the training set to obtain... eigenmode functions to And a residual ; like Figure 2 As shown, the process of performing CEEMDAN decomposition on the energy consumption sequences contained in the training set includes: Pre-set decomposition parameters, including the total number of noise additions and the noise amplitude coefficient; To the original energy consumption sequence Adaptive white noise is added to the middle in successive iterations, let the first... The white noise sequence added next is The noise amplitude coefficient is , This represents the operator for obtaining the k-th eigenmode component through EMD (Empirical Mode Decomposition); No. The sub-noise sequence at time... Values at: ; For the first The noisy sequence after the second noise addition, This is the original energy consumption sequence. The initial noise amplitude coefficient, Index for the number of times noise was added. The total number of times noise is added to the set; First stage : ; in, These are the first-order intrinsic mode components; First residual: ; No. Step : ; in, For the first eigenmode components, For modal order index, The final decomposition results Total quantity To obtain the operator for the first-order modal components via EMD, To obtain the first through EMD Operators for first-order modal components, For the first order residual, For the first Noise amplitude coefficient; No. Order residual: ; in, For the first Order residual; Final Reconstruction Relationship: ; in, For the first The first residual is the final residual component; Decomposition stops when the total number of residual extreme points is less than 3 or the preset maximum number of modes is reached.
[0032] The set of components obtained by decomposition is denoted as ,in .
[0033] CEEMDAN effectively improves the modal aliasing problem and residual noise interference in traditional EMD by adding adaptive white noise in each decomposition and averaging the results of multiple noisy decompositions, providing higher quality basic components for subsequent complex quantifications.
[0034] The decomposition of CEEMDAN indivual The sample entropy is calculated from the intrinsic mode components and one residual component, respectively, to obtain the complexity vector E. Where E is the complexity vector, which is a one-dimensional vector composed of the sample entropy values of all intrinsic mode components and residual components. The first intrinsic mode component The sample entropy value, For the first Each intrinsic mode component The sample entropy value, For the final residual components The sample entropy value; To reduce the impact of differences in amplitude between different components on sample entropy, each component is standardized with zero mean and unit variance before calculating sample entropy. For any component sequence ,in, For any component sequence, For component sequences The Each sample value, For component sequences The total number of sampling points, and the calculation method for sample entropy are as follows: structure dimensional vector ;in, For the first indivual dimensional vector, For the component sequence in the th The value of each position; Define any two The distance between two dimensional vector sequences is the maximum difference between their corresponding elements: ; in, For two Distance between dimensional vectors For the component sequence in the th The value at each position, For the component sequence in the th The value at each position, For the first vector index, For the second vector index, Index of elements within the vector; Statistics for each The number of vectors whose distance to the other vectors is less than a preset similarity tolerance is divided by the total number of vectors to obtain the first matching probability, and then calculated. Average matching probability under dimension: ;in, for The average matching probability under dimension, For the first The matching probability of each vector. For similarity tolerance; Increase the dimension to The second matching probability is obtained in the same way, and then calculated. Average matching probability under dimension: ;in, for The average matching probability under dimension; As stated The average matching probability under dimension and The negative logarithm of the ratio of the average matching probabilities under dimension is used as the sample entropy, resulting in: ; in, The sample entropy value. The length of the component sequence; Sample entropy measures the probability that a time series will maintain similar patterns as the dimension increases. High-frequency noise components have higher sample entropy due to low pattern repeatability, while low-frequency trend components have lower sample entropy due to high pattern repeatability. Mid-frequency periodic components fall in between. This indicator does not require prior assumptions about the data distribution and has good consistency for sequences of different lengths, providing an objective and quantifiable basis for subsequent adaptive grouping.
[0035] Step S3, as follows Figure 3 As shown, CEEMDAN decomposition is performed on the energy consumption sequences contained in the training set. The sample entropy of each component is used as the clustering feature. Hierarchical clustering is used to adaptively group each component into frequency bands, dividing them into high-frequency set, mid-frequency set and low-frequency set. In terms of complexity vector Each element in the dataset is used as a sample, and each CEEMDAN component is considered as an object to be clustered. Since the sample entropy itself is a one-dimensional feature, any two components... and The distance between them is defined as the absolute value of the difference in their sample entropy: ; in, For any two CEEMDAN components and The distance between them is defined as the absolute value of the difference in their sample entropy. For components The sample entropy value, For components The sample entropy value; Hierarchical clustering is used to construct a clustering tree, and the connection method can be Ward connection, average connection or full connection; Taking Ward's connection as an example, merging two clusters and When merging clusters, the scheme that minimizes the increase in total variance within the clusters is selected, and its distance is defined as: ; in, The Ward distance between two clusters. For the first A cluster, For the first A cluster, , Clusters and The center of mass; Number of cluster categories Determined by the silhouette coefficient, for each candidate Calculate the average profile coefficient and select the value that maximizes the average profile coefficient. The value is used as the final number of categories, and The profile coefficient is defined as: ; in, For the sample The profile coefficient, For the sample The average distance to all samples from the nearest heterogeneous cluster. For the sample The average distance to the remaining samples in the same cluster.
[0036] get After creating 10 clusters, calculate the mean sample entropy of each cluster. ;in, For the first The mean sample entropy of each cluster, For the first A cluster, For the first The sample entropy value of each component; The cluster with the highest mean sample entropy is defined as the high-frequency cluster. : ; in, For high-frequency sets, For indexes of high-frequency clusters; The cluster with the lowest mean sample entropy is defined as the low-frequency cluster. : ; in, It is a low-frequency set. Index for low-frequency clusters; the remaining The merging of clusters is defined as a mid-frequency cluster. : ; in, For mid-frequency sets, For indexing mid-frequency clusters; In this embodiment, if Then, high frequency, medium frequency and low frequency correspond to three clusters respectively; like Then, all clusters other than the highest and lowest complexity clusters are considered as a mid-frequency set, or further divided into mid-high frequency, mid-frequency and mid-low frequency subsets according to their complexity from high to low, and are processed using the LSTM model.
[0037] Build a model registry Record the component number, sample entropy, frequency band label, cluster center, model type, and optimal hyperparameters for each component during the training phase.
[0038] Step S4: Construct a Temporal Convolutional Network (TCN) model for the high-frequency set, a Long Short-Term Memory (LSTM) model for the mid-frequency set, and an Artificial Neural Network (ANN) model for the low-frequency set. Use a genetic algorithm to independently optimize the hyperparameters of each model and save the optimal model after training. High-frequency components typically include non-stationary elements such as measurement noise, random equipment start-up and shutdown, and short-term burst disturbances. TCN processes sequential data in parallel by combining causal convolution and dilated convolution, expanding the receptive field while strictly maintaining temporal causality and preventing future information leakage.
[0039] The output of dilated causal convolution is defined as: ; in, for The output of the causal convolution is expanded at each step. For the first Each convolutional kernel weight, The kernel size is [size]. For expansion rate, This is the kernel position index; By increasing the expansion rate layer by layer, the effective receptive field of the model grows exponentially with the number of layers, thus capturing long-range temporal dependencies with fewer parameters.
[0040] The TCN model consists of one or more stacked residual blocks. Each residual block contains, in sequence, an dilated causal convolutional layer, a ReLU activation function, a Dropout regularization layer, and residual connections. The output of the residual block is defined as: ; in, For the output of the residual block, It is the ReLU activation function. This is the weight matrix of the first convolutional layer. This is the weight matrix for the second convolutional layer. This is the bias term for the first convolutional layer. This represents the corresponding bias term for the second convolutional layer. The input is the residual after dimension alignment. This is the input for the residual block; Residual connections enable gradients to propagate directly across layers, thus mitigating the vanishing gradient problem during deep network training.
[0041] Regarding model input and output, with length as Using historical time windows as input, the output is the future. The predicted value of the high-frequency component corresponding to the step.
[0042] The parameters to be optimized in the TCN model include the kernel size. Expansion rate base And the number of training epochs; The kernel size of the TCN model Expansion rate base And the training epoch number is encoded as the first chromosome. .
[0043] Mid-frequency components typically carry daily, weekly, or equipment control cycle information in building energy consumption, and the sequences exhibit significant time dependence. LSTM models dynamically adjust information retention and forgetting through gating mechanisms to extract periodic dependencies and medium- to long-term memory information; The calculation process of each gate unit in the LSTM model is as follows: ; ; ; ; ; in, for Forget the door activation value, Forgotten Gate The weight matrix, for The hidden state at any given moment. for Input at any time Forgotten Gate The bias term, Use the Sigmoid activation function; for Enter the activation value of the gate at any time. For input gate The weight matrix, For input gate The bias term; for Candidate states at time 10:00 Candidate state The weight matrix, Candidate state The bias term; for The cell state at any given time; for Output the activation value of the gate at any time. This is the weight matrix of the output gate. This is the bias term for the output gate; for The hidden state at any given moment.
[0044] The model uses the length of the intermediate frequency component as Using historical windows as input, outputting the future. The predicted values of the intermediate frequency components are obtained. Similarly, a genetic algorithm is used to optimize the hyperparameters, including the number of LSTM layers. Number of hidden units And the number of training epochs, encoded as the second chromosome. .
[0045] Low-frequency components and residuals typically reflect long-term trends and slow changes in building energy consumption, with relatively smooth sequences and low complexity. An ANN model is used as the prediction model for low-frequency components. The ANN model takes a fixed-length trend window, time features, or statistical features of low-frequency components as input and outputs predicted values for future low-frequency components.
[0046] ANN model Layer computation: ; in, For the first The output of the layer, For the first The weight matrix of the layer, For the first The output of the layer, For the first Layer bias terms, For activation functions; Output layer: ; in, This is the predicted output of the ANN model. This is the weight matrix of the output layer. This is the output of the last hidden layer. This represents the total number of hidden layers in the ANN. For the bias term of the output layer; The parameters to be optimized in low-frequency ANN models include the number of hidden layers. Number of neurons per layer And the number of training epochs. Due to the smoothing of low-frequency components, the ANN model can achieve stable trend predictions with lower computational resources; Number of hidden layers Number of neurons per layer And the training epoch number is encoded as the third chromosome. ; For each candidate chromosome, a corresponding model is constructed based on its encoding parameters and trained on the training set. Then, the prediction error is calculated on the validation set to evaluate the fitness. The genetic algorithm's operating parameters are set as follows: population size is 80, maximum number of iterations is 100, crossover probability is 0.7, and mutation probability is 0.05. Each generation retains several elite individuals with the highest fitness to ensure that the optimal parameters are not lost due to random operations. The selection operation adopts roulette wheel selection.
[0047] The fitness function uses a normalized weighted combination of RMSE, MAE, and MAPE: The fitness function includes: ; in, For fitness value, The hyperparameter combination to be evaluated. The normalized root mean square error, The normalized mean absolute error, The normalized mean absolute percentage error. To prevent small constants with a denominator of zero, , , All are error weighting coefficients; The error indices are defined as follows: ; ; ; in, The root mean square error, The total number of samples, For the first The true value of each sample To test the first on the validation set The model prediction value for a single sample. For sample index, The mean absolute error, The mean absolute percentage error.
[0048] TCN, LSTM, and ANN have different model structures and hyperparameter spaces. This invention establishes different chromosome codes for each of the three and executes genetic algorithms for optimization independently, avoiding search space coupling between hyperparameters of different models and reducing optimization complexity. It also ensures that the optimization objective of each model is consistent with its corresponding signal features, avoiding the problem that uniform parameter tuning will cause each model to be unable to fully adapt to its respective task.
[0049] The prediction phase includes the following steps: Step S5, during the testing phase, for each time point to be predicted... ,Pick Previously available history windows ; Without using In the case of actual energy consumption data, Performing Ceemdan decomposition yields the set of components within the window. Then, the sample entropy is calculated for each component, and frequency band labels are mapped based on the cluster centers during the training phase or the current window hierarchical clustering results; In step S5, the frequency band label is determined as follows: ; in, Components to be predicted frequency band labels, For the component to be predicted, The entropy of this component sample, For the training phase Cluster centers of frequency bands Indicates high frequency, Indicates intermediate frequency, Indicates low frequency.
[0050] The components belonging to the high-frequency set are input into the trained TCN model for prediction, the components belonging to the mid-frequency set are input into the trained LSTM model for prediction, and the components belonging to the low-frequency set are input into the trained ANN model for prediction. The future values of each component are then output. The predicted value of the step; The predicted building energy consumption value is obtained by summing the predicted values using the following formula: ; in, This is the predicted value of building energy consumption. For the current predicted time, To predict the step size, For high-frequency sets, For mid-frequency sets, It is a low-frequency set. For the first The future component is predicted by the temporal convolutional network model. The predicted value of the step, For the first The future component is predicted by the long short-term memory network model. The predicted value of the step, For the first The future component is predicted by an artificial neural network model. The predicted value of the step, These are the component indices.
[0051] By leveraging the characteristic that each component in the CEEMDAN decomposition can linearly reconstruct the original sequence, the prediction results of each frequency band component are summed to obtain the final prediction value. This allows the final prediction result to simultaneously capture details in high frequencies, retain the periodicity of mid frequencies, and track trends in low frequencies, thus integrating multi-frequency information during the reconstruction stage.
[0052] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion, characterized in that, Includes the training phase and the prediction phase: The training phase includes the following steps: Step S1: Obtain historical energy consumption data of the target building and preprocess it, dividing it into training set and test set in chronological order; Step S2: Decompose the energy consumption sequence contained in the training set to obtain several intrinsic mode components and one residual component; calculate the sample entropy of each component to form a complexity vector. Step S3: Using the sample entropy of each component as the clustering feature, hierarchical clustering is used to adaptively group each component into high-frequency, mid-frequency, and low-frequency sets; the frequency band labels and cluster centers of each component are recorded to construct the model registry. Step S4: Construct a temporal convolutional network model for the high-frequency set, a long short-term memory network model for the mid-frequency set, and an artificial neural network model for the low-frequency set. Use a genetic algorithm to independently optimize the hyperparameters of each model and save the optimal model after training. The prediction phase includes the following steps: Step S5: Perform the same decomposition as in the training phase on the historical window data before the prediction time and calculate the entropy of each component sample; determine the frequency band label based on the distance between the entropy of each component sample and the cluster center in the model registry; call the corresponding frequency band model saved in the training phase to make a prediction, accumulate the prediction results of each component, and output the predicted building energy consumption value.
2. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion as described in claim 1, characterized in that, Step S2, the process of decomposing the energy consumption sequences contained in the training set includes: Pre-set decomposition parameters, including the total number of noise additions and the noise amplitude coefficient; Adaptive white noise is added to the original energy consumption sequence one by one to generate multiple sets of noisy sequences; Decompose all the noisy sequences and take the mean to obtain the first-order intrinsic mode components, and calculate the first-order residuals; The higher-order intrinsic mode components are generated iteratively, and the corresponding order residuals are updated synchronously. Decomposition stops when the total number of residual extreme points is less than a preset threshold or when the preset maximum number of modes is reached. The intrinsic mode components and the final residual components of each order are obtained.
3. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion as described in claim 1, characterized in that, In step S3, the specific methods for dividing the high-frequency set, mid-frequency set, and low-frequency set include: Using the absolute value of the difference between the entropies of any two sample components as the distance, hierarchical clustering is used to construct a clustering tree; The number of clusters is determined by the silhouette coefficient. The number of clusters that maximizes the average silhouette coefficient is taken as the final number of clusters, and the number of clusters is greater than or equal to the preset number of clusters. Calculate the sample entropy for each cluster and take the mean. Define the cluster with the highest mean as the high-frequency set, the cluster with the lowest mean as the low-frequency set, and merge the remaining clusters to define the mid-frequency set.
4. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion according to claim 3, characterized in that, Methods for calculating sample entropy include: For any component sequence, construct A dimensional vector is defined by any two... The distance between two vectors is the maximum difference between their corresponding elements; Statistics for each The number of vectors whose distance to other vectors is less than a preset similarity tolerance is calculated by dividing the number of vectors in each dimension by the total number of vectors. The first matching probability of the m-dimensional vector is obtained, and the average matching probability in the m-dimensional vector is obtained. Increase the dimension to m+1, and in the same way, obtain the second matching probability for each m+1 dimensional vector, and obtain the average matching probability under m+1 dimensions; The negative logarithm of the ratio of the average matching probability in m dimensions to the average matching probability in m+1 dimensions is used as the sample entropy.
5. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion according to claim 3, characterized in that, The contour coefficient is defined as: in, For the sample Profile coefficient, For the sample The average distance to all samples from the nearest heterogeneous cluster. For the sample The average distance to the remaining samples in the same cluster.
6. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion according to claim 1, characterized in that, In step S4, the method for independently optimizing the hyperparameters of each model includes: The kernel size, dilation rate, and number of training rounds of the temporal convolutional network model are encoded as the first chromosome; the number of layers, number of hidden units, and number of training rounds of the long short-term memory network model are encoded as the second chromosome; and the number of hidden layers, number of neurons per layer, and number of training rounds of the artificial neural network model are encoded as the third chromosome. Genetic algorithms are applied to the first chromosome, the second chromosome, and the third chromosome respectively to optimize the fitness. The prediction error is used as the fitness evaluation criterion, and the hyperparameter combination that optimizes the fitness is output. The fitness function includes: in, For fitness value, The hyperparameter combination to be evaluated. The normalized root mean square error, The normalized mean absolute error, The normalized mean absolute percentage error, To prevent small constants with a denominator of zero, , , All of these are error weighting coefficients.
7. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion according to claim 1, characterized in that, In step S5, the frequency band label is determined as follows: The frequency band with the smallest distance between the component sample entropy and the cluster center is selected as the frequency band label of the component to be predicted.
8. The building energy consumption prediction method based on sequence decomposition, grouping, and heterogeneous model fusion according to claim 1, characterized in that, In step S5, the methods for obtaining the predicted building energy consumption include: Extract energy consumption data with a preset historical window length before the prediction time, perform the same decomposition as in step S2, and obtain several intrinsic mode components and one residual component. Calculate the sample entropy of each component, and determine the frequency band label of each component based on the distance between the sample entropy of each component and the cluster center of each frequency band during the training phase. The components belonging to the high-frequency set are input into the trained temporal convolutional network model for prediction, the components belonging to the mid-frequency set are input into the trained long short-term memory network model for prediction, and the components belonging to the low-frequency set are input into the trained artificial neural network model for prediction. The predicted value of each component with a preset prediction step size is output respectively. The predicted building energy consumption value is obtained by summing the predicted values using the following formula: in, This is the predicted value of building energy consumption. For the current predicted time, To predict the step size, For high-frequency sets, For mid-frequency sets, It is a low-frequency set. For the first The future component is predicted by the temporal convolutional network model. The predicted value of the step, For the first The future component is predicted by the long short-term memory network model. The predicted value of the step, For the first The future component is predicted by an artificial neural network model. The predicted value of the step.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion as described in any one of claims 1 to 8.
10. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the building energy consumption prediction method based on sequence decomposition and grouping and heterogeneous model fusion as described in any one of claims 1 to 8.
