A building energy consumption prediction method fusing dual-input features and related equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
- Filing Date
- 2026-05-28
- Publication Date
- 2026-08-07
AI Technical Summary
特征耦合导致机理刻画模糊:现有的建模方法通常将所有动态与静态特征简单拼接后直接输入统一模型
本发明引入机器学习与深度学习方法,结合建筑属性特征与能耗时间序列信息,构建融合静态与动态特征的预测模型结构,并通过多模型对比分析不同方法在预测精度与稳定性方面的表现,以提高对能耗变化趋势的刻画能力。本发明采用双输入特征建模思想,将特征按照时序属性与物理含义进行结构化划分,使模型能够在结构层面清晰区分时间变化因素与建筑固有属性。这一设计有效避免了不同特征类型(动态时序特征与静态类别/数值特征)在建模过程中相互干扰,提高了模型对能耗变化机理的刻画能力。
Smart Images

Figure CN122529166A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of building energy management technology, and relates to a building energy consumption prediction method and related equipment that integrates dual-input features. Background Technology
[0002] With the development of machine learning and deep learning technologies, they have been widely applied in the field of building energy consumption prediction. The driving factors of building energy consumption are highly complex, including dynamic features that change over time, such as meteorological environmental variables and temporal characteristics, as well as static structural information such as building area, construction year, and building use. However, existing energy consumption prediction models still have the following limitations in multi-source feature processing and time-series modeling: Feature coupling leads to fuzzy mechanistic characterization: Existing modeling methods typically involve simply concatenating all dynamic and static features and directly inputting them into a unified model. This approach weakens the differences between different types of features in terms of time scale, semantic meaning, and mode of action, thus severely affecting the model's ability to characterize the mechanism of energy consumption changes.
[0003] Traditional coding methods lead to high-dimensional sparsity problems: When dealing with discrete categorical variables such as building number and building use, which contain important information about differences in energy consumption, traditional methods often use one-hot coding. This coding method is prone to introducing high-dimensional sparsity features, which not only increases the parameter size of the model but may also weaken the model's ability to learn the potential similarities between different buildings.
[0004] Static features interfere with the temporal modeling process: The static features of a building remain unchanged within the prediction time window. If these features are directly fed into a recurrent neural network (such as BiLSTM) for temporal modeling, not only will they fail to provide effective temporal information, but they may also introduce redundant features, increasing the difficulty of model training and causing non-temporal features to interfere with the temporal modeling process. Key temporal information is easily diluted: Traditional recurrent neural network-based prediction models typically assume that the contribution of each time step to the prediction result is equivalent, or rely solely on the implicit expression of temporal importance by the hidden state. However, in actual building operation, specific time periods (such as the initial startup of the air conditioning system, morning and evening peak hours, etc.) have a stronger indicative role in future energy consumption levels. Treating all historical moment information equally can easily lead to the dilution of key information by redundant temporal features, thus affecting the model's prediction accuracy for extreme and peak periods.
[0005] Therefore, current building energy consumption prediction technologies suffer from several drawbacks, including feature splicing leading to fuzzy mechanism characterization, traditional category coding causing high-dimensional sparsity, static features interfering with temporal network modeling, and traditional recurrent neural networks failing to highlight key time segments. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention provides a building energy consumption prediction method that integrates dual-input features. By separating static and dynamic features through dual input channels, introducing an embedding layer for low-dimensional dense representation, and combining an attention mechanism to explicitly weight and aggregate key temporal information, the method avoids mutual interference between different features and comprehensively improves the prediction accuracy, stability, and generalization ability of the model in complex multi-building scenarios.
[0007] This invention is achieved through the following technical solution: A building energy consumption prediction method that integrates dual-input features includes: Obtain the historical running dataset of the building to be predicted; Based on the established dual-input feature prediction model, the historical operation dataset of the building is input into the dual-input feature prediction model, and the predicted energy consumption value of the building is output, specifically: Based on the historical operation dataset of the building, static physical and environmental attributes are extracted from the historical operation dataset to construct static features, and time-series data of meteorological and operational status are extracted to construct dynamic time-series features. The discrete categorical variables in the static features are mapped to a continuous vector space by the embedding matrix to obtain the static feature embedding vector; The dynamic temporal features are organized in the form of a sliding time window, input into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step. An attention mechanism is used to calculate the attention weights at each time step in the hidden state sequence, and the hidden state sequence is weighted and summed based on the attention weights to obtain a dynamic temporal context vector. The static feature embedding vector and the dynamic temporal context vector are concatenated and fused. The concatenated and fused features are then input into a fully connected layer to output the predicted building energy consumption value for future time moments.
[0008] Preferably, the building orientation, location, air conditioning system type, window-to-wall ratio, building height, equipment density, regional climate type, and building utilization rate are considered; these are used to construct static features with 12 dimensions. The time-series data of meteorological and operational status includes: historical energy consumption, outdoor temperature, outdoor humidity, wind speed, weekday code, hourly code, chiller operating status, and fan frequency; the length of the sliding time window is set to 24.
[0009] Preferably, the step of mapping the discrete categorical variables in the static features to a continuous vector space through the embedding matrix is calculated using the following formula: ; In the formula, x is the one-hot encoded representation of the input discrete categorical variable. The embedding matrix parameters are initialized using Xavier, the mapping process uses the ReLU activation function, and the inactivation rate parameter is set to 0.2.
[0010] Preferably, the bidirectional long short-term memory network comprises a forward LSTM network and a backward LSTM network, with two layers and a unidirectional hidden layer dimension of 128; the gating and state update calculation process for a single time step is as follows: The gating calculation process is a forgetting gate:
[0011] Input Gate:
[0012] Candidate state:
[0013] Status Update:
[0014] Output gate:
[0015] in, The input for the dynamic temporal characteristics at the current time step is... This is the hidden state from the previous time step. This is the cell state vector from the previous time step. For the current moment Updated current cell state vector; Here, is the Sigmoid activation function, and t is the time step. This is the output vector of the forget gate; The output vector of the input gate. Let be the candidate cell state vector at time t. The output vector of the output gate; This means concatenating and fusing the hidden state from the previous time step with the current input vector; , , , These are the weight matrices for the forget gate, input gate, candidate state calculation, and output gate, respectively. , , , These are the bias term vectors for the forget gate, input gate, candidate state calculation, and output gate, respectively. This represents the element-wise multiplication of two matrices or vectors with the same dimensions.
[0016] Preferably, the dynamic temporal features are organized in the form of a sliding time window, input into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step, specifically including: The dynamic temporal features are organized using a sliding time window of a preset length and input into a bidirectional long short-term memory network for bidirectional temporal encoding. The forward network extracts the cumulative impact of historical energy consumption and environmental changes on current energy consumption, while the reverse network uses contextual information from future time steps to supplement the temporal feature expression. The outputs of the forward and reverse networks are then fused to output the comprehensive hidden state sequence corresponding to each time step.
[0017] Preferably, an attention mechanism is used to calculate the attention weights at each time step in the hidden state sequence, specifically as follows: Importance scores are calculated using an additive attention mechanism, and the formula is as follows:
[0018] in, Score based on importance. Let be the hidden state at time step t. and These are the weight matrix and bias parameters in nonlinear mapping calculations. This is the trainable scoring parameter vector of the model; The attention weight is obtained by normalizing the importance score.
[0019] Preferably, before performing prediction, the method further includes a step of closed-loop training iteration on the parameters of the dual-input feature prediction model based on a pre-built publicly available building energy consumption dataset: During the training iteration, mean squared error is used as the loss function, and gradient descent is performed using the Adam optimizer; the initial learning rate of the Adam optimizer is set to 0.001. The closed-loop training iteration process also introduces an early stopping mechanism: during the training iteration, the error data of the validation set is continuously monitored, and when it is determined that the error data of the validation set does not decrease for a preset number of consecutive rounds, the early stopping mechanism is triggered to stop the closed-loop training iteration.
[0020] A building energy consumption prediction system that integrates dual-input features includes: The data extraction module is used to acquire the historical operation dataset of the building to be predicted, extract the static physical and environmental attributes from the historical operation dataset to construct static features, and extract the time series data of meteorological and operational status to construct dynamic time series features. The prediction module is used to predict the building's energy consumption based on the established dual-input feature prediction model. The historical operating dataset of the building to be predicted is input into the dual-input feature prediction model, and the predicted building energy consumption value is output. The dual-input feature prediction model includes: The static feature encoding module is used to construct a trainable embedding matrix, which maps the discrete category variables in the static features to a continuous vector space to obtain the static feature embedding vector. The temporal modeling module is used to organize the dynamic temporal features in the form of a sliding time window, input them into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step. The attention mechanism module is used to calculate the attention weights at each time step in the hidden state sequence using an attention mechanism, and to perform a weighted summation on the hidden state sequence based on the attention weights to obtain a dynamic temporal context vector. The feature fusion and prediction module is used to concatenate and fuse the static feature embedding vector with the dynamic temporal context vector, input the concatenated and fused features into the fully connected layer in the dual-input feature prediction model, and output the building energy consumption prediction result.
[0021] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the building energy consumption prediction method that integrates dual-input features.
[0022] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the building energy consumption prediction method that integrates dual-input features.
[0023] Compared with the prior art, the present invention has the following beneficial technical effects: This invention introduces machine learning and deep learning methods, combining building attribute features with energy consumption time series information to construct a prediction model structure that integrates static and dynamic features. Through multi-model comparative analysis of the performance of different methods in terms of prediction accuracy and stability, it aims to improve the ability to characterize energy consumption change trends. This invention employs a dual-input feature modeling approach, structurally dividing features according to temporal attributes and physical meaning, enabling the model to clearly distinguish between time-varying factors and inherent building attributes at the structural level. This design effectively avoids mutual interference between different feature types (dynamic temporal features and static categorical / numerical features) during the modeling process, improving the model's ability to characterize the mechanisms of energy consumption changes.
[0024] Furthermore, for discrete category features such as building use and site number, this invention introduces an embedding layer for low-dimensional dense representation learning, transforming high-dimensional sparse encoding into continuous vector representation. This mechanism reduces the input dimensionality while improving feature representation capabilities, enabling it to characterize the similarity relationships between different buildings in the feature space, thereby significantly enhancing the model's prediction stability and generalization ability in multi-building scenarios.
[0025] Furthermore, this invention uses a bidirectional long short-term memory network (BiLSTM) only for modeling dynamic temporal features, avoiding interference from static non-temporal features in the time modeling process. This separation modeling strategy not only more comprehensively reflects the changing patterns of building energy consumption over time, but also effectively reduces model complexity and improves the rationality and interpretability of the model structure.
[0026] Furthermore, addressing the sudden and nonlinear characteristics of building load changes, this invention introduces an Attention mechanism in time-series modeling to explicitly weight historical hidden states. This mechanism breaks away from the limitation of traditional models that treat all historical moments equally, automatically identifying and focusing on key time segments that contribute significantly to the prediction results. It effectively captures critical moments before and after load abrupt changes, greatly improving the model's ability to predict extreme and peak periods under complex operating conditions. Attached Figure Description
[0027] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart of the building energy consumption prediction method that integrates dual-input features according to the present invention; Figure 2 This is a structural framework diagram of the dual-input feature prediction model of the present invention; Figure 3 This is a loss convergence curve of the dual-input feature prediction model in Embodiment 1 of the present invention; Figure 4 This is a scatter plot showing the relationship between the actual energy consumption value and the model prediction value in Embodiment 1 of the present invention. Figure 5 This shows the distribution of the predicted residuals in Embodiment 1 of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0030] This invention provides a building energy consumption prediction method that integrates dual-input features. Based on an established dual-input feature prediction model, this method inputs the building's historical operational dataset into the model to output high-precision future building energy consumption predictions, such as... Figure 1 As shown, the specific process includes the following steps: Step S1: Data Acquisition and Dual-Channel Feature Construction. Acquire the historical operation dataset of the building to be predicted, and structurally divide the complex building energy consumption drivers into static features and dynamic time-series features according to their physical meaning and temporal attributes.
[0031] Specifically, static physical and environmental attributes are extracted from the building's historical operational dataset to construct static features. These static features include 12 variables, specifically: building area, construction year, building type, number of floors, building orientation, location, air conditioning system type, window-to-wall ratio, building height, equipment density, regional climate type, and building occupancy rate. These features remain relatively stable over time, determining the building's overall energy consumption and its baseline response to the external environment.
[0032] Simultaneously, time-series data on meteorological and operational status are extracted to construct dynamic time-series features. These specifically include: historical energy consumption, outdoor temperature, outdoor humidity, wind speed, weekday coding, hourly coding, chiller operating status, and fan frequency. These features change continuously over time, directly driving fluctuations in building heat load.
[0033] Step S2: Independent channel embedding mapping of static features For discrete categorical variables in static features (such as building category, air conditioning system type, etc.), traditional one-hot encoding easily introduces high-dimensional sparse matrices, weakening the model's learning ability. Therefore, this embodiment maps them to a low-dimensional continuous vector space through an embedding matrix to obtain the static feature embedding vector, the calculation formula of which is as follows: ; In the formula, x is the one-hot encoded representation of the input discrete categorical variable. The embedding matrix parameters are initialized using Xavier, the mapping process uses the ReLU activation function, and the inactivation rate parameter is set to 0.2 to effectively prevent overfitting during static feature learning. Step S3: Bidirectional cyclic modeling of dynamic temporal features The dynamic temporal features extracted in step S1 are organized into a sliding time window with a window length T of 24, meaning that the dynamic sequence of the past 24 hours is used to predict future energy consumption. The organized dynamic temporal features are then input into a Bidirectional Long Short-Term Memory (BiLSTM) network for temporal modeling. This BiLSTM network consists of a forward LSTM network and a backward LSTM network, with two layers and a unidirectional hidden layer dimension of 128. The forward network extracts the cumulative impact of historical energy consumption and environmental changes on current energy consumption, while the backward network supplements the temporal feature representation with contextual information from future time steps. The outputs of the forward and backward networks are then fused to output the comprehensive hidden state sequence corresponding to each time step. The gating and state update calculation process for a single time step strictly follows the following formula: The specific gating and state update calculation process for a single time step is as follows: The gating calculation process is a forgetting gate:
[0034] Input Gate:
[0035] Candidate state:
[0036] Status Update:
[0037] Output gate:
[0038] in, The input for the dynamic temporal characteristics at the current time step is... This is the hidden state from the previous time step. This is the cell state vector from the previous time step. For the current moment Updated current cell state vector; Here, is the Sigmoid activation function, and t is the time step. This is the output vector of the forget gate; The output vector of the input gate. Let be the candidate cell state vector at time t. The output vector of the output gate; This means concatenating and fusing the hidden state from the previous time step with the current input vector; , , , These are the weight matrices for the forget gate, input gate, candidate state calculation, and output gate, respectively. , , , These are the bias term vectors for the forget gate, input gate, candidate state calculation, and output gate, respectively. This represents the element-wise multiplication of two matrices or vectors with the same dimensions.
[0039] Step S4: Key Time Sequence Capture Based on Additive Attention Mechanism Considering that in actual building operation, key time segments such as morning and evening peak hours and the initial startup of air conditioning have a strong indicative role in energy consumption prediction, this embodiment uses an attention mechanism to calculate the attention weight of each time step in the hidden state sequence. Specifically, the importance score of each time step is calculated using an additive attention mechanism, and the calculation formula is as follows:
[0040] in, Score based on importance. Let be the hidden state at time step t. and These are the weight matrix and bias parameters in nonlinear mapping calculations. This is the trainable scoring parameter vector of the model; Subsequently, the importance score was obtained using the Softmax function. Normalization is performed to obtain the attention weights for each time step. Finally, the hidden state sequence is adaptively weighted and summed based on the attention weights to generate a dynamic temporal context vector representing global key temporal information.
[0041] Step S5: Dual-input feature fusion and energy consumption prediction The static feature embedding vector (representing the inherent baseline attributes of the building) output in step S2 is concatenated and fused with the dynamic temporal context vector (representing the dynamic evolution characteristics of the environment and operating status) output in step S4.
[0042] The combined features after splicing and fusion are input into the fully connected layer in the dual-input feature prediction model to perform the final nonlinear mapping of the features and output the predicted building energy consumption value at future time.
[0043] Step S6: Closed-loop training and iterative optimization of the model Before performing actual predictions, this method also includes a closed-loop training iteration step on the parameters of the dual-input feature prediction model based on a pre-built public building energy consumption dataset: During the training iteration, mean squared error (MSE) is used as the loss function, and the Adam optimizer is used to update the network weights using gradient descent. The initial learning rate of the Adam optimizer is set to 0.001.
[0044] To ensure the generalization ability of the model, an early stopping mechanism is introduced in the closed-loop training iteration step: during the training iteration, the error data of the validation set is continuously monitored. When it is determined that the error data of the validation set does not decrease for a preset number of rounds (e.g., 10 rounds), the early stopping mechanism is triggered to stop the closed-loop training iteration and save the current optimal parameter model.
[0045] This invention also provides a building energy consumption prediction system that integrates dual-input features, which implements the above-mentioned method at the hardware or logic module level. The system includes: Data extraction module: used to obtain the historical operation dataset of the building to be predicted, extract 12-dimensional static physical and environmental attributes from the historical operation dataset to construct static features, and extract time series data of historical energy consumption, meteorology and operation status to construct dynamic time series features.
[0046] Prediction module: Contains an established dual-input feature prediction model, used to input historical operating data of the building to be predicted into the model, and output the predicted building energy consumption value. The dual-input feature prediction model further includes: Static feature encoding submodule: used to construct a trainable embedding matrix initialized with Xavier. This embedding matrix maps the discrete categorical variables in the static features to a continuous vector space. After ReLU activation and Dropout, the static feature embedding vector is obtained.
[0047] Temporal modeling submodule: Used to organize the dynamic temporal features with a sliding time window of length 24, input to a two-layer bidirectional long short-term memory network (BiLSTM) for forward and reverse temporal modeling, and output the hidden state sequence corresponding to each time step.
[0048] Attention Mechanism Submodule: Used to calculate the importance score of each time step in the hidden state sequence using an additive attention mechanism and normalize it into attention weights. Based on these weights, the hidden state sequence is weighted and summed to obtain a dynamic temporal context vector that can capture sudden loads.
[0049] Feature fusion and prediction submodule: This module is used to perform end-to-end splicing and fusion of the static feature embedding vector and the dynamic temporal context vector, input the fused features into the fully connected layer, and output the final building energy consumption prediction result.
[0050] The technical solution of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] Example 1 This invention proposes a building energy consumption prediction method that combines static features with dynamic temporal features, employing a dual-input feature fusion approach. The overall structure of the prediction model based on the dual-input feature is as follows: Figure 2 As shown, it includes: a static feature embedding module, a dynamic temporal input module, a BiLSTM temporal modeling module, an attention enhancement module, and a fully connected prediction module. Specifically, it includes the following steps: S1: Construct a building energy consumption dataset.
[0052] This invention utilizes the ASHRAE Building Energy Consumption Public Dataset. The dataset contains 1449 buildings across 16 building types and over 20 million time-series data points. The time span is from January 1, 2016 to December 31, 2016. The sampling granularity is 1 hour.
[0053] S2: Input feature construction.
[0054] This invention employs a dual-input structure. The static feature dimensions total 12, as shown in Table 1.
[0055] Table 1 Examples of Static Features
[0056] The dynamic feature window length is set to T = 24. That is, energy consumption for the next hour is predicted using data from the previous 24 hours.
[0057] S3: Embedding static feature encoding method.
[0058] This invention uses Embedding instead of One-Hot encoding. For example, there are 16 building categories. Traditional One-Hot encoding has 16 dimensions. This invention maps the embedded data to an 8-dimensional dense vector. The Embedding matrix has dimensions W. e ∈R 16×8 Embedding output is The Embedding layer constructs a trainable embedding matrix, mapping discrete categorical variables to a continuous vector space. This allows the model to learn the potential energy consumption behavior relationships between different categories during training. Specifically, categorical variables such as building number, building use, and site number are selected as embedding inputs. Each discrete feature corresponds to an independent embedding representation space, and its vector dimension is set according to the category size. During model training, the embedding vectors are continuously updated as the prediction error backpropagates, gradually forming a low-dimensional representation that can characterize the differences in building features. The parameters of the Embedding layer are shown in Table 2.
[0059] Table 2 Embedding Layer Parameters
[0060] S4: BiLSTM timing modeling structure.
[0061] First, the network structure: BiLSTM includes forward LSTM and backward LSTM. The hidden layer dimension is 128. The network has 2 layers. The input tensor is X∈R. 24×8 The output dimension is H∈R 24×256 Because bidirectional splicing results in 128 × 2 = 256.
[0062] The gating calculation process is a forgetting gate:
[0063] Input Gate:
[0064] Candidate state:
[0065] Status Update:
[0066] Output gate:
[0067] in, The input for the dynamic temporal characteristics at the current time step is... This is the hidden state from the previous time step. This is the cell state vector from the previous time step. For the current moment Updated current cell state vector; Here, is the Sigmoid activation function, and t is the time step. This is the output vector of the forget gate; The output vector of the input gate. Let be the candidate cell state vector at time t. The output vector of the output gate; This means concatenating and fusing the hidden state from the previous time step with the current input vector; , , , These are the weight matrices for the forget gate, input gate, candidate state calculation, and output gate, respectively. , , , These are the bias term vectors for the forget gate, input gate, candidate state calculation, and output gate, respectively. This represents the element-wise multiplication of two matrices or vectors with the same dimensions.
[0068] In its implementation, the model organizes input data using sliding time windows, with each window containing dynamic feature vectors from multiple consecutive time steps. BiLSTM employs a bidirectional structure to model the time series both forward and backward. The forward network focuses on depicting the cumulative impact of historical energy consumption and environmental changes on current energy consumption, while the backward network utilizes contextual information from future time steps to supplement the temporal feature representation. The bidirectional hidden states are fused along the temporal dimension to form a comprehensive feature sequence containing information from both preceding and following time steps.
[0069] S5: Attention enhancement mechanism.
[0070] In the model structure, the BiLSTM network first performs bidirectional encoding on the input dynamic temporal features, obtaining a hidden state sequence containing forward and backward temporal dependencies. The BiLSTM outputs 24 hidden states at each time step. The attention mechanism then introduces an attention scoring function to measure the importance of each hidden state at each time step to the current prediction task. An additive attention structure is used, calculating the attention score for each time step through a non-linear mapping, and then normalizing it to obtain the corresponding attention weight. The attention score is:
[0071] in, Score based on importance. Let be the hidden state at time step t. and These are the weight matrix and bias parameters in nonlinear mapping calculations. This is the trainable scoring parameter vector of the model; Subsequently, the model performs a weighted summation of the hidden states based on attention weights to construct a context vector. This context vector comprehensively reflects the most representative temporal features in the historical sequence. Experimental results show that the attention weights are significantly improved during key periods such as morning rush hour, midday load, and nighttime air conditioning switching. This indicates that the model can automatically focus on key time segments.
[0072] S6: Model training methods.
[0073] The dataset is divided into a training set (70%), a validation set (15%), and a test set (15%). Parameter settings are shown in Table 3.
[0074] Table 3 Model Parameter Settings
[0075] The loss function uses mean squared error (MSE), and the learning rate is dynamically adjusted. The EarlyStopping mechanism automatically stops training if the validation set error does not decrease for several consecutive rounds, preventing overfitting. The Dropout mechanism improves the model's generalization ability.
[0076] S6: Analysis of training results.
[0077] Loss convergence curve as shown Figure 3 As shown, the training loss decreases rapidly in the first 10 rounds. After the 25th round, the training and validation losses tend to stabilize. Early Stopping is triggered in the 38th round. The final training set loss is 0.0021, and the validation set loss is 0.0028.
[0078] This indicates that the model does not exhibit significant overfitting. The test set results are shown in Table 4.
[0079] Table 4 Test Set Results
[0080] The results show that compared with the traditional LSTM, the MAPE of this invention is reduced by 44.36%. This indicates that the dual-input fusion structure and the Attention mechanism significantly improve prediction accuracy. Through the synergistic effect of multi-source features, the model of this invention achieves lower error levels in RMSE, MAE, and multiple relative error metrics, with a lower coefficient of determination R0. 2 The prediction accuracy reached 0.79, and the overall prediction error exhibited a highly concentrated peak distribution near zero with no obvious systematic bias. Furthermore, the model avoided excessively high training costs while maintaining high prediction accuracy, resulting in low overall training time and demonstrating good feasibility for engineering implementation.
[0081] Figure 4The figure illustrates the scatter distribution relationship between the actual energy consumption values and the model predictions in this embodiment. The dashed line in the figure represents the reference line where the predicted value is completely consistent with the actual value under ideal prediction conditions. The overall distribution shows that most sample points are distributed near the diagonal, indicating a high consistency between the model prediction results and the actual energy consumption, and a good ability to capture the overall trend of building energy consumption changes. Especially in the low-to-medium load range, the predicted point cloud distribution is relatively concentrated with low dispersion, indicating that the model has relatively stable prediction performance under normal operating conditions. As the actual energy consumption level increases, the dispersion of the scatter distribution increases, with some high-load samples deviating on both sides of the diagonal. This phenomenon reflects that the model prediction error increases relatively during periods of large energy consumption fluctuations or sudden load changes. However, overall, the high-load samples still largely maintain a diagonal distribution, without a systematic overestimation or underestimation trend, indicating that the model still has a certain generalization ability under complex load scenarios. Combined with the quantitative evaluation indicators RMSE, MAE, and the coefficient of determination R², the scatter distribution results verify the effectiveness of the model constructed in this paper in terms of overall fitting accuracy and trend consistency.
[0082] Figure 5 The distribution of the prediction residuals in this embodiment is presented, and the statistical characteristics of the model's prediction error are analyzed. The residual is defined as the difference between the predicted and actual values. To avoid the impact of extreme outliers on the visualization, the residuals are truncated at high quantiles, showing only the main distribution intervals covering the vast majority of samples. From the residual histogram and the corresponding kernel density estimation results, it can be seen that the prediction residuals are highly concentrated near zero, exhibiting a clear peak distribution characteristic. The model can achieve relatively accurate predictions at most time points. Simultaneously, the residual distribution is basically symmetrical on both sides of zero, without showing obvious systematic shifts, indicating that the model does not exhibit significant overall overestimation or underestimation. Furthermore, the residual distribution still exhibits a certain degree of long-tail characteristics, reflecting relatively large prediction errors during a small number of high-load or energy consumption abrupt changes. This phenomenon is consistent with the aforementioned increase in the dispersion of scattered points in high-load intervals, indicating that extreme operating conditions remain one of the main sources affecting prediction accuracy. From the overall distribution, the prediction errors of most samples remain within a small range, and the model as a whole demonstrates good stability.
[0083] In summary, the predictive performance of the final model was evaluated from the perspective of overall distribution and statistical characteristics, and the prediction results were visualized and the error distribution was analyzed. Using two typical graphs—the scatter distribution of true and predicted values and the distribution of predicted residuals—the overall performance of the model across different load ranges was comprehensively evaluated from the perspectives of fit consistency and error structure.
[0084] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can integrate the operation of a building energy consumption prediction method with dual-input features.
[0085] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the building energy consumption prediction method integrating dual-input features in the above embodiments.
[0086] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0090] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0091] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0092] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Those skilled in the art can readily implement the present invention based on the accompanying drawings and the above description. However, any modifications, alterations, or variations made by those skilled in the art without departing from the scope of the present invention, utilizing the disclosed technical content, are equivalent embodiments of the present invention. Furthermore, any modifications, alterations, or variations made to the above embodiments based on the essential technology of the present invention are still within the protection scope of the present invention.
Claims
1. A building energy consumption prediction method integrating dual-input features, characterized in that, include: Obtain the historical running dataset of the building to be predicted; Based on the dual-input feature prediction model, the historical operation dataset of the building is input into the dual-input feature prediction model, and the predicted building energy consumption value is output, specifically: Static features are constructed by extracting static physical and environmental attributes from the historical operation dataset of the building, and dynamic time-series features are constructed by extracting meteorological and operational status time-series data. The discrete categorical variables in the static features are mapped to a continuous vector space by the embedding matrix to obtain the static feature embedding vector; The dynamic temporal features are organized in the form of a sliding time window, input into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step. An attention mechanism is used to calculate the attention weights at each time step in the hidden state sequence, and the hidden state sequence is weighted and summed based on the attention weights to obtain a dynamic temporal context vector. The static feature embedding vector and the dynamic temporal context vector are concatenated and fused. The concatenated and fused features are then input into a fully connected layer to output the predicted building energy consumption value for future time moments.
2. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, The static physical and environmental attributes include: building area, year of construction, building type, number of floors, building orientation, location, type of air conditioning system, window-to-wall ratio, building height, equipment density, regional climate type, and building occupancy rate; constructing a 12-dimensional static feature. The time-series data of meteorological and operational status includes: historical energy consumption, outdoor temperature, outdoor humidity, wind speed, weekday code, hourly code, chiller operating status, and fan frequency; the length of the sliding time window is set to 24.
3. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, The method of mapping discrete categorical variables in the static features to a continuous vector space using the embedding matrix is calculated as follows: ; In the formula, x is the one-hot encoded representation of the input discrete categorical variable. The embedding matrix parameters are initialized using Xavier, the mapping process uses the ReLU activation function, and the inactivation rate parameter is set to 0.
2.
4. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, The bidirectional long short-term memory network comprises a forward LSTM network and a backward LSTM network, with a network layer count of 2 and a unidirectional hidden layer dimension of 128. The specific gating and state update calculation process for a single time step is as follows: The gating calculation process is a forgetting gate: Input Gate: Candidate state: Status Update: Output gate: in, The input for the dynamic temporal characteristics at the current time step is... This is the hidden state from the previous time step. This is the cell state vector from the previous time step. For the current moment Updated current cell state vector; Here, is the Sigmoid activation function, and t is the time step. This is the output vector of the forget gate; The output vector of the input gate. Let be the candidate cell state vector at time t. The output vector of the output gate; This means concatenating and fusing the hidden state from the previous time step with the current input vector; , , , These are the weight matrices for the forget gate, input gate, candidate state calculation, and output gate, respectively. , , , These are the bias term vectors for the forget gate, input gate, candidate state calculation, and output gate, respectively. This involves multiplying each element individually.
5. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, The dynamic temporal features are organized in the form of sliding time windows, input into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step, specifically including: The dynamic temporal features are organized using a sliding time window of a preset length and input into a bidirectional long short-term memory network for bidirectional temporal encoding. The forward network extracts the cumulative impact of historical energy consumption and environmental changes on current energy consumption, while the reverse network uses contextual information from future time steps to supplement the temporal feature expression. The outputs of the forward and reverse networks are then fused to output the comprehensive hidden state sequence corresponding to each time step.
6. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, The attention weights at each time step in the hidden state sequence are calculated using an attention mechanism, specifically as follows: Importance scores are calculated using an additive attention mechanism, and the formula is as follows: in, Score based on importance. Let be the hidden state at time step t. and These are the weight matrix and bias parameters in nonlinear mapping calculations. This is the trainable scoring parameter vector of the model; The attention weight is obtained by normalizing the importance score.
7. The building energy consumption prediction method integrating dual-input features according to claim 1, characterized in that, Before performing prediction, the method further includes a closed-loop training iteration step on the parameters of the dual-input feature prediction model based on a pre-built public building energy consumption dataset: During the training iteration, mean squared error is used as the loss function, and gradient descent is performed using the Adam optimizer; the initial learning rate of the Adam optimizer is set to 0.
001. The closed-loop training iteration process also introduces an early stopping mechanism: during the training iteration, the error data of the validation set is continuously monitored, and when it is determined that the error data of the validation set does not decrease for a preset number of consecutive rounds, the early stopping mechanism is triggered to stop the closed-loop training iteration.
8. A building energy consumption prediction system integrating dual-input features, characterized in that, include: The data extraction module is used to acquire the historical operation dataset of the building to be predicted, extract the static physical and environmental attributes from the historical operation dataset to construct static features, and extract the time series data of meteorological and operational status to construct dynamic time series features. The prediction module is used to predict the building's energy consumption based on the established dual-input feature prediction model. The historical operating dataset of the building to be predicted is input into the dual-input feature prediction model, and the predicted building energy consumption value is output. The dual-input feature prediction model include: The static feature encoding module is used to construct a trainable embedding matrix, which maps the discrete category variables in the static features to a continuous vector space to obtain the static feature embedding vector. The temporal modeling module is used to organize the dynamic temporal features in the form of a sliding time window, input them into a bidirectional long short-term memory network for temporal modeling, and output the hidden state sequence corresponding to each time step. The attention mechanism module is used to calculate the attention weights at each time step in the hidden state sequence using an attention mechanism, and to perform a weighted summation on the hidden state sequence based on the attention weights to obtain a dynamic temporal context vector. The feature fusion and prediction module is used to concatenate and fuse the static feature embedding vector with the dynamic temporal context vector, input the concatenated and fused features into the fully connected layer in the dual-input feature prediction model, and output the building energy consumption prediction result.
9. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the building energy consumption prediction method that integrates dual-input features as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the building energy consumption prediction method that integrates dual-input features as described in any one of claims 1 to 7.