Voltage sag homologous detection method and system based on deep learning, and medium

Through the deep learning-based CBAM-VGG16 twin network feature extraction model and graph construction algorithm, combined with the improved DBSCAN algorithm, the problem of accuracy and low efficiency of voltage drop homologous detection in the prior art is solved, and more accurate and efficient voltage drop homologous detection is achieved.

CN120030448APending Publication Date: 2025-05-23STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411891583.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art is difficult to accurately identify whether multiple voltage drop events are caused by the same voltage drop source, resulting in problems such as grid voltage drop, contactor release and overheating of the operating motor. The existing methods are large in calculation and low in detection efficiency, making it difficult to apply to large-scale voltage drop data analysis.

Method used

Using a deep learning-based method, the CBAM-VGG16 twin network feature extraction model is used to extract the homologous correlation between voltage downshot samples, and the clustering is combined with the graph construction algorithm and the improved DBSCAN algorithm to output the homologous detection results of voltage downshot.

Benefits of technology

It improves the accuracy and efficiency of homologous detection of voltage stoichiometric detection, reduces the risk of false detection, enhances the generalization and robustness of detection methods, and is suitable for large-scale voltage stoichiometric data analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030448A_ABST
    Figure CN120030448A_ABST
Patent Text Reader

Abstract

The invention relates to a voltage sag homologous detection method and system based on deep learning and a medium, and the method comprises the following steps: obtaining a preprocessed to-be-detected voltage sag recording sample set, and constructing a to-be-detected voltage sag recording sample pair set; based on the to-be-measured voltage sag recording sample pair set, extracting homologous correlation between to-be-measured voltage sag recording sample pairs from a trained CBAM-VGG16-based twin network feature extraction model; based on the homologous correlation degree, determining the waveform category of each to-be-tested voltage sag recording sample in the to-be-tested voltage sag recording sample pair set by adopting a graph construction algorithm; and taking the waveform category as a clustering feature, carrying out clustering by adopting an improved DBSCAN algorithm, and outputting a voltage sag homologous detection result. Compared with the prior art, the method has the advantages of improving the accuracy of homologous detection, reducing the risk of false detection and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power quality and deep learning technology, and in particular to a method, system and medium for detecting voltage sag homology based on deep learning. Background Art

[0002] With the changes in the power supply structure on the grid side and the new features of integration and precision of the user-side equipment, voltage sag has become one of the main problems in power quality. Voltage sag refers to the transient disturbance phenomenon in which the effective value of the power frequency voltage at a certain point in the power system is temporarily reduced to 10% to 90% of the rated voltage, and then returns to the rated voltage amplitude after lasting for 10ms to 1min. The main causes of voltage sag are system short-circuit faults, transformer switching, and starting of large induction motors. After the voltage sag occurs, it will cause problems such as grid voltage drop, contactor release, and overheating of running motors. With the widespread application of a large number of sensitive load equipment and high-precision instruments in the power grid environment, these devices are more sensitive to voltage changes in a short period of time. Voltage sags can cause various equipment problems. In severe cases, the device may be out of control, leading to safety accidents, which not only cause huge economic losses, but also easily cause casualties. Therefore, identifying whether multiple voltage sag events are caused by the same voltage sag source is an urgent problem to be solved in the field of power quality. At the same time, voltage sag detection not only helps to improve the accuracy of locating the sag source, strengthen the management of the power system, promptly remove circuit faults, and reduce economic losses, but also can clarify disputes caused by losses to power users caused by voltage sags, and promptly define the responsibilities of both parties in the accident. Voltage sag detection is the basis for locating sags, understanding the scope of propagation, and accurately evaluating regional power grids, and has important theoretical research significance and application value.

[0003] In order to provide strong data support for the research on power quality, more and more monitoring terminals are deployed on the user side and the grid side to capture power quality fault recording data. A short circuit fault may cause voltage sags at multiple sites, and multiple monitoring terminals of the power quality monitoring platform will record multiple sag data triggered by a single fault. Analyzing and processing multiple sag data caused by the same sag source will not only increase the complexity and amount of calculation for processing sag data, but also lead to many problems such as overestimation of the severity of grid sags, inaccurate location of sag sources, and inaccurate identification of sag propagation paths in distribution networks. Therefore, identifying multiple voltage sag events as the same voltage sag source is an urgent problem to be solved in the field of power quality.

