Electric energy quality composite disturbance analysis method based on oscillogram characteristics

Through the composite disturbance analysis method of power quality based on waveform graph characteristics, the internal characteristics of the waveform graph waveform graph are analyzed, and the problem of poor practicality of the model in the prior art is solved, and more efficient and accurate identification of the disturbance element of the power quality is achieved.

CN119441965APending Publication Date: 2025-02-14STATE GRID ZHEJIANG ELECTRIC POWER CO LTD JINHUA POWER SUPPLY CO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411361749.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The prior art fails to effectively analyze the inherent characteristics of the electric energy quality disturbance waveform in the analysis of electric energy quality disturbance data, resulting in poor practicality of the model.

Method used

A composite perturbation analysis method based on waveform graph characteristics is proposed. By establishing a composite perturbation model, a set of power quality perturbation waveform diagrams are generated, and a decoding function is constructed to analyze the waveform graph characteristics and analyze multiple perturbation elements in the same waveform graph.

Benefits of technology

It significantly improves the practicality of the waveform graph analysis model, improves the efficiency, accuracy and generalization ability of identifying the elements of the power quality disturbance, and can accurately analyze the types and characteristic parameters of the elements of the power quality disturbance in the test set.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441965A_ABST
    Figure CN119441965A_ABST
Patent Text Reader

Abstract

The invention discloses a power quality composite disturbance analysis method based on oscillogram characteristics, and belongs to the field of power quality disturbance detection, and the method comprises the steps: S1, building a composite disturbance model based on power quality disturbance elements, and generating a training set, a verification set and a test set through the composite disturbance model; s2, establishing a decoding function based on the power quality disturbance element, and constructing an oscillogram analysis model according to the decoding function; s3, training the oscillogram analysis model based on the training set; s4, calculating the loss of the verification set according to the trained oscillogram analysis model and a loss formula, and determining an optimal oscillogram analysis model according to the trend of the loss of the verification set; s5, inputting the test set into an optimal oscillogram analysis model to obtain a test result, and post-processing the test result to obtain an analysis result corresponding to the test set; the method overcomes the problem of poor model practicability caused by the fact that the inherent characteristics of the power quality disturbance waveform are not analyzed in the prior art.
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 disturbance detection, and in particular to a power quality composite disturbance analysis method based on waveform characteristics. Background Art

[0002] With the development of power supply technology, a large number of distributed power sources and nonlinear loads are connected to the power supply network. The existing power supply network has power quality problems caused by complex disturbances formed by cross-coupling of multiple disturbances. Using monitoring devices to monitor massive power quality disturbance data to achieve power quality monitoring is one of the main tasks of smart grids. However, before monitoring the power supply quality of smart grids, it is necessary to analyze the power quality disturbance data. How to determine whether a power quality disturbance occurs and the type of disturbance at the same time, and distinguish the characteristic parameters of the disturbance after determining that the power quality disturbance occurs, and quantify the severity of the power quality disturbance are two important issues in the power quality disturbance data analysis process.

[0003] Chinese patent, publication number: CN117312952A, publication date: December 29, 2023, discloses a method for identifying power quality disturbance characteristics, by constructing 7 power quality disturbance characteristic identification models with the same network structure, and using the Seq2point model to obtain the mapping relationship between input and output, the input of each identification model is the power quality disturbance signal after data processing corresponding to the identification model, and the output of each identification model is the corresponding disturbance, so as to achieve the purpose of identifying 7 types of power quality disturbances and the composite disturbances formed by them; the specific steps are as follows: step 1, data processing is performed on the power quality disturbance signal to be identified to form a power quality disturbance signal after data processing; step 2, respectively constructing voltage swell and voltage Seven power quality disturbance feature identification models of temporary sag, voltage interruption, transient pulse, transient oscillation, harmonics and voltage fluctuation are prepared and trained; step 3, the power quality disturbance signal after data processing in step 1 is respectively input into the seven trained power quality disturbance feature identification models; step 4, the output result of each power quality disturbance feature identification model is judged to obtain a disturbance feature whose output result is non-zero; step 5, the non-zero disturbance feature is denormalized once to obtain the disturbance feature contained in the power quality disturbance signal, and the power quality disturbance identification result is output; however, the invention does not analyze the intrinsic characteristics of the power quality disturbance waveform, and is only applicable to the situation where the disturbance signal corresponds to the seven power quality disturbance feature identification models established. Summary of the invention

[0004] The purpose of the present invention is to address the problem that the prior art does not analyze the intrinsic characteristics of the power quality disturbance waveform, resulting in poor model practicability; a power quality composite disturbance analysis method based on waveform characteristics is proposed, a composite disturbance model is established through power quality disturbance elements to generate a power quality disturbance waveform set, and a decoding function corresponding to the power quality disturbance element is established, a waveform analysis model capable of analyzing the characteristics of the power quality disturbance waveform is constructed according to the decoding function, and multiple disturbance elements in the same waveform are analyzed through the waveform characteristics, and finally the power quality disturbance waveform is input into the waveform analysis model for analysis to obtain analysis results, the type of elements and characteristic parameters that cause the power quality disturbance are identified, and the practicability of the waveform analysis model is significantly improved.

