Distribution network single-phase earth fault detection method based on time sequence model
Through the Transformer-based fault identification model, combined with temporal self-attention and spatial cross-attention mechanisms, the problems of difficulty and low accuracy in locating single-phase grounding faults in distribution networks are solved, and high-precision fault identification and location are achieved.
Patent Information
- Application Number
- CN202510693270.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-16
AI Technical Summary
The existing technology is difficult to locate single-phase grounding faults in distribution networks, with low positioning accuracy. In addition, the fault location method based on steady-state signals is easily affected by the actual operating environment, resulting in misselection or omission.
A Transformer-based fault recognition model is adopted, combining linear embedding layers, Transformer main body, feature fusion module and prediction block. The temporal and spatial features of the current signal are extracted through temporal self-attention and spatial cross-attention mechanisms. A two-stage training strategy is used to train the model with real data and simulated data to generate fault status codes.
The recognition accuracy and reliability of single-phase grounding faults are improved, the generalization ability of the model is enhanced, and the fault point can be accurately identified and located in complex fault scenarios.
Smart Images

Figure CN120654129A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power big data, and in particular to a distribution network single-phase grounding fault detection method based on a time series model, and its corresponding computer program product, storage medium and computer equipment. Background Art
[0002] Automated identification of single-phase ground faults is a crucial safety monitoring tool for the safe operation of distribution lines. This fault accounts for over 80% of distribution system failures and often occurs in humid and rainy weather. It can be caused by a variety of factors, including tree obstructions, single-phase insulator breakdown on distribution lines, single-phase line breaks, and damage from small animals. This can cause current flow through the ground, leading to a difference in relative ground potential, resulting in serious consequences such as current imbalance, voltage fluctuations, equipment damage, and even fire.
[0003] The main causes of single-phase grounding faults include: a broken conductor that falls to the ground or rests on a crossarm; a conductor that is not securely tied or fixed in an insulator, falling onto the crossarm or the ground; excessive wind deflection of the conductor, or being too close to a building; a broken transformer high-voltage down conductor; a single-phase insulation breakdown or grounding of the high-voltage winding of a distribution transformer; an insulator breakdown; insulation breakdown of a branch fuse on the line; a tie on the upper crossarm of a conductor on the same pole that breaks and rests on the lower conductor; a lightning strike on the line; a tree that contacts the conductor due to poor tree access; bird damage; and floating objects (such as plastic sheeting and kites). Of these many causes, broken conductors, insulator breakdown, and tree short circuits are the most common causes of single-phase grounding faults on distribution lines.
[0004] Single-phase ground faults, the most common type of fault in distribution networks, pose multiple threats to power systems due to their concealed nature and time-sensitive nature. These faults can cause the voltage in the non-fault phase to suddenly rise to the line voltage, leading to direct damage such as insulation breakdown in equipment and cable overheating and melting. Furthermore, ground arcing can trigger secondary hazards such as forest fires and electric shocks. More seriously, the voltage fluctuations caused by the faults can trigger the disconnection of distributed generation (DGs), potentially leading to cascading failures in areas with high penetration of new energy sources.
[0005] Currently, scholars have proposed a variety of fault location methods based on steady-state signals, such as the zero-sequence current amplitude comparison method, the zero-sequence current direction method, and the zero-sequence admittance method. However, field operation results show that the line selection results based on steady-state algorithms are significantly affected by the actual operating environment. In some cases, there are even cases of incorrect selection or omission, which makes it impossible to achieve effective fault location. Summary of the Invention
[0006] In order to solve the problem of difficulty in locating single-phase grounding faults and low positioning accuracy in large-scale distribution networks, the present invention provides a distribution network single-phase grounding fault detection method based on a time series model, and its corresponding computer program product, storage medium and computer equipment.
[0007] The technical solutions provided by the present invention are as follows:
[0008] A method for detecting single-phase grounding faults in a distribution network based on a time series model comprises the following steps:
[0009] S1: Construct a Transformer-based fault identification model; the fault identification model includes a linear embedding layer, a Transformer body, a feature fusion module, and a prediction block; the fault identification model is used to generate a status code representing the fault status of each measuring point based on the current signals of the n input measuring points.
[0010] S2: Collect current information from all power measurement points in the specified distribution network. Synchronously extract the current signal graph of each measurement point according to the window length and add corresponding fault labels based on the fault status to generate a sample signal. Obtain a large number of sample signals to form a real-time data set.
[0011] S3: Based on the actual distribution network topology, a corresponding power grid simulation model was built using Pscad and Python. Using the power grid simulation module, different unidirectional ground faults were simulated. Current signals at each measurement point were collected and labeled with the corresponding faults to generate the required sample signals. A large number of sample signals were obtained to form a simulation dataset.
[0012] S4: The fault identification model is trained in two stages; in the training stage, the current signals at different measurement points input into the model are globally normalized.
[0013] In the first phase, training was performed using only simulated datasets, with contrastive loss as the loss function. In the second phase, training was performed using a mixed dataset containing both real and simulated datasets, with a combined contrastive and focal loss function. After both phases of training, the model parameters of the network model with the best verified performance were retained.
[0014] S5: Using the fault identification model retained in the previous step, the single-phase grounding fault of the distribution network is monitored in real time, so as to identify and locate the single-phase grounding fault of the distribution network according to the current signals of each measuring point in the specified distribution network.
[0015] As a further improvement of the present invention, the linear embedding layer is used to encode the current signals of each measuring point input in parallel into a corresponding feature matrix; the Transformer body is composed of 6 encoding layers, each of which includes an SCA module, a multi-head attention mechanism MSA using a TSA module, a feedforward layer, an LN layer, and a Dropout layer in sequence. The Transformer body is used to extract multi-level feature information from the input feature matrix of all measuring point signals and generate corresponding feature vectors. The feature fusion module is used to transform the original input current signal through a wavelet transform, and then perform feature encoding through a linear embedding layer, and then perform feature fusion of the encoded features with the output of the Transformer body and output them to the prediction block. The prediction block is composed of two fully connected layers, and is used to generate a status code representing the fault status of each measuring point based on the fused features of the measuring point.
[0016] As a further improvement of the present invention, for the feature matrix input by the first encoding layer in the Transformer body, a position vector is added to the feature vector of each measurement point through the absolute position encoding unit. Among them, the value PE of the i-th dimension in the position vector of the pos-th feature vector in the feature sequence is (pos,2i) and PE (pos,2i+1) as follows:
[0017]
[0018] In the above formula, d model Represents the dimension of the input feature vector.
[0019] As a further improvement of the present invention, the TSA module is used to capture the global dependency across time steps by calculating the correlation weights between each time step of each measurement point feature and other time steps, thereby identifying key change measurement points in the current signal.
[0020] As a further improvement to the present invention, the SCA module is used to construct a spatial correlation matrix based on the eigenvectors of the measurement points. The SCA module then quantifies the electrical coupling strength between the measurement points using attention weights, thereby modeling the propagation characteristics of the fault current in the spatial dimension. The electrical coupling strength reflects the topological connectivity and geographic distance between the measurement points.
[0021] As a further improvement of the present invention, the multi-head attention mechanism adopts 8 attention heads to perform parallel calculation of multi-head attention.
[0022] As a further improvement of the present invention, in each sample data of the actual data set and the simulation data, the current signal diagram of the measuring point where a single-phase grounding fault occurs is the current waveform data of the first 4 cycles and the last 8 cycles after the voltage mutation occurs.
[0023] As a further improvement of the present invention, discrete sampling is performed on the waveform of the current signal diagram, and the obtained feature vector consisting of 1024 current values is used as the input of the fault identification network.
[0024] As a further improvement of the present invention, the mean square error loss is selected as the required contrast loss, and the calculation formula of the joint loss L is as follows:
[0025]
[0026] In the above formula, represents the fault status of the i-th measuring point in the current distribution network predicted by the fault identification model, y represents the actual fault status of the i-th measuring point in the current distribution network; n represents the number of measuring points in the current distribution network; p t Indicates the closeness between the sample and the category; γ represents the focus parameter; α and β represent the weight coefficients of contrast loss and focal loss in the joint loss, respectively.
[0027] As a further improvement of the present invention, the status code output by the fault identification model is an n-bit binary code; when the value on any bit is 1, it indicates that a single-phase grounding fault has occurred at the measuring point; when the value on any bit is 0, it indicates that the measuring point is in a normal state.
[0028] The present invention also includes a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the distribution network single-phase grounding fault detection method based on the timing model as described above, and then outputs a status code representing the fault status of each measuring point based on the current signal input at each measuring point.
[0029] The present invention also includes a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the distribution network single-phase grounding fault detection method based on the timing model are implemented as described above, and then a status code representing the fault status of each measuring point is output according to the current signal inputted at each measuring point.
[0030] The present invention also includes a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the distribution network single-phase grounding fault detection method based on the timing model as described above are implemented, and then a status code representing the fault status of each measuring point is output according to the current signal of each measuring point input.
[0031] The present invention has the following beneficial effects:
[0032] The present invention designs a fault recognition model based on the transformer, which consists of a linear embedding layer, a backbone network, a feature fusion module, and a prediction head. The transformer body of the fault recognition model designed by the present invention uses a temporal self-attention mechanism and a spatial cross-attention mechanism to extract the temporal and spatial features of the current time series information of each input measurement point. In addition, this aspect also introduces absolute position encoding in the transformer body to characterize prior information such as the topological relationship between measurement points in the distribution network and line impedance. Therefore, the fault recognition model of the present invention can extract richer fault features to improve the recognition accuracy and reliability of single-phase faults.
[0033] In response to the problem of limited sample data containing fault characteristics in the existing power distribution network, the present invention provides two sources for sample data sets: one is to select single-phase ground fault data in actual production activities and store them as experimental data. The data in this part is difficult to obtain, and the amount of data is relatively small. The second is to use software simulation to produce single-phase ground fault current and voltage value changes that are more consistent with actual production activities. This method can accumulate a large amount of data in a short period of time, but the generated data is relatively ideal, and there will be a gap between the actual collected data. For the two types of sample data collected, the present invention has redesigned a two-stage training strategy. This significantly improves the generalization of the model and the practical value of the solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flowchart of the steps of the distribution network single-phase grounding fault detection method based on the time series model provided in Example 1 of the present invention.
[0035] Figure 2 This is a schematic diagram of the model architecture and principle of the fault identification model designed in Example 1 of the present invention.
[0036] Figure 3 The system topology diagram of a typical distribution network selected for the test experiment.
[0037] Figure 4 Module diagram of the fault identification model with feature fusion module designed for the present invention. DETAILED DESCRIPTION
[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.
[0040] Example 1
[0041] When a single-phase grounding fault occurs in a distribution network, the impact will vary depending on the distance from the fault measuring point and the topology. This is specifically reflected in the difference in numerical values of the current and voltage at the measuring point. Downstream measuring points close to the fault experience larger fluctuations and maintain their status after the grounding fault. Measuring points far from the fault, on the other hand, experience less impact, and the current waveform may show a trend opposite to that of the waveform close to the fault. Taking advantage of this feature, the solution provided in this embodiment designs a targeted neural network model, and uses all measuring points within a line as input. The neural network model is used to comprehensively analyze and compare the status of different measuring points, thereby finding the measuring point corresponding to the fault.
[0042] Specifically, if Figure 1 As shown, the distribution network single-phase grounding fault detection method based on the time series model provided in this embodiment includes the following steps:
[0043] S1: Build a fault recognition model based on Transformer. Figure 2 As shown, the fault identification model includes a linear embedding layer, a Transformer body, a feature fusion module and a prediction block. The fault identification model constructed in this embodiment is used to generate a status code representing the fault status of each measuring point based on the current signals of the n measuring points input. The status code output by the fault identification model of this embodiment is an n-bit binary code. When the value on any bit is 1, it indicates that a single-phase grounding fault has occurred at the measuring point, and when the value on any bit is 0, it indicates that the state of the measuring point is normal. For example, for a distribution network containing 8 measuring points, this embodiment synchronously inputs the current signals of the 8 measuring points into the fault identification module, and the fault identification module outputs an 8-bit status code. Among them, assuming that the output status code is 00100000, it means that a single-phase grounding fault has occurred at the measuring point No. 3 in the distribution network, and the states of other measuring points are normal.
[0044] In the fault identification model constructed in this embodiment, the linear embedding layer encodes the parallel input current signals of each measuring point into corresponding feature matrices. Assume that the input to the fault identification model is the T-point current time-series signals from n measuring points, where T represents the number of discrete sampled values of the current waveform data for the first four cycles and the last eight cycles of the voltage sudden change when the fault occurs. In the network structure of this embodiment, the value of T is set to 1024, meaning that the complete current waveform data is discretely sampled into a current time-series signal containing 1024 data points. The phenomenon embedding layer maps the T-point current time-series signals of n measuring points into a high-dimensional feature space, forming an initial embedding vector with spatiotemporal semantics. The number of measuring points in the model input can be adjusted based on the actual application scenario. In the network structure of this task, it is assumed that the number of measuring points in the distribution network is 32, and the number of input current time-series signals is also 32. Unlike traditional single-point models, this embodiment integrates data from multiple measuring points in parallel to construct a two-dimensional spatiotemporal matrix, enabling joint modeling of the temporal fluctuation characteristics of a single measuring point and the spatial variation characteristics between measuring points.
[0045] The Transformer main body consists of six encoding layers, each of which includes an SCA module, a multi-head attention mechanism (MSA) using a TSA module, a feedforward layer, a LN layer, and a dropout layer. The Transformer main body is used to extract multi-level feature information from all measurement point signals from the input feature matrix and generate corresponding feature vectors.
[0046] In power system fault diagnosis and analysis, the temporal characteristics of current signals and the spatial correlation information between multiple measurement points are crucial for accurately identifying fault types, locating fault locations, and predicting fault evolution trends. To fully exploit this critical information, the fault identification model constructed in this embodiment incorporates two attention mechanisms: Temporal Self-Attention (TSA) and Spatial Cross-Attention (SCA), which are used to model the complex temporal patterns of a single measurement point and the spatial propagation characteristics between multiple measurement points, respectively.
[0047] Among them, temporal self-attention can take into account that the current signal collected at a certain measuring point in the power system is usually expressed as long sequence data at a high sampling rate (such as 1024 time steps). These data not only have obvious temporal dependencies, but also often exhibit complex dynamic behaviors such as periodic fluctuations and transient mutations. For example, before and after a short-circuit fault occurs, the current signal will experience a sharp rise and decay process, while in load switching or lightning events, it may show a short spike or oscillating waveform. By calculating the correlation weight between each time step and other time steps, TSA can capture this global dependency across time steps, thereby effectively identifying key change nodes in the current signal (such as the start time of the fault, peak point, recovery stage, etc.). Compared with traditional recurrent neural networks (RNNs) or convolution operations, TSA can more flexibly model non-local time-dependent structures and weight the importance of different time periods, thereby enhancing the model's sensitivity and robustness to fault events.
[0048] Spatial cross-attention can characterize the electrical coupling relationships and fault propagation paths between multiple measurement points. This embodiment introduces spatial cross-attention. In a power distribution network containing multiple measurement points, each measurement point does not exist in isolation. Instead, it is influenced by factors such as the grid topology, line connection method, and geographical distance, forming a complex electrical coupling network. For example, a short circuit fault on a line may cause the current on adjacent lines to rise rapidly, resulting in a "fault propagation" phenomenon. SCA constructs a spatial correlation matrix between measurement points and uses an attention mechanism to quantify the mutual influence strength between different measurement points, thereby simulating the current conduction path and coupling strength in space. Specifically, each measurement point serves as a query, and the remaining measurement points serve as keys and values. The similarity scores between them are calculated to generate an attention weight, reflecting the degree of influence of other measurement points on the measurement point. This mechanism enables the model to automatically learn and model spatial characteristics such as "which measurement points have highly synchronized current responses" and "whether the fault propagates along a specific direction," providing strong support for subsequent fault location and causal reasoning.
[0049] In practical applications, the attention mechanism in this embodiment adopts a multi-head self-attention (MSA) parallel computing structure (a total of 8 attention heads) to achieve joint modeling in the time dimension and the space dimension, so that the model can adaptively focus on key spatiotemporal features. Specifically, in the time dimension, global dependency modeling is used to capture the dynamic behaviors of the current signal, such as periodic fluctuations and transient mutations; in the spatial dimension, based on the electrical coupling relationship between the measuring points (such as topological connection, geographical distance, etc.), a spatial correlation matrix is established to quantify the mutual influence intensity between different measuring points, thereby characterizing the propagation characteristics of the fault current in the power grid. In summary, MSA, TSA and SCA, starting from multiple dimensions of time and space, respectively, collaboratively model the dynamic evolution process and spatial propagation characteristics of the current signal in the power system, significantly improving the model's ability to understand complex fault scenarios and generalization performance.
[0050] In addition, the Transformer body of the fault identification model provided in this embodiment uses sine / cosine functions to generate a 1024-dimensional time series of absolute position encodings, which are used to characterize the spatial characteristics of the current signal at each measuring point in the entire distribution network. The absolute position encoding used in this embodiment can be used to characterize prior knowledge such as the physical connection distance and electrical impedance of the measuring point in the distribution network; it is then injected into the Transformer input layer via vector splicing. This encoding mechanism enables the model to explicitly learn the spatiotemporal correlation patterns of current fluctuations. When a fault occurs, the spatial attention weights of its neighboring measuring points are significantly higher than those of the distant measuring points, which is consistent with the actual propagation path of the fault current in the distribution network. This characteristic is consistent with the preset theory. The waveform fluctuations near the fault point are most obvious, and the waveform changes differ greatly from those at other measuring points. This is the part that the model is expected to focus on, further demonstrating the effectiveness of this mechanism.
[0051] Specifically, for the feature matrix input by the first encoding layer in the Transformer main body, this embodiment adds a position vector to the feature vector of each measurement point through the absolute position encoding unit. Among them, the value PE of the i-th dimension in the position vector of the pos-th feature vector in the feature sequence is (pos,2i) and PE (pos,2i+1) as follows:
[0052]
[0053] In the above formula, d model Represents the dimension of the input feature vector.
[0054] The feature fusion module is used to transform the original input current signal through wavelet transform, and then perform feature encoding through the linear embedding layer. The encoded features are then fused with the output of the Transformer body and output to the prediction block.
[0055] Finally, the prediction block consists of two fully connected layers and is used to generate a status code representing the fault status of each measurement point based on the fused features.
[0056] S2: Collect current information from all power measurement points in the specified distribution network. Synchronously extract the current signal graph of each measurement point according to the window length and add corresponding fault labels based on the fault status to generate a sample signal. Obtain a large number of sample signals to form a real-time data set.
[0057] The actual data set obtained in this embodiment includes both sample signals with single-phase ground faults and sample signals without unidirectional ground faults. The current signal graph for a measurement point with a single-phase ground fault is the current waveform data for the first four cycles and the last eight cycles after the voltage mutation. For sample signals without a single-phase ground fault, the signal flow graph is the current waveform data for 12 consecutive cycles. In this embodiment's actual data set, each sample signal can reflect a unidirectional ground fault at a single measurement point or multiple measurement points. In this embodiment, the sample label is a multi-bit status code representing the fault status of each measurement point in the sample signal. When the sample signal does not have a single-phase ground fault, all bits of this label are 0. When a unidirectional ground fault occurs at any measurement point, the corresponding bit in the sample label is 1. The number of 1s in the sample label represents the number of measurement points in the distribution network experiencing single-phase ground faults.
[0058] S3: Based on the actual distribution network topology, a corresponding power grid simulation model was built using Pscad and Python. Using the power grid simulation module, different unidirectional ground faults were simulated. Current signals at each measurement point were collected and labeled with the corresponding faults to generate the required sample signals. A large number of sample signals were obtained to form a simulation dataset.
[0059] During actual power grid operation, given the relatively low probability of single-phase grounding faults and the difficulty in obtaining a variety of spatial distributions of fault measurement points within the distribution network, training the fault identification network using only the actual data set may result in a network model with low generalization, making it difficult to adapt to actual fault identification needs. Therefore, this embodiment also simulates the operating state of the distribution network using simulation software, and then uses the simulation software to simulate and generate current signals of the distribution network under fault conditions at different measurement points, thereby obtaining the required simulated data set. Compared to the actual data set, the sample data in the simulated data set is more diverse. Using the two together will enable the fault network to more fully learn the characteristic information under different fault conditions, thereby improving the fault identification accuracy and generalization of the model.
[0060] S4: The fault identification model is trained in two stages; in the training stage, the current signals at different measurement points input into the model are globally normalized.
[0061] In the first phase, training was performed using only simulated datasets, with contrastive loss as the loss function. In the second phase, training was performed using a mixed dataset containing both real and simulated datasets, with a combined contrastive and focal loss function. After both phases of training were completed, the model parameters of the network model with the best verified performance were retained.
[0062] In this embodiment, the sample data set is divided into a training set, a validation set, and a test set. The data scales of the three can be flexibly set as needed. For example, the ratio of the data volume of the three is preferably 60%, 20%, and 20%. Among them, the validation set and the test set both use a mixed sample data set that contains both real data and simulation data. The training set includes two parts, the first part only includes simulation data, which is used to train the fault identification network in the first stage, and the second part is a mixed data set in which the simulation data and the real data are mixed in a preset ratio, which is used to train the fault identification network in the second stage. In this embodiment, by introducing simulation data, the mixed data set used by the network model in the training stage can cover all situations where single-phase grounding faults occur at any measuring point.
[0063] During training, the model learns based on the training set, then uses the validation set to adjust hyperparameters and prevent overfitting. Finally, the test set is used to evaluate the performance of all verified networks, and the model parameters of the fault identification network with the best performance are selected.
[0064] In this embodiment, the mean square error loss is selected as the required contrast loss during the network model training phase, and the calculation formula of the joint loss L is as follows:
[0065]
[0066] In the above formula, represents the fault status of the i-th measuring point in the current distribution network predicted by the fault identification model, y represents the actual fault status of the i-th measuring point in the current distribution network; n represents the number of measuring points in the current distribution network; p t Indicates the closeness between the sample and the category; γ represents the focus parameter; α and β represent the weight coefficients of contrast loss and focal loss in the joint loss, respectively.
[0067] S5: Using the fault identification model retained in the previous step, the single-phase grounding fault of the distribution network is monitored in real time, so as to identify and locate the single-phase grounding fault of the distribution network according to the current signals of each measuring point in the specified distribution network.
[0068] In the practical application phase of this embodiment, the fault identification network can be trained using a dataset related to a specific power distribution network, thereby obtaining a fault identification model that is specific to the specific power distribution network. Alternatively, the fault identification network can be trained using a large dataset corresponding to different power distribution networks, thereby obtaining a fault identification model that is applicable to different power distribution networks.
[0069] Example 2
[0070] In order to better apply the distribution network single-phase grounding fault detection method based on the time series model provided in Example 1, this embodiment further provides a computer program product, a storage medium, and a corresponding computer device that can implement the above method.
[0071] Specifically, this embodiment provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the steps of the distribution network single-phase grounding fault detection method based on the timing model as described above, and then outputs a status code representing the fault status of each measuring point based on the current signal input at each measuring point.
[0072] This embodiment also provides a storage medium storing a computer program. When the computer program is executed by a processor, the computer program implements the steps of the distribution network single-phase grounding fault detection method based on the timing model as described above, and then outputs a status code representing the fault status of each measuring point based on the current signal input at each measuring point.
[0073] This embodiment also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the distribution network single-phase grounding fault detection method based on the timing model as described above are implemented, and then a status code representing the fault status of each measuring point is output based on the current signal input from each measuring point.
[0074] The computer device provided in this embodiment includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the steps of the aforementioned microservice fault location method based on causal inference and knowledge graph are implemented, and the fault in the microservice is located according to the status data of the microservice operation process.
[0075] In actual applications, the computer device can be an embedded device and deployed in various terminal devices to support data processing and interaction. It can also be used as an independent computer device to support data processing needs in certain scenarios. This non-embedded computer device can be a laptop, tablet computer, desktop computer, or a medium or large computer device such as a rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster consisting of multiple servers) that can execute computer programs.
[0076] Specifically, the computer device of this embodiment includes at least, but is not limited to, a memory and a processor that can be interconnected via a system bus. In this embodiment, the memory (i.e., a readable storage medium) includes flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory can be an internal storage unit of the computer device, such as the hard disk or internal memory of the computer device. In other embodiments, the memory can also be an external storage device of the computer device, such as a plug-in hard disk equipped with the computer device, a smart memory card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory is generally used to store the operating system and various application software installed on the computer device. In addition, the memory can also be used to temporarily store various types of data that have been output or are about to be output.
[0077] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of a computer device.
[0078] Performance Testing
[0079] In order to verify the performance of the technical solution provided by the present invention, the technicians selected a specific power distribution network as an example to test the performance of the relevant solution. The test experiment process is as follows:
[0080] 1. Dataset
[0081] In this experiment, the data can be divided into the first and second batches based on their sources. The first batch of data was generated by using Pscad (PSCAD) and Python to interact with multiple simulation models. To obtain the simulation data, this experiment first built a runnable Pscad simulation model based on the topology of an actual power distribution network. This model was then used to generate the required simulation data. The second batch of data refers to data collected from an actual production environment. This data was obtained in real life and will be used in the subsequent descriptions.
[0082] 1.1 The first batch of data
[0083] The first batch of data comes from simulation data. Through the integration of Python and Pscad, batch simulations of multiple models and parameter combinations can be easily implemented. Once the script is written, hundreds or even thousands of parameter combinations can be automatically traversed and the results collected automatically. This is more efficient than manually clicking simulations and avoids repetitive work. The batch-automated generation of simulation data can quickly traverse a wider range of parameters, providing solid technical support for subsequent model training.
[0084] In this experiment, the schematic diagram of the simulated single-phase grounding line of the distribution network is as follows: Figure 3 As shown in the figure, a total of 8 detection points are simulated for real-time acquisition of current, voltage and other information in the line. When a voltage mutation occurs, the current waveform data of the first 4 cycles and the last 8 cycles are packaged as a sample data.
[0085] For each sample data point generated by the simulation, under the default initial conditions, assuming no single-phase ground fault has occurred on the line, the label information corresponding to the sample signal is recorded as: 00000000, with a length of 8 (the length of the measurement point). 0 indicates a normal state. When a single-phase ground fault occurs in a certain area, the current and voltage at the measurement point immediately upstream of the fault point will experience a significant sudden change. Assuming that the location of the single-phase ground fault is measurement point 3, the label information corresponding to the sample signal is recorded as: 00100000, where 0 indicates that the corresponding measurement point is normal and 1 indicates that the corresponding measurement point has a fault.
[0086] In this experiment, the first batch of simulation data includes a total of 13,371 data items. This embodiment will be divided into training set, validation set and test set according to the proportion. The data volume distribution of each data set after division is shown in the following table:
[0087] Table 1: Data size distribution of training set, validation set and test set in the simulated dataset
[0088] Dataset type train val test total Data volume 10760 1195 1416 13371
[0089] In order to more comprehensively reflect the distribution of all possible single-phase grounding faults in the power distribution network, this experiment flexibly sets the distribution of the number of fault points in a single line in the generated simulation dataset. The distribution of the number of fault points in the 13,371 sample data contained in the simulation dataset is shown in the following table:
[0090] Table 2: Distribution of the number of faults in each sample data in the simulation dataset
[0091]
[0092] 1.2. Second batch of data
[0093] The second batch of data comes from actual monitoring data in a real-world distribution network. Because single-phase ground fault detection requires comparison with waveforms at other measurement points, when there are fewer than three measurement points, this comparison cannot be performed and there may be a discrepancy in the number of measurement points. Therefore, only data with three or more nodes is recorded as usable data; all other data are discarded.
[0094] Of all the 1711 actual data obtained, 1154 are available. The distribution of the number of measurement points recorded in the available data of this experiment was statistically analyzed, as shown in Table 3.
[0095] Table 3: Distribution of the number of measurement points for each sample data in the actual data set
[0096]
[0097] In this experiment, the current waveform data at each measurement point needs to be discretely sampled into a current time series signal containing 1024 data points. However, in the actual data, due to the different sampling frequencies of the sampling devices in different lines, the total number of sampling points obtained for the current waveform data of the first four cycles and the last eight cycles during the sudden change is different. This is ultimately reflected in the packaged data as the length distribution of the individual sampling sequences varies. Specifically, in this experiment, the sequence length distribution of the actual data is shown in the following table:
[0098] Table 4: Sequence length distribution of different sample data in the actual dataset
[0099]
[0100] In this experiment, T is set to the default value of 1024. When the sequence length is less than or equal to 1024, the missing values are padded with 0s. When the sequence length is greater than 1024 and less than 2048, the first 1024 values are truncated as the application sequence. When the sequence length is greater than 2048, equidistant sampling is performed based on multiples of the total sequence length and 1024. During the training phase, the starting point value is randomly determined, or the mean value within the single distance range is sampled. This is to enhance data during the training phase.
[0101] Consistent with the simulated dataset, this experiment also divides the actual dataset into training dataset, validation dataset, and test dataset in proportion. The data volume distribution in datasets for different purposes is shown in the following table:
[0102] Table 5: Data size distribution of training set, validation set and test set in the actual data set
[0103] Dataset type train val test total Data volume 1309 145 260 1714
[0104] Comparing Tables 1 and 5, we can see that due to the low frequency of single-phase ground faults, actual data collection is difficult to obtain. Therefore, compared to the simulated data, the actual data set is smaller in size. Furthermore, statistics were collected for the 260 field test lines in the actual data set to provide the distribution of faults and normal conditions at the measurement point and line levels. The results are shown in the following table:
[0105] Table 6: Distribution of faults and normal conditions at the point and line levels in the real dataset
[0106]
[0107] Analysis of the data in the table above shows that the actual data collected at the line level are all single-phase grounding fault data, and the ratio of faults to normal data at the measurement point level is approximately 1:3, indicating that most of the data are normal measurement points.
[0108] 2. Experimental Results and Analysis
[0109] 2.1 Comparative Experiment
[0110] In this experiment, we first selected the Informer and TimeMixer++ networks as the baseline models for the backbone network and trained them on a simulated dataset to test the performance of the network models. We then selected the solution of our invention as the experimental group and also trained it on a simulated dataset to compare the baseline performance of the different network models.
[0111] 2.2 Enhanced Training
[0112] In the first phase of training, the network model's input data size is gradually adjusted to find the optimal current sequence signal length. The discrete sampling method for the current waveforms in the simulated dataset is then adjusted to obtain more augmented data to improve training results. After completing training using the full real-world dataset, the second phase of training begins. During this second phase, the real-world dataset is gradually introduced, and the trained model's recognition accuracy is verified on both datasets.
[0113] 2.3 Ablation Experiment
[0114] In this experiment, technicians also set up an ablation experiment to verify the performance improvement of the solution of the present invention after introducing global normalization, adopting a joint loss including focal loss, introducing absolute position encoding, using 3518 cases of diverse simulated data for supplementary training, and adopting a feature fusion module including wavelet DB4 transform.
[0115] The experimental optimization process was recorded in detail. The focus was on the training data, network model, fine-tuning strategy, input data size, and line accuracy on both the simulated and real-world test sets. The following table shows the model optimization process records.
[0116] Table 7: Detailed record of optimization process
[0117]
[0118]
[0119] By analyzing the performance optimization results of the solution of the present invention in combination with the above experimental process data, it can be found that the model optimization process provided by this experiment generally includes the following key optimization paths:
[0120] 1. Model Architecture Iteration (Phase 1-3)
[0121] In stages 1-5, there is no real data involved, only simulated data is involved in training, which can be summarized as the model architecture iteration stage. The first step is to find a basic network model that meets the task of the project. Based on this purpose, the performance of Informer, timeMixer++ and the Transformer-based network model of the present invention are compared. Combined with the experimental data, it can be seen that: compared with the two baseline models in the control group, the line-level accuracy of the fault identification network of the present invention on the independent test set of simulated data is improved from 73.42 to 84.38, verifying that the fault identification performance of the network model has certain advancedness.
[0122] 2. Data Engineering Breakthrough (Stages 6-7)
[0123] During the enhanced training of the fault identification model presented in this paper, significant performance degradation occurred when real-world data was first introduced. During the transition from full simulated data to full real-world data, the network model's line accuracy on the simulated data test set was only 13.5%, a stark contrast to the 84.38% achieved when training solely on simulated data.
[0124] After analysis, the main concern was that the amount of real-world data was too small, with only 1,454 cases used for training. During the training phase with the full amount of simulated data, the training data consisted of 11,955 cases, eight times the amount of real-world training data. For this reason, we considered mixing simulated and real-world data for training, hoping that features learned from the simulated data would be helpful for learning features from the real-world data.
[0125] In training task No. 7, real-world data and simulated data were used for training. With all other parameters remaining the same, the accuracy of the simulated data test line increased from 93.36% to 99.4%, and the accuracy of the real-world test line increased from 13.5% to 55%. Experiments further demonstrated the feasibility of this method.
[0126] 3. Training strategy optimization (stages 8-11)
[0127] In training task #8, a data preprocessing phase was used to perform global normalization on a single line. Compared to the previous point-by-point normalization, global normalization on a single line can normalize the collected information from different measurement points on that line to the same level, which is very useful for comparing changes at different measurement points. Ultimately, through testing on a test set of real-world data, the accuracy increased from 55% to 67.3%, demonstrating excellent value for feature fitting of real-world data. Subsequent optimizations also continued this basic preprocessing operation.
[0128] In training task No. 9, Focal Loss was used to address the 1:9 imbalance in the ratio of faulty and non-faulty samples in actual scenarios. The accuracy of the actual data was improved from 67.3% to 73.1%, a total improvement of 5.8%. This is consistent with the weight distribution of difficult and easy samples during the optimization process of Focal Loss and is in line with expectations.
[0129] In training task 10, considering that the Transformer model requires additional positional encoding for time series order, absolute positional encoding was added to strengthen time series modeling, achieving near-100% performance (99.97%) in simulation testing. Furthermore, in actual test data, line accuracy increased significantly from 73.1% to 80.4%, meeting expectations.
[0130] In training task 11, collecting actual single-phase ground fault data was difficult, and the data source was also difficult to obtain. Therefore, we hoped to increase the number of simulated data to gain performance with real data. Consequently, we added 3,518 more diverse simulated data cases to the training task. Ultimately, the accuracy on the actual test dataset increased from 80.4% to 81.15%, further demonstrating the value of simulated data in training. However, we also observed insufficient growth capacity and limited room for improvement.
[0131] 4. Feature Fusion (Stage 12)
[0132] Wavelet transform is a time-frequency joint analysis tool, which is particularly suitable for processing non-stationary signals commonly seen in power systems. It can decompose a signal into components at different scales (frequency) and locations (time). Figure 4 The architecture shown introduces wavelet transform operations into the fault identification network. Wavelet transform can be used to extract characteristic components with judgment significance from complex transient signals, making the fault identification performance of the model more accurate and reliable. Among them, when wavelet transform is applied to single-phase grounding fault line selection, it is also necessary to use a suitable wavelet basis to perform wavelet transform on the transient zero-sequence current. After testing, this experiment found that at the db4 scale and position, the model can better distinguish between fault and normal waveforms. After introducing the feature fusion processing based on wavelet transform in this experiment, the fitting efficiency of the network model did not decrease, and the line-level accuracy on the actual data set was further improved, reaching the highest 83.1%. This proves that the feature fusion mechanism used in the fault identification network of the present invention can improve the feature expression ability of the model and can effectively help the model learn.
[0133] The above-described embodiment merely represents one embodiment of the present invention. While the description is relatively specific and detailed, it should not be construed as limiting the scope of the invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, and these modifications and improvements fall within the scope of the present invention. Therefore, the scope of the present invention shall be determined by the appended claims.
Claims
1. A method for detecting single-phase grounding faults in a distribution network based on a time series model, characterized in that: It includes: S1: A fault recognition model is constructed based on Transformer, including a linear embedding layer, a Transformer main body, a feature fusion module, and a prediction block. It is used to generate a status code representing the fault status of each measuring point based on the current signals of n measuring points. S2: Collect current information from all power measurement points in the specified distribution network, synchronously extract the current signal graph of each measurement point according to the window length, and add corresponding fault labels to them according to the fault status, thereby generating a sample signal; obtain a large number of sample signals to form a real-time data set; S3: Based on the actual topology of the power distribution network, a corresponding power grid simulation model was built using Pscad and Python. Different unidirectional grounding faults were simulated using the power grid simulation module. The current signal graphs of each measuring point were collected and the corresponding fault labels were added to generate the required sample signals. Obtain a large number of sample signals to form a simulation data set; S4: performing two-stage training on the fault identification model; in the training stage, global normalization is performed on the current signals of different measurement points input into the model; In the first stage, only simulated datasets are used for training, and contrastive loss is used as the loss function; In the second stage, a mixed dataset containing both real and simulated datasets is used for training, and a joint loss consisting of contrast loss and focal loss is used as the loss function. After the two-stage training is completed, the model parameters of the network model with the best verified performance are retained. S5: Using the fault identification model retained in the previous step, the single-phase grounding fault of the distribution network is monitored in real time, so as to identify and locate the single-phase grounding fault of the distribution network according to the current signals of each measuring point in the specified distribution network.
2. The method for detecting single-phase grounding faults in a distribution network based on a time series model according to claim 1, characterized in that: The linear embedding layer is used to encode the current signals of each measuring point input in parallel into corresponding feature matrices; the Transformer body is composed of 6 encoding layers, each of which includes an SCA module, a multi-head attention mechanism MSA using a TSA module, a feedforward layer, an LN layer and a Dropout layer in sequence; the Transformer body is used to extract multi-level feature information from all measuring point signals from the input feature matrix and generate corresponding feature vectors; the feature fusion module is used to transform the original input current signal through a wavelet transform, then perform feature encoding through a linear embedding layer, and then perform feature fusion of the encoded features with the output of the Transformer body and output them to the prediction block; the prediction block is composed of two fully connected layers and is used to generate a status code representing its fault status based on the fused features of each measuring point.
3. The method for detecting single-phase grounding faults in a distribution network based on a time series model according to claim 2, wherein: For the feature matrix input by the first encoding layer in the Transformer body, a position vector is added to the feature vector of each measurement point through the absolute position encoding unit; wherein, the value PE of the i-th dimension in the position vector of the pos-th feature vector in the feature sequence is (pos,2i) and PE (pos,2i+1) as follows: In the above formula, d model Represents the dimension of the input feature vector.
4. The method for detecting single-phase grounding faults in a distribution network based on a time series model according to claim 2, wherein: The TSA module is used to capture the global dependency across time steps by calculating the correlation weights between each time step of each measurement point feature and other time steps, thereby identifying key change measurement points in the current signal. The SCA module is used to construct a spatial correlation matrix based on the eigenvectors of the measuring points. The electrical coupling strength between the measuring points is then quantified using attention weights. The electrical coupling strength is used to reflect the topological connection and geographic distance information between the measuring points. This allows the propagation characteristics of the fault current in the spatial dimension to be modeled.
5. The method for detecting single-phase grounding faults in a distribution network based on a time series model according to claim 4, characterized in that: The multi-head attention mechanism uses a parallel computation with 8 attention heads for multi-head attention; and / or The status code output by the fault identification model is an n-bit binary code; when the value on any bit is 1, it indicates that a single-phase grounding fault has occurred at the measuring point; when the value on any bit is 0, it indicates that the measuring point is in a normal state.
6. The method for detecting single-phase grounding fault in a distribution network based on a time series model according to claim 5, characterized in that: Selecting mean square error loss as the required contrast loss, the calculation formula of the joint loss is as follows: In the above formula, represents the fault status of the i-th measuring point in the current distribution network predicted by the fault identification model, and y represents the actual fault status of the i-th measuring point in the current distribution network; n represents the number of measurement points in the current distribution network; p t Indicates the closeness between the sample and the category; γ represents the focus parameter; α and β represent the weight coefficients of contrast loss and focal loss in the joint loss, respectively.
7. The method for detecting single-phase grounding faults in a distribution network based on a time series model according to claim 1, wherein: In each sample data of the actual data set and the simulation data, the current signal diagram of the measuring point where a single-phase grounding fault occurs is the current waveform data of the first 4 cycles and the last 8 cycles after the voltage mutation occurs; and / or Discrete sampling is performed on the waveform of the current signal diagram, and the obtained feature vector consisting of 1024 current values is used as the input of the fault identification network.
8. A computer program product comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the distribution network single-phase grounding fault detection method based on a timing model as described in any one of claims 1 to 7 are implemented, and then a status code representing the fault status of each measuring point is output according to the current signal of each measuring point input.
9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the distribution network single-phase grounding fault detection method based on a timing model as described in any one of claims 1 to 7 are implemented, and then a status code representing the fault status of each measuring point is output according to the current signal of each measuring point input.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the computer program is executed by a processor, the steps of the distribution network single-phase grounding fault detection method based on a timing model as described in any one of claims 1 to 7 are implemented, and then a status code representing the fault status of each measuring point is output according to the current signal of each measuring point input.