Heat metering data filling method based on dual-channel generative adversarial network

By adopting the heat metering data filling method of dual-channel generative adversarial network in the heating system, the problem of missing heat metering data in the heating system is solved, and higher data filling accuracy and system operation efficiency are achieved.

CN119357172AActive Publication Date: 2025-01-24ZHEJIANG UNIV OF TECH

Patent Information

Application Number
CN202411568412.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-24
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the problem of missing heat metering data in heating systems, resulting in insufficient data integrity and analysis accuracy.

Method used

The thermal metering data filling method based on the dual-channel generative adversarial network (GRU-WGAN) is adopted. By constructing the thermal metering data channel and auxiliary data channel of the bidirectional GRU layer, combined with weather information and date information, the Wasserstein loss function and weight clipping strategy are used. Optimize the generator and discriminator to improve data imputation accuracy.

Benefits of technology

It has significantly improved the accuracy of lack of data filling, captured the time dependence and non -linear characteristics of heat metering data, ensure the stability and consistency of generating data, and improve the operating efficiency and data analysis accuracy of the heating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357172A_ABST
    Figure CN119357172A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of heat energy management and heat supply system data processing, and discloses a heat metering data filling method based on a dual-channel generative adversarial network, through the design of the dual-channel generative adversarial network, multi-dimensional modeling can be performed on heat metering data and auxiliary data at the same time, and the accuracy of missing data filling is remarkably improved; data generation is carried out by combining the generator of the GRU, so that the information of the time dimension in the heat metering data can be better captured, and a better generation effect is achieved. External weather information and date information are used as auxiliary input and are combined to be directly input into the generator, and the mode is more suitable for capturing complex time dependence and is beneficial to generating filling data conforming to time logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of thermal energy management and heating system data processing, and specifically relates to a heat metering data filling method based on a dual-channel generative adversarial network (GRU-WGAN), which aims to solve the problem of missing heat metering data in a heating system and improve data integrity and analysis accuracy. Background Art

[0002] Heat metering data plays a vital role in the efficient operation and optimization of heating systems. Since the accuracy and integrity of heat metering data directly affect the load forecasting, energy consumption optimization and operation management of the heating system, ensuring the continuity and integrity of the data is particularly important for improving the reliability and efficiency of the heating system. In the existing heating system data collection process, data loss problems often occur due to equipment failures, communication interruptions and other reasons. This not only causes trouble for subsequent data analysis and system optimization, but also has a negative impact on the overall stability and heating efficiency of the heating system.

[0003] With the increase in data dimensions and the complexity of application scenarios of heating systems, how to deal with the lack of heat metering data and ensure the stable and efficient operation of the heating system has become a difficult problem that needs to be solved in the heating field. Although traditional heat metering data interpolation methods such as mean interpolation, linear interpolation and regression models can play a certain role in dealing with a small amount of missing data, they are very limited in effect when faced with large amounts of high-dimensional data with nonlinear characteristics. They often ignore the time series characteristics of the data and cannot capture complex nonlinear patterns, resulting in large deviations in the interpolation results, which in turn affects the decision-making and optimization effects of the system.

[0004] In recent years, with the rapid development of technologies such as deep learning and generative adversarial networks (GANs), researchers have begun to try to use more advanced algorithms to solve the problem of interpolation of thermometric data. Generative adversarial networks effectively learn the complex distribution of data and generate samples similar to real data through adversarial training of generators and discriminators. However, GAN models also face problems such as unstable training and mode collapse in practical applications. Especially when processing high-dimensional complex data, it is often difficult to ensure the stability and quality of generated data. Summary of the invention

[0005] The purpose of the present invention is to provide a heat metering data filling method based on a dual-channel generative adversarial network to achieve more accurate missing value filling and significantly improve the operating efficiency of the heating system and the accuracy of data analysis.

