Cable fault detection method and system

Through the self-attention mechanism of parallel calculation of attention head and position encoding, combined with the TCN model, the problem of insufficient accuracy of traditional cable fault detection in complex environments is solved, efficient and accurate cable fault detection and positioning is achieved, and the stable operation of the power system is supported.

CN120372256AInactive Publication Date: 2025-07-25GUIZHOU POWER GRID CO LTD

Patent Information

Application Number
CN202510859449.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional cable fault detection methods are insufficient in complex environments and have high false alarm rates, making it difficult to meet the power grid's demand for accurate fault diagnosis, especially in noise and interference, and it is difficult to accurately identify and locate fault signals.

Method used

Parallel computational attention heads are used for feature extraction, and a position-encoding self-attention mechanism is introduced. By obtaining cable signal data for standardization, it is converted into a matrix form, combining the multi-head attention mechanism and TCN model, the cross-entropy loss function is used to optimize the model parameters to distinguish fault signals from noise.

Benefits of technology

It improves the accuracy of cable fault detection and data processing efficiency, enhances the understanding of cable signal characteristics and the positioning accuracy of fault locations, realizes the automation and intelligence of cable fault detection, reduces maintenance costs, and ensures the stable operation of the power system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372256A_ABST
    Figure CN120372256A_ABST
Patent Text Reader

Abstract

The invention discloses a cable fault detection method and system, and relates to the technical field of power system monitoring and fault diagnosis, and the method comprises the steps: obtaining cable signal data, carrying out the standardization processing, converting the cable signal data into a matrix, carrying out the parallel calculation of attention heads, carrying out the feature extraction of the cable signal data, and carrying out the splicing and linear transformation of the output of the attention heads, the method comprises the following steps of: obtaining fused feature representation, introducing position codes into a self-attention mechanism, processing the structure and dynamic change of a sequence by utilizing the position codes, detecting and analyzing cable fault signals by utilizing extracted feature information, optimizing model parameters through detection and training results, and distinguishing the fault signals from noise. According to the method, position coding and a multi-head self-attention mechanism are combined, so that the model not only can capture the long-range dependency relationship, but also can accurately locate the time sequence characteristics of fault occurrence, and the accuracy of fault detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system monitoring and fault diagnosis, and particularly relates to a cable fault detection method and system. Background Art

[0002] With the continuous expansion of the scale of modern power grids and the continuous increase in complexity, the cable system, as a key infrastructure for power transmission, its reliability and stability are crucial for the safe operation of the entire power grid; however, traditional cable fault detection methods often have problems such as insufficient accuracy and high false alarm rates, and it is difficult to meet the urgent need for accurate fault diagnosis in the current power grid. Especially in complex operating environments, cable fault signals are often masked by noise and interference, posing a great challenge to fault detection.

[0003] As power systems and electronic devices become increasingly complex, the accurate identification and location of fault signals become more and more important. The self-attention mechanism has shown great potential in the field of fault signal identification. For example, a method based on a random forest regressor is used to detect the fault location and duration in a power system. However, the method has low computational efficiency when dealing with high-dimensional features and large-scale data. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is: how to perform feature extraction through parallel computing attention heads, introduce a self-attention mechanism with positional encoding to handle the structure and dynamic changes of sequences, realize in-depth understanding and extraction of cable signal features, and effectively detect cable fault signals and accurately distinguish them from noise, improving the accuracy of cable fault detection and data processing efficiency.

[0006] To solve the above technical problems, the present invention provides the following technical solutions: a cable fault detection method, including the following steps, Obtain cable signal data, perform normalization processing on the obtained cable data, and convert it into a matrix; through parallel computing attention heads, perform feature extraction on the cable signal data, splice and linearly transform the output of the attention heads to obtain a fused feature representation; introduce positional encoding in the self-attention mechanism and use the positional encoding to handle the structure and dynamic changes of the sequence; use the extracted feature information to detect and analyze cable fault signals, and optimize the model parameters through the detection and training results to distinguish fault signals from noise.

[0007] As a preferred solution of the cable fault detection method described in the present invention, wherein: the obtaining of cable signal data includes obtaining current data, voltage data, temperature data, insulation data, frequency data, time series data, fault feature data, and environmental data.

