Power grid fault diagnosis method based on time constraint and improved Time-ConvNeXt network
By adopting a method based on time constraints and improving the Time-ConvNeXt network in power grid fault diagnosis, the problem of insufficient utilization of timing information in the prior art is solved, and efficient timing feature fusion and the accuracy and real-time improvement of power grid fault diagnosis are achieved.
Patent Information
- Application Number
- CN202510240808.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-03-03
AI Technical Summary
Existing grid fault diagnosis methods are difficult to effectively utilize timing information, resulting in limited diagnostic accuracy and robustness in the face of dynamically changing grid faults.
The grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network is adopted. By extracting and filtering key features in the grid fault alarm text, an alarm event encoding matrix is generated, and an exponential attenuation weight is introduced with time decayed to obtain the time encoding matrix. At the same time, a cyclic timing attention module is added to the ConvNeXt network to enhance the model's ability to capture timing fault features.
It realizes efficient integration of timing characteristics during the grid fault diagnosis process, improves the efficiency and accuracy of grid fault diagnosis, and improves the robustness and real-timeness of the model.
Smart Images

Figure CN120177932A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid fault diagnosis in smart grids, and particularly relates to a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network. Background Art
[0002] With the rapid development of smart grids, the requirements for the accuracy and real-time performance of power grid fault diagnosis are increasing. Traditional fault diagnosis methods mainly rely on expert systems, fuzzy Petri nets, etc., and have problems such as relying on manual experience, slow diagnosis speed, and difficulty in dealing with complex multi-fault scenarios. In addition, the existing methods do not make full use of temporal information, resulting in limited diagnosis accuracy and robustness when facing dynamically changing power grid faults.
[0003] Current power grid fault diagnosis models usually rely on electrical quantity and switch quantity data, but do not fully exploit the spatio-temporal correlation features in alarm information. For example, the alarm data provided by the SCADA system contains a large amount of redundant information, and it is difficult for traditional methods to effectively filter out interference, and the time constraints of historical fault events are not incorporated into the model design. In recent years, although deep learning technologies (such as convolutional neural networks) have been introduced into the field of fault diagnosis, the existing models still lack the ability to efficiently fuse temporal features, which limits their application in real-time diagnosis.
[0004] Therefore, how to provide a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network that can achieve efficient fusion of temporal features during the power grid fault diagnosis process and further improve the efficiency and accuracy of power grid fault diagnosis is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention proposes a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network, comprising:
[0008] Step 1: Extract and screen key features in the power grid fault alarm text, generate an alarm event coding matrix, and introduce an exponentially decaying weight that decays with time to obtain a time coding matrix;
[0009] Step 2: Add a recurrent temporal attention module to the ConvNeXt network to obtain an improved Time-ConvNeXt network, and input the time coding matrix for end-to-end training of the power grid fault diagnosis model to extract spatio-temporal features;
[0010] Step 3: Input the test set into the trained power grid fault diagnosis model, and the power grid fault type probability is output by the fully connected layer.
[0011] Optionally, in Step 1, based on the maximum correlation and minimum redundancy criterion, key features in the power grid fault alarm text are extracted and screened.
[0012] Optionally, in Step 1, the generated alarm event coding matrix is as follows:
[0013]
[0014] where D A is the alarm event coding matrix; a ij is the coding value of the feature in the i-th row and j-th column of the alarm event, and the priority decreases from the upper left to the lower right.
[0015] Optionally, in Step 1, the exponentially decaying weight with time decay is as follows:
[0016] w decay (t) = e -αt ;
[0017] t = |T current - T past |;
[0018] where T past is the timestamp of the historical alarm event; T current is the timestamp of the current alarm event; t is the time difference between the historical alarm event and the current alarm event; w decay (t) is the weight of the historical alarm event; α is the decay factor used to control the influence degree of the time difference on the weight.
[0019] Optionally, in Step 1, the time coding matrix is as follows:
[0020]
[0021] where D A (t) is the time coding matrix; a ij is the coding value of the feature in the i-th row and j-th column of the alarm event, and the priority decreases from the upper left to the lower right; w decay (t) is the weight of the historical alarm event.
[0022] Optionally, in Step 2, a recurrent temporal attention module is added to the ConvNeXt network, specifically:
[0023] Channel attention weights are assigned through global average pooling and fully connected layers, specifically:
[0024] After the input features are subjected to the global average pooling operation, a feature representation with a reduced spatial dimension is obtained, which is used to further extract channel-level features. Then, through the transformation of the fully connected layer, the attention weights of each channel are obtained as follows:
[0025] W ds = FC(GAP(F));
[0026] where W ds is the attention weight of each channel; F is the tensor of the input features; GAP is the global average pooling operation, which obtains the global average value of each channel; FC is a fully connected layer used to convert the global average value into the attention weight of each channel;
[0027] The residual mechanism is adopted to cyclically update the features. Specifically:
[0028] Multiply the attention weight by the input features and then add them to the original input features to achieve residual connection, and repeat the update R times as follows:
[0029] F ds = F + F ⊙ W ds ;
[0030] F ds = update(F) i , for i ∈ R;
[0031] where F ds is the updated feature tensor; ⊙ is element-wise multiplication; update is the cyclic update operation.
[0032] Optionally, in step 2, the Time-ConvNeXt network is improved, including: depthwise separable convolution, layer normalization, and the GELU activation function.
[0033] Optionally, the depthwise separable convolution decomposes the standard convolution into pointwise convolution and depthwise convolution.
[0034] Optionally, the GELU activation function is as follows:
[0035]
[0036] where GELU(x) is the output of the GELU activation function; x is the input of the GELU activation function; tanh is the hyperbolic tangent function.
[0037] Optionally, it further includes: using cross-entropy as the loss function of the power grid fault diagnosis model.
[0038] As can be seen from the above technical solutions, compared with the prior art, the present invention proposes a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network. By introducing time decay weights and time series difference features, the encoding matrix is extended to fuse the time dependence of historical fault events. Further, a recurrent temporal attention module (RSE) is added to the ConvNeXt network to enhance the model's ability to capture temporal fault features, realizing the efficient fusion of temporal features in the power grid fault diagnosis process and further improving the efficiency and accuracy of power grid fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.
[0040] Figure 1 It is a schematic flow chart of the method of the present invention.
[0041] Figure 2 It is a schematic structural diagram of the improved Time-ConvNeXt network of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0043] Embodiment 1:
[0044] Embodiment 1 of the present invention discloses a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network, as Figure 1 shown, including:
[0045] Step 1: Extract and screen the key features in the power grid fault alarm text, generate an alarm event encoding matrix, and introduce an exponentially decaying weight that decays with time to obtain a time encoding matrix.
[0046] The power grid fault alarm text is obtained from the SCADA system, and the power grid fault alarm text is standardized before key feature extraction.
[0047] Based on the maximum relevance and minimum redundancy criterion (mRMR), extract and screen the key features in the power grid fault alarm text.
[0048] The generated alarm event coding matrix is as follows:
[0049]
[0050] Among them, D A is the alarm event coding matrix; a ij is the coding value of the feature in the i-th row and j-th column of the alarm event, and the priority decreases from the upper left to the lower right.
[0051] In order to make the influence of historical events on the current event decay over time, adjust the weight of historical events in the coding matrix, and introduce an exponentially decaying weight that decays over time, as follows:
[0052] w decay (t) = e -αt ;
[0053] t = |T current -T past |;
[0054] Among them, T past is the timestamp of the historical alarm event; T current is the timestamp of the current alarm event; t is the time difference between the historical alarm event and the current alarm event; w decay (t) is the weight of the historical alarm event; α is the decay factor, which is used to control the influence degree of the time difference on the weight.
[0055] The time coding matrix is as follows:
[0056]
[0057] Among them, D A (t) is the time coding matrix; a ij is the coding value of the feature in the i-th row and j-th column of the alarm event, and the priority decreases from the upper left to the lower right; w decay (t) is the weight of the historical alarm event.
[0058] Step 2: Add a recurrent temporal attention module (RSE) to the ConvNeXt network to obtain an improved Time-ConvNeXt network, and input the time coding matrix for end-to-end training of the power grid fault diagnosis model to extract spatio-temporal features.
[0059] The improved Time-ConvNeXt network structure is as Figure 2 shown.
[0060] Adding a recurrent temporal attention module to the ConvNeXt network specifically means:
[0061] Channel attention weights are assigned through global average pooling (GAP) and fully connected layers (FC), specifically as follows:
[0062] After the input features undergo global average pooling operation, a feature representation with a reduced spatial dimension is obtained, which is used to further extract channel-level features. Then, through the transformation of the fully connected layer, the attention weights for each channel are obtained, as follows:
[0063] W ds = FC(GAP(F));
[0064] Among them, W ds is the attention weight for each channel; F is the tensor of the input features; GAP is the global average pooling operation, which obtains the global average value for each channel; FC is a fully connected layer, which is used to convert the global average value into the attention weight for each channel;
[0065] Using the residual mechanism to cyclically update the features can effectively enhance the ability to capture temporal dependencies. And the design of the residual connection can not only alleviate the problem of gradient disappearance, but also effectively combine the original input information with the features modulated by the attention weights, enhancing the model's ability to transmit and learn features. Using the residual mechanism to cyclically update the features, specifically as follows:
[0066] Multiply the attention weight by the input features and then add them to the original input features to achieve the residual connection, and repeat the update R times, as follows:
[0067] F ds = F + F ⊙ W ds ;
[0068] F ds = update(F) i , for i ∈ R;
[0069] Among them, F ds is the updated feature tensor; ⊙ is element-wise multiplication; update is the cyclic update operation. Repeating the update process R times can enhance the ability to understand faults at different time points and express the relationship between features and time. And the cyclic mechanism enables the model to process temporal information multiple times, thereby better capturing long-term dependencies.
[0070] Improve the Time-ConvNeXt network, including: depthwise separable convolution, layer normalization (LayerNorm), and GELU activation function.
[0071] Depthwise separable convolution is an important part of the ConvNeXt network. Depthwise separable convolution decomposes the standard convolution into pointwise convolution (1×1 convolution) and depthwise convolution (3×3 convolution), which reduces the computational cost while improving the efficiency of the network. Depthwise separable convolution can effectively extract local and global information of features.
[0072] After depthwise separable convolution, layer normalization (LayerNorm) is used to normalize the features. Layer normalization can stabilize the training process of the model, alleviate the problem of internal covariate shift, and improve the robustness and convergence speed of the model.
[0073] Finally, the GELU activation function is used as the non-linear activation unit. The GELU activation function is a smooth activation function. The GELU activation function is as follows:
[0074]
[0075] Where GELU(x) is the output of the GELU activation function; x is the input of the GELU activation function; tanh is the hyperbolic tangent function.
[0076] Step 3: Input the test set into the trained power grid fault diagnosis model, and the probability of the power grid fault type is output by the fully connected layer.
[0077] It also includes: using cross-entropy as the loss function of the power grid fault diagnosis model.
[0078] An embodiment of the present invention discloses a power grid fault diagnosis method based on time constraints and an improved Time-ConvNeXt network. In terms of accuracy, the time constraint encoding matrix adopted by the present invention enhances the model's adaptability to dynamic faults by quantifying the time correlation of historical events. The RSE module captures long-term temporal dependencies through a cyclic attention mechanism, improving the discrimination accuracy in complex fault scenarios, and enabling the model to achieve an accuracy (ACC) of 97.7% on the test set, which is 11.2% higher than that of the traditional ResNet. In terms of real-time performance, the end-to-end design adopted by the present invention reduces intermediate processing steps, shortening the single diagnosis time to the millisecond level, meeting the requirements of modern smart grids for real-time fault diagnosis, and significantly improving the operation efficiency and reliability of the power grid. In terms of robustness, the time decay mechanism adopted by the present invention effectively suppresses redundant alarm interference, and the F1 value is increased to 95.2%. This shows that the present invention can maintain high diagnostic accuracy and stability when dealing with complex multi-fault scenarios, significantly improving the robustness of the model. In terms of the dependence on expert knowledge, the present invention reduces the dependence on expert knowledge by automatically extracting features and time dependence relationships, reducing subjective errors in the diagnosis process, and improving the objectivity and consistency of the diagnosis results. In terms of feature extraction, the improved Time-ConvNeXt network adopted by the present invention combines depthwise separable convolution and a cyclic temporal attention module to achieve efficient spatio-temporal feature extraction. When the model processes large-scale power grid data, it can quickly and accurately identify fault types, significantly improving the diagnostic efficiency.
[0079] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the various embodiments, reference can be made to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and reference can be made to the description of the method part for related parts.
[0080] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network, characterized in that: include: Step 1: Extract and filter the key features in the power grid fault alarm text, generate the alarm event coding matrix, and introduce the exponential decay weight that decays with time to obtain the time coding matrix; Step 2: Add a recurrent temporal attention module to the ConvNeXt network to obtain an improved Time-ConvNeXt network, and input the time coding matrix to perform end-to-end power grid fault diagnosis model training to extract spatiotemporal features; Step 3: Input the test set into the trained power grid fault diagnosis model, and output the power grid fault type probability through the fully connected layer.
2. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 1, based on the maximum relevance and minimum redundancy criterion, the key features in the power grid fault alarm text are extracted and screened.
3. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 1, the alarm event coding matrix generated is as follows: Among them, D A is the alarm event coding matrix; a ij is the encoding value of the feature of the i-th row and j-th column of the alarm event, and the priority decreases from the upper left to the lower right.
4. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 1, the exponential decay weight that decays over time is as follows: w decay (t)=e -αt ; t=|T current -T past |; Among them, T past is the timestamp of the historical alarm event; T current is the timestamp of the current alarm event; t is the time difference between the historical alarm event and the current alarm event; w decay (t) is the weight of the historical alarm event; α is the attenuation factor, which is used to control the influence of the time difference on the weight.
5. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 1, the time coding matrix is as follows: Among them, D A (t) is the time coding matrix; a ij is the code value of the feature of the i-th row and j-th column of the alarm event, with the priority decreasing from the upper left to the lower right; w decay (t) is the weight of historical alarm events.
6. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 2, a recurrent temporal attention module is added to the ConvNeXt network, specifically: Channel attention weights are allocated through global flat pooling and fully connected layers, specifically: After the global average pooling operation, the input features are transformed into a feature representation with a reduced spatial dimension, which is used to further extract channel-level features. After the fully connected layer transformation, the attention weights of each channel are obtained as follows: W ds =FC(GAP(F)); Among them, W ds is the attention weight of each channel; F is the tensor of input features; GAP is the global average pooling operation, which obtains the global average of each channel; FC is a fully connected layer, which is used to convert the global average into the attention weight of each channel; The residual mechanism is used to cyclically update the features, specifically: The attention weight is multiplied by the input feature and then added to the original input feature to achieve residual connection, and the update is repeated R times, as follows: F ds =F+F⊙W ds ; F ds =update(F) i ,for i∈R; Among them, F ds is the updated feature tensor; ⊙ is the element-by-element multiplication; update is the loop update operation.
7. A method for power grid fault diagnosis based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: In step 2, the Time-ConvNeXt network is improved, including: depthwise separable convolution, layer normalization, and GELU activation function.
8. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 7, characterized in that: The depth-wise separable convolution decomposes the standard convolution into point-wise convolution and depth-wise convolution.
9. A method for power grid fault diagnosis based on time constraints and improved Time-ConvNeXt network according to claim 7, characterized in that: The GELU activation function is as follows: Among them, GELU(x) is the output of the GELU activation function; x is the input of the GELU activation function; tanh is the hyperbolic tangent function.
10. A power grid fault diagnosis method based on time constraints and improved Time-ConvNeXt network according to claim 1, characterized in that: Also includes: Cross entropy is used as the loss function of the power grid fault diagnosis model.
Citation Information
Patent Citations
CNN (Convolutional neural network) based early-stage fault classification method and device of power distribution network
CN109444667A
Power distribution network fault diagnosis and positioning method based on super-resolution and graph neural network
CN114779015A
Full-chain interpretable power distribution network single-phase earth fault type identification method and system
CN117929913A
Graph theory-based method and device for locating instability fault source in direct-current microgrid
US12235311B1
Ground fault directionality detection method, device and computer readable storage medium
US20220043046A1