Optical cable fault detection method, device, equipment and medium

By building a waveform abnormality detection module and a TOP-Net fault identification network, combining local oscillation, trend-peak and position coding characteristics, using dynamic gradient sudden change information, the rapid identification and precise positioning of optical cable faults are achieved, the problem of optical cable fault location is solved, and the intelligent maintenance level of optical fiber communication system is improved.

CN120474610APending Publication Date: 2025-08-12STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510587755.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The prior art is difficult to quickly and accurately locate optical cable failures, resulting in low maintenance efficiency and high cost of optical fiber communication systems, which affects the stability of the communication network.

Method used

By adopting the optical cable fault detection method, the waveform abnormality detection module, the TOP-Net fault identification network and the positioning module are constructed, combined with local oscillation characteristics, trend-peak characteristics and position encoding characteristics, and the dynamic gradient mutation information is used for fault identification and positioning.

Benefits of technology

It realizes the rapid identification and precise positioning of optical cable faults, improves the intelligent maintenance level of optical fiber communication systems, reduces operation and maintenance costs, and ensures the stable operation of the communication network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120474610A_ABST
    Figure CN120474610A_ABST
Patent Text Reader

Abstract

The invention discloses an optical cable fault detection method, apparatus and device, and a medium. The method comprises the steps of collecting original data for model training; carrying out data preprocessing on the collected original data; constructing and training an optical cable fault detection model, wherein the optical cable fault detection model comprises a waveform anomaly detection module, a TOP-Net fault recognition network and a positioning module; the waveform anomaly detection module preliminarily screens out a fault point as a candidate fault point; the TOP-Net fault recognition network outputs a fault category judgment result according to the input candidate fault points; the positioning module determines a position index of a fault point by taking differential gradient abrupt change information in the fusion feature as a core; and detecting the optical cable fault by using the trained optical cable fault detection model. The optical cable fault is identified and positioned, the maintenance intelligence level of an optical fiber communication system is improved, the operation and maintenance cost is reduced, and stable operation of a communication network is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of optical communication technology, and in particular to an optical cable fault detection method, device, equipment and medium. Background Art

[0002] Amid the rapid development of global telecommunications technology, fiber-optic digital communications, as a crucial component of next-generation information infrastructure, have become the core support for modern communication networks. Optical fiber boasts significant advantages, including wide bandwidth, high transmission capacity, strong resistance to electromagnetic interference, and excellent confidentiality. It is widely used in backbone networks, access networks, and data center interconnections. The operational status of optical cables, as the physical carrier medium of optical fiber, is directly related to the security, reliability, and service quality of the entire communication system. However, in actual operation, faults such as fiber quality degradation, cable bending and deformation, and physical damage frequently occur. These not only impact the stable operation of communication systems but can also lead to serious consequences such as network outages and service degradation. Because optical cables are often laid underground, in bridges, or in ducts, faults are difficult to quickly locate, often relying on manual testing, which is inefficient and time-consuming. Therefore, a technical solution is urgently needed to continuously monitor the operational status of optical cables, identify faults in real time, and accurately locate them. This will improve the intelligent maintenance capabilities of optical fiber communication systems, reduce operation and maintenance costs, and ensure the stable operation of communication networks. Summary of the Invention

[0003] The present application provides a method, device, equipment and medium for detecting optical cable faults, which have the advantages of realizing the identification and location of optical cable faults, improving the intelligent maintenance level of optical fiber communication systems, reducing operation and maintenance costs, and ensuring the stable operation of communication networks.

[0004] The technical solution of this application is as follows:

[0005] In one aspect, the present application provides a method for detecting an optical cable fault, comprising the following steps:

[0006] Step 1: Collect raw data for model training;

[0007] Step 2: Preprocess the collected raw data;

[0008] Step 3: Build and train the optical cable fault detection model, which includes a waveform anomaly detection module, a TOP-Net fault identification network, and a positioning module.

[0009] The waveform anomaly detection module preliminarily selects fault points as candidate fault points based on the preset fluctuation intensity threshold and short-term waveform slope changes;

[0010] The TOP-Net fault identification network includes a TGA module that integrates local oscillation features, trend-peak features, and position encoding features. Based on the input candidate fault points, it outputs the fault category determination result through feature alignment, weighted fusion, and attention enhancement.

[0011] The positioning module uses the differential gradient mutation information in the fusion feature as the core to determine the position index of the fault point in the optical cable waveform, and then performs offset calibration with the nonlinear mapping of the actual deployment path to obtain the corrected fault location index;

[0012] Step 4: Use the trained optical cable fault detection model to detect optical cable faults.

[0013] Furthermore, in step 1, optical power data of the optical cable line under different operating conditions is collected; the collected optical power data includes the waveform response of the optical cable under normal operation, performance degradation and different types of fault conditions; optical cable faults include fiber breakage, abnormal reflection and slow-varying loss.

[0014] Furthermore, step 2 includes the following steps:

[0015] Median filtering is used to reduce the noise of the optical power signal. The median filtering formula is as follows:

[0016] P i (f) =Median(P i-k ,...,P i ,...,P i+k )∈R M