[0005] In a first aspect, a technical solution provided in an embodiment of the present invention is a method for analyzing composite disturbance of power quality based on waveform characteristics, comprising the following steps: S1. Establish a composite disturbance model based on power quality disturbance elements, generate a power quality disturbance waveform atlas according to the simulation time sequence of the composite disturbance model, and extract the elements of the power quality disturbance waveform atlas in time sequence to obtain a training set, a verification set and a test set; S2. Establishing a decoding function based on the power quality disturbance element, and constructing a waveform analysis model according to the decoding function; S3, training the waveform analysis model based on the training set; S4. Calculate the validation set loss according to the trained waveform analysis model and the loss formula, and determine the optimal waveform analysis model according to the trend of the validation set loss; S5. Input the test set into the optimal waveform analysis model to obtain a test result, and post-process the test result to obtain an analysis result corresponding to the test set.

[0006] In this scheme, a composite disturbance model is established according to the power quality disturbance elements, and the actual field disturbance waveform is simulated by the composite disturbance model to generate a power quality disturbance waveform set to obtain a training set, a verification set and a test set, so as to avoid the influence of waveform anomalies caused by non-power quality disturbance elements on the analysis results; and a waveform analysis model capable of analyzing the characteristics of the power quality disturbance waveform and analyzing multiple disturbance elements in the same waveform is constructed according to a decoding function established based on the power quality disturbance elements; then the waveform analysis model is trained using the training set, and the verification set is applied to the trained waveform analysis model to obtain the verification set loss, and the optimal waveform analysis model is determined according to the verification set loss, which significantly improves the efficiency, accuracy and generalization ability of the waveform analysis model in identifying power quality disturbance elements; finally, the test set is input into the optimal waveform analysis model for testing to obtain the test results, and the test results are post-processed to obtain the analysis results corresponding to the test set, which effectively improves the accuracy of the optimal waveform analysis model in analyzing the test set to obtain the types and characteristic parameters of the elements causing power quality disturbance.

[0007] Preferably, in S1, the composite disturbance model established based on the power quality disturbance element is specifically as follows: p(t)=[sag(t),swl(t),itr(t)]×[flk(t)] ×{sin(t)+[hmy(t)]+[sks(t)]+[nth(t)]+[noise(t)]} +[osc(t),imp + (t),imp - (t)] Where sin(t) is the standard sinusoidal signal, sag(t) is the voltage sag factor, swl(t) is the voltage swell factor, itr(t) is the voltage interruption factor, and imp + (t) is the transient positive pulse factor, imp - (t) is the transient negative pulse factor, osc(t) is the transient oscillation factor, sks(t) is the peak factor, nth(t) is the notch factor, flk(t) is the voltage flicker factor, hmy(t) is the harmonic factor, noise(t) is the noise signal, and p(t) is the power quality disturbance waveform.

[0008] Preferably, in S2, a decoding function is established based on the power quality disturbance element, and a specific process of constructing a waveform analysis model according to the decoding function is as follows: S21, establishing a decoding function based on the detection head of the YOLOv3 network head and the power quality disturbance element corresponding to the detection head; S22. Apply the decoding function to the detection head to improve the YOLOv3 network and obtain a waveform analysis model.

[0009] In this scheme, the detection head of the YOLOv3 network head is divided into three, and the three detection heads respectively detect different power quality disturbance elements. At the same time, a corresponding decoding function is established according to the characteristics of the power quality disturbance element itself, and the decoding function is applied to the corresponding detection head to improve the YOLOv3 network to obtain a waveform analysis model, thereby effectively improving the analysis capability, efficiency and accuracy of the waveform analysis model for the power quality disturbance waveform.

[0010] Preferably, the decoding function established in S21 includes: a detection activation function σ(.), a classification function Softmax, a time positioning function and a feature parameter identification function; The time positioning function is as follows: In the formula, is the midpoint of the time window, include j is an integer that follows the feature vector, σ(.) is the detection activation function, is the feature map T (i) The first value of the j-th feature map vector, is the time window width, include is the number of sampling points corresponding to the time scale of 5ms, is the number of sampling points corresponding to the time scale of 75ms, exp(.) is the exponential function, is the feature map T (i) The second value of the j-th feature map vector; The characteristic parameter identification function is as follows: g(x)=scale×σ(x)-0.5×(scale-1); Where g(x) is the identified feature parameter, scale is the scale parameter, and σ(x) is the detection activation function.

[0011] Preferably, in S3, the specific process of training the waveform analysis model based on the training set is: S31, randomly extracting waveforms from a training set based on a preset waveform number threshold and inputting them into the waveform analysis model for detection to obtain a feature graph; S32, calculating the waveform loss according to the characteristic graph and the loss formula, and simultaneously back-propagating the waveform loss using the back-propagation method to update the parameter combination of the waveform analysis model; S33. Repeat S31-S32 until the training stop condition is met.

[0012] In this scheme, some waveform graphs in the training set are extracted as a small batch of training waveform graphs and input into the waveform graph analysis model for training, and the parameter combination of the waveform graph analysis model is updated according to the calculated small batch training waveform graph loss and the back propagation method, including a preset waveform number threshold. The performance of the waveform graph analysis model when analyzing different numbers of waveform graphs is changed through the continuous parameter combination update process.

[0013] Preferably, S3 further includes collating and recording the waveform loss calculated during the training process to obtain the training set loss and the waveform analysis model parameter combination corresponding to the waveform loss.

[0014] In this solution, a correspondence between the waveform analysis model parameter combination and the training waveform in each updating process is established, and the loss of the training waveform is sorted out to obtain the training set loss, so as to support the subsequent determination of the optimal waveform analysis model parameter combination.