[0006] To achieve the above object, the technical solution adopted by the present invention is: A method for filling in thermal measurement data based on a dual-channel generative adversarial network, the method for filling in thermal measurement data based on a dual-channel generative adversarial network comprising: Obtain heat metering data and reconstruct it into a heat metering third-order tensor, and obtain weather information and date information and reconstruct it into an auxiliary third-order tensor; Marking the position of each missing value in the thermal metering data with missing data, and recording the marked positions in a Boolean matrix to obtain a mask matrix, wherein the value of the marked position in the mask matrix is ​​0, and the value of the unmarked position is 1; Constructing a dual-channel generative adversarial network, the dual-channel generative adversarial network includes a generator and a discriminator, the generator includes two independent branches and a shared branch, the two independent branches are respectively a thermal metering data channel based on a bidirectional GRU layer and an auxiliary data channel based on a bidirectional GRU layer, the shared branch includes a first activation function, a fully connected layer, and a second activation function connected in sequence, and the discriminator is constructed based on a convolutional neural network; The third-order heat meter tensor and the auxiliary third-order tensor are simultaneously input into the generator. Based on the mask matrix, the output of the generator is used to fill the data of the third-order heat meter tensor, and the generated samples after data filling are input into the discriminator. The discriminator loss function is calculated according to the output of the discriminator, and the weight of the discriminator is updated and clipped based on the discriminator loss function. After the discriminator is updated for multiple rounds, the generator loss function is calculated to update the generator weights by minimizing the probability that the generated sample is judged as real data by the discriminator; The thermal metering data filling is completed based on the trained generator and the mask matrix of the thermal metering data to be filled.

[0007] Several optional methods are also provided below, but they are not intended to be additional limitations on the above-mentioned overall solution, but are merely further supplements or preferences. Under the premise that there are no technical or logical contradictions, each optional method can be combined with the above-mentioned overall solution separately, and multiple optional methods can also be combined.

[0008] Preferably, the step of obtaining the heat measurement data and reconstructing it into a heat measurement third-order tensor comprises: Obtain heat metering data, including heating, temperature recovery and instantaneous flow; Normalize the heat metering data; The normalized heat metering data is divided into days and hours, and the heat metering data of 24 hours a day is reconstructed into a third-order tensor, recorded as a heat metering third-order tensor. The shape of the heat metering third-order tensor is (days, 24, meter_features), where days represents the number of days, 24 is the number of hours per day, and meter_features is the divided heat metering data.

[0009] Preferably, the step of obtaining weather information and date information and reconstructing them into an auxiliary third-order tensor includes: Obtain weather information including temperature, humidity, wind speed, wind direction and solar radiation, and obtain date information including day type, week and heating time period; The temperature, humidity, wind speed, wind direction and solar radiation are normalized, and the day type, week and heating time period are converted into binary vectors using One-Hot encoding; The normalized weather information and the date information converted into binary vectors are divided into days and hours, and the weather information and date information of 24 hours a day are reconstructed into a third-order tensor, which is recorded as an auxiliary third-order tensor. The shape of the auxiliary third-order tensor is (days, 24, aux_features), where days represents the number of days, 24 represents the number of hours per day, and aux_features represents the weather information and date information after segmentation.

[0010] Preferably, the processing process of the shared branch of the generator is as follows: Take the heat metering data channel and the auxiliary data channel at the time step The feature representations are and , first of all, the feature and Fusion, the fused features It is expressed as: Next, the fused features Nonlinear transformation is performed through the first activation function: In the formula, Represents the time step The first activated feature of represents a first activation function, wherein the first activation function is a ReLU activation function; Set the weight matrix of the fully connected layer to and the bias term is , then the time step Output representation of the fully connected layer Defined as: Then, the output of the fully connected layer is activated by the second activation function Nonlinear mapping is performed, which is expressed as follows: In the formula, Represents the time step The second activation feature of represents a second activation function, which is a hyperbolic tangent activation function.

[0011] Preferably, the step of inputting the heat metering third-order tensor into a generator and performing data padding on the heat metering third-order tensor using the output of the generator based on a mask matrix comprises: In the formula, represents the generated samples after data filling, represents the mask matrix, A third-order tensor representing the heat quantity of the input generator, represents the output of the generator, i.e., the time step The second activation feature.

[0012] Preferably, the discriminator comprises four convolutional layers, a flattening layer and a fully connected layer connected in sequence, and each convolutional layer is connected to a normalization layer, a ReLU activation function and an average pooling layer.

[0013] Preferably, the discriminator loss function is as follows: In the formula, is the discriminator loss function, Express expectations, Represents the real sample Distribution from real data , real sample The third-order tensor of the thermometric data corresponding to the thermometric data without missing data in the training data, Indicates the generated sample Distribution from generator , Represents the discriminator for the real sample The output score of Represents the discriminator to generate samples The output score of The generator loss function is as follows: In the formula, represents the generator loss function.

[0014] Preferably, the weight of the cropping discriminator includes: For each weight of the discriminator , the clipping strategy is: In the formula, Represents a clipping operation. Represents the clipping threshold, the weight after clipping Restricted to the interval Within.

[0015] The present invention provides a method for filling in thermal measurement data based on a dual-channel generative adversarial network, which has the following beneficial effects compared with the prior art: (1) Through the design of a dual-channel generative adversarial network, the present invention can simultaneously perform multi-dimensional modeling on thermal metering data and auxiliary data, significantly improving the accuracy of missing data filling; by combining the GRU generator for data generation, the information of the time dimension in the thermal metering data can be better captured to achieve better generation effect.

