Method, terminal and storage medium for repairing missing data of synchronous measurement of distribution network
By building a time interval matrix corresponding to the data matrix to be repaired and using a combined model of a bidirectional GRU network and a fully connected network, the problem of low data repair accuracy under dynamic conditions of the distribution network is solved, and higher data repair accuracy and system are achieved reliability.
Patent Information
- Application Number
- CN202111231057.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-10-22
AI Technical Summary
The prior art has low data repair accuracy under dynamic conditions of the distribution network, resulting in a great impact on decision-making.
Using the time series interpolation model based on bidirectional GRU network and the data repair method based on the cross-sequence interpolation model based on the fully connected network, the data matrix to be repaired, the missing position matrix and the time interval matrix are input to the pre-trained data repair model to Fix missing data and fully mine the spatial and temporal correlation information of the data.
It improves the repair accuracy of synchronous measurement data of distribution network under dynamic conditions, ensures data integrity and reliability, and supports more accurate system monitoring, protection and control.
Smart Images

Figure CN113936192B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent distribution network situation awareness, and in particular to a method, terminal and storage medium for repairing missing data of synchronous measurement of a distribution network. Background Art
[0002] The distribution network directly faces users and provides electric energy to all kinds of users. With the access of distributed power sources and electric vehicles, the load types of distribution networks are diversified and gradually evolve into large-scale dynamic systems. The development of intelligent distribution networks is urgent. In response to the improvement of the observable and controllable requirements of intelligent distribution networks, domestic and foreign scholars have developed a distribution network micro-phasor measurement unit (μPMU) based on the idea of the main grid phasor measurement unit (PMU). The μPMU has good synchronization of measurement data, high measurement accuracy, and can contain phase information, which provides more comprehensive and accurate information for system monitoring, protection and control, and is an important source of power system situation awareness.
[0003] However, massive amounts of data may encounter system failures or external interference during its collection, measurement, transmission, storage, and other processes, resulting in data loss. Incomplete data will affect modeling analysis and ultimately affect decision-making. Therefore, it is crucial to obtain complete and reliable measurement data.
[0004] At present, interpolation methods, such as Lagrange interpolation method, are mainly used to repair missing data. However, this method has a good repair effect on lost data under static conditions of the system. When the system is in dynamic conditions, the data repair accuracy is low. Summary of the invention
[0005] The embodiments of the present invention provide a method, a terminal and a storage medium for repairing missing data of synchronous measurement of a distribution network, so as to solve the problem of low data repair accuracy in the prior art when the system is in a dynamic condition.
[0006] In a first aspect, an embodiment of the present invention provides a method for repairing missing data of synchronous measurement of a distribution network, comprising:
[0007] Acquire the to-be-repaired synchronous measurement data of the distribution network, and construct the to-be-repaired data matrix, the missing position matrix and the time interval matrix according to the to-be-repaired synchronous measurement data; the missing position matrix is used to characterize the position of the missing data in the to-be-repaired data matrix, and the time interval matrix is used to characterize the time interval between the data in the to-be-repaired data matrix and the last non-missing data;
[0008] Input the data matrix to be repaired, the missing position matrix and the time interval matrix into the pre-trained data repair model to obtain the repaired data matrix; the data repair model includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network, and the output of the time series interpolation model is the input of the cross-sequence interpolation model;
[0009] The repaired synchronous measurement data is obtained according to the repaired data matrix.
[0010] In a possible implementation, constructing a data matrix to be repaired, a missing position matrix and a time interval matrix according to the synchronous measurement data to be repaired includes:
[0011] Divide the synchronous measurement data to be repaired into multiple groups of target synchronous measurement data, wherein the i-th group of target synchronous measurement data includes measurement data measured from time i to time i+T-1, T is the number of measurement data included in each group of target synchronous measurement data, 1≤i≤N, and N is the number of groups of the multiple groups of target synchronous measurement data;
[0012] A plurality of data matrices to be repaired, a plurality of missing position matrices and a plurality of time interval matrices are constructed according to a plurality of sets of target synchronous measurement data; the target synchronous measurement data, the data matrix to be repaired, the missing position matrix and the time interval matrix correspond to each other one by one.
[0013] In a possible implementation, the number of repaired data matrices is N;
[0014] The repaired synchronous measurement data is obtained according to the repaired data matrix, including:
[0015] All the data in the first repaired data matrix and the last row of data in the remaining N-1 repaired data matrices are spliced in chronological order to obtain the repaired synchronous measurement data.
[0016] In a possible implementation, after constructing a plurality of to-be-repaired data matrices, a plurality of missing position matrices, and a plurality of time interval matrices according to a plurality of sets of target synchronous measurement data, the method further includes:
[0017] Converting multiple to-be-repaired data matrices, multiple missing position matrices, and multiple time interval matrices into tensor formats respectively to obtain a to-be-repaired data tensor, a missing position tensor, and a time interval tensor;
[0018] Accordingly, the data matrix to be repaired, the missing position matrix and the time interval matrix are input into the pre-trained data repair model to obtain the repaired data matrix, including:
[0019] The data tensor to be repaired, the missing position tensor and the time interval tensor are input into the pre-trained data repair model to obtain the repaired data matrix.
[0020] In one possible implementation, in the time interval matrix,
[0021] in, is an element in the time interval matrix, representing the time interval between the data measured by channel d at time t and the last non-missing data; s t is the timestamp of time t; s t-1 The timestamp of time t-1; is an element in the missing position matrix, indicating whether the data measured by channel d at time t-1 is missing; Indicates that the data measured by channel d at time t-1 is missing, It means that the data measured by channel d at time t-1 is not missing.
[0022] In one possible implementation, the formula of the time series interpolation model based on the bidirectional GRU network is:
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032] Among them, σ and tanh are activation functions; is the data value of channel d of the data matrix to be repaired at time t-1, is the data value of channel d of the data matrix to be repaired at time t+1; and are the values of the hidden layer, update gate, new memory unit, and reset gate of the forward propagation of channel d at time t; and are the values of the hidden layer, update gate, new memory unit, and reset gate of channel d at time t. is the output value of the time series interpolation model based on the bidirectional GRU network of channel d at time t, are the element values of the data matrix to be repaired, the missing position matrix, and the time interval matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W o , and are weight parameters; b o , and These are bias parameters.
[0033] In one possible implementation, the formula of the cross-sequence interpolation model based on the fully connected network is:
[0034]
[0035] h t =φ(Ux t +Vz t +β)
[0036] Among them, σ and φ are activation functions; is the output value of the cross-sequence interpolation model based on the fully connected network at time t; h t is the intermediate parameter at time t; x t is the data value of the data matrix to be repaired at time t; and m t are the element values of the data matrix to be repaired and the missing position matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W, U and V are all weight parameters; α and β are both bias parameters.
[0037] In a possible implementation, before inputting the to-be-repaired data matrix, the missing position matrix, and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix, the method further includes:
[0038] Obtain a training sample set;
[0039] Iteratively train the pre-established data repair model according to the training sample set to obtain a trained data repair model;
[0040] In each iterative training, the root mean square error is used to evaluate the training results. When the root mean square error meets the preset conditions, the training is terminated to obtain a trained data repair model.
[0041] Root mean square error The calculation formula is Repair the matrix output by the model for the data Elements of is the element of the actual synchronous measurement data matrix x that does not contain missing data; is the element of the missing position matrix; D is the number of channels; T is the time series length.
[0042] In a second aspect, an embodiment of the present invention provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for repairing missing data of synchronous measurement of a distribution network are implemented as described in the first aspect or any possible implementation method of the first aspect.
[0043] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for repairing missing data of synchronous measurement of a distribution network as described in the first aspect or any possible implementation method of the first aspect are implemented.
[0044] The embodiment of the present invention provides a method, a terminal and a storage medium for repairing missing data of synchronous measurement of a distribution network. The method considers the time delay of synchronous measurement data of the distribution network by constructing a time interval matrix corresponding to the data matrix to be repaired; the missing data is repaired by a data repair model, and the data repair model includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network. The output of the time series interpolation model is the input of the cross-sequence interpolation model. The time series interpolation model based on the bidirectional GRU network can be used to repair the missing data of the channel according to the temporal relationship of the measurement data of each channel. The cross-sequence interpolation model based on the fully connected network uses the output of the time series interpolation model as the input, and can further repair the data according to the spatial correlation between data of different channels at the same time, so as to fully mine the spatiotemporal correlation information of the data, and improve the data repair accuracy even when the system is in a dynamic condition. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0046] Figure 1 It is a flow chart of the implementation of the method for repairing missing data of synchronous measurement of distribution network provided by an embodiment of the present invention;
[0047] Figure 2is a schematic diagram of splicing the repaired data matrix provided by an embodiment of the present invention;
[0048] Figure 3 is a structural schematic diagram of a data repair model provided by an embodiment of the present invention;
[0049] Figure 4 is a structural schematic diagram of a cross-sequence interpolation model based on a fully connected network provided in an embodiment of the present invention;
[0050] Figure 5 It is a repair effect diagram of the voltage amplitude of a time series of a certain channel provided by an embodiment of the present invention when the data missing rate is 20%;
[0051] Figure 6 It is a repair effect diagram of the voltage amplitude of a time series of a certain channel when the data missing rate is 30% provided by an embodiment of the present invention;
[0052] Figure 7 It is a repair effect diagram of the voltage amplitudes of different channels at a certain moment when the data loss rate is 20% provided by an embodiment of the present invention;
[0053] Figure 8 It is a repair effect diagram of the voltage amplitudes of different channels at a certain moment when the data loss rate is 30% provided by an embodiment of the present invention;
[0054] Fig. 9 It is a schematic diagram of absolute error distribution of voltage amplitude repair when the data missing rate is 20% provided by an embodiment of the present invention;
[0055] Fig.10 It is a structural schematic diagram of a device for repairing missing data of synchronous measurement of a distribution network provided by an embodiment of the present invention;
[0056] Fig.11 is a schematic diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0058] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0059] See also Figure 1, which shows an implementation flow chart of a method for repairing missing data of synchronous measurement of a distribution network provided by an embodiment of the present invention, wherein the execution subject of the method for repairing missing data of synchronous measurement of a distribution network may be a terminal.
[0060] See also Figure 1 ,The method for repairing missing data of distribution network synchronous measurement is described in detail as follows:
[0061] In S101, the synchronous measurement data to be repaired of the distribution network is obtained, and a data matrix to be repaired, a missing position matrix and a time interval matrix are constructed according to the synchronous measurement data to be repaired; the missing position matrix is used to represent the position of the missing data in the data matrix to be repaired, and the time interval matrix is used to represent the time interval between the missing data and the last non-missing data in the data matrix to be repaired.
[0062] In this embodiment, the μPMU can synchronously measure the measurement data of multiple nodes of the distribution network, such as voltage data, current data, etc. Each node serves as a channel. The synchronous measurement data to be repaired of the distribution network may include data obtained by synchronous measurement of multiple channels at multiple times.
[0063] In this embodiment, a data matrix to be repaired can be constructed based on the synchronous measurement data to be repaired of the distribution network, a missing position matrix can be constructed based on the position of the missing data in the data matrix to be repaired, and a time interval matrix can be constructed based on the time interval between the data at each moment in each channel in the data matrix to be repaired and the last non-missing data of the channel. The last non-missing data of the channel is the non-missing data with the most recent time interval.
[0064] The missing position matrix may be a two-dimensional mask matrix, where an element value of 0 at a corresponding position indicates that data is missing, and an element value of 1 at a corresponding position indicates that data is not missing.
[0065] In S102, the data matrix to be repaired, the missing position matrix and the time interval matrix are input into a pre-trained data repair model to obtain a repaired data matrix; the data repair model includes a time series interpolation model based on a bidirectional GRU (gated recurrent unit) network and a cross-sequence interpolation model based on a fully connected network, and the output of the time series interpolation model is the input of the cross-sequence interpolation model.
[0066] In this embodiment, the data matrix to be repaired is repaired by constructing a data repair model. The data matrix to be repaired, the missing position matrix and the time interval matrix are input into the pre-trained data repair model to obtain a data matrix after repairing the data matrix to be repaired.
[0067] The data repair model can be a multi-directional recurrent neural network model, which includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network. The time series interpolation model based on the bidirectional GRU network is used for time series interpolation, and the cross-sequence interpolation model based on the fully connected network is used for cross-channel data interpolation. That is, in this model, the bidirectional GRU is used as its interpolation block, which can repair the missing data of this channel according to the temporal relationship of the measurement data of each channel. The fully connected layer is used as an interpolation block. The interpolation block uses the output of the interpolation block as input, and further repairs the missing data according to the spatial correlation between the data of different channels at the same time, thereby improving the reconstruction accuracy. The data repair model can fully mine the spatiotemporal correlation information of the data and significantly improve the accuracy of data repair.
[0068] Both the LSTM and GRU are optimized variants of RNN (Recurrent Neural Networks). This RNN with a gate mechanism can solve the gradient vanishing and gradient exploding problems of traditional RNN, and performs better in practical applications. And compared with the LSTM, GRU is simpler, has fewer parameters, and converges faster, which can speed up the experimental process. Therefore, this embodiment uses a bidirectional GRU as the interpolation block.
[0069] In S103, the repaired synchronous measurement data is obtained according to the repaired data matrix.
[0070] In this embodiment, the method of constructing a data matrix to be repaired according to the synchronous measurement data to be repaired in S101 can be reversed, so that the repaired synchronous measurement data can be obtained according to the repaired data matrix. The repaired synchronous measurement data is the data after the repair of the synchronous measurement data to be repaired of the distribution network is completed.
[0071] The embodiment of the present invention considers the time delay of the synchronous measurement data of the distribution network by constructing a time interval matrix corresponding to the data matrix to be repaired; the missing data is repaired by a data repair model, and the data repair model includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network. The output of the time series interpolation model is the input of the cross-sequence interpolation model. Through the time series interpolation model based on the bidirectional GRU network, the missing data of the channel can be repaired according to the timing relationship of the measurement data of each channel. The cross-sequence interpolation model based on the fully connected network uses the output of the time series interpolation model as the input, and can further repair the data according to the spatial correlation between the data of different channels at the same time, which can fully mine the spatiotemporal correlation information of the data, and can not only improve the data repair accuracy when the system is in a static condition, but also improve the data repair accuracy when the system is in a dynamic condition.
[0072] In some embodiments, the “constructing a to-be-repaired data matrix, a missing position matrix, and a time interval matrix according to the to-be-repaired synchronous measurement data” in S101 above may include:
[0073] Divide the synchronous measurement data to be repaired into multiple groups of target synchronous measurement data, wherein the i-th group of target synchronous measurement data includes measurement data measured from time i to time i+T-1, T is the number of measurement data included in each group of target synchronous measurement data, 1≤i≤N, and N is the number of groups of the multiple groups of target synchronous measurement data;
[0074] A plurality of data matrices to be repaired, a plurality of missing position matrices and a plurality of time interval matrices are constructed according to a plurality of sets of target synchronous measurement data; the target synchronous measurement data, the data matrix to be repaired, the missing position matrix and the time interval matrix correspond to each other one by one.
[0075] In this embodiment, the grouped synchronous measurement data to be repaired is referred to as target synchronous measurement data. The synchronous measurement data to be repaired is divided into N groups of target synchronous measurement data. At each moment, a piece of synchronous measurement data measured by D channels can be obtained. Therefore, each group of target synchronous measurement data can include T pieces of data, and each matrix of data to be repaired can be a T*D matrix, that is, T rows and D columns. Wherein, D is the number of channels, and T is the number of measurement data contained in each group of target synchronous measurement data. The measurement data contained here is the measurement data measured at one moment, and can also represent the time series length, that is, the sequence length of the time series. The values of T and D can be set according to actual needs. In one possible implementation, T can be 12.
[0076] For each data matrix to be repaired, a missing position matrix can be constructed according to the position of the missing data in the matrix. For example, in the missing position matrix, the value of the missing data position is 0, and the value of the non-missing data position is 1. Of course, the two values can also be opposite, and there is no specific limitation here.
[0077] When irregular delays occur in missing data, it is necessary to construct a time interval matrix to represent the time interval between the acquisition time of each data of each channel and the acquisition time of the last non-missing data of the channel. The time interval can be represented by the number of time intervals, for example, the number of time intervals between time 1 and time 3 is 2, the number of time intervals between time 2 and time 5 is 5, and so on.
[0078] The missing position matrix and the time interval matrix may both be T*D matrices.
[0079] In a possible implementation, before dividing the to-be-repaired synchronous measurement data into a plurality of groups of target synchronous measurement data, the method for repairing the missing data of the distribution network synchronous measurement further includes:
[0080] The maximum and minimum value normalization method is used to normalize the synchronous measurement data to be repaired.
[0081] In this embodiment, the normalized data may be further divided into multiple groups of target synchronous measurement data.
[0082] In some embodiments, the number of repaired data matrices is N;
[0083] The above S103 may include:
[0084] All the data in the first repaired data matrix and the last row of data in the remaining N-1 repaired data matrices are spliced in chronological order to obtain the repaired synchronous measurement data.
[0085] The size of the repaired data matrix is the same as the size of the data matrix to be repaired, and the number is also the same, and the two correspond one to one. The data repaired by the data repair model is still N matrices with a time series length of T. Taking into account the memory function of the recurrent neural network, the last row of data in each matrix is the most accurate repair. Therefore, in the aforementioned grouping, the i-th group of target synchronous measurement data includes the measurement data measured from time i to time i+T-1. After the repair is completed, all the data in the first repaired data matrix and the last row of data of the remaining N-1 repaired data matrices are spliced in chronological order to obtain the repaired synchronous measurement data. For details, please refer to Figure 2 Among them, the repaired data matrices are also arranged in chronological order, that is, the first repaired data matrix is the matrix obtained after the repair of the data matrix to be repaired corresponding to the first group of target synchronous measurement data, and the remaining N-1 repaired data matrices are all repaired data matrices except the first repaired data matrix.
[0086] In some embodiments, after the above S101, the method for repairing missing data of synchronous measurement of distribution network further includes:
[0087] Converting multiple to-be-repaired data matrices, multiple missing position matrices, and multiple time interval matrices into tensor formats respectively to obtain a to-be-repaired data tensor, a missing position tensor, and a time interval tensor;
[0088] Accordingly, the above S102 may include:
[0089] The data tensor to be repaired, the missing position tensor and the time interval tensor are input into the pre-trained data repair model to obtain the repaired data matrix.
[0090] In this embodiment, multiple data matrices to be repaired, multiple missing position matrices, and multiple time interval matrices can be converted into three-dimensional tensor formats respectively to obtain a data tensor to be repaired, a missing position tensor, and a time interval tensor. The repaired data matrix can also be a three-dimensional matrix in tensor format.
[0091] In some embodiments, in the time interval matrix,
[0092] in, is an element in the time interval matrix, representing the time interval between the data measured by channel d at time t and the last non-missing data; s t is the timestamp of time t; s t-1 The timestamp of time t-1; is an element in the missing position matrix, indicating whether the data measured by channel d at time t-1 is missing; Indicates that the data measured by channel d at time t-1 is missing, It means that the data measured by channel d at time t-1 is not missing. Represents the time interval between the data measured by channel d at time t-1 and the last non-missing data.
[0093] For each time interval matrix, the above formula can be used to recursively obtain the corresponding time interval matrix. In each time interval matrix, the value of t is 1 to T.
[0094] In some embodiments, the formula of the time series interpolation model based on the bidirectional GRU network is:
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104] Among them, σ and tanh are activation functions; is the data value of channel d of the data matrix to be repaired at time t-1, is the data value of channel d of the data matrix to be repaired at time t+1; and are the values of the hidden layer, update gate, new memory unit, and reset gate of the forward propagation of channel d at time t; and are the values of the hidden layer, update gate, new memory unit, and reset gate of channel d at time t. is the output value of the time series interpolation model based on the bidirectional GRU network of channel d at time t, are the element values of the data matrix to be repaired, the missing position matrix, and the time interval matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W o , and are weight parameters; b o , and These are bias parameters.
[0105] The new memory unit may be a memory unit in an existing GRU or an improved memory unit, and no specific limitation is made here.
[0106] In the process of performing data repair through the data repair model, the values of the missing position matrix and the time interval matrix may remain unchanged.
[0107] In some embodiments, the formula of the cross-sequence interpolation model based on the fully connected network is:
[0108]
[0109] h t =φ(Ux t +Vz t +β)
[0110] Among them, σ and φ are activation functions; is the output value of the cross-sequence interpolation model based on the fully connected network at time t; h t is the intermediate parameter at time t; x t is the data value of the data matrix to be repaired at time t; and m t are the element values of the data matrix to be repaired and the missing position matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W, U and V are all weight parameters; α and β are both bias parameters.
[0111] See also Figure 3 and Figure 4 , FC is the fully connected layer, X t-1 , X t , X t+1 Both are inputs to the data repair model; All are outputs of the time series interpolation model; Both are the outputs of the cross-series interpolation model and the data repair model.
[0112] Figure 3 The dotted box in the figure is a time series interpolation model based on a bidirectional GRU network. The model processes the input sequence in order and in reverse order in the time dimension, and the output node of each time step contains the context information of the current moment. The bidirectional GRU in this embodiment is different from the traditional bidirectional RNN. The time of its input to the hidden layer is delayed in the forward propagation and advanced in the backward propagation process. The purpose is to avoid For estimation
[0113] See also Figure 4 , which is a schematic diagram of the structure of a cross-sequence interpolation model based on a fully connected network. As shown in the figure, the input data is not only propagated in the time dimension, but also transmitted between different channel data at the same time. In this embodiment, the fully connected interpolation part is placed after the time series interpolation part of the bidirectional GRU network, which can improve the data repair accuracy.
[0114] In some embodiments, before inputting the to-be-repaired data matrix, the missing position matrix and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix, the method further includes:
[0115] Obtain a training sample set;
[0116] Iteratively train the pre-established data repair model according to the training sample set to obtain a trained data repair model;
[0117] In each iterative training, the root mean square error (RMSE) is used to evaluate the training results. When the root mean square error meets the preset conditions, the training is terminated and the trained data repair model is obtained.
[0118] Root mean square error The calculation formula is Repair the matrix output by the model for the data Elements of is the element of the actual synchronous measurement data matrix x that does not contain missing data; is the element of the missing position matrix; D is the number of channels; T is the time series length.
[0119] The training sample set may include multiple training samples, each of which includes complete and non-missing measurement data and measurement data containing missing data corresponding to the complete and non-missing measurement data. A random missing ratio may be set for the complete and non-missing measurement data to obtain the corresponding measurement data containing missing data.
[0120] The preset conditions include that the root mean square error is less than a preset value, or that the difference between the root mean square errors obtained from two consecutive trainings is within a preset range, and so on.
[0121] In a possible implementation, a condition for terminating the iterative training may be that the number of iterations is greater than a preset number.
[0122] Among them, the preset value, preset range and preset number of times can be set according to actual needs and are not specifically limited here.
[0123] In this embodiment, RMSE is used as a performance evaluation index to evaluate the accuracy of the repaired data. The optimization parameters are updated successively, and the trained data repair model is saved so that it can be directly applied in subsequent data repair.
[0124] The purpose of this embodiment is to minimize the repair error of missing data. Therefore, the above-mentioned root mean square error calculation formula is used for calculation, and non-missing data is not included in the evaluation.
[0125] In a possible implementation, an objective function that minimizes the repair error can be constructed, and training is stopped after solving the objective function. The objective function is:
[0126]
[0127]
[0128] In the above formula, Φ d The function represents a bidirectional GRU network, and the Ψ function represents a fully connected layer network.
[0129] In one possible implementation, a time series interpolation model based on a bidirectional GRU network can be trained first. After the model is trained, the model is saved. Then, based on the trained model, a cross-sequence interpolation model based on a fully connected network is trained. After the training is completed, a repaired data repair model is obtained.
[0130] This embodiment takes into account the spatiotemporal correlation of μPMU measurement data, and establishes a multi-directional recurrent neural network model consisting of an interpolation block constructed by a bidirectional GRU network and a cross-channel data interpolation block constructed by a fully connected network; a time interval matrix is used to save the delay information between two measurements, and the delay characteristics have been saved, so the measurement data does not have to be strictly synchronized; the structure of the entire multi-directional recurrent neural network model utilizes the three-dimensional characteristics of the data; all the data of the first repaired data matrix and the last row of data of the remaining N-1 repaired data matrices are restored to data for actual application.
[0131] In a specific application scenario, the voltage amplitude in the synchronous phasor measurement data of the distribution network is used for testing. The initial amplitude data is in the form of per-unit value. The missing position matrix is randomly set to 0 with a certain probability, and the entire data set is set as the synchronous measurement data to be repaired under a given data missing rate.
[0132] Figure 5 and Figure 6 The repair effect diagrams of the voltage amplitude of the same channel under different data loss rates are shown respectively. Figure 7 and Figure 8 The repair effect diagrams of the voltage amplitudes of different channels at the same time under different data loss rates are respectively shown, showing the repair effect of the method provided in this embodiment in time and space. In the figure, ○ represents the actual value, and × represents the value after repair. Fig. 9 The violin plot in the figure shows the distribution of the absolute error of the voltage amplitude repair value when the data missing rate is 20%. Fig. 9 It can be seen that the absolute errors are concentrated near the median. In the case of a 20% data missing rate, the repair result still maintains a very high accuracy, and the median absolute error is only 0.0006 / pu, which verifies the effectiveness of the method provided in this embodiment.
[0133] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0134] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0135] Fig.10 The structure diagram of the device for repairing missing data of synchronous measurement of a power distribution network provided by an embodiment of the present invention is shown. For the convenience of explanation, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0136] like Fig.10As shown, the device 100 for repairing missing data of synchronous measurement in a power distribution network includes: a matrix construction module 101 , a repair module 102 and a restoration module 103 .
[0137] The matrix construction module 101 is used to obtain the to-be-repaired synchronous measurement data of the distribution network, and to construct the to-be-repaired data matrix, the missing position matrix and the time interval matrix according to the to-be-repaired synchronous measurement data; the missing position matrix is used to represent the position of the missing data in the to-be-repaired data matrix, and the time interval matrix is used to represent the time interval between the data in the to-be-repaired data matrix and the last non-missing data;
[0138] The repair module 102 is used to input the data matrix to be repaired, the missing position matrix and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix; the data repair model includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network, and the output of the time series interpolation model is the input of the cross-sequence interpolation model;
[0139] The restoration module 103 is used to obtain the repaired synchronous measurement data according to the repaired data matrix.
[0140] In a possible implementation, the matrix construction module 101 is specifically used for:
[0141] Divide the synchronous measurement data to be repaired into multiple groups of target synchronous measurement data, wherein the i-th group of target synchronous measurement data includes measurement data measured from time i to time i+T-1, T is the number of measurement data included in each group of target synchronous measurement data, 1≤i≤N, and N is the number of groups of the multiple groups of target synchronous measurement data;
[0142] A plurality of data matrices to be repaired, a plurality of missing position matrices and a plurality of time interval matrices are constructed according to a plurality of sets of target synchronous measurement data; the target synchronous measurement data, the data matrix to be repaired, the missing position matrix and the time interval matrix correspond to each other one by one.
[0143] In a possible implementation, the number of repaired data matrices is N;
[0144] The restoration module 103 is specifically used for:
[0145] All the data in the first repaired data matrix and the last row of data in the remaining N-1 repaired data matrices are spliced in chronological order to obtain the repaired synchronous measurement data.
[0146] In a possible implementation, the device 100 for repairing missing data of synchronous measurement in a power distribution network further includes a format conversion module.
[0147] A format conversion module, used to convert multiple to-be-repaired data matrices, multiple missing position matrices, and multiple time interval matrices into tensor formats, respectively, to obtain a to-be-repaired data tensor, a missing position tensor, and a time interval tensor;
[0148] Accordingly, the repair module 102 is specifically used for:
[0149] The data tensor to be repaired, the missing position tensor and the time interval tensor are input into the pre-trained data repair model to obtain the repaired data matrix.
[0150] In one possible implementation, in the time interval matrix,
[0151] in, is an element in the time interval matrix, representing the time interval between the data measured by channel d at time t and the last non-missing data; s t is the timestamp of time t; s t-1 The timestamp of time t-1; is an element in the missing position matrix, indicating whether the data measured by channel d at time t-1 is missing; Indicates that the data measured by channel d at time t-1 is missing, It means that the data measured by channel d at time t-1 is not missing.
[0152] In one possible implementation, the formula of the time series interpolation model based on the bidirectional GRU network is:
[0153]
[0154]
[0155]
[0156]
[0157]
[0158]
[0159]
[0160]
[0161]
[0162] Among them, σ and tanh are activation functions; is the data value of channel d of the data matrix to be repaired at time t-1, is the data value of channel d of the data matrix to be repaired at time t+1; and are the values of the hidden layer, update gate, new memory unit, and reset gate of the forward propagation of channel d at time t; and are the values of the hidden layer, update gate, new memory unit, and reset gate of channel d at time t. is the output value of the time series interpolation model based on the bidirectional GRU network of channel d at time t, are the element values of the data matrix to be repaired, the missing position matrix, and the time interval matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W o , and are weight parameters; b o , and These are bias parameters.
[0163] In one possible implementation, the formula of the cross-sequence interpolation model based on the fully connected network is:
[0164]
[0165] h t =φ(Ux t +Vz t +β)
[0166] Among them, σ and φ are activation functions; is the output value of the cross-sequence interpolation model based on the fully connected network at time t; h t is the intermediate parameter at time t; x t is the data value of the data matrix to be repaired at time t; and m t are the element values of the data matrix to be repaired and the missing position matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W, U and V are all weight parameters; α and β are both bias parameters.
[0167] In a possible implementation, the device 100 for repairing missing data of synchronous measurement in a power distribution network further includes a training module.
[0168] The training module is used to:
[0169] Obtain a training sample set;
[0170] Iteratively train the pre-established data repair model according to the training sample set to obtain a trained data repair model;
[0171] In each iterative training, the root mean square error is used to evaluate the training results. When the root mean square error meets the preset conditions, the training is terminated to obtain a trained data repair model.
[0172] Root mean square error The calculation formula is Repair the matrix output by the model for the data Elements of is the element of the actual synchronous measurement data matrix x that does not contain missing data; is the element of the missing position matrix; D is the number of channels; T is the time series length.
[0173] Fig.11 is a schematic diagram of a terminal provided by an embodiment of the present invention. Fig.11 As shown, the terminal 11 of this embodiment includes: a processor 110, a memory 111, and a computer program 112 stored in the memory 111 and executable on the processor 110. When the processor 110 executes the computer program 112, the steps in the above-mentioned various power distribution network synchronous measurement missing data repair method embodiments are implemented, such as Figure 1 Alternatively, when the processor 110 executes the computer program 112, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Fig.10 Functionality of modules / units 101 to 103 is shown.
[0174] Exemplarily, the computer program 112 may be divided into one or more modules / units, which are stored in the memory 111 and executed by the processor 110 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program 112 in the terminal 11. For example, the computer program 112 may be divided into Fig.10 Modules / units 101 to 103 are shown.
[0175] The terminal 11 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal 11 may include, but is not limited to, a processor 110 and a memory 111. Those skilled in the art will appreciate that Fig.11 It is only an example of the terminal 11 and does not constitute a limitation on the terminal 11. The terminal 11 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.
[0176] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0177] The memory 111 may be an internal storage unit of the terminal 11, such as a hard disk or memory of the terminal 11. The memory 111 may also be an external storage device of the terminal 11, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the terminal 11. Further, the memory 111 may also include both an internal storage unit of the terminal 11 and an external storage device. The memory 111 is used to store the computer program and other programs and data required by the terminal. The memory 111 may also be used to temporarily store data that has been output or is to be output.
[0178] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0179] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0180] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0181] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0184] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various distribution network synchronous measurement missing data repair method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0185] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for repairing missing data of synchronous measurement in a distribution network, characterized in that: include: Acquire the to-be-repaired synchronous measurement data of the distribution network, and construct a to-be-repaired data matrix, a missing position matrix, and a time interval matrix according to the to-be-repaired synchronous measurement data; The missing position matrix is used to represent the position of missing data in the data matrix to be repaired, and the time interval matrix is used to represent the time interval between the data in the data matrix to be repaired and the last non-missing data; Inputting the data matrix to be repaired, the missing position matrix and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix; the data repair model includes a time series interpolation model based on a bidirectional GRU network and a cross-sequence interpolation model based on a fully connected network, and the output of the time series interpolation model is the input of the cross-sequence interpolation model; Obtaining repaired synchronous measurement data according to the repaired data matrix; Among them, the formula of the time series interpolation model based on the bidirectional GRU network is: Among them, σ and tanh are activation functions; is the data value of channel d of the data matrix to be repaired at time t-1, is the data value of channel d of the data matrix to be repaired at time t+1; and are the values of the hidden layer, update gate, new memory unit, and reset gate of the forward propagation of channel d at time t; and are the values of the hidden layer, update gate, new memory unit, and reset gate of channel d at time t. is the output value of the time series interpolation model based on the bidirectional GRU network of channel d at time t, are the element values of the data matrix to be repaired, the missing position matrix, and the time interval matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W o , and are all weight parameters; bo, and All are bias parameters; The formula of the cross-sequence interpolation model based on the fully connected network is: h t =φ(Ux t +Vz t +b) Among them, σ and φ are activation functions; is the output value of the cross-sequence interpolation model based on the fully connected network at time t; ht is the intermediate parameter at time t; x t is the data value of the data matrix to be repaired at time t; and m t are the element values of the data matrix to be repaired and the missing position matrix after being repaired by the time series interpolation model based on the bidirectional GRU network; W, U and V are all weight parameters; α and β are both bias parameters.
2. The method for repairing missing data of synchronous measurement of distribution network according to claim 1, characterized in that: The step of constructing a data matrix to be repaired, a missing position matrix and a time interval matrix according to the synchronous measurement data to be repaired comprises: Divide the synchronous measurement data to be repaired into multiple groups of target synchronous measurement data, wherein the i-th group of target synchronous measurement data includes measurement data measured from time i to time i+T-1, T is the number of measurement data included in each group of target synchronous measurement data, 1≤i≤N, and N is the number of groups of the multiple groups of target synchronous measurement data; A plurality of data matrices to be repaired, a plurality of missing position matrices and a plurality of time interval matrices are constructed according to the plurality of sets of target synchronous measurement data; the target synchronous measurement data, the data matrices to be repaired, the missing position matrices and the time interval matrices correspond one to one.
3. The method for repairing missing data of synchronous measurement of distribution network according to claim 2, characterized in that: The number of the repaired data matrices is N; The step of obtaining the repaired synchronous measurement data according to the repaired data matrix includes: All the data in the first repaired data matrix and the last row of data in the remaining N-1 repaired data matrices are spliced in chronological order to obtain the repaired synchronous measurement data.
4. The method for repairing missing data of synchronous measurement of distribution network according to claim 2, characterized in that: After constructing a plurality of to-be-repaired data matrices, a plurality of missing position matrices and a plurality of time interval matrices according to the plurality of sets of target synchronous measurement data, the method further includes: Converting multiple to-be-repaired data matrices, multiple missing position matrices, and multiple time interval matrices into tensor formats respectively to obtain a to-be-repaired data tensor, a missing position tensor, and a time interval tensor; Accordingly, the step of inputting the to-be-repaired data matrix, the missing position matrix and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix includes: The to-be-repaired data tensor, the missing position tensor and the time interval tensor are input into a pre-trained data repair model to obtain a repaired data matrix.
5. The method for repairing missing data of synchronous measurement of distribution network according to claim 1, characterized in that: In the time interval matrix, in, is an element in the time interval matrix, representing the time interval between the data measured by channel d at time t and the last non-missing data; s t is the timestamp of time t; s t-1 The timestamp of time t-1; is an element in the missing position matrix, indicating whether the data measured by channel d at time t-1 is missing; Indicates that the data measured by channel d at time t-1 is missing, It means that the data measured by channel d at time t-1 is not missing.
6. The method for repairing missing data of synchronous measurement of distribution network according to any one of claims 1 to 5, characterized in that: Before inputting the to-be-repaired data matrix, the missing position matrix and the time interval matrix into a pre-trained data repair model to obtain a repaired data matrix, the method further includes: Obtain a training sample set; Iteratively training a pre-established data repair model according to the training sample set to obtain a trained data repair model; In each iterative training, the root mean square error is used to evaluate the training result. When the root mean square error meets the preset condition, the training is terminated to obtain the trained data repair model; Root mean square error The calculation formula is Repair the matrix output by the model for the data Elements of is the actual synchronous measurement data matrix without missing data x Elements of is the element of the missing position matrix; D is the number of channels; T is the time series length.
7. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for repairing missing data of synchronous measurement of a distribution network as described in any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for repairing missing data of synchronous measurement of a distribution network as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Tensor-based vehicle networking data loss multiple estimation new method
CN110162744A
Synchronous measurement missing data restoration method and device based on time sequence matrix decomposition
CN112632462A
Analysis device, analysis method and program
JP2019113962A
Federated-learning-based user data classification method and apparatus, and device and medium
WO2021179720A1
