Power quality disturbance data classification method and device, computer equipment, storage medium and computer program product
Through the relative displacement matrix processing and convolutional neural network training power quality disturbance data classification model, the problem of inaccurate classification of power quality disturbance data in the existing technology is solved, and the safe and stable operation of the power system and the support for low-carbon energy transformation is improved. ability.
Patent Information
- Application Number
- CN202410565951.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-11-08
AI Technical Summary
In the prior art, the feature extraction and classification methods of power quality disturbance data cannot be accurately classified, which affects the safe and stable operation of the power system and the transformation of low-carbon energy.
The relative displacement matrix method is used to convert the historical data of power mass perturbation into matrix data, and the classification model is trained using convolutional neural network to generate a classification model for power mass perturbation data to improve classification accuracy.
Through the combination of relative displacement matrix processing and convolutional neural network, the classification accuracy of power quality perturbation data is significantly improved, supporting the safe and stable operation of power systems and the transformation of low-carbon energy.
Smart Images

Figure CN118916775A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart grid technology, and in particular to a method, device, computer equipment, storage medium and computer program product for classifying power quality disturbance data. Background Art
[0002] Power quality problems refer to voltage and current waveform distortion, instability and other abnormal phenomena in the power system. These problems have an adverse effect on the normal operation of the power system and the performance of power equipment. How to quickly and accurately identify and classify power quality disturbances has become a necessary prerequisite for ensuring the safe and stable operation of the power system and promoting the transition to low-carbon energy. The classification of power quality disturbance data generally adopts two independent steps: feature extraction of disturbance signals and classification of disturbance signals.
[0003] In related technologies, feature extraction of disturbance signals generally adopts short-time Fourier transform, wavelet transform, S transform, Hilbert-Huang transform, etc. Classification of disturbance signals generally adopts machine learning algorithms and deep learning algorithms, such as K nearest neighbor, decision tree, support vector machine, neural network, etc., which can establish a mapping relationship between feature vectors and corresponding classification labels.
[0004] However, the feature extraction of disturbance signals and the classification methods of disturbance signals in the related art cannot achieve accurate classification of disturbance signals. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for classifying power quality disturbance data with high classification accuracy in order to solve the above technical problems.
[0006] In a first aspect, the present application provides a method for generating a power quality disturbance data classification model, comprising:
[0007] Acquire power quality disturbance historical data and corresponding first classification label data;
[0008] Aggregating the power quality disturbance historical data according to the first classification label data to obtain a grouping of the power quality disturbance historical data;
[0009] Converting the power quality disturbance historical data group into a first time series amplitude array according to the first acquisition time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group;
[0010] The first time series amplitude array is processed using a relative displacement matrix method to obtain first matrix data;
[0011] A convolutional neural network is trained according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model, and the power quality disturbance data classification model is used for classifying the power quality disturbance data.
[0012] In one embodiment, the first time series amplitude array is processed using a relative displacement matrix method to obtain first matrix data, including: obtaining a first number of first time series amplitude data included in the first time series amplitude array; generating a first blank matrix, the number of rows and the number of columns of the first blank matrix are both the first number; selecting any uncalculated first time series amplitude data as the first time series amplitude data to be calculated, and calculating the first difference between the first time series amplitude data to be calculated and each first time series amplitude data; determining the first target position according to the number of columns of the first time series amplitude data to be calculated and the number of columns of each first time series amplitude data; filling each first difference into the corresponding first target position of the first blank matrix to obtain the first matrix data; marking the first time series amplitude data to be calculated as calculated data; and continuing to execute the step of selecting any uncalculated first time series amplitude data as the first time series amplitude data to be calculated until all first time series amplitude data are calculated.
[0013] In a second aspect, the present application also provides a method for classifying power quality disturbance data, comprising:
[0014] Acquiring power quality disturbance data to be classified;
[0015] The power quality disturbance data to be classified is input into the power quality disturbance data classification model generation method based on the above-mentioned method embodiments to generate the power quality disturbance data classification model, and the power quality disturbance data classification result is obtained.
[0016] In one embodiment, before inputting the power quality disturbance data to be classified into the power quality disturbance data classification model, the method also includes: obtaining a second acquisition time and a second amplitude of the power quality disturbance data to be classified; generating a second time series amplitude array to be processed according to the second acquisition time and the second amplitude; normalizing the second time series amplitude array to be processed to obtain a second standard time series amplitude array; performing dimensionality reduction processing on the second standard time series amplitude array to obtain a second time series amplitude array; processing the second time series amplitude array using a relative displacement matrix processing method to obtain second matrix data.
[0017] In one embodiment, the second time series amplitude array is processed using a relative displacement matrix processing method to obtain second matrix data, including: obtaining a second number of second time series amplitude data included in the second time series amplitude array; generating a second blank matrix, the number of rows and the number of columns of the second blank matrix are both the second number; selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated, and calculating the second difference between the second time series amplitude data to be calculated and each second time series amplitude data; determining the second target position according to the number of columns of the second time series amplitude data to be calculated and the number of columns of each second time series amplitude data; filling the second difference into the corresponding second target position of the second blank matrix to obtain second matrix data; marking the second time series amplitude data to be calculated as calculated data; and continuing to execute the step of selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated until all second time series amplitude data are calculated.
[0018] In a third aspect, the present application also provides a device for generating a power quality disturbance data classification model, comprising:
[0019] A first data acquisition module, used to acquire power quality disturbance historical data and corresponding first classification label data;
[0020] an aggregation module, configured to aggregate the power quality disturbance historical data according to the first classification label data to obtain a group of the power quality disturbance historical data;
[0021] An array generation module, configured to convert the power quality disturbance historical data group into a first time series amplitude array according to the first acquisition time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group;
[0022] A matrix generation module, used for processing the first time series amplitude array by using a relative displacement matrix method, and converting the first time series amplitude array into first matrix data;
[0023] The model generation module is used to train a convolutional neural network according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model, and the power quality disturbance data classification model is used for classifying the power quality disturbance data.
[0024] In a fourth aspect, the present application further provides a power quality disturbance data classification device, comprising:
[0025] A second data acquisition module, used to acquire power quality disturbance data to be classified;
[0026] The classification module is used to input the power quality disturbance data to be classified into the power quality disturbance data classification model obtained by the power quality disturbance data classification model generation device in the above-mentioned device embodiments to obtain the power quality disturbance data classification result.
[0027] In a fifth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the steps in the above-mentioned method embodiments.
[0028] In a sixth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and the steps in the above-mentioned method embodiments are executed by a processor.
[0029] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, which performs the steps in the above-mentioned method embodiments when executed by a processor.
[0030] The above-mentioned power quality disturbance data classification model generation method, power quality disturbance data classification method, device, computer equipment, storage medium and computer program product generate a power quality disturbance data classification model based on power quality disturbance historical data marked with first classification label data. In the process of generating the power quality disturbance data classification model, the power quality disturbance historical data is processed to obtain image matrix data. The power quality disturbance data classification model is generated by using image matrix data and convolutional neural network, which can improve the accuracy of power quality disturbance data classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A diagram of an application environment of a method for generating a power quality disturbance data classification model and a method for classifying power quality disturbance data in one embodiment;
[0033] Figure 2 A schematic diagram of a flow chart of a method for generating a power quality disturbance data classification model in one embodiment;
[0034] Figure 3 A schematic diagram of a convolutional neural network architecture in one embodiment;
[0035] Figure 4A schematic diagram of a training result of a power quality disturbance data classification model in one embodiment;
[0036] Figure 5 A schematic diagram of a flow chart of a method for classifying power quality disturbance data in one embodiment;
[0037] Figure 6 It is a structural block diagram of a device for generating a power quality disturbance data classification model in one embodiment;
[0038] Figure 7 is a structural block diagram of a power quality disturbance data classification device in one embodiment;
[0039] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] The power quality disturbance data classification model generation method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 initiates a request to generate a power quality disturbance data classification model. After receiving the request to generate a power quality disturbance data classification model, the server 104 obtains the power quality disturbance historical data and the corresponding first classification label data; the power quality disturbance historical data is aggregated according to the first classification label data to obtain a power quality disturbance historical data group; according to the first acquisition time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group, the power quality disturbance historical data group is converted into a first time series amplitude array; the first time series amplitude array is processed using the relative displacement matrix method to obtain the first matrix data; the convolutional neural network is trained according to the first classification label data and the first matrix data to obtain the power quality disturbance data classification model, and the power quality disturbance data classification model is used for the classification of power quality disturbance data. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0042] In an exemplary embodiment, Figure 2 As shown, a method for generating a power quality disturbance data classification model is provided, and the method is applied to Figure 1 The server in the example is used to illustrate, including the following steps 202 to 210. Among them:
[0043] Step 202: Acquire power quality disturbance historical data and corresponding first classification label data.
[0044] The first classification label data is used to characterize the classification of the power quality disturbance history data. Optionally, the first classification label data may include but is not limited to voltage and current waveform distortion, instability and other abnormal phenomena.
[0045] In one embodiment, a user operation terminal initiates a request for generating a power quality disturbance data classification model and sends the request to a server. After receiving the request, the server executes the steps for generating the power quality disturbance data classification model, such as obtaining power quality disturbance history data and corresponding first classification label data, so as to generate a power quality disturbance data classification model based on the power quality disturbance history data and the corresponding first classification label data.
[0046] In one of the embodiments, the power quality disturbance historical data can be collected through a sensing device, and the collected power quality disturbance historical data can be classified, and corresponding first classification label data can be added, sample data can be generated based on the power quality disturbance historical data with the first classification label data added, and the sample data can be used to generate a power quality disturbance data classification model.
[0047] Optionally, after the sensing device collects the power quality disturbance history data, it transmits the collected power quality disturbance history data to the server, and the server adds first classification label data to the power quality disturbance history data, and stores the power quality disturbance history data with the first classification label data added. In one embodiment, after the sensing device collects the power quality disturbance history data, it can transmit the collected power quality disturbance history data to the terminal, and the user uses the terminal to add first classification label data to the power quality disturbance history data, and transmits the power quality disturbance history data with the first classification label data added to the server for storage.
[0048] Step 204 , aggregating the power quality disturbance historical data according to the first classification label data to obtain power quality disturbance historical data groups.
[0049] In one embodiment, a preset clustering method is used to aggregate the power quality disturbance historical data to achieve classification of the power quality disturbance historical data, and obtain power quality disturbance historical data groups, each of which has corresponding first classification label data. Optionally, the server generates a power quality disturbance data classification model based on the classified power quality disturbance historical data groups. Optionally, the clustering method is not limited, as long as clustering can be achieved.
[0050] Step 206: convert the power quality disturbance history data group into a first time series amplitude array according to the first acquisition time and the first amplitude of each power quality disturbance history data included in the power quality disturbance history data group.
[0051] In one embodiment, the first time series amplitude array to be processed can be generated according to the first acquisition time and the first amplitude. 1 , t 2 ,……,t n ], where t n is the signal amplitude at time n.
[0052] In one embodiment, the first time series amplitude array to be processed may be normalized to obtain a first standard time series amplitude array. Optionally, the first time series amplitude array to be processed may be normalized using a Z-Score to obtain a first standard time series amplitude array, for example, Z=[z 1 , z 2 , ..., z i ],in, i=1, 2,…, n, μ is the mean value of T, σ is the standard deviation of T.
[0053] In one embodiment, the first standard time series amplitude array can be further reduced in dimension to obtain the first time series amplitude array. Optionally, the first standard time series amplitude array can be reduced in dimension using the piecewise aggregation approximation (PAA) method, and a new smoothed time series can be generated by selecting an appropriate reduction factor, reducing the array from n dimensions to m dimensions, X = [x 1 , x 2 , ..., x m ], where x m Calculated by the following formula:
[0054]
[0055] Among them, k is the compression ratio, and m is the length of the compressed sequence X.
[0056] Step 208, using the relative displacement matrix method to process the first time series amplitude array to obtain first matrix data.
[0057] In one embodiment, the first quantity of the first time series amplitude data included in the first time series amplitude array can be obtained. For example, the first time series amplitude data is X=[x 1 , x 2 , ..., x m ], then the first quantity is m.
[0058] Further, a first blank matrix is generated, wherein the number of rows and the number of columns of the first blank matrix are both first numbers. For example, if the first number of the first time series amplitude data is m, then an m×m first blank matrix is generated.
[0059] Optionally, any uncalculated first time series amplitude data may be selected as the first time series amplitude data to be calculated, and the first difference between the first time series amplitude data to be calculated and each first time series amplitude data may be calculated. 1 , then calculate x 1 , ..., x m The first difference between 1 -x 1 , ..., x 1 -xm .
[0060] In one embodiment, the first target position can be determined according to the number of columns of the first time series amplitude data to be calculated and the number of columns of each first time series amplitude data; each first difference is filled into the corresponding first target position of the first blank matrix to obtain the first matrix data. Optionally, the number of columns of the first time series amplitude data to be calculated can be used as the number of columns of the position of the first difference in the first blank matrix, and the number of columns of the first time series amplitude data can be used as the number of rows of the position of the first difference in the first blank matrix. The first target position is determined according to the determined number of columns and rows. For example, the first difference is x 1 -x 1 , the first target position is the first row and first column of the first blank matrix, and the first difference value can be filled into the first target position corresponding to the first blank matrix, for example
[0061] Optionally, after calculating the first difference between the first time series amplitude data to be calculated and each first time series amplitude data included in the first time series amplitude array, and filling the first difference into the first target position corresponding to the first blank matrix, the first time series amplitude data to be calculated can be marked as calculated data, and the step of selecting any uncalculated first time series amplitude data as the first time series amplitude data to be calculated can be continued until all the first time series amplitude data are calculated, and all the first time series amplitude data are calculated and the calculated difference data are filled into the first blank matrix, so as to obtain the first matrix data, for example:
[0062] In one embodiment, further minimum-maximum normalization processing can be performed on the acquired first matrix data to convert the first matrix data into a gray value matrix, so as to convert the one-dimensional data into two-dimensional image data, so that the power quality disturbance data classification model obtained by training with the gray value matrix can realize the recognition of image data and improve the accuracy of the power quality disturbance data classification results. Optionally, the calculation formula of the final gray value matrix F is as follows:
[0063]
[0064] Among them, min(M) is used to represent the minimum value of the first matrix data, and max(M) is used to represent the maximum value of the first matrix data.
[0065] Step 210: training a convolutional neural network according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model.
[0066] Among them, the power quality disturbance data classification model is used for the classification of power quality disturbance data.
[0067] In one embodiment, a convolutional neural network is used as a basic network, and the convolutional neural network is trained based on sample data to form a power quality disturbance data classification model. The schematic diagram of the convolutional neural network architecture can be found in Figure 3 .
[0068] Optionally, a convolutional neural network can be used to construct a preliminary power quality disturbance data classification model. In one embodiment, a preliminary power quality disturbance data classification model with multiple convolutional layers can be formed, for example, a preliminary power quality disturbance data classification model with five convolutional layers can be formed, and the first matrix data is input into the preliminary power quality disturbance data classification model for training to obtain a power quality disturbance data classification model, so that the multiple convolutional layers included in the formed power quality disturbance data classification model can automatically identify the power quality disturbance data to be classified, so as to achieve power quality disturbance data classification.
[0069] Optionally, the convolutional layer operation formula can be:
[0070]
[0071] Among them, l represents the number of layers, is the rth neuron in layer l, is the weight between the pth and rth neurons in the lth layer, is the bias of the neurons in the lower r convolutional layers of the lth layer, N r is the set of feature maps in the previous layer that are connected to the rth feature map in the current layer.
[0072] In one embodiment, a maximum pooling layer may be set after a convolution layer. Optionally, a maximum pooling layer may be set after multiple convolution layers. For example, a maximum pooling layer may be set after the first, second, and fifth convolution layers. The maximum pooling layer is used to scale the data obtained after the convolution layer extracts features, reduce the dimension of the data, extract important information, and reduce noise interference. Optionally, the operation formula of the maximum pooling layer may be:
[0073]
[0074] Among them, xx is the output of the maximum pooling layer.
[0075] In one embodiment, an activation operation may be performed after the convolution layer. Optionally, a maximum pooling layer may be added after the activation operation. Optionally, a ReLU activation function may be used to perform a nonlinear transformation on the output of each convolution block, and the calculation formula of the nonlinear transformation is:
[0076]
[0077] In one embodiment, a probability layer may be connected after the fully connected layer, and the probability layer uses a function to implement classification of the power quality disturbance data. Optionally, the function may be a Softmax function.
[0078] In one embodiment, the probability layer calculates the probability of each output of the fully connected layer as follows:
[0079]
[0080] Among them, x i represents the i-th output of the fully connected layer; y i represents the probability of the i-th output of the probability layer, and n is the number of output nodes.
[0081] Optionally, the generated first matrix data and the corresponding first classification label data are used to train a preliminary power quality disturbance data classification model to obtain a power quality disturbance data classification model. Optionally, during the training process, an optimizer may be used to optimize the training to improve the accuracy of the power quality disturbance data classification model. In one embodiment, the optimizer may include but is not limited to an SGD optimizer, an SGDM optimizer, a NAG optimizer, an AdaGrad optimizer, an AdaDelta optimizer, an Adam optimizer, and a Nadam optimizer.
[0082] In one embodiment, a dynamic learning rate may be added during the training process to improve the efficiency of model training. In one embodiment, an early stopping strategy may be combined during the training process to improve the efficiency of model training.
[0083] In one embodiment, when power quality disturbance data classification is required, the power quality disturbance data to be classified is input into a power quality disturbance data classification model, and the power quality disturbance data classification result output by the power quality disturbance data classification model is received.
[0084] Optionally, the power quality disturbance data classification model outputs a power quality disturbance data classification result and a probability corresponding to the power quality disturbance data classification result.
[0085] In one embodiment, the sample data can be divided into positive samples and negative samples, the positive samples are used to train the preliminary power quality disturbance data classification model to form the power quality disturbance data classification model, and the negative samples are used to test the formed power quality disturbance data classification model to adjust the power quality disturbance data classification model according to the test results. Optionally, 80% of the sample data can be selected as positive samples and 20% of the sample data can be selected as negative samples.
[0086] In one embodiment, the output power quality disturbance data classification result may be output in a table form to more clearly determine whether the power quality disturbance data classification result is accurate, as shown in Table 1 below.
[0087] Table 1 Power quality disturbance data classification test results
[0088] type 0dB 50dB 40dB 30dB type 0dB 50dB 40dB 30dB Temporary rise 1.000 1.000 0.9975 0.9848 Temporary drop + gap 0.9598 0.9563 0.9850 0.9188 Temporary drop 1.000 1.000 1.0000 0.9898 Dip + Oscillation 0.9747 0.9945 0.9621 0.9196 Interrupt 0.9849 0.9781 0.9975 0.9444 Dip + Pulse 1.0000 1.0000 0.9637 0.9899 fluctuation 1.0000 1.0000 0.9975 0.9949 Interruptions + Fluctuations 0.9949 0.9941 1.0000 1.0000 harmonic 1.0000 1.0000 1.0000 0.9949 Interruption + Harmonics 0.9899 0.9672 1.000 1.0000 gap 1.0000 1.0000 0.9949 0.9898 Breaks + Gaps 0.9694 0.9943 0.9698 0.9296 oscillation 0.9949 1.0000 0.9926 1.0000 Interrupt + Pulse 1.0000 1.0000 0.9719 0.9388 pulse 1.0000 0.9943 1.0000 0.9949 Fluctuation + Harmonics 1.0000 1.0000 1.0000 1.0000 Temporary rise + fluctuation 1.0000 0.9944 1.0000 0.9948 Volatility + Gaps 0.9495 0.9833 1.0000 0.9444 Temporary rise + harmonics 0.9949 0.9828 0.9975 1.0000 Fluctuation + Oscillation 1.0000 1.0000 0.9715 0.9747 Temporary rise + gap 0.9850 0.9891 0.9926 0.9646 Wave + Pulse 0.9899 0.9435 1.0000 1.0000 Temporary rise + oscillation 1.0000 1.0000 0.9481 0.98000 Harmonics + Oscillations 1.0000 1.0000 0.9356 0.9343 Temporary rise + pulse 1.0000 1.0000 0.9950 1.0000 Harmonics + Pulse 1.0000 1.0000 1.0000 1.0000 Temporary drop + fluctuation 0.9949 1.0000 0.9975 0.9949 Gap + Oscillation 0.9950 0.9944 0.9689 0.8894 Temporary sag + harmonics 0.9949 0.9839 1.0000 1.0000 Notch + Pulse 1.0000 1.0000 1.0000 0.9100 average value 0.9924 0.9917 0.9880 0.9726
[0089] In one embodiment, a threshold value can be set, and when the test result is less than the set threshold value, the power quality disturbance data classification model is adjusted. For example, the threshold value is set to 0.95, then when the output test result is less than 0.95, the training process is adjusted, such as dynamically adjusting the learning rate of the training process, reducing the learning rate until the test result output by the trained power quality disturbance data classification model meets the requirements. Optionally, the learning rate can be dynamically adjusted based on the training results. For example, the training sample set and the test sample set can be input into the power quality disturbance data classification model to obtain the training results corresponding to the training sample set and the test results corresponding to the test sample set, and a training result schematic diagram (such as Figure 4 As shown in the figure), the dynamic learning rate is adjusted according to the training result diagram.
[0090] In the above-mentioned power quality disturbance data classification model generation method, the power quality disturbance data classification model is generated based on the power quality disturbance historical data marked with the first classification label data. In the process of generating the power quality disturbance data classification model, the power quality disturbance historical data is processed to obtain image matrix data. The power quality disturbance data classification model is generated by using the image matrix data and a convolutional neural network, which can improve the accuracy of power quality disturbance data classification.
[0091] In an exemplary embodiment, Figure 5 As shown, a method for classifying power quality disturbance data is provided, and the method is applied to Figure 1 The server in the example is used to illustrate, including the following steps 502 to 504. Among them:
[0092] Step 502: Obtain power quality disturbance data to be classified.
[0093] In one embodiment, the power quality disturbance data to be classified may be collected by a sensor device and then sent to a server.
[0094] Optionally, the power quality disturbance data to be classified may be collected by a sensor device and then sent to a terminal, and then sent by the terminal to a server.
[0095] In one embodiment, a request for power quality disturbance data classification may be initiated by a terminal, and after receiving the power quality disturbance data classification request, the server performs classification processing of the power quality disturbance data. Optionally, the terminal encapsulates the power quality disturbance data to be classified in the power quality disturbance data classification request, and after receiving the power quality disturbance data classification request, the server obtains the power quality disturbance data to be classified from the power quality disturbance data classification request, and processes the obtained power quality disturbance data to be classified to obtain a classification result corresponding to the power quality disturbance data to be classified.
[0096] In one of the embodiments, after the power quality disturbance data to be classified is obtained, the power quality disturbance data to be classified may be preprocessed to improve the accuracy of the classification of the power quality disturbance data.
[0097] In one embodiment, the preprocessing process may include: obtaining the second acquisition time and the second amplitude of the power quality disturbance data to be classified; generating a second time series amplitude array to be processed according to the second acquisition time and the second amplitude; normalizing the second time series amplitude array to be processed to obtain a second standard time series amplitude array; performing dimensionality reduction processing on the second standard time series amplitude array to obtain a second time series amplitude array; processing the second time series amplitude array using a relative displacement matrix processing method to obtain second matrix data. The specific implementation process is shown in step 208, which will not be repeated here.
[0098] Optionally, the second time series amplitude array is processed by the relative displacement matrix processing method to obtain the second matrix data, which may include: obtaining the second number of second time series amplitude data included in the second time series amplitude array; generating a second blank matrix, the number of rows and the number of columns of the second blank matrix are both the second number; selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated, and calculating the second difference between the second time series amplitude data to be calculated and each second time series amplitude data; determining the second target position according to the number of columns of the second time series amplitude data to be calculated and the number of columns of each second time series amplitude data; filling the second difference into the corresponding second target position of the second blank matrix to obtain the second matrix data; marking the second time series amplitude data to be calculated as calculated data; continuing to perform the step of selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated until all second time series amplitude data are calculated. For the specific implementation process, see step 208, which will not be repeated here.
[0099] Step 504: input the power quality disturbance data to be classified into a power quality disturbance data classification model to obtain a power quality disturbance data classification result.
[0100] Optionally, the power quality disturbance data to be classified may be preprocessed first, and after obtaining the preprocessing result, the preprocessing result may be input into a power quality disturbance data classification model to obtain the classification result output by the power quality disturbance data classification model.
[0101] In one embodiment, the power quality disturbance data classification result may be output in a table form. Optionally, the power quality disturbance data classification result may be transmitted to a terminal, and the terminal displays the power quality disturbance data classification result after receiving the power quality disturbance data classification result.
[0102] In this embodiment, the efficiency of power quality disturbance data classification is improved by inputting the power quality disturbance data to be classified into a pre-generated power quality disturbance data classification model. Furthermore, before inputting the power quality disturbance data to be classified into the power quality disturbance data classification model, the power quality disturbance data to be classified is processed to obtain image matrix data, and the image matrix data is input into the power quality disturbance data classification model, which can improve the accuracy of the power quality disturbance data classification result.
[0103] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0104] Based on the same inventive concept, the embodiment of the present application also provides a power quality disturbance data classification model generation device for implementing the power quality disturbance data classification model generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more power quality disturbance data classification model generation device embodiments provided below can refer to the limitations of the power quality disturbance data classification model generation method in the above text, and will not be repeated here.
[0105] In an exemplary embodiment, Figure 6 As shown, a power quality disturbance data classification model generation device 600 is provided, comprising: a first data acquisition module 602, an aggregation module 604, an array generation module 606, a matrix generation module 608 and a model generation module 610, wherein:
[0106] The first data acquisition module 602 is used to acquire power quality disturbance historical data and corresponding first classification label data.
[0107] The aggregation module 604 is used to aggregate the power quality disturbance historical data according to the first classification label data to obtain power quality disturbance historical data groups.
[0108] The array generation module 606 is used to convert the power quality disturbance historical data group into a first time series amplitude array according to the first collection time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group.
[0109] The matrix generation module 608 is used to process the first time series amplitude array using a relative displacement matrix method to convert the first time series amplitude array into first matrix data.
[0110] The model generation module 610 is used to train a convolutional neural network according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model, and the power quality disturbance data classification model is used for classifying power quality disturbance data.
[0111] In one embodiment, the matrix generation module 608 is also used to obtain the first number of first time series amplitude data included in the first time series amplitude array; generate a first blank matrix, the number of rows and the number of columns of the first blank matrix are both the first number; select any uncalculated first time series amplitude data as the first time series amplitude data to be calculated, and calculate the first difference between the first time series amplitude data to be calculated and each first time series amplitude data; determine the first target position according to the number of columns of the first time series amplitude data to be calculated and the number of columns of each first time series amplitude data; fill each first difference into the corresponding first target position of the first blank matrix to obtain the first matrix data; mark the first time series amplitude data to be calculated as calculated data; continue to execute the step of selecting any uncalculated first time series amplitude data as the first time series amplitude data to be calculated until all first time series amplitude data are calculated.
[0112] In one embodiment, Figure 7 As shown, a power quality disturbance data classification device 700 is provided, comprising: a second data acquisition module 702 and an aggregation module 704, wherein:
[0113] The second data acquisition module 702 is used to acquire power quality disturbance data to be classified.
[0114] The classification module 704 is used to input the power quality disturbance data to be classified into the power quality disturbance data classification model to obtain the power quality disturbance data classification result.
[0115] In one embodiment, the power quality disturbance data classification device 700 also includes a data processing module, which is used to obtain the second acquisition time and second amplitude of the power quality disturbance data to be classified; generate a second time series amplitude array to be processed according to the second acquisition time and the second amplitude; normalize the second time series amplitude array to be processed to obtain a second standard time series amplitude array; perform dimensionality reduction processing on the second standard time series amplitude array to obtain a second time series amplitude array; and process the second time series amplitude array using a relative displacement matrix processing method to obtain second matrix data.
[0116] In one embodiment, the data processing module is also used to obtain the second number of second time series amplitude data included in the second time series amplitude array; generate a second blank matrix, the number of rows and the number of columns of the second blank matrix are both the second number; select any uncalculated second time series amplitude data as the second time series amplitude data to be calculated, and calculate the second difference between the second time series amplitude data to be calculated and each second time series amplitude data; determine the second target position according to the number of columns of the second time series amplitude data to be calculated and the number of columns of each second time series amplitude data; fill the second difference into the corresponding second target position of the second blank matrix to obtain second matrix data; mark the second time series amplitude data to be calculated as calculated data; continue to execute the step of selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated until all second time series amplitude data are calculated.
[0117] Each module in the above-mentioned power quality disturbance data classification model generation device and power quality disturbance data classification device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0118] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a power quality disturbance data classification model or a method for classifying power quality disturbance data is implemented.
[0119] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0121] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are performed.
[0122] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are performed.
[0123] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0124] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0126] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating a power quality disturbance data classification model, characterized in that: The method comprises: Acquire power quality disturbance historical data and corresponding first classification label data; Aggregating the power quality disturbance historical data according to the first classification label data to obtain a power quality disturbance historical data group; Converting the power quality disturbance historical data group into a first time series amplitude array according to the first acquisition time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group; Processing the first time series amplitude array using a relative displacement matrix method to obtain first matrix data; A convolutional neural network is trained according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model, and the power quality disturbance data classification model is used for classifying power quality disturbance data.
2. The method according to claim 1, characterized in that The method of using the relative displacement matrix method to process the first time series amplitude array to obtain first matrix data includes: Obtaining a first quantity of first time series amplitude data included in the first time series amplitude array; Generate a first blank matrix, wherein the number of rows and the number of columns of the first blank matrix are both the first number; Select any uncalculated first time series amplitude data as first time series amplitude data to be calculated, and calculate a first difference between the first time series amplitude data to be calculated and each of the first time series amplitude data; Determine a first target position according to the number of columns of the first time series amplitude data to be calculated and the number of columns of each of the first time series amplitude data; Filling each of the first difference values into the corresponding first target position of the first blank matrix to obtain the first matrix data; Marking the first time series amplitude data to be calculated as calculated data; Continue to execute the step of selecting any uncalculated first time series amplitude data as the first time series amplitude data to be calculated until all the first time series amplitude data are calculated.
3. A method for classifying power quality disturbance data, characterized in that: The method comprises: Acquiring power quality disturbance data to be classified; The power quality disturbance data to be classified is input into a power quality disturbance data classification model generated based on the power quality disturbance data classification model generation method according to claim 1 or 2 to obtain a power quality disturbance data classification result.
4. The method according to claim 3, characterized in that Before inputting the power quality disturbance data to be classified into the power quality disturbance data classification model according to claim 1 or 2, the method further includes: Acquire a second acquisition time and a second amplitude of the power quality disturbance data to be classified; Generate a second time series amplitude array to be processed according to the second acquisition time and the second amplitude; Normalizing the second to-be-processed time series amplitude array to obtain a second standard time series amplitude array; Performing dimensionality reduction processing on the second standard time series amplitude array to obtain a second time series amplitude array; The second time series amplitude array is processed using a relative displacement matrix processing method to obtain second matrix data.
5. The method according to claim 4, characterized in that The method of processing the second time series amplitude array by using the relative displacement matrix processing method to obtain second matrix data includes: Obtain a second quantity of second time series amplitude data included in the second time series amplitude array; Generate a second blank matrix, wherein the number of rows and the number of columns of the second blank matrix are both the second number; Select any uncalculated second time series amplitude data as second time series amplitude data to be calculated, and calculate a second difference between the second time series amplitude data to be calculated and each of the second time series amplitude data; Determine a second target position according to the number of columns of the second time series amplitude data to be calculated and the number of columns of each of the second time series amplitude data; Filling the second difference value into the corresponding second target position of the second blank matrix to obtain the second matrix data; Marking the second time series amplitude data to be calculated as calculated data; Continue to execute the step of selecting any uncalculated second time series amplitude data as the second time series amplitude data to be calculated until all the second time series amplitude data are calculated.
6. A device for generating a power quality disturbance data classification model, characterized in that: The device comprises: A first data acquisition module, used to acquire power quality disturbance historical data and corresponding first classification label data; an aggregation module, configured to aggregate the power quality disturbance historical data according to the first classification label data to obtain a power quality disturbance historical data group; An array generation module, configured to convert the power quality disturbance historical data group into a first time series amplitude array according to the first acquisition time and the first amplitude of each power quality disturbance historical data included in the power quality disturbance historical data group; A matrix generation module, used for processing the first time series amplitude array by using a relative displacement matrix method, and converting the first time series amplitude array into first matrix data; A model generation module is used to train a convolutional neural network according to the first classification label data and the first matrix data to obtain a power quality disturbance data classification model, and the power quality disturbance data classification model is used for classifying power quality disturbance data.
7. A power quality disturbance data classification device, characterized in that: The device comprises: A second data acquisition module, used to acquire power quality disturbance data to be classified; A classification module is used to input the power quality disturbance data to be classified into the power quality disturbance data classification model obtained based on the power quality disturbance data classification model generation device according to claim 6 to obtain the power quality disturbance data classification result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Cited By
Voltage sag estimation method and device of power system, computer equipment, readable storage medium and program product
CN120710010A
Voltage sag estimation method and device for power system, computer device, readable storage medium and program product
CN120710010B
