A single-phase ground fault detection method based on S4 state space model

CN122595034APending Publication Date: 2026-08-18NANJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610799636.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

然而,现有深度学习方法在此领域的应用仍面临若干瓶颈:第一,多数方法仅依赖单一滤波或单一分解手段进行特征预处理,所提取的特征维度单一,难以完整覆盖金属性接地、高阻接地和电弧接地等不同类型故障在频域和时域上的差异化表现,导致场景适应性不足;第二,常用的循环神经网络类模型在序列处理时采用递推式的逐时间步串行计算方式,无法充分利用并行硬件加速,训练和推理效率较低,难以满足配电网馈线终端装置对实时性的严苛要求;第三,当面对长序列的故障录波数据时,循环神经网络容易出现梯度消失或梯度爆炸问题,对长程时序依赖关系的捕捉能力有限,而Transformer架构虽然具备全局感受野,其自注意力机制的计算复杂度随序列长度平方增长,在资源受限的边端设备上部署存在困难

Benefits of technology

[0033] Compared with the prior art, the beneficial effects achieved by the present invention are: the present invention, through the synergy of multi-dimensional feature complementarity, multi-scale local capture and efficient global time series modeling, has high accuracy, strong robustness and fast reasoning ability under complex working conditions such as arc grounding, high resistance grounding and strong noise, and meets the real-time detection requirements of the distribution network edge side.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122595034A_ABST
    Figure CN122595034A_ABST
Patent Text Reader

Abstract

The application provides a single-phase ground fault detection method based on an S4 state space model, including the following steps: acquiring a zero sequence voltage and a zero sequence current signal and constructing a multi-scenario fault sample set; performing multi-dimensional time-frequency feature extraction on samples in the multi-scenario fault sample set; extracting different scale local fault features by using a three-branch multi-scale convolutional neural network, and adaptively weighting and fusing the different scale local fault features through an attention mechanism; inputting the fused features into the S4 state space model, and extracting global time sequence dependent features in parallel through a structured state space equation; and finally outputting a fault detection result by a classifier. The application has high accuracy, strong robustness and fast reasoning ability under complex working conditions such as arc grounding, high resistance grounding and strong noise through the cooperation of multi-dimensional feature complementation, multi-scale local capture and efficient global time sequence modeling, and meets the real-time detection requirements of the edge side of a distribution network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power system fault detection, specifically a single-phase grounding fault detection method based on the S4 state-space model. Background Technology

[0002] As the final link in the power system directly facing end users, the power distribution network's reliability directly impacts the normal operation of social production and residents' lives. Statistics show that distribution network faults account for the vast majority of all power system faults, with single-phase grounding faults being the most frequent type, accounting for over 70% of all faults. In low-current grounding systems, including ungrounded neutral systems and systems grounded via arc suppression coils, after a single-phase grounding fault occurs, because no direct short-circuit loop is formed, the fault current amplitude is weak, and the three-phase line voltages remain symmetrical. Power system operating procedures allow continued operation with the fault for a period under these conditions. However, the drop in fault phase voltage and the rise in non-fault phase voltage will cause the system insulation to bear additional overvoltage stress. If the fault is not investigated and eliminated for a long time, it can easily evolve into more serious accidents such as phase-to-phase short circuits or two-point grounding, causing equipment damage or even large-scale power outages. Therefore, quickly and accurately detecting single-phase grounding faults and identifying their types is of significant engineering value in guiding maintenance personnel to eliminate faults in a timely manner and ensuring the safe and stable operation of the distribution network.

[0003] For a long time, scholars at home and abroad have conducted extensive research on the detection of single-phase grounding faults in low-current grounding systems, resulting in several technical branches, including steady-state quantity analysis, transient quantity analysis, and artificial intelligence methods. Detection methods based on steady-state quantities mainly utilize the amplitude of the zero-sequence voltage, the fundamental component of the zero-sequence current, and their phase relationship after the fault for fault identification, such as the traditional zero-sequence voltage over-limit criterion and the group amplitude-phase comparison method. These methods are simple in principle and easy to implement, but under high-resistance grounding fault conditions, the steady-state zero-sequence current signal is extremely weak and easily submerged in background noise and load fluctuations. Furthermore, the steady-state fault current is further reduced after compensation by the arc suppression coil, causing a significant decrease in the sensitivity of steady-state quantity-based methods in the compensated power grid, making it difficult to meet the effective detection requirements of high-resistance grounding faults in the field.

[0004] Transient-based detection methods overcome some of the shortcomings of steady-state methods. The transient zero-sequence voltage and current signals generated at the moment of a fault have amplitudes much larger than the steady-state components and are not directly affected by arc-suppression coil compensation, thus containing rich fault characteristic information. Researchers have successively proposed a series of detection criteria based on transient energy direction, transient zero-sequence current amplitude comparison, transient zero-sequence admittance, and transient reactive power direction. However, transient signals are short in duration, have complex and variable waveforms, and are significantly affected by factors such as the initial phase angle of the fault, the magnitude of the transition resistance, and line distributed parameters. In arc-ground fault scenarios, the intermittent arc extinction and reignition processes generate discontinuous transient signal sequences with significantly different morphologies. Traditional detection methods based on a single transient index or fixed threshold are prone to misjudgment or missed detection when faced with such complex waveforms.

[0005] In recent years, with the rapid development of artificial intelligence technology, data-driven methods, represented by deep learning, have been gradually introduced into the field of power distribution network fault detection. One-dimensional convolutional neural networks have shown certain advantages in fault waveform recognition due to their ability to automatically extract local features; recurrent neural networks and their variants (such as long short-term memory networks and gated recurrent units) have been tentatively applied in the task of sequence classification of transient signals due to their ability to model temporal dependencies. However, the application of existing deep learning methods in this field still faces several bottlenecks: First, most methods rely on a single filtering or decomposition method for feature preprocessing, resulting in a single feature dimension that is difficult to fully cover the differentiated performance of different types of faults such as metallic grounding, high-resistance grounding, and arc grounding in the frequency and time domains, leading to insufficient scenario adaptability; Second, commonly used recurrent neural network models adopt a recursive time-step serial computation method in sequence processing, which cannot fully utilize parallel hardware acceleration, resulting in low training and inference efficiency and difficulty in meeting the stringent real-time requirements of distribution network feeder terminal devices; Third, when faced with long-sequence fault waveform data, recurrent neural networks are prone to gradient vanishing or gradient exploding problems, limiting their ability to capture long-range temporal dependencies, while the Transformer architecture, although possessing a global receptive field, has a self-attention mechanism whose computational complexity increases quadratically with the sequence length, making deployment on resource-constrained edge devices difficult.

[0006] In summary, existing single-phase grounding fault detection technologies for low-current grounding systems have room for further improvement and enhancement in multiple dimensions, including the comprehensiveness of feature engineering, adaptability to complex operating conditions, model calculation efficiency, and long-sequence global modeling capabilities. Summary of the Invention

[0007] To address the aforementioned problems, this invention proposes a single-phase grounding fault detection method based on the S4 state-space model, aiming to overcome the performance bottlenecks of existing technologies and meet the requirements of high-precision, fast-response single-phase grounding fault detection in power distribution networks. The technical solution provided by this invention is as follows:

[0008] A single-phase ground fault detection method based on the S4 state-space model includes the following steps:

[0009] Step 1: Obtain the zero-sequence voltage and zero-sequence current signals of the low-current grounding system under different single-phase grounding fault conditions, and construct a multi-scenario fault sample set;

[0010] Step 2: Extract multi-dimensional time-frequency features from the samples in the multi-scenario fault sample set to obtain multi-dimensional time-frequency input features;