[0017] Among them, P i (f) Represents the optical power value after filtering at the i-th sampling point, P i represents the optical power value of the original i-th sampling point, k represents half the width of the sliding window, the window size is 2k+1, and the original optical power data sequence obtained after median filtering is 4096 is the length of the original sequence;

[0018] Perform linear interpolation resampling on the collected waveform signals so that all waveforms have consistent sampling intervals and lengths N. The linear interpolation resampling formula is as follows:

[0019]

[0020] i'∈{1,2,...,N} represents the i'th point in the target sequence; t i' Indicates the corresponding position of the resampled target position in the original sequence, t i' The original point interval is [j, j+1], where is rounded down; is the optical power value of the jth and j+1th points in the original sequence after median filtering, P i' is the power value of the i'th point in the resampled sequence;

[0021] Perform Z-score normalization on the processed signal. The Z-score normalization formula is as follows:

[0022]

[0023] represents the normalized waveform, μ is the mean power of the resampled waveform, and σ is the standard deviation of the resampled waveform.

[0024] Furthermore, in the optical cable fault detection model, the steps of the waveform anomaly detection module to screen the fault point are as follows:

[0025] Preprocessed optical power waveform sequence Input to the waveform anomaly detection module, where Represents the optical power value of the i'th distance sampling point, and the total number of sampling points is N;

[0026] Perform a sliding window first-order difference operation on the waveform sequence, calculate the power change between each two adjacent sampling points, and obtain the difference sequence The calculation formula is as follows:

[0027]

[0028] in, is the local power change difference of the i'th point;

[0029] Introduce the mutation threshold θ, set the empirical mutation threshold θ∈[0.05, 0.1], when the inequality is satisfied Then mark the i'th point as a candidate fault point; if It is determined to be a fiber break or a large insertion loss event; if It is judged to be reflection enhancement or coupling abnormality;

[0030] The set of sampling point indices that meet the above conditions is defined as the candidate fault point set I′ fault ,Right now:

[0031]

[0032] Furthermore, in the optical cable fault detection model, the TOP-Net fault identification network processes data in the following steps: window extraction, three-category feature generation, TGA module fusion, and classification prediction.

[0033] For each candidate point i′∈I′fault , from the normalized optical power waveform sequence Extract the waveform window segment x with the point as the center and fixed length L i' , used for subsequent feature extraction; the window extraction method is:

[0034]

[0035] Where L=64 is the window length, and all out-of-bounds parts are padded with zeros;

[0036] For each segment x i' Three types of basic feature representations are extracted in sequence: local oscillation features, trend-peak features, and position encoding features;

[0037] The local oscillation characteristics are obtained by first-order difference and local statistical coding, and the formula is as follows:

[0038]

[0039] Where Δx n represents the local difference at position n in the waveform; μ i' represents the local mean; σ i' represents the local standard deviation;

[0040] The difference sequence and the statistic are combined to form the final local oscillation eigenvector:

[0041]

[0042] Construct trend-peak features and extract the average slope, peak amplitude difference and local curvature of the waveform window segment; the formula is as follows

[0043]

[0044] Among them, S i' A represents the average slope of the waveform window at the candidate fault point i'; i' Indicates the peak amplitude difference of the waveform window at the candidate fault point i', max(x n )、min(x n ) are the maximum and minimum optical power values in the window; C i' represents the average second-order difference of the waveform segment at the candidate fault point i', |x n+1 -2x n +x n-1 | is the second-order difference in the form of central difference, reflecting the acceleration of the waveform change;

[0045] The above three trend-peak features constitute the trend-peak vector of the candidate fault point i':

[0046]

[0047] By combining the standardized distance information with the sine and cosine periodic functions, a position embedding vector is constructed for each waveform sampling point; for a waveform window with a length of L and a center of the candidate fault point i', Define each location The relative position is:

[0048]

[0049] Among them, m is the global index of the current sampling point; p m ∈[-1,1] is the normalized relative position, reflecting the spatial distance of each point relative to the center;

[0050] Introducing the Transformer-like sine and cosine position encoding mechanism, for the mth point, the relative position p m , whose position embedding is:

[0051]

[0052] Where d = 32 is the dimension of the position embedding vector, and the final position encoding of the m-th sampling point is:

[0053]

[0054] Combining the above two parts, the position encoding feature of each point m is defined as:

[0055]

[0056] Construct for all points in the waveform window:

[0057]

[0058] The position feature vector is input into the linear projection layer in the TGA module to generate position-guided attention weights;

[0059] The above three types of features are input into the TGA module in parallel for unified dimension alignment and structural fusion. First, independent linear projection layers are used to map the three types of features to the same dimension. Then, the local oscillation features and trend-peak features are weightedly fused point by point based on the attention weights generated by the position encoding. Next, the fused features are residually connected with the original two types of features and layer normalization is performed to generate a stable and structure-enhanced fused feature representation. Each candidate point will be processed into a fused feature vector of length 128. The formula is as follows:

[0060]

[0061] A osc=σ(F pos W osc )

[0062] A trend =σ(F pos W trend )

[0063] F fused =A osc ⊙F osc +A trend ⊙F trend

[0064] F output =LayerNorm(F fused +F osc +F trend )