[0008] The current data includes the current waveforms before and after the fault, the effective value of the current, the peak value of the current, the harmonic components of the current, and the phase information of the current; the voltage data includes the voltage waveforms before and after the fault, the effective value of the voltage, the peak value of the voltage, the harmonic components of the voltage, and the phase information of the voltage; the temperature data includes the temperature readings of various parts of the cable, the temperatures of cable joints and terminals, and the ambient temperature; the insulation data includes the insulation resistance value, the tangent value of the insulation dielectric loss angle, and the capacitance value of the insulation; the frequency data includes the fundamental frequency of the power grid and the frequencies of sub-harmonics; the time series data includes the data records of cable signals changing over time and the time stamps of fault occurrences; the fault feature data includes the fault type, the fault location information, the fault duration, and the signal change characteristics caused by the fault; the environmental data includes humidity, temperature fluctuations, noise levels, and vibration data.

[0009] As a preferred solution of the cable fault detection method described in the present invention, wherein: the conversion into matrices includes performing normalization processing on the obtained cable signal data, and converting the normalized data into a query matrix, a key matrix, and a value matrix.

[0010] Converting the normalized data into a query matrix, a key matrix, and a value matrix includes determining the dimension of the signal data, and determining the number of samples and the number of features, and converting the one-dimensional normalized data into a query matrix, a key matrix, and a value matrix through a sliding window.

[0011] As a preferred solution of the cable fault detection method described in the present invention, wherein: the performing feature extraction includes performing feature extraction on the cable signal data through parallel computing of attention heads, splicing and linearly transforming the outputs of the attention heads to obtain a fused feature representation; The formula for parallel computing of attention heads is: , wherein, is the i-th attention head, i is a variable index, i = 1, 2... h, h is the total number of attention heads, is the weight matrix of the query, is the weight matrix of the key, is the weight matrix of the value, is the final weight matrix, is the calculation process of the attention mechanism; The formula for linear transformation is: , , , wherein, Q is the query matrix, K is the key matrix, and V is the value matrix. is the weight matrix for the query, is the weight matrix for the key, is the weight matrix for the value, is the standardized data, and i is the variable index.

[0012] As a preferred solution of the cable fault detection method described in the present invention, wherein: the obtaining of the fused feature representation includes calculating the attention weights and concatenating the outputs of multiple attention heads to obtain the fused feature representation; The formula for calculating the attention weights is: , where Q is the query matrix, K is the key matrix, V is the value matrix, T is the transpose operation, is the scaling factor, is the calculation process of the attention mechanism, is the softmax function; The formula for concatenation is: , where Q is the query matrix, K is the key matrix, V is the value matrix, is the concatenation operation, is the first attention head, is the second attention head, is the h-th attention head, and h is the total number of attention heads, is the final weight matrix, is the multi-head attention mechanism.

[0013] As a preferred solution of the cable fault detection method described in the present invention, wherein: the self-attention mechanism includes introducing positional encoding in the self-attention mechanism and using the positional encoding to process the structure and dynamic changes of the sequence; The introduction of the positional encoding is expressed as: , , where, is the position index, j is the index of the model dimension, P is the positional encoding matrix, is the dimension of the positional encoding matrix, is the sine operation, is the cosine operation; The matrix after adding the positional encoding is expressed as: , , , Among them, Q is the query matrix, K is the key matrix, V is the value matrix, and P is the position encoding matrix. is the query matrix with position information. is the key matrix with position information. is the value matrix with position information.