[0004] With the development of computer science and people's high expectations and demands for power quality, the research on voltage sag has become a hot topic in industry and academia. Deep learning algorithms are also gradually applied to the field of voltage sag. Deep learning uses the powerful fitting ability of deep networks to automatically learn the discriminative features in voltage sags and the deep features and internal connections that cannot be extracted manually, bringing the research results in related fields to a new level. Voltage sag homology detection is a relatively new research topic in the field of voltage sags. Voltage sag homology detection is to classify multiple voltage sag data monitored in a short period of time, and classify the voltage sag monitoring data triggered by the same voltage sag source into one category. There are relatively few methods for voltage sag homology detection at present, mainly three categories: methods based on transformer transfer matrix and clustering algorithm, methods based on transformer transfer matrix and image matching, and methods based on space vector transformation. The solution ideas of the above methods are all centered around the feature of processing temporary sag waveforms. They detect whether they are from the same source by comparing the similarity of temporary sag waveforms, and they have all achieved good results in the environment set by their own experiments. However, each temporary sag data of the voltage sag homologous detection method based on the transformer transfer matrix must undergo at least eight matrix transformations, which requires huge computing resources and storage resources, and it is difficult to analyze large-scale voltage sag data; the method based on image matching has a complex process and many steps, and the efficiency of homologous detection is low, so it is difficult to apply to actual scenarios; the method based on space vector transformation, although it eliminates the influence of the transformer on the propagation of voltage sag, is easily affected by other disturbances such as harmonics, and lacks applicability and robustness; the above methods do not consider the influence of spatial distance on the detection of the same source of voltage sag. There is loss when the voltage sag propagates in the power grid. When a voltage sag event occurs, the closer the distance to the voltage sag source, the greater the probability of the sag propagation.

[0005] In response to the problem of voltage sag propagation, some scholars have first divided the problem of voltage sag propagation through transformers into two categories, namely, propagation through one transformer and propagation through multiple transformers. When propagating through a transformer, there are three main types of transformers. When the voltage sag passes through the first type of transformer, its phase voltage or line voltage will not change, and the transfer matrix T1 is the unit matrix E; the second type of transformer does not transmit zero-sequence voltage. Since the line voltage is independent of the zero-sequence voltage, the line voltage transfer matrix is ​​the unit matrix E; the third type of transformer has the same transfer characteristics for phase voltage and line voltage. The transfer matrix is ​​a conversion matrix for converting phase voltage to line voltage. The converted voltage does not contain zero-sequence components and has a phase shift of 30°.

[0006] Existing scholars have derived eight propagation matrices through the study and summary of the propagation of sags through multiple transformers. The traditional method of calculating the similarity of sag waveforms is: take the data with the earliest sag occurrence time as the benchmark data, use eight sag transfer matrices to calculate and process all data, and obtain the effective value of the sag waveform after each data conversion. The benchmark data and other data are comprehensively normalized to form a three-phase matrix. Finally, the three-phase similarity measurement distance between the standard voltage and the comparison matrix is ​​calculated. Taking phase A as an example, the mathematical distance between the phase A data of the standard voltage and the phase A data of each element in the comparison matrix is ​​measured respectively to obtain the distance matrix, and then the minimum value of each row is selected as the similarity between the benchmark data and the phase A of other data, and so on, to obtain the similarity of the three phases. This calculation method requires converting each data at least eight times, which is computationally intensive and the detection process is complicated. It is not suitable for application in real-world scenarios with large amounts of data.

[0007] In recent years, the rise of deep learning technology has provided a new direction for the analysis and management of voltage sags. Network structures such as convolutional neural networks, triple prototype networks, and autoencoders have been applied in the fields of voltage sag feature extraction and sag type identification: the voltage sag identification model based on the triple prototype network can accurately identify the type of voltage sag under the background of a small sample of sags; the sag type identification method based on the stacked denoising autoencoder-neural network constructs a multi-layer denoising autoencoder network for layer-by-layer training, and uses the BP neural network to identify the sag type. Therefore, by using the powerful feature self-extraction ability of deep learning to learn the propagation law of voltage sags in the power grid, we can get rid of the complex and cumbersome voltage sag homologous feature extraction method based on the prior knowledge of the transformer transfer matrix, and enhance the generalization and anti-interference ability of the detection method while improving the speed and accuracy of voltage sag homologous detection. Summary of the invention

[0008] The purpose of the present invention is to provide a voltage sag homology detection method, system and medium based on deep learning that can more accurately complete the homology detection task.

[0009] The purpose of the present invention can be achieved by the following technical solutions:

[0010] A voltage sag homologous source detection method based on deep learning, comprising the following steps:

[0011] Acquire the preprocessed voltage sag recorded waveform sample set to be tested, and construct the voltage sag recorded waveform sample pair set to be tested;

[0012] Input the voltage sag recorded wave sample pair set to be tested into the trained CBAM-VGG16-based twin network feature extraction model to extract the homology correlation between the voltage sag recorded wave sample pairs to be tested;