[0011] Step 3: Use a multi-scale convolutional neural network to extract multi-scale local features from the multi-dimensional time-frequency input features, and obtain attention fusion features through attention fusion;

[0012] Step 4: Input the attention fusion features into the S4 state space model, and extract global temporal features from the S4 state space model;

[0013] Step 5: Based on global temporal features, use a classifier to classify faults and output fault detection results.

[0014] Preferably, step 1 involves constructing a multi-scenario fault sample set, specifically including:

[0015] The system collects raw zero-sequence voltage and raw zero-sequence current signals under different neutral grounding methods, different fault types, and different operating conditions.

[0016] Wavelet threshold denoising is performed on the original zero-sequence voltage signal and the original zero-sequence current signal to obtain the denoised zero-sequence voltage signal and zero-sequence current signal;

[0017] The sliding window method is used to cut the denoised zero-sequence voltage signal and zero-sequence current signal into equal lengths to generate multiple samples. Each sample is then labeled with a corresponding fault type to form a multi-scenario fault sample set.

[0018] Preferably, step 2, multi-dimensional time-frequency feature extraction, specifically includes:

[0019] For each sample, high-frequency transient features are extracted by zero-phase high-pass filtering, power frequency steady-state features are extracted by zero-phase low-pass filtering, and modal time-frequency features are extracted by variational mode decomposition.

[0020] High-frequency transient features, power frequency steady-state features, and modal time-frequency features are stacked in the channel dimension to form multi-dimensional time-frequency input features.

[0021] Preferably, the extraction of modal time-frequency features by variational mode decomposition specifically involves: performing variational mode decomposition on the sample to adaptively decompose it into multiple intrinsic mode functions with different center frequencies; selecting several intrinsic mode functions related to the fault feature frequency band from the decomposition results and recombining them to obtain modal time-frequency features.

[0022] Preferably, step 3, attention fusion, specifically includes:

[0023] Multidimensional time-frequency input features are input in parallel to three convolutional branches with different kernel sizes to extract local fault features at different scales, resulting in a multi-scale feature map.

[0024] The attention weights are calculated on the multi-scale feature maps to obtain the attention weights corresponding to each scale feature map.

[0025] Attention weights are used to weight and fuse multi-scale feature maps to generate attention fusion features.

[0026] Preferably, the attention weight calculation for the multi-scale feature maps is as follows: after concatenating or adding the multi-scale feature maps, they are sequentially passed through global average pooling, a fully connected layer, and a Sigmoid activation function to generate attention weights.

[0027] Preferably, step 4 extracts global temporal features from the S4 state-space model, specifically including:

[0028] The attention fusion features are subjected to sequence dimension transformation and positional encoding is added to obtain a feature sequence with positional information;

[0029] The feature sequence with location information is input into a global feature extractor composed of stacked S4 state space model blocks. The sequence is evolved through internal state space equations to capture long-range dependencies and output global temporal features.

[0030] Preferably, step 5 outputs the fault detection results, specifically including:

[0031] The global temporal features are input into a classifier consisting of a fully connected layer and a Softmax activation function, and the output is a fault probability distribution vector.

[0032] The fault category corresponding to the maximum probability in the fault probability distribution vector is selected as the final fault detection result output.

[0033] Compared with the prior art, the beneficial effects achieved by the present invention are: the present invention, through the synergy of multi-dimensional feature complementarity, multi-scale local capture and efficient global time series modeling, has high accuracy, strong robustness and fast reasoning ability under complex working conditions such as arc grounding, high resistance grounding and strong noise, and meets the real-time detection requirements of the distribution network edge side. Attached Figure Description

[0034] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0035] Figure 1 This is a flowchart of the overall solution of the present invention;

[0036] Figure 2 This is a flowchart of the process for constructing a multi-scenario fault sample set according to the present invention;

[0037] Figure 3 This is a flowchart illustrating how the multidimensional time-frequency input features are obtained according to the present invention;

[0038] Figure 4 This is a flowchart illustrating how the present invention obtains attention fusion features through attention fusion;

[0039] Figure 5 This is a flowchart illustrating the extraction of global temporal features from the S4 state-space model according to the present invention;

[0040] Figure 6 This is a flowchart of the fault detection results output by the present invention. Detailed Implementation

[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] To make the above-mentioned objectives, features and effects of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0043] Example 1: A single-phase ground fault detection method based on the S4 state-space model, such as Figures 1 to 6 As shown, it includes the following steps:

[0044] S1: Obtain the zero-sequence voltage and zero-sequence current signals of the low-current grounding system under different single-phase grounding fault conditions, and construct a multi-scenario fault sample set.

[0045] In this application, fault detection begins with acquiring electrical quantities reflecting the characteristics of single-phase grounding faults from the actual operating environment of the distribution network. Specifically, voltage and current transformers installed at the feeder outlets of the low-current grounding system are used to simultaneously acquire the original zero-sequence voltage and current signals within a predetermined time window before and after the fault occurs. To ensure that the sample set can cover complex and varied field conditions, the signal acquisition process is designed to encompass various neutral grounding methods, including ungrounded neutral systems and systems grounded via arc suppression coils; to cover various fault types, such as metallic grounding faults, high-resistance grounding faults with different resistance values, and arc grounding faults; and to consider operating environments with different load levels and harmonic content. By introducing multiple scenario factors, the adaptability of the subsequent model to various operating conditions is ensured.