[0014] As a preferred solution of the cable fault detection method described in the present invention, the detection and analysis of the cable fault signal include: classifying the cable signal using the extracted feature information, extracting the signal feature values using the TCN model, sorting the feature values, and establishing a real-time fault detection model that combines TCN and the self-attention mechanism for signal classification, and optimizing the parameters of the fault detection model using the cross-entropy loss function. The detection and analysis of the cable fault signal further include: establishing a real-time fault detection model that combines TCN and the self-attention mechanism, and using the fault detection model to identify the fault features, guiding the fault detection model to learn the mapping relationship between the key features and the fault categories through the loss function, and outputting the probability distribution of each fault category. Extracting the signal feature values using the TCN model includes: capturing the long-range dependence relationship through causal convolution and dilated convolution, and the main characteristics include causality, expandable receptive field, and residual connection. The causal convolution formula is expressed as: , The dilated convolution formula is expressed as: , where k is the convolution kernel size, t is the time step, is the output of the causal convolution, is the convolution kernel, is the input sequence of the causal convolution, is the input sequence of the dilated convolution, is the output of the dilated convolution, is the dilation factor; The residual connection formula is expressed as: , where, is the output after the residual connection, is the input signal, is the non-linear transformation of the current layer; The formula for outputting the prediction result of the target sequence is expressed as: , where, is the activation function, is the convolution kernel weight of the l-th layer, is the bias term. is the output of the l-th layer, is the dilated output of the (l-1)-th layer, is the dilation factor of the l-th layer, k is the convolution kernel size, and t is the time step; The receptive field is expressed as: , where, is the dilation factor of the l-th layer, R is the receptive field size, k is the convolution kernel size, l is the variable index, and M is the number of TCN layers of the dilated convolution; The formula of the real-time fault detection model that fuses TCN and self-attention mechanism is expressed as: , where, Y is the prediction result of the fault detection model, is the fusion weight, which balances the contributions of the local features of TCN and the global dependencies of attention, is to apply a temporal convolutional network to the input sequence Z, is to apply a multi-head attention mechanism to the input sequence Z, and Z is the original data input; The formula of the cross-entropy loss function is: , where, L is the loss value, N is the number of samples, C is the number of classes, is the true label of sample b in class c, is the predicted probability of the model for sample b in class c, and b and c are variable indices; The formula for optimizing the model parameters is: , where, are the optimized real-time fault detection model parameters, are the real-time fault detection model parameters, is the learning rate, L is the loss value, is the gradient of the loss function with respect to the parameter θ; where, the real-time fault detection model parameters include the weights and biases of the dilated causal convolution kernels of the TCN model, the projection matrix, the output matrix, and the fusion weight of the self-attention mechanism.

[0015] Another object of the present invention is to provide a cable fault detection system. The present invention introduces a multi-head attention mechanism and a position encoding technique to improve the accuracy and efficiency of cable fault detection. By adopting the multi-head attention mechanism and the position encoding technique in deep learning, the system of the present invention not only realizes the efficient feature extraction of cable signal data and the precise processing of sequence dynamic changes, effectively differentiates fault signals from noise, but also can continuously improve the detection performance by optimizing model parameters, thereby ensuring the stable operation of the power system, reducing the economic losses and repair time caused by faults, and providing strong technical support for the safety management of power facilities.

[0016] To solve the above technical problems, the present invention provides the following technical solution: A cable fault detection system, comprising: a data acquisition and preprocessing module, a feature extraction module, a position encoding module, and a fault detection and model optimization module.

[0017] The data acquisition and preprocessing module is used to collect various signal data of the cable and convert them into matrix form through standardization processing.

[0018] The feature extraction module is used to extract features from the cable signal data by parallel computing multiple attention heads, splice the outputs of the heads and perform a linear transformation to obtain a fused feature representation.

[0019] The position encoding module is used to introduce position encoding in the self-attention mechanism, enabling the model to understand and process the order information and dynamic changes in the sequence data and providing the position information of the elements in the sequence.

[0020] The fault detection and model optimization module is used to classify the cable signals by using the extracted feature information, distinguish fault signals from normal signals, use a machine learning model, and optimize the model parameters through a cross-entropy loss function.

[0021] A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a cable fault detection method as described above are implemented.

[0022] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a cable fault detection method as described above are implemented.