[0013] Based on the homology correlation, a graph construction algorithm is used to determine the waveform category of each voltage sag recorded wave sample to be tested in the set of voltage sag recorded wave sample pairs to be tested;

[0014] The waveform categories are used as clustering features, and the improved DBSCAN algorithm is used for clustering to output voltage sag homology detection results.

[0015] Furthermore, the pre-processing step comprises:

[0016] The sample data of the voltage sag recording sample set to be tested are converted into three-phase RMS values ​​of the voltage sag, and a two-dimensional image transformation is performed to obtain a preprocessed voltage sag recording sample set to be tested.

[0017] Furthermore, the step of constructing the sample pair to be tested includes:

[0018] The pre-processed voltage sag recording sample set Q to be tested is 1 ,q 2 ,...,q i ,...,q n The sample data in} are sorted from small to large in the order of the time when the voltage sag occurs;

[0019] Traverse each sample data in the sorted voltage sag recording wave sample set to be tested, construct a voltage sag recording wave sample pair to be tested for each sample data, and form a voltage sag recording wave sample pair set to be tested, wherein according to the sample data q i The voltage sag recording sample pair to be measured constructed by (i∈{1,2,...,n}) is (q i ,q j ), j = i+1, i+2, ..., n, where n is the amount of sample data.

[0020] Furthermore, the CBAM-VGG16-based twin network feature extraction model includes a CBAM attention module, a VGG16 module, an L1 distance metric function layer, and a multi-layer fully connected layer. The training steps of the CBAM-VGG16-based twin network feature extraction model include:

[0021] 1) Obtaining original voltage sag recording data and constructing a voltage sag recording training sample pair set;

[0022] 2) Inputting the voltage sag recording training sample pair set into the CBAM attention module to extract the feature map;

[0023] 3) Inputting the feature map into the VGG16 module to extract the voltage sag recording feature and outputting the feature vector;

[0024] 4) Inputting the feature vector into the L1 distance measurement function layer for processing to obtain a measured feature vector;

[0025] 5) Inputting the measured feature vector into a multi-layer fully connected layer for processing, and outputting the homology correlation p;

[0026] 6) The homology correlation p and homology label Y s Back propagation is performed in the input loss function so that the homologous correlation of the homologous voltage sag recording wave training sample pairs tends to 1, and the non-homologous voltage sag recording wave training sample pairs tends to 0;

[0027] 7) Repeat steps 2)-6) for iterative training until the iteration condition is met to obtain a trained twin network feature extraction model based on CBAM-VGG16.

[0028] Furthermore, the step of constructing the voltage sag recording training sample pair set includes:

[0029] 1) Preprocessing the original voltage sag recording data to obtain the original voltage sag recording training sample set D = {C 1 ,C 2 ,C 3 ,...,C k}, C k The k-th voltage sag recording training data includes all voltage sag recording data caused by the same voltage sag source;

[0030] 2) From the original voltage sag recording training sample set D = {C 1 ,C 2 ,C 3 ,...,C k} Randomly select two classes C i , C j (i,j∈{1,2,3,…,k});

[0031] 3) From C i Randomly select multiple different data, select any two of them to form a similar sample pair (x, y), and set the homology label Y of the similar sample pair (x, y) s is 1;

[0032] 4) From C j Randomly extract data w from the randomly selected multiple different data, and use the remaining data z and data w to form a heterogeneous sample pair (z, w), and set the homology label Y of the heterogeneous sample pair (z, w) s is 0;

[0033] 5) Combine the same sample pairs (x, y), different sample pairs (z, w) and their respective homologous labels Ys Classify into the final voltage sag recording training sample pair set T and label data set Y;

[0034] 6) Repeat steps 2)-5) until the building process is completed.

[0035] Furthermore, the loss function adopts a binary cross entropy loss function, and the expression of the binary cross entropy loss function is:

[0036] L bce =-(Y s *(logp)+(1-Y s )*log(1-p))

[0037] Where, L bce is the binary cross entropy loss, Y s is a homology label, whose value is 1 or 0, and p is the homology correlation.

[0038] Furthermore, the execution steps of the graph construction algorithm include:

[0039] Taking each voltage sag recorded wave sample to be tested in the voltage sag recorded wave sample pair set as a graph node;

[0040] Determine whether the homology correlation between two voltage sag recorded wave samples to be tested in the voltage sag recorded wave sample pair to be tested exceeds a threshold value, and if so, connect the two nodes with an undirected edge to form an undirected graph, and construct a weighted adjacency matrix of the undirected graph based on the homology correlation;

[0041] The number of connected components in the undirected graph is determined, and all nodes in the same connected component are regarded as the same waveform category, so as to obtain the waveform categories of all voltage sag recording samples to be measured.