[0046] After obtaining the original signal, it is first subjected to wavelet threshold denoising to suppress the negative impact of random noise and electromagnetic interference on fault feature extraction. For example, a suitable wavelet basis function (such as db4 or sym8 wavelet) is selected and the number of decomposition levels is determined. Discrete wavelet transform is performed on the original zero-sequence voltage and zero-sequence current signals to obtain wavelet coefficients at each scale. For the wavelet coefficients of each decomposition level, soft or hard thresholding is performed according to a preset threshold criterion (e.g., a general threshold or an adaptive threshold based on Stein's unbiased risk estimation), reducing or shrinking coefficients with amplitudes below the threshold to zero, thereby filtering out noise-dominated components. Then, inverse wavelet transform reconstruction is performed using the thresholded wavelet coefficients to obtain the denoised zero-sequence voltage and zero-sequence current signals. This denoising process effectively improves the signal-to-noise ratio while preserving fault transient information.

[0047] Furthermore, a sliding window method is used to sample the denoised continuous signal. A fixed time window length and movement step size are set, and the signal is truncated along the time axis, dividing the long-time signal into several equal-length signal segments, each segment being an independent sample. Simultaneously, based on the actual fault occurrence within the time period of each segment, a fault type label in one-hot encoded form is assigned, such as "normal state," "metallic grounding fault," "high-resistance grounding fault," and "arc grounding fault." All labeled samples are aggregated to form a multi-scenario fault sample set, serving as the data foundation for subsequent model training and inference.

[0048] S2: Extract multi-dimensional time-frequency features from samples in the multi-scenario fault sample set to obtain multi-dimensional time-frequency input features.

[0049] In order to extract rich time-domain and frequency-domain representations that are sensitive to fault types from limited zero-sequence voltage and zero-sequence current signals, this application uses three heterogeneous feature extraction paths to process each sample in parallel and construct multi-dimensional time-frequency input features.

[0050] The first path extracts high-frequency transient features using a zero-phase high-pass filter. The advantage of a zero-phase filter is that it does not introduce phase distortion and can accurately preserve the high-frequency transient oscillation pattern at the moment of a fault. In a preferred embodiment, the cutoff frequency of the high-pass filter is set around 100Hz, retaining only transient components above the power frequency. This allows for the separate separation of high-frequency current pulses and voltage surges generated during fault arcing or grounding. The filter is applied to the denoised zero-sequence voltage and zero-sequence current signals in the sample, respectively, outputting a high-frequency transient feature sequence.

[0051] The second path extracts the power frequency steady-state characteristics through a zero-phase low-pass filter. The cutoff frequency of the low-pass filter is typically set around 50Hz to capture the steady-state power frequency components and their adjacent low-frequency modulation characteristics. These characteristics are particularly crucial for distinguishing high-impedance grounding faults from load fluctuations. After low-pass filtering, a power frequency steady-state characteristic sequence reflecting the slow changes in the fundamental amplitude and phase before and after the fault is obtained.

[0052] The third approach employs variational mode decomposition (VMD) to extract modal time-frequency features. VMD is an adaptive signal decomposition method that can decompose non-stationary, nonlinear fault signals into a series of intrinsic mode functions (IMFs) with finite bandwidth, each mode revolving around a different center frequency. Specifically, the VMD algorithm is executed on the zero-sequence signal of each sample, with a pre-set number of decomposition modes K (e.g., K = 3-5), and K IMFs are iteratively solved. Then, based on the correlation between each mode and the known fault characteristic frequency band, the mode functions with the highest correlation are selected for reconstruction, thereby obtaining modal time-frequency features that can accurately characterize the time-varying characteristics of a specific frequency band. For example, arc grounding faults often exhibit intermittent oscillations within a frequency band of several hundred hertz; by selecting the mode functions corresponding to the frequency band, this feature can be effectively extracted.

[0053] Finally, the high-frequency transient features, power frequency steady-state features, and modal time-frequency features output from the three channels are stacked along the channel dimension to form a multi-dimensional time-frequency input feature in the form of a three-dimensional tensor with multiple channels. This parallel and complementary feature construction method allows transient details, steady-state offsets, and narrowband resonances in the fault signal to be completely preserved within the same data unit.

[0054] S3: Multi-scale local feature extraction is performed on multi-dimensional time-frequency input features using a multi-scale convolutional neural network, and attention fusion features are obtained through attention fusion.

[0055] The multidimensional time-frequency input feature tensor constructed in this application is fed into a specially designed multi-scale convolutional neural network module to capture the local structural patterns of fault signals at different time scales. According to one aspect of this application, the module includes three parallel one-dimensional convolutional branches, each with a different kernel size, thereby focusing on receptive fields of different widths.

[0056] Specifically, the first branch uses a small convolutional kernel (e.g., 1×3), which is highly sensitive to subtle local changes in the input features and excels at capturing small-scale abrupt changes such as sudden spikes in arc current and rapid zero-crossing of high-frequency oscillations. The second branch uses a medium-sized convolutional kernel (e.g., 1×5), capable of characterizing patterns in the tens of milliseconds to hundreds of milliseconds during fault transition. The third branch uses a large convolutional kernel (e.g., 1×7), focusing on extracting large-scale contour information throughout the entire fault cycle, such as the continuous rise trend of zero-sequence voltage or the slowly varying envelope of zero-sequence current. Each convolutional branch is followed by a batch normalization layer and a nonlinear activation function to enhance training stability and feature expressiveness. After the input multidimensional time-frequency features undergo independent convolution operations in these three branches, small-scale feature maps, medium-scale feature maps, and large-scale feature maps are output, which are collectively referred to as multi-scale feature maps.

[0057] To adaptively fuse these feature maps at different scales, this application further introduces an attention weighting mechanism. In one optional implementation, the multi-scale feature maps generated by the three branches are first summed element-wise or concatenated along the channel dimension to form a comprehensive feature representation. Then, global average pooling is performed on the comprehensive feature representation, compressing the feature map within each channel into a scalar of one spatial dimension to aggregate statistical information from the global receptive field. Next, an attention weight vector matching the number of channels is generated by sequentially passing through a fully connected layer and a sigmoid activation function. Each element in the attention weight vector represents the importance that the corresponding scale feature map should be assigned in the current fault mode. Finally, the generated attention weight vector is used to perform channel-level weighted summation of the original feature maps at each scale to obtain the attention fusion feature. This fusion method allows the network to automatically suppress inefficient feature channels introduced by noise or interference based on the specific characteristics of the input signal, while enhancing feature channels that play a decisive role in distinguishing fault types, thereby improving the quality of feature representation.

[0058] S4: Input the attention fusion features into the S4 state space model, and extract global temporal features from the S4 state space model.

[0059] After obtaining the attention fusion features that incorporate multi-scale local information, it is necessary to model the global temporal dependencies of the fault signals. This application abandons the traditional recurrent neural network and instead adopts the S4 state-space model as the global feature extractor to achieve efficient parallel computation while maintaining the ability to model long sequences.

[0060] According to a further improvement in this embodiment, the attention fusion features are first subjected to a sequence dimension transformation, reshaping them into a format that meets the input requirements of the S4 model, typically represented as a two-dimensional matrix of sequence length and feature dimension. To inject temporal information of the signal at different positions in the sequence into the model, learnable positional codes are added to the transformed features, forming a feature sequence with positional information. The introduction of positional codes enables even a pure feedforward state-space model to distinguish the sequential order of the sequence, which is crucial for accurately capturing the temporal progression of faults.

[0061] Subsequently, the feature sequence with location information is input into a global feature extractor composed of stacked S4 state-space model blocks. Each S4 model block contains a set of continuous-time dynamic evolution rules defined by state-space equations. At a high level, the state-space equations map the input sequence to a latent high-dimensional state trajectory and, using structured state transition matrices and input projection matrices, compute the output of the entire sequence in parallel via convolution. This mechanism enables the model to process extremely long sequences with linear time complexity while capturing long-range dependencies spanning hundreds or even thousands of time steps. Through layer-by-layer abstraction and propagation, the S4 model gradually extracts global temporal features related to the fault mode from the initial local fusion features, such as the decay trend of continuous oscillations, the asymptotic recovery process of fault phase voltage, and global dynamic patterns such as the reignition and extinction cycles of intermittent arcs. The final output is a global temporal feature vector or sequence containing rich contextual information, which can be used for downstream classification tasks.

[0062] S5: Based on global temporal features, a classifier is used to classify faults and output fault detection results.

[0063] The final stage of fault detection involves identifying the fault type using the extracted global temporal features. In one aspect of this application, the global temporal features output from the S4 state-space model are fed into a classifier consisting of a fully connected layer and a Softmax activation function. Preferably, the global temporal features are first subjected to necessary pooling or flattening operations to obtain a fixed-length feature vector. This feature vector is linearly mapped through a fully connected layer, outputting an original score vector with a dimension equal to the preset number of fault categories, where each score corresponds to a fault type (including normal states). Subsequently, the Softmax function converts the original score vector into a fault probability distribution vector, where each element represents the probability that a sample belongs to the corresponding category, and the sum of all probabilities is 1, ensuring the interpretability of the output. Finally, based on the probability distribution vector, the fault category corresponding to the highest probability value is selected as the final fault detection result output. For example, if the probability value corresponding to an arc grounding fault is the highest, then the current sample is determined to have experienced an arc grounding fault. The fault detection results can be directly provided to distribution network maintenance personnel or feeder automation terminals, providing a basis for fault isolation and power restoration decisions.

[0064] According to another aspect of this application, a multi-scenario fault sample set is constructed, including:

[0065] S1.1: Collect raw zero-sequence voltage and raw zero-sequence current signals under different neutral grounding methods, different fault types, and different operating conditions.

[0066] The primary step in constructing a high-quality fault sample set is to systematically acquire raw electrical quantities reflecting the multi-dimensional characteristics of single-phase grounding faults from the physical environment of the distribution network. Specifically, voltage and current transformers with synchronous sampling capabilities are deployed at the bus outlets, feeder ends, and line segmentation points of multiple substations or switching stations. Using fault recording devices or distribution terminals with transient recording functions, raw zero-sequence voltage and current signals are continuously recorded for at least two cycles before the fault and at least ten cycles after the fault, at a sampling rate of no less than 64 points per power frequency cycle. In a preferred embodiment, the sampling rate is set to 128 points per power frequency cycle or higher to fully preserve the high-frequency transient details of the initial fault instant.

[0067] According to one aspect of this application, signal acquisition is not performed under a single operating condition, but rather purposefully covers multiple neutral grounding methods. For example, acquisition is conducted at different substations within the same distribution network or at different busbar sections of the same substation, targeting both ungrounded neutral systems and systems grounded via arc suppression coils (covering different compensation levels, including under-compensation, full compensation, and over-compensation). Under different neutral grounding methods, the impedance characteristics of the zero-sequence network are drastically different, and the amplitude, phase, and attenuation characteristics of the fault current also exhibit significant differences. Including both in a unified sample set can endow the model with the ability to generalize and discriminate across grounding methods.

[0068] Furthermore, the coverage of fault types is also crucial to the success of multi-scenario data acquisition. Besides common metallic grounding faults (where the grounding transition resistance is close to zero), this application focuses specifically on high-resistance grounding faults and arc grounding faults. High-resistance grounding faults are simulated by connecting power resistors of varying resistance values ​​in series at the fault point, covering a typical range from hundreds to thousands of ohms. In this type of fault, the fault current is weak, and its characteristics are easily masked by load fluctuations or transformer measurement errors. The simulation of arc grounding faults utilizes an arc generator to reproduce the arc extinction and reignition process when the current crosses zero, generating intermittent high-frequency pulse trains and sawtooth fluctuations in zero-sequence voltage. The diversity of operating conditions is also taken into consideration. The above fault simulation and signal acquisition processes are repeated under different load levels in different seasons and at different times, as well as under different levels of harmonic distortion caused by the penetration rate of new energy sources. Finally, a raw signal database covering multi-dimensional scenario information is compiled, providing a solid physical data foundation for subsequent denoising and sample processing.

[0069] S1.2: Perform wavelet threshold denoising on the original zero-sequence voltage signal and the original zero-sequence current signal to obtain the denoised zero-sequence voltage signal and zero-sequence current signal.

[0070] The raw zero-sequence voltage and zero-sequence current signals collected from the field are inevitably contaminated by electromagnetic interference, transformer noise, and quantization noise. Weak fault characteristics, especially the low-frequency, small-amplitude offset of high-resistance grounding faults and the high-frequency, low-energy pulses of arc grounding faults, are easily submerged in background noise. Therefore, effective noise reduction processing must be implemented before feature extraction. This application employs a wavelet thresholding denoising method to suppress noise while preserving the singularity and abrupt change edges of the fault transient signal to the greatest extent possible.

[0071] In one alternative implementation, based on the non-stationary characteristics of the zero-sequence signal, a wavelet basis function with good time-frequency tight support and symmetry is first selected, such as the db4 wavelet from the Daubechies series or the sym8 wavelet from the Symlets series. The determination of the number of decomposition levels comprehensively considers the signal sampling frequency and the frequency band where the power frequency component is located. For example, for a sampling rate of 128 points per power frequency cycle, selecting 5 to 7 decomposition levels can effectively separate the noise-dominated high-frequency wavelet coefficients from the signal-dominated low-frequency wavelet coefficients. Discrete wavelet transforms are then performed on the original zero-sequence voltage signal and zero-sequence current signal, respectively, to extract approximate coefficients and detail coefficients at each scale layer by layer.

[0072] Subsequently, we proceed to the core step of threshold processing. The method of threshold calculation directly affects the denoising effect. According to a further improvement in this embodiment, an adaptive threshold criterion is adopted. That is, for each layer of wavelet coefficients, the threshold size is dynamically determined based on the statistical characteristics of the coefficients at that layer, rather than using a single fixed threshold. For example, the method based on Stein's unbiased risk estimation can automatically select the optimal threshold according to the coefficient distribution, avoiding the accidental damage to weak fault features caused by hard truncation. Regarding the threshold shrinkage strategy, for low-scale detail coefficients representing transient changes, a soft threshold function is preferentially used, causing the processed coefficients to shrink towards zero overall, thereby achieving smooth denoising. For high-scale approximate coefficients representing the main contour of the signal, a hard threshold function is used or they are completely preserved to maintain the overall shape of the fault signal without distortion. After threshold processing, the corrected wavelet coefficients are used for inverse wavelet transform reconstruction to obtain the denoised zero-sequence voltage signal and the denoised zero-sequence current signal. After this step, random noise and periodic power frequency electromagnetic interference in the signal are significantly suppressed, while the fine structures that are crucial for subsequent feature extraction, such as the steep rising edge and high-frequency oscillation tail during the fault transient process, are well preserved.

[0073] S1.3: The sliding window method is used to cut the denoised zero-sequence voltage signal and zero-sequence current signal into equal lengths to generate multiple samples. A corresponding fault type label is added to each sample to form a multi-scenario fault sample set.

[0074] The denoised continuous time series signal cannot be directly used as input to the fault detection model; it needs to be segmented into equal-length, independent, and semantically clear sample units. This application uses a sliding window method to accomplish this transformation. A fixed-length time window and a fixed moving step size are set. Starting from the beginning of the signal, signal segments within the window are sequentially extracted as samples. The window slides forward along the time axis with a fixed step size until it covers the end of the signal. The selection of the window length must consider both the complete inclusion of fault features and the sufficiency of the number of samples. For example, when the sampling rate is 128 points per power frequency cycle, the window length can be set to 512 or 1024 points, corresponding to 4 to 8 power frequency cycles, which is sufficient to cover the main stages of a single-phase ground fault from the initial instant to the end of the transient process. The moving step size can be set to one-quarter or one-half of the window length, increasing the number of samples through partial overlap and alleviating the sample imbalance problem.

[0075] According to one aspect of this application, each sample obtained through sliding window truncation is assigned a precise corresponding fault type label. The label is determined based on the actual fault state of the distribution network within the time period of the signal segment. Specifically, segments truncationed from the normal operation period before the fault occurs are labeled as "normal state"; segments truncationed from the duration of a metallic grounding fault are labeled as "metallic grounding fault"; and so on, forming a label system containing complete category labels such as "high-resistance grounding fault" and "arc grounding fault". The label format adopts one-hot encoding, which is common in the field of machine learning. That is, each label is represented as a vector with a length equal to the total number of fault categories, where only the element corresponding to the category index position is 1, and the rest are 0. All signal samples truncationed by sliding window are paired one-to-one with their corresponding one-hot encoded labels, ultimately constructing a multi-scenario fault sample set. This sample set consists of denoised zero-sequence voltage and zero-sequence current time-series segments at the signal level, and is labeled with precise fault category labels at the semantic level. Together, they constitute a complete data infrastructure for model training and performance evaluation under the supervised learning paradigm.

[0076] According to another aspect of this application, multidimensional time-frequency input features are obtained, including:

[0077] S2.1: For each sample, high-frequency transient features are extracted by zero-phase high-pass filtering.

[0078] The first approach to multidimensional time-frequency feature extraction focuses on extracting high-frequency components reflecting the initial transient process of a fault from the denoised zero-sequence voltage and zero-sequence current samples. Single-phase ground faults are often accompanied by a sudden drop in voltage and a sudden rise in current. These instantaneous changes manifest as rich high-frequency components in the frequency domain. Especially for arc ground faults, the repeated extinction and reignition at the current zero-crossing point can generate significant pulse trains in the hundreds or even thousands of hertz frequency band. To accurately capture these high-frequency transient features without introducing phase distortion, this application employs a zero-phase digital filter.

[0079] In a preferred embodiment, a high-pass finite impulse response (FIR) filter is first designed based on the sampling frequency and the power frequency. Its cutoff frequency is set between 100Hz and 150Hz, effectively attenuating the 50Hz fundamental power frequency component and its lower harmonics, while completely preserving the high-frequency oscillations and traveling wave components excited by the fault transient process. Zero-phase filtering is achieved through forward-backward double filtering: first, the sample sequence is passed forward through the filter; then, the output is flipped on the time axis and passed through the same filter again; finally, the second output is flipped back to the original time sequence. This process ensures that the filter meets the high-pass requirement in amplitude-frequency characteristics while maintaining a constant zero phase-frequency characteristic. The phase relationship of each frequency component in the output signal is completely consistent with the input signal, eliminating the phase shift problem inherent in conventional filters. Passing the denoised zero-sequence voltage and zero-sequence current samples one by one through this zero-phase high-pass filter, the output is the high-frequency transient characteristic. In this feature sequence, the steep wavefront and local high-frequency oscillation details at the moment of fault occurrence are highlighted, while the steady-state power frequency background is significantly weakened, enabling the fault discrimination path that relies on high-frequency information to focus on the abrupt change mode and waveform singularity of transient energy.

[0080] S2.2: For each sample, extract the power frequency steady-state features through zero-phase low-pass filtering.

[0081] Complementing the high-frequency path, the second feature extraction path focuses on mining steady-state offset information in the power frequency and its adjacent frequency bands within the fault signal. In certain fault types, especially high-impedance grounding faults, high-frequency transient energy is extremely limited, and the fault characteristics are mainly manifested as a slow increase in zero-sequence voltage and a small phase shift in zero-sequence current. This information is concentrated in the low-frequency region at and near the power frequency. If only the high-frequency path is relied upon, such faults are easily missed.

[0082] According to one aspect of this application, a zero-phase low-pass filter is constructed with a cutoff frequency set around 50Hz to 60Hz. This filter allows only the fundamental power frequency component and any potentially very low-frequency interharmonics to pass through, while effectively attenuating harmonics above 100Hz and transient high-frequency components. Consistent with the high-frequency path, this low-pass filter also employs a forward-backward quadratic filtering structure to ensure zero-phase characteristics. The denoised zero-sequence voltage and zero-sequence current samples are input to this zero-phase low-pass filter, and the output yields the power frequency steady-state characteristics. This characteristic sequence preserves the gradual change in fundamental amplitude and the slow phase drift characteristics before and after the fault, while eliminating high-frequency noise and background harmonic interference unrelated to the fault. For example, when a high-resistance grounding occurs in a grounding system via an arc suppression coil, the steady-state power frequency component of the zero-sequence voltage exhibits a specific pattern of change due to the compensation effect of the arc suppression coil. This change is clearly presented in the power frequency steady-state characteristics, becoming a key basis for identifying such faults.

[0083] S2.3: For each sample, extract modal time-frequency features through variational mode decomposition.

[0084] In addition to the frequency band division features extracted by high-pass and low-pass filtering, this application introduces variational mode decomposition (VMD) as a third feature extraction path to achieve refined analysis of the signal's time-frequency structure. VMD is a completely non-recursive adaptive signal decomposition method that decomposes the input signal into a predetermined number of K intrinsic mode functions (IMFs) with finite bandwidth. Each IMF revolves around a specific center frequency, and the modes exhibit minimal aliasing in the frequency domain. Compared to traditional recursive methods such as empirical mode decomposition (EMD), VMD has a solid theoretical foundation in variational optimization and is more robust to noise and sampling effects.

[0085] In one optional implementation, for each denoised zero-sequence voltage and zero-sequence current sample, the number of decomposed modes K is set to 3 to 5, and each intrinsic mode function and its corresponding center frequency are solved iteratively using the alternating direction multiplier method. After decomposition convergence, each sample is represented as the sum of K intrinsic mode functions, each mode occupying a different frequency band. Subsequently, based on prior knowledge of fault detection, namely the characteristic frequency band distribution patterns of different types of faults, several order mode functions most relevant to the fault characteristic frequency band are automatically selected for reconstruction. For example, for arc grounding faults, their characteristic frequency bands are often concentrated in the range of several hundred hertz, exhibiting intermittent oscillation clusters; therefore, intrinsic mode functions with center frequencies falling within this frequency band are selected for reconstruction. For high-resistance grounding faults, the fault characteristics are mainly presented in the low-frequency band near the power frequency; therefore, the first or second order mode function with the lowest center frequency is selected. The reconstructed signal sequence is the modal time-frequency feature. This feature combines time resolution and frequency resolution, enabling it to accurately characterize the time-varying amplitude and instantaneous frequency evolution trajectory of specific frequency band components in fault signals, providing a refined information dimension that conventional filters cannot match for fault type identification.

[0086] S2.4: Stack high-frequency transient features, power frequency steady-state features, and modal time-frequency features in the channel dimension to form multi-dimensional time-frequency input features.

[0087] Through three heterogeneous processing pathways, each denoised zero-sequence voltage and zero-sequence current sample is transformed into three different but complementary feature representations. To enable these features to be synergistically utilized in a unified deep learning model, they need to be integrated into a single structured data unit. This application employs a channel-dimension stacking approach to achieve this integration.

[0088] Specifically, the high-frequency transient feature sequence, power frequency steady-state feature sequence, and modal time-frequency feature sequence of the same zero-sequence voltage sample are treated as three independent channels and concatenated along the newly added channel dimension. Similarly, the three feature sequences of the zero-sequence current sample are processed in the same way. The final data structure is in the form of a three-dimensional tensor, whose three dimensions correspond to the number of channels (i.e., the number of feature types), the time step length, and the number of signal sources (zero-sequence voltage and zero-sequence current), respectively. In a preferred embodiment, if zero-sequence voltage and zero-sequence current signals are used simultaneously, the number of channels is expanded to six or they are processed independently before fusion. This three-dimensional tensor is the multi-dimensional time-frequency input feature, where the value at each spatial location represents the feature response intensity of a specific signal source at a specific time and under a specific frequency band processing method. This multi-channel juxtaposition structure allows the subsequent convolutional neural network to perform convolution operations in parallel on different feature channels, learn the joint patterns of cross-frequency components, and organically integrate transient details, steady-state shifts, and time-frequency textures, providing information-rich and structurally regular input for multi-scale local feature extraction.

[0089] According to another aspect of this application, attention fusion features are obtained through attention fusion, including:

[0090] S3.1: Input the multi-dimensional time-frequency input features in parallel to three convolutional branches with different kernel sizes, and extract local fault features at different scales to obtain multi-scale feature maps.

[0091] After constructing the multidimensional time-frequency input feature tensor, the next step is to extract local features at multiple scales. This application designs a three-branch parallel multi-scale convolutional neural network architecture, aiming to capture the local structural patterns of fault signals from receptive fields at different times simultaneously. A single-size convolutional kernel can only focus on a local neighborhood of a specific width, while fault features may manifest as abruptly changing narrow pulses or a gradually wide envelope at different types and stages. Therefore, a multi-scale parallel sampling strategy is required.

[0092] According to one aspect of this application, the first branch is configured with a small convolutional kernel, exemplarily 1×3 in size, whose receptive field covers only 3 consecutive sampling points, corresponding to approximately 0.47 milliseconds for a sampling rate of 128 points per power frequency cycle. This makes it extremely adept at capturing abrupt changes within extremely short time windows, such as current spikes during arc reignition and steep edges of voltage drops. The second branch is configured with a medium-sized convolutional kernel, exemplarily 1×5, expanding the receptive field to 5 sampling points, capable of capturing transitional processes on the order of tens of milliseconds, such as the oscillating decay pattern of zero-sequence voltage transitioning from transient to steady state in the early stages of a fault. The third branch is configured with a larger convolutional kernel, exemplarily 1×7, further expanding the receptive field and focusing on extracting local contour features lasting several milliseconds or even longer, such as the local slope change trend of the zero-sequence current envelope. Each convolutional branch is followed by a batch normalization layer and a linear rectified activation function after the convolution operation to improve training stability and introduce nonlinearity. The multidimensional time-frequency input features are fed as a single input to these three branches. After convolution and activation, each branch outputs a local feature map with a configurable number of channels: a small-scale feature map, a medium-scale feature map, and a large-scale feature map. These three sets of feature maps have the same time step length in the spatial dimension (assuming equal-length padding), and respectively encode the local response patterns of the input signal at different granularities. They are collectively referred to as multi-scale feature maps.

[0093] S3.2: Calculate the attention weights for the multi-scale feature maps to obtain the attention weights corresponding to each scale feature map.

[0094] The multi-scale feature maps obtained from the three convolutional branches each carry local feature information at different receptive field levels. However, for a specific fault type, features at different scales are not equally important in discrimination. For example, the identification of metallic grounding faults may rely more on the voltage drop depth in large-scale contour features, while the identification of arc grounding faults highly depends on the high-frequency pulse details in small-scale features. Simply averaging or fusing the multi-scale feature maps at a fixed ratio will not meet the diverse feature representation requirements of fault types. Therefore, this application introduces an attention weighting mechanism to adaptively assign differentiated fusion weights to each scale.

[0095] In one optional implementation, the calculation of attention weights consists of three steps: convergence, compression, and activation. First, the small-scale, medium-scale, and large-scale feature maps output from the three branches are concatenated along the channel dimension to form a comprehensive multi-scale feature representation. Alternatively, to reduce the number of parameters, element-wise addition is used to fuse them into a comprehensive feature map with the same number of channels. Next, global average pooling is performed on this comprehensive feature map, compressing the feature values ​​of all time steps within each channel into a global scalar. This global scalar converges the average activation intensity of the corresponding channel across the entire time dimension, reflecting the overall activity level of the features encoded by that channel. Finally, the compressed feature vector is passed sequentially through a fully connected layer and a sigmoid activation function. The fully connected layer is responsible for learning the correlations and interactions between channels, while the sigmoid function maps the output to the interval between 0 and 1, generating an attention weight vector that matches the number of input channels. Each element in the attention weight vector corresponds to the weight coefficient of a specific channel in the original feature map at a certain scale, and its value represents the contribution of that channel to the fault detection task under the current input sample. Through the training process of backpropagation and gradient descent, the attention weight generation network can automatically learn a set of weight allocation strategies that are adaptive to different failure modes.

[0096] S3.3: Use attention weights to perform weighted fusion of multi-scale feature maps to generate attention fusion features.

[0097] After obtaining the attention weight vector, a channel-level weighted fusion operation is performed on the original multi-scale feature map using these weights to generate the final attention-fused feature. This is the key connection point between the attention mechanism and the multi-scale features; the accuracy of the weights directly determines the quality of the fused feature.

[0098] Specifically, the generated attention weight vector is first split according to the number of channels in the output feature map of each convolutional branch, resulting in sub-weight vectors corresponding to small-scale, medium-scale, and large-scale feature maps, respectively. Then, each sub-weight vector is multiplied channel-wise with its corresponding scale feature map; that is, for each channel of the feature map, the feature values ​​at all time steps within that channel are multiplied by the corresponding attention weight coefficient. If the weight coefficient of a channel approaches 1, the features of that channel are fully preserved and emphasized; if the weight coefficient of a channel approaches 0, the features of that channel are significantly suppressed or even masked. The three scale feature maps, after weighting, are re-concatenated along the channel dimension, or element-wise added while maintaining the channel dimension, ultimately forming the attention fusion feature. In a preferred embodiment, a channel-dimensional concatenation method is used to preserve the distributed representation of features at different scales, and the final output attention fusion feature has the same number of channels as the sum of the number of channels in the three branches. This fusion method allows the model to dynamically adjust its reliance on local information at different scales based on the actual characteristics of the input signal. When noise is strong or interference is significant, it automatically reduces its dependence on specific scale feature channels that are susceptible to interference, while fully activating relevant channels when features are obvious. This achieves the adaptability and anti-interference capability of feature fusion.

[0099] According to another aspect of this application, global temporal features are extracted from the S4 state-space model, including:

[0100] S4.1: Perform sequence dimension transformation on the attention fusion features and add positional encoding to obtain a feature sequence with positional information.

[0101] After multi-scale extraction and adaptive fusion, attention fusion features have acquired the ability to express the local structure of fault signals at multiple granularities. However, accurate fault determination depends not only on local morphology but also on the temporal order and dependencies of these local patterns. Therefore, these features need to be fed into the S4 state-space model to extract global temporal features, and prior to this, data format adaptation and temporal information injection need to be completed.

[0102] According to one aspect of this application, a sequence dimension transformation is first performed on the attention fusion features. Depending on the model design, the original dimension of the attention fusion features may be three-dimensional, where batch size, number of channels, and time step length are represented, respectively. S4 state-space models typically require input in sequence format, i.e., batch size, sequence length, and feature dimension. Through dimension permutation and reshaping operations, the number of channels and feature dimension are unified or mapped, ensuring that there is a feature vector of fixed dimension at each time step. For example, if the attention fusion features contain N channels and T time steps, the N feature values ​​across channels at each time step are compressed or rearranged into a feature vector of length N, and the entire sequence consists of T such feature vectors.

[0103] Furthermore, the convolutional computations within the S4 model are essentially time-shift invariant. Without positional information, the model cannot distinguish the order of different time steps in the sequence, which is unacceptable for fault detection tasks that rely on temporal causality. Therefore, after the sequence dimension transformation, a learnable positional encoding is added to each time step in the sequence. The positional encoding is an embedding vector with the same dimension as the feature vector, and its parameters are optimized synchronously with other parts of the network during model training. In an optional implementation, the positional encoding is implemented through a randomly initialized trainable embedding layer, where each absolute time position corresponds to an independent embedding vector, which is directly added element-wise to the feature vector of the corresponding time step. The result of the addition is a feature sequence with positional information. This sequence retains the local semantic information in the attention fusion features and embeds positional identifiers that distinguish temporal order, laying a correct input foundation for the subsequent global modeling of the S4 model.

[0104] S4.2: Input the feature sequence with location information into the global feature extractor, which is composed of stacked S4 state space model blocks. The sequence is evolved through the internal state space equation to capture long-range dependencies and output global temporal features.

[0105] Once the feature sequences with location information are ready, they are fed into the core temporal modeling component of this application: a global feature extractor composed of stacked multi-layer S4 state-space model blocks. The S4 model achieves efficient parallel processing of long sequences through structured state-space equations, while maintaining the ability to model long-range dependencies, thus breaking through the bottleneck of serial computation in traditional recurrent neural networks.

[0106] Specifically, each S4 model block encapsulates a set of continuous-time state-space equations, mathematically represented as state equations and observation equations. The state equations describe the temporal evolution of a hidden state vector, while the observation equations define how to generate the output from the hidden state. After discretization, this continuous-time dynamic system is transformed into an efficient convolutional kernel capable of performing forward computation in parallel across all time steps of the sequence, eliminating the need for sequential iterations like those in recurrent neural networks. The S4 model imposes specific low-rank and structured constraints on the state transition matrix, allowing the convolutional kernel computation to be completed in linear time complexity using Fast Fourier Transform or special parameterization techniques, maintaining efficiency even for long sequences with thousands of time steps.

[0107] In practical processing, the feature sequence with location information is sequentially passed through multiple layers of S4 model blocks. Shallow S4 blocks tend to capture short-range interactions between adjacent time steps, while deep S4 blocks gradually abstract long-range dependency patterns spanning hundreds of time steps. Through layer-by-layer evolution and transmission, various long-term patterns in the fault signal are fully extracted: for example, the periodic intervals of intermittent reignition in arc faults, the slow rising trend of zero-sequence voltage in high-resistance grounding faults, and the exponentially decaying envelope of transient oscillations are all fully encoded in the output global time-series features. Finally, the global feature extractor outputs an output sequence of the same length as the input sequence, or only takes the output of the last time step as a summary representation of the entire sequence, which is the global time-series feature, and enters the subsequent classification and discrimination stage.

[0108] According to another aspect of this application, the output fault detection results include:

[0109] S5.1: Input the global temporal features into a classifier consisting of a fully connected layer and a Softmax activation function, and output a fault probability distribution vector.

[0110] After the S4 state-space model completes the extraction of global temporal features of the input signal, the fault detection process enters the final classification decision stage. This application employs a concise and effective classifier, which consists of a fully connected layer and a cascaded Softmax activation function, responsible for mapping the high-dimensional global temporal features to the probability space of each fault category.

[0111] According to one aspect of this application, if the S4 model outputs global temporal features of the full sequence length (i.e., each time step corresponds to an output feature vector), a pooling operation is first performed on it to obtain a fixed-length summary representation. In a preferred embodiment, global average pooling is used to aggregate the sequence features along the time dimension to obtain a feature vector covering the statistical information of the entire sequence. If the S4 model has already output a summary representation, it can be directly fed into a fully connected layer. The weight matrix dimension of the fully connected layer is the feature dimension multiplied by the total number of fault categories, and the bias vector length is the total number of fault categories. This layer performs a linear transformation on the input feature vector and outputs an original score vector with a length equal to the number of fault categories. Each score reflects the original evidence strength that the current sample belongs to the corresponding fault category. Subsequently, the Softmax activation function performs a normalized exponential operation on the original score vector, mapping the scores of each category to probability values ​​between 0 and 1 with a sum of 1, generating a fault probability distribution vector. Each probability element in this vector can be independently interpreted as the model's confidence in that type of fault, making the detection results highly interpretable and facilitating the review and traceability of model decisions by maintenance personnel.

[0112] S5.2: Select the fault category corresponding to the maximum probability in the fault probability distribution vector as the final fault detection result output.

[0113] Finally, a clear state determination is made from the fault probability distribution vector. This application uses the maximum probability decision criterion to complete this determination, which is simple, definite, and compatible with the probability output characteristics of the Softmax classifier.

[0114] Specifically, a comparison search is performed on all probability values ​​in the fault probability distribution vector to locate the probability element with the largest value and obtain its corresponding index position. Since there is a predefined fixed mapping relationship between the output nodes of the fully connected layer of the classifier and the fault category labels, this index position can be directly converted into the corresponding fault category name. For example, index 0 corresponds to "normal state," index 1 corresponds to "metallic grounding fault," index 2 corresponds to "high-resistance grounding fault," and index 3 corresponds to "arc grounding fault," etc. Finally, the fault category name is output as the detection result to the feeder terminal unit, the distribution network automation master station, or the local human-machine interface, providing accurate decision-making basis for subsequent fault isolation, load transfer, and emergency repair scheduling. In actual deployment, the detection results can also be filtered according to a preset confidence threshold. A fault is only confirmed when the maximum probability value exceeds the threshold; otherwise, the previous detection state is maintained. This further suppresses false alarms caused by transient interference and improves the operational stability of the entire detection system in complex field environments.

[0115] Compared with existing technologies, significant performance improvements have been achieved in multiple dimensions, including detection accuracy, scene adaptability, anti-interference capability, and computational efficiency, as reflected in the following aspects:

[0116] High detection accuracy and strong adaptability to complex operating conditions: This invention improves the detection accuracy of different types of single-phase grounding faults, especially in complex operating conditions such as high-resistance grounding and arc grounding, which pose challenges to existing technologies. This achievement is attributed to a multi-level innovative design. At the feature construction level, it abandons the traditional approach of relying solely on a single filter or a single signal decomposition method, and innovatively employs three heterogeneous paths in parallel—zero-phase high-pass filtering, zero-phase low-pass filtering, and variational mode decomposition—to extract multi-dimensional time-frequency features of zero-sequence voltage and zero-sequence current signals. The high-pass filtering path focuses on capturing the high-frequency transient pulses and oscillation details at the initial moment of the fault, the low-pass filtering path retains the power frequency steady-state characteristics reflecting the slow shift in fundamental amplitude and phase before and after the fault, and the variational mode decomposition path extracts time-varying resonant mode information within a specific frequency band in a refined manner through adaptive frequency band division. The three pathways complement each other, simultaneously covering the significant steady-state voltage drop characteristics in metallic grounding faults, the weak low-frequency small-amplitude offset characteristics in high-resistance grounding faults, and the intermittent high-frequency pulse train characteristics in arc grounding faults, fully meeting the needs of different fault types for differentiated feature expression. At the multi-scale local feature extraction level, a three-branch parallel convolutional structure with large, medium, and small kernel sizes is employed to capture large-scale contour features and small-scale abrupt change features respectively, avoiding the deficiency of a single-scale convolutional kernel in insufficiently characterizing the diversity of fault signal morphology. Combined with the excellent modeling capability of the S4 state-space model for long-sequence global dependencies, complete temporal logic capture of the entire fault development process is achieved. The organic coupling of these technical means enables this invention to maintain high accuracy detection performance in various common field scenarios with low signal-to-noise ratios and weak features, such as arc grounding, high-resistance grounding, and scenarios with complex harmonic interference, effectively overcoming the problems of poor scenario adaptability and high false alarm rate caused by the single feature expression of existing methods.

[0117] With strong anti-interference capabilities and significant robustness to noise and power grid harmonics, this invention addresses the challenges of fault detection in the distribution network environment. The network environment is rife with electromagnetic interference, transformer measurement noise, and background harmonics introduced by new energy grid connection and power electronic equipment switching. These non-ideal factors severely threaten the reliability of fault detection. This invention collaboratively constructs a comprehensive anti-interference system across multiple technical levels. In the data preprocessing stage, wavelet threshold denoising is first used to reduce noise in the original zero-sequence signal. An adaptive threshold criterion is applied to the noise coefficient at different wavelet decomposition scales, either by soft threshold contraction or hard threshold zeroing. This suppresses random noise while preserving the steep edges and singular abrupt changes of the fault transient signal to the maximum extent possible, preventing weak fault features from being overwhelmed by noise. In the feature extraction stage, zero-phase high-pass and low-pass filters are used to extract high-frequency transient features and power frequency steady-state features, respectively. The zero-phase filter design ensures that the phase relationship of each frequency component of the signal is not distorted. Simultaneously, a precisely set cutoff frequency effectively filters out harmonic interference and out-of-band noise, retaining only the frequency band components with clear physical significance for fault identification. In the feature fusion stage, an attention weighting mechanism is introduced, enabling the network to autonomously learn and generate importance weights for feature channels at various scales. Feature channels with reduced signal-to-noise ratios due to interference are automatically suppressed with smaller weights, while high-quality feature channels carrying valid fault information are enhanced with larger weights. This triple defense of preprocessing noise reduction, frequency band selective extraction, and adaptive feature enhancement enables the invention to exhibit excellent robustness against interference factors such as power grid harmonics, random noise, and transient electromagnetic interference. It overcomes the inherent limitations of conventional one-dimensional convolutional neural network methods, which are highly sensitive to input data quality and experience rapid performance degradation under strong noise conditions.

[0118] High inference speed, supporting deployment on edge devices such as feeder terminals in distribution networks: Distribution network fault detection has stringent real-time requirements, especially on edge computing devices such as feeder terminal units, where computing resources and power consumption budgets are very limited. Model inference latency directly affects the response time of fault isolation and power restoration. This invention uses the S4 state-space model instead of the traditional recurrent neural network or Transformer structure in the global time-series modeling stage, achieving a breakthrough in computational efficiency. Recurrent neural networks, due to their recursive time-step serial computing mechanism, cannot be accelerated using parallel computing units such as graphics processors, and their training and inference speeds are linearly constrained by the sequence length. Although the Transformer's self-attention mechanism supports parallel computing, its computational complexity and memory usage increase quadratically with the sequence length, making it unbearable for long-sequence fault waveform data. In contrast, the S4 state-space model discretizes the continuous-time state-space equations into global convolutional kernels, enabling parallel forward computation across all time steps of the sequence. Furthermore, by imposing low-rank structured constraints on the state transition matrix, the computational complexity of the convolutional kernels is reduced to a linear relationship with the sequence length. This characteristic enables the S4 model to maintain its ability to capture global dependencies across thousands of time-step sequences while achieving an order-of-magnitude improvement in inference speed compared to recurrent neural networks and significantly reducing computational resource consumption compared to Transformers. Combined with a lightweight front-end design of multi-scale convolutional neural networks (CNNs), the overall model possesses the capability for millisecond-level real-time inference on edge computing platforms such as feeder terminal units. This fully meets the performance requirements of rapid fault detection and timely alarm in distribution networks, providing a feasible technical path for the large-scale deployment of single-phase grounding fault detection algorithms from the server side to the edge.

[0119] Example 2: The computer-readable storage medium of this example stores a computer program that, when executed by a processor, implements the steps in the single-phase grounding fault detection method based on the S4 state-space model of Example 1.

[0120] The computer-readable storage medium in this embodiment can be an internal storage unit of the terminal, such as the terminal's hard disk or memory; the computer-readable storage medium in this embodiment can also be an external storage device of the terminal, such as a plug-in hard disk, smart memory card, secure digital card, flash memory card, etc. equipped on the terminal; furthermore, the computer-readable storage medium can include both the terminal's internal storage unit and external storage devices.

[0121] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0122] Example 3: The computer device of this example includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the single-phase grounding fault detection method based on the S4 state-space model of Example 1.