[0015] Preferably, in S4, the specific process of determining the optimal waveform analysis model according to the trend of the validation set loss is: S41, calculating the average accuracy mean of the verification set and the average accuracy mean of the training set according to the average accuracy mean formula; S42, drawing a validation set curve based on the validation set loss and the mean of the validation set average accuracy, and drawing a training set curve based on the training set loss and the mean of the training set average accuracy; S43, comparing and analyzing the validation set curve and the training set curve to determine the minimum waveform loss, and determining the waveform analysis model parameter combination corresponding to the minimum waveform loss as the optimal parameter combination; S44. Adjust the waveform analysis model according to the optimal parameter combination to obtain an optimal waveform analysis model.

[0016] In this scheme, the minimum waveform loss is determined by drawing and comparing the validation set curve with the training set curve, and the waveform analysis model parameter combination corresponding to the minimum waveform loss is determined as the optimal parameter combination. At the same time, the waveform analysis model is adjusted according to the optimal parameter combination to obtain the optimal waveform analysis model that best fits the actual working environment and has the highest efficiency and accuracy in analyzing power quality disturbance elements.

[0017] Preferably, in S4, the loss formula is specifically as follows: Where, L Mis the total loss of the waveform analysis model corresponding to the validation set, L1 is the loss of the shallow detection head of the waveform analysis model corresponding to the validation set, L2 is the loss of the middle detection head of the waveform analysis model corresponding to the validation set, and L3 is the loss of the deep detection head of the waveform analysis model corresponding to the validation set. Including shallow detection head confidence loss And the confidence loss of the middle-level detection head Including shallow detection head classification loss and the classification loss of the middle-level detection head Including shallow detection head positioning loss and mid-level detection head positioning loss Including shallow detection head feature parameter regression loss and the mid-level detection head feature parameter regression loss is the confidence loss of the deep detection head, is the feature parameter regression loss of the deep detection head.

[0018] Preferably, in S5, the specific process of post-processing the test result to obtain the analysis result corresponding to the test set is: S51, calculating the start and end sampling points of the disturbance according to the midpoint of the candidate time window and the width of the candidate time window in the test result, and clipping the candidate time window according to the start and end sampling points to determine the time window; S52, filtering out the time windows according to the confidence in the test result, the conditional category probability and the preset category confidence threshold to obtain a time window set; S53, inputting different time window subsets in the time window set into the NMS filtering formula for comparison and filtering to determine the final time window, and determining the analysis result according to the category and characteristic parameters corresponding to the final time window; The time window is obtained by intercepting the time series of the test set according to a preset sampling period by the optimal waveform analysis model.

[0019] In this solution, the time window is input into the NMS filtering formula for comparison and filtering, overlapping time windows in the same category are screened, and time windows with smaller category confidence are discarded during continuous filtering, while time windows with larger category confidence are retained, so that the positioning of the analysis results is more accurate, and the detection accuracy of the optimal waveform analysis model is effectively improved.

[0020] Preferably, the NMS filtering formula is as follows: In the formula, the IoU value is 0, A is a subset of time windows involved in comparison and filtering, and B is another subset of time windows involved in comparison and filtering.

[0021] The present invention has at least the following substantial effects: The present invention establishes a composite disturbance model according to power quality disturbance elements, simulates actual field disturbance waveforms through the composite disturbance model to generate power quality disturbance waveform graph sets to obtain training sets, verification sets and test sets, thereby avoiding the influence of waveform anomalies caused by non-power quality disturbance elements on analysis results; and constructs a waveform graph analysis model capable of analyzing power quality disturbance waveform graph characteristics and analyzing multiple disturbance elements in the same waveform graph according to a decoding function established based on power quality disturbance elements; then the waveform graph analysis model is trained using the training set, and the verification set is applied to the trained waveform graph analysis model to obtain the verification set loss, and the optimal waveform graph analysis model is determined according to the verification set loss, thereby significantly improving the efficiency, accuracy and generalization ability of the waveform graph analysis model in identifying power quality disturbance elements; finally, the test set is input into the optimal waveform graph analysis model for testing to obtain test results, and the test results are post-processed to obtain the analysis results corresponding to the test set, thereby effectively improving the accuracy of the optimal waveform graph analysis model in analyzing the test set to obtain the types and characteristic parameters of the elements causing power quality disturbance.

[0022] The above invention content is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present invention will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the present invention. Also, the same reference symbols are used throughout the drawings to represent the same parts.

[0024] Figure 1 It is a flow chart of the power quality composite disturbance analysis method based on waveform characteristics of the present invention; Figure 2 It is a structural diagram of the waveform analysis model; Figure 3 Schematic diagram of the comparison analysis between the validation set curve and the training set curve. DETAILED DESCRIPTION

[0025] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific implementation method described herein is only an optimal embodiment of the present invention, which is only used to explain the present invention and does not limit the scope of protection of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0026] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the drawings; the process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0027] Embodiment 1: like Figure 1 As shown, this embodiment provides a method for analyzing power quality composite disturbance based on waveform characteristics, and the method includes the following steps: S1. Establish a composite disturbance model based on power quality disturbance elements, generate a power quality disturbance waveform atlas according to the simulation timing of the composite disturbance model, and extract the elements of the power quality disturbance waveform atlas in timing to obtain a training set, a verification set and a test set.