[0042] Furthermore, the step of clustering using the improved DBSCAN algorithm includes:

[0043] 1) The waveform category, start time, and monitoring point number are combined into a feature data set to be detected sorted by time;

[0044] 2) Setting parameters, including the space threshold EpsSpace, the time threshold EpsTime, and the minimum number of clustered samples MinPts;

[0045] 3) Select the first data in the feature data set to be detected, and determine whether it does not belong to any cluster. If not, select the next data in sequence. If yes, perform neighbor search processing to obtain all neighbors, and further determine whether the number of neighbors is less than MinPts. If yes, identify the selected first data as noise. If not, form a new cluster with the first data as the core, and mark the neighbors of the first data that are reachable by density as new cluster labels;

[0046] 4) Continue to iterate through the stack to find the indirect density reachable point of the first data. If the indirect density reachable point is not marked as noise or is not in the current cluster, set the cluster label of the first data as the current cluster label, otherwise continue to search for the next indirect density reachable point;

[0047] 5) Select the next data in the feature data set to be detected, and repeat steps 3)-4) until all data in the feature data set to be detected are processed, and finally obtain the voltage sag homology detection result.

[0048] The present invention also provides a voltage sag homology detection system based on deep learning, comprising:

[0049] Sample pair set construction module: used to obtain the pre-processed voltage sag recorded waveform sample set to be tested, and to construct the voltage sag recorded waveform sample pair set to be tested;

[0050] Homologous correlation extraction module: used for inputting the voltage sag recorded wave sample pair set to be tested into the trained CBAM-VGG16-based twin network feature extraction model to extract the homologous correlation between the voltage sag recorded wave sample pairs to be tested;

[0051] A waveform category discrimination module is used to determine the waveform category of each voltage sag recorded wave sample to be tested in the set of voltage sag recorded wave sample pairs based on the homology correlation and using a graph construction algorithm;

[0052] Detection module: used to use the waveform category as a clustering feature, adopt an improved DBSCAN algorithm for clustering, and output voltage sag homology detection results.

[0053] The present invention also provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the voltage sag homologous detection method based on deep learning as described above.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] (1) The present invention utilizes a twin network feature extraction model based on CBAM-VGG16 to learn the homology mapping relationship between two voltage sag recording samples in parallel, and captures the propagation law of the voltage sag recording samples in the power grid topology through a graph construction algorithm, and obtains waveform category features representing the homology correlation of the two data. Finally, clustering is performed through an improved DBSCAN algorithm to further improve the cluster allocation capability and more accurately complete the homology detection task.

[0056] (2) The present invention uses waveform category, start time, and monitoring point number as new features to characterize the homology of voltage sags. This feature comprehensively considers the sag waveform characteristics and the temporal and spatial characteristics of the sag event, extracts key information of the sag from multiple aspects, improves the accuracy of homology detection, and reduces the risk of false detection.

[0057] (3) The CBAM attention module in the twin network feature extraction model based on CBAM-VGG16 of the present invention can dynamically capture the location of the temporary drop recording fault, overcoming the problem of being unable to detect incomplete recordings.

[0058] (4) The present invention uses an improved DBSCAN algorithm that integrates time and space factors. On the basis of the classic DBSCAN algorithm, the time threshold is used to expand the range of data to be detected, and the monitoring point number and waveform category are combined to detect the same source data, which solves the problems of missed detection and confusion in fixed time slices. At the same time, the grid search method is used to adaptively select the parameters of the algorithm, and the parameters can be adaptively adjusted to achieve accurate detection results in the face of different power grid topologies. Based on the improved DBSCAN algorithm, it can get rid of the constraints of fixed time slices, reduce the sensitivity of the traditional DBSCAN algorithm to parameters, improve the generalization and robustness of the method, and can be applied to actual scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0060] Figure 2 is an overall architecture diagram of an embodiment of the present invention;

[0061] Figure 3 This is a schematic diagram of the feature extraction module of the present invention;

[0062] Figure 4 This is the logic diagram of the improved DBSCAN clustering algorithm of the present invention. DETAILED DESCRIPTION

[0063] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0064] Example 1