[0023] Advantages of the present invention: By acquiring and standardizing cable signal data and converting it into matrix form, the present invention ensures the consistency and comparability of data, improves data processing efficiency, reduces the influence of data noise on detection results, and provides a reliable data basis for subsequent feature extraction and fault detection; parallel computing attention heads are used for multi-dimensional feature extraction to accurately capture subtle changes in cable signals, enriching the feature information for fault detection and improving detection accuracy; position encoding is introduced into the self-attention mechanism to enhance the model's ability to recognize the time series characteristics of cable signals and improve the prediction accuracy of fault locations and time points. Using the extracted feature information and combining model parameter optimization, fault signals and noise are effectively distinguished, improving the accuracy and reliability of fault detection and providing timely decision support for cable maintenance and repair; various signal data such as current, voltage, and temperature are acquired to ensure the comprehensiveness of fault detection and improve detection accuracy and fault location accuracy; by converting signal data into query, key, and value matrices, it provides a structured input for parallel computing and improves computing efficiency; the outputs of multiple attention heads are concatenated to achieve deep fusion of feature information, enhancing the richness and robustness of feature representation and helping to identify complex fault patterns; fault detection and model optimization are carried out through machine learning models and cross-entropy loss functions to continuously improve the model, enhance generalization ability, and adapt to different environments and conditions. The present invention realizes the automation and intelligence of cable fault detection, greatly improves detection efficiency and accuracy, reduces maintenance costs, and ensures the stable operation of the power system. Description of the Drawings

[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0025] Figure 1 It is the overall flowchart of a cable fault detection method provided by an embodiment of the present invention.

[0026] Figure 2 It is the system scheme flowchart of a cable fault detection system provided by an embodiment of the present invention. Detailed Embodiments

[0027] To make the above objects, features, and advantages of the present invention more apparent and understandable, the following provides a detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.

[0028] Example 1. Referring to Figure 1 , which is the first embodiment of the present invention. This embodiment provides a method for detecting cable faults, including: S1: Obtain cable signal data, perform normalization processing on the obtained cable data, and convert it into a matrix.

[0029] The obtaining of cable signal data includes obtaining current data, voltage data, temperature data, insulation data, frequency data, time series data, fault feature data, and environmental data.

[0030] The current data includes the current waveform before and after the fault, the effective value of the current, the peak value of the current, the harmonic components of the current, and the phase information of the current; the voltage data includes the voltage waveform before and after the fault, the effective value of the voltage, the peak value of the voltage, the harmonic components of the voltage, and the phase information of the voltage; the temperature data includes the temperature readings of various parts of the cable, the temperature of the cable joints and terminals, and the ambient temperature; the insulation data includes the insulation resistance value, the tangent value of the insulation dielectric loss angle, and the capacitance value of the insulation; the frequency data includes the fundamental frequency of the power grid and the frequencies of the sub-harmonics; the time series data includes the data records of the cable signal changing with time and the time stamp of the fault occurrence; the fault feature data includes the fault type, the fault location information, the fault duration, and the signal change characteristics caused by the fault; the environmental data includes humidity, temperature fluctuation, noise level, and vibration data.

[0031] It should be noted that the obtained cable signal data is subjected to normalization processing, and the normalized data is converted into a query matrix, a key matrix, and a value matrix.

[0032] The normalization processing formula is: , where is the normalized data, is the original cable signal data, is the mean value of the original cable signal data, is the standard deviation of the original cable signal data.

[0033] Converting the standardized data into a query matrix, a key matrix, and a value matrix includes determining the dimension of the signal data, determining the number of samples and the number of features, and converting the one-dimensional standardized data into a query matrix, a key matrix, and a value matrix through a sliding window.

[0034] It should be further noted that integrating various signal data (such as current, voltage, temperature, etc.) provides more comprehensive cable status information, which helps to detect faults more accurately; the standardization process eliminates the influence of different dimensions and data ranges, making the data more suitable for processing by machine learning models; converting the signal data into matrix form facilitates efficient parallel computing and feature extraction using matrix operations.

[0035] S2: Extract features from the cable signal data by parallel computing attention heads, splice and linearly transform the outputs of the attention heads to obtain a fused feature representation.

[0036] Furthermore, the feature extraction includes extracting features from the cable signal data by parallel computing attention heads, splicing and linearly transforming the outputs of the attention heads to obtain a fused feature representation.

[0037] The formula for parallel computing attention heads is: , where, is the i-th attention head, i is the variable index, i = 1, 2... h, h is the total number of attention heads, is the weight matrix of the query, is the weight matrix of the key, is the weight matrix of the value, is the final weight matrix, is the calculation process of the attention mechanism.