[0065] Among them, FC osc 、FC trend 、FC pos Respectively represent the fully connected projection layers acting on three types of features; F osc 、F trend 、F pos is the unified dimensional feature representation after alignment; W osc 、W trend is a learnable attention weight parameter; σ(·) represents the Sigmoid activation function, which maps the dot product result to the (0, 1) interval; ⊙ is an element-by-element multiplication operation, which represents the attention weight; F fused is the intermediate feature representation after fusion; F output is the final fused output feature; LayerNorm(·) is a normalization operation performed on each feature vector dimension with a mean of 0 and a variance of 1;

[0066] The fused feature vector is input into the multi-classification prediction network. The fault category label is output through the fully connected layer and the Softmax activation function to determine whether the current candidate point belongs to the fiber break, insertion loss, reflection or normal category. The formula is as follows:

[0067]

[0068] Among them, FC cls Represents the fully connected layer used by the classifier; represents the predicted probability distribution of the fault category of the i'th sample; Softmax(·) is the multi-classification activation function.

[0069] Furthermore, in the positioning module of the optical cable fault detection model, a dynamic gradient tracking positioning algorithm based on a fusion feature sequence is used to locate the fault point from the feature fluctuations and map it to the physical distance target. The positioning calculation process is as follows:

[0070] F output ={F1,F2,...,F L}, ΔF a =F a+1 -F a

[0071]

[0072] τ=tanh(ω·μ+b),

[0073] score k =ReLU(Conv1D(G[a K ±r]))

[0074]

[0075] D fault =v·D total +ε offset

[0076] Where ΔF a Indicates the intensity of feature change between adjacent points; g a Represents the Euclidean distance of the a-th pair of differential vectors, and obtains a one-dimensional gradient sequence G={g1,g2,...,g L=1}; Represents the gradient value after Gaussian convolution smoothing, w k is the trainable Gaussian kernel weight, satisfying ∑w k =1; r a Represents the normalized gradient response, and the normalized response graph R={r1,r2,...,r L=1}, r i ∈(0,1); represents the global average response; τ is the adaptively calculated dynamic threshold; ω and b are trainable linear weights and biases; tanh is the activation enhancement nonlinear expression; H mask is the response mask; score k It is a convolution score for the gradient sequence in the neighborhood of each candidate point; V is the set of predicted continuous path points; TSI a is the gradient trend stability index calculated on the path point V; v represents the relative position ratio of the fault point in the sample, D total is the actual length of the optical cable, ε offset is the correction offset, D fault Indicates the final output location of the optical cable fault point;

[0077] Based on the pre-built optical cable laying path model ρ={(x0,y0),...,(x h ,y h )}, the physical distance D fault Map to actual geographic coordinates; find two adjacent path points with matching distances and use linear interpolation to obtain the geographic location:

[0078]

[0079] in, is the cumulative distance between adjacent path points, (x p ,y p ) is the final geographic coordinate;

[0080] The final output includes the type label of each fault event and the location of the optical cable fault point, that is,

[0081] Furthermore, in step 3, during the training process, the cross entropy loss is used to calculate the difference between the fault type output by the model and the true label:

[0082]

[0083] Among them, y i' is the real fault type label, is the probability distribution predicted by the model;

[0084] Use mean squared error loss to optimize the deviation between the predicted position index and the true position:

[0085]

[0086] in, is the fault point index position predicted by the model, v i' is the actual fault location index;

[0087] The total loss function is the weighted sum of the two:

[0088]

[0089] Among them, λ cls ,λ loc is a hyperparameter that adjusts the weights of the two tasks.

[0090] In another aspect, the present application provides an optical cable fault detection device, comprising:

[0091] A data acquisition unit, used to collect optical power data under the operating status of the optical cable line;

[0092] The data preprocessing unit performs denoising, resampling and normalization operations on the acquired optical power data to obtain a normalized waveform sequence with standard structure and consistent features.

[0093] and a detection unit, using the optical cable fault detection model trained in the optical cable fault detection method as described above, according to the waveform sequence Perform fault detection on optical cables and output the fault type and location.

[0094] On the other hand, the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is called and executed by the processor, the optical cable fault detection method as described above is implemented.

[0095] On the other hand, the present application provides a computer-readable medium storing a computer program. When the computer program is called and executed by a computer, the optical cable fault detection method as described above is implemented.

[0096] In summary, the beneficial effects of this application are:

[0097] 1. This paper proposes a fiber optic cable fault detection method based on dynamic gradient mutation sensing, integrating three types of waveform information: local oscillation characteristics, trend-peak characteristics, and position encoding characteristics. Compared with traditional single-feature extraction methods, this mechanism can achieve collaborative modeling of abnormal disturbances, global trends, and spatial locations in the fiber optic cable waveform, thereby improving the accuracy and robustness of fault identification.

[0098] 2. This paper proposes a position-guided attention fusion strategy, innovatively introduces position encoding features as weight guides, and performs weighted processing on the other two types of features, so that the model has stronger spatial perception capabilities while paying attention to local changes and global trends, realizing feature fusion under position perception and greatly improving the reliability of fault location.

[0099] 3. The present invention designs a dynamic gradient tracking positioning algorithm based on differential gradient mutation. This algorithm combines a learnable threshold mechanism with a dynamic window mean backtracking strategy, which can effectively suppress the impact of waveform disturbance errors on positioning accuracy and achieve more accurate positioning of optical cable fault points. BRIEF DESCRIPTION OF THE DRAWINGS

