Central heating user room temperature prediction method based on difference network
By adopting a room temperature prediction method based on differential network in central heating systems, using short-term and long-term historical thermal data sequences, the problems of poor generalization ability and low accuracy of room temperature prediction models in the prior art are solved, and more accurate and universal room temperature prediction is achieved.
Patent Information
- Application Number
- CN202510353412.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The room temperature prediction model of existing central heating systems has poor generalization capabilities and low accuracy of prediction results, mainly due to the failure to effectively utilize historical room temperature data and consider the impact of long-term timing.
Using a differential network-based method, a thermal data sequence of short-term and long-term historical moments is constructed by obtaining thermal data at the current and historical moments, and inputting it into the differential network prediction model to predict the room temperature at the next moment. The model combines short-term and long-term historical data, improving the generalization ability and prediction accuracy of the model.
It improves the accuracy and generalization ability of room temperature prediction, can more effectively capture the long-term trends and short-term dynamics of room temperature changes, and improves the temperature regulation decisions of central heating systems.
Smart Images

Figure CN119879263A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of room temperature prediction, and in particular relates to a method for predicting room temperature of central heating users based on a differential network. Background Art
[0002] As the urbanization process continues to advance, the per capita living area has increased year by year, and the regional heating area has also gradually increased. The main form of urban heating in some areas is a regional centralized heating system consisting of water as the heat transfer medium, a heat source, a heat exchange station, a transmission network management system, indoor pipes of residents, and a heat dissipation terminal. In winter, a centralized heating system is used to heat the building to ensure that the room temperature is maintained in a suitable range, thereby ensuring the comfort of the living environment. However, since the room temperature is affected by many factors, the room temperature often fluctuates up and down, such as being too high or too low, during the actual heating process. Therefore, it is crucial to accurately predict the future room temperature so that the water supply temperature can be adjusted in a reasonable and timely manner.
[0003] At present, the research methods for predicting the room temperature of residents in the central heating system include traditional statistical and physical models, such as: multivariate linear regression, nonlinear regression, white box model based on thermodynamic equation modeling, etc.; classic machine learning methods, such as: support vector machine, random forest, gradient boosting tree and recurrent neural network, etc.; hybrid models such as gray box model based on physical-data fusion model, ensemble learning to weightedly fuse the results of multiple base models, etc.; there are also transfer learning and small sample learning, such as reusing pre-trained models in other areas for new buildings or users with insufficient data, etc. In the existing technology, due to the involvement of complex mathematical formulas and professional knowledge, slow calculation speed, only considering short-term time series and not considering historical room temperature, the generalization ability of the prediction model is poor and the accuracy of the prediction results is low. Summary of the invention
[0004] The purpose of the present invention is to solve the problem raised in the background technology and to propose a method for predicting room temperature of central heating users based on a differential network.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] The present invention proposes a method for predicting room temperature of a central heating user based on a differential network, comprising:
[0007] Acquire and preprocess raw data, wherein the raw data includes thermal data at the current moment and thermal data at each moment within a first preset time period before the current moment;
[0008] The preprocessed raw data is constructed to obtain the step length before the current moment. And the length is The first short-term historical moment hot data sequence and the step length before the current moment is And the length is The first long-term historical moment hot data series, and < ;
[0009] Input the current thermal data and each thermal data sequence after data construction into the trained differential network prediction model to obtain the predicted room temperature at the next moment;
[0010] Among them, in the differential network prediction model, the current moment hot data, the first short-term historical moment hot data sequence and the first long-term historical moment hot data sequence are input into three time convolution networks one by one for feature extraction, and the current moment hot data vector, the hot data vector before the current moment and with a step length of of The first short-term historical moment hot data vector and the vector before the current moment with a step length of of The first long-term historical moment hot data vector;
[0011] All hot data vectors are then passed through the calculation module to obtain the hot data vectors at the current moment. The first difference of the first short-term historical moment hot data vector and the current moment hot data vector are respectively The second difference of the hot data vector at the first long-term historical moment;
[0012] The first difference and The second difference is then used as the input of the first characteristic difference molecular network and the second characteristic difference molecular network in turn, and each characteristic difference molecular network outputs the first room temperature difference between the next moment and the next moment of each historical moment;
[0013] All first room temperature differences are then input to the output layer, which selects the optimal first room temperature difference and calculates the optimal first room temperature difference to obtain the predicted room temperature at the next moment.
[0014] Preferably, the thermal data include room temperature, outdoor temperature, light intensity, wind speed and water supply temperature.
[0015] Preferably, the preprocessing operation includes: for a room temperature or water supply temperature whose thermal data at one moment is missing, using the neighboring mean interpolation method to fill the missing value; for a room temperature or water supply temperature whose thermal data at one moment is abnormal, first deleting the abnormal value, and then using the neighboring mean interpolation method to fill the deleted value;
[0016] The formula of the neighboring mean interpolation method is as follows: ;in, express The room temperature or water supply temperature is always missing. express The room temperature or water supply temperature at the previous moment, express The room temperature or water supply temperature at the next moment.
[0017] Preferably, the data construction of the preprocessed raw data includes: of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first short-term historical moment hot data sequence; the hot data before the current moment and with a step length of of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first long-term historical moment of the thermal data series, where and The value ranges are and .
[0018] Preferably, the calculation module includes a first difference calculation unit and a second difference calculation unit. When all the hot data vectors pass through the calculation module, the hot data vector at the current moment and The first short-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The first difference of the hot data vector at the first short-term historical moment, the hot data vector at the current moment and The first long-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The second difference of the hot data vector at the first long-term historical moment; each of the feature difference sub-networks is a fully connected neural network.
[0019] Preferably, in the differential network prediction model training stage, the thermal data at all times within the second preset time period are collected as a data set, and the data set is expressed as ,in Indicates the data set When constructing data in the training phase, the hot data of a moment is randomly selected from the data set as the hot data of the first initial moment, and the hot data of the first initial moment is used Representation; construct the second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the first initial moment thermal data; take the next moment of the first initial moment as the new first initial moment, and the new first initial moment thermal data is used Indicates that the second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the new first initial moment thermal data are reconstructed; and so on, until As the thermal data of the first initial moment, construct The second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the first initial moment thermal data are obtained. The first initial moment of thermal data, The second short-term historical moment hot data series and The second long-term historical moment hot data sequence is obtained, and the corresponding hot data of the first initial moment, the second short-term historical moment hot data sequence and the second long-term historical moment hot data sequence are used as a training set to train the differential network prediction model once.
[0020] Preferably, during each training process of the differential network prediction model, the first characteristic difference molecular network outputs the second room temperature difference between the next moment of the initial moment and the next moment of each second short-term historical moment, and the second characteristic difference molecular network outputs the second room temperature difference between the next moment of the initial moment and the next moment of each second long-term historical moment; the loss of each second room temperature difference and the actual room temperature difference at the corresponding moment is calculated, and the differential network prediction model is updated according to the loss; the output layer selects the smallest loss from all losses, and the second room temperature difference corresponding to the smallest loss is used as the optimal second room temperature difference in this training process, and the predicted room temperature at the next moment of the initial moment is calculated based on the optimal second room temperature difference.
[0021] Preferably, the construction of the second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the first initial moment thermal data comprises: for each first initial moment thermal data, the first initial moment thermal data sequence with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The second short-term historical moment hot data series, where The value range is [ a 1 , b 1 ] ; The first initial moment heat data before and step length is of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The second long-term historical moment thermal data series, where The value range is [ a 2 , b 2 ] .
[0022] Preferably, the loss calculation formula is as follows: ;in, is the loss of the differential network prediction model, is the first loss of the difference between the second room temperature difference output by the first characteristic difference sub-network and the actual room temperature difference at the corresponding moment, It is the second loss of the second room temperature difference output by the second characteristic difference molecular network and the actual room temperature difference at the corresponding moment, and both the first loss and the second loss are calculated using the mean square error loss function.
[0023] Preferably, after the differential network prediction model is trained, the hot data at one moment is randomly selected from the data set as the hot data at the second initial moment; the hot data before the second initial moment and with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third short-term historical moment hot data sequence is the second initial moment hot data before and with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third long-term historical moment thermal data series;
[0024] fixed ,initialization ; Input the thermal data of the second initial moment, the thermal data sequence of the third short-term historical moment, and the thermal data sequence of the third long-term historical moment into the trained differential network prediction model to obtain the predicted room temperature at the next moment of the second initial moment; Calculate the first mean absolute error and the first root mean square error between the predicted room temperature at the next moment of the second initial moment and the actual room temperature at the corresponding moment; Then let , loop until ,get Take the first range [ a 1 , b 1 ] For each value in , calculate the corresponding first mean absolute error and first root mean square error, and select the smallest first mean absolute error and first root mean square error from each first mean absolute error and first root mean square error, and assign the smallest first mean absolute error and first root mean square error to the corresponding As The value of
[0025] Similarly, fixed , Take the second range [ a 2 , b 2 ] For each value in , calculate the corresponding second mean absolute error and second root mean square error, and select the smallest second mean absolute error and second root mean square error from each second mean absolute error and second root mean square error, and assign the smallest second mean absolute error and second root mean square error to the corresponding As The value of .
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] This method for predicting room temperature of centralized heating users based on differential network is first constructed through original data, and long-term and short-term historical thermal data sequences are obtained respectively. The acquired long-term and short-term historical thermal data sequences and current thermal data are input into the differential network prediction model, and the differential network prediction model predicts the predicted room temperature at the next moment; and in the prediction process, the short-term historical thermal data and the long-term historical thermal data are combined to predict the future room temperature, which improves the generalization ability of the model, and the historical room temperature is added as input in the original data, which improves the prediction accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flow chart of a method for predicting room temperature of a central heating user based on a differential network according to the present invention;
[0029] Figure 2 It is a structural schematic diagram of the differential network prediction model of the present invention;
[0030] Figure 3 A schematic diagram of the relationship between the predicted temperature difference of a user at a position and the change in water supply temperature in the experiment of the present invention;
[0031] Figure 4 A schematic diagram showing the relationship between the predicted temperature difference of the user at position 2 and the change in the water supply temperature in the experiment of the present invention;
[0032] Figure 5 A schematic diagram showing the relationship between the predicted temperature difference of the user at the third position and the change of the water supply temperature in the experiment of the present invention;
[0033] Figure 6 A schematic diagram showing the relationship between the predicted temperature difference of users at four locations and the change in water supply temperature in the experiment of the present invention;
[0034] Figure 7 This is a comparison chart between the predicted room temperature and the actual room temperature of a user at position one in the experiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0036] In one embodiment, Figure 1-Figure 2 As shown, a method for predicting room temperature of central heating users based on a differential network is provided, comprising:
[0037] Step 1: Obtain the original data and pre-process it. The original data includes the current moment hot data and the hot data of each moment in the first preset time period before the current moment (e.g., the original data has a total of hot data);
[0038] It should be noted that the sequence obtained by sorting the original data in chronological order is expressed as ,in, Indicates the hot data at the current moment in the original data, Indicates the number of times before the current moment in the original data The hot data at the moment, that is, Hot data at the moment.
[0039] Among them, the thermal data include room temperature (i.e., indoor temperature), outdoor temperature, light intensity, wind speed, and water supply temperature;
[0040] Since there may be uncontrollable factors such as transmission problems, database storage delays, and external interference in the process of obtaining raw data, some data may be lost or abnormal, which can be solved through preprocessing;
[0041] The preprocessing operations include:
[0042] For room temperature or water supply temperature with missing thermal data at one moment, the missing value is filled by using the neighboring mean interpolation method;
[0043] For abnormal room temperature or water supply temperature in thermal data at one moment, the abnormal value is deleted first, and then the deleted value is filled by the neighboring mean interpolation method;
[0044] The formula of the neighboring mean interpolation method is as follows: ;
[0045] in, express The room temperature or water supply temperature is always missing. express The room temperature or water supply temperature at the previous moment, express The room temperature or water supply temperature at the next moment.
[0046] Step 2: construct the data of the preprocessed raw data to obtain the step length before the current moment. And the length is The first short-term historical moment hot data sequence and the step length before the current moment is And the length is The first long-term historical moment hot data series, and < , and The value ranges are [ a 1 , b 1 ] and [ a 2 , b 2 ] (in, For the first range [ a 1 , b 1 ] The default value in For the second range [ a 2 , b 2 ] The preset values in the range, where the first range and the second range are obtained based on experience), include:
[0047] The current hot data before and with a step length of of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first short-term historical moment hot data sequence is obtained, and then the step length before the current moment is And the length is The first short-term historical moment of the hot data series;
[0048] The current hot data before and with a step length of of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first long-term historical moment hot data sequence, and then get the step length before the current moment And the length is The first long historical moment of the thermal data series.
[0049] It should be noted that the step length is The time interval between two adjacent first short-term historical moments of thermal data is , and the time interval between the first short-term historical moment hot data (the hot data closest to the current moment) and the current moment is , the length is The first short-term historical moment hot data sequence is sorted in the order of historical moments and expressed as , Indicates The hot data at the moment; the step length is The time interval between two adjacent first long-term historical moments of thermal data is , and the time interval between the first long-term historical moment hot data (the hot data closest to the current moment) and the current moment is , the length is The first long-term historical moment hot data sequence is sorted in the order of historical moments and expressed as , Indicates Hot data at the moment; and The value of is set according to actual needs, such as in this embodiment is a moment (i.e., an hour), For 24 moments.
[0050] in, and The value of is set as follows:
[0051] After the differential network prediction model is trained, the hot data at one moment is randomly selected from the data set as the hot data at the second initial moment;
[0052] The second initial moment heat data before and step length is of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third short-term historical moment hot data sequence is the second initial moment hot data before and with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third long-term historical moment thermal data series;
[0053] fixed ,initialization ;
[0054] Input the thermal data at the second initial moment, the thermal data sequence of the third short-term historical moment (of corresponding length), and the thermal data sequence of the third long-term historical moment (of corresponding length) into the trained differential network prediction model to obtain the predicted room temperature at the next moment of the second initial moment;
[0055] Calculate a first mean absolute error and a first root mean square error between the predicted room temperature at the next moment after the second initial moment and the actual room temperature at the corresponding moment (the corresponding moment is the next moment after the second initial moment);
[0056] Re-order , loop operation (i.e. continue to calculate the corresponding first mean absolute error and first root mean square error) until ,get Take the first range [ a 1 , b 1 ] For each value in , calculate the corresponding first mean absolute error and first root mean square error, and select the smallest first mean absolute error and first root mean square error from each first mean absolute error and first root mean square error, and assign the smallest first mean absolute error and first root mean square error to the corresponding As The value of
[0057] Similarly, fixed ,initialization ;
[0058] Input the thermal data at the second initial moment, the thermal data sequence of the third short-term historical moment (of corresponding length), and the thermal data sequence of the third long-term historical moment (of corresponding length) into the trained differential network prediction model to obtain the predicted room temperature at the next moment of the second initial moment;
[0059] Calculate the second mean absolute error and the second root mean square error between the predicted room temperature at the next moment after the second initial moment and the actual room temperature at the corresponding moment (the corresponding moment is the next moment after the second initial moment);
[0060] Re-order , loop operation (i.e. continue to calculate the corresponding second mean absolute error and second root mean square error) until ,get Take the second range [ a 2 , b 2 ] For each value in , calculate the corresponding second mean absolute error and second root mean square error, and select the smallest second mean absolute error and second root mean square error from each second mean absolute error and second root mean square error, and assign the smallest second mean absolute error and second root mean square error to the corresponding As The value of
[0061] The mean absolute error The calculation formula is: ;
[0062] in, represents the actual room temperature at the next moment after the second initial moment, represents the predicted room temperature at the next moment after the second initial moment, express or The sequence number of the value, Indicates that when calculating the first mean absolute error The number of values or when calculating the second mean absolute error The number of values is calculated as follows: ;
[0063] Root mean square error The calculation formula is: ;
[0064] in, Indicates that when calculating the first root mean square error The number of values or when calculating the second RMS error The number of values is calculated as follows: .
[0065] Step 3: Input the current thermal data and each thermal data sequence after data construction into the trained differential network prediction model to obtain the predicted room temperature at the next moment; wherein, the structure of the differential network prediction model is as follows: Figure 2 As shown, from data input to output, there are three parallel time convolution networks, a computing module, two parallel first feature difference sub-networks and a second feature difference sub-network and an output layer connected in sequence (wherein the weights of the three time convolution networks in the training phase are shared, and the weights of the first feature difference sub-network and the second feature difference sub-network are shared. The purpose of sharing weights is to characterize the commonalities between short-term historical moment data and long-term historical moment data: to mine the relationship between the true value of outdoor temperature, light intensity, wind speed and water supply temperature characteristics and the true value of room temperature characteristics in the true value data set. Each feature difference sub-network is a fully connected neural network).
[0066] Step 3.1: In the differential network prediction model, the current moment hot data, the first short-term historical moment hot data sequence, and the first long-term historical moment hot data sequence are input into three time convolution networks one by one for feature extraction, and the current moment hot data vector, the hot data vector before the current moment with a step length of of The first short-term historical moment hot data vector and the vector before the current moment with a step length of of The first long-term historical moment hot data vector;
[0067] The hot data at the previous moment is extracted through the time convolution network feature to obtain the hot data vector at the current moment. The hot data vector at the current moment is expressed as ; The first short-term historical moment hot data sequence is extracted through feature extraction to obtain a step length of of The first short-term historical moment hot data vector, The first short-term historical moment hot data vectors are sorted in the order of historical moments to obtain a set representation as , Indicates The hot data vector at the moment; the first long-term historical hot data sequence is extracted by feature extraction to obtain a step size of of The first long-term historical moment hot data vector, The set of hot data vectors at the first long-term historical moment sorted in the order of historical moments is expressed as , Indicates The TCN temporal convolutional network covers a longer time span and can more effectively extract long-term trend features compared to ordinary fully connected layers. At the same time, it naturally supports variable-length input and is suitable for differential calculations at different time intervals. The local perception characteristics of the convolution operation can suppress noise interference and generate more stable representations to improve the robustness of the model.
[0068] Step 3.2: All hot data vectors are passed through the calculation module to obtain the hot data vectors at the current moment and The first difference of the first short-term historical moment hot data vector and the current moment hot data vector are respectively The second difference of the hot data vector at the first long-term historical moment;
[0069] The calculation module includes a first difference calculation unit and a second difference calculation unit. When all hot data vectors pass through the calculation module, the hot data vector at the current moment and The first short-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The first difference of the hot data vector at the first short-term historical moment, the hot data vector at the current moment and The first long-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The second difference of the hot data vector at the first long-term historical moment.
[0070] Step 3.3 The first difference and The second difference is then used as the input of the first feature difference molecular network and the second feature difference molecular network in turn, and each feature difference molecular network outputs the first room temperature difference (i.e., the first room temperature difference) between the next moment and the next moment of each historical moment; each first difference and the second difference is used as the input of the corresponding feature difference molecular network to capture the dynamic change trend of the data; each feature difference molecular network is a fully connected neural network, including a sequentially connected input layer (including 5 neurons), a hidden module (a total of three sequentially connected hidden layers, each hidden layer including 64 neurons) and an output module (including one neuron), and the activation function of the input layer and all hidden layer neurons is the LeakyReLU activation function;
[0071] Among them, the first characteristic difference molecular network outputs the first room temperature difference between the next moment of the current moment and the next moment of each first short-term historical moment, The first room temperature difference, and The set corresponding to the first room temperature difference is expressed as ,in Indicates Moment and The first room temperature difference at the moment; the second characteristic difference molecular network outputs the first room temperature difference between the next moment of the current moment and the next moment of each first long-term historical moment, The first room temperature difference, and The set corresponding to the first room temperature difference is expressed as ,in Indicates Moment and The first room temperature difference at the moment The moment is the next moment after the current moment.
[0072] Step 3.4, all first room temperature differences are input to the output layer, the output layer selects the best first room temperature difference, and calculates the best first room temperature difference to obtain the predicted room temperature at the next moment;
[0073] Among them, when the output selects the optimal first room temperature difference, the optimal first room temperature difference is directly selected according to the parameters of the trained output layer, and is expressed as ,in, is the room temperature at the next moment after one of the first short-term historical moments or one of the first long-term historical moments, then the predicted room temperature at the next moment .
[0074] In another embodiment, the method for predicting room temperature of central heating users based on a differential network further includes training of a differential network prediction model. The training process of the differential network prediction model is as follows (during the training process, the learning rate learning_rate is set to 0.01, the batch size batch_size is set to 128, and the number of iterations epochs is 200 for the best prediction effect. The network optimizer is Adam, and the data is standardized using Standard):
[0075] Step (1), collect the thermal data at all times within the second preset time period as a data set, and the data set is expressed as ,in Indicates the data set The data set can contain thermal data from the entire heating season.
[0076] Step (2), preprocess the data set (the process is the same as the preprocessing process in step 1, and will not be repeated);
[0077] Step (3): construct the processed data set:
[0078] Step (3-1), randomly select a hot data at a moment from the data set as the hot data at the first initial moment, and the hot data at the first initial moment is used express;
[0079] Step (3-2), constructing a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data;
[0080] Step (3-3), the next moment after the first initial moment is used as the new first initial moment, and the new first initial moment thermal data is used Indicates that the second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the new first initial moment thermal data are reconstructed;
[0081] Steps (3-4), and so on, until As the thermal data of the first initial moment, construct a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data;
[0082] Steps (3-5) yield The first initial moment of thermal data, The second short-term historical moment hot data series and The second long-term historical moment hot data sequence is obtained, and the corresponding hot data of the first initial moment, the second short-term historical moment hot data sequence and the second long-term historical moment hot data sequence are used as a training set to train the differential network prediction model once;
[0083] The step of constructing a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data includes:
[0084] For each first initial moment hot data, the first initial moment hot data before and with a step length of of The hot data at each moment is taken out from the data set in sequence and spliced into a data set with a length of The second short-term historical moment hot data sequence is obtained, and then the step length before the first initial moment is And the length is The second short-term historical moment hot data series, where The value range is [ a 1 , b 1 ] (The training phase starts from the first range [ a 1 , b 1 ] A value is randomly selected as );
[0085] The first initial moment hot data before and step length is of The hot data at each moment is taken out from the data set in sequence and spliced into a data set with a length of The second long-term historical moment heat data sequence is obtained, and then the step length before the first initial moment is And the length is The second long-term historical moment thermal data series, where The value range is [ a 2 , b 2 ] (The training phase starts from the second range [ a 2 , b 2 ] A value is randomly selected as ).
[0086] Step (4), input the hot data of the first initial moment, the second short-term historical moment hot data sequence and the second long-term historical moment hot data sequence in each training set into three time convolutional networks for feature extraction, and obtain the first initial moment hot data vector, the second short-term historical moment hot data vector and the second long-term historical moment hot data vector in turn.
[0087] Step (5), all thermal data vectors are then passed through the calculation module in sequence, and the output of the calculation module is then passed through the first characteristic difference molecular network and the second characteristic difference molecular network to obtain the second room temperature difference between the next moment of the initial moment and the next moment of each historical moment (that is, the second room temperature difference between the next moment of the initial moment and the next moment of the second short-term historical moment, and the second room temperature difference between the next moment of the initial moment and the next moment of the second long-term historical moment, where the second room temperature difference is the second indoor temperature difference).
[0088] Step (6), calculating the loss between each second room temperature difference and the actual room temperature difference at the corresponding moment (i.e., the actual room temperature difference between the next moment of the initial moment and the next moment of each historical moment), and updating the differential network prediction model according to the loss (according to the value of the loss, adjusting the parameters of the differential network prediction model to minimize the loss to improve the accuracy of the prediction result);
[0089] The loss calculation formula is as follows: ;
[0090] in, is the loss of the differential network prediction model, is the first loss of the difference between the second room temperature difference output by the first characteristic difference sub-network and the actual room temperature difference at the corresponding moment, It is the second loss of the second room temperature difference output by the second characteristic difference molecular network and the actual room temperature difference at the corresponding moment, and both the first loss and the second loss are calculated using the mean square error loss function.
[0091] Step (7), the output layer selects the minimum loss from all losses, and uses the second room temperature difference corresponding to the minimum loss as the optimal second room temperature difference in this training process, and calculates the optimal second room temperature difference to obtain the predicted room temperature at the next moment of the initial moment (through such training, in the actual application stage, the output layer directly selects the optimal first room temperature difference from all first room temperature differences).
[0092] The room temperature prediction method for central heating users based on differential network (in Table 1 and Figure 3-Figure 6 The prediction effect of the model method used in the prior art is compared with that of the model method used in the prior art:
[0093] The XGBoost model (an efficient gradient boosting tree algorithm) used in the prior art takes raw data as input, but the thermal data in the raw data does not include the room temperature, and outputs the predicted room temperature at the next moment; The existing technology also uses an MLP model (which uses a multi-layer fully connected neural network), which takes raw data as input and outputs the predicted room temperature at the next moment; The existing technology also uses a CNN-LSTM model (using a convolutional neural network (CNN) and a long short-term memory network (LSTM)), whose input is raw data, but only considers short-term historical thermal data sequences in the process, and outputs the predicted room temperature at the next moment.
[0094] This method is compared with the model used in the prior art. The error between the actual room temperature and the predicted room temperature is calculated as the prediction effect using three indicators: MAE (mean absolute error between the predicted room temperature and the actual temperature), RMSE (root mean square error between the predicted room temperature and the actual temperature), and MAPE (mean absolute percentage error between the predicted room temperature and the actual temperature). The three indicators are the average values of 10 experimental results. The smaller the MAE, RMSE, and MAPE, the smaller the error, and the better the prediction performance of the model. The comparison data is shown in Table 1: Table 1
[0095] Table 1 shows the comparison of the prediction accuracy of various models on the data sets of users in different locations. It can be seen that the accuracy of this method is much higher than other model methods in the prior art.
[0096] In actual situations, the only factor affecting room temperature that can be controlled artificially is the water supply temperature. Therefore, in the experiment, while keeping other features (outdoor temperature, light intensity and wind speed) unchanged, only the water supply temperature is changed. In the specific experiment, the original data of different user locations (including location 1, location 2, location 3 and location 4) are obtained according to steps 1 to 3 to obtain the predicted room temperature at the next moment (recorded as the initial predicted room temperature), and then the water supply temperature in the thermal data at the current moment in the original data is changed (such as reducing the water supply temperature by 2°C), and other features remain unchanged. The original data after this change is operated according to steps 1 to 3 to obtain the predicted room temperature at the next moment after this change, and the predicted room temperature after this change is subtracted from the initial predicted room temperature to obtain the corresponding predicted room temperature change; then change The water supply temperature in the thermal data at the current moment in the original data (such as reducing the water supply temperature by 1°C), other features remain unchanged, and the original data after this change is operated according to steps 1 to 3 to obtain the predicted room temperature at the next moment after the change, and the predicted room temperature after this change is subtracted from the initial predicted room temperature to obtain the corresponding predicted room temperature change, and the operation is repeated to observe the relationship between the change in water supply temperature (i.e. the change in water supply temperature in the thermal data at the current moment in the original data) and the predicted room temperature change (i.e. the difference between the predicted room temperature after the change and the initial predicted room temperature), and judge the prediction accuracy and generalization ability of the model by observing whether the amplitude of the predicted room temperature change conforms to the physical laws (wherein, the more obvious the change in the predicted room temperature with the change in the water supply temperature, the better the prediction accuracy and generalization ability of the model). Figure 3-Figure 6 The following table shows the predicted temperature difference changes for different user locations (location 1, location 2, location 3 and location 4) in Table 1, as the water supply temperature changes continuously. Figure 3-Figure 6 It can be seen that this method has better prediction accuracy and generalization ability than other model methods in the prior art. In this experiment, the minimum unit of water supply temperature change is set to ℃, the maximum change range is ℃.
[0097] Among them, the comparison between the predicted room temperature and the actual room temperature of a user at a certain location within a period of time predicted by this method is as follows: Figure 7 shown.
[0098] This method for predicting room temperature of centralized heating users based on differential network is first constructed through original data, and long-term and short-term historical thermal data sequences are obtained respectively. The acquired long-term and short-term historical thermal data sequences and current thermal data are input into the differential network prediction model, and the differential network prediction model predicts the predicted room temperature at the next moment; and in the prediction process, the short-term historical thermal data and the long-term historical thermal data are combined to predict the future room temperature, which improves the generalization ability of the model, and the historical room temperature is added as input in the original data, which improves the prediction accuracy of the model.
[0099] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0100] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for predicting room temperature of central heating users based on differential network, characterized in that: The method for predicting room temperature of central heating users based on differential network includes: Acquire and preprocess raw data, wherein the raw data includes thermal data at the current moment and thermal data at each moment within a first preset time period before the current moment; The preprocessed raw data is constructed to obtain the step length before the current moment. And the length is The first short-term historical moment hot data sequence and the step length before the current moment is And the length is The first long-term historical moment hot data series, and < ; Input the current thermal data and each thermal data sequence after data construction into the trained differential network prediction model to obtain the predicted room temperature at the next moment; Among them, in the differential network prediction model, the current moment hot data, the first short-term historical moment hot data sequence and the first long-term historical moment hot data sequence are input into three time convolution networks one by one for feature extraction, and the current moment hot data vector, the hot data vector before the current moment and with a step length of of The first short-term historical moment hot data vector and the vector before the current moment with a step length of of The first long-term historical moment hot data vector; All hot data vectors are then passed through the calculation module to obtain the hot data vectors at the current moment. The first difference of the first short-term historical moment hot data vector and the current moment hot data vector are respectively The second difference of the hot data vector at the first long-term historical moment; The first difference and The second difference is then used as the input of the first characteristic difference molecular network and the second characteristic difference molecular network in turn, and each characteristic difference molecular network outputs the first room temperature difference between the next moment and the next moment of each historical moment; All first room temperature differences are then input to the output layer, which selects the optimal first room temperature difference and calculates the optimal first room temperature difference to obtain the predicted room temperature at the next moment.
2. The method for predicting room temperature of central heating users based on differential network according to claim 1, characterized in that: The thermal data include room temperature, outdoor temperature, light intensity, wind speed and water supply temperature.
3. The method for predicting room temperature of central heating users based on differential network according to claim 2, characterized in that: The pre-processing operations include: For room temperature or water supply temperature with missing thermal data at one moment, the missing value is filled by using the neighboring mean interpolation method; For abnormal room temperature or water supply temperature in thermal data at one moment, the abnormal value is deleted first, and then the deleted value is filled by the neighboring mean interpolation method; The formula of the neighboring mean interpolation method is as follows: ; in, express The room temperature or water supply temperature is always missing. express The room temperature or water supply temperature at the previous moment, express The room temperature or water supply temperature at the next moment.
4. The method for predicting room temperature of central heating users based on differential network according to claim 1, characterized in that: The data construction of the preprocessed raw data includes: The current hot data before and with a step length of of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first short-term historical moment of the hot data series; The current hot data before and with a step length of of The hot data at each moment is taken out from the preprocessed raw data in sequence and spliced into a time sequence with a length of The first long-term historical moment of the thermal data series, where and The value ranges are and .
5. The method for predicting room temperature of central heating users based on differential network according to claim 1, characterized in that: The calculation module includes a first difference calculation unit and a second difference calculation unit. When all hot data vectors pass through the calculation module, the hot data vector at the current moment and The first short-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The first difference of the hot data vector at the first short-term historical moment, the hot data vector at the current moment and The first long-term historical moment hot data vector is used as the input of the first difference calculation unit, and the current moment hot data vector is obtained respectively with The second difference of the hot data vector at the first long-term historical moment; Each of the feature difference sub-networks is a fully connected neural network.
6. The method for predicting room temperature of central heating users based on differential network according to claim 1, characterized in that: In the differential network prediction model training phase, the thermal data at all times within the second preset time period are collected as a data set, and the data set is represented as ,in Indicates the data set Hot data at a moment; During the data construction in the training phase, the hot data at a certain moment is randomly selected from the data set as the hot data at the first initial moment, and the hot data at the first initial moment is used as express; Constructing a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data; The next moment after the first initial moment is taken as the new first initial moment, and the thermal data of the new first initial moment is used as Indicates that the second short-term historical moment thermal data sequence and the second long-term historical moment thermal data sequence of the new first initial moment thermal data are reconstructed; And so on, until As the thermal data of the first initial moment, construct a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data; Then we get The first initial moment of thermal data, The second short-term historical moment hot data series and The second long-term historical moment hot data sequence is obtained, and the corresponding hot data of the first initial moment, the second short-term historical moment hot data sequence and the second long-term historical moment hot data sequence are used as a training set to train the differential network prediction model once.
7. The method for predicting room temperature of central heating users based on differential network according to claim 6, characterized in that: During each training process of the differential network prediction model, the first characteristic difference sub-network outputs the second room temperature difference between the next moment of the initial moment and the next moment of each second short-term historical moment, and the second characteristic difference sub-network outputs the second room temperature difference between the next moment of the initial moment and the next moment of each second long-term historical moment; Calculate the loss of each second room temperature difference and the actual room temperature difference at the corresponding moment, and update the differential network prediction model according to the loss; The output layer selects the minimum loss from all losses, and takes the second room temperature difference corresponding to the minimum loss as the optimal second room temperature difference in this training process, and calculates the predicted room temperature at the next moment of the initial moment based on the optimal second room temperature difference.
8. The method for predicting room temperature of central heating users based on differential network according to claim 6, characterized in that: The step of constructing a second short-term historical moment thermal data sequence and a second long-term historical moment thermal data sequence of the first initial moment thermal data comprises: For each first initial moment hot data, the first initial moment hot data before and with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The second short-term historical moment hot data series, where The value range is ; The first initial moment hot data before and step length is of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The second long-term historical moment thermal data series, where The value range is .
9. The method for predicting room temperature of central heating users based on differential network according to claim 7, characterized in that: The loss calculation formula is as follows: ; in, is the loss of the differential network prediction model, is the first loss of the difference between the second room temperature difference output by the first characteristic difference sub-network and the actual room temperature difference at the corresponding moment, It is the second loss of the second room temperature difference output by the second characteristic difference molecular network and the actual room temperature difference at the corresponding moment, and both the first loss and the second loss are calculated using the mean square error loss function.
10. The method for predicting room temperature of central heating users based on differential network according to claim 6, characterized in that: After the differential network prediction model is trained, hot data at one moment is randomly selected from the data set as hot data at a second initial moment; The second initial moment heat data before and step length is of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third short-term historical moment hot data sequence is the second initial moment hot data before and with a step length of of The hot data at each moment is taken out from the data set one by one and spliced into a time sequence with a length of The third long-term historical moment thermal data series; fixed ,initialization ; Input the thermal data of the second initial moment, the thermal data sequence of the third short-term historical moment, and the thermal data sequence of the third long-term historical moment into the trained differential network prediction model to obtain the predicted room temperature at the next moment of the second initial moment; Calculate a first mean absolute error and a first root mean square error between the predicted room temperature at the next moment of the second initial moment and the actual room temperature at the corresponding moment; Re-order , loop until ,get Take the first range For each value in , calculate the corresponding first mean absolute error and first root mean square error, and select the smallest first mean absolute error and first root mean square error from each first mean absolute error and first root mean square error, and assign the smallest first mean absolute error and first root mean square error to the corresponding As The value of Similarly, fixed , Take the second range For each value in , calculate the corresponding second mean absolute error and second root mean square error, and select the smallest second mean absolute error and second root mean square error from each second mean absolute error and second root mean square error, and assign the smallest second mean absolute error and second root mean square error to the corresponding As The value of .
Citation Information
Patent Citations
General water-cooling central air conditioner energy consumption prediction method based on long-short-term memory recurrent neural network
CN109961177A
Network model training method and device, room temperature prediction method and device, equipment and medium
CN113722975A
Video behavior identification method and device based on multi-time scale convolution
CN113869235A
Power load prediction method based on decomposition network
CN115600640A
Photovoltaic power station ultra-short-term power intelligent prediction method based on SLSTM and MLSTNet models
CN115796004A