[0038] The formula for the linear transformation is: , , , where, Q is the query matrix, K is the key matrix, V is the value matrix, is the weight matrix of the query, is the weight matrix of the key, is the weight matrix of the value, is the standardized data.

[0039] It should be noted that the parallel computing attention heads can process multiple feature dimensions simultaneously, improving the efficiency and depth of feature extraction; the attention mechanism can automatically learn the important features in the data, enhancing the model's ability to identify fault signals; concatenation and linear transformation fuse the outputs of different attention heads to obtain a richer feature representation.

[0040] S3: Introduce positional encoding in the self-attention mechanism and use the positional encoding to process the structure and dynamic changes of the sequence.

[0041] Furthermore, the obtaining of the fused feature representation includes calculating the attention weights and concatenating the outputs of multiple attention heads to obtain the fused feature representation.

[0042] The formula for calculating the attention weights is: , where Q is the query matrix, K is the key matrix, V is the value matrix, T is the transpose operation, is the scaling factor, is the calculation process of the attention mechanism, is the softmax function.

[0043] The formula for the concatenation is: , where Q is the query matrix, K is the key matrix, V is the value matrix, is the concatenation operation, is the first attention head, is the second attention head, is the h-th attention head, h is the total number of attention heads, is the final weight matrix, is the multi-head attention mechanism.

[0044] Furthermore, the positional encoding enables the model to understand the order information in the sequence data, which is particularly important for time series data analysis; and processing the structure and dynamic changes of the sequence helps the model better capture the spatio-temporal features of the fault signal.

[0045] S4: Use the extracted feature information to detect and analyze the cable fault signal, and optimize the model parameters through the detection and training results to distinguish the fault signal from the noise.

[0046] It should be noted that the self-attention mechanism includes introducing positional encoding in the self-attention mechanism and using the positional encoding to process the structure and dynamic changes of the sequence.

[0047] The introduction of the positional encoding is expressed as: , , wherein, is the position index, j is the index of the model dimension, P is the position encoding matrix, is the dimension of the position encoding matrix, is the sine operation, is the cosine operation.

[0048] The matrix after adding the position encoding is expressed as: , , , wherein, Q is the query matrix, K is the key matrix, V is the value matrix, and P is the position encoding matrix, is the query matrix with position information, is the key matrix with position information, is the value matrix with position information.

[0049] Furthermore, the detection and analysis of the cable fault signal include classifying the cable signal by using the extracted feature information, extracting the signal eigenvalue by using the TCN model, sorting the eigenvalue, and establishing a real-time fault detection model integrating TCN and self-attention mechanism for signal classification, and optimizing the parameters of the fault detection model by using the cross-entropy loss function.

[0050] The detection and analysis of the cable fault signal also include establishing a real-time fault detection model integrating TCN and self-attention mechanism, and using the fault detection model to identify the fault features, guiding the fault detection model to learn the mapping relationship between the key features and the fault categories through the loss function, and outputting the probability distribution of each fault category.

[0051] Feature extraction and classification in deep learning are end-to-end joint optimizations. During backpropagation, the gradient of the cross-entropy loss for the last fully connected layer will continue to propagate forward to the TCN convolutional kernel and attention weights, thus changing the feature extraction method; for example, when the model repeatedly misjudges a certain oscillation pattern as normal, the gradient generated by the loss will force the TCN to learn a more sensitive oscillation detection filter.

[0052] Extracting the signal eigenvalue by using the TCN model includes capturing the long-range dependence relationship through causal convolution and dilated convolution, and the main characteristics include causality, expandable receptive field, and residual connection.

[0053] Causal convolution ensures that the output of each time step only depends on the current and previous inputs, avoiding information leakage. The formula for causal convolution is expressed as: , Dilated convolution expands the receptive field by inserting holes between the convolutional kernels, enabling the capture of long-range dependencies in shallower network architectures. The formula for dilated convolution is expressed as: , where k is the convolutional kernel size, t is the time step, is the output of causal convolution, is the convolutional kernel, is the input sequence of causal convolution, is the input sequence of dilated convolution, is the output of dilated convolution, is the dilation factor.