[0028] In one embodiment, the composite disturbance model established based on the power quality disturbance element is specifically as follows: p(t) = [sag(t), swl(t), itr(t)] × [flk(t)] ×{sin(t)+[hmy(t)]+[sks(t)]+[nth(t)]+[noise(t)]} +[osc(t),imp + (t),imp - (t)] Where sin(t) is the standard sinusoidal signal, sag(t) is the voltage sag factor, swl(t) is the voltage swell factor, itr(t) is the voltage interruption factor, and imp + (t) is the transient positive pulse factor, imp - (t) is the transient negative pulse factor, osc(t) is the transient oscillation factor, sks(t) is the peak factor, nth(t) is the notch factor, flk(t) is the voltage flicker factor, hmy(t) is the harmonic factor, noise(t) is the noise signal, and p(t) is the power quality disturbance waveform.

[0029] In this embodiment, there are 10 power quality disturbance factors, and the 10 power quality disturbance elements together constitute a composite power quality disturbance signal in an actual working environment. The composite power quality disturbance signal can be regarded as the superposition of multiple single disturbance elements. According to the overlapping of the disturbance element time intervals, the composite situation between every two disturbance elements is divided into overlapping composite and non-overlapping composite. However, there is internal mutual exclusivity between some disturbance elements, such as a certain waveform segment cannot be in a temporary rise and temporary drop state at the same time, and a peak and a notch cannot appear at the same time. According to the internal mutual exclusivity, the 10 power quality disturbance elements are divided into 4 categories and Table 1 is established. The Table 1 is shown as follows: Table 1. Basic disturbance elements of power quality and their characteristic parameters Secondly, since the value range of the characteristic parameters to be identified for each disturbance element is different, the normalization method is used to adjust the value range of the characteristic parameters to the range of [0,1] to balance the importance of each characteristic parameter in the learning process of the waveform analysis model. The normalization formula is as follows: In the formula, x is the value of the feature parameter before normalization, is the value of the feature parameter after normalization, x min is the minimum value before the feature parameter is normalized, x max is the maximum value before the characteristic parameter is normalized; when the waveform analysis model training is completed and the learning is finished, it is necessary to perform a regression operation on the normalized value of the above characteristic parameter to obtain the actual value of the characteristic parameter; finally, the composite disturbance model is deployed in MATLAB and combined with the actual field data to simulate and generate a power quality disturbance waveform atlas. A total of 57 power quality disturbance waveforms are generated, including 11 single disturbance waveforms, 22 double disturbance waveforms and 24 triple disturbance waveforms. One of the single disturbance waveforms is a normal signal. Specifically, in MATLAB, the fundamental frequency is set to 50 Hz, the sampling frequency is set to 6.4 kHz, the sampling time is set to 0.28 s, and a total of 1792 sampling points are set; It should be noted that the training set, validation set, and test set are each generated in MATLAB through the composite disturbance model. They are all obtained by extracting the power quality disturbance waveform atlas set by MATLAB according to the set sampling frequency and the simulation timing of the composite disturbance model, but their sample distribution is consistent. The difference is that the relationship between the number of samples of each disturbance in the training set, validation set, and test set is 4:1:1, so when the number of each disturbance element in the training set is 1600, the number of each disturbance element in the validation set and the test set is 400.

[0030] S2. Establish a decoding function based on the power quality disturbance element, and construct a waveform analysis model according to the decoding function.

[0031] In one embodiment, the specific process of establishing a decoding function to construct a waveform analysis model is as follows: S21, establishing a decoding function based on the detection head of the YOLOv3 network head and the power quality disturbance element corresponding to the detection head; S22. Apply the decoding function to the detection head to improve the YOLOv3 network and obtain a waveform analysis model.

[0032] In one embodiment, the established decoding function specifically includes: a detection activation function σ(.), a classification function Softmax, a time positioning function and a feature parameter identification function; The time positioning function is as follows: In the formula, is the midpoint of the time window, include j is an integer that follows the feature vector, σ(.) is the detection activation function, is the feature map T (i) The first value of the j-th feature map vector, is the time window width, include is the number of sampling points corresponding to the time scale of 5ms, is the number of sampling points corresponding to the time scale of 75ms, exp(.) is the exponential function, is the feature map T (i) The second value of the j-th feature map vector; The characteristic parameter identification function is as follows: g(x)=scale×σ(x)-0.5×(scale-1); Where g(x) is the identified feature parameter, scale is the scale parameter, and σ(x) is the detection activation function.

