Spectrum data processing method and system of distributed optical fiber sensing system
By employing a method of synchronously and sequentially parsing and storing spectral data into continuous memory in a distributed optical fiber sensing system, the problem of excessive computation time in long-distance, high spatial resolution measurements is solved, achieving more efficient data processing and system real-time performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHI FIAN YUN SENSE (HANGZHOU) INTELLIGENT TECHNOLOGY CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-12
AI Technical Summary
Existing distributed fiber optic sensing systems suffer from excessive time consumption for spectrum data preprocessing and fitting calculations during long-distance, high-spatial-resolution measurements, resulting in poor system real-time performance and low efficiency in engineering applications.
The method of synchronously and sequentially parsing the input data stream and storing the spectrum data in a pre-allocated contiguous memory space avoids the creation of temporary string objects and redundant copying. It also improves the CPU cache prefetching efficiency by using a streaming parsing method and matches the sequential traversal pattern of subsequent data fitting.
It significantly reduces the time required for parsing and fitting spectral data, improves the real-time performance and engineering application efficiency of the system, and enhances CPU cache utilization and the continuity of data processing.
Smart Images

Figure CN122195653A_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein generally relate to the field of optoelectronic technology, and specifically to a method and system for spectral data processing of a distributed optical fiber sensing system. Background Technology
[0002] In distributed fiber optic sensing systems, to achieve long-distance, high spatial resolution temperature or strain measurements, the system typically needs to perform high-density sampling of various scattering phenomena along the fiber direction, with the amount of data generated in a single measurement reaching more than 200,000 points.
[0003] As measurement distance and spatial resolution increase, the overall computation time for spectrum data preprocessing and spectrum fitting stages increases significantly, thus limiting the system's real-time performance and engineering application efficiency. Summary of the Invention
[0004] Embodiments of this disclosure provide a method, system, computer program, and electronic device for processing spectrum data in a distributed optical fiber sensing system, aimed at solving one or more of the above-mentioned problems and other potential problems.
[0005] According to a first aspect of this disclosure, a method for processing spectrum data of a distributed optical fiber sensing system is provided. The method includes receiving an input data stream comprising spectrum data of the distributed optical fiber sensing system, and during the receiving of the input data stream, synchronously and sequentially parsing the input data stream to obtain the spectrum data and sequentially storing the spectrum data into a pre-allocated contiguous memory space.
[0006] According to a second aspect of this disclosure, a spectrum data processing system for a distributed optical fiber sensing system is provided. The system includes a data receiving module configured to receive an input data stream comprising spectrum data from the distributed optical fiber sensing system. The data receiving module includes a data parsing and storage subunit configured to synchronously and sequentially parse the input data stream to obtain spectrum data and sequentially store the spectrum data into a pre-allocated contiguous memory space during the reception of the input data stream.
[0007] According to a third aspect of this disclosure, a computer program product is provided, comprising a computer program. When executed by a processor, the computer program implements the method of the first aspect described above.
[0008] According to a fourth aspect of this disclosure, an electronic device is provided, including one or more processors and a memory associated with the one or more processors. The memory is used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in the first aspect. Attached Figure Description
[0009] The above and other objects, features, and advantages of embodiments of the present disclosure will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated in the drawings by way of example and not limitation.
[0010] Figure 1 This illustrates the process of parsing spectrum data in the prior art.
[0011] Figure 2 An exemplary application environment is shown for a spectrum data processing method for a distributed optical fiber sensing system according to an embodiment of the present disclosure.
[0012] Figure 3 An exemplary flowchart illustrates a spectral data processing method for a distributed optical fiber sensing system according to an embodiment of the present disclosure.
[0013] Figure 4 An exemplary parsing schematic diagram of an input data stream according to an embodiment of the present disclosure is shown.
[0014] Figure 5 An exemplary schematic diagram illustrating multi-threaded writing and computation of data according to embodiments of the present disclosure is shown.
[0015] Figure 6 An exemplary system diagram of a spectrum data processing system for a distributed optical fiber sensing system according to an embodiment of the present disclosure is shown.
[0016] Figure 7 A block diagram illustrating an electronic device according to an embodiment of the present disclosure.
[0017] In the various figures, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0018] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0019] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0020] As mentioned earlier, the spectral data of distributed Brillouin fiber optic sensing systems are typically stored in text formats such as CSV and subsequently processed on a host computer or industrial control computer. With the increase in measurement distance and spatial resolution, traditional data parsing methods based on line-by-line reading and discrete memory allocation have gradually revealed problems such as low parsing efficiency and insufficient cache utilization. This significantly increases the overall computation time in the data preprocessing and data fitting stages, thereby limiting the real-time performance and engineering application efficiency of the system. Figure 1 The process of parsing spectral data detected by a distributed fiber optic sensing system in the prior art is illustrated. For example... Figure 1 As shown, in existing technologies, the parsing of CSV text 102 containing spectrum data employs a line-by-line reading and string splitting method, using a two-dimensional pointer array or linked list structure to store the parsing results. For example, each time fscanf is called to read a line, new memory 111 (malloc) is typically dynamically allocated for the string. Frequent allocation / release of a large number of small memory blocks incurs significant overhead, and string splitting involves multiple data copying operations. Furthermore, line-by-line processing disrupts the spatial locality of data. After reading a small segment of data (a line), the program may switch to other calculations, invalidating the subsequent file content prefetched in the CPU cache. The next time the data is read, it needs to be reloaded from main memory or disk, resulting in a low cache hit rate. Allocating memory separately for each line makes the storage location of each line of data in memory random and scattered. This makes sequential traversal of the spectrum data time-consuming during the fitting calculation, and when the sampling point scale exceeds 200,000 points, it is difficult to complete fast demodulation.
[0021] In view of this, embodiments of this specification provide a method for processing spectrum data of a distributed optical fiber sensing system. This method includes receiving an input data stream containing spectrum data from the distributed optical fiber sensing system. During the reception of the input data stream, the input data stream is synchronously and sequentially parsed to obtain the spectrum data, and the spectrum data is sequentially stored in a pre-allocated contiguous memory space. The CSV file is parsed synchronously during writing, enabling direct extraction and parsing of the spectrum data from the character buffer, avoiding the creation of temporary string objects. The parsing results are directly and sequentially stored in the pre-allocated contiguous memory space, reducing redundant copying. The streaming parsing method utilizes large-block loading of the character buffer, enabling efficient operation of the CPU cache prefetch mechanism. The sequential storage of the parsing results in contiguous memory space matches the sequential traversal memory access pattern during subsequent data fitting, reducing sequential traversal time.
[0022] The embodiments of this disclosure will now be described in further detail with reference to the accompanying drawings. Figure 2 An exemplary application environment of a data processing method for a distributed fiber optic sensing system according to embodiments of this disclosure is shown. For example... Figure 2As shown, environment 200 can be a computing device, which may include, but is not limited to, personal computers, server computers, handheld or laptop devices, mobile devices (such as mobile phones, personal digital assistants (PDAs), media players, etc.), multiprocessor systems, minicomputers, mainframe computers, edge computing devices, and distributed computer systems including any of the above systems or devices. In environment 200, file 202 is a file storing spectral data of the distributed fiber optic sensing system, for example, a file stored in a text format such as CSV. In one or more embodiments of this disclosure, the distributed fiber optic sensing system can be a BOTDR / BODTA system based on the Brillouin scattering effect, which measures the offset of the scattered light spectrum relative to the incident light (i.e., the Brillouin shift), which is linearly related to temperature / strain. The BOTDR / BODTA system can record the power-frequency response curve of each spatial point along the fiber length direction by scanning the frequency difference between the pump light and the probe light, and output spectral data. In one or more embodiments of this disclosure, the distributed optical fiber sensing system can also be a DAS or φ-OTDR system based on the Rayleigh scattering effect. Since vibration causes local refractive index changes in the optical fiber, resulting in phase fluctuations in the backscattered light, the DAS or φ-OTDR system can locate vibration events and analyze waveform characteristics by detecting the amount of phase change and obtaining a time-domain phase sequence. In this process, the DAS or φ-OTDR system can also perform a fast Fourier transform on the phase change sequence of a fixed location over a continuous time period, converting the time-domain information into a frequency-domain spectrum. In one or more embodiments of this disclosure, document 202 can be a large-scale CSV data (the amount of data generated in a single measurement can reach more than 200,000 points) obtained by the system high-density sampling of various scattering phenomena along the optical fiber direction in a distributed Brillouin optical fiber sensing system to achieve long-distance, high spatial resolution temperature or strain measurement. For example, the spectral data of the distributed optical fiber sensor system can be one or more of Brillouin scattering data, Rayleigh scattering data, Raman scattering data, etc. For example, the spectral data can be obtained by a BOTDR / BODTA system recording the power-frequency response curves at each spatial point along the fiber's length. Alternatively, it can be obtained by a DAS or φ-OTDR system performing a fast Fourier transform on the phase change sequence at a fixed location over a continuous time period. In one or more embodiments of this disclosure, the spectral data of the distributed fiber optic sensing system can be Brillouin spectral data, which includes the amplitude information of physical parameters such as temperature or strain as a function of the spectrum. In one or more embodiments of this disclosure, the Brillouin spectral data can be Brillouin scattered light signals measured at different locations along the fiber. It can include spectral data from multiple sampling frequency points at multiple sampling spatial points along the fiber direction.Sampling spatial points refer to different locations along the length of the optical fiber. To achieve distributed measurement and high spatial resolution, the optical fiber sensor system performs measurements along the fiber at dense intervals (e.g., per centimeter, per meter), and each such location is a spatial sampling point. To obtain the complete Brillouin scattering spectrum, the system performs dense frequency scanning or sampling within the frequency range where the Brillouin shift may occur. Therefore, for each spatial sampling point, the system measures and records the corresponding scattered light intensity (i.e., spectral intensity data) at a series of different frequency points (i.e., frequency sampling points) to accurately depict the Brillouin gain spectrum, thereby accurately locating its peak (Brillouin shift) and calculating the linewidth. In one or more embodiments of this disclosure, the structure of the Brillouin spectrum data parsed from the CSV file can be viewed as a two-dimensional matrix. The rows of the two-dimensional matrix can represent different spatial sampling points, the columns of the two-dimensional matrix can represent different frequency sampling points, and the matrix element values of the two-dimensional matrix correspond to the scattered light intensity at a certain spatial sampling point and a certain frequency sampling point. In one or more embodiments of this disclosure, file 202 can be written into a contiguous memory space 211 in memory 201 via an input data stream. In one or more embodiments of this disclosure, the contiguous memory space can be a physically contiguous and uninterrupted memory region in the memory of a computing device. The physical memory addresses of all bytes in this memory region are consecutive and sequentially increasing. For example, if the address of the first byte is 0x1000, then the address of the second byte is 0x1001, the address of the third byte is 0x1002, and so on. Therefore, data elements stored in this space are stored one next to another in memory.
[0023] The following is combined Figure 3 This disclosure describes a data processing method 300 for a distributed Brillouin fiber optic sensing system according to embodiments of the present disclosure. It should be understood that the numbers in the flowchart of method 300 do not indicate the order in which these steps are performed; some or all of these steps may be performed in parallel, or their order may be interchanged, and this disclosure does not limit this. Furthermore, Figure 3 The methods described may also include additional steps not shown and / or the steps shown may be omitted, and the scope of this disclosure is not limited in this respect.
[0024] like Figure 3As shown in block 302, method 300 may include: receiving an input data stream including Brillouin spectrum data; during the reception of the input data stream, synchronously and sequentially parsing the input data stream to obtain the Brillouin spectrum data and sequentially storing the Brillouin spectrum data into a pre-allocated contiguous memory space. In one or more embodiments of this disclosure, the Brillouin spectrum data in a CSV file is transmitted to the processing system of a computing device in a continuous and sequential manner. For example, when reading a file including Brillouin spectrum data (e.g., a CSV file), the disk data can be first read into a temporary area (i.e., a buffer) in memory; for example, a 1024-byte buffer can be defined using char buffer
[1024] . Data can then be retrieved from this memory area, thus reducing the number of disk I / O operations and improving read efficiency.
[0025] In one or more embodiments of this disclosure, a contiguous memory region (i.e., contiguous memory space) can be pre-allocated based on the size of the Brillouin spectrum data in the CSV file. In one or more embodiments of this disclosure, the Brillouin spectrum data includes multiple spatial sampling point data of the optical fiber, and each spatial sampling point data includes spectral intensity data of multiple frequency sampling points. In one or more embodiments of this disclosure, the CSV file can store discrete Brillouin spectrum sampling data in tabular form, with each row representing a spatial sampling point of the optical fiber and columns representing the scattered light intensity of different frequency sampling points. In one or more embodiments of this disclosure, the number of spatial sampling points of the Brillouin spectrum data can be determined by obtaining the number of rows of the Brillouin spectrum data in the CSV file; the number of frequency sampling points for each spatial sampling point in the Brillouin spectrum data can be determined by obtaining the number of columns of the Brillouin spectrum data in the CSV file. For example, memory allocation can be performed using the following code: double *data_buffer=(double*)malloc(rows*cols*sizeof(double)) Here, `rows` represents the number of spatial sampling points, and `cols` represents the number of frequency sampling points. This function can allocate a contiguous block of memory in physical memory, adapting to the row-filling mechanism of the CPU cache, making the parsing of Brillouin spectrum data stored in CSV files to RAM faster and improving memory bandwidth utilization.
[0026] In one or more embodiments of this disclosure, the buffer can be used to store a line of CSV data, thereby achieving line-by-line buffering when reading a file that includes Brillouin spectrum data. That is, each time a file is read, a line of data (from the current character to the newline character at the end of the line) is read into the buffer. For example, file.readline() or csv.reader can be used for line-by-line reading. Figure 4An exemplary parsing schematic diagram of an input data stream according to an embodiment of this disclosure is shown. Figure 4 As shown, in one or more embodiments of this disclosure, the parsing process of the input data stream 403 created based on the file 402 including Brillouin spectrum data can specifically be as follows: First, the input data stream is scanned line by line to extract the character sequence 431 to be parsed corresponding to a spatial sampling point data. The character sequence 431 to be parsed has a corresponding sequence number to indicate the order in which the character sequences to be parsed are extracted from the input data stream. For example, the sequence number can be a natural number; the smaller the value, the earlier the corresponding character sequence is extracted and written. Each parsed character sequence is directly parsed to obtain the spatial sampling point data 432 corresponding to the character sequence to be parsed. Each parsed spatial sampling point data 432 is directly stored. In one or more embodiments of this disclosure, when storing the spatial sampling point data 432, it can be stored sequentially in the corresponding array row of the two-dimensional array 411 based on the sequence number of the character sequence to be parsed. In this way, the file can be read and parsed simultaneously. Each line of data is parsed and immediately written to the target memory address (i.e., the corresponding array row in the two-dimensional array), thus avoiding the need for intermediate temporary buffer arrays and multiple string copies.
[0027] In one or more embodiments of this disclosure, parsing a character sequence to obtain spatial sampling point data corresponding to the character sequence may include converting the data format to double, calculating and storing the sequence number corresponding to the character sequence, calculating the mapping offset of the data in one-dimensional contiguous memory based on the sequence number, and handling one or more of the following operations: missing values, format alignment, etc. In one or more embodiments of this disclosure, after storing the spatial sampling point data, the parameters related to calculating the sequence number and mapping offset may also be updated synchronously.
[0028] In one or more embodiments of this disclosure, a row pointer array 412 pointing to the two-dimensional array 411 can be created based on the two-dimensional array 411. The array elements of the row pointer array 412 correspond one-to-one with the array rows of the two-dimensional array 411; that is, the nth array element in the row pointer array 412 points to the nth array row of the two-dimensional array 411. For example, the row pointer array 412 can be constructed using the following code: double **data=(double**)malloc(rows*sizeof(double*)); for (int=0;i <rows;i++) { data[i] = data_buffer + i * cols; } Each array element `data[i]` in the row pointer array directly references an existing memory location in `data_buffer` (implemented by calculating `i*cols`) without creating a new data copy, thus avoiding memory reallocation and redundant data copying. In one or more embodiments of this disclosure, when storing the spatial sampling point data 432, the storage location of the parsed spatial sampling point data can be determined based on the sequence number of the character sequence to be parsed. For example, the character to be parsed with sequence number `j` should be stored in the array row pointed to by the array element `data[j]` with the corresponding sequence number in the row pointer array 412. Therefore, the spatial sampling point data 432 obtained from parsing the character to be parsed can be stored in the array row pointed to by the array element `data[j]`. In this way, it can be ensured that the data in the input data stream is stored in the two-dimensional array in the order of writing. For example, the data with sequence number 0 is stored in the 0th row of the two-dimensional array, the data with sequence number 1 is stored in the 1st row of the two-dimensional array, the data with sequence number 2 is stored in the 2nd row of the two-dimensional array, and so on. The parsed Brillouin spectrum data can be stored in contiguous memory. The row number (row_index) of the Brillouin spectrum data can be accessed using `double *spectrum = data[row_index]`. This treats a single row of a two-dimensional array as a one-dimensional data unit, ensuring sequential traversal and improving the computational efficiency of data preprocessing and data fitting.
[0029] In this way, the starting address of each row of the data_buffer is stored using a pointer, allowing for fast access to each row directly via the pointer data[row_index]. This enables the row index of the data_buffer to dynamically map different spectral regions. Fitting Brillouin spectrum data in a distributed optical fiber system requires selecting Brillouin spectrum data column-wise to form a row of spectrum at a specific spatial sampling point (i.e., the measurement point along the fiber's length). After fitting and demodulation, the temperature or strain at the corresponding measurement point is obtained. Therefore, the optical signal at each spatial sampling point on the fiber undergoes frequency domain transformation to obtain a spectrum. However, the spectrum at different locations may differ because local temperature, strain, fiber loss, or noise can cause morphological changes in the frequency spectrum, such as center shift, width, or height changes, resulting in different spectral regions. Therefore, within the entire frequency range, some regions contain valid information, while others contain noise or useless data. By dynamically mapping the row index of the data_buffer to different spectral regions, subsequent fitting calculations based on Brillouin spectral data can access data only for a certain frequency range. This improves efficiency and reduces the interference of noise and other useless data on the fitting results.
[0030] In this way, one or more embodiments of this disclosure synchronously parse during the writing process. That is, the data is parsed into a structure that can be directly used by subsequent algorithms and stored in memory during the writing stage, thus decoupling the Brillouin spectrum data writing process from the calculation process such as fitting based on the Brillouin spectrum data. This allows the fitting calculation based on the Brillouin spectrum data to be unaware of the underlying data organization, improving the system's scalability and maintainability while ensuring cache friendliness and high performance. Based on this, in one or more embodiments of this disclosure, method 300 may further include determining whether the Brillouin spectrum data stored in the contiguous memory space meets the preset calculation conditions, and performing calculations based on the data if the Brillouin spectrum data stored in the contiguous memory space meets the preset calculation conditions. As mentioned above, calculations such as Brillouin spectrum data fitting require a large amount of sequential data traversal, meaning that the algorithm must access the data in the order it was written. Brillouin spectrum data is stored in memory in contiguous memory. Based on the starting address of the pre-allocated contiguous memory space, the algorithm can access the data in the optimal processing order, unaffected by the input writing order. In one or more embodiments of this disclosure, the preset calculation condition may be the number of rows of Brillouin frequency data stored in contiguous memory space. In one or more embodiments of this disclosure, the preset calculation condition may also include the selection of data for the algorithm, for example, reading only complete rows that have been written, reading only array rows corresponding to a certain frequency range, skipping missing markers, etc. In one or more embodiments of this disclosure, it may also include control over the algorithm's calculation mode, for example, calculating the increment corresponding to the currently added data, recalculating all currently written data, partially updating the results, etc. In this way, a combination of progressive calculation, configurable control, and read-write decoupling can be achieved in the data processing of the distributed Brillouin fiber optic sensing system. This allows for flexible definition of calculation triggering conditions, data ranges, and calculation strategies according to different needs, and enables simultaneous writing and calculation of data, meaning the system can achieve controllable and scalable real-time calculation.
[0031] Based on the storage of Brillouin spectrum data in contiguous memory space, in one or more embodiments of this disclosure, a single write thread can write and parse the data, while multiple parallel computing threads process the data simultaneously. For example... Figure 5As shown, in one or more embodiments of this disclosure, Brillouin frequency data based on a CSV file can be written using a write thread 541. During this process, the Brillouin spectrum data in the CSV file is sequentially parsed and synchronously stored in a contiguous memory space 511. In one or more embodiments of this disclosure, the contiguous memory space 511 used to store the Brillouin spectrum data can also be divided into multiple contiguous sub-memory spaces, each configured with a corresponding parallel computing thread 542. While the write thread parses and stores the Brillouin spectrum data, the three parallel computing threads can process the Brillouin spectrum data in the contiguous memory space in parallel without interfering with each other. Here, a contiguous sub-memory space means that the physical address range of the sub-memory space is contiguous. For example, the physical address range of the first sub-memory space is 0x1000-0x1FFF, corresponding to rows 0-4095 of the CSV file; the physical address range of the second sub-memory space is 0x2000-0x2FFF, corresponding to rows 4096-8191 of the CSV file; and the physical address range of the third sub-memory space is 0x3000-0x3FFF, corresponding to rows 8192-12287 of the CSV file. In one or more embodiments of this disclosure, it can be determined whether the Brillouin spectrum data in the sub-memory space corresponding to the parallel computing thread meets the calculation conditions according to preset calculation conditions. When it is determined that the Brillouin spectrum data in the sub-memory space meets the calculation conditions, the parallel computing thread corresponding to that sub-memory space is started to perform relevant calculations based on the Brillouin spectrum data in the sub-memory space. For example, the calculation condition may be that the number of rows of Brillouin spectrum data in the space is greater than or equal to a preset value. When it is determined that the number of rows of Brillouin spectrum data in the sub-memory space is greater than or equal to the preset value, the corresponding parallel computing thread is started to perform calculations. In this way, the Brillouin spectrum data stored in contiguous memory space is divided into three parts, with each parallel computing thread processing one part. The three parallel computing threads operate simultaneously, effectively tripling the computation speed. This process only partitions the Brillouin spectrum data stored in contiguous memory space, without involving the allocation of memory blocks, thus reducing redundant data copying.
[0032] In one or more embodiments of this disclosure, the contiguous memory space can also be address-aligned according to the number of bytes in the central processing unit (CPU) (e.g., 32 bytes or 64 bytes, etc.). That is, when pre-allocating the contiguous memory space, the starting address of the contiguous memory space is set to an integer multiple of the boundary specified by the CPU. This allows the entire data block to be read into the CPU register at once. Then, when parsing Brillouin spectrum data, the CPU's built-in SIMD instruction set (e.g., SSE, AVX, etc.) can be used directly, enabling the CPU to process more data at once using the instruction set and improving processing speed.
[0033] Figure 6 An exemplary system diagram of a spectrum data processing system for a distributed optical fiber sensing system according to an embodiment of the present disclosure is shown. The various embodiments in this specification are described in a progressive manner, with reference to each other for similar or identical parts. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple, and relevant parts can be referred to in the description of the method embodiments. Figure 6 As shown, in one or more embodiments of this disclosure, the data processing system 600 may include a data receiving module 601, configured to receive an input data stream including spectrum data from a distributed fiber optic sensing system. The data receiving module may include a data parsing and storage subunit 611, configured to synchronously and sequentially parse the input data stream to obtain spectrum data and sequentially store the spectrum data into a pre-allocated contiguous memory space during the reception of the input data stream.
[0034] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0035] Figure 7 A block diagram of an electronic device 700 that can implement various embodiments of the present disclosure is shown. (See diagram for reference.) Figure 7As shown, the electronic device 700 includes a processor 710, a disk drive 720, an input / output interface 730, a network interface 740, and a memory 750. The processor 710, disk drive 720, input / output interface 730, network interface 740, and memory 750 can communicate with each other via a communication bus 760.
[0036] The processor 710 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs and implement the technical solution provided in this application.
[0037] The memory 750 can be implemented in the form of ROM (Read Only Memory), RAM (Read Access Memory), static memory, dynamic storage devices, etc. The memory 750 can store the operating system 751 for controlling the operation of the electronic device 700, and the basic input / output system (BIOS) 752 for controlling the low-level operations of the electronic device 700. Additionally, it can store a web browser 753, a data storage management system 754, etc. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 750 and is called and executed by the processor 710.
[0038] The input / output interface 730 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0039] The network interface 740 is used to connect the communication module (not shown in the figure) to enable communication and interaction between the device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0040] Bus 760 includes a pathway for transmitting information between various components of the device, such as processor 510, disk drive 720, input / input interface 730, network interface 740, and memory 750.
[0041] It should be noted that although the above-described device only shows the processor 710, disk drive 720, input / output interface 730, network interface 740, memory 750, bus 760, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the method of this application, and does not necessarily include all the components shown in the figures.
[0042] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0043] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Furthermore, although operations are depicted in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the foregoing discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0044] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for processing spectrum data in a distributed optical fiber sensing system, characterized in that, include: The system receives an input data stream including spectrum data from a distributed optical fiber sensing system. During the process of receiving the input data stream, the system synchronously and sequentially parses the input data stream to obtain the spectrum data and sequentially stores the spectrum data into a pre-allocated contiguous memory space.
2. The method according to claim 1, characterized in that, The spectral data includes multiple spatial sampling point data of the optical fiber, and the spatial sampling point data includes spectral intensity data of multiple frequency sampling points; and the pre-allocation of the contiguous memory space includes: Determine the number of spatial sampling points of the spectrum data and the number of frequency sampling points of the spatial sampling point data; and Allocate contiguous memory space for storing a two-dimensional array, wherein the number of rows of the two-dimensional array is determined based on the number of spatial sampling points, and the number of columns of the two-dimensional array is determined based on the number of frequency sampling points.
3. The method according to claim 2, characterized in that, The parsing of the input data stream includes: The input data stream is scanned line by line to extract a sequence of characters to be parsed corresponding to a spatial sampling point. This sequence has a corresponding sequence number, which indicates the order in which the extracted character sequences are extracted from the input data stream. The character sequence to be parsed is analyzed to obtain the spatial sampling point data corresponding to the character sequence to be parsed; Based on the sequence number of the character sequence to be parsed, the spatial sampling point data are stored sequentially into the corresponding array rows in a two-dimensional array.
4. The method according to claim 3, characterized in that, Also includes: Based on the two-dimensional array, a corresponding row pointer array is created, where each element of the row pointer array corresponds one-to-one with a row of the two-dimensional array and points to the corresponding row. Furthermore, storing the spatial sampling point data sequentially into the corresponding row of the two-dimensional array based on the sequence number of the character sequence to be parsed includes: Based on the sequence number j of the character sequence to be parsed, the j-th array element is determined from the row pointer array; as well as Based on the j-th array element of the row pointer array, the obtained spatial sampling point data is stored in the array row pointed to by the j-th array element.
5. The method according to any one of claims 1-4, characterized in that, Also includes: Determine whether the spectral data in the contiguous memory space meets the preset calculation conditions; and In response to determining that the spectral data in the contiguous memory space meets preset calculation conditions, calculations based on the spectral data are performed.
6. The method according to claims 1-4, characterized in that, The contiguous memory space is divided into multiple contiguous sub-memory spaces, each sub-memory space having a corresponding parallel computing thread, and the method further includes: Determine whether the spectral data in the sub-memory space corresponding to the parallel computing thread meets the computing conditions; and In response to determining that the spectral data in the sub-memory space meets the calculation conditions, the parallel computing thread performs calculations based on the spectral data in the sub-memory space.
7. A spectrum data processing system for a distributed optical fiber sensing system, characterized in that, include: A data receiving module is configured to receive an input data stream including spectral data from a distributed fiber optic sensor system, wherein the data receiving module includes: The data parsing and storage subunit is configured to synchronously and sequentially parse the input data stream to obtain the spectrum data and sequentially store the spectrum data into a pre-allocated contiguous memory space during the process of receiving the input data stream.
8. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.
9. Electronic devices, including: One or more processors, and A memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1-7.