[0123] In this embodiment, the processor can be an industrial-grade embedded processor with an integrated dedicated neural network acceleration unit, specifically including: a microcontroller with a neural network processing unit, a digital signal processor with an integrated AI acceleration engine, an embedded system-on-a-chip for edge AI, a field-programmable gate array with an integrated hard AI acceleration core, a customized fault detection application-specific integrated circuit, etc. The memory can include read-only memory and random access memory, and provide instructions and data to the processor. A portion of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.

[0124] Those skilled in the art will clearly understand that each implementation can be achieved using software plus the necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0125] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A single-phase earth fault detection method based on S4 state space model, characterized in that, Includes the following steps: Step 1: Obtain the zero-sequence voltage and zero-sequence current signals of the low-current grounding system under different single-phase grounding fault conditions, and construct a multi-scenario fault sample set; Step 2: Extract multi-dimensional time-frequency features from the samples in the multi-scenario fault sample set to obtain multi-dimensional time-frequency input features; Step 3: Use a multi-scale convolutional neural network to extract multi-scale local features from the multi-dimensional time-frequency input features, and obtain attention fusion features through attention fusion; Step 4: Input the attention fusion features into the S4 state space model, and extract global temporal features from the S4 state space model; Step 5: Based on global temporal features, use a classifier to classify faults and output fault detection results.

