Method and system for complementing missing values of multi-dimensional power consumption time sequence data
By adopting the two-stage missing value interpolation method of the Bi-GRUI and Transformer variant of the bidirectional gated cycle unit in the processing of electricity consumption data, the problem of missing value completion of electricity consumption data is solved, the data quality and modeling capabilities are improved, and the market-oriented reform of electricity prices is supported.
Patent Information
- Application Number
- CN202411851142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-18
AI Technical Summary
The existing technology is difficult to effectively deal with missing values in electricity consumption data, resulting in the lack of data collected by users' electricity loads, affecting the development of dynamic time-sharing settlement and the reform of market-oriented electricity prices.
The two-stage missing value interpolation method based on the bidirectional gating cyclic units Bi-GRUI and Transformer variants is adopted to capture the time correlation between multivariate timing data through the autoencoder, and the potential relationship between timing and dimensions is mined through the Transformer variant to complete the missing value.
The quality of damaged time series data has been significantly improved, the model's modeling ability to model time series data, effectively fit the user's electricity consumption timing, and support the in-depth development of the market-oriented reform of electricity prices.
Smart Images

Figure CN119848444A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power data processing, and in particular relates to a method and system for completing missing values of multi-dimensional power consumption time series data. Background Art
[0002] The accuracy of electricity consumption data collection directly affects the user's fee settlement. The new generation of electricity consumption information collection system has the characteristics of large scale, wide distribution, heterogeneous equipment and diversified business. As a result, the requirements for the quality of power data collection are constantly increasing; the collection of electricity consumption data of tens of millions of users is large-scale, some collection tasks are incompletely configured, and terminal equipment and channels are abnormal, resulting in missing electricity load collection data for a small number of users; especially with the development of time-of-use electricity price business, the electricity price time periods of different user groups are inconsistent and the time periods change frequently. Frequent adjustment of time zone and time period parameters will increase the risk of parameter failure, omission and error; therefore, it is urgent to carry out research on user electricity consumption data fitting and completion methods, so as to realize dynamic time-of-use settlement of users and support the in-depth development of electricity price market-oriented reform.
[0003] Traditionally, the missing data of electricity consumption collection are often processed by the mean filling method or the typical electricity consumption day data filling method. On the one hand, the quality of the filled data is uneven, and on the other hand, it will increase the workload and work cost of business personnel. In addition, with the continuous growth of energy demand and the continuous improvement of environmental protection awareness, time-of-use electricity price policy, as a means to adjust the peak and valley differences of energy consumption and promote energy conservation and emission reduction, has been paid attention to by more and more countries and regions. The impact of time-of-use electricity price on commercial consumption has also increased the difficulty of filling the missing values of user load. In recent years, a lot of work has been done to fill the missing values through statistical and machine learning methods, but it is often difficult to consider the impact of external factors on user electricity consumption behavior.
[0004] Therefore, the scheme for completing missing values in electricity consumption data cannot guarantee the success rate and completeness of electricity consumption data collection, resulting in the inability to widely carry out dynamic time-sharing settlement for users. Summary of the invention
[0005] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a method and system for filling missing values of multidimensional electricity consumption time series data. Based on the bidirectional gated recurrent unit Bi-GRUI and Transformer variants, a two-stage interpolation method is adopted to further enhance the modeling ability of the model for time series data and improve the quality of damaged time series data.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] A first aspect of the present invention provides a method for completing missing values of multi-dimensional electricity consumption time series data.
[0008] A missing value filling method for multi-dimensional electricity consumption time series data, comprising:
[0009] Obtain the multi-dimensional electricity consumption time series data to be completed, and pre-process it into a multi-variable time series matrix;
[0010] Input the multivariate time series matrix into the trained completion model to complete the missing values and obtain the completed multivariate time series matrix;
[0011] Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
[0012] Furthermore, the autoencoder includes an encoder and a decoder;
[0013] An encoder is constructed using a bidirectional gated recurrent unit with a time decay factor, the encoder taking a multivariate time matrix as input and a context vector as output;
[0014] A decoder is constructed using global attention and time-of-use electricity price influence factors. The decoder takes the context vector as input and the completed multivariate time series matrix as output.
[0015] Furthermore, the bidirectional gated recurrent unit with a time decay factor uses the time decay factor to modify the input at the corresponding moment;
[0016] The time decay factor is based on the time lag between the current value and the last valid value, and a time lag matrix is constructed for the multivariable time series matrix, thereby calculating the time decay factor at each moment.
[0017] Furthermore, the specific processing flow of the decoder for the input context vector is as follows:
[0018] First, the latent vector is calculated through the gated recurrent unit;
[0019] Secondly, the global attention score of the latent vector is calculated and normalized;
[0020] Then, the normalized calculation result is residually connected with the latent vector, and then multiplied by the time-of-use electricity price impact factor;
[0021] Finally, the output of the decoder is obtained through a linear layer.
[0022] Furthermore, the time-of-use electricity price influencing factor is calculated by a negative exponential formula based on the time-of-use electricity price and learnable parameters.
[0023] Furthermore, the Transformer variant includes an embedding layer, a plurality of feature extraction modules and an output layer;
[0024] Among them, the feature extraction module includes multi-head self-attention operation, residual connection and normalization layer, temporal convolution layer and feature convolution layer in sequence.
[0025] Furthermore, the temporal convolution layer performs a 1D convolution operation on the time dimension based on a gated linear unit structure;
[0026] The feature convolution layer performs a 1D convolution operation on the feature dimension based on a gated linear unit structure.
[0027] A second aspect of the present invention provides a system for completing missing values of multi-dimensional electricity consumption time series data.
[0028] A missing value completion system for multi-dimensional electricity consumption time series data, including a preprocessing module and a completion module:
[0029] The preprocessing module is configured to: obtain the multi-dimensional electricity consumption time series data to be completed, and preprocess it into a multi-variable time series matrix;
[0030] The completion module is configured to: input the multivariate time series matrix into the trained completion model, complete the missing values, and obtain the completed multivariate time series matrix;
[0031] Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
[0032] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in a method for completing missing values of multi-dimensional electricity consumption time series data as described in the first aspect of the present invention.
[0033] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a method for completing missing values of multidimensional electricity consumption time series data as described in the first aspect of the present invention are implemented.
[0034] One or more of the above technical solutions have the following beneficial effects:
[0035] 1. To address the problem of missing power data, the present invention proposes a two-stage missing value interpolation method based on an autoencoder and a Transformer variant of a bidirectional gated recurrent unit, which respectively captures the temporal correlation between multivariate time series data and the potential relationship between time series and dimensions, enhances the modeling ability of the model for time series data, effectively fits the user's power consumption time series, and improves the quality of damaged time series data.
[0036] 2. The influencing factor of time-of-use electricity price is introduced and used as the global attention input data of the autoencoder, so as to fully explore the correlation between users' electricity consumption behavior and time-of-use electricity price and improve the data fitting quality.
[0037] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0039] Figure 1 This is a structural diagram of the two-stage missing value interpolation model of the first embodiment.
[0040] Figure 2 It is a structural diagram of the gated recurrent unit GRUI of the first embodiment.
[0041] Figure 3 It is a bidirectional GRUI structure diagram of the first embodiment.
[0042] Figure 4 This is a structural diagram of the temporal convolutional layer of the first embodiment.
[0043] Figure 5 This is a comparative experimental diagram of the first embodiment.
[0044] Figure 6 This is a graph showing the hyperparameter sensitivity experiment results of the first embodiment. DETAILED DESCRIPTION
[0045] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0046] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0047] The accuracy of electricity consumption data collection directly affects the user's fee settlement. In view of the fact that the electricity consumption data collection of tens of millions of users inevitably has the problem of partial data missing, especially with the development of time-of-use electricity price business, the electricity price periods of different user groups are inconsistent and the collection period changes frequently, which further reduces the success rate and completeness rate of electricity consumption data collection. To this end, the present invention proposes a two-stage missing value interpolation model of a bidirectional gated recurrent unit Bi-GRUI and a Transformer variant. The model adopts a two-stage interpolation method as a whole:
[0048] In the first stage, an autoencoder (AE) structure based on a bidirectional gated recurrent unit (Bi-GRUI) is used to complete missing values in the preprocessed data. The influence of time-of-use electricity price factors and time decay factors are considered and introduced into the global attention of the decoder to fully explore the time-of-use differences and time series correlations of user electricity consumption data.
[0049] In the second stage, the completed values are put into the Transformer variant to further extract relevant information from different dimensions such as time and features to obtain the final missing value completion result.
[0050] Experimental results show that the model proposed in this invention can effectively fit the missing values of user load and can be used to support the construction of a new generation of acquisition systems.
[0051] Embodiment 1
[0052] In one embodiment of the present disclosure, a method for filling missing values in multi-dimensional electricity consumption time series data is provided, comprising the following steps:
[0053] Step S1: Acquire the multi-dimensional electricity consumption time series data to be completed, and pre-process it into a multi-variable time series matrix;
[0054] Step S2: input the multivariate time series matrix into the trained completion model to complete the missing values and obtain the completed multivariate time series matrix;
[0055] Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
[0056] Furthermore, the autoencoder includes an encoder and a decoder;
[0057] An encoder is constructed using a bidirectional gated recurrent unit with a time decay factor, the encoder taking a multivariate time matrix as input and a context vector as output;
[0058] A decoder is constructed using global attention and time-of-use electricity price influence factors. The decoder takes the context vector as input and the completed multivariate time series matrix as output.
[0059] Furthermore, the bidirectional gated recurrent unit with a time decay factor uses the time decay factor to modify the input at the corresponding moment;
[0060] The time decay factor is based on the time lag between the current value and the last valid value, and a time lag matrix is constructed for the multivariable time series matrix, thereby calculating the time decay factor at each moment.
[0061] Furthermore, the specific processing flow of the decoder for the input context vector is as follows:
[0062] First, the latent vector is calculated through the gated recurrent unit;
[0063] Secondly, the global attention score of the latent vector is calculated and normalized;
[0064] Then, the normalized calculation result is residually connected with the latent vector, and then multiplied by the time-of-use electricity price impact factor;
[0065] Finally, the output of the decoder is obtained through a linear layer.
[0066] Furthermore, the time-of-use electricity price influencing factor is calculated by a negative exponential formula based on the time-of-use electricity price and learnable parameters.
[0067] Furthermore, the Transformer variant includes an embedding layer, a plurality of feature extraction modules and an output layer;
[0068] Among them, the feature extraction module includes multi-head self-attention operation, residual connection and normalization layer, temporal convolution layer and feature convolution layer in sequence.
[0069] Furthermore, the temporal convolution layer performs a 1D convolution operation on the time dimension based on a gated linear unit structure;
[0070] The feature convolution layer performs a 1D convolution operation on the feature dimension based on a gated linear unit structure.
[0071] The following describes in detail the implementation process of a missing value completion method for multi-dimensional electricity consumption time series data in this embodiment from two aspects: model construction and experimental verification.
[0072] 1. Constructing a two-stage missing value interpolation model of Bi-GRUI+Transformer
[0073] Starting from model training and model structure, the process of building a model for actual completion is explained.
[0074] 1.1 Multivariate Time Series Matrix Definition
[0075] A multivariate time series matrix with m variables and length n is defined as in is time t i ∈T, where represent The jth variable of n ) T is the time matrix of the multivariate time series matrix; the following description is made by taking the complete multivariate time series matrix with m=4 and n=3 as an example, wherein the value of the t1 timestamp is set to 0:
[0076]
[0077] 1.2 Data Preprocessing
[0078] The model is used to fill in the missing value data, so the model needs to be trained with training data to enable it to learn modeling and completion capabilities. In this embodiment, the mask matrix is used to construct the training data, specifically:
[0079] Masking is performed on the complete multivariate time series matrix to simulate the missing data part; by introducing the mask matrix To perform the mask operation of the original sequence, Indicates t i The j-th variable at time is a missing value. Indicates that data exists; according to the following mask matrix M, the multivariate time series matrix after the mask operation is completed can be obtained:
[0080]
[0081] And because the electricity load trends and volumes of users in different industries such as agriculture, industry and commerce are very different, mathematical statistical methods are used to extract the statistical features s of each category of users as the conditional input of the model. The statistical features s include the one-dimensional vector of the user's monthly peak-to-valley difference rate, peak (spike) electricity proportion, and valley electricity proportion. In addition, considering the impact of time-of-use electricity prices on user electricity consumption structure, the time-of-use electricity price impact factor τ is introduced as the auxiliary input of the decoder.
[0082] 1.3 Model Architecture
[0083] The two-stage missing value interpolation model of this embodiment is as follows: Figure 1 As shown, a two-stage interpolation scheme is adopted to reduce the error that may be caused by single interpolation.
[0084] In the first stage, the autoencoder structure is used as a whole to complete the interpolation of missing values. In order to fully capture the temporal correlation between multivariate time series data, a bidirectional gated recurrent unit with a time decay factor is used as the main part of the encoder. In the decoding stage, global attention and time-of-use electricity price influencing factors are used to better complete the fitting operation of the original data.
[0085] In the second stage, considering the advantages of Transformer in various aspects, it is used as the feature extractor of the second stage, and the original fully connected feedforward network layer (FFN) of Transformer is replaced with time convolution layer and feature convolution layer to fully explore the potential relationship between time series and dimension.
[0086] 1.3.1 The first interpolation stage based on autoencoder AE
[0087] Due to the existence of missing values, the time intervals between two adjacent existing values are different, and different time intervals have different impacts on time series data, which also makes their impact on missing values very different; it is generally believed that the closer the missing value is to the existing value, the greater the impact of the existing value will be. For this reason, the time lag between the current value and the last valid value is defined, that is, the difference between the current moment and the moment of the nearest valid value in the previous moment. And introduce the time lag matrix The following is the calculation formula for the time delay matrix δ corresponding to the multivariate time series matrix X:
[0088]
[0089] in, Indicates t i-1 At the moment, the jth variable exists. This means the variable is missing.
[0090] Based on this, the time decay factor in GRUI can be obtained The calculation formula is:
[0091]
[0092] Among them, W β and b β is a learnable parameter, and the negative exponential formula is used to ensure that β ti ∈(0,1]. Therefore, the gated recurrent unit GRUI with a time decay factor, such as Figure 2 As shown, the state update process is expressed by the following formula:
[0093]
[0094]
[0095]
[0096] in, is the time decay factor calculated by formula (6), and are the hidden states of the i-1th step and the i-th step respectively, To update the gate, To reset the gate, is the candidate hidden state, W μx , W rx , W μs , W rs , b μ , b r , is a learnable parameter, σ is the sigmoid activation function, and ⊙ is the bit-by-bit multiplication.
[0097] Using bidirectional GRUI as the encoder structure, the multivariate time series matrix after mask operation is completed and user statistical features s as the input of the encoder, the specific structure of the bidirectional GRUI is as follows Figure 3 As shown, with the update of the hidden state at each time step, we can get the i and from t n The hidden vectors in two different time directions to t1, the hidden vector groups h1 and h2 at the first and second moments, and all the hidden vectors H en As shown below:
[0098]
[0099] Finally, according to the latent vectors at the last moment in both directions and Find the final context vector z of the encoder and use it as the initial hidden state of the decoder:
[0100]
[0101] Where g is a linear function.
[0102] In the decoder part, the output of step i is used as the input of step i+1 for the next decoding operation. The specific decoding process of step i is:
[0103] First, the latent vector of the decoder step i is calculated by GRUI Secondly, the latent vector H en Calculate the global attention score and normalize it to get α i,j , and then compare the calculated result with Perform a residual connection, then multiply it by the time-of-use electricity price impact factor τ, and finally pass a linear layer to get the output of the decoder The formula is:
[0104]
[0105]
[0106] The higher the electricity price v is in a certain period of time, the more likely it is to constrain the user's electricity consumption level. Therefore, the time-of-use electricity price impact factor τ in the above formula can be calculated as:
[0107]
[0108] Among them, W τ and b τ is a learnable parameter, and the negative exponential formula is used to ensure that τ∈(0,1].
[0109] After n time steps, the final decoding result X1 is obtained; in order to better perform the interpolation operation in the second stage, the value of the non-masked part of the reconstructed data X1 is replaced with the original data value so as to serve as the input value of the subsequent operation, which is expressed by the formula:
[0110] X m =M⊙X+(1-M)⊙X1 (19)
[0111] 1.3.2 Second interpolation stage based on Transformer variants
[0112] Based on the advantages of the multi-head attention mechanism in Transformer in extracting time dimension features and its advantages in parallel computing, this part chooses to perform the second stage of interpolation operation based on the Transformer module.
[0113] The matrix X after the completion of the first stage m And the mask matrix M is used as the model input of this part. The specific steps are:
[0114] (1) Perform a concat operation on it, and then extract features through the embedding layer to obtain the embedded vector E, which can be expressed as:
[0115] X cat =Concat(X m ,M) (20)
[0116] E=Dropout(Embedding(X cat )) (twenty one)
[0117] (2) After passing through the N-layer feature extraction module, in this embodiment, N is 2. The feature extraction module first performs a multi-head self-attention operation on the input embedding vector E to capture the correlation of the time dimension between the data, which is expressed as:
[0118] Q=EW Q ,K=EW K ,V=EW V (twenty two)
[0119]
[0120] MultiHead(Q,K,V)=Concat(head1,head2,…,head h )W (25)
[0121] Then, after the residual connection and normalization layer, that is, the Add&Norm module in the model diagram, we get X LN1 :
[0122] X LN1 =LN(E+Dropout(MultiHead(Q,K,V))) (26)
[0123] Next, the temporal convolution layer and the feature convolution layer are used in sequence to extract the temporal relationship and the relationship between features respectively.
[0124] In the temporal convolution layer, a 1D convolution operation based on the gated linear unit (GLU) structure is used, and padding operation is performed to ensure that the input and output data dimensions are the same. The specific model structure is as follows: Figure 4 As shown, it can be expressed as:
[0125]
[0126] Among them, ⊙ is the Hadamard product and σ is the sigmoid activation function.
[0127] Then, the input X of the feature convolution layer is obtained through residual connection and normalization layer. LN2 , expressed as:
[0128]
[0129] Similarly, in the feature convolution layer, a 1D convolution operation is also performed on the feature dimension, and a padding operation is performed to ensure that the input and output data dimensions are the same. Then, the output X of the feature extraction module is obtained through a residual connection and a normalization layer. LN3 , expressed as:
[0130]
[0131] (3) After passing through the feature extraction module, it enters the final output layer to obtain the second-stage interpolation result X2, which can be expressed as:
[0132] X2=ReLu(X LN3 W α +b α )W β +b β (31)
[0133] Among them, W α , W β , b α , b β is a learnable parameter and ReLu is the activation function.
[0134] Since the purpose of this process is only to interpolate and fit the missing values, the mask matrix M is used to replace the original values of the non-masked part of the final output result X2 to obtain the final result X2 after missing value completion. out , expressed as:
[0135] X out =M⊙X+(1-M)⊙X2 (32)
[0136] 1.3.3 Loss Function
[0137] Since this model performs two-stage interpolation operations and the model input of the second stage depends on the missing value fitting value of the first stage, the interpolation loss only considers the final output result X out The missing value fitting part of the two stages is not related to the reconstruction part of the non-missing value part. Therefore, the reconstruction loss part should take both X1 and X2 into account.
[0138] The reconstruction loss function of a single stage can be calculated as follows:
[0139]
[0140] in, It can be expressed as X1 or X2, where X is the original data, M is the mask matrix, and the loss function uses the root mean square loss (RMSE). Since it is a reconstruction loss, only the non-missing part of the data is considered.
[0141] The final reconstruction loss It can be expressed as:
[0142]
[0143] Wherein, α is a hyperparameter for adjusting the weight of the reconstruction loss in the first stage and the second stage, and in this embodiment, α=0.5.
[0144] The interpolation loss is different from the reconstruction loss. It only considers the missing value part of the final output result. Therefore, the final interpolation loss The calculation formula is as follows:
[0145]
[0146] Among them, R is the mask matrix of the original data without masking operation.
[0147] The final loss function As shown below:
[0148]
[0149] Here, λ is the weight ratio of the reconstruction loss. In this embodiment, λ=1, which aims to balance the model's ability to interpolate missing data values and its ability to learn the original time series data pattern.
[0150] 2 Experimental results
[0151] 2.1 Data Description
[0152] To verify the effectiveness of this model, this embodiment uses the load data of industrial and commercial users from the power consumption information collection system of a province of the State Grid to train and test the model; after dividing the obtained data set by hour, a total of 68147 samples are obtained, each sample contains the user's yesterday's power indication curve code, the daily frozen power indication and other features, each sample contains 25 time points, and the 25th point is spliced with the 0 point of the next day's curve; in addition, this embodiment takes into account the user's monthly peak-to-valley difference rate, peak (spike) power proportion, valley power proportion and other statistical characteristics as well as the time-of-use electricity price v; then this embodiment divides it into training set, test set and validation set in a ratio of 3:1:1, respectively, to verify the effectiveness of the model of this embodiment.
[0153] 2.2 Experimental environment and evaluation indicators
[0154] The operating system used in this experiment is Ubuntu 18.04.3LTS, the CPU is Intel(R) Core(TM) i9-9980XE CPU@3.00GHz, the memory is 128G DDR4@3200MHz, the graphics card is NVIDIA TITAN RTX×2, and the model modeling and training is based on the PyTorch 1.12.1 framework Python 3.8.13.
[0155] In the first stage of the model, the hidden layer dimension is 32, the learning rate of the autoencoder is 0.001, the embedding dimension of the second stage is 32, the ID convolution kernel size is 3×32, the padding size is 1, the step size is 1, the Dropout size is 0.5, the Epoch is 500, the batch size is 128, the first and second stage reconstruction loss weight parameters are α=0.5, and the reconstruction loss weight ratio λ=1.
[0156] This embodiment uses the root mean square loss (RMSE) as the evaluation indicator of this experiment. The calculation process is the same as the interpolation loss in formula (34), which represents the average error between the interpolation result and the target value. The smaller the value, the better the model interpolation performance.
[0157] 2.3 Experimental comparison
[0158] In order to verify the effectiveness of this model, this embodiment conducts comparative experiments on a large number of baseline models, and tests the performance of different models under different data missing rates by setting different data missing rates (MR) for the original data; this embodiment selects M-RNN, GP-VAE, BRITS, SSGAN, SAITS, SSSD and other baselines for experimental research, and the experimental results are shown in Tables 1 and Figure 5 As shown:
[0159] Table 1. Comparison of model experimental performance
[0160]
[0161] It can be seen that when the missing rate of the power data set is the highest, this model achieves the best result, which is 14.8% higher than the best baseline model SSSD when the data missing rate is 50%. When the data missing rate is 30%, the performance of this model is 15.4% higher than that of the SSSD model.
[0162] 2.4 Ablation Experiment
[0163] In order to study the role of each module in this model, this embodiment performs ablation experiments on various parts of the model. The experimental results are shown in Table 2:
[0164] Table 2. Ablation experiments
[0165]
[0166] Among them, w / oBi-GRUI means that only a simple GRU is used to replace the Bi-GRUI module, w / o represents that reconstruction loss is not used, and w / o 1D-Conv represents that only FFN in the original Transformer is used without using timing and feature convolution operations. In this embodiment, it can be seen that considering the time lag between existing data and extracting features of each dimension through convolution plays a certain role in the interpolation work, and adding reconstruction loss can also effectively improve the learning ability of the model.
[0167] 2.5 Hyperparameter Sensitivity Experiments
[0168] This example studies the impact of different values of the reconstruction loss weight ratio parameter λ and the dimension d of the latent vector in GRUI on the model. The experimental results are as follows: Figure 6 As shown:
[0169] This embodiment conducts experiments when the data missing rate is 10%, 30%, and 50%. It can be seen that the model effect is best when the reconstruction loss weight ratio λ=1, which shows that the reconstruction loss is helpful for improving the model's learning ability of time series data patterns, and when λ is too large, the model focuses more on the reconstruction task and reduces the model's interpolation and fitting ability; for the hyperparameter embedding dimension d=32, the model performance is optimal, while too large or too small will lead to a decrease in performance, indicating that when the embedding dimension is too small, the knowledge cannot be fully learned, and when it is too large, it may cause overfitting.
[0170] In response to the missing data in the electricity consumption data set, this embodiment proposes a method for completing missing values of electricity consumption data taking into account the influencing factors of time-of-use electricity prices. This method adopts a two-stage interpolation strategy to reduce the errors that may be caused by single interpolation, thereby improving the modeling ability of the model for time series data: in the first stage, a generative model with an autoencoder structure is used as a whole to complete the interpolation of missing values. In order to fully capture the time correlation between multivariate time series data under different types of users, user statistical characteristics are considered and Bi-GRUI units are used as the main part of the encoder; in the decoding stage, global attention and time-of-use electricity price influencing factors are used to better complete the reconstruction of the original data; at the same time, Transformer is used as the feature extractor of the second stage, and its FFN is replaced by time series and feature convolution layers to fully explore the potential relationship between time series and dimensions, and this model has achieved good results on this data set.
[0171] Embodiment 2
[0172] In one embodiment of the present disclosure, a system for completing missing values of multi-dimensional electricity time series data is provided, including a preprocessing module and a completion module:
[0173] The preprocessing module is configured to: obtain the multi-dimensional electricity consumption time series data to be completed, and preprocess it into a multi-variable time series matrix;
[0174] The completion module is configured to: input the multivariate time series matrix into the trained completion model, complete the missing values, and obtain the completed multivariate time series matrix;
[0175] Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
[0176] Embodiment 3
[0177] The purpose of this embodiment is to provide a computer-readable storage medium.
[0178] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in a method for completing missing values of multi-dimensional electricity consumption time series data as described in the first embodiment of the present disclosure.
[0179] Embodiment 4
[0180] The purpose of this embodiment is to provide an electronic device.
[0181] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in a method for completing missing values of multi-dimensional electricity consumption time series data as described in Embodiment 1 of the present disclosure are implemented.
[0182] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A missing value filling method for multi-dimensional electricity consumption time series data, characterized in that: include: Obtain the multi-dimensional electricity consumption time series data to be completed, and pre-process it into a multi-variable time series matrix; Input the multivariate time series matrix into the trained completion model to complete the missing values and obtain the completed multivariate time series matrix; Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
2. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 1, characterized in that: The autoencoder comprises an encoder and a decoder; An encoder is constructed using a bidirectional gated recurrent unit with a time decay factor, the encoder taking a multivariate time matrix as input and a context vector as output; A decoder is constructed using global attention and time-of-use electricity price influence factors. The decoder takes the context vector as input and the completed multivariate time series matrix as output.
3. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 2, characterized in that: The bidirectional gated recurrent unit with a time decay factor uses the time decay factor to modify the input at the corresponding moment; The time decay factor is based on the time lag between the current value and the last valid value, and a time lag matrix is constructed for the multivariable time series matrix, thereby calculating the time decay factor at each moment.
4. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 2, characterized in that: The specific processing flow of the decoder for the input context vector is as follows: First, the latent vector is calculated through the gated recurrent unit; Secondly, the global attention score of the latent vector is calculated and normalized; Then, the normalized calculation result is residually connected with the latent vector, and then multiplied by the time-of-use electricity price impact factor; Finally, the output of the decoder is obtained through a linear layer.
5. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 4, characterized in that: The time-of-use electricity price influencing factor is calculated through a negative exponential formula based on the time-of-use electricity price and learnable parameters.
6. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 1, characterized in that: The Transformer variant includes an embedding layer, multiple feature extraction modules and an output layer; Among them, the feature extraction module includes multi-head self-attention operation, residual connection and normalization layer, temporal convolution layer and feature convolution layer in sequence.
7. A missing value filling method for multi-dimensional electricity consumption time series data according to claim 6, characterized in that: The temporal convolution layer performs a 1D convolution operation on the time dimension based on a gated linear unit structure; The feature convolution layer performs a 1D convolution operation on the feature dimension based on a gated linear unit structure.
8. A missing value completion system for multi-dimensional electricity consumption time series data, characterized in that: Including preprocessing modules and completion modules: The preprocessing module is configured to: obtain the multi-dimensional electricity consumption time series data to be completed, and preprocess it into a multi-variable time series matrix; The completion module is configured to: input the multivariate time series matrix into the trained completion model, complete the missing values, and obtain the completed multivariate time series matrix; Among them, the completion model is a two-stage missing value interpolation model based on the autoencoder and Transformer variant of the bidirectional gated recurrent unit. The autoencoder is used to capture the temporal correlation between multivariate time series data and perform the first-stage fitting and completion of missing values. The Transformer variant is used to explore the potential relationship between time series and dimensions and perform the second-stage fitting and completion of missing values.
9. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; a processor for executing the computer-readable instructions; Wherein, when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is executed.
10. A storage medium, characterized in that: The computer-readable instructions are non-transitorily stored, wherein when the computer-readable instructions are executed by a computer, the method of any one of claims 1 to 7 is performed.
Citation Information
Cited By
Method and system for complementing traffic flow data based on priori knowledge and Transform
CN120216932A
Time sequence model and physical model fused transformer oil temperature prediction method
CN121882112A
Industrial missing data generation method and system for time-sharing power supply
CN122220708A