[0033] In this embodiment, the waveform analysis model constructed according to the decoding function is as follows: Figure 2 As shown, the waveform analysis model can be divided into a trunk sub-network, a neck sub-network and a head sub-network according to the function, and the shallow detection head, the middle detection head and the deep detection head are all set in the head sub-network; The backbone subnetwork includes a CBL module and a Res residual module. The CBL module is composed of a one-dimensional convolutional layer, a batch normalization layer, and a Leaky ReLU activation layer connected in series. Figure 2The (1×11 / 2, 32) marked on the CBL module in the backbone subnetwork shows that the convolution kernel size of the CBL module is 1×11, the convolution step size is 2, and the output dimension is 32; the Res residual module provides the effect of cross-layer direct connection for the waveform analysis model, which can alleviate the problem of gradient disappearance and gradient explosion after the network is deepened; The neck subnetwork includes a CBL module, a ConvSet module, an Upsample upsampling module, and a Concatenate merging module. The ConvSet module fuses and enhances the results of splicing feature maps of different scales by cross-using 1×1 / 1 and 1×11 / 1 CBL modules. The Upsample upsampling module samples up layer by layer from the bottom feature map. The Concatenate merging module fuses the upsampled feature map of each layer with the corresponding low-level feature map. Finally, the neck subnetwork obtains fused features containing rich high-level abstract features and precise location information features through the above modules, and then transmits the shallow detail information back to the deep path to further enhance the time positioning effect of the deep layer. The head sub-network includes a CBL module and a Conv module. The CBL module and the Conv module, combined with the decoding function and the category and parameters of the perturbation element, form a three-layer detection head as shown in Table 2. Table 2 is as follows: Table 2. Information of each layer's detection head and output feature map In the table, M = Q / 32, Q is the total number of sampling points; According to the basic principle of the YOLOv3 network, in the waveform analysis model, the length of the shallow feature map corresponding to the shallow detection head in the sequence direction is 4M, corresponding to the 4M equally divided segments of the original sequence, where the feature map After the sigmoid activation function, the detection activation function σ(.) outputs the confidence score Said Represents the first column element of the i-th row of the corresponding feature map, It represents the probability confidence that the i-th equal-division segment contains a gap, a spike, an oscillation, a positive pulse, or a negative pulse; The channel dimension is 5, and the classification function Softmax is used to perform decoding operations along the channel direction to obtain the conditional category probability of the jth type of disturbance in the gap, spike, oscillation, positive pulse or negative pulse disturbance in the i-th equally divided segment Said represents a feature map vector composed of the i-th row elements of the corresponding feature map, wherein the feature map vector is a row vector; When the shallow detection head detects notch disturbance, spike disturbance, oscillation disturbance, positive pulse disturbance or negative pulse disturbance, the time positioning problem is also involved. Specifically, the j-th feature vector of the shallow feature map corresponding to the shallow detection head is decoded by the time positioning function to obtain the midpoint and width of the time window corresponding to the corresponding disturbance, and then the start and end positions of the time window are obtained; The detection action and principle of the middle-layer detection head are similar to those of the shallow-layer detection head. The difference is that the middle-layer feature map corresponding to the middle-layer detection head detects and classifies three types of amplitude disturbance elements, namely voltage surge, voltage sag and voltage interruption, on 2M equally divided segments of the original sequence. The deep detection head is used to detect voltage flicker disturbances and harmonic disturbances. Since the detection of the voltage flicker disturbances and harmonic disturbances does not involve the problem of time positioning, the deep detection head uses global average pooling to aggregate global features on the sequence dimension. Its detection branch uses the Sigmoid activation function, that is, the detection activation function σ(.) outputs the probability value of voltage flicker disturbances and harmonic disturbances. Specifically, the Sigmoid activation function outputs 0.5 at 0 as the division threshold. When the probability value is greater than 0.5, it is considered that the corresponding disturbance exists; After the above-mentioned shallow detection head, middle detection head and deep detection head complete the detection, it is necessary to identify the characteristic parameters of the detection results of the detection heads and output the detection results. At this time, the characteristic parameters are in the range of [0,1] after normalization in the aforementioned step S1. If the detection head directly uses the saturated activation function Sigmoid for output, the corresponding value needs to be set to positive infinity or negative infinity in advance, which will cause the waveform analysis model to fail to learn. Therefore, the characteristic parameter identification function is used to change the output range to [-0.5,1.5]. The output outside the changed range can be used to indicate out-of-distribution data, and the scale parameter scale takes a value of 2.

[0034] S3. Training the waveform analysis model based on the training set.

[0035] In one embodiment, the training process of the waveform analysis model is as follows: S31, randomly extracting waveforms from a training set based on a preset waveform number threshold and inputting them into the waveform analysis model for detection to obtain a feature graph; S32, calculating the waveform loss according to the characteristic graph and the loss formula, and simultaneously back-propagating the waveform loss using the back-propagation method to update the parameter combination of the waveform analysis model; S33. Repeat S31-S32 until the training stop condition is met.

[0036] In one embodiment, S3 further includes collating and recording the waveform loss calculated during the training process to obtain the training set loss and the waveform analysis model parameter combination corresponding to the waveform loss.

[0037] In this embodiment, the waveform analysis model parameter combination includes the preset waveform number threshold, learning rate, training algebra, etc. During the training process, the training waveform data is continuously extracted from the training set without replacement according to the preset waveform number threshold and input into the waveform analysis model until the waveform data in the training set is exhausted, that is, the training stop condition is met. In this embodiment, a total of 50 training sessions were performed to obtain 50 waveform analysis models and waveform losses and waveform analysis model parameter combinations corresponding to the 50 waveform analysis models.

[0038] S4. Calculate the validation set loss based on the trained waveform analysis model and the loss formula, and determine the optimal waveform analysis model based on the trend of the validation set loss.

[0039] In one embodiment, using Figure 3 The scheme of comparing and analyzing the validation set curve with the training set curve shown in the figure is to find the optimal waveform analysis model among the 50 waveform analysis models that have completed training, and specifically includes the following sub-steps: S41, calculating the average accuracy mean of the verification set and the average accuracy mean of the training set according to the average accuracy mean formula; S42, drawing a validation set curve based on the validation set loss and the mean of the validation set average accuracy, and drawing a training set curve based on the training set loss and the mean of the training set average accuracy; S43, comparing and analyzing the validation set curve and the training set curve to determine the minimum waveform loss, and determining the waveform analysis model parameter combination corresponding to the minimum waveform loss as the optimal parameter combination; S44. Adjust the waveform analysis model according to the optimal parameter combination to obtain an optimal waveform analysis model.