2. The single-phase earth fault detection method based on S4 state space model according to claim 1, characterized in that, Step 1 involves constructing a multi-scenario fault sample set, specifically including: The system collects raw zero-sequence voltage and raw zero-sequence current signals under different neutral grounding methods, different fault types, and different operating conditions. Wavelet threshold denoising is performed on the original zero-sequence voltage signal and the original zero-sequence current signal to obtain the denoised zero-sequence voltage signal and zero-sequence current signal; The sliding window method is used to cut the denoised zero-sequence voltage signal and zero-sequence current signal into equal lengths to generate multiple samples. Each sample is then labeled with a corresponding fault type to form a multi-scenario fault sample set.

3. The single-phase earth fault detection method based on S4 state space model according to claim 2, characterized in that, Step 2, multi-dimensional time-frequency feature extraction, specifically includes: For each sample, high-frequency transient features are extracted by zero-phase high-pass filtering, power frequency steady-state features are extracted by zero-phase low-pass filtering, and modal time-frequency features are extracted by variational mode decomposition. High-frequency transient features, power frequency steady-state features, and modal time-frequency features are stacked in the channel dimension to form multi-dimensional time-frequency input features.

4. The single-phase grounding fault detection method based on the S4 state-space model according to claim 3, characterized in that, Extracting modal time-frequency features through variational mode decomposition involves: performing variational mode decomposition on the sample to adaptively decompose it into multiple intrinsic mode functions with different center frequencies; selecting several intrinsic mode functions related to the fault characteristic frequency band from the decomposition results and recombining them to obtain modal time-frequency features.