[0100] Figure 1 This is a flow chart of an optical cable fault detection method based on dynamic gradient mutation perception according to the present invention;

[0101] Figure 2 Schematic diagram of the TOP-Net fault detection model in an embodiment of the present invention;

[0102] Figure 3Schematic diagram of a TGA module in an embodiment of the present invention;

[0103] Figure 4 Schematic diagram of a fault location algorithm in an embodiment of the present invention. DETAILED DESCRIPTION

[0104] The specific implementation of the present application is described in detail below with reference to the accompanying drawings.

[0105] A specific embodiment of the present application provides a method for detecting optical cable faults based on dynamic gradient mutation perception. Figure 1-4 As shown, the following steps are included:

[0106] Step 1: Collect raw data for model training;

[0107] Collect optical power data from optical cable lines under different operating conditions as the basic data source for model training. The collected optical power data should include the waveform response of the optical cable under normal operation, performance degradation, and different types of faults (such as fiber breakage, abnormal reflection, and slow-varying loss). The data source is an optical time domain reflectometer (OTDR).

[0108] Step 2: Preprocess the collected raw data;

[0109] In this embodiment, the collected raw optical power waveform data is a single-channel, one-dimensional sequence with a length of 4096. The collected raw optical power waveform data is standardized to improve the recognition accuracy and generalization ability of the subsequent fault detection model. First, median filtering is used to reduce the noise of the optical power signal to remove high-frequency noise caused by equipment errors or environmental interference. The median filtering formula is as follows:

[0110] P i (f) =Median(P i-k ,...,P i ,...,P i+k )∈R M

[0111] Among them, P i (f) Represents the optical power value after filtering at the i-th sampling point, P i Represents the optical power value of the original i-th sampling point, k represents the half width of the sliding window, the window size is 2k+1, and the sliding window size here is 5. The original optical power data sequence obtained after median filtering is 4096 is the length of the original sequence.

[0112] Because different OTDR devices or test conditions may result in inconsistent sampling points, it is necessary to perform linear interpolation resampling on the collected waveform signals so that all waveforms have consistent sampling intervals and lengths N. In this embodiment, an equal-interval downsampling method is used to reduce the original sequence from 4096 dimensions to 1024 dimensions, that is, a sample point is selected every 4 sampling points. The linear interpolation resampling formula is as follows:

[0113]

[0114] i'∈{1,2,...,N} represents the i'th point in the target sequence; t i' Indicates the corresponding position of the resampled target position in the original sequence, t i' The original point interval is [j, j+1], where ( is rounded down); is the optical power value of the jth and j+1th points in the original sequence after median filtering, P i' is the power value of the i'th point in the resampled sequence.

[0115] Next, a Z-score normalization operation is performed on the processed signal to normalize the waveform to a uniform value range to eliminate baseline offsets under different sampling conditions. The Z-score normalization formula is as follows:

[0116]

[0117] represents the normalized waveform, μ is the mean power of the resampled waveform, and σ is the standard deviation of the resampled waveform.

[0118] At this point, the original 4096-dimensional optical power waveform data undergoes three processing steps: median filtering (keeping the dimension unchanged), resampling (reducing it to 1024 dimensions), and normalization (compressing the values to the range [0, 1]). The final result is an input data sequence with a unified structure, consistent scale, and clear features, which serves as the input basis for subsequent anomaly detection and fault identification models.

[0119] Step 3: Build and train the detection model:

[0120] After completing the pre-processing operations such as denoising, resampling and normalization of the original optical power data, a normalized waveform sequence with standard structure and consistent features is obtained. This normalized waveform sequence serves as the input of the detection model. The detection model combines multi-channel feature extraction and the TGA (Triple-Guided Attention) mechanism to effectively generate fused features with trend perception, anomaly detection, and spatial positioning capabilities. First, the normalized waveform data is input into the waveform anomaly detection module, which preliminarily screens out fault points based on a preset fluctuation intensity threshold and short-term waveform slope changes. Next, the data of the candidate fault points is input into the TOP-Net (Trend-Oscillation-Position Network) fault identification network, which is composed of a TGA module and integrates local oscillation features, trend-peak features, and position encoding features. It can effectively extract the composite feature patterns of different types of optical cable faults in the waveform. Through feature alignment, weighted fusion, and attention enhancement, TGP-Net outputs the fault category determination result. Next, the positioning module uses the Dynamic Gradient Tracing Positioning (DGTP) algorithm. This algorithm, based on differential gradient mutation information from fused features, combines a learnable threshold judgment with a variable window mean backtracking mechanism to accurately determine the fault point's position index within the optical cable waveform. This is then offset-calibrated with the nonlinear mapping of the actual cable routing to compensate for errors. Finally, the corrected fault location index is converted into actual geographic coordinates through the coordinate mapping module, which can be used by external fault visualization platforms or emergency repair systems, achieving a closed-loop fault perception process from data to action.

