Building energy consumption prediction method based on LSTM-AM algorithm and FPGA hardware acceleration thereof
Through the LSTM-AM neural network algorithm and FPGA hardware acceleration technology, the problems of long calculation time and poor accuracy of existing building energy consumption prediction methods are solved, and high-performance, low-power consumption prediction of building energy consumption is achieved, which satisfies the requirements of complex control algorithms. and the application requirements of artificial intelligence algorithms in building controllers.
Patent Information
- Application Number
- CN202410736090.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-03
AI Technical Summary
Existing building energy consumption prediction methods take a long time to calculate and have poor accuracy, and the performance of traditional building controller hardware is insufficient to support the operation of complex control algorithms and artificial intelligence algorithms.
It uses the LSTM-AM neural network algorithm combined with FPGA hardware acceleration to achieve building energy consumption prediction through the ZYNQ architecture. It uses the double-layer LSTM and attention mechanism to enhance the prediction accuracy, and uses the parallel computing capabilities of the FPGA to achieve high-performance, low-power energy consumption. consumption forecast.
It significantly improves the accuracy and performance of building energy consumption prediction, reduces calculation time, and meets the application needs of complex control algorithms and artificial intelligence algorithms in building controllers.
Smart Images

Figure CN118586283A
Abstract
Description
Technical Field
[0001] The present invention relates to a building energy consumption prediction method based on an LSTM-AM algorithm and FPGA hardware acceleration thereof, and specifically relates to a building energy consumption prediction algorithm model constructed by using an LSTM-AM neural network, and a building energy consumption prediction method implementing the algorithm model by means of FPGA hardware acceleration, belonging to the field of building energy technology. Background Art
[0002] At present, the global energy crisis is prominent, environmental issues are increasingly attracting public attention, and energy conservation, emission reduction and sustainable development have become a consensus in academia. Building energy consumption accounts for one-third of the world's total energy consumption, and has been increasing in recent years. More than half of the energy consumption in buildings is used for cooling, heating and hot water supply in buildings, which varies greatly and is difficult to predict. The flexibility and elasticity issues in building energy use are becoming more and more important, and the importance of hourly scale building energy consumption forecasting has been further increased. Due to the limitations of hourly scale, accuracy and online linearity, data-driven energy consumption forecasting methods are widely recognized. Through accurate short-term (i.e., a few hours or a day) energy consumption forecasting of alternating current, the operation of the power system can be optimized and energy conservation can be achieved. On the other hand, due to the popularity of renewable energy and distributed energy systems, the complexity and volatility of energy supply are increasing, increasing the demand for balance between supply and demand. For buildings with multiple complex energy supply systems, it is necessary to formulate detailed and optimized operation strategies based on the energy consumption forecast on the demand side. Accurate construction of short-term energy consumption forecasts is conducive to the scheduling and peak regulation of the energy network, improving economy and reliability.
[0003] Some methods and challenges faced by the existing energy consumption prediction method system 1) The existing building energy consumption prediction method based on neural network is prone to long calculation time and poor prediction accuracy. 2) Traditional building controllers are mainly DDC and PLC, and the hardware processor performance is limited. When running complex control algorithms and artificial intelligence algorithms, they are often stretched and cannot meet the requirements of today's smart buildings for the hardware computing power of building controllers to run complex control algorithms and artificial intelligence algorithms.
[0004] Based on the first problem, the present invention proposes a building energy consumption prediction algorithm based on LSTM-AM neural network, which greatly improves the accuracy of building energy consumption prediction with less computing time consumption. For the second problem, a high-performance embedded device is needed that can realize the application of complex control algorithms and artificial intelligence algorithms in buildings on the edge side while satisfying the control of building terminal devices by traditional building controllers. The ZYNQ architecture of FPGA manufacturer Xilinx combines FPGA (PL end) and CPU (PS end) through the AXI4 bus protocol, and can use the characteristics of FPGA parallel computing to realize the scene of building energy consumption prediction algorithm with high computing power demand in a hardware acceleration manner. At the same time, the flexibility of FPGA can cope with different building energy consumption prediction scenarios, and the ARM-based CPU on the PS end can better handle tasks such as control, communication, and human-computer interaction interface. The present invention combines the building environment temperature and the historical building energy consumption data and uses the LSTM-AM algorithm model to realize the building energy consumption prediction. In the ZYNQ architecture, the heterogeneous acceleration method is used to realize the building energy consumption prediction algorithm based on the LSTM-AM neural network in a high-performance and low-power consumption manner to run in the ZYNQ-based building controller. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a building energy consumption prediction method based on an LSTM-AM neural network algorithm model and capable of running at high performance on a ZYNQ-based building controller through FPGA hardware acceleration.
[0006] The technical solution of the present invention is as follows:
[0007] A building energy consumption prediction method based on LSTM-AM algorithm and FPGA hardware acceleration thereof, characterized in that the steps are as follows:
[0008] S1. Collect and preprocess relevant data and construct a data set;
[0009] S1.1. Collect the total hourly energy consumption data of the building;
[0010] S1.2. Collect hourly indoor air temperature data of the building;
[0011] S1.3, pre-process the data collected in S1.1 and S1.2 to check whether there are any problems such as missing data and zeroing, and then divide the pre-processed data into training set, validation set and test set in proportion;
[0012] S2. Construct a building energy consumption prediction model;
[0013] S2.1, take the building hourly total energy consumption data and building hourly indoor air temperature data obtained in S1 as initial input;
[0014] S2.2, build LSTM-AM neural network algorithm model;
[0015] First, the LSTM layer is constructed. A double-layer LSTM is used to take the building hourly total energy consumption data and the building hourly indoor air temperature data as input for training and modeling. Then, the attention mechanism is introduced after the LSTM layer to construct the AM layer. The AM attention mechanism performs weighted attention processing on the time series data through the learned weights, focusing on the key content and giving it a greater weight, while giving smaller weights to other content. Through differentiated weight configuration methods, the LSTM-AM neural network algorithm model can be enhanced to focus on key information.
[0016] S2.3, training and evaluation process of LSTM-AM neural network algorithm;
[0017] The LSTM-AM neural network algorithm model is trained using the training set data, and the validation set is used to tune the LSTM-AM neural network algorithm model and select the best hyperparameter configuration; finally, the test set is used to evaluate the performance and accuracy of building energy consumption prediction using the LSTM-AM neural network algorithm model; the specific evaluation parameter is to calculate the mean absolute percentage error between the predicted value and the actual value of building energy consumption;
[0018] S2.4, export the parameters of the LSTM-AM neural network algorithm model;
[0019] The weight parameter w and bias parameter bias of the LSTM layer and AM layer are exported respectively as parameter input of the FPGA hardware accelerator;
[0020] S3, using the parallel computing capability of the FPGA on the PL side of ZYNQ to accelerate the computing of the LSTM-AM neural network algorithm model;
[0021] S3.1. Design FPGA engineering to obtain the acceleration module of LSTM-AM neural network algorithm model;
[0022] Design FPGA engineering, and obtain the acceleration module of LSTM-AM neural network algorithm model, including storage unit, computing unit and control unit;
[0023] The storage unit includes ram_in, ram_h, ram_c, and rom_weight, ram_in caches the data of the input gate, ram_h and ram_c cache the data of the output gate and the cell gate respectively, and rom_weight stores the parameters of the LSTM-AM neural network algorithm model;
[0024] The computing unit includes: lstm_cell operation module and am_cell operation module: (1) lstm_cell operation module: including four matrix point multiplication operation modules of forget gate f, input gate i, input gate g and output gate o, tanh_sigmoid module and multiplication and addition operation module; the four matrix point multiplication operation modules use matrix-vector multiplication to perform matrix point multiplication operation on the weight parameter w of the LSTM layer and the input vector of the LSTM-AM neural network algorithm model, and add the matrix point multiplication operation result and the LSTM layer bias parameter bias, so as to realize the parallel calculation of four matrix operations; the tanh_sigmoid module realizes the sigmoid and tanh functions in the form of exponential functions by looking up a table; the multiplication and addition operation module calculates the cell value ct and the output value ht at the current moment; (2) the am_cell operation module realizes the forward propagation process of the AM attention mechanism and obtains the output of the LSTM-AM neural network algorithm model;
[0025] The control unit includes an lstm_ctrl module and an am_ctrl module, which are used to send control signals to allow the FPGA hardware accelerator to sequentially read the weight parameter w and bias parameter bias of the LSTM layer and the AM layer and the input vector of the LSTM-AM neural network algorithm model, and sequentially complete the forward propagation calculation of the LSTM layer and the AM layer;
[0026] S3.2. Package the acceleration module of the LSTM-AM neural network algorithm model into an IP core;
[0027] Package the S3.1 FPGA project into an IP core and use the AXI-Lite bus protocol as the interface;
[0028] S3.3. Use the PS end of ZYNQ to call the acceleration module of the LSTM-AM neural network algorithm model;
[0029] Design the ZYNQ project, use the acceleration module of the LSTM-AM neural network algorithm model as an on-chip peripheral, mount it to the PS end through the AXI-Lite bus protocol, design a driver on the PS end, and implement data interaction with the acceleration module of the LSTM-AM neural network algorithm model through the AXI-Lite bus protocol;
[0030] Beneficial effects of the present invention: The present invention provides a method of combining the hourly total energy consumption data of a building with the hourly indoor air temperature data of a building and realizing building energy consumption prediction using an LSTM-AM neural network algorithm model, and utilizing FPGA hardware acceleration in a ZYNQ architecture to realize a building energy consumption prediction algorithm based on an LSTM-AM neural network and run it in a ZYNQ-based building controller in a high-performance manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 Flowchart of the building energy consumption prediction method based on LSTM-AM algorithm and its FPGA hardware acceleration
[0032] Figure 2 This is the structure diagram of the building energy consumption prediction model based on the LSTM-AM algorithm
[0033] Figure 3 System architecture diagram of building energy consumption prediction method based on LSTM-AM algorithm and its FPGA hardware acceleration
[0034] Figure 4 The test results of using LSTM algorithm single channel data input as the traditional energy consumption prediction algorithm
[0035] Figure 5 Test results of the improved energy consumption prediction algorithm using LSTM-AM algorithm dual-channel data input DETAILED DESCRIPTION
[0036] The specific implementation of the present invention is described in detail below in conjunction with the content of the invention and the accompanying drawings.
[0037] Refer to the attached Figure 1 , Figure 2 , Figure 3 The present invention provides a building energy consumption prediction method based on LSTM-AM algorithm and FPGA hardware acceleration thereof, which comprises the following steps:
[0038] A building energy consumption prediction method based on LSTM-AM algorithm and FPGA hardware acceleration thereof, characterized in that the steps are as follows:
[0039] S1. Collect and preprocess relevant data and construct a data set;
[0040] S1.1. Collect the total hourly energy consumption data of the building;
[0041] S1.2. Collect hourly indoor air temperature data of the building;
[0042] S1.3, pre-process the data collected in S1.1 and S1.2 to check whether there are any problems such as missing data and zeroing, and then divide the pre-processed data into training set, validation set, and test set in the ratio of 6:2:2;
[0043] S2. Construct a building energy consumption prediction model;
[0044] S2.1, take the building hourly total energy consumption data and building hourly indoor air temperature data obtained in S1 as initial input;
[0045] S2.2, build LSTM-AM neural network algorithm model;
[0046] First, the LSTM layer is constructed. A double-layer LSTM is used to take the building hourly total energy consumption data and the building hourly indoor air temperature data as input for training and modeling. Then, the attention mechanism is introduced after the LSTM layer to construct the AM layer. The AM attention mechanism performs weighted attention processing on the time series data through the learned weights, focusing on the key content and giving it a greater weight, while giving smaller weights to other content. Through differentiated weight configuration methods, the LSTM-AM neural network algorithm model can be enhanced to focus on key information.
[0047] S2.3, training and evaluation process of LSTM-AM neural network algorithm;
[0048] The LSTM-AM neural network algorithm model is trained using the training set data, and the validation set is used to tune the LSTM-AM neural network algorithm model and select the best hyperparameter configuration; finally, the test set is used to evaluate the performance and accuracy of building energy consumption prediction using the LSTM-AM neural network algorithm model; the specific evaluation parameter is to calculate the mean absolute percentage error between the predicted value and the actual value of building energy consumption;
[0049] S2.4, export the parameters of the LSTM-AM neural network algorithm model;
[0050] The weight parameter w and bias parameter bias of the LSTM layer and AM layer are exported respectively as parameter input of the FPGA hardware accelerator;
[0051] S3, using the parallel computing capability of the FPGA on the PL side of ZYNQ to accelerate the computing of the LSTM-AM neural network algorithm model;
[0052] S3.1. Design FPGA engineering to obtain the acceleration module of LSTM-AM neural network algorithm model;
[0053] Design FPGA engineering, and obtain the acceleration module of LSTM-AM neural network algorithm model, including storage unit, computing unit and control unit;
[0054] The storage unit includes ram_in, ram_h, ram_c, and rom_weight, ram_in caches the data of the input gate, ram_h and ram_c cache the data of the output gate and the cell gate respectively, and rom_weight stores the parameters of the LSTM-AM neural network algorithm model;
[0055] The computing unit includes: lstm_cell operation module and am_cell operation module: (1) lstm_cell operation module: including four matrix point multiplication operation modules of forget gate f, input gate i, input gate g and output gate o, tanh_sigmoid module and multiplication and addition operation module; the four matrix point multiplication operation modules use matrix-vector multiplication to perform matrix point multiplication operation on the weight parameter w of the LSTM layer and the input vector of the LSTM-AM neural network algorithm model, and add the matrix point multiplication operation result and the LSTM layer bias parameter bias, so as to realize the parallel calculation of four matrix operations; the tanh_sigmoid module realizes the sigmoid and tanh functions in the form of exponential functions by looking up a table; the multiplication and addition operation module calculates the cell value ct and the output value ht at the current moment; (2) the am_cell operation module realizes the forward propagation process of the AM attention mechanism and obtains the output of the LSTM-AM neural network algorithm model;
[0056] The control unit includes an lstm_ctrl module and an am_ctrl module, which are used to send control signals to allow the FPGA hardware accelerator to sequentially read the weight parameter w and bias parameter bias of the LSTM layer and the AM layer and the input vector of the LSTM-AM neural network algorithm model, and sequentially complete the forward propagation calculation of the LSTM layer and the AM layer;
[0057] S3.2. Package the acceleration module of the LSTM-AM neural network algorithm model into an IP core;
[0058] Package the S3.1 FPGA project into an IP core and use the AXI-Lite bus protocol as the interface;
[0059] S3.3. Use the PS end of ZYNQ to call the acceleration module of the LSTM-AM neural network algorithm model;
[0060] Design the ZYNQ project, use the acceleration module of the LSTM-AM neural network algorithm model as an on-chip peripheral, mount it to the PS end through the AXI-Lite bus protocol, design a driver on the PS end, and implement data interaction with the acceleration module of the LSTM-AM neural network algorithm model through the AXI-Lite bus protocol;
[0061] The LSTM algorithm single-channel data input is used as the traditional energy consumption prediction algorithm and the LSTM-AM algorithm dual-channel data input is used as the improved energy consumption prediction algorithm. The model is tested using the test set, and MAPE and MSE are used as indicators to evaluate the performance of the algorithm model. The experimental results are obtained using Figure 4 , Figure 5The traditional energy consumption prediction algorithm has a MAPE of 25.6% and an MSE of 102.4, while the improved energy consumption prediction algorithm has a MAPE of 14.7% and an MSE of 39.2. It can be concluded that compared with the traditional energy consumption prediction algorithm, the improved energy consumption prediction algorithm has significantly improved accuracy.
[0062] In order to verify the acceleration performance of the FPGA accelerator, different hardware platforms are used to implement the forward propagation calculation process of the LSTM-AM neural network algorithm model. The CPU-X64 uses the Intel Core i7-6700HQ processor with a main frequency of 2.6GHz; the CPU-ARM uses the Zhengdian Atom MP157 development board, the main control is STM32MP157DAA1, and the main frequency is 800MHz; the FPGA uses the Zhengdian Atom Navigator development board, the main control model is XC7Z020CLG400-2, and the operating frequency of the FPGA after the hardware accelerator is integrated can reach 200MHz. Table 1 shows the running time of the forward propagation of the LSTM-AM neural network algorithm model implemented on different hardware platforms.
[0063] Table 1 Performance comparison of LSTM-AM neural network algorithm model running on each platform
[0064]
[0065] As you can see, compared to Core i7-6700HQ, FPGA can achieve 19 times the speed improvement. Compared to STM32MP157, FPGA can achieve 501 times the speed improvement.
[0066] The above results prove that: 1) Using the LSTM-AM algorithm and using dual-channel data input as an improved energy consumption prediction algorithm can improve the accuracy of building energy consumption prediction compared to the LSTM algorithm with single-channel data input as a traditional energy consumption prediction algorithm. 2) Using FPGA hardware acceleration module can achieve performance improvement compared to CPU.
Claims
1. A building energy consumption prediction method based on LSTM-AM algorithm and its FPGA hardware acceleration, It is characterized in that Here are the steps: S1. Collect and preprocess relevant data and construct a data set; S1.
1. Collect the total hourly energy consumption data of the building; S1.
2. Collect hourly indoor air temperature data of the building; S1.3, pre-process the data collected in S1.1 and S1.2 to check whether there are any problems such as missing data and zeroing, and then divide the pre-processed data into training set, validation set and test set in proportion; S2. Construct a building energy consumption prediction model; S2.1, take the building hourly total energy consumption data and building hourly indoor air temperature data obtained in S1 as initial input; S2.2, build LSTM-AM neural network algorithm model; First, the LSTM layer is constructed. A double-layer LSTM is used to take the building hourly total energy consumption data and the building hourly indoor air temperature data as input for training and modeling. Then, the attention mechanism is introduced after the LSTM layer to construct the AM layer. The AM attention mechanism performs weighted attention processing on the time series data through the learned weights, focusing on the key content and giving it a larger weight, while giving smaller weights to other content. Through differentiated weight configuration methods, the LSTM-AM neural network algorithm model can be enhanced to focus on key information. S2.3, training and evaluation process of LSTM-AM neural network algorithm; The LSTM-AM neural network algorithm model is trained using the training set data, and the validation set is used to tune the LSTM-AM neural network algorithm model and select the best hyperparameter configuration; finally, the test set is used to evaluate the performance and accuracy of building energy consumption prediction using the LSTM-AM neural network algorithm model; the specific evaluation parameter is to calculate the mean absolute percentage error between the predicted value and the actual value of building energy consumption; S2.4, export the parameters of the LSTM-AM neural network algorithm model; The weight parameter w and bias parameter bias of the LSTM layer and AM layer are exported respectively as parameter input of the FPGA hardware accelerator; S3, using the parallel computing capability of the FPGA on the PL side of ZYNQ to accelerate the computing of the LSTM-AM neural network algorithm model; S3.
1. Design FPGA engineering to obtain the acceleration module of LSTM-AM neural network algorithm model; Design FPGA engineering, and obtain the acceleration module of LSTM-AM neural network algorithm model, including storage unit, computing unit and control unit; The storage unit includes ram_in, ram_h, ram_c, and rom_weight, ram_in caches the data of the input gate, ram_h and ram_c cache the data of the output gate and the cell gate respectively, and rom_weight stores the parameters of the LSTM-AM neural network algorithm model; The computing unit includes: lstm_cell operation module and am_cell operation module: (1) lstm_cell operation module: including four matrix point multiplication operation modules of forget gate f, input gate i, input gate g and output gate o, tanh_sigmoid module and multiplication and addition operation module; the four matrix point multiplication operation modules use matrix-vector multiplication to perform matrix point multiplication operation on the weight parameter w of the LSTM layer and the input vector of the LSTM-AM neural network algorithm model, and add the matrix point multiplication operation result and the LSTM layer bias parameter bias, so as to realize the parallel calculation of four matrix operations; the tanh_sigmoid module realizes the sigmoid and tanh functions in the form of exponential functions by looking up a table; the multiplication and addition operation module calculates the cell value ct and the output value ht at the current moment; (2) the am_cell operation module realizes the forward propagation process of the AM attention mechanism and obtains the output of the LSTM-AM neural network algorithm model; The control unit includes an lstm_ctrl module and an am_ctrl module, which are used to send control signals to allow the FPGA hardware accelerator to sequentially read the weight parameter w and bias parameter bias of the LSTM layer and the AM layer and the input vector of the LSTM-AM neural network algorithm model, and sequentially complete the forward propagation calculation of the LSTM layer and the AM layer; S3.
2. Package the acceleration module of the LSTM-AM neural network algorithm model into an IP core; Package the S3.1 FPGA project into an IP core and use the AXI-Lite bus protocol as the interface; S3.
3. Use the PS end of ZYNQ to call the acceleration module of the LSTM-AM neural network algorithm model; Design the ZYNQ project, use the acceleration module of the LSTM-AM neural network algorithm model as an on-chip peripheral, mount it to the PS end through the AXI-Lite bus protocol, design a driver on the PS end, and implement data interaction with the acceleration module of the LSTM-AM neural network algorithm model through the AXI-Lite bus protocol.
Citation Information
Cited By
Method for constructing explainable urban building energy consumption model integrating inter-building effect
CN119719818A
Gas drive front description method based on multi-modal fusion deep learning model
CN121479527A
A method for describing gas drive front based on multi-modal fusion deep learning model
CN121479527B