[0040] In one embodiment, the loss formula is specifically as follows: Where, L M is the total loss of the waveform analysis model corresponding to the validation set, L1 is the loss of the shallow detection head of the waveform analysis model corresponding to the validation set, L2 is the loss of the middle detection head of the waveform analysis model corresponding to the validation set, and L3 is the loss of the deep detection head of the waveform analysis model corresponding to the validation set. Including shallow detection head confidence loss And the confidence loss of the middle-level detection head Including shallow detection head classification loss and the classification loss of the middle-level detection head Including shallow detection head positioning loss and mid-level detection head positioning loss Including shallow detection head feature parameter regression loss and the mid-level detection head feature parameter regression loss is the confidence loss of the deep detection head, is the feature parameter regression loss of the deep detection head.

[0041] In this embodiment, the category with the largest conditional category probability in the waveform analysis model output is first determined as the disturbance type, and then the conditional category probability is multiplied by the confidence to obtain the category confidence. By changing the preset original category confidence threshold δ, a series of precision and recall rates can be obtained. The area under the curve formed by the precision and recall rate is the average accuracy. The average accuracy mean is the average of the average accuracy of all categories of disturbances. The calculation formulas of the precision and recall rate are as follows: Where Pre is the precision, TP is the number of correctly identified disturbances, FP is the number of incorrectly identified disturbances, Re is the recall rate, and FN is the number of missed identified disturbances; it should be noted that the training set, validation set, and test set are independently generated by the composite disturbance model, so the training set and validation set can be simulated and generated according to historical data to facilitate the correctness of the recognition results of the waveform analysis model; Secondly, when calculating the loss of the validation set and the training set according to the loss formula, the confidence loss uses the binary cross entropy loss, and the classification loss uses the multi-classification cross entropy loss, as shown below: In the formula, Including shallow detection head confidence loss And the confidence loss of the middle-level detection head 4M / i represents the length of the feature map corresponding to the detection head in the sequence direction. Represents the conditional category probability prediction value of the true category. According to whether the jth equally divided segment contains the perturbation target, the corresponding feature map vector can be divided into positive and negative categories. The indicator function They take values ​​0 and 1 respectively. The values ​​are 0 and 1, λ noobj is the weight coefficient for balancing the number of negative feature map vectors and positive feature map vectors, λ cls is the weight coefficient of classification loss, is the feature map C (i) The first value of the j-th eigenvector of is the feature map C(3) The jth value of the first eigenvector of for The label value of The calculation of the positioning loss and the feature parameter regression loss is as follows: In the formula, Including shallow detection head positioning loss and mid-level detection head positioning loss is the shallow detection head feature parameter regression loss, is the feature parameter regression loss of the middle-level detection head, is the feature parameter regression loss of the deep detection head, λ loc is the positioning loss weight coefficient, 4M / i, 4M, and 2M all represent the length of the feature map corresponding to the detection head in the sequence direction, and λ para is the feature parameter regression loss weight coefficient, is the feature map T (i) The first value of the j-th feature map vector, for The label value of is the feature map T (i) The second value of the j-th feature map vector, for The label value of A is the feature map (1) The feature map vector composed of the j-th row elements of for The label value of Indicates whether the jth equally divided segment contains a spike disturbance or a gap disturbance. Indicates whether the jth equally divided segment contains positive pulse disturbance or negative pulse disturbance. Indicates whether the j-th equal-division segment contains oscillation disturbances, A is the feature map (2) The feature map vector composed of the j-th row elements, for The label value of A is the feature map (3) The feature map vector composed of the first row elements of for The label value of Indicates whether the first equal-division segment contains voltage flicker disturbance. indicates whether the first equally divided segment contains harmonic disturbances, g(·) is the characteristic parameter identification function, that is, g(x) = scale × σ(x) - 0.5 × (scale - 1), diag(·) is the diagonal matrix constructor, and in addition, consistent with the above, the indicator function They take values ​​0 and 1 respectively; Then the mean accuracy and loss are plotted as follows Figure 3 The curve graph shown in the figure is compared and analyzed, and the training set curve that is closest to the validation set curve is defined as the minimum waveform loss curve, and the waveform analysis model parameter combination corresponding to the minimum waveform loss is determined as the optimal parameter combination. At this time, if you want to improve the efficiency of the waveform analysis model, you can determine the trained waveform analysis model corresponding to the minimum waveform loss curve as the optimal waveform analysis model, or you can adjust the waveform analysis model according to the optimal parameter combination to obtain the optimal waveform analysis model, thereby further improving the accuracy of the waveform analysis model.

[0042] S5. Input the test set into the optimal waveform analysis model to obtain a test result, and post-process the test result to obtain an analysis result corresponding to the test set.

[0043] In one embodiment, post-processing the test results of the waveform analysis model to obtain corresponding analysis results specifically includes the following sub-steps: S51, calculating the start and end sampling points of the disturbance according to the midpoint of the candidate time window and the width of the candidate time window in the test result, and clipping the candidate time window according to the start and end sampling points to determine the time window; S52, filtering out the time windows according to the confidence in the test result, the conditional category probability and the preset category confidence threshold to obtain a time window set; S53, inputting different time window subsets in the time window set into the NMS filtering formula for comparison and filtering to determine the final time window, and determining the analysis result according to the category and characteristic parameters corresponding to the final time window; The time window is obtained by intercepting the time series of the test set according to a preset sampling period by the optimal waveform analysis model.