[0121] The preprocessed optical power waveform sequence Input to the waveform anomaly detection module to preliminarily determine the potential fault points. Represents the optical power value of the i'th distance sampling point, and the total number of sampling points is N. Specifically, a sliding window first-order difference operation is performed on the waveform sequence, and the power change between each two adjacent sampling points is calculated to obtain the difference sequence The calculation formula is as follows:

[0122]

[0123] in, is the local power change difference at point i', which is used to measure the degree of waveform mutation at that point.

[0124] Furthermore, we introduce the mutation threshold θ and set the empirical mutation threshold θ∈[0.05, 0.1]. When the inequality is satisfied, Then mark the i'th point as a candidate fault point. If the fiber optic cable is broken or the insertion loss is large, This is a reflection enhancement or coupling abnormality phenomenon.

[0125] Finally, the set of sampling point indexes that meet the above conditions is defined as the candidate fault point set I fault ,Right now:

[0126]

[0127] The above candidate fault point set will serve as an important basis for the subsequent fault identification and location model input.

[0128] After completing the abnormal change detection in the optical power waveform and obtaining the candidate fault point set I fault Finally, the waveform segments corresponding to the candidate fault points are input into the fault identification network model for type judgment, thereby realizing the identification and classification of multiple types of optical cable faults. This step includes four stages: window extraction, three-category feature generation, TGA module fusion, and classification prediction.

[0129] Specifically, first for each candidate point i′∈I′ fault , from the normalized optical power waveform sequence Extract the waveform window segment x with the point as the center and fixed length L i' , used for subsequent feature extraction. The window extraction method is:

[0130]

[0131] Where L=64 is the window length, and all out-of-bounds parts are padded with zeros.

[0132] Furthermore, for each segment x i' Three basic feature representations are extracted in sequence: local oscillation features, trend-peak features, and position encoding features. Local oscillation features are obtained through first-order differences and local statistical encoding to enhance the modeling capability of local disturbance information. The formula is as follows:

[0133]

[0134] Where Δx n Represents the local difference at position n in the waveform, which is used to measure the rate and direction of power change before and after that point; μ i' represents the local mean, which is used to measure the average power level of the window segment; σ i' It represents the local standard deviation, which is used to characterize the degree of dispersion of the power value in the local area and reflect the strength of the signal fluctuation.

[0135] Furthermore, the difference sequence and the statistic are combined to form the final local oscillation eigenvector:

[0136]

[0137] This vector comprehensively expresses the local change trend, oscillation rate and power distribution of the waveform at the candidate fault point, has rich local disturbance expression capabilities, and provides a highly recognizable feature basis for subsequent attention module fusion.

[0138] In order to further characterize the overall change trend and extreme value characteristics of the optical power waveform around the candidate fault point, a trend-peak feature is constructed, and the average slope, peak amplitude difference and local curvature of the waveform window segment are extracted.

[0139] The formula is as follows

[0140]

[0141] Among them, S i' A represents the average slope of the waveform window at the candidate fault point i'; i' Indicates the peak amplitude difference of the waveform window at the candidate fault point i', max(x n )、min(x n ) are the maximum and minimum optical power values in the window; C i' represents the average second-order difference (curvature) of the waveform segment at the candidate fault point i', |x n+1 -2x n +x n-1 | is the second-order difference in the form of central difference, reflecting the acceleration of the waveform change.

[0142] The above three trend-peak features constitute the trend-peak vector of the candidate fault point i':

[0143]

[0144] In fault detection, the relative position of the candidate fault point in the waveform window is often related to its physical meaning. Therefore, in order to give the model the ability to perceive spatial position information, a combination of standardized distance information and sine and cosine periodic functions is used to construct a position embedding vector for each waveform sampling point. For a waveform window with a length of L and a center of the candidate fault point i', Define each location The relative position is:

[0145]

[0146] Among them, m is the global index of the current sampling point; p m ∈[-1,1] is the normalized relative position, reflecting the spatial distance of each point relative to the center.

[0147] Furthermore, in order to improve the model's ability to perceive the periodicity of sequence positions, a Transformer-like sine and cosine position encoding mechanism is introduced. For the mth point, the relative position pm , whose position embedding is:

[0148]

[0149] Where d = 32 is the dimension of the position embedding vector, and the final position encoding of the m-th sampling point is:

[0150]

[0151] Combining the above two parts, the position encoding feature of each point m is defined as:

[0152]

[0153] Construct for all points in the waveform window:

[0154]

[0155] This position feature vector is fed into the linear projection layer in the TGA module to generate position-guided attention weights.

[0156] The above three types of features are input into the TGA module in parallel for unified dimension alignment and structural fusion. First, an independent linear projection layer is used to map the three types of features to the same dimension; then, the attention weights generated by the position encoding are used to perform point-by-point weighted fusion of the local oscillation features and the trend-peak features; then, the fused features are residually connected with the original two types of features, and layer normalization is performed to generate a stable and structure-enhanced fused feature representation. Each candidate point will be processed into a fused feature vector of length 128. This fusion method effectively improves the generalization ability of the model in multi-type and multi-form optical cable fault identification tasks. The formula is as follows:

[0157]

[0158] A osc =σF pos W osc )

[0159] A trend =σ(F pos W trend )

[0160] F fused =A osc ⊙F osc +A trend ⊙F trend