[0054] Residual connections alleviate the vanishing gradient problem in deep networks and simultaneously enhance the model's convergence speed. The formula for residual connections is expressed as: , where, is the output after residual connection, is the input signal, is the non-linear transformation of the current layer.

[0055] TCN achieves multi-scale feature extraction of sequence data by stacking multiple layers of dilated causal convolution. Through layer-by-layer stacking, TCN can extract features at different time scales and finally output the prediction result of the target sequence. The formula for outputting the prediction result of the target sequence is expressed as: , where, is the activation function, is the convolutional kernel weight of the l-th layer, is the bias term, is the output of the l-th layer, is the dilated output of the (l - 1)-th layer, is the dilation factor of the l-th layer, k is the convolutional kernel size, and t is the time step.

[0056] The receptive field is expressed as: , where, is the dilation factor of the l-th layer, R is the receptive field size, k is the convolutional kernel size, l is the variable index, and M is the number of TCN layers of dilated convolution.

[0057] The causal convolutional structure of TCN can efficiently capture long-range time dependencies in cable monitoring data, while the self-attention mechanism enhances the model's ability to identify key fault features through dynamic weight allocation.

[0058] The formula for the real-time fault detection model that fuses TCN and the self-attention mechanism is expressed as: , where Y is the prediction result of the fault detection model, is the fusion weight, balancing the contributions of the local features of the TCN and the global dependencies of the attention, is applying a temporal convolutional network to the input sequence Z, is applying a multi-head attention mechanism to the input sequence Z, and Z is the original data input.

[0059] In cable fault detection, the cross-entropy loss function is used to optimize the parameters of the real-time fault detection model that fuses the TCN and the self-attention mechanism. The core logic is to model the fault detection as a classification task and guide the model to learn the mapping relationship between the key features and the fault categories through the loss function, and finally output the probability distribution of each fault category.

[0060] The formula for the cross-entropy loss function is: , where L is the loss value, N is the number of samples, C is the number of categories, is the true label of sample b in category c, is the predicted probability of the model for sample b in category c, and b and c are variable indices.

[0061] The formula for optimizing the parameters of the real-time fault detection model is: , where, are the optimized parameters of the real-time fault detection model, are the parameters of the real-time fault detection model, is the learning rate, L is the loss value, is the gradient of the loss function with respect to the parameter θ.

[0062] It should be noted that the optimized parameters of the real-time fault detection model include all the optimizable parameters in the model, specifically including: the dilated causal convolution kernel weights and biases of the TCN model, which are used to extract multi-scale temporal features; the projection matrix of the self-attention mechanism, which is used to dynamically allocate weights to the key time periods of faults; the output matrix, which is used to fuse the multi-head features; the fusion weight β, which balances the contributions of the local features of the TCN and the global dependencies of the attention; the parameters of the real-time fault detection model are jointly optimized through the gradient backpropagation of the cross-entropy loss to achieve end-to-end fault feature learning and classification decision-making.

[0063] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

[0064] Embodiment 2, referring to Figure 2 , which is the second embodiment of the present invention. This embodiment provides a cable fault detection system, including a data acquisition and preprocessing module M101, a feature extraction module M201, a position encoding module M301, and a fault detection and model optimization module M401.

[0065] The data acquisition and preprocessing module M101 is used to collect various signal data of the cable and convert it into a matrix form through standardization processing.

[0066] The feature extraction module M201 is used to extract features from the cable signal data by parallel computing multiple attention heads, splice the outputs of the heads, and obtain a fused feature representation through a linear transformation.

[0067] The position encoding module M301 is used to introduce position encoding in the self-attention mechanism, enabling the model to understand and process the order information and dynamic changes in the sequence data, and providing the position information of the elements in the sequence.

[0068] The fault detection and model optimization module M401 is used to classify the cable signals using the extracted feature information, distinguish between fault signals and normal signals, use a machine learning model, and optimize the model parameters through a cross-entropy loss function.

[0069] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

[0070] Embodiment 3, the third embodiment of the present invention, which is different from the previous two embodiments in that: When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0071] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a predefined sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device.