[0044] In one embodiment, the NMS filtering formula is as follows: In the formula, the IoU value is 0, A is a subset of time windows involved in comparison and filtering, and B is another subset of time windows involved in comparison and filtering.

[0045] In this embodiment, the left boundary coordinate z of each candidate time window is calculated by using the midpoint of the candidate time window and the width of the candidate time window in the test result. (b) , right boundary coordinate z (e) , and according to the rounding function, the left boundary coordinate z (b) and the right boundary coordinate z (e) The start and end sampling points of the disturbance are calculated as follows: In the formula, Includes the starting sampling point with disturbance and stop sampling point Round(.) is the rounding function, Q is the total number of sampling points; Then, for each candidate time window, the category with the largest conditional category probability is selected as the disturbance type, and multiplied by the confidence to obtain the category confidence. At the same time, the candidate time windows with category confidence lower than the preset category confidence threshold are filtered out to obtain a time window set. Finally, the NMS filtering formula is used to filter out the candidate time windows whose category confidences of the optimal waveform analysis model may be greater than or equal to the preset category confidence threshold and overlap with each other for the same disturbance target, and determine the final analysis result.

[0046] In this implementation, a performance index is also used to evaluate the detection and classification performance of the optimal waveform analysis model. Specifically, the average accuracy mean is used. The calculation formula is the same as the calculation formula for the average accuracy mean in the above-mentioned search for the optimal parameter combination. The difference is that the correct identification of the disturbance TP requires the following two conditions to be met at the same time: 1) The IoU between the predicted time window and the real time is greater than the threshold, that is, greater than 0; 2) The disturbance type is correctly classified; If there are multiple prediction time windows that meet the above two conditions at the same time, the prediction time window with the largest IoU is selected to match the real time window, and the remaining ones are regarded as misidentifications. In addition, only the condition 2) but not the condition 1) is also regarded as misidentification. If there is no prediction time that meets the above conditions, it is considered that missed identification occurs; and the average absolute error of each parameter is calculated based on the correct identification of the disturbance TP of each type of basic disturbance. The average absolute error err of the parameter p of the correct identification of the disturbance TP is p Given by: In the formula, and represents the predicted value of parameter p and the true value of parameter p for each correctly identified perturbation TP.

[0047] This embodiment has at least the following substantial effects: In this embodiment, a composite disturbance model is established according to power quality disturbance elements, and the actual field disturbance waveform is simulated by the composite disturbance model to generate a power quality disturbance waveform set to obtain a training set, a verification set and a test set, so as to avoid the influence of waveform anomalies caused by non-power quality disturbance elements on the analysis results; and a waveform analysis model capable of analyzing the characteristics of power quality disturbance waveforms and analyzing multiple disturbance elements in the same waveform is constructed according to a decoding function established based on power quality disturbance elements; then the waveform analysis model is trained using the training set, and the verification set is applied to the trained waveform analysis model to obtain the verification set loss, and the loss of the verification set is determined according to the loss of the verification set. The optimal waveform analysis model significantly improves the efficiency, accuracy and generalization ability of the waveform analysis model in identifying power quality disturbance elements; finally, the test set is input into the optimal waveform analysis model for testing to obtain test results, and the test results are post-processed to obtain analysis results corresponding to the test set, which effectively improves the accuracy of the optimal waveform analysis model in analyzing the test set to obtain the types and characteristic parameters of elements causing power quality disturbances; finally, the average accuracy mean is calculated again in combination with the analysis results of the optimal waveform analysis model analysis test set to verify and evaluate the detection and classification performance of the optimal waveform analysis model, so as to ensure that the optimal waveform analysis model is suitable for the actual working environment.

[0048] The above specific embodiments are preferred embodiments of the present invention, and are not intended to limit the specific implementation scope of the present invention. The scope of the present invention includes but is not limited to the present specific embodiments. All equivalent changes made in accordance with the shape, structure, and method of the present invention are within the protection scope of the present invention.

Claims

1. A power quality composite disturbance analysis method based on waveform characteristics, characterized in that: The following steps are involved: S1. Establish a composite disturbance model based on power quality disturbance elements, generate a power quality disturbance waveform atlas according to the simulation time sequence of the composite disturbance model, and extract the elements of the power quality disturbance waveform atlas in time sequence to obtain a training set, a verification set and a test set; S2. Establishing a decoding function based on the power quality disturbance element, and constructing a waveform analysis model according to the decoding function; S3, training the waveform analysis model based on the training set; S4. Calculate the validation set loss according to the trained waveform analysis model and the loss formula, and determine the optimal waveform analysis model according to the trend of the validation set loss; S5. Input the test set into the optimal waveform analysis model to obtain a test result, and post-process the test result to obtain an analysis result corresponding to the test set.