[0161] F output =LayerNorm(F fused +F osc +Ftrend )

[0162] Among them, FC osc 、FC trend 、FC pos Respectively represent the fully connected projection layers acting on three types of features; F osc 、F trend 、F pos is the unified dimensional feature representation after alignment; W osc 、W trend is a learnable attention weight parameter; σ(·) represents the Sigmoid activation function, which maps the dot product result to the (0, 1) interval; ⊙ is an element-by-element multiplication operation, which represents the attention weight; F fused is the intermediate feature representation after fusion; F output is the final fused output feature; LayerNorm(·) is a normalization operation performed on each feature vector dimension with a mean of 0 and a variance of 1.

[0163] Furthermore, the fused feature vector is input into the multi-classification prediction network, which outputs the fault category label through the fully connected layer and the Softmax activation function to determine whether the current candidate point belongs to the fiber break, insertion loss, reflection, or normal category. This recognition result serves as the basis for the subsequent fault location module, helping to achieve accurate identification and precise location of optical cable faults. The formula is as follows:

[0164]

[0165] Among them, FC cls Represents the fully connected layer used by the classifier; represents the predicted probability distribution of the fault category of the i'th sample; Softmax(·) is a multi-classification activation function that ensures the output probability distribution meets the normalization requirements.

[0166] Furthermore, to achieve high-precision automatic location of optical cable faults, a dynamic gradient tracking location algorithm based on a fused feature sequence was incorporated. Based on the fused feature graph, this algorithm combines feature gradient analysis, response graph construction, path tracking, and trend scoring to accurately extract the fault point from the feature fluctuations and map it to the physical distance. The location calculation process is as follows:

[0167] F output ={F1,F2,...,F L}, ΔF a =F a+1 -F a

[0168]

[0169] τ=tanh(ω·μ+b),

[0170] score k =ReLU(Conv1D(G[a K ±r]))

[0171]

[0172] D fault =v·D total +ε offset

[0173] Where ΔF a Indicates the intensity of feature change between adjacent points; g a Represents the Euclidean distance of the a-th pair of differential vectors, and obtains a one-dimensional gradient sequence G={g1,g2,...,g L=1}; Represents the gradient value after Gaussian convolution smoothing, w k is the trainable Gaussian kernel weight, satisfying ∑w k =1; r a Represents the normalized gradient response, and the normalized response graph R={r1,r2,...,r L=1}, r i ∈(0,1); Represents the global average response, which is used to generate the adaptive threshold; τ is the adaptively calculated dynamic threshold, which is used to filter the high response points; ω and b are trainable linear weights and biases, which control the threshold strength; tanh is the activation enhancement nonlinear expression; H mask is the response mask, which records the index exceeding the threshold in the response map; score k It is a convolution score for the gradient sequence in the neighborhood of each candidate point; V is the set of predicted continuous path points; TSI a is the gradient trend stability index calculated on the path point V; v represents the relative position ratio of the fault point in the sample, D total is the actual length of the optical cable, ε offset is the correction offset, D fault Indicates the final output location of the optical cable fault point.

[0174] Furthermore, based on the pre-built optical cable laying path model ρ={(x0,y0),...,(x h ,y h )}, the physical distance D fault Map to actual geographic coordinates. Find two adjacent path points with matching distances and use linear interpolation to obtain the geographic location:

[0175]

[0176] in, is the cumulative distance between adjacent path points, (x p ,y p ) is the final geographic coordinate.

[0177] The final output of the system includes the type label of each fault event and the location of the optical cable fault point, that is,

[0178] During training, the cross-entropy loss is used to calculate the difference between the fault type output by the model and the true label:

[0179]

[0180] Among them, y i' is the real fault type label, is the probability distribution predicted by the model.

[0181] Use mean squared error loss to optimize the deviation between the predicted position index and the true position:

[0182]

[0183] in, is the fault point index position predicted by the model, v i' is the actual fault location index.

[0184] The total loss function is the weighted sum of the two:

[0185]

[0186] Among them, λ cls ,λ loc is a hyperparameter that adjusts the weights of the two tasks.

[0187] Step 4: Use the model to detect the operation status of the optical cable in the area:

[0188] The preprocessed normalized optical power waveform sequence is input into the fault detection model, which goes through waveform anomaly detection, fault identification and classification, positioning calculation and positioning correction modules in sequence, and finally outputs the current operating status of the optical cable in the area and the corresponding fault geographical coordinates.

[0189] A specific embodiment of the present application provides an optical cable fault detection device, comprising:

[0190] A data acquisition unit, used to collect optical power data under the operating status of the optical cable line;

[0191] The data preprocessing unit performs denoising, resampling and normalization operations on the acquired optical power data to obtain a normalized waveform sequence with standard structure and consistent features.

[0192] and a detection unit, using the optical cable fault detection model trained in the optical cable fault detection method as described above, according to the waveform sequence Perform fault detection on optical cables and output the fault type and location.

[0193] A specific embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is called and executed by the processor, the optical cable fault detection method described above is implemented.

[0194] A specific embodiment of the present application provides a computer-readable medium. The computer-readable medium stores a computer program. When the computer program is called and executed by a computer, the optical cable fault detection method described above is implemented.