[0016] (2) The present invention uses external weather information and date information as auxiliary inputs, which are directly input into the generator after being combined. This method is more suitable for capturing complex time dependencies and helps to generate fill-in data that conforms to time logic.

[0017] (3) The present invention solves the problem of mode collapse during training by using the Wasserstein loss function and weight clipping strategy for the discriminator, and optimizes the generator through the feedback of the discriminator to ensure that the data generated by the model is stable and close to the real data distribution. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of a thermal metering data filling method based on a dual-channel generative adversarial network of the present invention; Figure 2 A model diagram of the generator of the present invention; Figure 3 This is a model diagram of the discriminator of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0021] In view of the complexity of heat metering data and the limitations of existing methods, the present invention proposes a heat metering data filling method based on a dual-channel generative adversarial network. The dual-channel structure can not only process heat metering data, but also integrate external weather information and date features and other related information, make full use of the relationship between time series and multidimensional features, and improve the stability of the model by adopting the Wasserstein loss function, and effectively avoid problems such as mode collapse. In addition, the present invention can better capture the short-term and long-term dependency characteristics of heat metering data through the dual-channel GRU structure, thereby achieving more accurate missing value filling, significantly improving the operating efficiency of the heating system and the accuracy of data analysis.

[0022] like Figure 1 As shown, a method for filling thermal metering data based on a dual-channel generative adversarial network in this embodiment includes the following steps: Step 1: Construct dual-channel data: obtain thermal metering data and reconstruct it into a thermal metering third-order tensor, and obtain weather information and date information and reconstruct it into an auxiliary third-order tensor.

[0023] The heat metering data channel comes from the heating database, mainly including water supply temperature, return water temperature, instantaneous flow rate and other information, and the weather data in the auxiliary data channel comes from the NASA public data set, including temperature, precipitation, solar radiation and other information. In this embodiment, a dual-channel input data structure is first constructed for the heat metering data and auxiliary data of the heating system to provide high-quality input data for the subsequent generative adversarial network model.

[0024] During the data construction process, the heat metering data of the heating system was obtained and processed, including supply temperature (℃), return temperature (℃) and instantaneous flow ( ), these data represent the core heat demand and heating efficiency in the system. In order to improve the efficiency and accuracy of data processing, the data is segmented by days and hours to construct time series features. Specifically, the 24-hour heat metering data of each day is reconstructed into a third-order tensor, recorded as the heat metering third-order tensor. The shape of the heat metering third-order tensor is (days, 24, meter_features), where days represents the number of days, 24 is the number of hours per day, and meter_features is the heat metering data feature. This structured data representation ensures that the model effectively captures the short-term and long-term dependencies in the heat metering data.

[0025] This embodiment also extracts weather information (including temperature, humidity, wind speed, wind direction, and solar radiation, etc.) and date information (including day type, week, and heating time period, etc.). These auxiliary data are closely related to heat metering data and can affect the operation of the system and the user's heat demand. In order to enable the model to accurately understand the role of these external factors, the auxiliary data is also divided according to days and hours, constructed into a time series, and recorded as an auxiliary third-order tensor. The shape of the auxiliary third-order tensor is (days, 24, aux_features), where aux_features represents all weather and date features.

[0026] In the data preprocessing of this implementation example, a mask matrix is ​​constructed to mark missing values ​​in the data to ensure that during the model training process, the model can focus on generating missing value filling results. The specific method is: identify the specific locations where missing values ​​appear in the thermal metering data, mark the location of each missing value, and record the marked locations in a Boolean matrix to obtain a mask matrix, in which the values ​​of the marked locations in the mask matrix are 0, and the values ​​of the unmarked locations are 1.

[0027] In addition, the normalization method is used to scale the weather information in the heat metering data and auxiliary data to the interval [0,1] to eliminate the dimensional differences between different features and ensure data consistency. For discrete features such as date information, One-Hot encoding is used to process the category information into a binary vector that can be recognized by the computer to ensure that the model can fully understand the impact of date features on the heating system. Table 1 shows the discrete category information conversion rules.

[0028] Table 1 Discrete category information conversion rules data Value One-Hot Encoding Day Type Working days, holidays, weekends 001,010,100 Week Monday to Sunday 0000001,0000010…1000000 Heating time period Early / late heating period, mid heating period 10,01 Through the above steps, this embodiment successfully constructs a dual-channel data structure, which enables the model to simultaneously learn the internal variation rules of heat metering data and the external influence of auxiliary data, providing sufficient feature information support for subsequent data filling and generation.