2. The power quality composite disturbance analysis method based on waveform characteristics according to claim 1 is characterized in that: In S1, the composite disturbance model established based on the power quality disturbance element is specifically as follows: p(t)=[sag(t),swl(t),itr(t)]×[flk(t)]×{sin(t)+[hmy(t)]+[sks(t)]+[nth(t)]+[noise(t)]}+[osc(t),imp + (t),imp - (t)] Where sin(t) is the standard sinusoidal signal, sag(t) is the voltage sag factor, swl(t) is the voltage swell factor, itr(t) is the voltage interruption factor, and imp + (t) is the transient positive pulse factor, imp - (t) is the transient negative pulse factor, osc(t) is the transient oscillation factor, sks(t) is the peak factor, nth(t) is the notch factor, flk(t) is the voltage flicker factor, hmy(t) is the harmonic factor, noise(t) is the noise signal, and p(t) is the power quality disturbance waveform.

3. The power quality composite disturbance analysis method based on waveform characteristics according to claim 1 is characterized in that: In S2, a decoding function is established based on the power quality disturbance element, and the specific process of constructing a waveform analysis model according to the decoding function is as follows: S21, establishing a decoding function based on the detection head of the YOLOv3 network head and the power quality disturbance element corresponding to the detection head; S22. Apply the decoding function to the detection head to improve the YOLOv3 network and obtain a waveform analysis model.

4. The power quality composite disturbance analysis method based on waveform characteristics according to claim 3 is characterized in that: The decoding function established in S21 includes: a detection activation function σ(.), a classification function Softmax, a time positioning function and a feature parameter identification function; The time positioning function is as follows: In the formula, is the midpoint of the time window, include j is an integer that follows the feature vector, σ(.) is the detection activation function, is the feature map T (i) The first value of the j-th feature map vector, is the time window width, include is the number of sampling points corresponding to the time scale of 5ms, is the number of sampling points corresponding to the time scale of 75ms, exp(.) is the exponential function, is the feature map T (i) The second value of the j-th feature map vector; The characteristic parameter identification function is as follows: g(x)=scale×σ(x)-0.5×(scale-1); Where g(x) is the identified feature parameter, scale is the scale parameter, and σ(x) is the detection activation function.

5. The power quality composite disturbance analysis method based on waveform characteristics according to claim 1 is characterized in that: In S3, the specific process of training the waveform analysis model based on the training set is: S31, randomly extracting waveforms from a training set based on a preset waveform number threshold and inputting them into the waveform analysis model for detection to obtain a feature graph; S32, calculating the waveform loss according to the characteristic graph and the loss formula, and simultaneously back-propagating the waveform loss using the back-propagation method to update the parameter combination of the waveform analysis model; S33. Repeat S31-S32 until the training stop condition is met.

6. The power quality composite disturbance analysis method based on waveform characteristics according to claim 5 is characterized in that: The S3 also includes collating and recording the waveform loss calculated during the training process to obtain the training set loss and the waveform analysis model parameter combination corresponding to the waveform loss.

7. The power quality composite disturbance analysis method based on waveform characteristics according to claim 6 is characterized in that: In S4, the specific process of determining the optimal waveform analysis model according to the trend of the validation set loss is: S41, calculating the average accuracy mean of the verification set and the average accuracy mean of the training set according to the average accuracy mean formula; S42, drawing a validation set curve based on the validation set loss and the mean of the validation set average accuracy, and drawing a training set curve based on the training set loss and the mean of the training set average accuracy; S43, comparing and analyzing the validation set curve and the training set curve to determine the minimum waveform loss, and determining the waveform analysis model parameter combination corresponding to the minimum waveform loss as the optimal parameter combination; S44. Adjust the waveform analysis model according to the optimal parameter combination to obtain an optimal waveform analysis model.

8. The method for analyzing power quality composite disturbances based on waveform characteristics according to claim 7 is characterized in that: In S4, the loss formula is specifically as follows: Where, L M is the total loss of the waveform analysis model corresponding to the validation set, L1 is the loss of the shallow detection head of the waveform analysis model corresponding to the validation set, L2 is the loss of the middle detection head of the waveform analysis model corresponding to the validation set, and L3 is the loss of the deep detection head of the waveform analysis model corresponding to the validation set. Including shallow detection head confidence loss And the confidence loss of the middle-level detection head Including shallow detection head classification loss and the classification loss of the middle-level detection head Including shallow detection head positioning loss and mid-level detection head positioning loss Including shallow detection head feature parameter regression loss and the mid-level detection head feature parameter regression loss is the confidence loss of the deep detection head, is the feature parameter regression loss of the deep detection head.

9. The power quality composite disturbance analysis method based on waveform characteristics according to claim 1 is characterized in that: In S5, the specific process of post-processing the test result to obtain the analysis result corresponding to the test set is: S51, calculating the start and end sampling points of the disturbance according to the midpoint of the candidate time window and the width of the candidate time window in the test result, and clipping the candidate time window according to the start and end sampling points to determine the time window; S52, filtering out the time windows according to the confidence in the test result, the conditional category probability and the preset category confidence threshold to obtain a time window set; S53, inputting different time window subsets in the time window set into the NMS filtering formula for comparison and filtering to determine the final time window, and determining the analysis result according to the category and characteristic parameters corresponding to the final time window; The time window is obtained by intercepting the time series of the test set according to a preset sampling period by the optimal waveform analysis model.

10. The method for analyzing power quality composite disturbance based on waveform characteristics according to claim 9, characterized in that: The NMS filtering formula is as follows: In the formula, the IoU value is 0, A is a subset of time windows involved in comparison and filtering, and B is another subset of time windows involved in comparison and filtering.

Citation Information

Patent Citations

  • Electric energy quality disturbance characteristic identification method

    CN117312952A