[0195] The parts not involved in the present invention are the same as the existing technology or are implemented by using the existing technology.

[0196] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this field, several variations and improvements can be made without departing from the creative concept of the present application, and these all fall within the scope of protection of the present application.

Claims

1. A method for detecting optical cable faults, characterized in that: The following steps are involved: Step 1: Collect raw data for model training; Step 2: Preprocess the collected raw data; Step 3: Build and train the optical cable fault detection model, which includes a waveform anomaly detection module, a TOP-Net fault identification network, and a positioning module. The waveform anomaly detection module preliminarily selects fault points as candidate fault points based on the preset fluctuation intensity threshold and short-term waveform slope changes; The TOP-Net fault identification network includes a TGA module that integrates local oscillation features, trend-peak features, and position encoding features. Based on the input candidate fault points, it outputs the fault category determination result through feature alignment, weighted fusion, and attention enhancement. The positioning module uses the differential gradient mutation information in the fusion feature as the core to determine the position index of the fault point in the optical cable waveform, and then performs offset calibration with the nonlinear mapping of the actual deployment path to obtain the corrected fault location index; Step 4: Use the trained optical cable fault detection model to detect optical cable faults.

2. The optical cable fault detection method according to claim 1, wherein: In step 1, optical power data of the optical cable line under different operating conditions is collected; the collected optical power data includes waveform responses of the optical cable under normal operation, performance degradation, and different types of fault conditions; Optical cable faults include fiber breakage, abnormal reflection, and slow-varying loss.

3. The optical cable fault detection method according to claim 1, wherein: Step 2 includes the following steps: Median filtering is used to reduce the noise of the optical power signal. The median filtering formula is as follows: P i (f) =Median(P i-k ,...,P i ,...,P i+k )∈R M Among them, P i (f) Represents the optical power value after filtering at the i-th sampling point, P i represents the optical power value of the original i-th sampling point, k represents half the width of the sliding window, the window size is 2k+1, and the original optical power data sequence obtained after median filtering is 4096 is the length of the original sequence; Perform linear interpolation resampling on the collected waveform signals so that all waveforms have consistent sampling intervals and lengths N. The linear interpolation resampling formula is as follows: i'∈{1,2,...,N} represents the i'th point in the target sequence; t i' Indicates the corresponding position of the resampled target position in the original sequence, t i' The original point interval is [j, j+1], where is rounded down; is the optical power value of the jth and j+1th points in the original sequence after median filtering, P i' is the power value of the i'th point in the resampled sequence; Perform Z-score normalization on the processed signal. The Z-score normalization formula is as follows: represents the normalized waveform, μ is the mean power of the resampled waveform, and σ is the standard deviation of the resampled waveform.

4. The optical cable fault detection method according to claim 3, characterized in that: In the optical cable fault detection model, the waveform anomaly detection module screens fault points in the following steps: Preprocessed optical power waveform sequence Input to the waveform anomaly detection module, where Represents the optical power value of the i'th distance sampling point, and the total number of sampling points is N; Perform a sliding window first-order difference operation on the waveform sequence, calculate the power change between each two adjacent sampling points, and obtain the difference sequence The calculation formula is as follows: in, is the local power change difference of the i'th point; Introduce the mutation threshold θ, set the empirical mutation threshold θ∈[0.05, 0.1], when the inequality is satisfied Then mark the i'th point as a candidate fault point; if It is determined to be a fiber break or a large insertion loss event; if It is judged to be reflection enhancement or coupling abnormality; The set of sampling point indices that meet the above conditions is defined as the candidate fault point set I′ fault ,Right now:

