Building cooling and heating load accurate prediction method based on double attention mechanisms and novel particle swarm optimization
By introducing dual attention mechanism and new particle swarm algorithm into building cooling and heating load forecasting, combined with BiLSTM neural network and CEEMD decomposition technology, the problem of insufficient load forecasting accuracy in the existing technology is solved, and more efficient energy utilization and More accurate load forecasting.
Patent Information
- Application Number
- CN202410644532.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-10-18
AI Technical Summary
The existing technology has insufficient accuracy in building cooling and heating load prediction, resulting in excessive heating and cooling, resulting in energy waste.
A building cooling and heating load prediction method based on a dual attention mechanism and a new particle swarm algorithm is adopted. The BiLSTM neural network is combined with the GA-SA improved particle swarm algorithm for hyperparameter optimization, and CEEMD decomposition technology is used to build an error correction model to improve prediction accuracy. .
It significantly improves the accuracy of building cooling and heating load forecasting, reduces energy waste, achieves more accurate load forecasting, and reduces model errors.
Smart Images

Figure CN118797566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of load forecasting, and in particular to a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm. Background Art
[0002] The field of load forecasting uses data-driven methods to make forecasts by introducing neural networks and artificial intelligence algorithms, which is more flexible and adaptive than traditional model-driven methods. However, the immaturity of hot and cold load forecasting technology often leads to the inability to accurately predict future loads, resulting in excessive heating and cooling, and a large amount of energy waste. How to accurately achieve load forecasting is an important research goal to achieve energy conservation and emission reduction and avoid energy waste. Summary of the invention
[0003] In order to overcome the above shortcomings, the present invention proposes a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a new particle swarm algorithm. Compared with the traditional LSTM neural network prediction technology, the method adopts a bidirectional long short-term memory network (BiLSTM) to better capture the long-term dependency of data, and uses the Pearson correlation coefficient method to achieve data simplification and dimensionality reduction. The channel and space dual attention mechanisms are used to assign different weights to the input features of the reduced-dimensional data. The GA-SA improved particle swarm algorithm is used to optimize the hyperparameters of the neural network, and the CEEMD decomposition technology and the BiLSTM neural network are further used to build an error correction model, which greatly improves the prediction accuracy.
[0004] The present invention proposes a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm, and the steps are as follows: Step 1, obtain the historical cooling and heating load data of the building and the relevant external influencing factor data, and pre-process the obtained data; the relevant external influencing factor data include indoor temperature, outdoor temperature, outdoor wind speed, relative humidity, precipitation in the past 3 hours, solar radiation rate, building utilization rate, personnel density, equipment lighting and other influencing factors and corresponding time series data; Step 2: Using the external influencing factor data and historical load data preprocessed in step 1 as input features and output features, respectively, a short-term building cooling and heating load prediction model is constructed based on the BiLSTM neural network; Step 3: Based on the input features of step 2 and the BiLSTM neural network architecture, a dual attention mechanism is introduced to assign different inertia weights to the hidden state and input features of the BiLSTM output respectively. Step 4: Based on the BiLSTM neural network architecture in step 2, the hyperparameters are optimized using the new particle swarm algorithm improved by GA-SA. The specific steps include: Add the crossover and mutation operation of the genetic algorithm to the particle swarm algorithm to obtain the processed particle swarm algorithm; In the processed particle swarm algorithm, a probability jump operation of the annealing algorithm is added to obtain an updated particle swarm algorithm; The number of training times, learning rate and number of neurons are used as optimization conditions, and the updated particle swarm algorithm is used to perform hyperparameter optimization processing to obtain optimization results. Step 5, based on the load prediction results obtained by the building cooling and heating load prediction model optimized in Steps 3 and 4, an error correction model is formed using CEEMD decomposition technology and BiLSTM neural network; In step 6, the obtained prediction results are used as the evaluation indicators of the accurate prediction model of building cooling and heating loads. The root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and model prediction accuracy (ACC) are used to evaluate the performance and assess the model prediction performance.
[0005] Preferably, the step 1 preprocesses the data, characterized in that the preprocessing includes: correlation analysis between external influencing factor data and historical load data, missing value processing of load data, outlier correction, and normalization processing.
[0006] Preferably, the correlation analysis between the external influencing factor data and the historical load data is characterized by using the Pearson correlation coefficient method to calculate the correlation between the external influencing factor and the historical load data, and preliminarily screening out influencing factors with a correlation degree less than 0.2 such as air pressure and relative humidity to achieve data dimensionality reduction and simplification, and reduce the complexity of the data set. The formula is as follows: Among them, the r value ranges from -1 to 1, and the closer the absolute value is to 1, the stronger the correlation between variables.
[0007] Preferably, the missing value processing of the historical load data is characterized by judging the missing value ratio. When the ratio is less than 5%, the nearest mean substitution method is used to perform weighted averaging of normal data before and after the missing value to fill the missing value. When the ratio is greater than 5%, the random forest method is used to perform multiple interpolation to fill the missing value. The formula using the nearest mean substitution method is as follows: in, is the replacement value for missing values, X j is the value of the neighboring data point j, w j is the weight of data point j, and n is the number of adjacent points selected.
[0008] Preferably, the correction of outliers in the data is characterized by using the quartile method to identify undersized and oversized values in the original data, and using the adjacent mean substitution method to correct the identified outliers in the data. The formula for the quartile method is as follows: IQR=Q3-Q1 MAX=Q3+1.5IQR MIN=Q1-1.5IQR Among them, Q3 is the upper quartile of the top of the box, and Q1 is the lower quartile of the bottom of the box. MAX and MIN are the upper and lower bounds of the outliers, and outlier correction is performed on the values that fall outside the upper and lower bounds.
[0009] Preferably, the normalization processing of the data is characterized by adopting the Min-max normalization method, and the formula is as follows: Among them, x nom is the normalized data, x is the original data before normalization, max(x) and min(x) are the maximum and minimum values of all data of the current element respectively.
[0010] Preferably, in step 2, the data is divided into input features and output features, characterized in that the external influencing factor data is used as input data, and X i (i=1, 2, 3…n, n is the input feature dimension), the output feature is the historical load data Y, and the input set and the output set are divided into training set, test set and validation set in the ratio of 7:2:1, and enter the BiLSTM neural network for training.
[0011] Preferably, the BiLSTM load forecasting model in step 2 is characterized in that it is a variant of the LSTM neural network that combines the two information flows of forward and directional. By splicing the hidden states of the forward and directional directions together, it can more comprehensively understand and capture the bidirectional dependency between input features and data, effectively improving the prediction model's ability to express the features of the input data.
[0012] Preferably, the load forecasting model constructed in step 2 is characterized in that it is trained using training set data, and the load forecasting results are verified using test set and validation set data. The error between the model and the original data is large, and the model is a non-stationary sequence with strong randomness and poor periodicity.
[0013] Preferably, the load forecasting model constructed in step 2 is characterized in that the predicted load forecasting result needs to be denormalized, and the formula is as follows: x=x' nom (max(x)-min(x))+min(x)
[0014] Preferably, in step 3, a dual attention mechanism is introduced to weight the input features of the BiLSTM load forecasting model, characterized in that the specific steps are: The channel attention mechanism is used to focus on different channels (features) of the input data, and different inertia weights Mc are assigned to different features in the historical load data, that is, the external influencing factor data; The spatial attention mechanism is used to focus on different positions of the input data, that is, different inertia weights Ms are assigned to the information at different time points of the historical load data.
[0015] Preferably, the channel attention mechanism pays attention to different channels (features) of the input data, and is characterized in that the main formula is as follows: Mc=σ(W c h t +b c ) Among them, Mc is the calculated channel attention weight vector, h + 、h - are the forward and reverse hidden states of the BiLSTM model, is the corresponding weight matrix, b n is the bias matrix, W c , b c are the weight matrix and bias vector of the fully connected layer respectively
[0016] Preferably, the spatial attention mechanism pays attention to different positions of the input data, and is characterized in that the main formula is as follows: Ms=softmax(W s h t ) Among them, Ms is the calculated spatial attention weight vector, and the softmax function is used to convert W s h t The elements in are normalized to the attention weights, W s is the learned parameter matrix.
[0017] Preferably, in step 4, a crossover and mutation operation of a genetic algorithm is added to the particle swarm algorithm, characterized in that the specific steps are: Initialize design parameters, calculate the fitness of particles and select parent particles according to the fitness; Randomly select two parent particles for crossover operation, and perform mutation operation on the child solution generated after crossover; Recalculate the fitness of the offspring particles, replace the particles with low fitness in the original particles, perform iterative optimization according to the set number of iterations, and finally obtain the updated particle population.
[0018] Preferably, in step 4, in the processed particle swarm algorithm, a probability jump operation of an annealing algorithm is added, characterized in that the specific steps are: Randomly initialize the speed and position of the particles, calculate the position of each particle and the global optimal position; Calculate the annealing algorithm fitness of the individual optimal particle at the current set temperature, and then randomly select to replace the global optimal particle; Update the speed and position of the particles, calculate the fitness of each particle, determine whether the particle is better, and then determine whether to perform annealing operation; If the termination condition is met, the optimal solution is obtained. If the condition is not met, the iteration is continued and the annealing algorithm fitness of each particle is recalculated.
[0019] Preferably, in step 4, the fitness of the annealing algorithm of the individual optimal particle at the current set temperature is calculated, and then the global optimum is randomly selected to replace it, characterized in that the loss value function predicted by the model is used as the fitness function of the annealing algorithm, and the formula is: in, y are the predicted value and actual value of load forecast respectively.
[0020] Preferably, in step 4, the optimal solution is obtained by satisfying the termination condition, wherein the termination condition uses whether the annealing temperature reaches the minimum temperature, whether the number of iterations reaches the maximum value, or the convergence of the fitness value as a criterion.
[0021] Preferably, in step 5, the error correction model is formed by using CEEMD decomposition technology and BiLSTM neural network, characterized in that the specific steps are: Add Gaussian white noise to the original signal to construct a disturbance signal; Perform EMD decomposition on each disturbance signal to obtain the corresponding IMF component and residual signal Res; Repeat adding Gaussian white noise and performing EMD decomposition on the disturbance signal n times, calculate the integrated average of IMF, and obtain the final decomposition result; Each decomposed error component is input into the pre-established BiLSTM model for prediction, and the final load forecast result is obtained after accumulation.
[0022] Preferably, in step 5, the CEEMD decomposition technology and the BiLSTM neural network are used to form an error correction model, characterized in that the main formula is as follows: Where: x i (t) is the original data, is the random same positive and negative white noise added, is the i-th mixed signal with positive and negative white noise added, is the jth IMF component after adding positive and negative white noise decomposition, is the corresponding residual component.
[0023] Preferably, the BiLSTM neural network model evaluation index is constructed according to the prediction results to evaluate the model prediction performance, which is characterized by using root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and model prediction accuracy (ACC) for performance evaluation, and the formula is as follows: Among them, RMSE is the mean square error, MAE is the mean absolute error, MAPE is the mean absolute percentage error, ACC is the model prediction accuracy, N is the number of samples, y i is the true value corresponding to sample i, p i The predicted value obtained by the final optimized prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a flow chart of a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm.
[0025] Figure 2 Schematic diagram of the load forecasting model design process in the embodiment of the present invention
[0026] Figure 3 Schematic diagram of the GA-SA improved particle swarm algorithm process in the embodiment of the present invention DETAILED DESCRIPTION
[0027] In order to make the technical solutions in the embodiments of the present invention better understood by the persons skilled in the art, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. In the description process, the described embodiments are only used to explain the present application and are not used to limit the scope of the present application.
[0028] In the embodiment of the present application, a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm is provided. Figure 1 As shown, the following steps are included:
[0029] Step 1, obtain the historical cooling and heating load data of the building and the relevant external influencing factor data, and pre-process the obtained data; the relevant external influencing factor data include indoor temperature, outdoor temperature, outdoor wind speed, relative humidity, precipitation in the past 3 hours, solar radiation rate, building utilization rate, personnel density, equipment lighting and other influencing factors and corresponding time series data;
[0030] Furthermore, in step 1, the required historical cooling and heating loads and their corresponding time series and external influencing factor data are collected at 1 hour intervals. The external influencing factor data may also be other related factors not mentioned in this embodiment, and may be adjusted according to actual conditions.
[0031] Furthermore, in step 1, the data is preprocessed, and the specific steps are: S101. Conduct correlation analysis on external influencing factors and historical load data to reduce data dimension; S102, performing missing value processing on load data; S103, identifying outliers and correcting them; S104, normalizing each data; S105. Select a time step, extract the time series features of the data using a sliding window, and obtain target data.
[0032] Furthermore, in step S101, a correlation analysis is performed on the external influencing factors and the historical load data. The method is the Pearson correlation coefficient method, and the correlation between the external influencing factors and the historical load data is calculated. The influencing factors with a correlation degree less than 0.2 are initially screened and eliminated to achieve data dimensionality reduction and simplification, thereby reducing the complexity of the data set. The formula is as follows: Among them, the r value ranges from -1 to 1, and the closer the absolute value is to 1, the stronger the correlation between variables.
[0033] Furthermore, in step 102, the missing value ratio is determined. When the ratio is less than 5%, the nearest mean substitution method is used to perform weighted averaging of normal data before and after the missing value to fill in the missing value. When the ratio is greater than 5%, the random forest method is used to perform multiple interpolation to fill in the missing value. The formula for the nearest mean substitution method is: in, is the replacement value for missing values, X jis the value of the neighboring data point j, w j is the weight of data point j, and n is the number of adjacent points selected.
[0034] Furthermore, in step 103, the quartile method is used to identify the undersized and oversized values in the original data, and the adjacent mean substitution method is used to correct the identified data outliers. The formula for the quartile method is: IQR=Q3-Q1 MAX=Q3+1.5IQR MIN=Q1-1.5IQR Among them, Q3 is the upper quartile of the top of the box, and Q1 is the lower quartile of the bottom of the box. MAX and MIN are the upper and lower bounds of the outliers, and outlier correction is performed on the values that fall outside the upper and lower bounds.
[0035] Furthermore, in step S104, the data is normalized using the Min-max normalization method, and the formula is as follows: Among them, x nom is the normalized data, x is the original data before normalization, max(x) and min(x) are the maximum and minimum values of all data of the current element respectively.
[0036] Furthermore, in step S105, 7 days can be selected as a time step to predict the load of the next day or 10 hours can be selected as a step to predict the load required for the next two hours. A fixed-size sliding window is created with the arbitrarily selected time step to realize feature extraction, and the window is moved with the selected time step until the window covers the entire time series data.
[0037] Step 2: Using the external influencing factor data and historical load data preprocessed in step 1 as input features and output features respectively, a short-term building cooling and heating load prediction model is constructed based on the BiLSTM neural network;
[0038] Furthermore, in step 2, the input feature and output feature are represented by x and y respectively, and the input set and the output set are divided into a training set, a test set and a validation set in a ratio of 7:2:1 and input into the BiLSTM neural network for training; wherein the output feature y is a one-dimensional historical load data set, and the input feature x is represented in the following matrix: Among them, T represents the time step, D represents the feature dimension, and any x t,d It is represented as a feature value with time steps t and feature dimension d.
[0039] Furthermore, in step 2, the BiLSTM load forecasting model is a variant of the LSTM neural network that combines the two information flows of forward and directional information. By splicing the hidden states of the forward and directional information flows together, it can more comprehensively understand and capture the bidirectional dependency between input features and data, effectively improving the prediction model's ability to express the features of the input data.
[0040] Furthermore, in step 2, the BiLSTM load forecasting model is built using matlab software, and the external influencing factor data with input feature dimension D and output feature dimension 1 are imported after preprocessing. After data tiling and format conversion, the data are input into the training model to complete the forecast. The load forecasting results of the test set and validation set obtained by simulation have a large error with the original data, which is a non-stationary sequence with strong randomness and poor periodicity.
[0041] Furthermore, in step 2, the load forecasting result needs to be denormalized using the following formula: x=x' nom (max(x)-min(x))+min(x)
[0042] Step 3: Based on the input features of step 2 and the BiLSTM neural network architecture, a dual attention mechanism is introduced to assign different inertia weights to the hidden state and input features of the BiLSTM output respectively.
[0043] Furthermore, in step 3, the dual attention mechanism is constructed as a channel attention mechanism and a spatial attention mechanism, which are respectively used to focus on important information of different channels and different time steps in the sequence, thereby improving the performance and generalization ability of the model through weight distribution.
[0044] Furthermore, in step 3, the channel attention mechanism is used to focus on different channels (features) of the input data, and different inertia weights Mc are assigned to different features in the historical load data, i.e., external influencing factor data. The main formula is as follows: Mc=σ(W c h t +b c ) Among them, Mc is the calculated channel attention weight vector, h + 、h - They are the forward and reverse hidden states of the BiLSTM model, is the corresponding weight matrix, b n is the bias matrix, W c 、b c are the weight matrix and bias vector of the fully connected layer respectively
[0045] Furthermore, in step 3, the specific steps of applying the channel attention mechanism to the BiLSTM neural network are: The input sequence is input into the BiLSTM network for training. After bidirectional processing by the BiLSTM network, the hidden state representation such as the feature information learned in two directions of the input sequence is obtained in each hidden layer. Perform maximum pooling and average pooling operations on the bidirectional hidden state, summarize the features of each channel, and obtain global information; The global information is input into the fully connected layer, the attention weight of each channel is calculated, and the sigmoid activation function is used for normalization; The obtained attention weights are used to perform weighted updates on the input features to obtain scaled new features.
[0046] Furthermore, in step 3, the spatial attention mechanism is used to focus on different positions of the input data, that is, different inertia weights Ms are assigned to the information at different time points of the historical load data. The main formula is as follows: Ms=softmax(W s h t ) Among them, Ms is the calculated spatial attention weight vector, and the softmax function is used to convert W s h t The elements in are normalized to the attention weights, W s is the learned parameter matrix.
[0047] Furthermore, in step 3, the specific steps of applying the spatial attention mechanism to the BiLSTM neural network are: The input sequence is input into the BiLSTM network for training. After bidirectional processing by the BiLSTM network, the long-term dependencies and contextual connections of the data are effectively captured, and the corresponding hidden sequence is generated. The hidden state sequence is mapped using a multi-layer perceptron and normalized using the softmax function to obtain the standardized spatial attention weight; The obtained attention weights are used to perform weighted updates on the hidden state sequence to obtain scaled new features.
[0048] Step 4: Based on the BiLSTM neural network architecture in step 2, the hyperparameters are optimized using the new particle swarm algorithm improved by GA-SA.
[0049] Further, in step 4, the A-SA improved novel particle swarm algorithm comprises the following specific steps: S401, adding a crossover and mutation operation of a genetic algorithm to a particle swarm algorithm to obtain a processed particle swarm algorithm; S402, adding a probability jump operation of an annealing algorithm to the processed particle swarm algorithm to obtain an updated particle swarm algorithm; S403, taking the number of training times, learning rate, and number of neurons as optimization conditions, using the updated particle swarm algorithm to perform hyperparameter optimization processing to obtain an optimization result.
[0050] Furthermore, in step S401, by adding the crossover operation of the genetic algorithm, it helps the population to continuously evolve and find better solutions, increases the diversity and global search capability of the algorithm, avoids the defect of the particle swarm algorithm falling into the local optimum too early, and improves the optimization effect.
[0051] Furthermore, in step S401, the specific steps are: S4011, initialize the population size and design parameters, and calculate the fitness of the particles; S4012. Screening out multiple parent particles according to the particle fitness; S4013, randomly select two parent generation particles to perform a crossover operation, and perform a mutation operation on the child generation solution generated after the crossover; S4014, recalculate the fitness, replace the original particles with low fitness, and continuously perform iterative optimization to obtain an updated population.
[0052] Furthermore, in step S4011, the parameters to be designed include: population size, chromosome length, number of iterations, particle dimension, inertia weight, c1, c2, selection of genetic algorithm, crossover and mutation probability.
[0053] Furthermore, in step S4011, the fitness function is used to calculate the fitness of the particle, and one particle corresponds to one fitness value.
[0054] Furthermore, in step S4012, the particles need to be sorted first, and sorted according to the calculated fitness values, with the particles with high fitness at the front and the particles with low fitness at the back. Screening multiple parent particles means screening the particles with high fitness at the front half.
[0055] Furthermore, in step S4013, single-point crossover and single-point mutation are performed on two randomly selected parent particles, and the mutation process is a random mutation, which helps to increase the diversity of solutions.
[0056] Furthermore, in step S4014, the fitness of the new particles after the mutation crossover is recalculated, the original particles with low fitness are replaced, and iterative optimization is performed according to a preset number of iterations. Finally, some particles with low fitness are eliminated according to the set selection probability to obtain a new particle population.
[0057] Furthermore, in step S402, the specific steps are: S4021 sets the initial parameters of the particle population, randomly initializes the speed and position of the particles, and calculates the position of each particle and the global optimal position; S4022 calculates the annealing algorithm fitness of the individual optimal particle at the current set temperature, and then randomly selects a replacement for the global optimal particle; S4023 updates the speed and position of the particles, calculates the fitness of each particle, updates the individual optimal position and the population optimal position, and performs annealing operation; S4024 satisfies the termination condition and obtains the optimal solution. If the condition is not met, the iteration continues and the annealing algorithm fitness of each particle is recalculated.
[0058] Furthermore, in step S402, by adding the probability jump operation of the annealing algorithm, a local optimal solution can be jumped out with a certain probability, thereby further strengthening the global search capability of the algorithm and improving the accuracy of finding the optimal solution.
[0059] Furthermore, in step S4021, the particle population is an updated particle population obtained after crossover and mutation processing by the genetic algorithm, and the initialization parameters include the annealing speed, minimum temperature, and initial temperature of the annealing algorithm in addition to the parameters of the aforementioned particle population.
[0060] Furthermore, in step S4022, the global optimal solution obtained by the particle swarm algorithm may fall into the local optimal solution. By calculating the fitness function of the annealing algorithm, the individual optimal particles replace the global optimal particles, and the calculation is continuously updated to avoid falling into the local optimal solution and introduce a better solution. The fitness function of the annealing algorithm can be designed as a loss function value, and the formula is: in, y are the predicted value and actual value of load forecast respectively.
[0061] Furthermore, in step S4023, the fitness value of the updated particle is calculated. If the new particle is better than the previous generation, it is directly accepted as the next generation particle and annealed according to the set annealing speed. If it is not better than the previous generation particle, the acceptance probability P is calculated. If the acceptance probability P is greater than rand(0,1), annealing and cooling are still accepted. Otherwise, the next round of particle speed and position update is not accepted. The calculation formula of the acceptance probability P is: Among them, △f is the difference in fitness between the new solution and the original solution, and T is the temperature of the current state.
[0062] Furthermore, in step S4023, the acceptance probability P is set. When the new solution is not better, the new solution is still accepted with a certain probability, which helps to avoid falling into the local optimal trap. The random probability makes the algorithm more flexible and increases the exploration ability of the algorithm.
[0063] Furthermore, in step S4024, whether the temperature reaches the minimum temperature, whether the number of iterations reaches the maximum value, or the fitness value converges is used as a termination condition to determine whether the iteration is terminated.
[0064] Furthermore, in step S403, the boundary conditions of the particle swarm algorithm are set, and the particle swarm algorithm is improved through the mutation crossover of the genetic algorithm and the probability jump of the annealing algorithm, and the hyperparameter optimization is performed with the number of training times, learning rate, and number of neurons as optimization targets to improve the model performance.
[0065] Step 5, based on the load prediction results obtained by the building cooling and heating load prediction model optimized in Steps 3 and 4, an error correction model is formed using CEEMD decomposition technology and BiLSTM neural network;
[0066] Furthermore, in step 5, the steps of building an error correction model are: S501 uses CEEMD decomposition technology to reduce the noise of prediction errors; S502 performs BiLSTM prediction on the decomposed IMF components and accumulates them to obtain error prediction values; S503 adds the initial prediction value and the accumulated error prediction value to obtain the final prediction result.
[0067] Furthermore, in step S501, the CEEMD decomposition technique introduces an integrated method based on the EMD adaptive decomposition to improve the stability and robustness of the EMD. Specifically, it includes: reconstructing the original signal multiple times, performing EMD decomposition on each reconstructed signal, repeating the above steps, performing different reconstructions and decompositions, and calculating the integrated average of IMF. The CEEMD decomposition formula is as follows: Where: x i (t) is the original data, is the random same positive and negative white noise added, is the i-th mixed signal with positive and negative white noise added, is the jth IMF component after adding positive and negative white noise decomposition.
[0068] Furthermore, in step S501, the prediction error is denoised using CEEMD decomposition technology, and the smoothness of the decomposition result is controlled by introducing a smoothing regularization term, so that the non-stationary prediction result with strong randomness and poor periodicity is decomposed into multiple IMF components, so that the change trend of each IMF component tends to be smooth, thereby reducing the unstationary characteristics of the error sequence.
[0069] Furthermore, in step S502, a BiLSTM prediction model is established for each decomposed error component, which solves the problem of modal aliasing and improves the accuracy of prediction. Finally, the prediction results of each component are accumulated to obtain the error prediction value.
[0070] In step 6, the obtained prediction results are used as the evaluation indicators of the accurate prediction model of building cooling and heating loads. The root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and model prediction accuracy (ACC) are used to evaluate the performance and assess the model prediction performance.
[0071] Furthermore, in step 6, the main formula for evaluating model performance is as follows: Among them, RMSE is the mean square error, MAE is the mean absolute error, MAPE is the mean absolute percentage error, ACC is the model prediction accuracy, N is the number of samples, y i is the true value corresponding to sample i, p i The predicted value obtained by the final optimized prediction model.
[0072] In summary, the embodiments of the present invention provide a method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a new particle swarm algorithm. The influence rate of important information is increased by weight allocation of the attention mechanism, and the hyperparameter optimization of the new particle swarm algorithm is used to find the optimal model, thereby improving the prediction accuracy and generalization ability of the model.
[0073] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the processes in the accompanying drawings are not necessarily required for implementing the present invention.
[0074] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Simple modifications, equivalent substitutions, improvements, etc. made by technicians in this technical field on this basis should all be included in the protection scope of the present invention.
Claims
1. A method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm, comprising the following steps: Step 1, obtain the historical cooling and heating load data of the building and the relevant external influencing factor data, and pre-process the obtained data; the relevant external influencing factor data include indoor temperature, outdoor temperature, outdoor wind speed, relative humidity, precipitation in the past 3 hours, solar radiation rate, building utilization rate, personnel density, equipment lighting and other influencing factors and corresponding time series data; Step 2: Using the external influencing factor data and historical load data preprocessed in step 1 as input features and output features, respectively, a short-term building cooling and heating load prediction model is constructed based on the BiLSTM neural network; Step 3: Based on the input features of step 2 and the BiLSTM neural network architecture, a dual attention mechanism is introduced to assign different inertia weights to the hidden state and input features of the BiLSTM output respectively. Step 4: Based on the BiLSTM neural network architecture in step 2, the hyperparameters are optimized using the new particle swarm algorithm improved by GA-SA. The specific steps include: Add the crossover and mutation operation of the genetic algorithm to the particle swarm algorithm to obtain the processed particle swarm algorithm; In the processed particle swarm algorithm, a probability jump operation of the annealing algorithm is added to obtain an updated particle swarm algorithm; The number of training times, learning rate and number of neurons are used as optimization conditions, and the updated particle swarm algorithm is used to perform hyperparameter optimization processing to obtain optimization results. Step 5, based on the load prediction results obtained by the building cooling and heating load prediction model optimized in Steps 3 and 4, an error correction model is formed using CEEMD decomposition technology and BiLSTM neural network; In step 6, the obtained prediction results are used as the evaluation indicators of the accurate prediction model of building cooling and heating loads. The root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and model prediction accuracy (ACC) are used to evaluate the performance and assess the model prediction performance.
2. The method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm as claimed in claim 1, characterized in that: In step 3, a dual attention mechanism is introduced to assign different inertia weights. The specific steps are as follows: The channel attention mechanism is used to focus on different channels (features) of the input data, and different inertia weights Mc are assigned to different features in the historical load data and external influencing factor data; The spatial attention mechanism is used to focus on different positions of the input data, that is, different inertia weights Ms are assigned to the information at different time points of the historical load data.
3. The method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm as claimed in claim 1, characterized in that: In step 4, the crossover and mutation operation of the genetic algorithm is added to the particle swarm algorithm. The specific steps are as follows: Initialize design parameters, calculate the fitness of particles and select parent particles according to the fitness; Randomly select two parent particles for crossover operation, and perform mutation operation on the child solution generated after crossover; Recalculate the fitness of the offspring particles, replace the particles with low fitness in the original particles, perform iterative optimization according to the set number of iterations, and finally obtain the updated particle population.
4. The method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm as claimed in claim 1, characterized in that: In step 4, in the processed particle swarm algorithm, a probability jump operation of the annealing algorithm is added, and the specific steps are as follows: Randomly initialize the speed and position of the particles, calculate the position of each particle and the global optimal position; Calculate the annealing algorithm fitness of the individual optimal particle at the current set temperature, and then randomly select to replace the global optimal particle; Update the speed and position of the particles, calculate the fitness of each particle, determine whether the particle is better, and then determine whether to perform annealing operation; If the termination condition is met, the optimal solution is obtained. If the condition is not met, the iteration is continued and the annealing algorithm fitness of each particle is recalculated.
5. The method for accurately predicting building cooling and heating loads based on a dual attention mechanism and a novel particle swarm algorithm as claimed in claim 1, characterized in that: In step 5, the specific steps of using CEEMD decomposition technology and BiLSTM neural network to form an error correction model are as follows: Add Gaussian white noise to the original signal to construct a disturbance signal; Perform EMD decomposition on each disturbance signal to obtain the corresponding IMF component and residual signal Res; Repeat adding Gaussian white noise and performing EMD decomposition on the disturbance signal n times, calculate the integrated average of IMF, and obtain the final decomposition result; Each decomposed error component is input into the pre-established BiLSTM model for prediction, and the final load forecast result is obtained after accumulation.
Citation Information
Cited By
Building air conditioning system load prediction method and device, medium and equipment
CN119149963A
A method, device, medium and equipment for predicting load of building air conditioning system
CN119149963B
Distributed power grid dispatching management and optimization method
CN120414619A
Physical-data dual-drive heat supply system heat demand prediction and optimization control method and system
CN120745508A
Part plane morphology error prediction method based on multilayer perceptron
CN121009593A
