Voltage data augmentation method and apparatus, computer device, readable storage medium and program product
Patent Information
- Application Number
- CN202510988301.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-07-17
AI Technical Summary
但是,该量测体系采集到的数据频率较低,数量较少,无法满足对电能质量高精度实时监测的需求
[0028]The aforementioned voltage data augmentation method, apparatus, computer equipment, readable storage medium, and program product, for any first sample node in a first sample distribution network, acquire a first voltage sequence of the first sample node and first tag data of any first voltage value in the first voltage sequence, and for any second sample node in a second sample distribution network, acquire a second voltage sequence of the second sample node; wherein the acquisition frequency of both the first and second voltage sequences is a first acquisition frequency; based on the second acquisition frequency, multiple second voltage values are selected from the first voltage sequence, and based on a third acquisition frequency, multiple third voltage values are selected from the second voltage sequence; wherein both the second and third acquisition frequencies are less than the first acquisition frequency; and a first edge index matrix representing the topological connection relationship of the first sample distribution network is acquired. The method described in this application uses a second edge index matrix to characterize the topological connectivity of a second sample distribution network. Based on a first voltage sequence, first-label data of first voltage values, a second voltage sequence, a third voltage sequence formed by multiple second voltage values, second-label data of second voltage values, a fourth voltage sequence formed by multiple third voltage values, the first edge index matrix, and the second edge index matrix, the pre-trained multi-task learning transfer model is trained to obtain a post-trained multi-task learning transfer model. The current voltage sequence of the target distribution network, the current acquisition frequency of the current voltage sequence, the target acquisition frequency, and the current edge index matrix characterizing the topological connectivity of the target distribution network are input into the post-trained multi-task learning transfer model, outputting the target voltage sequence of the target distribution network at the target acquisition frequency. The target acquisition frequency is greater than the current acquisition frequency. The method provided in this application allows the post-trained multi-task learning transfer model to expand the current voltage sequence acquired at the current acquisition frequency to the target voltage sequence at the target acquisition frequency. This effectively expands the voltage values in the current voltage sequence, resulting in a richer target voltage sequence, thereby enabling high-precision monitoring of the power quality of the target distribution network based on the voltage sequence.
Smart Images