5. The optical cable fault detection method according to claim 1, wherein: In the optical cable fault detection model, the TOP-Net fault identification network processes data in the following steps: window extraction, three-category feature generation, TGA module fusion, and classification prediction. For each candidate point i′∈I′ fault , from the normalized optical power waveform sequence Extract the waveform window segment x with the point as the center and fixed length L i' , used for subsequent feature extraction; the window extraction method is: Where L=64 is the window length, and all out-of-bounds parts are padded with zeros; For each segment x i' Three types of basic feature representations are extracted in sequence: local oscillation features, trend-peak features, and position encoding features; The local oscillation characteristics are obtained by first-order difference and local statistical coding, and the formula is as follows: Where Δx n represents the local difference at position n in the waveform; μi' represents the local mean; σi' represents the local standard deviation; The difference sequence and the statistic are combined to form the final local oscillation eigenvector: Construct trend-peak features and extract the average slope, peak amplitude difference and local curvature of the waveform window segment; the formula is as follows Among them, S i' A represents the average slope of the waveform window at the candidate fault point i'; i' Indicates the peak amplitude difference of the waveform window at the candidate fault point i', max(x n )、min(x n ) are the maximum and minimum optical power values in the window; C i' represents the average second-order difference of the waveform segment at the candidate fault point i', |x n+1 -2x n +x n-1 | is the second-order difference in the form of central difference, reflecting the acceleration of the waveform change; The above three trend-peak features constitute the trend-peak vector of the candidate fault point i': By combining the standardized distance information with the sine and cosine periodic functions, a position embedding vector is constructed for each waveform sampling point; for a waveform window with a length of L and a center of the candidate fault point i', Define each location The relative position is: Among them, m is the global index of the current sampling point; p m ∈[-1,1] is the normalized relative position, reflecting the spatial distance of each point relative to the center; Introducing the Transformer-like sine and cosine position encoding mechanism, for the mth point, the relative position p m , whose position embedding is: Where d = 32 is the dimension of the position embedding vector, and the final position encoding of the m-th sampling point is: Combining the above two parts, the position encoding feature of each point m is defined as: Construct for all points in the waveform window: The position feature vector is input into the linear projection layer in the TGA module to generate position-guided attention weights; The above three types of features are input into the TGA module in parallel for unified dimension alignment and structural fusion. First, independent linear projection layers are used to map the three types of features to the same dimension. Then, the local oscillation features and trend-peak features are weightedly fused point by point based on the attention weights generated by the position encoding. Next, the fused features are residually connected with the original two types of features and layer normalization is performed to generate a stable and structure-enhanced fused feature representation. Each candidate point will be processed into a fused feature vector of length 128. The formula is as follows: A osc =σ(F pos ·W osc ) A trend =σ(F pos ·W trend ) F fused =A osc ⊙F osc +A trend ⊙F trend F output =LayerNorm(F fused +F osc +F trend ) Among them, FC osc 、FC trend 、FC pos Respectively represent the fully connected projection layers acting on three types of features; F osc 、F trend 、F pos is the unified dimensional feature representation after alignment; W osc 、W trend is a learnable attention weight parameter; σ(·) represents the Sigmoid activation function, which maps the dot product result to the (0, 1) interval; ⊙ is an element-by-element multiplication operation, which represents the attention weight; F fused is the intermediate feature representation after fusion; F output is the final fused output feature; LayerNorm(·) is a normalization operation performed on each feature vector dimension with a mean of 0 and a variance of 1; The fused feature vector is input into the multi-classification prediction network. The fault category label is output through the fully connected layer and the Softmax activation function to determine whether the current candidate point belongs to the fiber break, insertion loss, reflection or normal category. The formula is as follows: Among them, FC cls Represents the fully connected layer used by the classifier; represents the predicted probability distribution of the fault category of the i'th sample; Soft max(·) is the multi-classification activation function.

6. The optical cable fault detection method according to claim 1, wherein: In the optical cable fault detection model positioning module, a dynamic gradient tracking positioning algorithm based on a fused feature sequence is used to locate the fault point from the feature fluctuations and map it to the physical distance target. The positioning calculation process is as follows: F output ={F1,F2,...,F L },ΔF a =F a+1 -F a slag k =ReLU(Conv1D(G[a K ±r])) Where ΔF a Indicates the intensity of feature change between adjacent points; g a Represents the Euclidean distance of the a-th pair of differential vectors, and obtains a one-dimensional gradient sequence G={g1,g2,...,g L=1 }; Represents the gradient value after Gaussian convolution smoothing, w k is the trainable Gaussian kernel weight, satisfying ∑w k =1; r a Represents the normalized gradient response, and the normalized response graph R={r1,r2,...,r L=1 }, r i ∈(0,1); μ ra represents the global average response; τ is the adaptively calculated dynamic threshold; ω and b are trainable linear weights and biases; tanh is the activation enhancement nonlinear expression; H mask is the response mask; score k It is a convolution score for the gradient sequence in the neighborhood of each candidate point; V is the set of predicted continuous path points; TSI a is the gradient trend stability index calculated on the path point V; v represents the relative position ratio of the fault point in the sample, D total is the actual length of the optical cable, ε offset is the correction offset, D fault Indicates the final output optical cable fault point location; Based on the pre-built optical cable laying path model ρ={(x0,y0),...,(x h ,y h )}, the physical distance D fault Map to actual geographic coordinates; find two adjacent path points with matching distances and use linear interpolation to obtain the geographic location: in, is the cumulative distance between adjacent path points, (x p ,y p ) is the final geographic coordinate; The final output includes the type label of each fault event and the location of the optical cable fault point, that is, 7. The optical cable fault detection method according to claim 1, characterized in that: In step 3, during training, the cross entropy loss is used to calculate the difference between the fault type output by the model and the true label: Among them, y i' is the real fault type label, is the probability distribution predicted by the model; Use mean squared error loss to optimize the deviation between the predicted position index and the true position: in, is the fault point index position predicted by the model, v i' is the actual fault location index; The total loss function is the weighted sum of the two: Among them, λ cls ,λ loc is a hyperparameter that adjusts the weights of the two tasks.

8. An optical cable fault detection device, characterized in that: include: A data acquisition unit, used to collect optical power data under the operating status of the optical cable line; The data preprocessing unit performs denoising, resampling and normalization operations on the acquired optical power data to obtain a normalized waveform sequence with standard structure and consistent features. and a detection unit, using the optical cable fault detection model trained in the optical cable fault detection method according to any one of claims 1 to 7, according to the waveform sequence Perform fault detection on optical cables and output the fault type and location.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is called and executed by the processor, the optical cable fault detection method according to any one of claims 1 to 7 is implemented.

10. A computer-readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is called and executed by a computer, the optical cable fault detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Knock detection method and device, equipment and storage medium

    CN120832557A