[0065] The present embodiment provides a method for detecting the same source of voltage sags based on deep learning. Since the voltage sag same source detection classifies the voltage sag monitoring data triggered by the same voltage sag source among multiple voltage sag record data monitored in a short period of time into one category, the voltage sag same source detection is essentially a clustering problem. Since the voltage sag signals are complex and diverse, the shallow clustering algorithm cannot effectively extract the signal features, and the voltage sag propagation laws are complex and diverse, there are also fewer voltage sag samples that can be used for learning, and the single encoder deep neural network model architecture is not conducive to extracting the same source features of the voltage sag samples. Therefore, the method of the present invention uses a deep clustering strategy to integrate the twin network and clustering algorithm to more efficiently complete the detection task. Figure 2 As shown in the figure, this method uses the idea of ​​deep clustering and is divided into two modules: feature extraction and homology detection. It combines the powerful feature extraction ability of deep learning and the efficient cluster allocation ability of clustering algorithm to complete the detection task more accurately and improve the robustness and generalization of the detection method. Figure 1 and Figure 2 , the overall detection steps are as follows:

[0066] Step 1: Convert the original voltage sag recording data into the root mean square value (RMS) of the three-phase voltage sag, and then transform the RMS value into a data dimension of 105×105×3 through a two-dimensional image.

[0067] Step 2: Divide the preprocessed data set into a training set and a validation set in a ratio of 9:1, and dynamically construct voltage sag recording training sample pairs for the training set and the validation set in batches.

[0068] The training set is constructed according to the training set construction method; similarly, the test data converted from two-dimensional images is constructed into test sample pairs according to the test set construction method to meet the input requirements of the feature extraction module.

[0069] The steps for constructing the training set are as follows:

[0070] Step 1): Given a voltage sag recording training sample set D = {C 1 ,C 2 ,C 3 ,...,C k}, C k is the k-th type of training waveform data set, which contains all the waveform data of temporary sag caused by the same temporary sag source, and the batch training data set size is set to 2m;

[0071] Step 2): In order to ensure the balance of the same and different sample pairs in the training set, two classes are randomly selected from the original recording data set each time, 3 data are extracted from one class and 1 data is extracted from the other class to form a same sample pair and a different sample pair, thus forming a batch training data set. 1 ,t 2 ,...,t 2m}、label dataset Y={y 1 ,y 2 ,…,y 2m} as an example to explain the construction process in detail. First, two different classes C are randomly selected. i , C j (i,j∈{1,2,3,…,k}); then from C i Randomly extract 3 different data x, y, z, select any two data to form a similar sample pair (x, y), and set the homology label Y of the similar sample pair s is 1; from C j Randomly extract a data w from the , and combine it with the remaining data z to form a heterogeneous sample pair (z, w), and set the homology label Y of the heterogeneous sample pair s =0; merge the sample pairs (x, y), (z, w) and their respective labels 1 and 0 into the training data set T and the label data set Y respectively. At this time, a group of homogeneous and heterogeneous sample pairs are constructed. Repeat this step until 2m sample pairs are generated, and the construction of a batch training data set is completed.

[0072] Step 3): Repeat step 2) until the building process is completed.

[0073] Step 3: Input the training sample pairs into the feature extraction module to extract the homology correlation between the sample pairs, and adjust the homology correlation between the sample pairs through the binary cross entropy loss function, so that the homology correlation of the same type of sample pairs is close to 1, while the homology correlation of the different types of sample pairs is close to 0.

[0074] like Figure 3 As shown, the main body of the feature extraction module is a twin network feature extraction model based on CBAM-VGG16. The training steps of the twin network feature extraction model based on CBAM-VGG16 are as follows:

[0075] Dynamically construct training sample pairs from the training set and validation set in batches;

[0076] a) Input the sample pairs in the training set, and then input the feature map after the CBAM attention module into the VGG16 architecture consisting of 13 convolution layers with a convolution kernel of 3×3 and a step size of 1 and 5 pooling layers with a sliding window of 2×2 and a step size of 2 to extract the voltage sag recording features. After the flattening layer, the feature vectors with dimensions of 1×1×4608 are output respectively;

[0077] b) Input the feature vector into the L1 distance metric function layer to obtain a feature vector of 1×1×4608 dimensions after measurement;

[0078] c) After two fully connected layers, a 1×1×1 homology correlation is obtained;

[0079] d) The obtained homology correlation p and homology label Y s Input into the binary cross entropy loss function for back propagation, guide the network to learn meaningful features, more accurately measure the homology correlation between recorded samples, so that the homology correlation of homology sample pairs tends to 1, and the non-homology sample pairs tends to 0. Binary cross entropy loss function L bce As shown in formula (1):

[0080] L bce = -(Y s *(logp)+(1-Y s )*log(1-p)) (1)

[0081] Where: Y s is the true homology label with a value of 1 or 0, and p is the homology correlation. s =1, that is, when the samples are homologous, the smaller p is, the larger the loss function is, and the homologous correlation of the same samples is improved; when Y s = 0, that is, when the sample pairs are not homologous, the larger p is, the larger the loss function is, reducing the homologous correlation between heterogeneous samples. As the model is trained, the loss function gradually decreases, the homologous correlation of homologous sample pairs is closer to 1, and the homologous correlation of non-homologous sample pairs is closer to 0, so that the model can fully learn the rules between voltage sag samples;