[0072] More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memories), fiber optic devices, and portable compact disc read-only memories (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, then editing, interpreting, or processing it in other suitable ways as necessary, and then storing it in a computer memory.

[0073] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following techniques well known in the art or a combination thereof can be used: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

Claims

1. A cable fault detection method, characterized in that: Including, Obtain cable signal data, perform normalization processing on the obtained cable data, and convert it into a matrix; Extract features from the cable signal data through parallel computing of attention heads, splice and linearly transform the outputs of the attention heads to obtain a fused feature representation; Introduce positional encoding in the self-attention mechanism and use the positional encoding to handle the structural and dynamic changes of the sequence; Use the extracted feature information to detect and analyze cable fault signals, and optimize the model parameters through the detection and training results to distinguish fault signals from noise.

2. The cable fault detection method according to claim 1, wherein: The obtaining of the cable signal data includes obtaining current data, voltage data, temperature data, insulation data, frequency data, time series data, fault feature data, and environmental data; The current data includes the current waveforms before and after the fault, the effective value of the current, the peak value of the current, the harmonic components of the current, and the phase information of the current; the voltage data includes the voltage waveforms before and after the fault, the effective value of the voltage, the peak value of the voltage, the harmonic components of the voltage, and the phase information of the voltage; the temperature data includes the temperature readings of various parts of the cable, the temperatures of cable joints and terminals, and the ambient temperature; the insulation data includes the insulation resistance value, the tangent value of the insulation dielectric loss angle, and the capacitance value of the insulation; the frequency data includes the fundamental frequency of the power grid and the frequencies of sub-harmonics; the time series data includes the data records of cable signals changing with time and the time stamps of fault occurrences; the fault feature data includes the fault type, fault location information, fault duration, and signal change characteristics caused by the fault; the environmental data includes humidity, temperature fluctuations, noise levels, and vibration data.

3. The cable fault detection method according to claim 2, characterized in that: The conversion into a matrix includes performing normalization processing on the obtained cable signal data and converting the normalized data into a query matrix, a key matrix, and a value matrix; The conversion of the normalized data into a query matrix, a key matrix, and a value matrix includes determining the dimension of the signal data, determining the number of samples and the number of features, and converting the one-dimensional normalized data into a query matrix, a key matrix, and a value matrix through a sliding window.

4. The cable fault detection method according to claim 3, characterized in that: The feature extraction includes extracting features from the cable signal data through parallel computing of attention heads, splicing and linearly transforming the outputs of the attention heads to obtain a fused feature representation; The formula for parallel computing of attention heads is: , Among them, is the i-th attention head, where i is a variable index, i = 1, 2... h, and h is the total number of attention heads, is the weight matrix of the query, is the weight matrix of the key, is the weight matrix of the value, is the final weight matrix, is the calculation process of the attention mechanism; The formula for linear transformation is: , , , Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. is the weight matrix of the query, is the weight matrix of the key, is the weight matrix of the value, is the normalized data, and i is the variable index.

5. The cable fault detection method according to claim 4, wherein: The obtaining of the fused feature representation includes calculating attention weights and splicing the outputs of multiple attention heads to obtain a fused feature representation; The formula for calculating attention weights is: , Among them, Q is the query matrix, K is the key matrix, V is the value matrix, T is the transpose operation, is the scaling factor, is the calculation process of the attention mechanism, is the softmax function; The formula for splicing is: , Among them, Q is the query matrix, K is the key matrix, and V is the value matrix. is the concatenation operation, is the first attention head, is the second attention head, is the h-th attention head, where h is the total number of attention heads, is the final weight matrix, is the multi-head attention mechanism.

6. The cable fault detection method according to claim 5, characterized in that: The self-attention mechanism includes introducing positional encoding in the self-attention mechanism and using the positional encoding to handle the structural and dynamic changes of the sequence; The introduction of positional encoding is expressed as: , , Among them, is the position index, j is the index of the model dimension, P is the position encoding matrix, is the dimension of the position encoding matrix, is the sine operation, is the cosine operation; The matrix after adding positional encoding is expressed as: , , , Among them, Q is the query matrix, K is the key matrix, V is the value matrix, and P is the position encoding matrix. is the query matrix with position information. is the key matrix with position information. is the value matrix with position information.

7. The cable fault detection method according to claim 6, characterized in that: The detection and analysis of the cable fault signals include classifying the cable signals using the extracted feature information, extracting signal feature values using a TCN model, sorting the feature values, and establishing a real-time fault detection model that combines TCN and the self-attention mechanism for signal classification, and using the cross-entropy loss function to optimize the parameters of the fault detection model; The detection and analysis of the cable fault signal further includes establishing a real-time fault detection model integrating TCN and self-attention mechanism, using the fault detection model to identify fault features, guiding the fault detection model to learn the mapping relationship between key features and fault categories through a loss function, and outputting the probability distribution of each fault category; Using the TCN model to extract signal feature values includes capturing long-range dependencies through causal convolution and dilated convolution, and the main characteristics include causality, expandable receptive field, and residual connection; The formula of causal convolution is expressed as: , The formula of dilated convolution is expressed as: , where k is the convolution kernel size and t is the time step, is the causal convolution output, is the convolution kernel, is the input sequence of the causal convolution, is the input sequence of the dilated convolution, is the dilated convolution output, is the dilation factor; The formula of residual connection is expressed as: , Among them, is the output after residual connection, is the input signal, is the non-linear transformation of the current layer; The formula for outputting the prediction result of the target sequence is expressed as: , Among them, is the activation function, is the convolutional kernel weight of the l-th layer, is the bias term, is the output of the l-th layer, is the dilated output of the (l - 1)-th layer, is the dilation factor of the l-th layer, k is the convolutional kernel size, and t is the time step; The receptive field is expressed as: , Among them, is the dilation factor of the l-th layer, R is the receptive field size, k is the convolutional kernel size, l is the variable index, and M is the number of TCN layers of the dilated convolution; The formula of the real-time fault detection model integrating TCN and self-attention mechanism is expressed as: , Among them, Y is the prediction result of the fault detection model, is the fusion weight, is to apply a temporal convolutional network to the input sequence Z, is to apply a multi-head attention mechanism to the input sequence Z, and Z is the original data input; The formula of the cross-entropy loss function is: , where L is the loss value, N is the number of samples, and C is the number of classes, is the true label of sample b in class c, is the predicted probability of the model for sample b in class c, where b and c are variable indices; The formula for optimizing model parameters is: , Among them, are the parameters of the optimized real-time fault detection model, are the parameters of the real-time fault detection model, is the learning rate, L is the loss value, is the gradient of the loss function with respect to the parameter θ; among them, the parameters of the real-time fault detection model include the weights and biases of the dilated causal convolution kernels of the TCN model, the projection matrix, the output matrix, and the fusion weights of the self-attention mechanism.

8. A cable fault detection system, which applies a cable fault detection method according to any one of claims 1 to 7, characterized in that Including: Data acquisition and preprocessing module, feature extraction module, position encoding module, and fault detection and model optimization module; The data acquisition and preprocessing module is used to collect various signal data of the cable and convert it into matrix form through standardization processing; The feature extraction module is used to extract features from the cable signal data by parallel computing multiple attention heads, splice the outputs of the heads, and obtain the fused feature representation through linear transformation; The position encoding module is used to introduce position encoding in the self-attention mechanism, enabling the model to understand and process the order information and dynamic changes in sequence data, and providing the position information of the elements in the sequence; The fault detection and model optimization module is used to classify the cable signal using the extracted feature information, distinguish fault signals from normal signals, use a machine learning model, and optimize the model parameters through the cross-entropy loss function.

9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of a cable fault detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of a cable fault detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Petrochemical industry electric energy quality disturbance identification method based on multi-scale TCN and multi-head self-attention mechanism

    CN118395244A

  • Fault diagnosis method based on additive adaptive LSTM-Transformer

    CN118690789A

  • Power cable fault detection method

    CN119535106A

Cited By

  • Signal processing model training method, signal processing method, device and equipment

    CN121662030A

  • Training methods for signal processing models, signal processing methods, devices and equipment

    CN121662030B

  • Cable fault detection method based on optical fiber sound sensing detection method and pulse excitation method

    CN121899576A