[0029] Step 2. Construct a dual-channel generative adversarial network. The dual-channel generative adversarial network includes a generator and a discriminator. The generator contains two independent branches and one shared branch. The two independent branches are a thermal metering data channel based on a bidirectional GRU layer and an auxiliary data channel based on a bidirectional GRU layer. The shared branch includes a first activation function, a fully connected layer, and a second activation function connected in sequence. The discriminator is constructed based on a convolutional neural network.

[0030] Step 2.1, GRU generator construction.

[0031] (1) Heat metering data channel (independent branch).

[0032] The heat metering data channel is specifically used to process heat metering data in the heating system, including key variables such as heating and cooling. In order to capture the time dependency of these data, this embodiment designs a two-layer GRU (Gated Recurrent Unit). This structure can dynamically learn the time series features of heat metering data and extract dynamic changes in the data in a time-step-wise manner.

[0033] like Figure 2 The input of the heat metering data channel is a three-order tensor with a shape of (days, 24, meter_features), where days represents the number of days, 24 represents the time step (hour) of each day, and meter_features represents the number of features of the heat metering data. First, for each time step , take the third-order tensor of the heat measurement of the input generator , which is recorded as , and the hidden state of the previous time step Perform linear transformation and calculate update gate (UpdateGate) and ResetGate The specific calculation method is as follows:

[0034] The calculation formula of the update gate is: in, and Represent the weight matrices of input data and hidden state respectively, is the bias term, is the Sigmoid activation function.

[0035] The reset gate is calculated as: in, and is the weight matrix of input and hidden state, is the offset term for resetting the gate. Update gate Controls the current time step The hidden state How much to keep the previous time step information, and reset the gate It determines the hidden state How much information needs to be forgotten.

[0036] By resetting the gate, the hidden state of the previous moment is adjusted to calculate the candidate hidden state (CandidateHiddenState) . It is calculated as follows:

[0037] Among them, the symbol represents element-wise multiplication, and are the weight matrices for input and hidden states, respectively. is the bias term. By introducing the reset gate , the model can selectively forget the previous moment information in the system, thus more effectively adapting to complex time series changes.

[0038] Hidden state at the current time step From the hidden state of the previous moment With candidate hidden states By updating the gate Linear weighting gives: Among them, the update gate Determine the candidate hidden state The hidden state at the previous moment The weighted ratio of , thus flexibly controlling the information flow and memory between time steps. After two layers of GRU processing, the output of the thermal metering data channel is mapped to a time series tensor with a shape of (days, 24, hidden_dim).

[0039] (2) Auxiliary data channel (independent branch).

[0040] Similar to the thermal metering data channel, the auxiliary data channel processes auxiliary features from external environmental conditions such as weather data, date information, etc. These auxiliary data have a significant impact on the thermal metering data, so they need to be processed by an independent GRU channel.

[0041] The auxiliary data channel uses a two-layer GRU structure, and its input is a tensor of shape (days, 24, aux_features), where aux_features represents external environmental features (such as temperature, humidity, wind speed, etc.). In order to maintain consistency with the structure of the heat metering data channel, the GRU layer design of the auxiliary data channel is the same, and the number of hidden units in each layer is set to 128. Figure 2 The input data dimension of the auxiliary data channel is 12+5, where 12 represents the dimension of discrete data and 5 represents the dimension of weather information.

[0042] The core calculation steps of the auxiliary data channel are consistent with the thermal metering data channel, including update gate, reset gate, candidate hidden state and hidden state update. Auxiliary data input , the update gate is calculated in the same way as the thermal metering data channel:

[0043] The reset gate is calculated as: Among them, in the auxiliary data channel , , denote the weight matrix and bias term of the update gate respectively, and , , Reset gate weight matrix and bias term. Determines the hidden state of the previous moment The degree of influence of the information in on the current time step.

[0044] The calculation formula for the candidate hidden state after adjusting by the reset gate is: The final auxiliary data hidden state update formula is: After two layers of GRU processing, the output shape of the auxiliary data channel is a time series tensor of (days, 24, hidden_dim), where hidden_dim represents the feature dimension of each time step.

[0045] (3) Fusion and generation of channel features, feature transformation and output generation (shared branch).

[0046] After extracting the time series features from the heat metering data channel and the auxiliary data channel, the two are added point by point in the feature dimension to generate a fused comprehensive feature representation. Specifically, the heat metering data channel and the auxiliary data channel are set at time step The feature representations are and , first of all, the feature and Fusion, the fused features It is expressed as:

[0047] This point-by-point fusion method can effectively combine the dynamic characteristics of thermal metering data and auxiliary data, enabling the model to capture the complex correlation between thermal metering data and the external environment. Then, the fused features are nonlinearly transformed through the ReLU activation function:

[0048] In the formula, Represents the time step The first activated feature of represents a first activation function, which is a ReLU activation function.

[0049] After the ReLU activation function, the fusion features is input to the fully connected layer, which maps it to the output dimension of the original thermal metering data. The weight matrix of the fully connected layer is set to and the bias term is , then the time step Output representation of the fully connected layer Defined as:

[0050] Subsequently, the output of the fully connected layer is nonlinearly mapped through the hyperbolic tangent activation function (Tanh) to ensure that the generated data is within the normalized range: In the formula, Represents the time step The second activation feature of represents a second activation function, which is a hyperbolic tangent activation function.

[0051] Finally, the output of the generator is passed through the mask matrix With the original input data Combined with, only the missing values ​​are filled. The specific definition is as follows:

[0052] In the formula, represents the generated samples after data filling, represents the mask matrix, A third-order tensor representing the heat quantity of the input generator, represents the output of the generator, i.e., the time step Through the above operations, the final output of the generator only makes reasonable estimates of the missing data and keeps the position of the non-missing data unchanged.

[0053] by Figure 2The data input dimension shown in is used as an example to illustrate the data transmission process. The shape of the thermal metering third-order tensor of the thermal metering data channel of the input generator is 32*24*1. After passing through the bidirectional GRU layer, the shape of the output feature is 32*24*128. The shape of the thermal metering third-order tensor of the auxiliary data channel of the input generator is 32*24*(12+5). After passing through the bidirectional GRU layer, the shape of the output feature is 32*24*128. After the two output features are fused, they are processed by the first activation function to obtain an output feature shape of 32*24*128. Then, after passing through the fully connected layer, the output feature shape is 32*24*128. Finally, after being processed by the second activation function, the output feature shape is 32*24*128.

[0054] Step 2.2: Discriminator construction.

[0055] like Figure 3 The figure shows the model diagram of the discriminator. The discriminator is mainly used to distinguish between real data and generated data in the generative adversarial network (GAN). By continuously optimizing its discrimination ability, it helps the generator generate more realistic samples. In this example, the discriminator design is based on the convolutional neural network (CNN). Through multi-layer convolution, pooling and normalization operations, the temporal features in the input data are gradually extracted, and the fully connected layer is used for classification and discrimination. The overall architecture includes three main modules: convolutional feature extraction, nonlinear activation and pooling, feature flattening and fully connected layer. The design and implementation of each module are as follows.

[0056] (1) Convolutional feature extraction and normalization.

[0057] The discriminator consists of multiple convolutional layers and batch normalization layers, which are designed to extract the temporal features of the input data in layers. (including generated samples and real samples), its shape is (days, 24, 1), where days represents the number of days, 24 represents the time step (hours) of each day, and 1 represents the single channel feature (heating or cooling data). First, the input data is processed by the first layer of convolution operation, which is composed of the convolution kernel and the bias term Perform linear transformation and output feature map (FeatureMap) The calculation formula is:

[0058] in, Indicates that the output feature map is at position The value at For the input feature map at position The value at is the convolution kernel (Filter) at position The weight matrix at is the bias term, and They represent the height and width of the convolution kernel respectively.

[0059] The output of the convolutional layer is normalized through the BatchNormalization layer to accelerate model training and stabilize the gradient of the network. The specific operation of BatchNormalization is as follows:

[0060] in, Indicates that the output feature map is at position The normalized value at and represent the mean and variance of the input data respectively, is a minimum constant that prevents the denominator from being zero. and is a learnable affine transformation parameter used to restore the normalized data distribution. Through the BatchNormalization operation, the model can effectively avoid the gradient vanishing and gradient exploding phenomena and improve the convergence speed during training.

[0061] (2) Nonlinear activation and pooling.

[0062] In order to introduce nonlinear transformation, the discriminator adds a ReLU activation function after each convolution layer. The ReLU activation function is defined as follows:

[0063] in, Represents the data input to the ReLU activation function. The activated feature representation retains the part of the input that is greater than zero, and sets the part that is less than zero to zero, thereby introducing nonlinearity. Compared with other activation functions (such as Sigmoid or Tanh), the ReLU activation function has higher computational efficiency and can effectively alleviate the gradient vanishing problem.

[0064] Subsequently, the activated feature map is subjected to dimensionality reduction operation through the pooling layer. This embodiment uses the average pooling method to downsample the features. The pooling window size is set to 2×2 and the step size is 2. The calculation formula of average pooling is as follows:

[0065] in, The feature map after pooling is at position The value at represents the set of all elements in the pooling window, represents the size of the pooling window, Indicates the internal position of the pooling window The pooling operation can effectively reduce the spatial dimension of the feature map, thereby reducing the amount of calculation and enhancing the model's translation invariance to the features.

[0066] (3) Feature flattening and fully connected layer design.

[0067] After multiple layers of convolution and pooling operations, the discriminator feature map is flattened into a one-dimensional vector through the flattening layer. The flattened feature representation is set as , whose shape is (batch_size, feature_dim), where batch_size is the batch size and feature_dim is the length of the feature vector. The flattened feature vector is input to the fully connected layer (FullyConnectedLayer), and its linear transformation is expressed as follows:

[0068] in, is the weight matrix of the fully connected layer, is the bias term, is the output of the fully connected layer. Through the fully connected layer, the discriminator can map high-dimensional features into scalar representations to represent the discrimination results of the input data.

[0069] (4) Discriminator output and classification judgment.

[0070] After the linear transformation of the fully connected layer, the discriminator passes the output to the Sigmoid activation function to map it to the interval [0,1], thereby indicating the probability that the input sample is real data. The Sigmoid activation function is defined as follows:

[0071] in, represents the linear combination result of the input features, Represents the output of the Sigmoid activation function. The Sigmoid activation function can compress the input features to the interval [0,1] and output a scalar value representing the probability. Finally, the discriminator uses this probability value as its judgment result on the authenticity of the input data to guide the optimization direction of the generator.

[0072] That is, the discriminator of this embodiment is designed as a multi-layer structure. In the overall design of the discriminator, a total of four convolutional layers are included, and the number of convolution kernels is gradually increased between layers to enhance the model's ability to represent high-dimensional features. Specifically, it includes four convolutional layers, a flattening layer, and a fully connected layer connected in sequence, and each convolutional layer is connected to a normalization layer, a ReLU activation function, and an average pooling layer.

[0073] by Figure 3 Taking the input discriminator feature shape of 32*24*1 as an example to illustrate the flow process, the shape of the input feature after passing through four convolutional layers changes to 32*24*64, 32*12*128, 32*6*256 and 32*3*512 respectively. After the flattening process of the flattening layer, the shape of the feature becomes 32*1536, and then the shape of the output feature after the fully connected layer is 32*1.

[0074] Step 3: Input the third-order calorimetric tensor and the auxiliary third-order tensor into the generator at the same time, and fill the third-order calorimetric tensor with data using the output of the generator based on the mask matrix, and input the generated sample after data filling into the discriminator, calculate the discriminator loss function based on the output of the discriminator, and update and trim the weight of the discriminator based on the discriminator loss function. This embodiment optimizes the generator and the discriminator through the Wasserstein function.

[0075] (1) Generator loss function.

[0076] The generator aims to generate samples that are as close as possible to the real data distribution, so that the discriminator cannot effectively distinguish between the generated samples and the real samples. To achieve this goal, the generator uses the Wasserstein loss function, which is defined as follows:

[0077] in, represents the generator loss function, whose goal is to minimize the discriminant score of the generated samples. Indicates the generated sample Distribution from generator , Represents the discriminator to generate samples The output score (i.e., the discrimination result) of

[0078] The goal of the generator is to make the discriminator To generate samples The output score As close as possible to the true data score, thereby minimizing This forces the discriminator to believe that the generated samples are indistinguishable from real samples.

[0079] (2) Loss function of the discriminator.

[0080] The discriminator is optimized in the generative adversarial network by maximizing its ability to distinguish between real samples and generated samples. To this end, this embodiment adopts the Wasserstein loss function and is defined by the following objective function:

[0081] in, is the discriminator loss function, whose goal is to maximize the true sample score And the generated sample score The difference between Express expectations, Represents the real sample Distribution from real data , real sample The third-order tensor of the thermometric data corresponding to the thermometric data without missing data in the training data, Indicates the generated sample Distribution from generator , Represents the discriminator for the real sample The output score of Represents the discriminator to generate samples The output score of .

[0082] By minimizing and maximize , the discriminator can form a clear distinction boundary between real data and generated data, thereby improving its discrimination ability.

[0083] (3) Weight clipping of the discriminator.

[0084] To ensure that the discriminator satisfies the 1-Lipschitz continuity condition, this paper adds a weight clipping strategy during discriminator training. Specifically, for each weight of the discriminator , the clipping strategy is:

[0085] In the formula, Represents a clipping operation. Represents the clipping threshold, the weight after clipping Restricted to the interval For all weights of the discriminator, by Restricted to the interval Within , the output change of the discriminator can be kept within a small range, thereby avoiding its drastic response to the input data and ensuring that it satisfies the 1-Lipschitz continuity. At the same time, according to the characteristics of thermal measurement data, different weight ranges are adopted in different training stages to obtain better training effects.

[0086] Step 4: After the discriminator is updated for multiple rounds, the generator loss function is calculated to update the generator weights by minimizing the probability that the generated sample is judged as real data by the discriminator.

[0087] This embodiment adopts an alternating optimization strategy of the generator and the discriminator. Specifically, in each training iteration, the generator and the discriminator perform adversarial training by alternating optimization. Specifically, the discriminator is trained multiple times before each generator update (for example, n_critic=5) to ensure that it has sufficient discriminative ability to guide the optimization of the generator. The generator improves its generation effect by minimizing the probability that its generated samples are judged as real data. The entire optimization process is as follows:

[0088] (1) Update the discriminator weight parameters :use Backpropagation is performed as the objective function and the discriminator weights are clipped.

[0089] (2) Update the generator weight parameters :use Backpropagation is performed as the objective function, and the generated weights are updated.

[0090] This alternating optimization strategy can ensure that the generator and the discriminator maintain a dynamic balance during the training process, thereby gradually improving the overall generation effect of the model.

[0091] Step 5: Complete the thermal metering data filling based on the trained generator and the mask matrix of the thermal metering data to be filled. In the inference application process, obtain the thermal metering data with missing data, generate a mask matrix based on the thermal metering data with missing data, and then convert the thermal metering data with missing data into a thermal metering third-order tensor. The converted thermal metering third-order tensor is input into the generator. Based on the mask matrix, the output of the generator is used to fill the thermal metering third-order tensor with data to obtain the filled data.

[0092] The present invention provides a heat metering data filling method based on a dual-channel generative adversarial network, which can effectively handle the missing problem of multi-dimensional heat metering data in the heating system. By performing dual-channel modeling on heat metering data and auxiliary data (such as weather information and date features), the time dependency and nonlinear characteristics of the data are fully captured. This method can not only improve the accuracy of missing data filling, but also ensure the stability and consistency of generated data, effectively avoiding the mode collapse problem in generative adversarial network (GAN) training.

[0093] In the experiment of simulating missing data filling, the real heating data of a community in northern China was used as the heat metering data set, and the meteorological data of NASA was used as the auxiliary data set. Data interpolation was performed under the condition of simulated data missing. After the interpolation was completed, the interpolation results were evaluated by MAE (Mean Absolute Error) and MAPE (Mean Absolute Percentage Error), and compared with the classic interpolation methods (linear interpolation, KNN (K-Nearest Neighbors) and mean interpolation). The results are shown in Table 2.

[0094] Table 2 Experimental results method Evaluation Metrics MAE Evaluation Metrics MAPE Method of the present invention 0.0455 0.1200 Linear interpolation 0.5209 1.3868 KNN 0.2189 0.5939 Mean interpolation 1.9508 5.2423 According to the experimental results, the present invention can effectively improve the accuracy of filling missing values ​​of thermal metering data through the adversarial training method, especially in complex multi-dimensional time series data scenarios.

[0095] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A method for filling in thermal measurement data based on a dual-channel generative adversarial network, characterized in that: The thermal measurement data filling method based on the dual-channel generative adversarial network includes: Obtain heat metering data and reconstruct it into a heat metering third-order tensor, and obtain weather information and date information and reconstruct it into an auxiliary third-order tensor; Marking the position of each missing value in the thermal metering data with missing data, and recording the marked positions in a Boolean matrix to obtain a mask matrix, wherein the value of the marked position in the mask matrix is ​​0, and the value of the unmarked position is 1; Constructing a dual-channel generative adversarial network, the dual-channel generative adversarial network includes a generator and a discriminator, the generator includes two independent branches and a shared branch, the two independent branches are respectively a thermal metering data channel based on a bidirectional GRU layer and an auxiliary data channel based on a bidirectional GRU layer, the shared branch includes a first activation function, a fully connected layer, and a second activation function connected in sequence, and the discriminator is constructed based on a convolutional neural network; The third-order heat meter tensor and the auxiliary third-order tensor are simultaneously input into the generator. Based on the mask matrix, the output of the generator is used to fill the data of the third-order heat meter tensor, and the generated samples after data filling are input into the discriminator. The discriminator loss function is calculated according to the output of the discriminator, and the weight of the discriminator is updated and clipped based on the discriminator loss function. After the discriminator is updated for multiple rounds, the generator loss function is calculated to update the generator weights by minimizing the probability that the generated sample is judged as real data by the discriminator; The thermal metering data filling is completed based on the trained generator and the mask matrix of the thermal metering data to be filled.

