Current transformer secondary side data processing method, device, equipment and medium
Through multi-scale convolutional neural network and bidirectional long and short-term memory neural network model, combined with the isolated forest anomaly detection algorithm, the measurement error caused by clock out-of-synchronization and current fluctuation in online calibration of the current transformer is solved, and more accurate calculation of the average current and phase angle is achieved, improving the calibration accuracy and response capability of the current transformer.
Patent Information
- Application Number
- CN202510462599.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the online calibration method of the current transformer is difficult to accurately calculate the average current due to the clock synchronization of the metering and acquisition device and the current fluctuation, and is susceptible to noise interference, and cannot respond quickly to load fluctuations or burst failures.
A parallel-connected multi-scale convolutional neural network and a bidirectional long and short-term memory neural network model are adopted, combined with an isolated forest anomaly detection algorithm, and the prediction model is trained through historical power data to expand and decompose the power data, extract low-frequency and high-frequency components, and calculate the average current and phase angle.
It effectively solves the discretency and noise interference problems of the metering and acquisition device, improves the accuracy and response speed of current transformer calibration, reduces measurement errors, and provides reliable data support for online calibration.
Smart Images

Figure CN120372467A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of current transformer detection, and more specifically, to a method, device, equipment and medium for processing secondary side data of a current transformer. Background Art
[0002] Current transformers are key measurement and protection devices in the power system and are widely used in multiple fields such as current monitoring, power metering, and equipment protection. It can convert high current signals into low current signals for use by secondary equipment. However, due to factors such as magnetic saturation, frequency fluctuations, temperature changes, and current waveform distortion, current transformers have measurement errors during actual operation. These errors may cause deviations in the electrical energy values displayed by the watt-hour meter, and the accumulation of errors will also lead to inaccurate electricity charge metering.
[0003] Traditional current transformer calibration generally uses the off-line comparison method, which requires shutting down the equipment and using professional equipment for one-by-one calibration. This method is not only cumbersome to operate, but also has a long shutdown time, which is likely to affect the normal operation of the power system. Therefore, related technologies have also proposed an on-line calibration method for current transformers based on data-driven. However, due to limitations such as the acquisition time interval of the metering acquisition device, incomplete clock synchronization, and noise in the current data, there are large deviations in the predicted current transformer errors of the data-driven on-line calibration method for current transformers. How to preprocess the power data of the metering acquisition device has become the primary problem for on-line calibration of current transformers. Currently, current data preprocessing methods can be classified into the following categories:
[0004] (1) Analytical method: This is a method that precisely solves problems through mathematical derivation and formulas and is usually used in fields such as mathematics, physics, and engineering. In the analytical method, the problem is directly derived and calculated through known theories, equations, and models to obtain an accurate solution without relying on numerical approximation or simulation calculation. It is applicable to scenarios where the signal has regularity and a clear expression form, such as the prediction of power data of sine waves or other periodic signals. Through integral operations, the analytical method can directly obtain the average value from the mathematical expression of the signal.
[0005] (2) Numerical method: This is a method that solves mathematical problems through numerical approximation calculations, especially suitable for complex problems that cannot be solved by the analytical method or for which analytical solutions are difficult to obtain. Its core idea is to transform continuous problems into discrete problems and gradually approximate the solution through calculations with finite step sizes. It mainly includes the arithmetic mean method and the sliding window method based on sampled data, etc. The arithmetic mean method quickly obtains an approximate average current value by calculating the average value of current samples over a period of time and is applicable to scenarios with high real-time requirements. The sliding window method can reflect the short-term change characteristics of the signal by dynamically updating the average value of samples within the window and is a method widely used in dynamic signal processing;
[0006] (3) Multi-scale adaptive calibration method. This method analyzes through the frequency and time domains and performs data-driven learning and adjustment. Its main methods include Fourier transform, discrete wavelet transform, and machine learning algorithms. These methods can more effectively process non-periodic signals and complex environmental noises, improving calculation accuracy and robustness.
[0007] Based on the basic descriptions of the above related technologies, it can be seen that several current data preprocessing methods provided by the current related technologies mainly rely on mathematical analysis and numerical calculations for calculating the average current, and they have the following deficiencies:
[0008] (1) In an actual power system, the current waveform is often affected by various factors, making it difficult to effectively handle the average value calculation of these irregular waveforms;
[0009] (2) When processing signals with large noise interference, it is easily affected by the noise, which may lead to inaccurate calculation results of the average current;
[0010] (3) Based on the calculation of a fixed window, it is difficult to adapt to the instantaneous changes of the current signal and may not be able to quickly respond to dynamic changes such as load fluctuations or sudden faults;
[0011] (4) In an actual application scenario, the metering and acquisition device collects power data at fixed time intervals. Due to the too large acquisition time interval, there are a large number of missing power data, and machine learning methods cannot obtain good performance in the face of a large number of discrete data.
[0012] Therefore, how to solve the inaccurate calibration of current transformers caused by the clock asynchronization of metering and acquisition devices and the volatility of the current itself is an urgent problem to be solved at present. Summary of the Invention
[0013] The purpose of the present invention is to provide a method, device, equipment, and medium for processing secondary-side data of a current transformer, which solves the problem of inaccurate calibration of the current transformer caused by the clock asynchronization of the metering and acquisition device and the volatility of the current itself.
[0014] In the first aspect of the present invention, a method for processing secondary-side data of a current transformer is provided. The method includes:
[0015] Obtain a neural network model, historical power data, and first-day-before power data; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and both the historical power data and the first-day-before power data are power data of a line connected to a bus;
[0016] Use the historical power data to train the neural network model to obtain a prediction model for predicting power data;
[0017] Using the prediction model, expand the first-day-ahead power data into continuous data to obtain second-day-ahead power data;
[0018] Decompose the second-day-ahead power data to obtain a low-frequency component and a high-frequency component;
[0019] Obtain a convolutional neural network for solving the average current, and use the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculate the current phase angle according to the average current and the second-day-ahead power data.
[0020] In one implementation, according to the topological structure diagram, obtain the historical power data of the lines connected to the bus; wherein, the historical power data and the first-day-ahead power data both include current data, voltage data, active power data, reactive power data, and meter reading data;
[0021] Before obtaining the historical power data, the method further includes: using an isolation forest anomaly detection algorithm to remove the anomaly points in the historical power data.
[0022] In one implementation, the multi-scale convolutional neural network includes three sub-convolutional neural networks connected in parallel, wherein each sub-convolutional neural network has a different scale;
[0023] The bidirectional long short-term memory neural network includes multiple forward long short-term memory networks, multiple backward long short-term memory networks, and an attention mechanism layer; wherein, the number of forward long short-term memory networks is the same as that of backward long short-term memory networks.
[0024] In one implementation, using the prediction model to expand the first-day-ahead power data into continuous data to obtain second-day-ahead power data includes:
[0025] Use three sub-convolutional neural networks with different scales to extract the local features of the first-day-ahead power data at different scales, and fuse the local features extracted by each sub-convolutional neural network to obtain the data features of the first-day-ahead power data;
[0026] Use multiple forward long short-term memory networks and multiple backward long short-term memory networks to extract the forward features and backward features of each time step of the first-day-ahead power data to obtain context features, use the attention mechanism layer to generate attention weights for each time step, and fuse the attention weights and the context features to obtain the temporal features of the first-day-ahead power data;
[0027] Fuse the temporal features and the data features to obtain a feature vector;
[0028] Predict the feature vector through a fully connected layer to obtain the second-day-ahead power data.
[0029] In an implementation scheme, the second day power data is decomposed by wavelet decomposition method.
[0030] In one implementation, the convolutional neural network includes a convolution layer, a maximum pooling layer and a Dropout layer.
[0031] A second aspect of the present invention provides a current transformer secondary side data processing device, the device comprising:
[0032] An acquisition module is used to acquire a neural network model, historical power data, and power data before the first day; wherein the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and the historical power data and power data before the first day are both power data of a line connected to a bus;
[0033] A training module, used to train the neural network model using the historical power data to obtain a prediction model for predicting power data;
[0034] A data expansion module, used to expand the first day-ahead power data into continuous data using the prediction model to obtain the second day-ahead power data;
[0035] A data decomposition module, used for decomposing the second day power data to obtain a low-frequency component and a high-frequency component;
[0036] The data processing module is used to obtain a convolutional neural network for solving the average current, use the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculate the current phase angle based on the average current and the power data of the second day.
[0037] In one implementation, the acquisition module is further used to: acquire historical power data of the line connected to the busbar according to the topological structure diagram; wherein the historical power data and the power data before the first day both include current data, voltage data, active power data, reactive power data and meter code data;
[0038] The device also includes a data preprocessing module, which is used to use an isolation forest anomaly detection algorithm to eliminate abnormal points in the historical power data.
[0039] According to a third aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the current transformer secondary side data processing method provided in the first aspect of the present invention are implemented.
[0040] In a fourth aspect of the present invention, there is provided a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method for processing secondary-side data of a current transformer provided in the first aspect of the present invention.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] 1. In a method for processing secondary-side data of a current transformer provided by the present invention, first, a neural network model and historical power data are obtained; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel; secondly, the neural network model is trained using the historical power data to obtain a prediction model for predicting power data; then, the prediction model is used to expand the power data of the day before the first day to obtain the power data of the day before the second day. Based on the above, the data features of the current data of the day before the first day are extracted by the multi-scale convolutional neural network provided by the present invention. At the same time, in combination with the bidirectional long short-term memory neural network, the time series features of the power data of the day before the first day are captured, and the problem of excessive discreteness existing in the power data collected by the metering and acquisition device at fixed time intervals is solved. Finally, the power data of the day before the first day is expanded by combining the data features and the time series features to obtain the power data of the day before the second day. The expanded power data of the day before the second day is decomposed to extract the low-frequency component and the high-frequency component, and a convolutional neural network for solving the average current is obtained. Feature learning is performed on the low-frequency and high-frequency components to better capture the characteristics of the data, thereby calculating the average current and the current phase angle, reducing the distortion and error existing in the method provided by the related technology, and providing data support for the on-line calibration of the current transformer.
[0043] 2. In a method for processing secondary-side data of a current transformer provided by the present invention, the noise points and abnormal points in the historical power data are removed by the isolation forest anomaly detection algorithm, which can avoid the problem of inaccurate calculation results caused by noise. Description of the Drawings
[0044] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, form a part of this application, and do not limit the embodiments of the present invention. In the drawings:
[0045] Figure 1 is a flowchart of a method for processing secondary-side data of a current transformer provided by an embodiment of the present application;
[0046] Figure 2 is a flowchart of a power data cleaning method based on the isolation forest anomaly detection algorithm provided by an embodiment of the present application;
[0047] Figure 3 is a network diagram of a multi-scale convolutional neural network provided by an embodiment of the present application;
[0048] Figure 4 It is a network schematic diagram of the long short - term memory network provided by an embodiment of the present application;
[0049] Figure 5 It is a model schematic diagram of the neural network model provided by an embodiment of the present application;
[0050] Figure 6 It is a network schematic diagram of the convolutional neural network provided by an embodiment of the present application;
[0051] Figure 7 It is a result graph processed by the isolation forest anomaly detection algorithm provided by an embodiment of the present application;
[0052] Figure 8 It is a result graph of power data after the neural network model provided by an embodiment of the present application is expanded;
[0053] Figure 9 It is a line graph of the prediction error of power data after the neural network model provided by an embodiment of the present application is expanded;
[0054] Figure 10 It is a line graph comparing the data processing method provided by an embodiment of the present application with the prior art;
[0055] Figure 11 It is a line graph comparing the error values of the data processing method provided by an embodiment of the present application with the prior art;
[0056] Figure 12 It is a result graph of the current data processing method based on wavelet transform provided by an embodiment of the present application;
[0057] Figure 13 It is an error line graph of the current data processing method based on wavelet transform provided by an embodiment of the present application. Detailed implementation manners
[0058] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with embodiments and the accompanying drawings. The illustrative embodiments and descriptions thereof of the present invention are only used to explain the present invention and do not limit the present invention.
[0059] It should be noted that the terms "include" or "may include" used in various embodiments of the present application indicate the presence of the function, operation or element applied for, and do not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present application, the terms "include", "have" and their cognates are only intended to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items.
[0060] In various embodiments of the present application, the expression "or" or "at least one of B or / and C" includes any combination or all combinations of the words listed at the same time. For example, the expression "B or C" or "at least one of B or / and C" may include B, may include C, or may include both B and C.
[0061] It should be understood that terms such as "first" and "second" are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0062] Please refer to Figure 1 , Figure 1 is a flow chart of a current transformer secondary side data processing method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0063] S101, obtaining a neural network model, historical power data, and power data before the first day; wherein the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and the historical power data and power data before the first day are both power data of the lines connected to the bus.
[0064] In this embodiment, historical power data and power data before the first day can be obtained from the metering and collection device arranged at the busbar, including current data, voltage data, active power and reactive power data, meter code data, etc. This is common knowledge for technicians in this technical field, and this embodiment does not provide a detailed description of the acquired data.
[0065] Before acquiring the historical power data, the method further includes: using an isolation forest anomaly detection algorithm to remove abnormal points in the historical power data.
[0066] Specifically, taking the power data collected by the substation gateway metering device as the research object, the improved isolation forest algorithm is used to clean the historical power data according to the power data of the metering acquisition device, including current data I = {i1, i2,..., i n}, voltage data V = {v1, v2,..., v n}, active power data P = {p1, p2,..., p n}, reactive power data Q = {q1, q2,..., q n}, and meter reading data E = {e1, e2,..., e n}. The original power data contains noise, incomplete values, outliers, or duplicate records due to acquisition equipment failures, communication errors, or environmental interference. These problems can lead to inaccurate or even misleading data analysis, modeling, or prediction results. By cleaning the power data, the quality and consistency of the data can be improved, providing a reliable basis for subsequent algorithm applications and decision-making.
[0067] The traditional isolation forest algorithm assumes that outliers occur less frequently in the dataset, that their distribution is significantly different from other points, and that outliers are more easily isolated because they are far from most points or fall in sparse regions. However, when the data dimension is extremely high, random splitting may lead to a decline in model performance. According to the characteristics of historical current data, the present invention adopts a dynamic splitting method. By utilizing the distribution characteristics of the data, the splitting strategy is adaptively adjusted to make the splitting more targeted and improve the isolation effect. The flow chart of the power data cleaning method based on the isolation forest anomaly detection algorithm is as Figure 2 shown. The specific steps are as follows:
[0068] Step 1: Input historical power data, including n samples, each sample having m features, where both n and m are integers.
[0069] Step 2: Randomly sample ψ samples from the dataset. Usually, the value of ψ is much smaller than n. Repeat the sampling t times to construct t isolation trees.
[0070] Step 3: For each sampled subset, construct an isolation tree. First, split the samples according to the features. The density information of the data can be used as an important basis for guiding the splitting. The splitting in high-density regions should be more detailed, while the splitting in low-density regions can be coarser. The estimated probability density function f(x) of the data point x can be expressed as shown in Formula 1:
[0071] where n is the number of current data samples, x i is the i-th sample point in the dataset, h is the smoothing parameter, which determines the width of the kernel function and affects the smoothness of the estimation result. K is the kernel function, used to measure the distance between x and the sample point x iThe similarity between. The kernel function can be expressed as shown in Formula 2: where μ represents the distance value of the sample point x to the kernel center x i after being normalized by the bandwidth h. After dynamically segmenting the samples, an isolation tree is constructed, and the segmentation process is repeated until all samples are isolated or the specified maximum depth of the tree is reached.
[0072] Step 4: Calculate the anomaly score according to the isolation tree path length. The number of segmentation times required for a sample to reach the leaf node from the root node is called the path length. And the anomaly points that need to be cleaned usually have a shorter path length. The anomaly score s(x,n) of the sample x needs to be calculated according to the average path length of the samples, which can be specifically expressed as shown in Formula 3: where h(x) is the path length of the sample x, E(h(x)) is the average path length of the path length, and c(n) is a normalization factor that depends on the number of samples n.
[0073] Step 5: Compare the calculated anomaly score with the set anomaly threshold. If it exceeds the threshold, it indicates that the power data is abnormal data and it will be discarded.
[0074] The neural network model provided in this embodiment will be described in detail below. As Figure 3 shown, the multi-scale convolutional neural network uses three sub-convolutional neural networks with different scales connected in parallel to extract the global and local features of the current data, including a convolutional layer, a normalization layer, and a max pooling layer; different-scale and hierarchical feature information is extracted through three convolutional layers to extract the local features of the power data.
[0075] For the three sub-convolutional neural networks, they first perform a one-step convolution operation on the power data X t input at time t. The output result Y t after convolution can be expressed as shown in Formula 4: where k is the size of the convolutional kernel, X t+i-1 is the size of the input data, W i is the weight of the i-th convolutional kernel, and b is the bias. Then perform a one-step normalization operation. The output result Y t after the convolution operation is the input data X t for the normalization operation. The output result Y t after normalization and the partial derivative Y′ t of the result can be expressed as shown in Formulas 5 and 6: Y t =γ·Y′ t +β(5); where μ is the mean of the input sequence, σ 2 is the variance of the input sequence, γ and β are trainable scaling and offset parameters, and ε is a constant to avoid the denominator being zero. The μ and σ within the T time period2 It can be expressed by the formula:
[0076] Then, a pooling operation is performed, where the normalized output data Y t is the output result X of the pooling operation t , and the output result Y at time t after pooling t can be expressed as shown in Formula 9: where P is the pooling window size.
[0077] For the bidirectional long short-term memory neural network BiLSTM, it includes multiple forward long short-term memory networks, multiple backward long short-term memory networks, and an attention mechanism layer; among them, the number of the forward long short-term memory networks is the same as that of the backward long short-term memory networks.
[0078] In this embodiment, the number of both the forward long short-term memory network and the backward long short-term memory network is 4. The network schematic diagram of each long short-term memory network LSTM is as Figure 4 shown.
[0079] The operation process of LSTM can be expressed as shown in Formulas 10 - 15:
[0080] f t = s(W f [h t-1 , x t + b f )(10);
[0081] c′ t = tanh(W c [h t-1 , x t + b c )(11);
[0082] i t = s(W i [h t-1 , x t + b i )(12);
[0083] c t = f t ⊙ c t-1 + i t ⊙ c′ t (13);
[0084] o t = s(W o [h t-1 , x t + b o ) (14);
[0085] h t = o t ⊙tanh(c t )(15);
[0086] Among them, f t is the output of the forget gate, 1 means complete acceptance, 0 means complete forgetting, W f , W c , W i , W o are all weight matrices, b f , b c , b i , b o are all bias terms, i t is the input gate, c' t is the candidate state, c t is the current state, c t-1 is the state at the previous time step, o t is the output gate, h t-1 is the hidden state at the previous time step, x t is the input data at the current time t, s is the sigmod function, tanh is the hyperbolic tangent function, and ⊙ represents the dot product of vectors.
[0087] S102. Use the historical power data to train the neural network model to obtain a prediction model for predicting power data.
[0088] In this embodiment, for training the neural network model using historical power data to obtain a prediction model for predicting power data, the currently conventional neural network training method is adopted. Therefore, this embodiment will not give redundant descriptions either.
[0089] S103. Use the prediction model to expand the first-day-ahead power data into continuous data to obtain the second-day-ahead power data.
[0090] In this embodiment, the expansion is implemented as follows: Use three sub-convolutional neural networks with different scales to extract the local features of the first-day-ahead power data at different scales, fuse the local features extracted by each sub-convolutional neural network to obtain the data features of the first-day-ahead power data; Use multiple forward long short-term memory networks and multiple backward long short-term memory networks to extract the forward features and backward features of each time step of the first-day-ahead power data to obtain the context features, use the attention mechanism layer to generate attention weights for each time step, and fuse the attention weights and context features to obtain the temporal features of the first-day-ahead power data; Fuse the temporal features and data features to obtain a feature vector; Perform prediction on the feature vector through a fully connected layer to obtain the second-day-ahead power data.
[0091] Specifically, based on the formulas (4)-(9) described above, the multi-scale convolutional neural network can extract the data features of the electricity data of the previous day.
[0092] BiLSTM generates the global context features of the current data at each time step by combining the outputs of multiple forward LSTMs and multiple backward LSTMs which can be expressed as: It can be expressed as:
[0093] The attention mechanism generates attention weights for each time step and combines these weights with the temporal features to form global context features. The core of the attention layer is to calculate the attention weights for each time step, usually using the additive attention mechanism, that is:
[0094] where, e t is the attention score at the current time step, e t' is the attention weight at time step t, usually calculated in the following way: e t = score(h t ) = W a ·h t + b a (18), where, W a and b a are learned parameters, and h t is the output of BiLSTM.
[0095] Then, the attention weights are combined with the output of BiLSTM to form the global context feature h conte :
[0096] Finally, the output h CNN of the multi-scale convolutional neural network is merged with the output h BiLSTM of BiLSTM. Based on the model diagram of the current data prediction method of the neural network model, as Figure 5 shown. Connecting them forms a new feature vector hcombined which can be expressed as: h combined = [h CNN , h BiLSTM (20)
[0097] The merged feature vector is predicted through the fully connected layer: y pred = W f ·h combined + b f (21), where, W f and b fare the weights and biases of the fully connected layer, and ypred is the predicted value. After prediction, the electricity data of the day before the first day can be augmented by interpolation method to obtain the electricity data of the day before the second day.
[0098] Based on the neural network model provided in this embodiment, the prediction and interpolation process of the electricity data of the day before the first day is realized, combining the advantages of the multi-scale convolutional neural network and the bidirectional long short-term memory network. The multi-scale convolutional neural network uses three columns of parallel CNN structures with different scales to extract the global and local features of the current data, which can effectively process high-dimensional inputs and capture local patterns; BiLSTM has strong modeling ability for time series data, can remember long-term dependencies, and is suitable for dealing with the non-linear and dynamic characteristics in electricity data. This method not only improves the accuracy of data prediction and interpolation, but also has strong robustness and can perform excellently in the environment of missing data and noise.
[0099] S104, decompose the electricity data of the day before the second day to obtain a low-frequency component and a high-frequency component.
[0100] In this embodiment, the wavelet decomposition method is used to realize the decomposition of the electricity data of the day before the second day. Wavelet decomposition is a technique for signal processing, which can decompose a signal into multiple frequency band components to facilitate the extraction of different time-frequency features. The predicted electricity data is decomposed into a low-frequency approximation component and a high-frequency detail component by wavelet decomposition.
[0101] First, perform wavelet operations on the electricity data of the day before the second day, and this operation can be expressed as shown in formulas (22) and (23):
[0102]
[0103] ψ j,k (t) = 2 j / 2 ψ(2 j t - k)(23), where Y(j,k) is the wavelet transform coefficient of the signal x(t) at the scale factor j and the time shift k. ψ j,l (t) is the wavelet basis function. j is the scale factor, which controls the stretching of the wavelet. k is the time shift factor, which controls the translation of the wavelet, and 2 j / 2 is the normalization factor to ensure that the energy of the wavelet function does not change with the scale. By performing multi-scale decomposition on the power signal, components of different frequency bands can be obtained. Through wavelet decomposition, the signal is decomposed into a low-frequency approximation component A n and a high-frequency detail component D n . The low-frequency approximation component represents the trend part of the signal, and the high-frequency detail component represents the fluctuation part of the signal. Combining the low-frequency approximation component and the high-frequency detail component can effectively reflect the fluctuation characteristics of the electricity data. These components can be reconstructed into an approximate part of the original signal through inverse wavelet transform:
[0104] The current data processing method based on wavelet transform can perform multi-resolution decomposition on current signals, effectively extract the time-frequency characteristics of the signals, and is particularly sensitive to instantaneous changes in non-stationary signals.
[0105] S105, obtain a convolutional neural network for solving the average current, use the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculate the current phase angle according to the average current and the power data of the previous day.
[0106] In this embodiment, the processing of the components is implemented by a convolutional neural network. The network schematic diagram for calculating the average current based on the convolutional neural network is as Figure 6 shown. A convolutional neural network is constructed. The convolutional neural network is used to extract features from power data and calculate the average current. Performing convolutional learning on the current data after wavelet transformation can better capture the characteristics of the current data and reduce the impact of data volatility on subsequent feature extraction and model training. This process includes a convolutional layer, a max pooling layer, and a Dropout layer to extract important features from the input power data and perform calculations. Finally, it is activated through the relu activation function, which can be specifically expressed as shown in Formula 25:
[0107] Convolutional layer: The convolution operation is used to extract local features of the input signal. In the process of calculating the current, the convolutional layer can extract local patterns (such as fluctuations, periodic changes, etc.) in the current signal. The convolution formula is: Y = X * W + b (26), where X is the input data, W is the convolution kernel, b is the bias term, and Y is the output of the convolutional layer.
[0108] Then, the max pooling operation is performed. The max pooling is used for dimensionality reduction and extraction of the most important features, reducing the amount of calculation. For a pooling window (2×2), its formula is: Y i,j = max(X 2i,2j , X 2i+1,2j , X 2i,2j+1 , X 2i+1,2j+1 )(27); where Y i,j is the output after pooling, and X 2i,2j , X 2i+1,2j , X 2i,2j+1 , X 2i+1,2j+1 represent the data values in the pooling window.
[0109] Then, through the fully connected layer and then through the softmax function, it can be specifically expressed as shown in Formula 28:
[0110] where, x irepresents the i-th component of the input vector x = [x1, x2, x3,..., x n , e is the base of the natural exponential function, is the exponential sum of all input components, used for normalization.
[0111] Next, calculate the average current. After extracting the features of the power signal through the convolutional layer, finally, calculate the average value of the current through a fully connected layer and a linear activation function. Assume the output is y avg , then the calculation formula is: y avg = W f ·h + b f (29), where, W f is the weight of the fully connected layer, h is the feature vector after convolution and pooling, b f is the bias term. Finally, use the linear activation function to calculate the obtained y avg , which is the average value of the current.
[0112] Finally, calculate the current phase angle. The current phase angle is used to describe the phase information of the current waveform. In the power system, the current signal is often periodic, and calculating the phase angle can reveal the phase change of the current. Assume the current signal can be expressed in complex form: I(t) = I0e jθ(t) (30), where, I(t) is the current signal, I0 is the amplitude of the current, θ(t) is the phase angle of the current signal, and j is the imaginary unit. According to the expanded power data, calculate the current phase angle, and the calculation formula is: where, P is the active power of the line, V is the effective value of the line voltage, I is the effective value of the line current, φ I is the current phase angle.
[0113] It can be seen that the convolutional neural network can automatically extract the deep features of the signal and capture complex patterns and non-linear relationships. It can not only improve the accuracy of current signal feature extraction, but also achieve efficient and accurate average current and phase angle estimation under complex working conditions.
[0114] In a method for processing secondary - side data of a current transformer described above, first, a neural network model and historical power data are obtained. Among them, the neural network model includes a multi - scale convolutional neural network and a bidirectional long - short - term memory neural network connected in parallel. Secondly, the neural network model is trained using historical power data to obtain a prediction model for predicting power data. Thirdly, the first - day - before power data is augmented using the prediction model to obtain second - day - before power data. Based on the above content, the data features of the first - day - before current data are extracted by the multi - scale convolutional neural network provided by the present invention. At the same time, combined with the bidirectional long - short - term memory neural network, the time - series features of the first - day - before power data are captured, solving the problem of excessive discreteness in the power data collected by the metering and acquisition device at fixed time intervals. Finally, the first - day - before power data is augmented by combining the data features and time - series features to obtain second - day - before power data. The augmented second - day - before power data is decomposed to extract low - frequency components and high - frequency components, and a convolutional neural network for solving the average current is obtained. Feature learning is performed on the low - frequency and high - frequency components to better capture the characteristics of the data, thereby calculating the average current and the current phase angle, reducing the distortion and error existing in the method provided by the related technology, and providing data support for the online calibration of the current transformer.
[0115] To illustrate the effect of the method provided by the embodiments of the present application, the method provided by the embodiments of the present application will be described below through experimental data.
[0116] Experiment on the power data cleaning method based on the isolated forest. According to the phase - A current data of a certain line collected by the metering and acquisition device, the denoising scatter plot of the phase - A current is as Figure 7 shown. The blue dots represent normal data at corresponding times, and the red crosses represent the identified abnormal data signals. Based on this result, the noise and abnormal power data in the current data are removed, thereby realizing data cleaning. The result graph of the power data augmented based on the neural network model provided by the present invention is as Figure 8 shown. The black curve represents the actual secondary - side current magnitude of the current transformer, and the red curve represents the predicted secondary - side current magnitude of the current transformer. From Figure 8 it can be seen that the overall trend of the prediction curve is highly consistent with the actual current curve, and its current magnitude is in the range of [0.49, 0.5]. The prediction method can accurately capture and effectively predict the dynamic changes of the current. Although there are a small number of deviations at the peak and trough of the sharp current changes, the prediction effect of the model still shows high reliability and accuracy. The prediction error line graph of the power data augmented based on the neural network model is as Figure 9As shown, the current difference curve represents the difference between the actual current and the predicted current at the same moment. From the difference curve, it can be seen that the difference range is between [-0.0012, 0.0005], and its maximum error is less than 0.25%. It can be seen that the prediction method of the present invention can effectively predict data at other moments based on the data of the metering acquisition device. To illustrate the accuracy and superiority of the prediction method of the present invention, a comparative line chart of the data processing method of the present invention and the existing technologies of LSTM and CNN power prediction methods is provided, as Figure 10 shown. A comparative line chart of the error values of the data processing method provided by the present invention and the existing technologies is shown, as Figure 11 shown. From Figure 11 it can be seen that compared with the LSTM and CNN methods, the present invention has better prediction accuracy at the peak and valley values of the current. At the same time, in terms of the prediction results, the present invention is smaller than the other two methods and more in line with the actual requirements, providing more accurate data support for the subsequent calculation of the average current and phase angle. The result graph of the current data processing method based on wavelet transform is shown as Figure 12 shown. In this experiment, the average current value is calculated in half-hour time units. The black dots represent the actual average current in the first half hour before this moment, the red dots represent the size of the average current predicted by the present invention in the first half hour before this moment, and the blue dots represent the size of the average current obtained by arithmetic averaging the predicted current in the first half hour before this moment. It can be seen that there is a certain fluctuation in the predicted current, and there is a certain error in the average current obtained by arithmetic averaging. However, the method of the present invention using wavelet transform can effectively reduce the influence of the current prediction fluctuation. The error line chart of the current data processing method based on wavelet transform is shown as Figure 13 shown. It can be seen that the average current error of the present invention fluctuates within the range of 0.01A, while the error of the average current calculated by arithmetic averaging reaches 0.1A. It can be seen that this method can effectively reduce the problem of inaccurate data caused by the fluctuation of current data, providing reliable data support for the subsequent on-line calibration of current transformers.
[0117] The embodiment of the present application also provides a current transformer secondary side data processing device, which includes:
[0118] An acquisition module, configured to acquire a neural network model, historical power data, and first-day-before power data; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and both the historical power data and the first-day-before power data are power data of a line connected to a bus;
[0119] A training module, configured to train the neural network model using the historical power data to obtain a prediction model for predicting power data;
[0120] A data expansion module, used to expand the first day-ahead power data into continuous data using the prediction model to obtain the second day-ahead power data;
[0121] A data decomposition module, used for decomposing the second day power data to obtain a low-frequency component and a high-frequency component;
[0122] The data processing module is used to obtain a convolutional neural network for solving the average current, use the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculate the current phase angle based on the average current and the power data of the second day.
[0123] It can be seen that in the current transformer secondary side data processing device described above, first, the neural network model and historical power data are obtained; wherein the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel; secondly, the neural network model is trained using the historical power data to obtain a prediction model for predicting power data; and thirdly, the prediction model is used to expand the first day-ahead power data to obtain the second day-ahead power data. Based on the above content, the multi-scale convolutional neural network provided by the present invention is used to extract the data features of the current data the day before, and at the same time, combined with the bidirectional long short-term memory neural network, the time series features of the power data the day before are captured, so as to solve the problem of excessive discreteness when the metering and collection device collects power data once at a fixed time interval. Finally, the power data the day before is expanded in combination with the data features and the time series features to obtain the power data the day before. The expanded power data from the second day before is decomposed to extract low-frequency and high-frequency components, and a convolutional neural network is obtained to solve the average current. Feature learning is performed on the low-frequency and high-frequency components to better capture the characteristics of the data, thereby calculating the average current and current phase angle. This reduces the distortion and errors in the methods provided by related technologies and provides data support for online calibration of current transformers.
[0124] In one embodiment, the acquisition module is further used to: acquire historical power data of the line connected to the bus according to the topological structure diagram; wherein the historical power data and the power data before the first day both include current data, voltage data, active power data, reactive power data and meter code data;
[0125] The device also includes a data preprocessing module, which is used to use an isolation forest anomaly detection algorithm to eliminate abnormal points in the historical power data.
[0126] A current transformer secondary side data processing device provided in an embodiment of the present application is Figure 1The current transformer secondary side data processing method shown is a technical solution under the same inventive concept. Through the detailed description of a current transformer secondary side data processing method provided by the above embodiments, those skilled in the art can clearly understand the implementation process of a current transformer secondary side data processing device in this embodiment. Therefore, for the sake of simplicity of the specification, it will not be elaborated here.
[0127] The embodiment of the present application also provides a computer device. Among them, the computer device includes a processor, a memory, a communication interface, and at least one communication bus for connecting the processor, the memory, and the communication interface. The memory includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (PROM), or a portable read-only memory (CD-ROM), and this memory is used for relevant instructions and data.
[0128] The communication interface is used to receive and send data. The processor can be one or more CPUs. In the case where the processor is a single CPU, the CPU can be a single-core CPU or a multi-core CPU. The processor in the intelligent pet terminal is used to read one or more programs stored in the memory and perform the following operations: obtaining a neural network model, historical power data, and first-day-ahead power data; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and both the historical power data and the first-day-ahead power data are power data of the line connected to the busbar; training the neural network model with the historical power data to obtain a prediction model for predicting power data; using the prediction model to expand the first-day-ahead power data into continuous data to obtain second-day-ahead power data; decomposing the second-day-ahead power data to obtain a low-frequency component and a high-frequency component; obtaining a convolutional neural network for solving the average current, and using the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculating the current phase angle based on the average current and the second-day-ahead power data.
[0129] It should be noted that the specific implementation of each operation can be the corresponding description of the method embodiment shown above Figure 1 The computer device can be used to execute a current transformer secondary side data processing method in the method embodiment of the present application above, and will not be specifically elaborated here.
[0130] In an embodiment of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the terminal is stored in this storage space. Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in this storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. One or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the method for processing secondary-side data of a current transformer in the above embodiment. Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0131] The specific implementation manners described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only the specific implementation manners of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for processing secondary side data of a current transformer, characterized in that, The method includes: Obtaining a neural network model, historical power data, and the power data of the day before the first day; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and both the historical power data and the power data of the day before the first day are the power data of the lines connected to the busbar; Training the neural network model using the historical power data to obtain a prediction model for predicting power data; Using the prediction model to expand the power data of the day before the first day into continuous data to obtain the power data of the day before the second day; Decomposing the power data of the day before the second day to obtain a low-frequency component and a high-frequency component; Obtaining a convolutional neural network for solving the average current, and using the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculating the current phase angle based on the average current and the power data of the day before the second day.
2. The method according to claim 1, wherein According to the topological structure diagram, obtaining the historical power data of the lines connected to the busbar; wherein, the historical power data and the power data of the day before the first day both include current data, voltage data, active power data, reactive power data, and meter reading data; Before obtaining the historical power data, the method further includes: using an isolation forest anomaly detection algorithm to remove the abnormal points in the historical power data.
3. The method according to claim 1, wherein The multi-scale convolutional neural network includes three sub-convolutional neural networks connected in parallel, and the scales of each sub-convolutional neural network are different; The bidirectional long short-term memory neural network includes multiple forward long short-term memory networks, multiple backward long short-term memory networks, and an attention mechanism layer; wherein, the number of the forward long short-term memory networks is the same as that of the backward long short-term memory networks.
4. The method according to claim 3, characterized in that, Using the prediction model to expand the power data of the day before the first day into continuous data to obtain the power data of the day before the second day, including: Using three sub-convolutional neural networks with different scales to extract the local features of the power data of the day before the first day at different scales, and fusing the local features extracted by each sub-convolutional neural network to obtain the data features of the power data of the day before the first day; Using multiple forward long short-term memory networks and multiple backward long short-term memory networks to extract the forward features and backward features of each time step of the power data of the day before the first day to obtain context features, using the attention mechanism layer to generate attention weights for each time step, and fusing the attention weights and the context features to obtain the temporal features of the power data of the day before the first day; Fusing the temporal features and the data features to obtain a feature vector; Predicting the feature vector through a fully connected layer to obtain the power data of the day before the second day.
5. The method according to claim 1, wherein Using the wavelet decomposition method to decompose the power data of the day before the second day.
6. The method according to claim 1, wherein The convolutional neural network includes a convolutional layer, a max pooling layer, and a Dropout layer.
7. A secondary side data processing device for a current transformer, characterized in that, The device includes: An obtaining module, configured to obtain a neural network model, historical power data, and the power data of the day before the first day; wherein, the neural network model includes a multi-scale convolutional neural network and a bidirectional long short-term memory neural network connected in parallel, and both the historical power data and the power data of the day before the first day are the power data of the lines connected to the busbar; A training module, used to train the neural network model using the historical power data to obtain a prediction model for predicting power data; A data expansion module, used to expand the first day-ahead power data into continuous data using the prediction model to obtain the second day-ahead power data; A data decomposition module, used for decomposing the second day power data to obtain a low-frequency component and a high-frequency component; The data processing module is used to obtain a convolutional neural network for solving the average current, use the convolutional neural network to solve the low-frequency component and the high-frequency component to calculate the average current, and calculate the current phase angle based on the average current and the power data of the second day.
8. The device according to claim 7, characterized in that, The acquisition module is further used to: acquire historical power data of the line connected to the busbar according to the topological structure diagram; wherein the historical power data and the power data before the first day both include current data, voltage data, active power data, reactive power data and meter code data; The device also includes a data preprocessing module, which is used to use an isolation forest anomaly detection algorithm to eliminate abnormal points in the historical power data.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the current transformer secondary side data processing method according to any one of claims 1 to 6 are implemented.
10. 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 current transformer secondary side data processing method according to any one of claims 1 to 6 are implemented.