5. The single-phase grounding fault detection method based on the S4 state-space model according to claim 4, characterized in that, Step 3, attention fusion, specifically includes: Multidimensional time-frequency input features are input in parallel to three convolutional branches with different kernel sizes to extract local fault features at different scales, resulting in a multi-scale feature map. The attention weights are calculated on the multi-scale feature maps to obtain the attention weights corresponding to each scale feature map. Attention weights are used to weight and fuse multi-scale feature maps to generate attention fusion features.

6. The single-phase grounding fault detection method based on the S4 state-space model according to claim 5, characterized in that, The specific steps for calculating attention weights on multi-scale feature maps are as follows: after concatenating or adding the multi-scale feature maps, they are sequentially passed through global average pooling, fully connected layers, and the Sigmoid activation function to generate attention weights.

7. The single-phase grounding fault detection method based on the S4 state-space model according to claim 5, characterized in that, Step 4 extracts global temporal features from the S4 state-space model, specifically including: The attention fusion features are subjected to sequence dimension transformation and positional encoding is added to obtain a feature sequence with positional information; The feature sequence with location information is input into a global feature extractor composed of stacked S4 state space model blocks. The sequence is evolved through internal state space equations to capture long-range dependencies and output global temporal features.

8. The single-phase grounding fault detection method based on the S4 state-space model according to claim 7, characterized in that, Step 5 outputs the fault detection results, specifically including: The global temporal features are input into a classifier consisting of a fully connected layer and a Softmax activation function, and the output is a fault probability distribution vector. The fault category corresponding to the maximum probability in the fault probability distribution vector is selected as the final fault detection result output.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the single-phase grounding fault detection method based on the S4 state-space model as described in any one of claims 1-8.

10. A computer device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the single-phase grounding fault detection method based on the S4 state-space model as described in any one of claims 1-8.