Standard value prediction method, error monitoring method and device of current transformer
The GatedFormer model addresses accuracy and efficiency issues in current transformer monitoring by predicting standard current values through a transposed embedding layer and gated attention network, ensuring precise online monitoring without a reference transformer.
Patent Information
- Application Number
- CN202411284950.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Current transformer error monitoring methods face challenges in accuracy and efficiency, particularly in online applications, due to high costs associated with hardware solutions and limited effectiveness of existing artificial intelligence algorithms.
A method utilizing a GatedFormer model that includes a transposed embedding layer, gated attention network, and feedforward neural network to predict standard current values, enabling accurate online monitoring without a reference current transformer.
The GatedFormer model enhances prediction accuracy by capturing long-term temporal dependencies and intrinsic properties of time series data, reducing error accumulation and improving generalization, thus facilitating efficient online monitoring of current transformers.
Smart Images

Figure CN119128440A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power system monitoring, and in particular to a standard value prediction method, an error monitoring method and a device thereof for a current transformer. Background Art
[0002] Although current transformers have a calibrated accuracy level, as the equipment ages, the actual error of the current transformer may exceed the calibration tolerance. Therefore, when calculating the error of the current transformer under test, it is usually necessary to introduce a standard current transformer with known accuracy. By measuring the secondary side current of the tested current transformer and the standard current transformer and calculating the difference between them, the error of the tested transformer can be determined.
[0003] The current value of the standard current transformer is an important basis for calculating the error of the current transformer. However, this requires physically connecting a standard current transformer to each circuit. In actual scenarios, due to the wide distribution and large number of current transformers, a lot of work time is spent on the way to the work site, resulting in a waste of manpower, economic and time costs.
[0004] In recent years, researchers have proposed a series of solutions for online monitoring technology of current transformer errors. These solutions can be systematically divided into two categories: one focuses on designing hardware devices and signal injection methods to build an online monitoring system; the second focuses on using big data and artificial intelligence methods to analyze and calculate the collected data, thereby realizing online monitoring of current transformers. However, the main focus is on designing hardware devices and signal injection, which has a high cost investment. In terms of big data and artificial intelligence analysis, related theoretical research is relatively weak. It is currently found that the prediction accuracy based on algorithms such as BP neural networks and k-means clustering is still a certain distance away from practical application. Therefore, it is necessary to propose a new artificial intelligence prediction method to improve the prediction accuracy of standard current values. Summary of the invention
[0005] The present invention provides a standard value prediction method, an error monitoring method and a device for a current transformer, so as to improve the accuracy of model prediction of standard current values and solve the problem that the current standard value prediction method is difficult to use in online monitoring applications of current transformers.
[0006] The present invention is achieved through the following technical solutions:
[0007] A first aspect of the present invention provides a method for predicting a standard current value of a current transformer, comprising:
[0008] Obtaining the timing data of the secondary side of multiple current transformers;
[0009] Processing the time series data through a transposed embedding layer to obtain high-dimensional features;
[0010] Extracting the high-dimensional features through a gated attention network to obtain time series trend features;
[0011] Encoding the time series trend feature through a feedforward neural network to obtain an encoded feature;
[0012] The encoding features are processed through the output layer to obtain the predicted standard current value of the current transformer.
[0013] The prediction method of the present invention uses multi-channel current data as input, and transposes the input time series feature dimension through the transposition embedding layer, so that the subsequent model pays more attention to the temporal correlation of the time series, and introduces a gated structure before the attention mechanism, and evaluates the trend information of the time series part before the feature enters the attention mechanism, so as to capture multivariate correlation and improve the ability of the gated attention network to capture the long-term dependency characteristics of the time series. Due to the introduction of the transposition embedding process, the time series of a variable is mapped to a vector, so that the feedforward neural network can perform the same linear operation on the independent time series and learn the intrinsic properties of the time series. Through the above process, a prediction result with high accuracy is finally obtained. The problem of applying the model-based prediction method to the error monitoring of the current transformer without a reference current transformer is solved.
[0014] In some implementations, the transposed embedding layer includes a mapping layer and a linear layer; and the processing of the time series data through the transposed embedding layer to obtain high-dimensional features includes:
[0015] Mapping the time series data through the mapping layer to obtain transposed features;
[0016] The transposed features are subjected to dimensionality-increasing processing through the linear layer to obtain high-dimensional features.
[0017] In some embodiments, the gated attention network includes a gated network and a multi-head attention mechanism, wherein the gated network includes a first convolution input layer, a first activation layer connected to the first convolution input layer, a second convolution input layer, a second activation layer connected to the second convolution input layer, and a feature fusion layer;
[0018] The high-dimensional features are extracted through a gated attention network to obtain time series trend features, including:
[0019] Performing a first convolution process on the high-dimensional feature through the first convolution input layer to obtain a first convolution feature, and performing a first activation process on the first convolution feature through the first activation layer to obtain a first activation feature; and
[0020] Performing a second convolution processing on the high-dimensional feature through the second convolution input layer to obtain a second convolution feature, and performing a second activation processing on the second convolution feature through the second activation layer to obtain a second activation feature;
[0021] Performing feature fusion processing on the first activation feature and the second activation feature through the feature fusion layer to obtain a fusion feature;
[0022] The fusion features are processed through the multi-head attention mechanism to obtain time series trend features.
[0023] In some embodiments, the method further comprises:
[0024] Before encoding the time series trend feature by the feedforward neural network to obtain the encoded feature, performing layer normalization processing on the time series trend feature; and / or,
[0025] Before the encoding feature is processed through the output layer to obtain the predicted standard current value of the current transformer, the encoding feature is subjected to layer normalization processing.
[0026] In some embodiments, the output layer is a linear projection layer.
[0027] In some implementations, the timing data includes current timing data, voltage timing data, and frequency timing data.
[0028] The second aspect of the present invention provides an online error monitoring method for a current transformer, comprising: calculating the actual value and standard value of the current transformer at the corresponding time node to obtain the error of the current transformer; the standard value is obtained by the standard current value prediction method of the current transformer described in any one of the first aspect of the present invention.
[0029] A third aspect of the present invention provides a device for predicting a standard current value of a current transformer, comprising:
[0030] A data acquisition module, used to acquire time series data of the secondary side of multiple current transformers;
[0031] A standard value prediction module, used to predict the standard value of the current transformer;
[0032] The standard value prediction module includes a transposed embedding layer, a gated attention network, a feedforward neural network and an output layer;
[0033] The transposed embedding layer is used to process the time series data to obtain high-dimensional features;
[0034] The gated attention network is used to extract features from the high-dimensional features to obtain time series trend features;
[0035] The feedforward neural network is used to encode the time series trend feature to obtain the encoded feature;
[0036] The output layer is used to process the encoding features to obtain the predicted standard value of the current transformer.
[0037] In a fourth aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the standard current value prediction method for the current transformer described in any one of the first aspect of the present invention and / or the online error monitoring method for the current transformer described in the second aspect are implemented.
[0038] In a fifth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the standard current value prediction method of the current transformer described in any one of the first aspect of the present invention, and / or the online error monitoring method of the current transformer described in the second aspect.
[0039] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0040] By replacing the embedding layer of the original Transformer with a transposed embedding layer, that is, transposing the dimension, the prediction model can input the time series as a vector, which helps the model pay more attention to the temporal correlation of the time series. At the same time, the introduction of the gated attention mechanism can evaluate the trend information of the time series before the feature enters the attention processing, learn the long-term temporal dependency of the time series, and thus improve the accuracy of predicting the standard current value.
[0041] Since the introduced transposed embedding layer maps the time series of a variable into a vector, the feedforward neural network can perform the same linear operation on independent time series. The neurons in the linear layer learn the intrinsic properties of the time series, such as frequency spectrum, periodicity, amplitude, etc. Therefore, the feedforward neural network improves the generalization performance of the model.
[0042] Due to the introduction of the transposed embedding layer, the time series data can be mapped into a vector and provided to the subsequent model for processing. Therefore, the model can take the time series data of multiple current transformers as input, which broadens the dimension of feature extraction.
[0043] Using the linear projection layer as the output layer, multiple prediction moments in the future can be directly output, which significantly reduces the error accumulation of step-by-step prediction.
[0044] Layer normalization is used to unify the feature distribution of different variables, reducing the differences caused by inconsistent measurements. Since the idea of transposition is introduced in the embedding layer, the time series of each current transformer current is taken as a vector. Since the current values of the same node are highly correlated, layer normalization can effectively process the transposed vector. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:
[0046] Figure 1 It is a structural block diagram of a GatedFormer prediction model proposed by the present invention;
[0047] Figure 2 is a flow chart of a current transformer standard value prediction method based on gated attention according to an embodiment of the present invention;
[0048] Figure 3 is a schematic diagram of a transposition embedding process according to an embodiment of the present invention;
[0049] Figure 4 is a structural block diagram of a gated attention network according to an embodiment of the present invention;
[0050] Figure 5 It is a structural block diagram of a Gatedformer model after introducing layer normalization in an embodiment of the present invention;
[0051] Figure 6 It is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0053] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to or inherent to other steps or units of the device.
[0054] The terms used in the various embodiments of the application are only used to describe the purpose of specific embodiments and are not intended to limit the various embodiments of the application. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise limited, all terms used here (including technical terms and scientific terms) have the same meaning as the meanings commonly understood by ordinary technicians in the field of the various embodiments of the application. The terms (such as the terms defined in the dictionary generally used) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in the various embodiments of the application.
[0055] The embodiments of the present invention provide a standard value prediction method, an error monitoring method and a device for a current transformer, which can predict an accurate standard current value and can be applied to online error prediction of a circuit transformer. In the absence of a standard current transformer, the predicted value can be used as the standard value, thereby performing real-time online monitoring of the error of the current transformer.
[0056] In the error analysis of current transformers, ratio difference and angle difference are two core elements, which together determine the measurement accuracy of the transformer. However, in many practical application scenarios, especially in the fields of power system protection and electric energy metering, the ratio difference directly affects the linearity of the measurement results and becomes a key factor in determining system performance. Therefore, the present invention focuses on building an efficient and accurate ratio difference prediction model to cope with the growing demand for power system monitoring.
[0057] In view of this, the present invention proposes a gated attention model (hereinafter referred to as "GatedFormer") that applies gating on the basis of the Transformer model to predict the standard value of the future current transformer. This method uses the GatedFormer model to learn data features through multi-channel current data input to accurately predict the standard value of the future current transformer. Specifically, this method embeds time point variables through a multi-head attention mechanism to capture multivariate correlations; captures the long-term dependency characteristics of the time series through a gated attention network, and applies a feedforward network to learn nonlinear representations, and finally outputs the prediction results through the output layer. It has excellent time series data processing capabilities and high-accuracy prediction results, provides an effective solution for condition monitoring and fault warning, and has important technical support and broad application prospects for the safe operation and maintenance of power systems.
[0058] See also Figure 1 As shown, Figure 1 It is a structural block diagram of the GatedFormer prediction model proposed in the present invention, which includes a transposed embedding layer, a gated attention network, a feedforward neural network and an output layer connected in sequence.
[0059] The Gatedformer model mainly uses the encoder structure of the Transformer. By transposing the dimension of the embedding layer of the original Transformer, the model can input the time series as a vector, which helps the model pay more attention to the temporal correlation of the time series. At the same time, the gated attention mechanism is introduced in the encoder structure, which can evaluate the trend information of the time series before the features enter the multi-head attention processing, which is used to learn the long-term temporal dependency of the time series. Then, the model uses a feedforward neural network for feature encoding. Finally, the prediction results are mapped out through the output layer.
[0060] Traditional Transformer models usually treat multiple variable features at a moment as vectors, which cannot well extract the long-term temporal relationship of the current. The transposed embedding layer introduced in the present invention maps the entire time series of the same current transformer into a high-dimensional feature representation, thereby independently characterizing the entire historical process of the current transformer.
[0061] For long time series prediction problems, the key goal is to extract nonlinear relationships from historical data. Most of the previous work is to improve the original multi-head attention mechanism, such as compressing the attention structure and only selecting attention in specific areas. The present invention does not change the internal structure of the multi-head attention mechanism, but constructs a gated network structure for feature pre-extraction before the features are input into the attention structure, and combines it with the original multi-head attention mechanism to form a gated attention network. Since the original network structure is not improved, it is more time-saving and labor-saving in model construction and training, and the gated part can be used as a universal plug-in before the multi-head attention mechanism.
[0062] Transformer uses feedforward neural networks as the basic building blocks for encoding vector representation. The vectors formed in traditional models are features of multiple variables collected at the same time, which makes it difficult to reflect the semantic information of a time series. The transposed embedding layer introduced in the present invention maps a time series of a variable into a vector, and can perform the same linear operations on independent time series. The neurons in the linear layer can also learn the intrinsic properties of the time series, such as frequency spectrum, periodicity, amplitude, etc. Therefore, the use of feedforward neural networks can make the model generalize better.
[0063] Based on the above advantages, the GatedFormer prediction model can be used to predict the standard value of the current transformer, and accurate results can be obtained. The standard current value can be obtained without setting a standard current transformer, thereby realizing online monitoring of the current transformer error without a standard current transformer.
[0064] See also Figure 2 As shown, Figure 2 : is a flow chart of a current transformer standard value prediction method based on gated attention provided by an embodiment of the present invention, the method comprising:
[0065] S1, obtaining the time series data of the secondary side of multiple current transformers;
[0066] S2, processes the time series data through the transposed embedding layer to obtain high-dimensional features;
[0067] S3, extracts high-dimensional features through the gated attention network to obtain temporal trend features;
[0068] S4, encoding the time series trend features through a feedforward neural network to obtain encoded features;
[0069] S5, the encoded features are processed through the output layer to obtain the predicted standard current value of the current transformer.
[0070] The timing data of the secondary side of multiple current transformers can be obtained by real-time collection of distributed current data on the secondary side of multiple current transformers through an acquisition platform. The acquisition platform collects and stores the distributed current data in real time, and organizes it to obtain a distributed current data set. The distributed current data set includes the secondary side current value, voltage value, frequency and other information of the three phases of each circuit actually collected.
[0071] Considering that the sampling interval of distributed current data is generally 15 minutes, when processing time series data, the time span of the historical window is set first, and the data in a historical window is formed into a time series data according to the acquisition time sequence. For example, the time span of one day, two days, four days and seven days is set, and there are four types of historical windows, including 96, 192, 384 and 672 data points respectively.
[0072] When training the model, the time series data of historical windows with different time spans are used as training samples to train the GatedFormer model. On this basis, the GatedFormer model can effectively capture the long- and short-term time series characteristics within the window. In addition, multiple prediction periods are configured, and prediction windows with different time spans are defined to predict the secondary side standard current transformer values at future moments. For example, 12, 24, 48, and 96 time units correspond to the prediction of current standard value data for the next 12 hours, one day, two days, and four days, respectively. The GatedFormer model is trained separately through different historical windows and prediction windows to improve its ability to capture long and short time series, as well as output with multiple prediction durations.
[0073] When making predictions, the input of the Gatedformer model is the current data of each node within a given time interval, which is used to make predictions. Assume that the input time period is the historical current value of P moments, expressed as: X = X t-P+1 ,X t-P+2 ,...,X t , X t ∈R P×N , where N represents the current data of N current transformers detected at that moment. Assuming that the output is the predicted current data at Q moments, it is expressed as: Y = X t+1 ,X t+2 ,...,X t+Q The time series prediction algorithm f can accurately predict Y based on X, and evaluate the model prediction performance by comparing the error between the predicted value Y and the true current standard value. The prediction algorithm can be simply expressed as follows.
[0074] X t+1 ,X t+2 ,...,X t+Q =f(X t-P+1 ,X t-P+2 ,...,X t )
[0075] In step S2, the transposed embedding layer maps the entire time series of the same current transformer into a high-dimensional feature representation, which can be seen in Figure 3 Schematic diagram of the transposed embedding process shown.
[0076] In one embodiment, the transposed embedding layer uses a mapping layer and a linear layer, the mapping layer is used to perform transposition mapping on the input features, and the linear layer is used to increase the dimension of the input features. The specific process of processing the time series data through the transposed embedding layer to obtain high-dimensional features is shown as follows.
[0077] First, the time series data is mapped through the mapping layer to obtain the transposed features, which are expressed as follows:
[0078] X∈R P×N →X∈R N×P
[0079] Where X is the input time series data, X = X t-P+1 ,X t-P+2 ,...,X t , P is the number of data points, N is the number of current transformers, that is, the secondary side timing data of N current transformers are input.
[0080] Then, the transposed features are dimensionally increased through the linear layer, represented by D, to obtain high-dimensional features, which are expressed as follows:
[0081] X∈R N×P →X′∈R N×D
[0082] In one embodiment, the input time series data X may not only be current data, but also include voltage data and frequency data on the secondary side. Since the collector may cause collection errors, multi-dimensional data can improve the reliability of prediction.
[0083] In step S3, the high-dimensional features are first filtered through the gated network in the gated attention network, and then input into the multi-head attention mechanism to finally learn the trend characteristics of the input time series data.
[0084] See also Figure 4 As shown, Figure 4 This is a block diagram of the gated attention network. The module uses two convolutional layers as filters and gate structures, including a first convolutional input layer, a first activation layer connected to the first convolutional input layer, a second convolutional input layer, a second activation layer connected to the second convolutional input layer, and a feature fusion layer. The output features of the feature fusion layer are used as input features of the multi-head attention mechanism.
[0085] The first convolution input layer and the first activation layer serve as the filter structure of the gated network. The high-dimensional features are first convolved through the first convolution input layer to obtain the first convolution features, and then the first activation layer performs the first activation processing on the first convolution features to obtain the first activation features.
[0086] The second convolution input layer and the second activation layer serve as the gate structure of the gated network. The high-dimensional features are first convolved through the second convolution input layer to obtain the second convolution features, and then the second convolution features are processed through the second activation layer to obtain the second activation features.
[0087] Then, the first activation feature and the second activation feature are subjected to feature fusion processing through the feature fusion layer of the gated network to obtain a fused feature. Finally, the fused feature is used as the input feature of the multi-head attention mechanism, and the fused feature is processed by the multi-head attention mechanism to obtain a time series trend feature. Since the improvement of the present invention is to add a gated network before the existing multi-head attention mechanism, the processing performed in the multi-head attention mechanism is the same as the existing method, and this part is only briefly introduced.
[0088] The nonlinear relationship of the current value in the time series is obtained through the first activation layer and the second activation layer. Since the input with the time series as the vector feature is formed in the previous transposed embedding layer, the gated attention mechanism can capture the trend characteristics of the current transformer in the time series.
[0089] In one implementation, the first activation layer may use a tanh activation function, and the second activation layer may use a sigmoid activation function. Taking this structure as an example, the processing in the gated attention network may specifically include the following contents.
[0090] (1) The processing definition of the filter module is as follows:
[0091] filter = tanh(convs1(X′))
[0092] Among them, X′ represents the high-dimensional features obtained after the transposed embedding layer processing, convs1() represents the first convolution processing, and tanh() represents the first activation processing.
[0093] (2) The processing definition of the gate control module is as follows:
[0094] gate = sigmoid(convs2(X′))
[0095] Among them, X′ represents the high-dimensional features obtained after the transposed embedding layer processing, convs2() represents the second convolution processing, and sigmoid() represents the second activation processing.
[0096] (3) The output of the final gating network is expressed as:
[0097] X gate =filter⊙gate
[0098] Among them, X gate It represents the input vector of the multi-head attention mechanism after passing through the gated network structure. ⊙ represents the fusion processing, where two vectors are multiplied for fusion.
[0099] (4) The processing definition of the multi-head attention mechanism is as follows:
[0100] Q=X gate W Q
[0101] K=X gate W K
[0102] V=X gate W V
[0103] Among them, Q, K, V are the three input representation vectors used in the multi-head attention mechanism, and W Q , W K , W V is the corresponding learnable parameter, and the attention score is obtained through matrix operation. The attention score is expressed as follows.
[0104]
[0105] Among them, d h Represents vector X gate Dimension, (K) T is the transpose of vector K, and softmax() is the activation function.
[0106] Finally, the output of the gated attention network is: Z = AV.
[0107] In the original Transformer model, a feedforward neural network is used as the basic building block for encoding vector representation. The present invention still adopts this setting for vector encoding. Moreover, due to the transposed embedding layer introduced before, each time series data is mapped into a high-dimensional feature, so that the feedforward neural network can learn the intrinsic properties of the time series, thereby improving the generalization of the model.
[0108] In this solution, the feedforward neural network is essentially a linear layer, so a linear layer can be used, or a fully connected layer (MLP) can be directly used to implement it.
[0109] In order to avoid the consequences of error accumulation in step-by-step prediction, a linear projection layer can be used in the output layer to directly output multiple prediction moments in the future. This multi-step prediction method can significantly reduce the accumulation of prediction errors.
[0110] In one embodiment, in order to improve the stability and convergence of model training, layer normalization is introduced between the gated attention network and the feedforward neural network, and between the feedforward neural network and the output layer, such as Figure 5 The figure shows the block diagram of the Gatedformer model structure after the introduction of layer normalization. The results of previous transformers using layer normalization will lead to a uniform distribution between variables, reducing the differences between variables. Once the collected time points are not aligned in time, the operation will also introduce interaction noise between non-causal or delayed processes. However, since this scheme introduces the idea of transposition in the embedding layer, the time series of the current of each current transformer is used as a vector. Since the current values of the same node are definitely highly correlated, the use of layer normalization can effectively process the transposed vector. In addition, since all sequences as variables are normalized to a normal distribution, the differences caused by inconsistent measurements can be reduced. In contrast, in the previous architecture, different time step markers will be normalized, resulting in excessive smoothing of the sequence.
[0111] The second aspect of the present invention also provides a training method for the GatedFormer model, the model structure refers to Figure 1 and Figure 5As shown in the figure, the training data is obtained from the distributed current data set of the secondary side of the multi-channel current transformer collected in real time by the acquisition platform. The time series values of the secondary side current data, voltage data and frequency data are used as the model input. The input time series is the historical time series, and the predicted time series is the future time series. Therefore, the future time series corresponding to the input time series is used as the prediction target to iteratively train the model. On this basis, the historical time series data of different time windows and the corresponding predicted time series data of different time windows are intercepted to train the model's ability to capture the characteristics of long-term and short-term time series, as well as the ability to output the predicted sequence of the unpredictable time window.
[0112] The third aspect of the present invention provides a method for online monitoring of current transformer errors based on gated attention, which specifically comprises: calculating the actual value and standard value of the current transformer at the corresponding time node to obtain the error of the current transformer.
[0113] It can be understood that the online monitoring of the current transformer error is a real-time monitoring process. The standard current value prediction method of the current transformer based on the GatedFormer model provided by the present invention predicts the standard current value for a period of time in the future, and the error is calculated at the corresponding time node with the actual value of the current transformer collected in real time, and the error is evaluated by the difference ratio method. Since the GatedFormer model can accurately predict the standard current value, it can also obtain accurate error monitoring results when applied to error monitoring. The advantages of the GatedFormer model have been detailed in the aforementioned embodiments, and its accuracy does not need to be emphasized here.
[0114] In addition, when performing error monitoring, the prediction of future standard current values will also be a real-time and continuous process, constantly acquiring historical data from the previous P moments, predicting the standard current value of the future Q moments from the current moment, and through continuous prediction, the current standard value of the future moment is also updated in real time, thereby eliminating the influence of time variables on the predicted value.
[0115] In a fourth aspect of the present invention, a current transformer standard current value prediction device based on gated attention is provided, the device comprising a data acquisition module and a standard value prediction module. The data acquisition module is used to acquire the time series data of the secondary side of multiple current transformers, and the standard value prediction module is used to predict the standard value of the current transformer.
[0116] The data acquisition module can directly interact with the power collection platform, directly acquire distributed current data, and perform corresponding data processing to obtain time series data for input into the standard value prediction module. The processing requirements and methods for time series data can be found in the aforementioned embodiments.
[0117] The standard value prediction module is to predict the standard current value through the GatedFormer model established in the present invention and its corresponding method. Specifically, the standard value prediction module includes a transposed embedding layer, a gated attention network, a feedforward neural network and an output layer. The transposed embedding layer is used to process the time series data to obtain high-dimensional features; the gated attention network is used to extract features from the high-dimensional features to obtain time series trend features; the feedforward neural network is used to encode the time series trend features to obtain encoded features; the output layer is used to process the encoded features to obtain the predicted standard value of the current transformer.
[0118] In one embodiment, the standard value prediction module also includes a first normalization layer and a second normalization layer. The first normalization layer is connected between the gated attention network and the feedforward neural network, and is used to perform layer normalization processing on the time series trend features. The second normalization layer is connected between the feedforward neural network and the output layer, and is used to perform layer normalization processing on the encoding features.
[0119] In addition, in order to verify the effect of the Gatedformer model on the online monitoring of current transformers, this paper uses the state evaluation system data set provided by the CT metering performance evaluation function detection platform to conduct experiments. The data set includes one input and two output currents of current transformer A, the rated primary current of the outgoing branch is 100A, and the rated primary current of the incoming branch is 200A, which means that there are three current characteristics at each time point. The experimental platform simulates the sampling frequency of once every 15 minutes, with a total of 70,078 standard current value data for two years, assuming that the actual current load of a collection interval remains unchanged (that is, the current error is at the same percentage value). At the same time, this paper selects RMSE, MSE, and MAPE as comprehensive evaluation indicators of model performance. The following is a brief introduction to the experimental process and experimental results.
[0120] 1. Experimental setup
[0121] The graphics card configuration of this experiment is NVIDIA GeForce GTX 1080Ti, the video memory size is 12GB, the programming language is Python3.9, the framework is Pytorch1.7.1, and the experimental test is carried out on the Linux system. The main hyperparameters in the Gatedformer model are the historical time period P, the predicted future time period Q, the number of model stacking blocks M, and the high-level dimension embedding D of the input X. In this paper, P is set to 672, which contains a full week of historical current data, allowing the model to learn daily and weekly cycle information; Q is set to four values: 12, 24, 48, and 96, which can better verify the accuracy of the model for future predictions; M is set to 3, and D is set to 1024. After verification, this design can make the model perform best; the epoch of the model is set to 10 and the batchsize is 128. Measuring the prediction accuracy of a model requires analysis of multiple evaluation indicators. Therefore, this paper selects three indicators: mean square error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) to comprehensively evaluate the performance of the model. The formula is as follows:
[0122]
[0123]
[0124] Among them, n is the number of samples, y i is the true value, is the model's predicted value.
[0125] 2. Comparison of Baseline Models
[0126] Since there are almost no similar solutions in China that use the Transformer model to solve current transformer prediction problems, this paper selects models that currently perform well in the field of time series prediction for comparison, in order to verify that the model proposed in this paper can best adapt to our task of online prediction of current transformers.
[0127] In the experimental results section, the Gatedformer model proposed in this invention is compared in detail with classic and most advanced time series prediction models such as Autoformer, FiLM, FEDforme, Dlinear, Reformer, Informer, NonstationaryTransformer, Transformer, TiDE, PatchTST, Pyraformer, LightTS, Crossformer, Times Net, etc. under different prediction windows (12, 24, 48, 96), with 15 minutes as a time point, that is, the current value of the current transformer can be predicted at most for one day in the future.
[0128] The experimental results are shown in Table 1, which lists the performance of each model in terms of performance indicators such as mean square error (MSE), mean absolute error (MAE) and mean absolute percentage error (MAPE), which further verifies the excellent performance of Gatedformer in the current prediction task in current transformers.
[0129] It can be found that the dependence of previous models on long time series and the volatility of long-term predictions may pose certain challenges. In particular, the TimesNet model performs well in public datasets, but its performance drops significantly when predicting longer windows (such as 24, 48, and 96). In contrast, our proposed model maintains stability when predicting the next 96 windows, highlighting the robustness of Gatedformer in long-time series prediction, which helps to detect the current value of current transformers more accurately. In addition, under longer prediction windows (48 and 96), the MSE and MAE of Gatedformer are significantly lower than those of other models, demonstrating its excellent performance in modeling long-term time series data. This result once again confirms the superiority of Gatedformer in the current prediction task in current transformers. The final results show that when the Gatedformer-based current transformer online monitoring method is used to predict the current value of the previous week as a historical window, the model's prediction error for the standard current value of the current transformer is only 0.090%. This result once again highlights the efficiency and accuracy of Gatedformer in processing time series prediction tasks, provides a reliable solution for online monitoring of current transformers, and further verifies the effectiveness and reliability of this method in practical applications.
[0130] Table 1 Comparison of MSE, MAE and MAPE indicators of each prediction model
[0131]
[0132]
[0133] (III) Comparison of ablation experiments
[0134] In the ablation experiment, the advantages of the Gatedformer model in capturing long-term dependencies were verified, and the impact of the gating mechanism on the model performance was explored. We selected multiple past time series windows 96, 192, 384, and 672 for comparison, that is, using the current value of the current transformer in the past week to predict the current value of the next day. The results in Table 2 show the performance of the model with and without the gating network. By comparing different time windows, it can be observed that the Gatedformer model performs best in long-term prediction intervals. Specifically, when the prediction window is 672 time intervals, that is, the time span of one week of current values, the prediction effect of Gatedformer is the best, which shows that the model can well learn the periodic information of the current transformer current value of one week. In all time windows, the Gatedformer model using the gated network showed better performance, which shows that the gated network is significantly helpful in extracting long-term series dependencies, thereby improving the prediction ability of the model.
[0135] In terms of performance indicators, the Gatedformer using the gated network shows lower mean square error (MSE), mean absolute error (MAE) and mean absolute percentage error (MAPE) in all time windows. Taking the prediction window of 672 as an example, the MSE of the Gatedformer using the gated network is 0.0023, the MAE is 0.0377, and the MAPE is 0.0839, while the corresponding values without the gated network are 0.0024, 0.0390 and 0.0866 respectively. Intuitively, this module can reduce the prediction error of the current standard value by 3.22%. This result further verifies the role of the gated network in improving the performance of the Gatedformer model.
[0136] Table 2 Comparison of MSE, MAE, and MAPE indicators of prediction models with and without gating networks
[0137]
[0138]
[0139] In summary, the ablation experiment results fully verify the advantages of the Gatedformer model in capturing long-term dependencies and processing long-time span data, and highlight the importance of the gating mechanism for model performance. This finding further consolidates the reliability and effectiveness of Gatedformer in time series prediction tasks, especially in the field of online monitoring of current transformers, where its introduction can well predict virtual standard values and improve the monitoring accuracy and stability of the system.
[0140] A fifth aspect of the present invention provides an electronic device, such as Figure 6 As shown, Figure 6 FIG. 1 is a schematic diagram of the structure of an electronic device of the present invention, wherein the electronic device comprises a processor 60, a memory 61, an input device 62, an output device 63 and a communication device 66; the number of processors 60 in the computer device can be one or more. Figure 6 The processor 60, the memory 61, the input device 62 and the output device 63 in the electronic device can be connected by a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0141] The memory 61 is a computer-readable storage medium that can be used to store software programs, computer executable programs and modules. The processor 60 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 61, so as to implement the standard value prediction method of the current transformer of any embodiment of the present invention, and / or the error online monitoring method of the current transformer of any embodiment.
[0142] The memory 61 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 61 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 61 may further include a memory remotely arranged relative to the processor 60, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0143] The input device 62 may be used to receive user ID, instructions, current transformer related data, etc., and the output device 63 may be used to output prediction results, network distribution pages, etc.
[0144] In a sixth aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the method for predicting the standard value of a current transformer of any of the above embodiments of the present invention and / or the method for online monitoring the error of a current transformer of any of the embodiments are implemented. The storage medium may be a ROM / RAM, a magnetic disk, an optical disk, etc.
[0145] In the seventh aspect of the present invention, a computer program product is provided. When the computer program product is run on a computer, the computer executes the standard value prediction method of the current transformer of any of the above-mentioned embodiments of the present invention, and / or the online error monitoring method of the current transformer of any of the embodiments.
[0146] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting a standard current value of a current transformer, characterized in that: include: Obtaining the timing data of the secondary side of multiple current transformers; Processing the time series data through a transposed embedding layer to obtain high-dimensional features; Extracting the high-dimensional features through a gated network to obtain time series trend features; Encoding the time series trend feature through a feedforward neural network to obtain an encoded feature; The encoding features are processed through the output layer to obtain the predicted standard current value of the current transformer.
2. The method for predicting the standard current value of a current transformer according to claim 1, characterized in that: The transposed embedding layer includes a mapping layer and a linear layer; the time series data is processed by the transposed embedding layer to obtain high-dimensional features, including: Mapping the time series data through the mapping layer to obtain transposed features; The transposed features are subjected to dimensionality-increasing processing through the linear layer to obtain high-dimensional features.
3. The method for predicting the standard current value of a current transformer according to claim 1, characterized in that: The gated attention network includes a gated network and a multi-head attention mechanism, wherein the gated network includes a first convolution input layer, a first activation layer connected to the first convolution input layer, a second convolution input layer, a second activation layer connected to the second convolution input layer, and a feature fusion layer; The high-dimensional features are extracted through a gated attention network to obtain time series trend features, including: Performing a first convolution process on the high-dimensional feature through the first convolution input layer to obtain a first convolution feature, and performing a first activation process on the first convolution feature through the first activation layer to obtain a first activation feature; and Performing a second convolution processing on the high-dimensional feature through the second convolution input layer to obtain a second convolution feature, and performing a second activation processing on the second convolution feature through the second activation layer to obtain a second activation feature; Performing feature fusion processing on the first activation feature and the second activation feature through the feature fusion layer to obtain a fusion feature; The fusion features are processed through the multi-head attention mechanism to obtain time series trend features.
4. The method for predicting the standard current value of a current transformer according to claim 3, characterized in that: The method further comprises: Before encoding the time series trend feature by the feedforward neural network to obtain the encoded feature, performing layer normalization processing on the time series trend feature; and / or, Before the encoding feature is processed through the output layer to obtain the predicted standard current value of the current transformer, the encoding feature is subjected to layer normalization processing.
5. The method for predicting the standard current value of a current transformer according to claim 1, characterized in that: The output layer is a linear projection layer.
6. The method for predicting the standard current value of a current transformer according to any one of claims 1 to 5, characterized in that: The time series data includes current time series data, voltage time series data and frequency time series data.
7. A method for online monitoring of current transformer errors, characterized in that: include: Calculate the actual value and standard value of the current transformer at the corresponding time node to obtain the error of the current transformer; The standard value is obtained by the standard current value prediction method of the current transformer described in any one of claims 1-6.
8. A device for predicting the standard current value of a current transformer, characterized in that: include: A data acquisition module, used to acquire time series data of the secondary side of multiple current transformers; A standard value prediction module, used to predict the standard value of the current transformer; The standard value prediction module includes a transposed embedding layer, a gated attention network, a feedforward neural network and an output layer; The transposed embedding layer is used to process the time series data to obtain high-dimensional features; The gated attention network is used to extract features from the high-dimensional features to obtain time series trend features; The feedforward neural network is used to encode the time series trend feature to obtain the encoded feature; The output layer is used to process the encoding features to obtain the predicted standard value of the current transformer.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the standard current value prediction method of the current transformer described in any one of claims 1 to 6 and / or the error online monitoring method of the current transformer described in claim 7 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 standard current value prediction method of the current transformer described in any one of claims 1 to 6 and / or the error online monitoring method of the current transformer described in claim 7 are implemented.
Citation Information
Patent Citations
Current transformer hidden fault diagnosis early warning method and system
CN114282608A
Gated attention neural network
CN114424208A
Time sequence prediction method based on differential fusion Transform
CN114841072A
Traffic flow prediction method based on long-term and short-term Transform model
CN115545152A
Transformer comprehensive analysis method and device, terminal and storage medium
CN115932657A
Cited By
Real-time fault detection method for Tokamak magnetic probe
CN119471534A
A real-time fault detection method for tokamak magnetic probes
CN119471534B
Multi-node combined prediction method for current transformer
CN122570968A