[0082] e) Repeat the above steps for iterative training. After the model training is completed, save the model parameters with the best effect.

[0083] Combined with the graph construction algorithm, the model accuracy is measured using simulation test data to obtain the model with the best training effect and save the model parameters.

[0084] The CBAM-VGG16-based twin network feature extraction model in the feature extraction module is used to extract the main feature that describes the homology of the temporary drop: homology correlation. Without considering the influence of the time and location of the temporary drop, the higher the homology correlation extracted by the twin network, the stronger the homology of the two temporary drop data.

[0085] Step 4: construct the input sample pairs according to the input requirements of the feature extraction module for the voltage sag recording samples to be detected in the test set, obtain the homology correlation matrix, set the threshold, and obtain the waveform category through the graph construction algorithm.

[0086] In this embodiment, the threshold is set to 0.8.

[0087] The steps for constructing the voltage sag recording sample pair to be detected are as follows:

[0088] Step 1): Given a set of samples of transient dips to be detected, Q = {q 1 ,q 2 ,...,q n}, the data in Q are sorted from small to large in the order of the time when the temporary drop occurred;

[0089] Step 2): Starting from the first data, construct the detection sample pair related to it. i (i∈{1,2,...,n}) as an example, construct q i The sample pair (q i ,q j ), where j=i+1,i+2,...,n;

[0090] Step 3): Repeat step 2 until q is processed n-1 , construct sample pairs (q n-1 ,q n )Finish.

[0091] After the recorded wave samples to be detected pass through the feature extraction module, a homology correlation matrix is ​​generated, which contains the homology correlation between each pair of recorded wave samples to be detected, forming a homology correlation matrix M. It is input into the graph construction algorithm to finally obtain the waveform category of the recorded wave data to be detected.

[0092] The processing steps of the graph construction algorithm are as follows:

[0093] Step 1): The graph construction algorithm combines the idea of ​​graph theory and regards each sample to be detected as a node of the graph to be constructed;

[0094] Step 2): When the homology correlation between two data to be detected exceeds a threshold, the two nodes are connected by an edge, and an undirected graph based on the homology correlation matrix is ​​finally generated. The homology correlation between the data constitutes a weighted adjacency matrix of the undirected graph;

[0095] Step 3): The number of connected components in the undirected graph is the number of categories of the recorded wave data waveforms to be detected. Nodes within the same connected subgraph belong to the same waveform category.

[0096] Step 5: Input the three-dimensional features of waveform category, start time, and monitoring point number into the improved DBSCAN algorithm. The time threshold is fixed at 10 minutes, and the spatial threshold is searched for the optimal parameter through the network search method to finally obtain the result of the voltage sag homology detection.

[0097] After obtaining the waveform category, it is combined with the start time and the monitoring point number to form the feature data set to be detected and input into the improved DBSCAN algorithm to obtain the final homology detection result. The start time refers to the time recorded by the monitoring terminal when the voltage sag occurs, and the monitoring point number refers to the monitoring terminal number that records this data. Due to information blockage, it replaces the topological position data of the power grid here. As Figure 4 shown, the specific processing steps of the improved DBSCAN algorithm are as follows:

[0098] Step 1): Set the parameters of the algorithm: spatial threshold EpsSpace, time threshold EpsTime, and minimum number of samples in a cluster MinPts, and input the feature data set to be detected;

[0099] Step 2): The algorithm starts processing the data from the first piece of data in the feature data sorted by time. If it belongs to a cluster, it sequentially selects the next one for judgment. If the selected data does not belong to any cluster, it performs a neighbor retrieval process. This process retrieves all density-reachable objects with a spatial distance Δs < EpsSpace, a time distance Δt < EpsTime, and a waveform category Δw of 0 requirement to form the neighbors of the selected data. If the number of neighbors is less than MinPts, the selected data is designated as noise. Otherwise, a new cluster with it as the core is formed, and all its density-reachable neighbors are labeled with the new cluster label.

[0100] Step 3): Continue to iteratively search for indirectly density-reachable points of the selected data through the stack. If the reachable point is not marked as noise or is not in the current cluster, its cluster label is set to the current cluster label. Otherwise, continue to search for the indirectly density-reachable points.

[0101] Step 4): After processing the selected point, continue to sequentially select the next point and repeat steps 2 and 3 until all points are processed.

[0102] The core idea of ​​deep clustering is to learn high-quality data features through deep neural networks to serve subsequent clustering analysis. The deep clustering method based on the twin network uses the structure of the twin network to map sample pairs into a shared representation space, and then perform feature analysis in the representation space. This shared representation space can retain important features of the data and make related samples closer in the space, thereby providing a more meaningful representation for subsequent clustering analysis.

