Optical fiber fault positioning method and device, electronic equipment and storage medium
The OTDR curve of the fiber link is collected through the OTDR equipment and trained using the fiber event prediction model. The problems of low efficiency and low accuracy of fiber fault positioning in the prior art are solved, and accurate fiber fault positioning and rapid fault diagnosis are achieved.
Patent Information
- Application Number
- CN202510271190.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, the method of manually calculating the location of the fiber failure is inefficient and has low accuracy.
The OTDR curve of the fiber link is collected through a dedicated OTDR device, divided it into multiple windows equidistantly, and the OTDR curve fragments in each window are obtained, and these fragments are trained using the fiber event prediction model to identify the target fragments with faults, thereby determining the location of the fault.
Accurate fiber fault location is achieved, reducing the cost of manual search for fault points, and providing fast and reliable technical support for the maintenance and fault diagnosis of fiber links.
Smart Images

Figure CN120165764A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a method, device, electronic device and storage medium for optical fiber fault location. Background Art
[0002] Optical fiber communication systems have important applications in modern communication networks. They transmit data at the speed of light, providing ultra-high-speed transmission capabilities to meet the needs of high-bandwidth applications such as large-capacity data, high-definition video, and real-time audio in modern society. At the same time, optical fiber communication has the characteristics of low transmission loss and signal attenuation, making long-distance transmission possible. Optical fiber communication has a high resistance to electromagnetic interference, which makes signal transmission more stable and reliable, reducing the possibility of communication interruption. Secondly, optical fiber communication has higher security because optical signals are difficult to steal or interfere with, providing better data protection and privacy confidentiality. In addition, optical fiber communication also has a smaller volume and weight, suitable for high-density wiring and mobile communication requirements. Therefore, optical fiber communication is an essential communication method in modern society.
[0003] Although optical fiber communication systems have advantages such as high bandwidth, low latency, and anti-interference, they may still experience failures. Therefore, optical fiber fault location is a key step in ensuring the real-time performance and stability of optical fiber communication. By carefully measuring and analyzing the length and attenuation of optical fibers, the problems existing in optical fiber communication can be accurately determined, and the maintenance work can be carried out accurately and effectively.
[0004] In traditional optical fiber fault location methods, manual sampling measurement and calculation are carried out using precise optical fiber measuring instruments. Although the measured data obtained is accurate and reliable, the labor cost is high, and for overly long optical fibers, faults between sampling points may be missed. Therefore, the maintenance and management of optical fibers and other aspects are complex and inconvenient, and the cost is huge. Summary of the Invention
[0005] The present invention provides a method, device, electronic device and storage medium for optical fiber fault location to solve the problems of low efficiency and low accuracy in the existing method of manually calculating the optical fiber fault location.
[0006] In a first aspect, the present invention provides an optical fiber fault location method, including: Collecting an OTDR curve of a to-be-tested optical fiber link through a dedicated OTDR device; Equidistantly dividing the to-be-tested optical fiber link to create multiple windows, and obtaining OTDR curve segments within each window; Based on each of the OTDR curve segments, train through an optical fiber event prediction model to determine the target OTDR curve segment with an optical fiber fault; the optical fiber fault monitoring model is obtained by training based on OTDR curve segment samples and their optical fiber event type labels; According to the target window where the target OTDR curve segment is located, determine the location information of the optical fiber fault in the optical fiber link to be measured.
[0007] In one embodiment, the optical fiber event prediction model is trained in the following manner: Create a plurality of window samples based on the optical fiber link samples, and obtain the OTDR curve segment samples within each of the window samples; Generate optical fiber event type labels for each of the OTDR curve segment samples; the optical fiber event type labels include at least a normal event label and a fault event label; Perform model training based on each of the OTDR curve segment samples and their optical fiber event type labels to obtain the optical fiber event prediction model.
[0008] In one embodiment, when generating the optical fiber event type labels for each of the OTDR curve segment samples, for each window sample, the following steps are included: Determine the attenuation value samples and optical fiber distance samples of each optical fiber sampling point sample in the window sample; Perform first-order difference quotient calculation based on each of the attenuation value samples and each of the optical fiber distance samples to obtain a plurality of slope values; If none of the plurality of slope values exceed the second preset threshold, determine that there is no optical fiber fault within the window sample, and generate a normal event label for the OTDR curve segment sample within the window sample; If there is any slope value exceeding the second preset threshold and there are no two consecutive slope values changing in a positive and negative manner, determine that there is an optical fiber fault within the window sample, and generate a non-reflection event label for the OTDR curve segment sample within the window sample; If there are two consecutive slope values changing in a positive and negative manner and the change amplitude exceeds the second preset amplitude change value, determine that there is an optical fiber fault within the window sample, and generate a reflection event label for the OTDR curve segment sample within the window sample.
[0009] In one embodiment, the following loss function is adopted during the model training process: ; where L represents the loss function; y represents the predicted value; represents the true value.
[0010] In one embodiment, collecting the OTDR curve of the optical fiber link to be measured by a dedicated OTDR device includes: Sending a pulsed optical signal to the optical fiber link to be measured by a dedicated OTDR device, and obtaining the reflection signals of multiple consecutive optical fiber sampling points in the optical fiber link to be measured; Calculating the optical fiber distance and attenuation value of each optical fiber sampling point according to each reflection signal; Mapping each optical fiber distance to the abscissa and mapping each attenuation value to the ordinate to construct an OTDR curve.
[0011] In one embodiment, the optical fiber event prediction model includes a batch normalization layer, a first convolutional layer, a reshaping tensor layer, a first max pooling layer, a second convolutional layer, a second max pooling layer, a flattening layer, and a linear layer; The batch normalization layer is used to normalize each OTDR curve segment to obtain first output data; The first convolutional layer is used to extract features from the first output data to obtain second output data; The reshaping tensor layer is used to adjust the dimensions of the second output data to obtain third output data; The first max pooling layer is used to reduce the dimension of the third output data to obtain fourth output data; The second convolutional layer is used to extract features from the fourth output data to obtain fifth output data; The second max pooling layer is used to reduce the dimension of the fifth output data to obtain sixth output data; The flattening layer is used to flatten the sixth output data into one-dimensional data to obtain seventh output data; The linear layer is used to perform classification calculation on the seventh output data to obtain the optical fiber event types to which each OTDR curve segment belongs.
[0012] In a second aspect, the present invention further provides an optical fiber fault location device, including: An OTDR curve acquisition module, configured to collect the OTDR curve of the optical fiber link to be measured by a dedicated OTDR device; A window division module, configured to equally divide the optical fiber link to be measured, create multiple windows, and obtain OTDR curve segments within each window; An optical fiber fault prediction module, configured to train based on each OTDR curve segment through an optical fiber event prediction model to determine a target OTDR curve segment with an optical fiber fault; the optical fiber fault monitoring model is obtained by training based on OTDR curve segment samples and their optical fiber event type labels; An optical fiber fault location module is configured to determine the location information of the optical fiber fault in the to-be-tested optical fiber link according to the target window where the target OTDR curve segment is located.
[0013] In a third aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of any of the above-mentioned optical fiber fault location methods are implemented.
[0014] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned optical fiber fault location methods are implemented.
[0015] The optical fiber fault location method, device, electronic device, and storage medium provided by the present invention divide the to-be-tested optical fiber link at equal intervals and create multiple windows, obtain the OTDR curve segments within each window, and then use the optical fiber event prediction model to train each OTDR curve segment, accurately identify the target OTDR curve segment with an optical fiber fault, and then through the target window where the target OTDR curve segment is located, the location information of the optical fiber fault in the to-be-tested optical fiber link can be effectively calculated, realizing accurate optical fiber fault location, reducing the cost of manual search for fault points, and providing fast and reliable technical support for the maintenance and fault diagnosis of the optical fiber link. Description of the Drawings
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 It is a flowchart of the optical fiber fault location method provided by the present invention.
[0018] Figure 2 It is a schematic diagram of a normal OTDR curve provided by the present invention.
[0019] Figure 3 It is a schematic diagram of an abnormal OTDR curve provided by the present invention.
[0020] Figure 4 It is a schematic diagram of the architecture of the optical fiber event prediction model provided by the present invention.
[0021] Figure 5 It is a schematic diagram of the structure of the optical fiber fault location device provided by the present invention.
[0022] Figure 6 It is a schematic structural diagram of the electronic device provided by the present invention. Specific embodiments
[0023] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0024] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein.
[0025] The following will be combined with Figures 1 - 6 to describe the optical fiber fault location method, device, electronic device and storage medium provided by the present invention.
[0026] It should be noted that the optical fiber fault location method provided by the embodiments of the present invention is implemented based on an optical fiber fault location device. The optical fiber fault location method provided by the present invention relies on artificial intelligence technology to obtain data such as optical fiber reflection loss, attenuation, and event location from a professional measuring device of an Optical Time-Domain Reflectometer (OTDR). The data is input into a trained one-dimensional convolutional neural network, and through model processing, the accurate location of the optical fiber fault is further obtained, reducing the cost of manually searching for the fault point. This method is simple and feasible, easy to implement, and adaptable to various types of optical fibers.
[0027] The embodiments of the present invention describe the optical fiber fault location method by taking the optical fiber fault location device in the optical fiber fault location device as the execution subject.
[0028] Combined with Figure 1 , Figure 1 It is a schematic flow diagram of the optical fiber fault location method provided by the present invention.
[0029] As Figure 1 shown, the method includes the following: Step 101: Collect the OTDR curve of the optical fiber link to be measured through a dedicated OTDR device; Step 102: Divide the optical fiber link to be measured at equal intervals, create multiple windows, and obtain the OTDR curve segments within each window; Step 103: Based on each of the OTDR curve segments, train through an optical fiber event prediction model to determine the target OTDR curve segment where an optical fiber fault exists. Step 104: According to the target window where the target OTDR curve segment is located, determine the position information of the optical fiber fault in the optical fiber link to be measured.
[0030] Specifically, an optical pulse signal is sent to the optical fiber link to be measured through an OTDR device, and data is collected for multiple consecutive optical fiber sampling points in the optical fiber link to be measured by the OTDR device, that is, the reflected signals of each optical fiber sampling point are collected. Therefore, the reflected signals of multiple optical fiber sampling points in the optical fiber link to be measured can be obtained from the OTDR device.
[0031] According to the reflected signal of each optical fiber sampling point, calculate the optical fiber distance and attenuation value of each optical fiber sampling point, and construct an OTDR curve from the optical fiber distance and attenuation value of each optical fiber sampling point. The horizontal axis of the OTDR curve represents the optical fiber distance, and the vertical axis represents the attenuation value. As Figure 2 shown, Figure 2 is a schematic diagram of a normal OTDR curve provided by the present invention. Figure 2 There are two Fresnel reflection peaks a and b in it. The cursor A is set at the trailing edge of the Fresnel reflection peak a as the starting end of the optical fiber link to be measured. The part before the cursor A is the test blind area of the OTDR instrument. The cursor B is set at the leading edge of the Fresnel reflection peak b as the termination end of the optical fiber link to be measured. The distance between the cursor A and the cursor B is the length of the optical fiber link to be measured, denoted as: where, is the optical fiber distance corresponding to the cursor A, is the optical fiber distance corresponding to the cursor B.
[0032] Furthermore, the optical fiber link to be measured is equally divided through a window function to create multiple windows, and each window is numbered, such as window 1, window 2,..., window n. Thus, the OTDR curve segments within each window can be obtained. It can be considered that the OTDR curve is cut into OTDR curve segments according to the size of each window, and the types of optical fiber events within the window are predicted in a small range to achieve accurate optical fiber fault identification.
[0033] Further, input each OTDR curve segment into the optical fiber event prediction model, perform learning and analysis through the optical fiber event prediction model, and output the type of optical fiber event to which each OTDR curve segment belongs. Among them, the types of optical fiber events include normal events and fault events, and fault events include but are not limited to reflection events and non-reflection events. The window where these fault events exist is the position where there is an optical fiber fault in the optical fiber link to be measured. As Figure 3 shown, Figure 3 is a schematic diagram of the abnormal OTDR curve provided by the present invention.
[0034] It should be noted that in the OTDR curve, a normal event reflects the normal state of the optical fiber link, but there is no significant reflection or abnormal loss. It may be manifested as a gradual change in the signal intensity during the OTDR test without causing obvious signal distortion or reflection; a reflection event refers to the phenomenon of optical signal reflection caused by discontinuities in the optical fiber link, losses at interfaces, or other abnormal characteristics. A reflection event usually appears as a prominent reflection wave in the OTDR curve, forming a "spike" in the echo diagram; a non-reflection event refers to other events in the optical fiber link that do not involve reflection, usually manifested as attenuation, loss, or change of the optical signal, but without a significant reflection wave.
[0035] According to the type of optical fiber event to which each OTDR curve segment output by the optical fiber event prediction model belongs, filter out the target OTDR curve segments belonging to reflection events or non-reflection events, and determine the target window where the target OTDR curve segment is located. After knowing the position of the starting end of the optical fiber link to be measured, since the size of each window is equal and known, by combining the product of the label of the target window and the window size with the position of the starting end, the position information of the optical fiber fault in the optical fiber link to be measured can be determined.
[0036] The optical fiber fault location method provided by the present invention divides the optical fiber link to be measured at equal intervals and creates multiple windows, obtains the OTDR curve segments within each window, and then uses the optical fiber event prediction model to train each OTDR curve segment, accurately identifying the target OTDR curve segments with optical fiber faults. Furthermore, through the target window where the target OTDR curve segment is located, the position information of the optical fiber fault in the optical fiber link to be measured can be effectively calculated, realizing accurate optical fiber fault location, reducing the cost of manual search for fault points, and providing fast and reliable technical support for the maintenance and fault diagnosis of the optical fiber link.
[0037] In some embodiments, based on step 101, the collecting the OTDR curve of the optical fiber link to be measured by a dedicated OTDR device includes: Send a pulsed optical signal to the optical fiber link to be measured through a dedicated OTDR device, and obtain the reflection signals of multiple consecutive optical fiber sampling points in the optical fiber link to be measured; Calculate the optical fiber distance and attenuation value of each optical fiber sampling point according to each of the reflection signals; Map each of the optical fiber distances to the abscissa and map each of the attenuation values to the ordinate to construct an OTDR curve.
[0038] Specifically, an OTDR device usually supports multiple optical fiber ports. Select an appropriate optical fiber port according to the test requirements and connect it to the optical fiber link to be measured through the optical fiber port. After the connection is completed, some settings for the measurement are also required to ensure accurate test results. These settings include the optical fiber type, measurement range, wavelength selection, etc. The optical fiber type is to determine the type of the optical fiber link to be measured (such as single-mode, multi-mode), which will affect the selection of the pulsed signal; the measurement range is to set an appropriate measurement range according to the length of the optical fiber link; the wavelength selection means that the OTDR device may support pulsed optical signals of different wavelengths, and usually the actual operating wavelength of the optical fiber is selected. The measurement of OTDR is based on time-domain reflection, and the attenuation of the signal is inferred by calculating the round-trip time of the optical pulse. Therefore, the OTDR device needs to determine the sampling points according to the set measurement range and measurement accuracy. The more sampling points, the higher the measurement accuracy, but the longer the measurement time will be.
[0039] After determining the optical fiber link to be measured and the sampling parameters, the OTDR device will send a pulsed optical signal to both paths of the optical fiber to be measured and collect the reflection signals of multiple consecutive optical fiber sampling points in the optical fiber link to be measured. Therefore, the reflection signals of multiple optical fiber sampling points in the optical fiber link to be measured can be obtained from the OTDR device.
[0040] Furthermore, according to each of the reflection signals, calculate the optical fiber distance and attenuation value of each optical fiber sampling point. The formula is as follows: where D is the attenuation value, is the attenuation coefficient, is the distance between the position of the optical fiber sampling point and the position of the cursor A (i.e., the starting end).
[0041] Furthermore, construct a coordinate axis, the index of its horizontal axis is the optical fiber distance, and the index of its vertical axis is the attenuation value. Map the optical fiber distances of each optical fiber sampling point to the abscissa and map the attenuation values to the ordinate, and connect the points to construct an OTDR curve. Specifically, it is possible that the OTDR device cannot collect the reflection signal of a certain optical fiber sampling point. Then the data of this optical fiber sampling point in the OTDR curve is empty, and linear interpolation can be used to complete it. This method is very common in data preprocessing and will not be elaborated here.
[0042] In the embodiments of the present invention, the optical fiber distance and attenuation value in the optical fiber link to be measured are measured and calculated, and these data are visually presented on the OTDR curve, so as to realize the rapid evaluation of the optical fiber link performance and fault location, and provide fast and reliable technical support for the maintenance and fault diagnosis of the optical fiber link.
[0043] In some embodiments, the optical fiber event prediction model includes a batch normalization layer, a first convolutional layer, a reshaping tensor layer, a first max pooling layer, a second convolutional layer, a second max pooling layer, a flattening layer, and a linear layer; The batch normalization layer is used to perform normalization processing on each of the OTDR curve segments to obtain first output data; The first convolutional layer is used to extract features from the first output data to obtain second output data; The reshaping tensor layer is used to adjust the dimensions of the second output data to obtain third output data; The first max pooling layer is used to reduce the dimension of the third output data to obtain fourth output data; The second convolutional layer is used to extract features from the fourth output data to obtain fifth output data; The second max pooling layer is used to reduce the dimension of the fifth output data to obtain sixth output data; The flattening layer is used to flatten the sixth output data into one-dimensional data to obtain seventh output data; The linear layer is used to perform classification calculation on the seventh output data to obtain the optical fiber event types to which each of the OTDR curve segments belongs.
[0044] It should be noted that the model architecture of the optical fiber event prediction model adopts a one-dimensional convolutional neural network, and the one-dimensional convolutional neural network at least includes a convolutional layer, a pooling layer, and a linear layer. For one-dimensional input data, the convolutional layer performs the convolution calculation of the one-dimensional sequence and the one-dimensional convolutional kernel to realize one-dimensional non-linear operation. The pooling layer is one-dimensional max pooling, which reduces the data features on the premise of maintaining the scale invariance of the OTDR one-dimensional data, reduces the number of parameters and the amount of calculation, prevents overfitting, and improves the generalization ability of the model. The linear layer is the classifier in the one-dimensional convolutional neural network. After normalizing, convolving, and pooling the original data, the original data is mapped to the feature space of the hidden layer, the feature vector is extracted, and then the feature vector is classified by the classifier to obtain the required output. The linear layer includes weights and biases. Taking the one-dimensional linear layer calculation as an example, if the one-dimensional input is X, the weight matrix is W, and the bias is B, then the output Y can be calculated by the following formula: .
[0045] By adjusting the sizes of W and B, for example, adjusting W to 2×3 and B to 2×1, an output Y of size 2×1 can be obtained. For the present invention, the size of the output should be l×N, where N is the number of optical fiber sampling points.
[0046] The optical fiber event prediction model belongs to a non - linear model, specifically including a batch normalization layer, a first convolutional layer, a reshaping tensor layer, a first max - pooling layer, a second convolutional layer, a second max - pooling layer, a flattening layer, and a first linear layer, a second linear layer, and a third linear layer. As Figure 4 shown, Figure 4 it is a schematic diagram of the architecture of the optical fiber event prediction model provided by the present invention.
[0047] Therefore, inputting each OTDR curve segment into the optical fiber event prediction model for analysis and processing is as follows. Input each OTDR curve segment into the batch normalization layer, and the batch normalization layer normalizes each OTDR curve segment to output the first output data. Further, input the first output data into the first convolutional layer, and the first convolutional layer extracts features from the first output data to output the second output data. Further, input the second output data into the reshaping tensor layer, and the reshaping tensor layer adjusts the dimensions of the second output data to adapt to the data processing of subsequent network layers and outputs the third output data. Further, input the third output data into the first max - pooling layer, and the first max - pooling layer reduces the dimension of the third output data to output the fourth output data. Further, input the fourth output data into the second convolutional layer, and the second convolutional layer extracts features from the fourth output data to output the fifth output data. Further, input the fifth output data into the second max - pooling layer, and the second max - pooling layer reduces the dimension of the fifth output data to obtain the sixth output data. Further, input the sixth output data into the flattening layer, and the flattening layer flattens the sixth output data into one - dimensional data to obtain the seventh output data. Further, input the seventh output data into the linear layer, and the first linear layer, the second linear layer, and the third linear layer perform classification calculations on the seventh output data to output the types of optical fiber events to which each OTDR curve segment belongs.
[0048] In one embodiment, first, the batch normalization layer normalizes the input data to 1×1×ω, the first convolutional layer expands 1×1×ω to 1×200×ω, and then convolutions are performed on the expanded channels (200) through the reshaping tensor layer, the first max - pooling layer, and the second convolutional layer to fit the linear relationship and non - linear perturbations, losses, and errors. Then, redundant information is removed through the second max - pooling to reduce the number of parameters. Finally, the obtained high - dimensional data (1×ω×25) is flattened into a one - dimensional feature vector (1×1×25ω), and classification is performed through 3 linear layers to obtain an output vector 1×1×k of length k.
[0049] Table 1 Parameters of Each Layer of the Model
[0050] As shown in Table 1, there are two hyperparameters k and ω in the model. k represents the length of the input data, and ω represents the number of optical fiber sampling points to be predicted. Either the real-time data can be used alone as the input, and ω is taken as 1, or the real-time data and ω - 1 past data can be combined and used as the input in vector form. At this time, ω is the length of the input vector.
[0051] In the embodiment of the present invention, the OTDR curve segments within the equally divided window are input into the optical fiber event prediction model. The optical fiber event prediction model analyzes each OTDR curve segment, accurately predicts the optical fiber event type to which each OTDR curve segment belongs, and can accurately identify the target OTDR curve segment with optical fiber faults, thereby realizing accurate optical fiber fault location, reducing the cost of manual search for fault points, and providing fast and reliable technical support for the maintenance and fault diagnosis of the optical fiber link.
[0052] In some embodiments, the optical fiber event prediction model is trained in the following manner: Create multiple window samples based on the optical fiber link samples, and obtain the OTDR curve segment samples within each of the window samples; Generate the optical fiber event type labels for each of the OTDR curve segment samples; the optical fiber event type labels include at least a normal event label and a fault event label; Perform model training based on each of the OTDR curve segment samples and their optical fiber event type labels to obtain the optical fiber event prediction model.
[0053] Specifically, send a pulsed optical signal to the optical fiber link sample through an OTDR device, and collect data on multiple consecutive optical fiber sampling point samples in the optical fiber link sample through the OTDR device. Calculate the optical fiber distance and attenuation value of each optical fiber sampling point sample, and construct an OTDR curve sample from the optical fiber distance and attenuation value of each optical fiber sampling point sample.
[0054] Furthermore, equally divide the optical fiber link sample through a window function to create multiple window samples. From this, the OTDR curve segment samples within each window sample can be obtained, which can be considered as cutting the OTDR curve sample into OTDR curve segment samples according to the size of each window sample.
[0055] Furthermore, label each of the OTDR curve segment samples to generate the optical fiber event type labels for each of the OTDR curve segment samples, which include at least a normal event label, a reflection event label, and a non-reflection event label.
[0056] Further, use each OTDR curve segment sample and its optical fiber event type label as a data set. For the preprocessed data set, use the method of random sampling to ensure data randomness. It can be divided into a training set according to a ratio of 70% - 80%, a validation set according to a ratio of 10% - 15%, and the remaining 10% - 15% is divided into a test set.
[0057] Train the model with the training set to help the model learn features and patterns. Further, input the validation set into the trained model for optical fiber event type prediction to verify the accuracy of the prediction results of the trained model. From the verification results, it can be seen that the accuracy of the model gradually improves after training. Compare the predicted results with the actual results, analyze the accuracy of the predicted results, and then further optimize the model. For the optical fiber event type prediction task, its true label should be a vector with values of 0 and 1 for 1×k (where 0 represents no fault event and 1 represents a fault event). Therefore, before calculating the loss function, perform a softmax calculation on the 1×k model output vector to normalize the range of the output vector to 0 and 1.
[0058] The following formula is the calculation formula for performing softmax on the 1×k output vector: ; where, represents the j-th component in the model output vector, represents the component after normalization processing.
[0059] During the model training process, use the following loss function: ; where, L represents the loss function; y represents the predicted value; represents the true value.
[0060] In the embodiment of the present invention, through each OTDR curve segment sample and its optical fiber event type label for model training, a trained optical fiber event prediction model is obtained, which can accurately predict the optical fiber event type to which each OTDR curve segment belongs, that is, it can accurately identify the target OTDR curve segment with an optical fiber fault, thereby realizing accurate optical fiber fault location, reducing the cost of manual search for fault points, and providing fast and reliable technical support for the maintenance and fault diagnosis of optical fiber links.
[0061] It should be noted that in the OTDR curve, normal events usually appear as relatively smooth curves, reflection events usually appear as a "spike", and non-reflection events usually appear as obvious attenuation curves. Therefore, for the prediction of optical fiber events within each small window sample, the first-order difference calculation method can be used to measure the change between two adjacent optical fiber sampling point samples within the window sample. The first-order difference calculation method specifically includes calculating the first-order difference value between two optical fiber sampling point samples and also calculating the first-order slope value between two optical fiber sampling point samples. Since the distance between two adjacent optical fiber sampling point samples is small enough and the change between them is relatively smooth, the change between two adjacent optical fiber sampling point samples within the window sample can be measured by calculating the first-order difference value, or by calculating the first-order slope value.
[0062] When performing the first-order difference calculation, it is calculated by the two-point method. Let the values of the function y = f(x) at two points x0 and x1 be y0 and y1 respectively, and the polynomial is obtained as follows: ; Make it satisfy , .
[0063] From analytic geometry, it can be obtained that: Among them, is the obtained first-order difference value, is the obtained first-order slope value.
[0064] When generating the optical fiber event type labels for each of the OTDR curve segment samples, the following steps are included for each window sample: Determine the attenuation value samples and optical fiber distance samples of each optical fiber sampling point sample in the window sample; Perform first-order difference quotient calculation based on each of the attenuation value samples and each of the optical fiber distance samples to obtain a plurality of slope values; If none of the plurality of slope values exceed the second preset threshold, it is determined that there is no optical fiber fault within the window sample, and a normal event label for the OTDR curve segment sample within the window sample is generated; If there is any slope value that exceeds the second preset threshold and there is no change in which two consecutive slope values are positive and negative, it is determined that there is an optical fiber fault within the window sample, and a non-reflection event label for the OTDR curve segment sample within the window sample is generated; If there are two consecutive slope values that change from positive to negative and the change amplitude exceeds the second preset amplitude change value, it is determined that there is a fiber optic fault within the window sample, and a reflection event label for the OTDR curve segment sample within the window sample is generated.
[0065] Specifically, the attenuation value samples and fiber optic distance values of each fiber optic sampling point sample in the window sample are determined, and first-order difference quotient calculation is performed based on each attenuation value sample and each fiber optic distance value, that is, the first-order slope value calculation is performed on the attenuation value sample and fiber optic distance sample of two fiber optic sampling point samples with an adjacent relationship, obtaining multiple slope values.
[0066] If none of the multiple slope values exceed the second preset threshold, it is determined that there is no fiber optic fault within the window sample, and a normal event label for the OTDR curve segment sample within the window sample is generated, where the second preset threshold is set according to the actual situation.
[0067] If any one of the multiple slope values exceeds the second preset threshold and there are no two consecutive slope values that change from positive to negative, it is determined that there is a fiber optic fault within the window sample, and a non-reflection event label for the OTDR curve segment sample within the window sample is generated.
[0068] If there are two consecutive slope values that change from positive to negative and the change amplitude exceeds the second preset amplitude change value, it is determined that there is a fiber optic fault within the window sample, and a reflection event label for the OTDR curve segment sample within the window sample is generated, where the second preset amplitude change value is set according to the actual situation.
[0069] By analyzing the attenuation value samples and fiber optic distance samples in the OTDR curve segment sample and performing first-order difference quotient calculation in the embodiments of the present invention, different event types in the fiber optic link can be effectively identified, including normal events, non-reflection events, and reflection events, thereby achieving precise classification and positioning of fiber optic faults, and overall improving the automation level of fiber optic link monitoring and the accuracy of fault diagnosis.
[0070] The fiber optic fault location device provided by the present invention is described below, and the fiber optic fault location device described below can be mutually corresponding and referred to with the fiber optic fault location method described above.
[0071] Refer to Figure 5 , Figure 5 is a schematic structural diagram of the fiber optic fault location device provided by the present invention.
[0072] The fiber optic fault location device includes: An OTDR curve acquisition module 510, configured to acquire the OTDR curve of the fiber optic link to be measured through a dedicated OTDR device.
[0073] A window division module 520, configured to equally divide the to-be-tested optical fiber link, create multiple windows, and obtain OTDR curve segments within each window.
[0074] An optical fiber fault prediction module 530, configured to train based on each of the OTDR curve segments through an optical fiber event prediction model to determine target OTDR curve segments with optical fiber faults; the optical fiber fault monitoring model is obtained by training based on OTDR curve segment samples and their optical fiber event type labels.
[0075] An optical fiber fault location module 540, configured to determine the location information of the optical fiber fault in the to-be-tested optical fiber link according to the target window where the target OTDR curve segment is located.
[0076] The optical fiber fault location device provided by the present invention equally divides the to-be-tested optical fiber link and creates multiple windows, obtains OTDR curve segments within each window, then uses the optical fiber event prediction model to train each OTDR curve segment, accurately identifies the target OTDR curve segments with optical fiber faults, and then through the target window where the target OTDR curve segment is located, can effectively calculate the location information of the optical fiber fault in the to-be-tested optical fiber link, realizes accurate optical fiber fault location, reduces the cost of manually searching for fault points, and provides fast and reliable technical support for the maintenance and fault diagnosis of the optical fiber link.
[0077] Further, the OTDR curve acquisition module 510 is further configured to: Send a pulsed optical signal to the to-be-tested optical fiber link through a dedicated OTDR device, and obtain the reflection signals of multiple consecutive optical fiber sampling points in the to-be-tested optical fiber link; According to each of the reflection signals, calculate the optical fiber distance and attenuation value of each of the optical fiber sampling points; Map each of the optical fiber distances to the abscissa and map each of the attenuation values to the ordinate to construct an OTDR curve.
[0078] Further, the optical fiber fault location device is further configured to: Create multiple window samples based on optical fiber link samples, and obtain OTDR curve segment samples within each of the window samples; Generate optical fiber event type labels for each of the OTDR curve segment samples; the optical fiber event type labels at least include a normal event label and a fault event label; Perform model training based on each of the OTDR curve segment samples and their optical fiber event type labels to obtain the optical fiber event prediction model.
[0079] Further, the optical fiber fault location device is further configured to: Determine the attenuation value samples and optical fiber distance samples of each optical fiber sampling point sample in the window sample; Perform first-order difference quotient calculation based on each of the attenuation value samples and each of the optical fiber distance samples to obtain a plurality of slope values; If none of the plurality of slope values exceed the second preset threshold, it is determined that there is no optical fiber fault in the window sample, and a normal event label for the OTDR curve segment sample within the window sample is generated; If there is any slope value exceeding the second preset threshold and there are no two consecutive slope values showing a positive-negative change, it is determined that there is an optical fiber fault in the window sample, and a non-reflection event label for the OTDR curve segment sample within the window sample is generated; If there are two consecutive slope values showing a positive-negative change and the change amplitude exceeds the second preset amplitude change value, it is determined that there is an optical fiber fault in the window sample, and a reflection event label for the OTDR curve segment sample within the window sample is generated.
[0080] It should be noted that the optical fiber fault location device provided by the present invention can execute the optical fiber fault location method described in any of the above embodiments during specific operation, and this embodiment will not be elaborated herein.
[0081] Figure 6 is a schematic structural diagram of an electronic device provided by the present invention. As Figure 6 shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640. Among them, the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logical instructions in the memory 630 to execute the optical fiber fault location method, which includes: collecting the OTDR curve of the optical fiber link to be measured through a dedicated OTDR device; equally dividing the optical fiber link to be measured to create a plurality of windows, and obtaining the OTDR curve segments within each window; based on each of the OTDR curve segments, training through an optical fiber event prediction model to determine the target OTDR curve segment with an optical fiber fault; the optical fiber fault monitoring model is obtained by training based on the OTDR curve segment samples and their optical fiber event type labels; according to the target window where the target OTDR curve segment is located, determining the location information of the optical fiber fault in the optical fiber link to be measured.
[0082] In addition, when the logical instructions in the above-mentioned memory 630 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 an 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 the various embodiments of the present invention. The aforementioned storage medium includes: various media 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 that can store program codes.
[0083] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the optical fiber fault location method provided in the above-mentioned embodiments. The method includes: collecting an OTDR curve of a fiber optic link to be measured through a dedicated OTDR device; equally dividing the fiber optic link to be measured to create multiple windows and obtaining OTDR curve segments within each window; based on each of the OTDR curve segments, training through an optical fiber event prediction model to determine a target OTDR curve segment where a fiber optic fault exists; the optical fiber fault monitoring model is obtained through model training based on OTDR curve segment samples and their optical fiber event type labels; according to the target window where the target OTDR curve segment is located, determining the location information of the fiber optic fault in the fiber optic link to be measured.
[0084] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the optical fiber fault location method provided in the above-mentioned embodiments. The method includes: collecting an OTDR curve of a fiber optic link to be measured through a dedicated OTDR device; equally dividing the fiber optic link to be measured to create multiple windows and obtaining OTDR curve segments within each window; based on each of the OTDR curve segments, training through an optical fiber event prediction model to determine a target OTDR curve segment where a fiber optic fault exists; the optical fiber fault monitoring model is obtained through model training based on OTDR curve segment samples and their optical fiber event type labels; according to the target window where the target OTDR curve segment is located, determining the location information of the fiber optic fault in the fiber optic link to be measured.
[0085] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for locating an optical fiber fault, characterized in that: include: Collect the OTDR curve of the optical fiber link to be tested through a dedicated OTDR device; The optical fiber link to be tested is divided into equal intervals to create multiple windows, and an OTDR curve segment in each window is obtained; Based on each of the OTDR curve segments, a fiber event prediction model is trained to determine a target OTDR curve segment where a fiber fault exists; the fiber fault monitoring model is obtained by model training based on the OTDR curve segment samples and their fiber event type labels; According to the target window where the target OTDR curve segment is located, the location information of the optical fiber fault in the optical fiber link to be tested is determined.
2. The optical fiber fault location method according to claim 1, characterized in that: The optical fiber event prediction model is trained in the following way: Creating multiple window samples based on the optical fiber link sample, and obtaining an OTDR curve segment sample within each of the window samples; Generate a fiber event type label for each of the OTDR curve segment samples; the fiber event type label includes at least a normal event label and a fault event label; Model training is performed based on each of the OTDR curve segment samples and their optical fiber event type labels to obtain the optical fiber event prediction model.
3. The optical fiber fault location method according to claim 2, characterized in that: When generating the optical fiber event type label of each of the OTDR curve segment samples, the following steps are included for each window sample: Determine the attenuation value sample and the optical fiber distance sample of each optical fiber sampling point sample in the window sample; Performing first-order difference quotient calculation based on each of the attenuation value samples and each of the optical fiber distance samples to obtain a plurality of slope values; If none of the multiple slope values exceeds the second preset threshold, it is determined that there is no optical fiber fault in the window sample, and a normal event label of the OTDR curve segment sample in the window sample is generated; If any slope value exceeds the second preset threshold and there are no two consecutive slope values showing one positive and one negative change, it is determined that there is a fiber fault in the window sample, and a non-reflective event label of the OTDR curve segment sample in the window sample is generated; If there are two consecutive slope values showing one positive and one negative change and the change amplitude exceeds the second preset amplitude change value, it is determined that there is a fiber fault in the window sample, and a reflection event label of the OTDR curve segment sample in the window sample is generated.
4. The optical fiber fault locating method according to claim 2, characterized in that: The following loss function is used during model training: ; Where L represents the loss function; y represents the predicted value; Represents the true value.
5. The optical fiber fault locating method according to claim 1, characterized in that: The method of collecting the OTDR curve of the optical fiber link to be tested by using a dedicated OTDR device includes: Sending a pulsed optical signal to the optical fiber link to be tested through a dedicated OTDR device to obtain reflection signals of multiple continuous optical fiber sampling points in the optical fiber link to be tested; Calculating the optical fiber distance and attenuation value of each optical fiber sampling point according to each of the reflected signals; Each of the optical fiber distances is mapped to the abscissa, and each of the attenuation values is mapped to the ordinate, to construct an OTDR curve.
6. The optical fiber fault locating method according to any one of claims 1 to 5, characterized in that: The fiber event prediction model includes a batch normalization layer, a first convolutional layer, a tensor reshape layer, a first maximum pooling layer, a second convolutional layer, a second maximum pooling layer, a flattening layer, and a linear layer; The batch normalization layer is used to perform normalization processing on each of the OTDR curve segments to obtain first output data; The first convolutional layer is used to perform feature extraction on the first output data to obtain second output data; The reshape tensor layer is used to adjust the dimension of the second output data to obtain third output data; The first maximum pooling layer is used to reduce the dimension of the third output data to obtain fourth output data; The second convolutional layer is used to perform feature extraction on the fourth output data to obtain fifth output data; The second maximum pooling layer is used to reduce the dimension of the fifth output data to obtain sixth output data; The flattening layer is used to flatten the sixth output data into one-dimensional data to obtain seventh output data; The linear layer is used to perform classification calculation on the seventh output data to obtain the optical fiber event type to which each OTDR curve segment belongs.
7. An optical fiber fault locating device, characterized in that: include: OTDR curve acquisition module, used to acquire the OTDR curve of the optical fiber link to be tested through a dedicated OTDR device; A window division module is used to divide the optical fiber link to be tested into equal intervals, create multiple windows, and obtain an OTDR curve segment in each window; An optical fiber fault prediction module is used to determine a target OTDR curve segment where an optical fiber fault exists based on each of the OTDR curve segments and training the optical fiber event prediction model; The optical fiber fault monitoring model is obtained by model training based on OTDR curve segment samples and their optical fiber event type labels; The optical fiber fault locating module is used to determine the location information of the optical fiber fault in the optical fiber link to be tested according to the target window where the target OTDR curve segment is located.
8. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the optical fiber fault locating method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the optical fiber fault locating method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Optical cable abnormity positioning method and system based on OTDR, electronic equipment and storage medium
CN120750421A
OTDR-based optical cable anomaly localization method, system, electronic equipment, and storage medium
CN120750421B
Fault diagnosis and intelligent operation and maintenance method and system for optical distribution network
CN122394663A