Method, system, equipment and medium for fault diagnosis of main network relay protection device
By preprocessing the data of the main grid relay protection device and modeling the self-attention mechanism, high-accuracy, anti-interference and real-time fault diagnosis is achieved, solving the problems of inaccurate fault diagnosis and insufficient anti-interference capability in the existing technology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies for main grid relay protection devices suffer from low fault diagnosis accuracy, insufficient anti-interference capability, and poor real-time performance.
The initial operating data of the relay protection device is collected, preprocessed to form a standardized time-series input matrix, multi-dimensional physical features and event features are extracted, global dependency modeling is performed through a self-attention mechanism, and fault type classification, tripping action prediction and fault location diagnosis are performed.
It improves the accuracy and anti-interference ability of fault diagnosis, enhances real-time performance, and strengthens the ability to characterize complex fault modes.
Smart Images

Figure CN121834513A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power system relay protection and fault diagnosis, and particularly relates to a method, system, device and medium for fault diagnosis of a main grid relay protection device. BACKGROUND
[0002] The main grid relay protection device is an important part of the operation of the power system, and its main function is to monitor the current, voltage, power and other electrical quantities in real time, and to quickly and reliably send a protection action signal when a fault occurs, so as to ensure the safe and stable operation of the power grid. The traditional relay protection device is mostly based on fixed threshold, phasor comparison or impedance circle criterion method, which has high calculation efficiency, but when facing multi-source disturbance, nonlinear noise and complex working conditions, it is easy to misjudge or refuse to act. With the expansion of the scale of the power system and the large-scale access of renewable energy, the operation environment of the power system is more complex, and the fault signal shows the characteristics of multi-dimension, non-stationary and strong noise. The traditional protection method is difficult to fully extract the time sequence correlation and global characteristics of the signal, thereby limiting the accuracy and generalization ability of fault diagnosis.
[0003] In recent years, deep learning methods have been gradually applied to fault identification and state estimation of the power system. The long short-term memory network can capture the dynamic characteristics of time series data, and the multi-head self-attention mechanism can describe the global dependence relationship between different positions in the sequence. However, existing researches mostly stay in theoretical simulation or local experiments, and lack of systematic method design for the actual application of the main grid relay protection device. SUMMARY
[0004] In view of the above problems, the present application is proposed.
[0005] Therefore, the technical problem solved by the present application is that the fault diagnosis accuracy is not high, the anti-interference ability is insufficient, and the real-time performance is poor in the prior art.
[0006] To solve the above technical problems, the present application provides the following technical scheme: a method for fault diagnosis of a main grid relay protection device, comprising, Collecting initial operation data of the relay protection device, preprocessing the initial operation data to form a standardized time sequence input matrix; Based on the standardized time sequence input matrix, multi-dimensional physical features and event features are extracted, feature fusion is performed, and the fused features are mapped into a low-dimensional embedding sequence; The low-dimensional embedding sequence is modeled by using a self-attention mechanism to extract time sequence dynamic features, and fault type classification, trip action prediction and fault location diagnosis are performed.
[0007] As a preferred scheme of the method for fault diagnosis of a main grid relay protection device, the method comprises the following steps: Collecting multi-source electrical quantity signals and auxiliary state signals in the operation of the main grid relay protection device, and outputting initial operation data; Windowing and slicing the initial operation data, and dividing time segments according to a fixed length; Standardizing the electrical quantity signals of the time segments to obtain a standardized time sequence input matrix.
[0008] As a preferred scheme of the method for fault diagnosis of a main grid relay protection device, the method comprises the following steps: Based on the standardized time sequence input matrix, multi-scale physical features are extracted, and an event feature vector is constructed; The multi-scale physical features and the event feature vector are spliced to form a unified multi-dimensional fusion feature vector; The fusion feature vector is mapped to a low-dimensional space, a sinusoidal position code and an event embedding vector are added, and a low-dimensional embedding sequence is generated.
[0009] As a preferred scheme of the method for fault diagnosis of a main grid relay protection device, the method comprises the following steps: The multi-head self-attention mechanism is used to model the global dependence of the low-dimensional embedding sequence, and a sequence representation with global context awareness is outputted; Based on the sequence representation with global context awareness, local dynamic features and long-term dependencies of the sequence are extracted, and a time sequence feature representation is obtained; Based on the time sequence feature representation, fault type classification, trip action prediction and fault location diagnosis are performed, a loss function is used for joint optimization, and a final diagnosis result is outputted.
[0010] As a preferred scheme of the method for fault diagnosis of a main grid relay protection device, the method comprises the following steps: Comprehensive feature extraction is performed on the electrical quantity signals of each time segment, and the expression is as follows: In the formula, The total active power in time segment t. These represent the real and imaginary parts of the complex number, respectively. Let be the instantaneous voltage value of phase p at time t. Let be the conjugate complex number of the current phasor of the p-th phase at time t. The total reactive power in time segment t. Let c be the root mean square value of the electrical quantity. The total number of sampling points. Let be the sampled value of the c-th signal at discrete time point n. For signal At angular frequency Complex phasors at that location, For window functions, Let c be the instantaneous value of the electrical quantity at sampling point n. It is a complex exponential function.
[0011] As a preferred embodiment of the fault diagnosis method for a main grid relay protection device according to the present invention, the step of performing global dependency modeling of the low-dimensional embedded sequence using a multi-head self-attention mechanism includes, To compute self-attention, for an embedded sequence, first compute the query, key, and value matrix, expressed as: in, , , These are the query, key, and value matrices, respectively. For embedded sequences, , , These are trainable weight matrices for the query, key, and value, respectively. The expression for attention score is: in, Let be the output matrix of the self-attention function. The softmax normalization function is... , , These are the query, key, and value matrices, respectively. This is the scaling factor.
[0012] The application can directly capture and model global dependency between all elements in the input sequence by introducing a multi-head self-attention mechanism to process the low-dimensional embedding sequence, break through the limitation of traditional recurrent or convolutional neural networks in long-distance dependency modeling, and improve the extraction ability and discrimination precision of the model on complex and non-local fault features by parallel computing attention scores and weighted aggregation.
[0013] As a preferred scheme of the method for fault diagnosis of a main network relay protection device, the method comprises the following steps: The output calculation formula is: wherein, is the prediction output of the fault type classification, is a softmax normalization function, is a weight matrix of the classification head, is an input feature vector, is a bias term of the classification head, is the prediction output of the protection action, is a Sigmoid activation function, is a weight matrix of the action prediction head, is a bias term of the action prediction head, is the prediction output of the fault location, is a weight matrix of the location regression head, is a bias term of the location regression head. The overall loss is a weighted sum of multi-task losses, and the expression is: wherein, is an overall multi-task loss function, , , are respectively first, second and third hyperparameters, is a loss of the fault type classification task, is a loss of the protection action prediction task, is a loss of the fault location regression task.
[0014] By constructing a multi-task joint optimization framework including fault type classification, protection action prediction and fault location regression, the application balances the optimization objectives and convergence speed of each task by using a weighted sum loss function, improves the generality and discrimination of feature representation, and avoids the possible one-sidedness of features in a single task model.
[0015] The application provides a system for fault diagnosis of a main grid relay protection device.
[0016] To solve the above technical problems, the application provides the following technical scheme: a system for fault diagnosis of a main grid relay protection device, comprising a data acquisition and preprocessing module, a feature extraction module and a prediction and diagnosis module, The data acquisition and preprocessing module acquires initial operation data of the relay protection device, pre-processes the initial operation data and forms a standardized time sequence input matrix. The feature extraction module extracts multi-dimensional physical features and event features based on the standardized time sequence input matrix, performs feature fusion and maps the fused features into a low-dimensional embedding sequence. The prediction and diagnosis module uses a self-attention mechanism to model global dependency relationships of the low-dimensional embedding sequence, extracts time sequence dynamic features, performs fault type classification, trip action prediction and fault location diagnosis.
[0017] The application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method for fault diagnosis of a main grid relay protection device when executing the computer program.
[0018] The application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the method for fault diagnosis of a main grid relay protection device when executed by a processor.
[0019] The application has the following beneficial effects: by acquiring and standardizing and pre-processing multi-source electrical signals to form a time sequence input matrix, then extracting and fusing multi-scale physical features and event features and mapping them into a low-dimensional embedding sequence, introducing a self-attention mechanism to model global dependency relationships of the sequence to extract time sequence dynamic features, and finally synchronously realizing fault type classification, trip action prediction and fault location diagnosis through a multi-task joint optimization mechanism, the signal processing, feature engineering and deep learning modeling are integrated, the representation ability for complex fault modes is enhanced through global context perception and local dynamic feature extraction, the comprehensiveness and synergy of diagnosis are improved, and the problems of low fault diagnosis accuracy, insufficient anti-interference ability and poor real-time performance in the prior art are solved. BRIEF DESCRIPTION OF DRAWINGS
[0020] To more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0021] Figure 1 A general flowchart of a method for fault diagnosis of a main grid relay protection device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.
[0023] Embodiment 1, refer to Figure 1 For an embodiment of the present application, the embodiment provides a method for fault diagnosis of a main grid relay protection device, comprising: In order to solve the problems of low accuracy, insufficient anti-interference ability and poor real-time performance of fault diagnosis in the prior art, the present application provides a method for fault diagnosis of a main grid relay protection device.
[0024] S1: collecting initial operation data of the relay protection device, preprocessing the initial operation data to form a standardized time sequence input matrix; S2: based on the standardized time sequence input matrix, extracting multi-dimensional physical features and event features, performing feature fusion, and mapping the fused features into a low-dimensional embedding sequence; S3: using a self-attention mechanism to model the global dependency relationship of the low-dimensional embedding sequence, extracting time sequence dynamic features, and performing fault type classification, trip action prediction and fault location diagnosis.
[0025] Therefore, through standardized preprocessing, the original multi-source heterogeneous data is converted into regular time sequence input, the key information is fused and extracted from multi-scale physical features and event features, and the embedding process is dimensionally reduced, which effectively condenses the fault representation. The self-attention mechanism is introduced to globally model the time sequence embedding, which can capture the complex long-distance dependency relationship in the signal, and based on the unified framework, the three core tasks of fault type discrimination, action behavior prediction and location positioning are simultaneously completed. Form a chain from data regularization, feature optimization to intelligent diagnosis. Through the collaborative design of each step, the comprehensive analysis ability, anti-interference ability and overall accuracy of the diagnosis model for complex fault patterns are improved.
[0026] Embodiment 2, for an embodiment of the present application, based on the previous embodiment, a method for fault diagnosis of a main grid relay protection device is provided, comprising: In the embodiments of the present application, the initial operation data of the relay protection device is collected in step S1, and the initial operation data is preprocessed to form a standardized time sequence input matrix, including A1-A3: A1: Collecting multi-source electrical quantity signals and auxiliary state signals of the main network relay protection device in operation, and outputting initial operation data.
[0027] Collecting multi-source electrical quantity signals obtained by the main network relay protection device during operation, with a sampling frequency of fs. The collected signals include: three-phase currents , three-phase voltages , active power P, reactive power Q, and auxiliary state signals such as trip flag, SOE, and self-test signals of the protection device. These state signals are recorded in an event-driven manner and are strictly synchronized with the electrical quantity signals through timestamps, ensuring the temporal consistency of the data. The raw data is stored in the form of time series to form a structured data set , where is the input signal sequence of the ith sample, is the corresponding multi-label information (including fault type, action state, and fault location).
[0028] The raw data matrix is represented as: where each row represents all channel data vectors at a sampling time, , is the total number of sampling points, and C is the total number of signal channels, including electrical quantity channels and state signal channels.
[0029] A2: Windowing and slicing the initial operation data, and dividing the time segments by a fixed length.
[0030] The continuously collected signal sequence is sliced into multiple time segments with clear time boundaries by a fixed window length . Each time segment contains sampling points, ensuring that each window can completely capture the key electrical characteristics during fault occurrence.
[0031] A3: Standardizing the electrical quantity signals of the time segments to obtain a standardized time sequence input matrix.
[0032] The electrical quantity signals of each time segment are standardized by Z-score, making the mean of each channel data 0 and the variance 1, and eliminating the dimensional influence between different physical quantities.
[0033] For internal state signals (such as SOE records), binarization or min-max normalization methods are used for processing to ensure that all input features are in a similar numerical range.
[0034] After preprocessing, the standardized time sequence input matrix is obtained , where L is the number of time steps (L=N), and C is the total number of signal channels.
[0035] To meet the requirements of batch training, multiple time segments are organized into batches: wherein, is the batch input data tensor, is the b-th sample, is the batch size, is the signal sequence with a fixed window length, and C is the total number of signal channels.
[0036] In the embodiments of the present application, the Z-score standardization processing is specifically used for the standardization processing of the electrical quantity signal of the time segment in step A3: For the signal of the k-th channel , the standardization calculation formula is: wherein, is the preprocessed signal, and are the sample mean and standard deviation of the channel signal on the training set, respectively, is the signal of the k-th channel.
[0037] In an alternative embodiment, the normalization processing based on interval mapping can also be used for the standardization processing of the electrical quantity signal of the time segment in step A3. The minimum value and the maximum value of the electrical quantity signal of the channel in the current time segment are counted, and all are compressed to a preset unified interval (for example, compressed to the range of 0-1).
[0038] In another alternative embodiment, the standardization processing based on median centering and robust scale can also be used for the standardization processing of the electrical quantity signal of the time segment in step A3. The median level of the electrical quantity signal in the current time segment is calculated, and the level is used as the center reference for the translation processing of the sampling data. Subsequently, the dispersion degree of the signal in the main concentrated interval is taken as the scale basis for the amplitude scaling processing of the data, so that the signal tends to be stable in numerical distribution.
[0039] In the embodiments of the present application, the electrical quantity signals of the time segments in step A3 are standardized, and the mean value zero and variance normalization are performed on each signal channel respectively, so as to eliminate the numerical differences caused by different electrical quantity dimensions and inherent offsets.
[0040] In the embodiments of the present application, in step S2, based on the standardized time sequence input matrix, multi-dimensional physical features and event features are extracted, feature fusion is performed, and the fused features are mapped into a low-dimensional embedding sequence, including B1-B3: B1: Based on the standardized time sequence input matrix, multi-scale physical features are extracted, and an event feature vector is constructed.
[0041] The SOE record and self-check signal of the protection device are converted into a structured feature vector: the SOE signal is encoded by a time stamp sequence, to generate event count statistical features and one-hot encoding features; the self-check signal is represented as a multi-dimensional binary vector, which directly reflects the health state and working state of each module of the device.
[0042] B2: The multi-scale physical features and the event feature vector are spliced to form a unified multi-dimensional fusion feature vector.
[0043] The physical features and the event features are spliced in the feature dimension to form a unified multi-dimensional feature vector , wherein is the dimension of the fused features, and L is the length of the time sequence B3: The fused feature vector is mapped into a low-dimensional space, a sinusoidal position encoding and an event embedding vector are added, and a low-dimensional embedding sequence is generated.
[0044] The feature vector F is projected into a low-dimensional space through a full connection layer, to obtain an embedding sequence , wherein is the dimension of the model; wherein W is a weight matrix, which is a real matrix with D rows and columns, b is a bias term, represents the embedding sequence, represents the feature vector.
[0045] The sinusoidal position encoding is added to explicitly reserve the order information of the time sequence, wherein pos is the position index of the time step. At the same time, a separate event embedding vector is learned for a key event (such as a tripping event, a protection start, etc.), which is added to the embedding representation of the corresponding time step through an addition operation.
[0046] In the embodiments of the present application, the extraction of the multi-scale physical features in step S2 specifically embodies as: The electrical quantity signals of each time segment are comprehensively extracted, and the expression is: in, The total active power in time segment t. These represent the real and imaginary parts of the complex number, respectively. Let be the instantaneous voltage value of phase p at time t. Let be the conjugate complex number of the current phasor of the p-th phase at time t. The total reactive power in time segment t. Let c be the root mean square value of the electrical quantity. The total number of sampling points. Let be the sampled value of the c-th signal at discrete time point n. For signal At angular frequency Complex phasors at that location, For window functions, Let e be the instantaneous value of the electrical quantity e at sampling point n. It is a complex exponential function.
[0047] In an optional implementation, step S2, which extracts multi-scale physical features, can also employ multi-scale feature extraction based on time-domain statistics. For electrical signals within a time segment, time-domain feature indicators such as overall amplitude level, fluctuation amplitude, extreme value distribution, and changing trend are extracted statistically. Specifically, these include: signal average level, amplitude stability, numerical dispersion, peak range, and rate of change characteristics, used to characterize the comprehensive behavioral characteristics of the signal under short-term fluctuations and long-term trends.
[0048] In another optional implementation, the extraction of multi-scale physical features in step S2 can also be achieved by vector feature extraction based on phasor and phase evolution trends. Based on the voltage and current signals within the time segment, the phase difference change trajectory, vector amplitude stability, phase offset trend, and three-phase characteristic consistency index are extracted to characterize the system power transmission characteristics and electrical energy flow state.
[0049] In the embodiments of this application, step S2 extracts multi-scale physical features by simultaneously calculating the effective value features in the time domain, the fundamental phasor features in the frequency domain, and the power-related features. This extracts feature quantities with clear physical meaning from the original sampled data. For example, active power and reactive power reflect the energy transmission status, the root mean square value characterizes the signal strength, and complex phasors capture the amplitude and phase of the fundamental component, thereby enhancing the model's ability to characterize the electrical characteristics of faults and the reliability of the diagnostic basis.
[0050] In the embodiments of the present application, the generation of the low-dimensional embedding sequence in step B3 is embodied as: the final input embedding sequence as the input of the model. The complete formula is: wherein, represents the final input embedding vector at time step t, represents the feature embedding, is the position encoding, is the event embedding, is the position encoding vector, is the position index in the sequence, and correspond to the even and odd dimensions in the embedding vector respectively, is the total dimension of the embedding vector.
[0051] In an alternative embodiment, the generation of the low-dimensional embedding sequence in step B3 can also adopt an embedding generation scheme based on a learnable position vector, in the model parameters, a position vector table is established for each possible position index, each row in the table is a vector with the same dimension as the feature embedding, when processing the input at time step t, the corresponding row is found from the position vector table according to the position of the time step in the sequence, to obtain the position encoding vector, the feature embedding vector corresponding to the time step, the found position encoding vector and the event embedding vector corresponding to the time step are added dimension by dimension to obtain the final input embedding at the time step.
[0052] In another alternative embodiment, the generation of the low-dimensional embedding sequence in step B3 can also adopt an embedding generation scheme based on relative position and time interval, for any time step t, first, according to the time difference between the time step and the previous time step, the sampling interval or the event occurrence interval, the time difference is mapped to a discrete level or a continuous interval, for each time difference level or time interval interval, a relative position vector is pre-assigned, with the same dimension as the feature embedding, when generating the embedding at time step t, the feature embedding vector, the event embedding vector and the relative position vector are fused dimension by dimension (for example, added dimension by dimension).
[0053] In the embodiments of the present application, the generation of the low-dimensional embedding sequence in step B3 realizes the unified representation of the implicit time sequence structure and key events in the power system time sequence signal by mapping the multi-scale physical features to the low-dimensional space and explicitly introducing the sinusoidal position encoding and the learnable event embedding.
[0054] It should be noted that by deep fusion of multi-scale physical features and structured event features, a unified high-dimensional feature vector is constructed, and then through dimension reduction mapping and embedding enhancement processing, a low-dimensional embedding sequence with time sequence perception and event explicit expression ability is formed. This method effectively solves the problem of splitting of physical signals and event information in traditional fault diagnosis.
[0055] In the embodiments of the present application, the low-dimensional embedding sequence is modeled by using a self-attention mechanism in step S3 to model global dependence relationships, extract time sequence dynamic features, and perform fault type classification, trip action prediction and fault location diagnosis, including C1-C3: C1: using a multi-head self-attention mechanism to model global dependence of the low-dimensional embedding sequence, outputting a sequence representation with global context awareness.
[0056] Calculate self-attention. For the embedding sequence, first calculate the query, key and value matrices, and the expression is: wherein, , , are the query, key and value matrices, is the embedding sequence, , , are the trainable weight matrices of the query, key and value, respectively; The attention score expression is: wherein, is the output matrix of the self-attention function, is a softmax normalization function, , , are the query, key and value matrices, is a scaling factor.
[0057] A multi-head attention mechanism is used, h attention heads are used, each head independently calculates the attention weight, then the outputs of all heads are spliced in the feature dimension, and are integrated through a linear projection layer, and the expression is: wherein, is the output matrix of the multi-head attention mechanism, h is the number of attention heads, is the output matrix of the i-th attention head, is a splicing operation, are trainable weight matrices of the i-th query, key and value, respectively. are trainable weight matrices of the i-th query, key and value, respectively. , , are trainable weight matrices of the i-th query, key and value, respectively.
[0058] The output gets the global context-aware sequence representation .
[0059] C2: Based on the global context-aware sequence representation, extract the local dynamic characteristics and long-term dependencies of the sequence, and obtain the time sequence feature representation.
[0060] The attention output is input into a long short-term memory network (LSTM) to further capture the local dynamic characteristics and long-term dependencies of the power signal. For the LSTM structure, a multi-layer LSTM is used, and each LSTM unit includes an input gate, a forget gate, an output gate, and a cell state. For the input at the t-th time step (from A), the internal state update formula of the LSTM is: where σ is a sigmoid function, and is an element-wise multiplication. is an output vector, is an input gate output vector, is an output gate output vector, is a candidate cell state vector, is an updated cell state vector, is a current hidden state vector, are trainable weight matrices of the i-th query, key and value, respectively. are the basic bias provided for each gate and candidate state, is the hidden state of the previous time step t−1, is the input vector of the current time step t.
[0061] The LSTM processes the input sequence A in time step order and outputs the corresponding hidden state sequence . Take the hidden state of the last time step as the summary representation of the entire sequence, which is used for the final classification and regression task C3: Based on the time sequence feature representation, fault type classification, tripping action prediction and fault location diagnosis are performed, and a loss function is used for joint optimization to output the final diagnosis result.
[0062] Three independent output heads are constructed: the fault type classification head adopts a softmax activation function, outputs the probability distribution of each fault type (such as single-phase grounding, phase-to-phase short circuit, etc.), and the loss function uses a classification cross-entropy; the protection action prediction head adopts a sigmoid activation function, outputs the binary probability of the tripping action, and the loss function uses a binary cross-entropy; the fault location regression head adopts a linear activation function, outputs the continuous estimated value of the fault location, and the loss function uses a mean square error.
[0063] In the embodiments of the present application, the joint optimization of the loss function in step C3 to output the final diagnosis result is embodied as: The output calculation formula is: wherein, is the predicted output of the fault type classification, is a softmax normalization function, is the weight matrix of the classification head, is the input feature vector, is the bias term of the classification head, is the predicted output of the protection action, is a Sigmoid activation function, is the weight matrix of the action prediction head, is the bias term of the action prediction head, is the predicted output of the fault location, is the weight matrix of the location regression head, is the bias term of the location regression head. The overall loss is designed as a weighted sum of multi-task loss, and the expression is: wherein, is the overall multi-task loss function, , , are the first, second and third hyperparameters, respectively, which can be artificially set according to experience and take positive real numbers, is the loss of the fault type classification task, is the loss of the protection action prediction task, is the loss of the fault location regression task.
[0064] In an optional embodiment, the loss function is used for joint optimization in step C3, and the final diagnostic result can also use a task merging scheme based on a joint classification output head to define several joint class labels, such as "single-phase grounding and tripping", "single-phase grounding but not tripping", "inter-phase short circuit and tripping", "inter-phase short circuit but not tripping", etc., to combine the original fault type and tripping action into a multi-class output. The last layer of the model outputs the probability distribution of each joint class through a joint classification head, and a multi-class classification loss is used for the loss function, and the fault location is still output by an independent regression head, and the position loss can be combined with the joint classification loss to form a multi-task loss for joint training.
[0065] In another optional embodiment, the loss function is used for joint optimization in step C3, and the final diagnostic result can also use a multi-stage diagnosis scheme based on a cascade prediction structure. The first stage output head is responsible for the judgment of the presence or absence of fault and the fault type, and a classification task is used. After predicting the presence of fault and determining the fault type, the second stage output head further predicts whether tripping action is needed on this basis, and the fault location is estimated based on the results of the first two stages.
[0066] In the embodiments of the present application, the loss function is used for joint optimization in step C3, and the final diagnostic result is output through three independent output heads sharing the bottom feature extraction network, which correspond to the fault type classification, protection action prediction and fault location regression three core diagnostic tasks respectively, ensuring the rationality of the respective optimization objectives.
[0067] In summary, by collecting and standardizing the pre-processing of multi-source electrical signals to form a time series input matrix, then extracting and fusing multi-scale physical features and event features and mapping them into low-dimensional embedding sequences, introducing a self-attention mechanism to model the global dependency relationship of the sequences to extract time series dynamic features, and finally synchronously realizing fault type classification, tripping action prediction and fault location diagnosis through a multi-task joint optimization mechanism, the signal processing, feature engineering and deep learning modeling are integrated, the global context perception and local dynamic feature extraction are enhanced to enhance the representation ability of complex fault patterns, and the comprehensiveness and collaboration of diagnosis are improved, solving the problems of low fault diagnosis accuracy, insufficient anti-interference ability and poor real-time performance in the prior art.
[0068] Embodiment 3 is an embodiment of the present application, which provides a system for fault diagnosis of a main grid relay protection device, comprising a data acquisition and preprocessing module, a feature extraction module and a prediction and diagnosis module, The data acquisition and preprocessing module acquires the initial operation data of the relay protection device, pre-processes the initial operation data, and forms a standardized time series input matrix; The feature extraction module is based on a standardized time sequence input matrix, extracts multi-dimensional physical features and event features, performs feature fusion, and maps the fused features into a low-dimensional embedding sequence. The prediction and diagnosis module uses a self-attention mechanism to model global dependency relationships of the low-dimensional embedding sequence, extracts time sequence dynamic features, and performs fault type classification, trip action prediction, and fault location diagnosis.
[0069] The embodiment also provides an electronic device suitable for the method for diagnosing faults of a main grid relay protection device, which comprises a memory and a processor.
[0070] The embodiment also provides a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the method for diagnosing faults of a main grid relay protection device.
[0071] The storage medium provided by the embodiment and the method for diagnosing faults of a main grid relay protection device provided by the above embodiment belong to the same inventive concept, and the technical details not described in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
[0072] From the above description about the embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary general hardware, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a floppy disk, a read-only memory (ROM), a random access memory (RAM), a FLASH, a hard disk or an optical disk, and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods of various embodiments of the present application.
[0073] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application, and although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced by equivalents without departing from the spirit and scope of the present application, and all of them should be covered in the scope of the claims of the present application.
Claims
1. A method for fault diagnosis of a main grid relay protection device, characterized in that: Comprising, Collect initial operation data of the relay protection device, pre-process the initial operation data, and form a standardized time sequence input matrix; Based on the standardized time sequence input matrix, extract multi-dimensional physical features and event features, perform feature fusion, and map the fused features into a low-dimensional embedding sequence; Model the global dependency relationship of the low-dimensional embedding sequence using a self-attention mechanism, extract time sequence dynamic features, and perform fault type classification, trip action prediction, and fault location diagnosis.
2. The method for fault diagnosis of a main grid relay protection device as described in claim 1, characterized in that: The collection of initial operation data of the relay protection device, the pre-processing of the initial operation data, and the formation of a standardized time sequence input matrix include, Collecting multi-source electrical quantity signals and auxiliary state signals in the operation of the main network relay protection device, and outputting initial operation data; Windowing and slicing the initial operation data, and dividing the time slices according to a fixed length; Standardizing the electrical quantity signals of the time slices to obtain a standardized time sequence input matrix.
3. The method of claim 2, wherein the method further comprises: determining whether the fault is a fault of the main grid relay protection device based on the comparison result. The extraction of multi-dimensional physical features and event features based on the standardized time sequence input matrix, the feature fusion, and the mapping of the fused features into a low-dimensional embedding sequence include, Based on the standardized time sequence input matrix, extract multi-scale physical features, and construct an event feature vector; Concatenate the multi-scale physical features and the event feature vector to form a unified multi-dimensional fusion feature vector; Map the fusion feature vector to a low-dimensional space, add a sinusoidal position encoding and an event embedding vector, and generate a low-dimensional embedding sequence.
4. The method of claim 3, wherein the method further comprises: determining whether the fault is a fault of the main grid relay protection device based on the comparison result. The use of a self-attention mechanism to model the global dependency relationship of the low-dimensional embedding sequence, extract time sequence dynamic features, and perform fault type classification, trip action prediction, and fault location diagnosis include, Using a multi-head self-attention mechanism to model the global dependency of the low-dimensional embedding sequence, and outputting a sequence representation with global context awareness; Based on the sequence representation with global context awareness, extract the local dynamic features and long-term dependencies of the sequence, and obtain a time sequence feature representation; Based on the time sequence feature representation, perform fault type classification, trip action prediction, and fault location diagnosis, jointly optimize using a loss function, and output the final diagnosis result.
5. The method for fault diagnosis of a main grid relay protection device as described in claim 4, characterized in that: The extraction of multi-scale physical features includes, Comprehensive feature extraction is performed on the electrical quantity signals of each time slice, and the expression is: in, The total active power in time segment t. These represent the real and imaginary parts of the complex number, respectively. Let be the instantaneous voltage value of phase p at time t. Let be the conjugate complex number of the current phasor of the p-th phase at time t. The total reactive power in time segment t. Let c be the root mean square value of the electrical quantity. The total number of sampling points. Let be the sampled value of the c-th signal at discrete time point n. For signal At angular frequency Complex phasors at that location, For window functions, Let e be the instantaneous value of the electrical quantity e at sampling point n. It is a complex exponential function.
6. The method of claim 5, wherein: the master network relay protection device is a transformer differential protection device; the first fault is a transformer differential protection device fault; and the second fault is a transformer differential protection device fault. The use of a multi-head self-attention mechanism to model the global dependency of the low-dimensional embedding sequence includes, Calculate the self-attention. For the embedding sequence, first calculate the query, key, and value matrices, and the expression is: wherein, , , are query, key and value matrices, respectively, is an embedding sequence, , , are trainable weight matrices for query, key and value, respectively; The attention score expression is: wherein, is an output matrix of the self-attention function, is a softmax normalization function, , , are query, key, and value matrices, respectively, is a scaling factor.
7. The method for fault diagnosis of a main grid relay protection device as described in claim 6, characterized in that: The use of a loss function to jointly optimize and output the final diagnosis result includes, The output calculation formula is: wherein, is a prediction output for fault type classification, is a softmax normalization function, is a weight matrix of the classification head, is an input feature vector, is a bias term of the classification head, is a prediction output for protective action, is a Sigmoid activation function, is a weight matrix of the action prediction head, is a bias term of the action prediction head, is a prediction output for fault location, is a weight matrix of the location regression head, is a bias term of the location regression head; The overall loss is designed as a weighted sum of multi-task losses, and the expression is: wherein, is the overall multitask loss function, , , are first, second, third hyperparameters, respectively, is the loss for the fault type classification task, is the loss for the protective action prediction task, is the loss for the fault location regression task.
8. A system for fault diagnosis of a main grid protection device, applying the method for fault diagnosis of a main grid protection device according to any one of claims 1 to 7, characterized in that, It includes a data collection and preprocessing module, a feature extraction module, and a prediction and diagnosis module, The data collection and preprocessing module collects initial operation data of the relay protection device, pre-processes the initial operation data, and forms a standardized time sequence input matrix; The feature extraction module is based on the standardized time sequence input matrix, extracts multi-dimensional physical features and event features, performs feature fusion, and maps the fused features into a low-dimensional embedding sequence; The prediction and diagnosis module is used for modeling global dependence relationship of low-dimensional embedding sequence by using self-attention mechanism, extracting time sequence dynamic characteristics, and performing fault type classification, trip action prediction and fault position diagnosis. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor implements the steps of the method for fault diagnosis of a main grid relay protection device according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method for fault diagnosis of a main grid relay protection device according to any one of claims 1 to 7.