[0103] In summary, the above-mentioned voltage sag homology detection includes the entire process from preprocessing of the recorded wave sample data to be detected to finally obtaining the homology detection results through the clustering algorithm. After the training of the feature extraction module based on the twin network is completed, the recorded wave data to be detected is first constructed into detection sample pairs and input into the feature extraction module to obtain the homology correlation matrix between the detection data. Then, combined with the graph construction algorithm, the homology correlation matrix is ​​converted into the waveform category of the data as one of the features of the final clustering. Finally, the waveform category, start time, and monitoring point number are integrated together to form the homology feature sample set S to be detected, and the improved DBSCAN module is input to complete the final clustering.

[0104] Example 2

[0105] This embodiment provides a voltage sag homology detection system based on deep learning, including:

[0106] Sample pair set construction module: used to obtain the pre-processed voltage sag recorded waveform sample set to be tested, and to construct the voltage sag recorded waveform sample pair set to be tested;

[0107] Homologous correlation extraction module: used for inputting the voltage sag recorded wave sample pair set to be tested into the trained CBAM-VGG16-based twin network feature extraction model to extract the homologous correlation between the voltage sag recorded wave sample pairs to be tested;

[0108] A waveform category discrimination module is used to determine the waveform category of each voltage sag recorded wave sample to be tested in the set of voltage sag recorded wave sample pairs based on the homology correlation and using a graph construction algorithm;

[0109] Detection module: used to use the waveform category as a clustering feature, adopt an improved DBSCAN algorithm for clustering, and output voltage sag homology detection results.

[0110] The rest is the same as in Example 1.

[0111] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0112] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The schemes in the embodiments of the present invention may be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.

[0113] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0117] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A voltage sag homologous detection method based on deep learning, characterized in that: The following steps are involved: Acquire the preprocessed voltage sag recorded waveform sample set to be tested, and construct the voltage sag recorded waveform sample pair set to be tested; Based on the voltage sag recorded wave sample pair set to be tested, the homology correlation between the voltage sag recorded wave sample pairs to be tested is extracted using a trained CBAM-VGG16-based twin network feature extraction model; Based on the homology correlation, a graph construction algorithm is used to determine the waveform category of each voltage sag recorded wave sample to be tested in the set of voltage sag recorded wave sample pairs to be tested; The waveform categories are used as clustering features, and the improved DBSCAN algorithm is used for clustering to output voltage sag homology detection results.

2. The method for detecting voltage sags from the same source based on deep learning according to claim 1, characterized in that: The pre-processing step comprises: The sample data of the voltage sag recording sample set to be tested are converted into three-phase RMS values ​​of the voltage sag, and a two-dimensional image transformation is performed to obtain a preprocessed voltage sag recording sample set to be tested.

3. The method for detecting voltage sags from the same source based on deep learning according to claim 1, characterized in that: The steps of constructing the sample pair to be tested include: The pre-processed voltage sag recording sample set Q = {q1, q2, ..., q i ,...,q n The sample data in} are sorted from small to large in the order of the time when the voltage sag occurs; Traverse each sample data in the sorted voltage sag recording wave sample set to be tested, construct a voltage sag recording wave sample pair to be tested for each sample data, and form a voltage sag recording wave sample pair set to be tested, wherein according to the sample data q i The voltage sag recording sample pair to be measured constructed by (i∈{1,2,...,n}) is (q i ,q j ), j = i+1, i+2, ..., n, where n is the amount of sample data.

4. The method for detecting voltage sags from the same source based on deep learning according to claim 1, characterized in that: The twin network feature extraction model based on CBAM-VGG16 extracts the homology correlation between the voltage sag recording sample pairs to be tested by parallel processing. The twin network feature extraction model based on CBAM-VGG16 includes a CBAM attention module, a VGG16 module, an L1 distance metric function layer, and a multi-layer fully connected layer. The training steps of the twin network feature extraction model based on CBAM-VGG16 include: 1) Obtaining original voltage sag recording data and constructing a voltage sag recording training sample pair set; 2) Inputting the voltage sag recording training sample pair set into the CBAM attention module to extract the feature map; 3) Inputting the feature map into the VGG16 module to extract the voltage sag recording feature and outputting the feature vector; 4) Inputting the feature vector into the L1 distance measurement function layer for processing to obtain a measured feature vector; 5) Inputting the measured feature vector into a multi-layer fully connected layer for processing, and outputting the homology correlation p; 6) The homology correlation p and homology label Y s Back propagation is performed in the input loss function so that the homologous correlation of the homologous voltage sag recording wave training sample pairs tends to 1, and the non-homologous voltage sag recording wave training sample pairs tends to 0; 7) Repeat steps 2)-6) for iterative training until the iteration condition is met to obtain a trained twin network feature extraction model based on CBAM-VGG16.