2. The method for filling in thermal measurement data based on a dual-channel generative adversarial network according to claim 1 is characterized in that: The step of obtaining the heat measurement data and reconstructing it into a heat measurement third-order tensor includes: Obtain heat metering data, including heating, temperature recovery and instantaneous flow; Normalize the heat metering data; The normalized heat metering data is divided into days and hours, and the heat metering data of 24 hours a day is reconstructed into a third-order tensor, recorded as a heat metering third-order tensor. The shape of the heat metering third-order tensor is (days, 24, meter_features), where days represents the number of days, 24 is the number of hours per day, and meter_features is the divided heat metering data.

3. The method for filling thermal measurement data based on dual-channel generative adversarial network according to claim 1 is characterized in that: The weather information and date information are obtained and reconstructed into an auxiliary third-order tensor, including: Obtain weather information including temperature, humidity, wind speed, wind direction and solar radiation, and obtain date information including day type, week and heating time period; The temperature, humidity, wind speed, wind direction and solar radiation are normalized, and the day type, week and heating time period are converted into binary vectors using One-Hot encoding; The normalized weather information and the date information converted into binary vectors are divided into days and hours, and the weather information and date information of 24 hours a day are reconstructed into a third-order tensor, which is recorded as an auxiliary third-order tensor. The shape of the auxiliary third-order tensor is (days, 24, aux_features), where days represents the number of days, 24 represents the number of hours per day, and aux_features represents the weather information and date information after segmentation.

4. The method for filling thermal measurement data based on dual-channel generative adversarial network according to claim 1 is characterized in that: The shared branch of the generator is processed as follows: Take the heat metering data channel and the auxiliary data channel at the time step The feature representations are and , first of all, the feature and Fusion, the fused features It is expressed as: Next, the fused features Nonlinear transformation is performed through the first activation function: In the formula, Represents the time step The first activated feature of represents a first activation function, wherein the first activation function is a ReLU activation function; Set the weight matrix of the fully connected layer to and the bias term is , then the time step Output representation of the fully connected layer Defined as: Then, the output of the fully connected layer is activated by the second activation function Nonlinear mapping is performed, which is expressed as follows: In the formula, Represents the time step The second activation feature of represents a second activation function, which is a hyperbolic tangent activation function.

5. The method for filling in thermal measurement data based on a dual-channel generative adversarial network according to claim 1, characterized in that: The step of inputting the heat metering third-order tensor into the generator and performing data padding on the heat metering third-order tensor using the output of the generator based on the mask matrix includes: In the formula, represents the generated samples after data filling, represents the mask matrix, A third-order tensor representing the heat quantity of the input generator, represents the output of the generator, i.e., the time step The second activation feature.

6. The method for filling in thermal measurement data based on a dual-channel generative adversarial network according to claim 1, characterized in that: The discriminator includes four convolutional layers, a flattening layer and a fully connected layer connected in sequence, and each convolutional layer is connected to a normalization layer, a ReLU activation function and an average pooling layer.

7. The method for filling thermal measurement data based on dual-channel generative adversarial network according to claim 1 is characterized in that: The discriminator loss function is as follows: In the formula, is the discriminator loss function, Express expectations, Represents the real sample Distribution from real data , real sample The third-order tensor of the thermometric data corresponding to the thermometric data without missing data in the training data, Indicates the generated sample Distribution from generator , Represents the discriminator for the real sample The output score of Represents the discriminator to generate samples The output score of The generator loss function is as follows: In the formula, represents the generator loss function.

8. The method for filling thermal measurement data based on dual-channel generative adversarial network according to claim 1 is characterized in that: The weights of the cropping discriminator include: For each weight of the discriminator , the clipping strategy is: In the formula, Represents a clipping operation. Represents the clipping threshold, the weight after clipping Restricted to the interval Within.

Citation Information

Patent Citations

  • Missing data filling generation method based on dual-condition generative adversarial network

    CN114757335A

  • Network traffic data completion method and system based on generative adversarial network

    CN117194903A

  • Abnormal data reconstruction method and system based on isolated forest adversarial network

    CN117520954A

  • Vibration electromagnetic multi-field data filling system and method based on normalized flow

    CN118211066A

  • Classification system and method based on generative adversarial network

    US20220207300A1

Cited By

  • Laboratory equipment data sharing and analysis method and system based on multi-modal model

    CN120524338A