Method, apparatus and device for generating same-route identification information, and storage medium
By acquiring the data image of the optical fiber core and using the hash algorithm to generate a binary sequence, the same route is identified based on the Hamming distance, which solves the problem of low efficiency in the collection of basic optical cable information and big data analysis in the existing technology and realizes efficient same route identification.
Patent Information
- Application Number
- CN202311353292.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2043-10-18
AI Technical Summary
Existing co-route identification methods require the pre-collection of sufficient and complete basic information of optical cables and the analysis of large data sets, resulting in low identification efficiency.
By obtaining the data images of the first fiber core and the second fiber core, converting them into a binary sequence using a hash algorithm, and generating co-route identification information based on the Hamming distance, the fiber core data images are directly collected without the need to collect basic optical cable information in advance.
It improves the efficiency of same-route identification, simplifies the analysis process, and avoids dependence on large data sets and complex calculations.
Smart Images

Figure CN118803471B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network operation and maintenance, and in particular to a method, apparatus, device and storage medium for generating same-route identification information. Background Art
[0002] Optical cables are communications cable assemblies that utilize one or more optical fibers enclosed in a sheath as the transmission medium and can be used individually or in groups. Routing is the network-wide process that determines the end-to-end path. Existing transmission networks must adhere to the principle of multi-route protection for critical services. Therefore, identifying and eliminating common routing issues within optical cables is one of the most important tasks in transmission network optimization and management.
[0003] Current co-routing identification methods mainly use basic data such as optical paths, optical cables, and pipelines to automatically analyze network routes to discover and locate co-routing problems in communication networks.
[0004] However, using this method to identify the same route requires the collection of sufficient and complete basic information of the optical cable in advance, and the identification analysis needs to be based on a huge data set, resulting in low identification efficiency. Summary of the Invention
[0005] The embodiments of the present application provide a method, apparatus, device, and storage medium for generating same-route identification information, which can improve the efficiency of same-route identification.
[0006] In one aspect of an embodiment of the present application, a method for generating same-route identification information is provided, the method comprising:
[0007] Acquire a first data image of a first fiber core and a second data image of a second fiber core, where the first fiber core and the second fiber core are the fiber cores to be identified for co-routing issues, the first data image being a fiber curve image representing a relationship between return light intensity and fiber length in the first fiber core, and the second data image being a fiber curve image representing a relationship between return light intensity and fiber length in the second fiber core;
[0008] Based on a hash algorithm, the first data image and the second data image are converted into a binary sequence, the binary sequence including a first sequence and a second sequence, the first sequence being associated with the first data image and including a plurality of first results, each of which is a result generated by grayscale binarization of each first pixel in the first data image, and the second sequence being associated with the second data image and including a plurality of second results, each of which is a result generated by grayscale binarization of each second pixel in the second data image;
[0009] Determine, based on the first sequence and the second sequence, a Hamming distance between the first sequence and the second sequence, where the Hamming distance is the number of differences between a first result in the first sequence and a corresponding second result in the second sequence;
[0010] When the Hamming distance is zero, information is generated that the first fiber core and the second fiber core have the same route throughout.
[0011] In one aspect of an embodiment of the present application, a device for generating same-route identification information is provided, the device comprising:
[0012] an acquisition module, configured to acquire a first data image of a first fiber core and a second data image of a second fiber core, wherein the first fiber core and the second fiber core are fiber cores to be identified as having a co-routing problem, the first data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the first fiber core, and the second data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the second fiber core;
[0013] a conversion module, configured to convert the first data image and the second data image into a binary sequence based on a hash algorithm, the binary sequence comprising a first sequence and a second sequence, the first sequence being associated with the first data image and comprising a plurality of first results, each of which is a result generated by grayscale binarization of each first pixel in the first data image; and a second sequence being associated with the second data image and comprising a plurality of second results, each of which is a result generated by grayscale binarization of each second pixel in the second data image.
[0014] a determination module, configured to determine a Hamming distance between the first sequence and the second sequence based on the first sequence and the second sequence, where the Hamming distance is the number of differences between a first result in the first sequence and a corresponding second result in the second sequence;
[0015] The generating module is used for generating information that the first fiber core and the second fiber core have the same route throughout when the Hamming distance is zero.
[0016] In one aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory and a program or instruction stored in the memory and executable on a processor, wherein when the program or instruction is executed by the processor, the method for generating same-route identification information as provided in any one of the above-mentioned embodiments of the present application is implemented.
[0017] In one aspect of an embodiment of the present application, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, a method for generating same-route identification information as provided in any aspect of the above-mentioned embodiment of the present application is implemented.
[0018] In one aspect of an embodiment of the present application, a computer program product is provided. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method for generating same-route identification information provided in any aspect of the above-mentioned embodiment of the present application.
[0019] The method for generating same-route identification information provided in the embodiments of the present application comprises the following steps: acquiring a first data image of a first fiber core and a second data image of a second fiber core; and converting the first data image and the second data image into a binary sequence based on a hash algorithm, wherein the binary sequence comprises a first sequence and a second sequence. In this way, the data image of the fiber core can be directly collected without pre-collection of the basic information of the optical cable, and the binary sequence generated based on the hash algorithm is used to represent the first data image and the second data image, thereby overcoming the problems of too large data set and complicated processing calculation. Finally, the Hamming distance between the first sequence and the second sequence is determined according to the first sequence and the second sequence, and the same-route identification information between the first fiber core and the second fiber core is generated according to the Hamming distance. In this way, the same-route identification information generated in the embodiments of the present application can be generated by simply analyzing the binary sequence, without identification analysis based on a large data set and pre-collection of perfect basic information of the optical cable, thereby improving the efficiency of same-route identification. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.
[0021] Figure 1 is a flowchart of an embodiment of the method for generating same-route identification information provided in the present application;
[0022] Figure 2 is a structural schematic diagram of an embodiment of the apparatus for generating same-route identification information provided in the present application;
[0023] Figure 3 is a structural schematic diagram of an embodiment of the device for generating same-route identification information provided in the present application. DETAILED DESCRIPTION
[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is only intended to provide a better understanding of the present application by showing examples of the present application.
[0025] It is to be noted that, in the present document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0026] The acquisition, storage, use, processing and the like of data in the technical solutions of the present application comply with relevant provisions of national laws and regulations.
[0027] In the related art, the current method for generating same-route identification information mainly uses basic data such as optical paths, optical cables, and pipelines to automatically analyze the network route, and to find and locate the same-route problem in the communication network. In this method, it is necessary to pre-collect sufficient and perfect optical cable basic information, and to perform identification analysis according to a large data set, which results in too low identification efficiency.
[0028] The present application provides a method, device, equipment and storage medium for generating same-route identification information. In the method for generating same-route identification information provided by the present application, a first data image of a first core and a second data image of a second core are acquired, and then the first data image and the second data image are converted into binary sequences based on a hash algorithm, wherein the binary sequences include a first sequence and a second sequence. In this way, the data image of the core can be directly collected without pre-collecting the optical cable basic information, and the binary sequence generated according to the hash algorithm is used to represent the first data image and the second data image, which overcomes the problems of too large data set and too complex processing and calculation. Finally, the Hamming distance between the first sequence and the second sequence is determined according to the first sequence and the second sequence, and the same-route identification information between the first core and the second core is generated according to the Hamming distance. In this way, the same-route identification information finally generated by the present application can be generated by simply analyzing the binary sequence, without identification analysis according to a large data set and without pre-collecting sufficient and perfect optical cable basic information, thereby improving the efficiency of same-route identification.
[0029] The specific embodiments of the method, device, equipment and storage medium for generating same-route identification information provided by the present application will be introduced below. First, the method for generating same-route identification information will be introduced.
[0030] Figure 1A flowchart of a method for generating same-route identification information is provided, the method for generating same-route identification information is applied to a server, and the method can include the following steps S101-S104.
[0031] S101, a first data image of a first fiber core and a second data image of a second fiber core are obtained.
[0032] The first fiber core and the second fiber core are fiber cores to be identified whether a same-route problem occurs. For example, in a case where it is necessary to identify whether a same-route problem occurs between an A fiber core and a B fiber core, the A fiber core can be taken as the first fiber core, and the B fiber core can be taken as the second fiber core.
[0033] The data image is a fiber curve image representing a relationship between return light intensity and fiber length, wherein the abscissa is the fiber length, and the ordinate is the return light intensity. Specifically, the first data image is a fiber curve image representing a relationship between return light intensity and fiber length in the first fiber core, and the second data image is a fiber curve image representing a relationship between return light intensity and fiber length in the second fiber core.
[0034] For example, the server can collect a dot matrix composed of attenuation data of the first fiber core and the second fiber core through an optical time-domain reflectometer (OTDR), and then present and save the dot matrix through the corresponding first data image and second data image. Specifically, the first data image and the second data image can be collected through a board card supporting the OTDR function, or collected through direct testing of the OTDR instrument.
[0035] S102, based on a hash algorithm, the first data image and the second data image are converted into a binary sequence, and the binary sequence includes a first sequence and a second sequence.
[0036] The hash algorithm is an algorithm for mapping a value of any length to a binary value of a shorter fixed length. The binary sequence is a sequence generated after the data image is binarized.
[0037] The first sequence is a binary sequence corresponding to the first data image, and the first sequence includes a plurality of first results. The first result is a result generated by performing gray-scale binarization on each first pixel point in the first data image. The first pixel point is a pixel point in the first data image that needs to be processed by gray-scale binarization.
[0038] The second sequence is a binary sequence corresponding to the second data image, and the second sequence includes a plurality of second results. The second result is a result generated by performing gray-scale binarization on each second pixel point in the second data image. The second pixel point is a pixel point in the second data image that needs to be processed by gray-scale binarization.
[0039] For example, after collecting the first data image and the second data image, the server performs grayscale binarization processing on multiple first pixels in the first data image based on a hash algorithm to generate multiple first results, and generates a first sequence based on the multiple first results. Simultaneously, the server performs grayscale binarization processing on multiple second pixels in the second data image based on a hash algorithm to generate multiple second results, and generates a second sequence based on the multiple second results.
[0040] S103: Determine a Hamming distance between the first sequence and the second sequence according to the first sequence and the second sequence.
[0041] The Hamming distance is the number of differences between the first result in the first sequence and the corresponding second result in the second sequence. For example, let d(x, y) represent the Hamming distance between two sequences x and y. Perform an XOR operation on the characters at corresponding positions in the two sequences and count the number of 1s (i.e., the number of characters at corresponding positions in the two sequences that differ). This number is the Hamming distance.
[0042] For example, after obtaining the first sequence and the second sequence, the server compares the first result and the second result at corresponding positions in the two sequences in sequence to determine the number of differences between the first result and the second result. This number is the Hamming distance.
[0043] As an example, a first sequence A = {1, 0, 0, 1, 1} and a second sequence B = {1, 0, 1, 1, 1}. The first result and the second result at corresponding positions in sequences A and B are compared sequentially, and the number of differences between the first result and the second result is determined to be 1, thereby determining that the Hamming distance is 1.
[0044] S104 : When the Hamming distance is zero, information is generated that the first fiber core and the second fiber core have the same route throughout.
[0045] After determining the Hamming distance, the server determines whether the optical path corresponding to the first fiber core and the optical path corresponding to the second fiber core share the same route throughout their entirety based on the Hamming distance. If the Hamming distance is zero, it is determined that the first fiber core and the second fiber core share the same route throughout their entirety, and information indicating that the first fiber core and the second fiber core share the same route throughout their entirety is generated. If the Hamming distance is not zero, it is determined that the first fiber core and the second fiber core do not share the same route throughout their entirety, and information indicating that the first fiber core and the second fiber core do not share the same route throughout their entirety is generated.
[0046] Through this embodiment, the first data image of the first fiber core and the second data image of the second fiber core are obtained, and then based on the hash algorithm, the first data image and the second data image are converted into a binary sequence, wherein the binary sequence includes a first sequence and a second sequence. In this way, the data image of the fiber core can be directly collected without the need to collect basic information of the optical cable in advance. At the same time, the binary sequence generated according to the hash algorithm is used to represent the first data image and the second data image, thereby overcoming the problems of too large a data set and more complex processing calculations. Finally, based on the first sequence and the second sequence, the Hamming distance between the first sequence and the second sequence is determined, and the same-route identification information between the first fiber core and the second fiber core is generated based on the Hamming distance. In this way, the same-route identification information finally generated by the embodiment of the present application can be generated only by simply analyzing the binary sequence, without the need to perform identification analysis based on a large data set, and without the need to collect sufficiently complete basic information of the optical cable in advance, thereby improving the efficiency of same-route identification.
[0047] In one embodiment, the first sequence includes a first receiving sequence and a first sending sequence, and the second sequence includes a second receiving sequence and a second sending sequence. The above method for generating the same-route identification information may further include:
[0048] When the Hamming distance is not zero, determining a first change time of the first fiber core according to the first receiving sequence and the first transmitting sequence, where the first change time is a test time corresponding to a most recent change in the first result of the first receiving sequence and the first transmitting sequence;
[0049] Determining a second change time of the second fiber core according to the second receiving sequence and the second sending sequence, where the second change time is a test time corresponding to a most recent change in the second results of the second receiving sequence and the second sending sequence;
[0050] In a case where the first change time and the second change time are the same, generating a first change value set for the first fiber core and a second change value set for the second fiber core based on the first result and the second result, the first change value set including at least one first change value, the first change value being used to characterize a degree of change in the intensity of returned light in a region where a first pixel point in the first data image corresponding to the first change time is located, and the second change value set including at least one second change value, the second change value being used to characterize a degree of change in the intensity of returned light in a region where a second pixel point in the second data image corresponding to the second change time is located;
[0051] Generate a change difference value set based on the first change value set and the second change value set, wherein the change difference value set includes at least one change difference value, and the change difference value is the difference between any first change value in the first change value set and any second change value in the second change value set;
[0052] In a case where at least one of the change difference values in the change difference value set is less than a preset threshold value, information that the first core and the second core exist local same routing is generated.
[0053] The first receiving sequence is a binary sequence corresponding to a data image acquired by the first core along the receiving direction, and the first sending sequence is a binary sequence corresponding to a data image acquired by the first core along the sending direction.
[0054] The second receiving sequence is a binary sequence corresponding to a data image acquired by the second core along the receiving direction, and the second sending sequence is a binary sequence corresponding to a data image acquired by the second core along the sending direction.
[0055] The first change time is a test time corresponding to a case where the last returned light intensity values of the first receiving sequence and the first sending sequence are different, the second change time is a test time corresponding to a case where the last returned light intensity values of the second receiving sequence and the second sending sequence are different, and the returned light intensity value is a corresponding longitudinal coordinate value in the data image.
[0056] For example, the server compares the first receiving sequence and the first sending sequence in a case where the Hamming distance is not zero, determines a test time corresponding to a case where the first result of the first receiving sequence and the first sending sequence changes for the last time. As an example, the first sequence A includes the first receiving sequence A1 and the first sending sequence A2. A1={1, 0, 0, 1, 1}, A2={1, 0, 1, 1, 1}, and it is determined that the time corresponding to the case where the first receiving sequence A1 and the first sending sequence A2 change for the last time is the third first result by comparison.
[0057] Meanwhile, the second receiving sequence and the second sending sequence are compared, and a test time corresponding to a case where the second result of the second receiving sequence and the second sending sequence changes for the last time is determined. As an example, the second sequence B includes the second receiving sequence B1 and the second sending sequence B2. B1={1, 0, 0, 1, 1}, B2={1, 0, 1, 1, 1}, and it is determined that the time corresponding to the case where the second receiving sequence B1 and the second sending sequence B2 change for the last time is the third second result by comparison.
[0058] In a case where the first change time and the second change time are the same, a plurality of first change values are generated according to a plurality of changed first results corresponding to the first change time, each first change value is collected into a first change value set, a plurality of second change values are generated according to a plurality of changed second results corresponding to the second change time, and each second change value is collected into a second change value set.
[0059] When the first change value set and the second change value set are determined, the difference between any first change value in the first change value set and any second change value in the second change value set is calculated to obtain multiple change differences, and the individual change differences are grouped into a change difference set.
[0060] Each change difference value in the change difference value set is compared with a preset threshold to determine whether the optical path corresponding to the first fiber core and the optical path corresponding to the second fiber core have a local co-routing. If at least one change difference value in the change difference value set is less than the preset threshold, it is determined that the first fiber core and the second fiber core have a local co-routing, and information that the first fiber core and the second fiber core have a local co-routing is generated.
[0061] As an example, a first change time corresponds to two changed first results, and two first change values, P1 and P2, are determined based on the two first results. P1 and P2 are grouped into a first change value set P. A second change time corresponds to two changed second results, and two second change values, Q1 and Q2, are determined based on the two second results. Q1 and Q2 are grouped into a second change value set Q. The difference between each first change value in the first change value set P and each second change value in the second change value set Q is then calculated to obtain four change difference values K1, K2, K3, and K4. The four change differences are compared with a preset threshold. If at least one change difference is less than the preset threshold, it is determined that the first fiber core and the second fiber core have a local co-routing, and information that the first fiber core and the second fiber core have a local co-routing is generated.
[0062] Through this embodiment, after determining that there is no full co-routing between the first fiber core and the second fiber core, by determining the first change value set and the second change value set when the first change time and the second change time are the same, it is possible to further determine whether there is a local co-routing between the first fiber core and the second fiber core.
[0063] In one embodiment, the first data image includes a first received data image and a first sent data image, the second data image includes a second received data image and a second sent data image, the first result includes a first received result and a first sent result, and the second result includes a second received result and a second sent result;
[0064] In a case where the first change time and the second change time are the same, generating a first change value set for the first fiber core and a second change value set for the second fiber core based on the first result and the second result, including:
[0065] Obtain each first area corresponding to the first change time and each second area corresponding to the second change time, where the first area is the area where the first pixel point corresponding to the first reception result or the first transmission result of the first change time is located, and the second area is the area where the second pixel point corresponding to the second reception result or the second transmission result of the second change time is located;
[0066] Obtaining a first reception value of a first reception data image corresponding to a first reception result and a first transmission value of a first transmission data image corresponding to a first transmission result in each first area, and a second reception value of a second reception data image corresponding to a second reception result and a second transmission value of a second transmission data image corresponding to a second transmission result in each second area, wherein the first reception value, the first transmission value, the second reception value, and the second transmission value are all numerical values of return light intensities in corresponding data images;
[0067] A first set of change values for the first core is generated based on the difference between the first reception value and the first transmission value in each first region, and a second set of change values for the second core is generated based on the difference between the second reception value and the second transmission value in each second region.
[0068] The first received data image is associated with the first received sequence, the first sent data image is associated with the first sent sequence, the first received result is the first result in the first received sequence, and the first sent result is the first result in the first sent sequence.
[0069] The second received data image is associated with the second receive sequence, the second sent data image is associated with the second send sequence, the second receive result is the second result in the second receive sequence, and the second send result is the second result in the second send sequence.
[0070] For example, if the first change time and the second change time are the same, the server obtains the first received result or the first sent result that has changed corresponding to the first change time, and determines the first region based on the first received result or the first sent result. As an example, if two first received results have changed corresponding to the first change time, namely V1 and V2, the first regions W1 and W2 are determined based on the horizontal coordinates of the first received data image corresponding to V1 and V2, respectively.
[0071] Furthermore, the server obtains the changed second reception result or second transmission result corresponding to the second change time, and determines the second region based on the second reception result or second transmission result. As an example, if two second reception results corresponding to the second change time have changed, namely V3 and V4, the second regions W3 and W4 are determined based on the horizontal coordinates of the first received data image corresponding to V3 and V4, respectively.
[0072] Obtain the corresponding vertical coordinate values of each pixel point in the first area W1 and W2 in the corresponding first received data image and the corresponding vertical coordinate values in the first sent data image, as well as the corresponding vertical coordinate values of each pixel point in the second area W3 and W4 in the corresponding second received data image and the corresponding vertical coordinate values in the second sent data image.
[0073] The difference between the vertical coordinate values corresponding to each pixel point in the first area W1 and W2 in the corresponding first received data image and the vertical coordinate values corresponding to the first transmitted data image is calculated to generate a first change value set of the first fiber core; the difference between the vertical coordinate values corresponding to each pixel point in the second area W3 and W4 in the corresponding second received data image and the vertical coordinate values corresponding to the second transmitted data image is calculated to generate a second change value set of the second fiber core.
[0074] Through this embodiment, by determining each first area corresponding to the first change time and each second area corresponding to the second change time, a first change value set of the first fiber core and a second change value set of the second fiber core are further generated, which helps to subsequently determine whether there is a local common route between the first fiber core and the second fiber core based on the first change value set and the second change value set.
[0075] In one embodiment, a first set of changed values for the first core is generated based on the difference between the first received value and the first transmitted value in each first region, and a second set of changed values for the second core is generated based on the difference between the second received value and the second transmitted value in each second region, satisfying the following formula 1:
[0076]
[0077] Where z is the first change value or the second change value, x is the starting position of the first area or the second area, y is the ending position of the first area or the second area, and z new is the first received value or the second received value, z old is the first sending value or the second sending value, and n is the number of first pixels in the first area or the number of second pixels in the second area.
[0078] Through this embodiment, the first change value set of the first fiber core and the second change value set of the second fiber core are determined according to Formula 1, which helps to subsequently determine whether there is a local co-routing between the first fiber core and the second fiber core based on the first change value set and the second change value set.
[0079] In one embodiment, the above S102 specifically includes:
[0080] setting the first data image and the second data image into a target format;
[0081] Acquire a first grayscale of a first pixel in a first data image in a target format, and a second grayscale of a second pixel in a second data image in a target format;
[0082] Comparing a first grayscale of a first pixel with a first average grayscale, and generating a first sequence based on the comparison result;
[0083] The second grayscale of the second pixel is compared with the second average grayscale, and a second sequence is generated based on the comparison result.
[0084] The first pixel is each pixel in the first data image, and the second pixel is each pixel in the second data image. The first grayscale is the grayscale of the first pixel, and the second grayscale is the grayscale of the second pixel. The first average grayscale is the average grayscale in the first data image, and the second average grayscale is the average grayscale in the second data image.
[0085] For example, the server first preprocesses the first data image and the second data image by determining the target size of the image, filtering out high-frequency information, reducing the image to a size of 32*32, and retaining 1024 pixels, thereby setting the first data image and the second data image to the target format.
[0086] Then, the first grayscale corresponding to each of the 1024 pixels in the first data image and the second grayscale corresponding to each of the 1024 pixels in the second data image are obtained. Each first grayscale is then compared with the average grayscale of the first data image. If the first grayscale is greater than the average grayscale of the first data image, the value is 1; otherwise, the value is 0. Each second grayscale is compared with the average grayscale of the second data image. If the second grayscale is greater than the average grayscale of the second data image, the value is 1; otherwise, the value is 0.
[0087] The results generated after comparing 1024 pixel points in the first data image are spliced together to generate a first sequence; the results generated after comparing 1024 pixel points in the second data image are spliced together to generate a second sequence.
[0088] Through this embodiment, the first sequence and the second sequence are generated according to the first data image and the second data image, which helps to directly identify whether they are the same route according to the first sequence and the second sequence, thereby reducing the amount of calculation and improving the recognition speed.
[0089] In one embodiment, after S101, the following steps may also be included:
[0090] Determining image names of the first data image and the second data image according to the names of the transmission optical paths of the first fiber core and the second fiber core, wherein the image names are associated with the names of the transmission optical paths;
[0091] The test time, the return light intensity value, the optical fiber length value, and the event point position corresponding to the first data image and the second data image are acquired respectively, and the event point includes a fusion loss point and a joint loss point;
[0092] The first data set is generated according to the first data image and the corresponding test time, return light intensity value, optical fiber length value, and event point position, and the second data set is generated according to the second data image and the corresponding test time, return light intensity value, optical fiber length value, and event point position;
[0093] The first data set and the second data set are stored according to the image name or the test time.
[0094] The transmission optical path name is the name of the transmission system optical path section borne by the fiber core, the optical fiber length value is the horizontal coordinate value corresponding to the data image, and the return light intensity value is the vertical coordinate value corresponding to the data image.
[0095] For example, the server acquires the first data image of the first fiber core and the second data image of the second fiber core, and names the first data image and the second data image according to the transmission optical path name. Meanwhile, the test time, the horizontal coordinate set of the data image, the vertical coordinate set of the data image, and the position of the event point are recorded. The respective data corresponding to the first data image and the second data image are summarized into the first data set and the second data set. For storage of the first data set and the second data set, multi-dimensional storage can be performed according to the named name and the test time.
[0096] According to the embodiment, multi-dimensional storage is performed on the first data set and the second data set according to the named name and the test time, which is helpful for subsequent quick retrieval of the respective data corresponding to the first data image and the second data image. Meanwhile, the event points corresponding to the first data image and the second data image are acquired, which is helpful for analysis of the optical cable quality corresponding to the first fiber core and the second fiber core.
[0097] As shown in Figure 2 The device for generating same-route identification information provided by the embodiment of the application includes an acquisition module 210, a conversion module 220, a determination module 230, and a generation module 240.
[0098] The acquisition module 210 is configured to acquire a first data image of a first fiber core and a second data image of a second fiber core, the first fiber core and the second fiber core being fiber cores to be identified whether a same-route problem occurs, the first data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the first fiber core, and the second data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the second fiber core.
[0099] The conversion module 220 is configured to convert the first data image and the second data image into a binary sequence based on a hash algorithm, the binary sequence comprising a first sequence and a second sequence, the first sequence being associated with the first data image, the first sequence comprising a plurality of first results, each of the first results being a result of gray-scale binarization of a first pixel point in the first data image, the second sequence being associated with the second data image, the second sequence comprising a plurality of second results, each of the second results being a result of gray-scale binarization of a second pixel point in the second data image.
[0100] The determination module 230 is configured to determine a Hamming distance between the first sequence and the second sequence according to the first sequence and the second sequence, the Hamming distance being a number of first results in the first sequence that are different from corresponding second results in the second sequence.
[0101] The generation module 240 is configured to generate information that the first core and the second core have a full same route in a case where the Hamming distance is zero.
[0102] In an embodiment, the apparatus for generating same route identification information further comprises:
[0103] The time determination module is configured to determine a first change time of the first core according to the first received sequence and the first sent sequence in a case where the Hamming distance is not zero, the first change time being a test time corresponding to a last change of the first results of the first received sequence and the first sent sequence;
[0104] The time determination module is further configured to determine a second change time of the second core according to the second received sequence and the second sent sequence, the second change time being a test time corresponding to a last change of the second results of the second received sequence and the second sent sequence;
[0105] The set generation module is configured to generate a first change value set of the first core and a second change value set of the second core based on the first results and the second results in a case where the first change time and the second change time are the same, the first change value set comprising at least one first change value, the first change value being used to represent a change degree of a return light intensity of a region in which the first pixel point is located in the first data image corresponding to the first change time, the second change value set comprising at least one second change value, the second change value being used to represent a change degree of a return light intensity of a region in which the second pixel point is located in the second data image corresponding to the second change time;
[0106] The set generation module is further configured to generate a change difference value set based on the first change value set and the second change value set, the change difference value set comprising at least one change difference value, the change difference value being a difference between any one of the first change values in the first change value set and any one of the second change values in the second change value set;
[0107] The information generating module is configured to generate information that a local co-routing exists between the first fiber core and the second fiber core when at least one change difference in the change difference set is smaller than a preset threshold.
[0108] In one embodiment, the set generation module further includes:
[0109] an area acquisition unit, configured to acquire each first area corresponding to the first change time and each second area corresponding to the second change time, wherein the first area is an area where a first pixel point corresponding to the first reception result or the first transmission result of the first change time is located, and the second area is an area where a second pixel point corresponding to the second reception result or the second transmission result of the second change time is located;
[0110] a value acquisition unit, configured to acquire a first reception value of a first reception data image corresponding to a first reception result and a first transmission value of a first transmission data image corresponding to a first transmission result in each first area, and a second reception value of a second reception data image corresponding to a second reception result and a second transmission value of a second transmission data image corresponding to a second transmission result in each second area, wherein the first reception value, the first transmission value, the second reception value, and the second transmission value are all numerical values of the return light intensity in the corresponding data images;
[0111] The set generation unit is used to generate a first change value set of the first fiber core according to the difference between the first reception value and the first transmission value in each first area, and to generate a second change value set of the second fiber core according to the difference between the second reception value and the second transmission value in each second area.
[0112] In one embodiment, the conversion module 220 further includes:
[0113] a setting unit, configured to set the first data image and the second data image to a target format;
[0114] an acquiring unit, configured to acquire a first grayscale of a first pixel in a first data image in a target format, and a second grayscale of a second pixel in a second data image in a target format;
[0115] a comparing unit, configured to compare a first grayscale of a first pixel with a first average grayscale, and generate a first sequence based on a comparison result;
[0116] The comparing unit is further configured to compare the second grayscale of the second pixel with the second average grayscale, and generate a second sequence based on the comparison result.
[0117] In one embodiment, the apparatus for generating same-route identification information further includes:
[0118] a name determination module, configured to determine image names of the first data image and the second data image according to the names of the transmission optical paths of the first fiber core and the second fiber core, wherein the image names are associated with the names of the transmission optical paths;
[0119] An information acquisition module is used to respectively acquire the test time, return light intensity value, optical fiber length value, and event point position corresponding to the first data image and the second data image, where the event point includes a fusion loss point and a connector loss point;
[0120] The set generation module is further configured to generate a first data set based on the first data image and the corresponding test time, return light intensity value, fiber length value, and event point location, and to generate a second data set based on the second data image and the corresponding test time, return light intensity value, fiber length value, and event point location;
[0121] The storage module is used to store the first data set and the second data set according to image name or test time.
[0122] Figure 3 A schematic diagram of the hardware structure of a device for generating same-route identification information provided in an embodiment of the present application is shown.
[0123] The device for generating same-route identification information may include a processor 301 and a memory 302 storing computer program instructions.
[0124] Specifically, the processor 301 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0125] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 302 may include removable or non-removable (or fixed) media. Where appropriate, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0126] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0127] The processor 301 reads and executes computer program instructions stored in the memory 302 to implement any one of the methods for generating same-route identification information in the above embodiments.
[0128] In one example, the device for generating the same route identification information may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301 , the memory 302 , and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0129] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0130] Bus 310 comprises hardware, software or both, and the parts that will generate same route identification information equipment are coupled to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more above these combination.In suitable case, bus 310 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0131] In addition, in conjunction with the method for generating same-route identification information in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the methods for generating same-route identification information in the above embodiments is implemented.
[0132] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0133] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0134] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0135] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0136] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A method for generating same-route identification information, characterized in that: The method comprises: Acquire a first data image of a first fiber core and a second data image of a second fiber core, where the first fiber core and the second fiber core are the fiber cores to be identified for co-routing issues, the first data image being a fiber curve image representing a relationship between return light intensity and fiber length in the first fiber core, and the second data image being a fiber curve image representing a relationship between return light intensity and fiber length in the second fiber core; Based on a hash algorithm, converting the first data image and the second data image into a binary sequence, the binary sequence including a first sequence and a second sequence, the first sequence being associated with the first data image and including a plurality of first results, each of which is a result generated by grayscale binarization of each first pixel in the first data image; and the second sequence being associated with the second data image and including a plurality of second results, each of which is a result generated by grayscale binarization of each second pixel in the second data image; determining, based on the first sequence and the second sequence, a Hamming distance between the first sequence and the second sequence, where the Hamming distance is the number of differences between a first result in the first sequence and a corresponding second result in the second sequence; When the Hamming distance is zero, information is generated that the first fiber core and the second fiber core have the same route throughout.
2. The method according to claim 1, characterized in that The first sequence includes a first receiving sequence and a first sending sequence, and the second sequence includes a second receiving sequence and a second sending sequence; The method further comprises: When the Hamming distance is not zero, determining a first change time of the first fiber core according to the first receiving sequence and the first transmitting sequence, the first change time being a test time corresponding to a most recent change in a first result of the first receiving sequence and the first transmitting sequence; determining, according to the second receiving sequence and the second transmitting sequence, a second change time of the second fiber core, where the second change time is a test time corresponding to a most recent change in a second result of the second receiving sequence and the second transmitting sequence; In a case where the first change time and the second change time are the same, generating a first change value set for the first fiber core and a second change value set for the second fiber core based on the first result and the second result, the first change value set including at least one first change value, the first change value being used to characterize a degree of change in the intensity of returned light in a region where a first pixel point in a first data image corresponding to the first change time is located, and the second change value set including at least one second change value, the second change value being used to characterize a degree of change in the intensity of returned light in a region where a second pixel point in a second data image corresponding to the second change time is located; generating a change difference value set based on the first change value set and the second change value set, wherein the change difference value set includes at least one change difference value, and the change difference value is a difference between any one of the first change values in the first change value set and any one of the second change values in the second change value set; When at least one change difference value in the change difference value set is smaller than a preset threshold, information is generated indicating that the first fiber core and the second fiber core have a local co-route.
3. The method according to claim 2, characterized in that The first data image includes a first received data image and a first sent data image, the second data image includes a second received data image and a second sent data image, the first result includes a first received result and a first sent result, and the second result includes a second received result and a second sent result; The step of generating, based on the first result and the second result, a first set of change values for the first fiber core and a second set of change values for the second fiber core when the first change time and the second change time are the same, comprising: Obtain each first area corresponding to the first change time and each second area corresponding to the second change time, where the first area is an area where a first pixel point corresponding to the first reception result or the first transmission result of the first change time is located, and the second area is an area where a second pixel point corresponding to the second reception result or the second transmission result of the second change time is located; acquiring a first reception value of the first reception data image corresponding to a first reception result in each of the first areas and a first transmission value of the first transmission data image corresponding to a first transmission result, as well as a second reception value of the second reception data image corresponding to a second reception result in each of the second areas and a second transmission value of the second transmission data image corresponding to the second transmission result, wherein the first reception value, the first transmission value, the second reception value, and the second transmission value are all numerical values of return light intensities in the corresponding data images; A first set of change values of the first fiber core is generated according to the difference between the first reception value and the first transmission value in each first area, and a second set of change values of the second fiber core is generated according to the difference between the second reception value and the second transmission value in each second area.
4. The method according to claim 3, characterized in that Generating a first set of changed values for the first core according to the difference between the first received value and the first transmitted value in each first region, and generating a second set of changed values for the second core according to the difference between the second received value and the second transmitted value in each second region, satisfy the following relationship: Where z is the first change value or the second change value, x is the starting position of the first area or the second area, y is the ending position of the first area or the second area, and z new is the first received value or the second received value, z old is the first sending value or the second sending value, and n is the number of first pixels in the first area or the number of second pixels in the second area.
5. The method according to claim 1, wherein The step of converting the first data image and the second data image into a binary sequence based on a hash algorithm includes: setting the first data image and the second data image into a target format; Acquire a first grayscale of a first pixel in a first data image in the target format, and a second grayscale of a second pixel in a second data image in the target format; comparing a first grayscale of the first pixel with a first average grayscale, and generating a first sequence based on the comparison result; The second grayscale of the second pixel is compared with the second average grayscale, and a second sequence is generated based on the comparison result.
6. The method according to any one of claims 1 to 5, characterized in that After acquiring the first data image of the first fiber core and the second data image of the second fiber core, the method further includes: determining image names of the first data image and the second data image according to the transmission optical path names of the first fiber core and the second fiber core, wherein the image names are associated with the transmission optical path names; Respectively acquiring the test time, return light intensity value, optical fiber length value, and event point position corresponding to the first data image and the second data image, wherein the event point includes a fusion loss point and a connector loss point; Generate a first data set based on the first data image and the corresponding test time, return light intensity value, fiber length value, and event point location, and generate a second data set based on the second data image and the corresponding test time, return light intensity value, fiber length value, and event point location; The first data set and the second data set are stored according to the image name or the test time.
7. A device for generating same-route identification information, characterized in that: The device comprises: an acquisition module, configured to acquire a first data image of a first fiber core and a second data image of a second fiber core, wherein the first fiber core and the second fiber core are fiber cores to be identified as to whether a co-routing problem occurs, the first data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the first fiber core, and the second data image being an optical fiber curve image representing a relationship between return light intensity and optical fiber length in the second fiber core; a conversion module, configured to convert the first data image and the second data image into a binary sequence based on a hash algorithm, the binary sequence comprising a first sequence and a second sequence, the first sequence being associated with the first data image and comprising a plurality of first results, each of which is a result generated by grayscale binarization of each first pixel in the first data image; and the second sequence being associated with the second data image and comprising a plurality of second results, each of which is a result generated by grayscale binarization of each second pixel in the second data image. a determining module, configured to determine a Hamming distance between the first sequence and the second sequence based on the first sequence and the second sequence, where the Hamming distance is the number of differences between a first result in the first sequence and a corresponding second result in the second sequence; A generating module is configured to generate information indicating that the first fiber core and the second fiber core have the same route throughout the entire process when the Hamming distance is zero.
8. An electronic device, characterized in that: The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the method for generating same-route identification information according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for generating same-route identification information according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for detecting fault of fiber grating network
CN108259083A
Systems and methods for tracking moving targets and monitoring object positions
US20050053267A1