5. The method for detecting voltage sags from the same source based on deep learning according to claim 4, characterized in that: The steps of constructing the voltage sag recording training sample pair set include: 1) Preprocessing the original voltage sag recording data to obtain the original voltage sag recording training sample set D = {C1, C2, C3, ..., C k }, C k The k-th voltage sag recording training data includes all voltage sag recording data caused by the same voltage sag source; 2) From the original voltage sag recording training sample set D = {C1, C2, C3, ..., C k } Randomly select two classes C i , C j (i,j∈{1,2,3,…,k}); 3) From C i Randomly select multiple different data, select any two of them to form a similar sample pair (x, y), and set the homology label Y of the similar sample pair (x, y) s is 1; 4) From C j Randomly extract data w from the randomly selected multiple different data, and use the remaining data z and data w to form a heterogeneous sample pair (z, w), and set the homology label Y of the heterogeneous sample pair (z, w) s is 0; 5) Combine the same sample pairs (x, y), different sample pairs (z, w) and their respective homologous labels Y s Classify into the final voltage sag recording training sample pair set T and label data set Y; 6) Repeat steps 2)-5) until the building process is completed.

6. The method for detecting voltage sags from the same source based on deep learning according to claim 4, characterized in that: The loss function adopts a binary cross entropy loss function, and the expression of the binary cross entropy loss function is: L bce =-(Y s *(logp)+(1-Y s )*log(1-p)) Where, L bce is the binary cross entropy loss, Y s is a homology label, whose value is 1 or 0, and p is the homology correlation.

7. The method for detecting voltage sags from the same source based on deep learning according to claim 1, characterized in that: The execution steps of the graph construction algorithm include: Taking each voltage sag recorded wave sample to be tested in the voltage sag recorded wave sample pair set as a graph node; Determine whether the homology correlation between two voltage sag recorded wave samples to be tested in the voltage sag recorded wave sample pair to be tested exceeds a threshold value, and if so, connect the two nodes with an undirected edge to form an undirected graph, and construct a weighted adjacency matrix of the undirected graph based on the homology correlation; The number of connected components in the undirected graph is determined, and all nodes in the same connected component are regarded as the same waveform category, so as to obtain the waveform categories of all voltage sag recording samples to be measured.

8. The method for detecting voltage sags from the same source based on deep learning according to claim 1, characterized in that: The step of clustering using the improved DBSCAN algorithm includes: 1) The waveform category, start time, and monitoring point number are combined into a feature data set to be detected sorted by time; 2) Setting parameters, including the space threshold EpsSpace, the time threshold EpsTime, and the minimum number of clustered samples MinPts; 3) Select the first data in the feature data set to be detected, and determine whether it does not belong to any cluster. If not, select the next data in sequence for determination. If yes, perform neighbor search processing to obtain all neighbors, and further determine whether the number of neighbors is less than MinPts. If yes, identify the selected first data as noise. If not, form a new cluster with the first data as the core, and mark the neighbors of the first data that are reachable by density as new cluster labels; 4) Continue to iterate through the stack to find the indirect density reachable point of the first data. If the indirect density reachable point is not marked as noise or is not in the current cluster, set the cluster label of the first data as the current cluster label, otherwise continue to find the indirect density reachable point; 5) Select the next data in the feature data set to be detected, and repeat steps 3)-4) until all data in the feature data set to be detected are processed, and finally obtain the voltage sag homology detection result.

9. A voltage sag homologous detection system based on deep learning, characterized in that: include: Sample pair set construction module: used to obtain the pre-processed voltage sag recorded waveform sample set to be tested, and to construct the voltage sag recorded waveform sample pair set to be tested; Homologous correlation extraction module: used for inputting the voltage sag recorded wave sample pair set to be tested into the trained CBAM-VGG16-based twin network feature extraction model to extract the homologous correlation between the voltage sag recorded wave sample pairs to be tested; A waveform category discrimination module is used to determine the waveform category of each voltage sag recorded wave sample to be tested in the set of voltage sag recorded wave sample pairs based on the homology correlation and using a graph construction algorithm; Detection module: used to use the waveform category as a clustering feature, adopt an improved DBSCAN algorithm for clustering, and output voltage sag homology detection results.

10. A computer-readable storage medium, characterized in that: It includes one or more programs for execution by one or more processors of an electronic device, and the one or more programs include instructions for executing the voltage sag homologous detection method based on deep learning as described in any one of claims 1-8.