Figure CN120873597B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power grid technology, and in particular to a voltage data expansion method, apparatus, computer equipment, readable storage medium, and program product. Background Technology
[0002] In modern power system operation, accurate acquisition of power quality monitoring data from the distribution network is crucial for ensuring the stable and reliable operation of the power system and achieving efficient utilization of power resources. Power quality monitoring can reflect the real-time operating status of the power grid, providing key information for power quality assessment, fault diagnosis, and optimized control.
[0003] Currently, power quality monitoring data acquisition relies on a hybrid measurement system consisting of supervisory control and data acquisition (SCADA), a wide area measurement system (WAMS) based on synchronous phasor measurement units (PMUs), and advanced metering infrastructure (AMI). However, this measurement system acquires data at a low frequency and in small quantities, which cannot meet the needs for high-precision real-time monitoring of power quality. Summary of the Invention
[0004] Therefore, it is necessary to provide a voltage data expansion method, apparatus, computer equipment, readable storage medium, and program product that can increase the number of voltage data acquisition frequencies to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a voltage data augmentation method, the method comprising:
[0006] For any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence are obtained; and for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node is obtained; wherein, the acquisition frequency of the first voltage sequence and the second voltage sequence is a first acquisition frequency.
[0007] Based on a second sampling frequency, multiple second voltage values are selected from the first voltage sequence, and based on a third sampling frequency, multiple third voltage values are selected from the second voltage sequence; wherein, both the second sampling frequency and the third sampling frequency are less than the first sampling frequency;
[0008] Obtain the first edge index matrix representing the topological connection relationship of the first sample distribution network and the second edge index matrix representing the topological connection relationship of the second sample distribution network. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by the multiple second voltage values, the second label data of the second voltage value, the fourth voltage sequence formed by the multiple third voltage values, the first edge index matrix, and the second edge index matrix, train the multi-task learning transfer model before training to obtain the multi-task learning transfer model after training.
[0009] The current voltage sequence of the target distribution network, the current sampling frequency of the current voltage sequence, the target sampling frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network are input into the trained multi-task learning transfer model, and the target voltage sequence of the target distribution network at the target sampling frequency is output; wherein, the target sampling frequency is greater than the current sampling frequency.
[0010] In one embodiment, the step of filtering out a plurality of second voltage values from the first voltage sequence based on a second acquisition frequency includes:
[0011] Based on the maximum and minimum voltage values in the first voltage sequence, any first voltage value is normalized.
[0012] The normalized voltage sequence is determined as the normalized voltage sequence, and the normalized voltage sequence is divided into multiple initial subsequences of the same length.
[0013] For any initial subsequence, the initial subsequence is input into a downsampling function, and the output includes a target subsequence comprising multiple second voltage values; wherein, the downsampling function is used to reduce the sampling frequency of the initial subsequence from the first sampling frequency to the second sampling frequency.
[0014] In one embodiment, the first tag data includes the acquisition time of the first voltage value, the type of power quality event that occurred at the acquisition time of the first sample node, the location of the first sample node in the first sample distribution network, and the first acquisition frequency.
[0015] In one embodiment, the method further includes:
[0016] For any given second voltage value, replace the first sampling frequency in the first tag data of the second voltage value with the second sampling frequency to obtain the second tag data of the second voltage value.
[0017] In one embodiment, the multi-task learning transfer model includes a graph convolutional network, a gated recurrent network, and a fully connected layer connected in sequence; the graph convolutional network and the gated recurrent network are shared feature extraction layers for the first sample distribution network and the second sample distribution network, and the fully connected layer includes a first fully connected layer for the first sample distribution network and a second fully connected layer for the second sample distribution network.
[0018] In one embodiment, the method further includes:
[0019] During the training of the multi-task learning transfer model, if the loss value output by the multi-task learning transfer model in the current training round is less than the preset loss value, then the multi-task learning transfer model obtained in the current training round is determined as the trained multi-task learning transfer model; wherein, the loss value is calculated by weighting a first loss value and a second loss value, the first loss value being the loss value corresponding to the first sample distribution network, and the second loss value being the loss value corresponding to the second sample distribution network.
[0020] Secondly, this application also provides a voltage data expansion device, the device comprising:
[0021] The first acquisition module is used to acquire, for any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence, and to acquire, for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node; wherein, the acquisition frequency of the first voltage sequence and the second voltage sequence is a first acquisition frequency.
[0022] A filtering module is used to filter out multiple second voltage values from the first voltage sequence based on a second sampling frequency, and to filter out multiple third voltage values from the second voltage sequence based on a third sampling frequency; wherein the second sampling frequency and the third sampling frequency are both less than the first sampling frequency;
[0023] The second acquisition module is used to acquire a first side index matrix representing the topological connection relationship of the first sample distribution network and a second side index matrix representing the topological connection relationship of the second sample distribution network. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by the multiple second voltage values, the second label data of the second voltage value, the fourth voltage sequence formed by the multiple third voltage values, the first side index matrix, and the second side index matrix, the multi-task learning transfer model before training is trained to obtain the multi-task learning transfer model after training.
[0024] The input module is used to input the current voltage sequence of the target distribution network, the current sampling frequency of the current voltage sequence, the target sampling frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network into the trained multi-task learning transfer model, and output the target voltage sequence of the target distribution network at the target sampling frequency; wherein, the target sampling frequency is greater than the current sampling frequency.
[0025] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the methods in any of the above embodiments.
[0026] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0027] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0028] The aforementioned voltage data augmentation method, apparatus, computer equipment, readable storage medium, and program product, for any first sample node in a first sample distribution network, acquire a first voltage sequence of the first sample node and first tag data of any first voltage value in the first voltage sequence, and for any second sample node in a second sample distribution network, acquire a second voltage sequence of the second sample node; wherein the acquisition frequency of both the first and second voltage sequences is a first acquisition frequency; based on the second acquisition frequency, multiple second voltage values are selected from the first voltage sequence, and based on a third acquisition frequency, multiple third voltage values are selected from the second voltage sequence; wherein both the second and third acquisition frequencies are less than the first acquisition frequency; and a first edge index matrix representing the topological connection relationship of the first sample distribution network is acquired. The method described in this application uses a second edge index matrix to characterize the topological connectivity of a second sample distribution network. Based on a first voltage sequence, first-label data of first voltage values, a second voltage sequence, a third voltage sequence formed by multiple second voltage values, second-label data of second voltage values, a fourth voltage sequence formed by multiple third voltage values, the first edge index matrix, and the second edge index matrix, the pre-trained multi-task learning transfer model is trained to obtain a post-trained multi-task learning transfer model. The current voltage sequence of the target distribution network, the current acquisition frequency of the current voltage sequence, the target acquisition frequency, and the current edge index matrix characterizing the topological connectivity of the target distribution network are input into the post-trained multi-task learning transfer model, outputting the target voltage sequence of the target distribution network at the target acquisition frequency. The target acquisition frequency is greater than the current acquisition frequency. The method provided in this application allows the post-trained multi-task learning transfer model to expand the current voltage sequence acquired at the current acquisition frequency to the target voltage sequence at the target acquisition frequency. This effectively expands the voltage values in the current voltage sequence, resulting in a richer target voltage sequence, thereby enabling high-precision monitoring of the power quality of the target distribution network based on the voltage sequence. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a flowchart illustrating a voltage data augmentation method in one embodiment;
[0031] Figure 2 This is a flowchart illustrating the second voltage value selection method in one embodiment;
[0032] Figure 3 This is a schematic diagram of the structure of a multi-task learning transfer model in one embodiment;
[0033] Figure 4 This is a diagram of the internal structure of a GRU unit in one embodiment;
[0034] Figure 5 This is a flowchart illustrating the voltage data augmentation method in another embodiment;
[0035] Figure 6 This is a structural block diagram of a voltage data augmentation device in one embodiment;
[0036] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0038] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0039] In one embodiment, such as Figure 1 As shown, a voltage data augmentation method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] S102. For any first sample node in the first sample distribution network, obtain the first voltage sequence of the first sample node and the first tag data of any first voltage value in the first voltage sequence, and for any second sample node in the second sample distribution network, obtain the second voltage sequence of the second sample node; wherein, the acquisition frequency of the first voltage sequence and the second voltage sequence is the first acquisition frequency.
[0041] In the power distribution network, a node refers to a key location in the power network used for connecting electrical equipment, distributing power, or monitoring voltage. It is a basic unit of the topology. A node can be a physical device (such as a transformer or switch) or an abstract logical connection point. Its voltage and power characteristics directly affect power quality and system operation. A voltage sequence refers to a discrete data set of voltage samples from a node in the power system over time, reflecting the dynamic changes in voltage amplitude. Tag data refers to additional information on voltage values that are manually or automatically labeled, used to guide machine learning model training, power quality assessment, or fault diagnosis. The sampling frequency refers to the number of times voltage values are sampled per unit time period.
[0042] Optionally, the voltage at a node in the distribution network includes three-phase voltage, and the voltage values of phase A, phase B, and phase C can be represented by... , and This means that for any one phase of the three-phase voltage, a voltage sequence can be obtained by collecting the voltage value of that phase at any node in the distribution network.
[0043] S104. Based on the second acquisition frequency, select multiple second voltage values from the first voltage sequence, and based on the third acquisition frequency, select multiple third voltage values from the second voltage sequence; wherein, both the second acquisition frequency and the third acquisition frequency are less than the first acquisition frequency.
[0044] Optionally, by reducing the sampling frequency of the first voltage sequence from a first sampling frequency to a second sampling frequency, a portion of the first voltage values can be deleted from all the first voltage values in the first voltage sequence, and the remaining first voltage values are the second voltage values. Similarly, by reducing the sampling frequency of the second voltage sequence from a first sampling frequency to a third sampling frequency, a portion of the voltage values can be deleted from all the voltage values in the second voltage sequence, and the remaining voltage values are the third voltage values. For example, if the first sampling frequency is... Then the second and third sampling frequencies can be respectively and .
[0045] S106. Obtain the first side index matrix representing the topological connection relationship of the first sample distribution network and the second side index matrix representing the topological connection relationship of the second sample distribution network. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by multiple second voltage values, the second label data of the second voltage value, the fourth voltage sequence formed by multiple third voltage values, the first side index matrix and the second side index matrix, train the multi-task learning transfer model before training to obtain the multi-task learning transfer model after training.
[0046] Among them, the topological connection relationship of the distribution network refers to the physical or logical structure of the interconnection of various electrical devices (such as busbars, transformers, switches, loads, etc.) in the power grid through power lines (edges), describing the path of power flow and the interaction between nodes; the edge index matrix is a mathematical form of representing the topological connection relationship, usually a 2×M matrix (M is the number of edges), where each column corresponds to an edge and contains the numbers of two nodes (start and end).
[0047] Optionally, since the multi-task learning transfer model before training is input with the first and third voltage sequences of the first sample distribution network and the second and fourth voltage sequences of the second sample distribution network, which are voltage sequences of the two distribution networks at different sampling frequencies, and also includes the label data carried by the first and second voltage values, the multi-task learning transfer model can be guided to quickly adapt to the voltage data input from the second sample distribution network based on the voltage data and label data of the first sample distribution network. Thus, even without inputting the label data of the voltage data of the second sample distribution network, the multi-task learning transfer model can still be trained based on the voltage data of the second sample distribution network.
[0048] S108. Input the current voltage sequence of the target distribution network, the current sampling frequency of the current voltage sequence, the target sampling frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network into the trained multi-task learning transfer model, and output the target voltage sequence of the target distribution network at the target sampling frequency; wherein, the target sampling frequency is greater than the current sampling frequency.
[0049] Optionally, the trained multi-task learning transfer model can expand the voltage values in the current voltage sequence based on the relationship between the current acquisition frequency and the target acquisition frequency to obtain a target voltage sequence with richer data.
[0050] In the aforementioned voltage data augmentation method, for any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence are obtained; and for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node is obtained; wherein the acquisition frequency of both the first and second voltage sequences is a first acquisition frequency; based on a second acquisition frequency, multiple second voltage values are selected from the first voltage sequence, and based on a third acquisition frequency, multiple third voltage values are selected from the second voltage sequence; wherein both the second and third acquisition frequencies are less than the first acquisition frequency; and a first edge index matrix representing the topological connection relationship of the first sample distribution network and a first edge index matrix representing the topological connection relationship of the second sample distribution network are obtained. The method described in this application uses a second-side index matrix representing the topological connectivity of the target distribution network. Based on a first voltage sequence, first-label data of the first voltage value, a second voltage sequence, a third voltage sequence formed by multiple second voltage values, second-label data of the second voltage values, a fourth voltage sequence formed by multiple third voltage values, the first-side index matrix, and the second-side index matrix, the multi-task learning transfer model before training is trained to obtain a trained multi-task learning transfer model. The current voltage sequence of the target distribution network, the current acquisition frequency of the current voltage sequence, the target acquisition frequency, and the current-side index matrix representing the topological connectivity of the target distribution network are input into the trained multi-task learning transfer model, and the target voltage sequence of the target distribution network at the target acquisition frequency is output. The target acquisition frequency is greater than the current acquisition frequency. The method provided in this application allows the trained multi-task learning transfer model to expand the current voltage sequence acquired at the current acquisition frequency to the target voltage sequence at the target acquisition frequency. This effectively expands the voltage values in the current voltage sequence, resulting in a richer target voltage sequence, thereby enabling high-precision monitoring of the power quality of the target distribution network based on the voltage sequence.
[0051] In some embodiments, such as Figure 2 As shown, based on the second acquisition frequency, multiple second voltage values are selected from the first voltage sequence, including:
[0052] S202. Based on the maximum and minimum voltage values in the first voltage sequence, normalize any first voltage value.
[0053] S204. Determine the normalized voltage sequence as the normalized voltage sequence, and divide the normalized voltage sequence into multiple initial subsequences of the same length.
[0054] S206. For any initial subsequence, input the initial subsequence into the downsampling function and output a target subsequence including multiple second voltage values; wherein, the downsampling function is used to reduce the sampling frequency of the initial subsequence from the first sampling frequency to the second sampling frequency.
[0055] The downsampling function is a signal processing or data dimensionality reduction operation used to reduce the sampling rate or resolution of the data, usually by reducing the number of data points; each initial subsequence contains the same number of voltage values; all target subsequences are combined in time sequence to form the third voltage sequence.
[0056] Alternatively, the normalization process is shown in the following equation:
[0057]
[0058] In the formula, x i This represents the voltage value in the first voltage sequence. and These are the maximum and minimum voltage values, respectively. These are the voltage values in the normalized voltage sequence.
[0059] Alternatively, the downsampling function is shown in the following equation:
[0060]
[0061] In the formula, The first voltage sequence after normalization. This is the third voltage sequence. Let be the downsampling function, and e be the noise matrix.
[0062] Optionally, if the normalized voltage sequence is divided into l initial subsequences, then the first voltage sequence input to the multi-task learning transfer model... and the third voltage sequence They can be represented as:
[0063]
[0064]
[0065] In the formula, N is the number of nodes in the first sample distribution network. This indicates that there is no power quality monitoring information at this location. However, since the multi-task learning transfer model needs to identify specific values during training and application, 0 is used to fill in the data for the locations where monitoring information is missing.
[0066] In this embodiment, the third voltage sequence is obtained by performing normalization, segmentation, and downsampling on the first voltage sequence in sequence. This makes the training results of the multi-task learning transfer model based on the first and third voltage sequences more accurate.
[0067] In some embodiments, the first tag data includes the acquisition time of the first voltage value, the type of power quality event that occurred at the first sample node at the acquisition time, the location of the first sample node in the first sample distribution network, and the first acquisition frequency.
[0068] Among them, power quality events refer to short-term or long-term deviations of voltage, current or frequency from ideal standard values in a power system. These deviations may lead to abnormal operation, malfunction or damage of electrical equipment.
[0069] In this embodiment, by determining multiple first label data, the training of the multi-task learning transfer model based on the label data can be made more accurate.
[0070] In some embodiments, the method further includes:
[0071] For any given second voltage value, replace the first sampling frequency in the first tag data of the second voltage value with the second sampling frequency to obtain the second tag data of the second voltage value.
[0072] Optionally, in order to make the tag data more compatible with the second voltage value, the tag data for the second voltage value needs to be updated.
[0073] In this embodiment, by replacing the first acquisition frequency in the first label data of the second voltage value with the second acquisition frequency, the label data is made more compatible with the second voltage value, thereby making the training of the multi-task learning transfer model more accurate.
[0074] In some embodiments, the multi-task learning transfer model includes a graph convolutional network, a gated recurrent network, and a fully connected layer connected in sequence; the graph convolutional network and the gated recurrent network are shared feature extraction layers for the first sample distribution network and the second sample distribution network, and the fully connected layer includes a first fully connected layer for the first sample distribution network and a second fully connected layer for the second sample distribution network.
[0075] Among them, the Graph Convolutional Network (GCN) mainly aggregates measurement information between nodes by extracting the spatial topological relationships between nodes in the distribution network; the Gated Recurrent Unit (GRU) can model the time series evolution characteristics of voltage measurement data based on GCN, and at the same time, it uses the gating mechanism to solve the gradient vanishing problem in traditional RNNs, which can better capture long-term dependencies in sequence data, thereby significantly improving the performance of voltage value augmentation; the first fully connected layer is used to perform dimension transformation and output the voltage data of the first sample distribution network, and the second fully connected layer is used to perform dimension transformation and output the voltage data of the second sample distribution network.
[0076] Optionally, such as Figure 3 As shown, Figure 3 This is a schematic diagram of a multi-task learning transfer model provided in an embodiment of this application. The shared feature extraction layer in the diagram includes a graph convolutional network and a gated recurrent network. The graph convolutional network includes multiple sequentially connected graph convolutional GCN layers, and the gated recurrent network includes multiple gated recurrent GRU units. The source domain fully connected layer and the target domain fully connected layer are the first fully connected layer and the second fully connected layer, respectively. The multi-task learning loss calculation module is used to calculate the loss value during model training.
[0077] Optionally, the computation process within each GCN layer is shown in the following equation:
[0078]
[0079] In the formula, and These are the input and output of the GCN layer, respectively. It is the adjacency matrix after adding self-loops. This is the corresponding degree matrix. This is the learnable weight matrix of the GCN layer, also called the convolution kernel.
[0080] Optionally, the transfer function between two adjacent GCN layers is shown in the following equation:
[0081]
[0082] In the formula, and These are the inputs for the current layer and the next convolutional layer, respectively. This is the learnable weight matrix for this layer. The ReLU function is used as the activation function. , used to introduce nonlinearity.
[0083] Optionally, assume that there are a total of If there are 1 GCN layer, then the feature matrix output by the GCN network is... It is a shape of The two-dimensional matrix needs to be processed before being input into the GRU network. Converted into a three-dimensional tensor suitable for GRU network processing , shape ,in The time step is the time step, which means concatenating the GCN output features from different times in chronological order.
[0084] Optionally, for the input sequence ,in The GCN network is in the 19th century. The output at each time step has the following shape: The operation process of each GRU unit mainly includes the following four parts:
[0085] (1) Calculate the reset gate
[0086]
[0087] In the formula, It is input To the weight matrix of the reset gate, It is the hidden state from the previous moment. To the weight matrix of the reset gate, It is the bias vector for resetting the gate. It is the Sigmoid activation function, whose output range is [0,1]. The reset gate is used to determine the hidden state at the previous time step. How much information needs to be reset?
[0088] (2) Calculate the update gate
[0089]
[0090] In the formula, , and These are the weight matrix and bias vector corresponding to the update gate, respectively. The update gate is used to determine the hidden state at the previous time step. How much information needs to be transmitted to the hidden state at the current moment? .
[0091] (3) Calculate the candidate hidden state
[0092]
[0093] In the formula, and It is the weight matrix used to calculate the candidate hidden states. It is a bias vector. This represents element-wise multiplication. The candidate hidden state is determined based on the current input. And the previous hidden state after the door was reset Calculated.
[0094] (4) Calculate the hidden state at the current time.
[0095]
[0096] In the formula, the hidden state at the current moment. It is a candidate hidden state Hidden state from the previous moment The weighted sum, with weights determined by the update gate. Decide.
[0097] Optionally, the GRU layer has a chain-like structure, meaning each GRU layer consists of multiple GRU units connected one after another, so that the output of the GRU unit in the previous time step is used as the input of the GRU unit in the next time step. The internal structure of each gated recurrent GRU unit is as follows: Figure 4 As shown.
[0098] Optionally, after After computation at each time step, the GRU network outputs a three-dimensional sequence of hidden states. ,in It is the first The hidden state of the time step, with the shape of , This is the hidden state dimension of the GRU network. Then, for... Compression is performed in the time dimension, specifically by... Cut into The shape is The samples are provided for further processing.
[0099] To further integrate the different dimensional feature information output by the GRU layer, a fully connected layer is used to weight and combine the features output by the GRU network, thereby improving the model's training performance. Simultaneously, to ensure consistency between the input and output dimensions of the entire model, a dimensionality transformation of the GRU network's output is performed through the fully connected layer. The shape is The sample transformation is Thus, the final output of the model is obtained. The calculation formula for the fully connected layer is shown in the following formula:
[0100]
[0101] In the formula, It is the weight matrix of the fully connected layer. It is a bias vector. It is an activation function. It is the final prediction result of the entire model.
[0102] In this embodiment, by designing as follows Figure 3 The multi-task learning transfer model shown can more accurately and efficiently expand the data in the voltage sequence.
[0103] In some embodiments, the method further includes: during the training process of the multi-task learning transfer model, if the loss value output by the multi-task learning transfer model in the current training round is less than a preset loss value, then the multi-task learning transfer model obtained in the current training round is determined as the trained multi-task learning transfer model; wherein, the loss value is obtained by weighted calculation of a first loss value and a second loss value, the first loss value is the loss value corresponding to the first sample distribution network, and the second loss value is the loss value corresponding to the second sample distribution network.
[0104] Optionally, the formula for calculating the first loss value or the second loss value is as follows:
[0105]
[0106] In the formula, n represents the total number of voltage values in the first voltage sequence or the total number of voltage values in the second voltage sequence. The voltage value is either from the first voltage sequence or the voltage value from the second voltage sequence. This is the predicted data for the model.
[0107] Optionally, the formula for calculating the loss value is as follows:
[0108]
[0109] In the formula, Let the loss function of the first sample distribution network be... The loss function for the second sample distribution network. and These are the weight coefficients of the two, which can be adjusted as hyperparameters during training.
[0110] In this embodiment, the loss value is obtained by weighting the first loss value and the second loss value, which can effectively improve the accuracy of the model training results.
[0111] In one embodiment, such as Figure 5 As shown, another method for voltage data augmentation is provided, including the following:
[0112] (1) The datasets required for training the model in the source domain and the target domain are obtained by simulation. The dataset in the source domain is usually obtained by simulation in a small-scale system, while the dataset in the target domain is usually obtained by simulation of the actual power distribution network.
[0113] (2) The data is preprocessed. First, the data is linearly normalized to meet the needs of model training. Second, the high-frequency labels are downsampled to obtain the corresponding low-frequency data. Finally, the high-frequency labels and low-frequency data are classified and organized to obtain the final training samples.
[0114] (3) The training samples of the source domain and the target domain are fed into the GCN+GRU cascade model. The transfer learning algorithm based on multi-task learning is adopted to guide the model to learn in the target domain using the source domain data until the loss function value reaches the predetermined requirement.
[0115] (4) Online application of the model: The power quality monitoring data obtained in the actual power distribution network is preprocessed and then sent into the final model to obtain the super-resolution measurement generation results.
[0116] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0117] Based on the same inventive concept, this application also provides a voltage data expansion device for implementing the voltage data expansion method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more voltage data expansion device embodiments provided below can be found in the limitations of the voltage data expansion method described above, and will not be repeated here.
[0118] In one exemplary embodiment, such as Figure 6 As shown, a voltage data expansion device 600 is provided, including: a first acquisition module 601, a filtering module 602, a second acquisition module 603, and an input module 604, wherein:
[0119] The first acquisition module 601 is used to acquire, for any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence, and to acquire, for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node; wherein the acquisition frequency of the first voltage sequence and the second voltage sequence is a first acquisition frequency.
[0120] The filtering module 602 is used to filter out a plurality of second voltage values from the first voltage sequence based on a second sampling frequency, and to filter out a plurality of third voltage values from the second voltage sequence based on a third sampling frequency; wherein the second sampling frequency and the third sampling frequency are both less than the first sampling frequency.
[0121] The second acquisition module 603 is used to acquire a first side index matrix representing the topological connection relationship of the first sample distribution network and a second side index matrix representing the topological connection relationship of the second sample distribution network. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by the plurality of second voltage values, the second label data of the second voltage value, the fourth voltage sequence formed by the plurality of third voltage values, the first side index matrix, and the second side index matrix, the multi-task learning transfer model before training is trained to obtain the multi-task learning transfer model after training.
[0122] The input module 604 is used to input the current voltage sequence of the target distribution network, the current acquisition frequency of the current voltage sequence, the target acquisition frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network into the trained multi-task learning transfer model, and output the target voltage sequence of the target distribution network at the target acquisition frequency; wherein, the target acquisition frequency is greater than the current acquisition frequency.
[0123] In some embodiments, the filtering module 602 is further configured to normalize any first voltage value based on the maximum and minimum voltage values in the first voltage sequence; determine the normalized voltage sequence as a normalized voltage sequence, and divide the normalized voltage sequence into multiple initial subsequences of the same length; for any initial subsequence, input the initial subsequence into a downsampling function, and output a target subsequence including multiple second voltage values; wherein, the downsampling function is configured to reduce the sampling frequency of the initial subsequence from the first sampling frequency to the second sampling frequency.
[0124] In some embodiments, the voltage data augmentation device 600 is specifically used for the first tag data to include the acquisition time of the first voltage value, the type of power quality event that occurred at the first sample node at the acquisition time, the location of the first sample node in the first sample distribution network, and the first acquisition frequency.
[0125] In some embodiments, the voltage data expansion device 600 is further configured to, for any given second voltage value, replace the first acquisition frequency in the first tag data of the second voltage value with the second acquisition frequency to obtain the second tag data of the second voltage value.
[0126] In some embodiments, the voltage data augmentation device 600 is further used for multi-task learning transfer models including a graph convolutional network, a gated recurrent network, and a fully connected layer connected in sequence; the graph convolutional network and the gated recurrent network are shared feature extraction layers for the first sample distribution network and the second sample distribution network, and the fully connected layer includes a first fully connected layer for the first sample distribution network and a second fully connected layer for the second sample distribution network.
[0127] In some embodiments, the voltage data augmentation device 600 is further configured to, during the training process of the multi-task learning transfer model, if the loss value output by the multi-task learning transfer model in the current training round is less than a preset loss value, determine the multi-task learning transfer model obtained in the current training round as the trained multi-task learning transfer model; wherein, the loss value is obtained by weighted calculation of a first loss value and a second loss value, the first loss value being the loss value corresponding to the first sample distribution network, and the second loss value being the loss value corresponding to the second sample distribution network.
[0128] Each module in the aforementioned voltage data expansion device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0129] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a voltage data augmentation method.
[0130] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0131] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0132] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0133] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0135] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0137] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A voltage data augmentation method, characterized in that, The method includes: For any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence are obtained; and for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node is obtained; wherein, the acquisition frequency of the first voltage sequence and the second voltage sequence is a first acquisition frequency. Based on a second sampling frequency, multiple second voltage values are selected from the first voltage sequence, and based on a third sampling frequency, multiple third voltage values are selected from the second voltage sequence; wherein, both the second sampling frequency and the third sampling frequency are less than the first sampling frequency; A first edge index matrix representing the topological connectivity of the first sample distribution network and a second edge index matrix representing the topological connectivity of the second sample distribution network are obtained. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by the multiple second voltage values, the second label data of the second voltage value, the fourth voltage sequence formed by the multiple third voltage values, the first edge index matrix, and the second edge index matrix, the multi-task learning transfer model before training is trained to obtain the trained multi-task learning transfer model. The multi-task learning transfer model includes a graph convolutional network, a gated recurrent network, and a fully connected layer connected in sequence. The graph convolutional network and the gated recurrent network are shared feature extraction layers for the first sample distribution network and the second sample distribution network. The fully connected layer includes a first fully connected layer for the first sample distribution network and a second fully connected layer for the second sample distribution network. The current voltage sequence of the target distribution network, the current sampling frequency of the current voltage sequence, the target sampling frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network are input into the trained multi-task learning transfer model, and the target voltage sequence of the target distribution network at the target sampling frequency is output; wherein, the target sampling frequency is greater than the current sampling frequency.
2. The method according to claim 1, characterized in that, The step of filtering multiple second voltage values from the first voltage sequence based on the second acquisition frequency includes: Based on the maximum and minimum voltage values in the first voltage sequence, any first voltage value is normalized. The normalized voltage sequence is determined as the normalized voltage sequence, and the normalized voltage sequence is divided into multiple initial subsequences of the same length. For any initial subsequence, the initial subsequence is input into a downsampling function, and the output includes a target subsequence comprising multiple second voltage values; wherein, the downsampling function is used to reduce the sampling frequency of the initial subsequence from the first sampling frequency to the second sampling frequency.
3. The method according to claim 1, characterized in that, The first tag data includes the acquisition time of the first voltage value, the type of power quality event that occurred at the first sample node at the acquisition time, the location of the first sample node in the first sample distribution network, and the first acquisition frequency.
4. The method according to claim 3, characterized in that, The method further includes: For any given second voltage value, replace the first sampling frequency in the first tag data of the second voltage value with the second sampling frequency to obtain the second tag data of the second voltage value.
5. The method according to claim 1, characterized in that, The method further includes: During the training of the multi-task learning transfer model, if the loss value output by the multi-task learning transfer model in the current training round is less than the preset loss value, then the multi-task learning transfer model obtained in the current training round is determined as the trained multi-task learning transfer model; wherein, the loss value is calculated by weighting a first loss value and a second loss value, the first loss value being the loss value corresponding to the first sample distribution network, and the second loss value being the loss value corresponding to the second sample distribution network.
6. A voltage data expansion device, characterized in that, The device includes: The first acquisition module is used to acquire, for any first sample node in the first sample distribution network, a first voltage sequence of the first sample node and a first tag data of any first voltage value in the first voltage sequence, and to acquire, for any second sample node in the second sample distribution network, a second voltage sequence of the second sample node; wherein, the acquisition frequency of the first voltage sequence and the second voltage sequence is a first acquisition frequency. A filtering module is used to filter out multiple second voltage values from the first voltage sequence based on a second sampling frequency, and to filter out multiple third voltage values from the second voltage sequence based on a third sampling frequency; wherein the second sampling frequency and the third sampling frequency are both less than the first sampling frequency; The second acquisition module is used to acquire a first edge index matrix representing the topological connection relationship of the first sample distribution network and a second edge index matrix representing the topological connection relationship of the second sample distribution network. Based on the first voltage sequence, the first label data of the first voltage value, the second voltage sequence, the third voltage sequence formed by the multiple second voltage values, the second label data of the second voltage values, the fourth voltage sequence formed by the multiple third voltage values, the first edge index matrix, and the second edge index matrix, the multi-task learning transfer model before training is trained to obtain the multi-task learning transfer model after training. The multi-task learning transfer model includes a graph convolutional network, a gated recurrent network, and a fully connected layer connected in sequence. The graph convolutional network and the gated recurrent network are shared feature extraction layers for the first sample distribution network and the second sample distribution network. The fully connected layer includes a first fully connected layer for the first sample distribution network and a second fully connected layer for the second sample distribution network. The input module is used to input the current voltage sequence of the target distribution network, the current sampling frequency of the current voltage sequence, the target sampling frequency, and the current edge index matrix representing the topological connection relationship of the target distribution network into the trained multi-task learning transfer model, and output the target voltage sequence of the target distribution network at the target sampling frequency; wherein, the target sampling frequency is greater than the current sampling frequency.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Power distribution network measurement data super-resolution sensing method based on transfer learning
CN119539257A