Pipeline electromagnetic internal detection data high-speed storage method based on ZYNQ

Through the ZYNQ-based on-chip cache architecture and BRAM double buffering mechanism, the problems of unstable data storage and high power consumption in in-pipe detection are solved, and the rapid, complete data storage and plug-and-play effects are achieved.

CN120406840APending Publication Date: 2025-08-01SHENYANG UNIVERSITY OF TECHNOLOGY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510490153.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The prior art has problems such as unstable data storage, high power consumption, and small storage capacity in the detection of pipelines, resulting in data loss and inability to transmit in time.

Method used

It adopts a full-chip cache architecture based on ZYNQ, uses the BRAM dual buffering mechanism and a Windows-compatible file system to realize continuous storage and rapid transmission of data, and realizes plug-and-play through the USB interface.

Benefits of technology

It reduces system power consumption, extends the working time of the detection equipment, and solves the problem of data not being transmitted in time, achieving rapid and complete storage and reading of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406840A_ABST
    Figure CN120406840A_ABST
Patent Text Reader

Abstract

The invention provides a pipeline electromagnetic internal detection data high-speed storage method based on ZYNQ, and relates to the technical field of pipeline online internal detection. Firstly, preparation work before storage of pipeline electromagnetic internal detection data is carried out, and then the pipeline electromagnetic internal detection data is collected; transmitting data in the distributed RAM at the PL end to a global / static storage area station at the PS end through a BRAM buffer; storing the data in the global / static storage area station in a storage card by the PS end until the detection is finished; and reading the pipeline electromagnetic internal detection data stored in the file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipeline in-line inspection, and particularly to a high-speed storage method for pipeline electromagnetic in-line inspection data based on ZYNQ. Background Art

[0002] The pipeline in-line inspection technology is one of the most effective methods for identifying pipeline defects. This technology uses a pipeline in-line detector as the core execution unit. The detector is equipped with non-destructive testing sensors, a signal processing system, and a data acquisition and storage device, and is driven forward by the pressure difference of the conveying medium inside the pipeline to complete the inspection inside the pipeline. Due to the characteristics of electromagnetic non-destructive testing sensors, such as no need for a coupling agent and high detection sensitivity, it has become a common means for identifying small defects such as cracks in the field of pipeline in-line inspection. During the pipeline inspection process, the inspection equipment needs to continuously complete long-distance continuous inspection tasks of thousands of kilometers, and the entire inspection process often lasts for several weeks or even longer. In order to accurately obtain the status of the pipeline and the inspection equipment, the pipeline in-line detector usually uses multi-channel data acquisition and integrates various sensors such as accelerometers and gyroscopes. These sensors will generate a large amount of detection data during the long-term inspection process, and the inspection equipment cannot communicate with the outside world during pipeline in-line inspection, and can only collect and store the data online and then perform offline processing. To ensure the rapid and complete recording of data, a high-speed storage scheme needs to be designed to provide accurate data for the subsequent evaluation of the pipeline.

[0003] Currently, the commonly used storage methods often adopt DDR, BRAM cache schemes or the method of alternating read and write of a single SRAM double buffer. For the former, batch transfer and storage need to wait until all the data in the cache is read out before new data can be cached again, which is extremely prone to data loss in the case of high-speed continuous storage. For the latter, due to the small storage capacity of SRAM, it is not suitable for single-batch large-capacity buffer read and write operations. And external SSD and other schemes have problems such as insufficient seismic and temperature resistance and high power consumption.

[0004] ZYNQ is an extensible processing platform, which consists of a processing system PS composed of a dual-core ARM and an FPGA programmable logic part PL. ZYNQ combines the flexibility of FPGA parallel computing and can meet the requirements of high-performance and low-power multi-core processing capabilities of complex embedded systems, and has excellent applicability to the data storage of pipeline electromagnetic in-line inspection. Summary of the Invention

[0005] Aiming at the deficiencies of the prior art, the present invention provides a high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ. This method adopts a full-chip internal cache mechanism and realizes continuous data storage by constructing a dual-buffer architecture based on BRAM between the PL side and the PS side, significantly reducing the system power consumption. At the same time, a Windows-compatible file system is integrated on the PS side, enabling the storage medium to be directly connected to a PC device for reading after the acquisition is completed, eliminating the process of long-time reading of detection data through serial ports and other means.

[0006] The technical solutions adopted by the present invention are as follows:

[0007] A high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ, comprising the following steps:

[0008] Step 1: Prepare for storing pipeline electromagnetic internal detection data;

[0009] Step 1.1: Before the pipeline detection work starts, create a storage file i.txt on the memory card, where i = 1, 2, 3, 4... n, and n is the total number of storage files;

[0010] Step 1.2: Define the communication timing, data frame structure, and control signals of the Serial Peripheral Interface SPI;

[0011] Step 1.3: Configure the communication mode for transmitting pipeline electromagnetic internal detection data, and select to sample the pipeline electromagnetic internal detection data on the rising edge or falling edge;

[0012] Step 1.4: Mount the memory card by calling the mount function in the file system library;

[0013] Step 2: Collect pipeline electromagnetic internal detection data;

[0014] Continuously transmit the data collected by the sensors continuously working in the pipeline electromagnetic internal detection system into the distributed RAM of ZYNQ through any I / O port of ZYNQ using the protocol of the Serial Peripheral Interface SPI;

[0015] Step 3: Transfer the data in the distributed RAM on the PL side to the global / static storage area static on the PS side through BRAM buffering;

[0016] Step 3.1: Add two IP cores for connecting the AXI bus and BRAM in the compilation environment, and connect them to two IP cores for generating BRAM; allocate different address ranges to the two BRAMs, and divide the BRAM of ZYNQ into two different addresses, BRAM_A and BRAM_B;

[0017] Step 3.2: Set the time t as the data flow time parameter. When t = t1, where t1 is the time when the pipeline electromagnetic internal detection data starts to be sent, write the detection data in the PL - side distributed RAM into BRAM_A;

[0018] Step 3.3: When t = t2, BRAM_A reaches the storage peak. The PL - side of ZYNQ sends an interrupt signal irq to the PS - side through the dedicated interrupt channel of ZYNQ, and starts to write the detection data in the registers of the PL - side into BRAM_B;

[0019] Step 3.4: When the PS - side of ZYNQ receives the interrupt signal irq from the PL - side, the PS temporarily saves the data in BRAM_A to the global / static storage area static on the PS - side through the AXI bus of ZYNQ, and completes the data saving at the moment t = t3;

[0020] Step 3.5: When at the moment t = t4, BRAM_B reaches the storage peak, the PL - side of ZYNQ sends an interrupt signal irq to the PS - side again through the dedicated interrupt channel of ZYNQ, and starts to write the data in the PL - side distributed RAM into BRAM_A;

[0021] Step 3.6: When the PS - side of ZYNQ receives the interrupt signal from the PL - side, the PS temporarily saves the detection data in BRAM_B to the global / static storage area static on the PS - side through the AXI bus of ZYNQ, and completes the data saving at the moment t = t5.

[0022] Step 4: The PS - side stores the data in the global / static storage area static into the memory card;

[0023] Step 4.1: The PS - side first mounts the memory card by calling the function for mounting the memory card in the file system library, and opens the storage file i.txt through the open file function;

[0024] Step 4.2: When at the moment t = t3, store the data from BRAM_A in the global / static storage area static on the PS - side into the storage file i.txt;

[0025] Step 4.3: When at the moment t = t5, store the data from BRAM_B in the global / static storage area static on the PS - side into the storage file i.txt;

[0026] Step 4.4: When at the moment t = t6, when the storage file i.txt reaches the storage peak, close the storage file i.txt through the close file function. At this time, i = i + 1, and use the open file function again to open the file i.txt to continue storing;

[0027] Step 5: Repeat the above Step 3.2 - Step 4 until the detection work is completed;

[0028] Step 6: Read the pipeline electromagnetic internal detection data stored in the file;

[0029] After the pipeline electromagnetic internal detection work is completed, connect the high - speed storage module in the pipeline detection device to the PC through the USB interface to read the data.

[0030] The beneficial effects of adopting the above technical solution are as follows:

[0031] The present invention provides a high - speed storage method for pipeline electromagnetic internal detection data based on ZYNQ. This method adopts a full - chip internal unit cache architecture, formats the memory card with a file system compatible with Windows, and simulates the memory card as a USB flash drive. This method greatly reduces power consumption and extends the working time of the pipeline electromagnetic internal detection device when the power reserve carried by the pipeline detection device is limited. At the same time, when used as a USB flash drive, it can achieve plug - and - play, thus solving the drawbacks that the detection device in pipeline detection cannot communicate with the outside world and the data is transmitted through slow - speed methods such as serial ports after offline detection is completed. Description of the Drawings

[0032] Figure 1 It is a flowchart of the technical solution of the high - speed storage method for pipeline electromagnetic internal detection data of the present invention;

[0033] Figure 2 It is a flowchart of the high - speed storage method for pipeline electromagnetic internal detection data in the embodiment of the present invention;

[0034] Figure 3 It is the circuit diagram of the W15 port of ZYNQ AXZ7020 in the embodiment of the present invention. Detailed Embodiments

[0035] The following combines the drawings and embodiments to further describe in detail the specific embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0036] A high - speed storage method for pipeline electromagnetic internal detection data based on ZYNQ, as Figure 1 shown, includes the following steps:

[0037] Step 1: Prepare for storing pipeline electromagnetic internal detection data;

[0038] Step 1.1: Before the pipeline detection work starts, create a storage file i.txt in the memory card, where i = 1, 2, 3, 4... n, and n is the total number of storage files.

[0039] In this embodiment, i = 1, 2... 30, n = 30;

[0040] Step 1.2: Define the communication timing, data frame structure, and control signals of the Serial Peripheral Interface (SPI);

[0041] The data frame structure includes a frame header, a data segment, and a check bit; the control signals include Chip Select (CS), etc.;

[0042] In this embodiment, a three - wire SPI interface is adopted. The clock signal SCLK remains high in the idle state, and 256 - bit data is transmitted each time. The chip - select signal CS remains high - level valid during the entire 256 - bit transmission to ensure the continuity of data transmission.

[0043] Step 1.3: Configure the communication mode for electromagnetic internal detection data transmission, and select to sample the electromagnetic internal detection data on the rising edge or falling edge;

[0044] In this embodiment, all data is configured to be sampled on the falling edge of SCLK;

[0045] Step 1.4: Mount the memory card by calling the mount function in the file system library;

[0046] Step 2: Collect the pipeline electromagnetic internal detection data;

[0047] Use the protocol of the Serial Peripheral Interface (SPI) to continuously transmit the data collected by the sensors continuously working in the pipeline electromagnetic internal detection system into the distributed RAM of ZYNQ through any I / O port of ZYNQ.

[0048] In this embodiment, the specific process of the pipeline electromagnetic internal detection data high - speed storage method is as Figure 2 shown. During the acquisition process, use the SPI protocol to continuously transmit the data collected by the sensors continuously working in the pipeline electromagnetic internal detection system into the temporarily created array CH_DATA of ZYNQ through the W15 port of ZYNQ AXZ7020. The circuit diagram of the W15 port of ZYNQ AXZ7020 is as Figure 3 shown.

[0049] Step 3: Transfer the data in the distributed RAM of the PL side to the global / static storage area static of the PS side through BRAM buffering

[0050] In this embodiment, transfer the data in the array CH_DATA of the PL side to the arrays WriteDataFirst and WriteDataSecond of the PS side through BRAM buffering;

[0051] Step 3.1: Add two AXI BRAM Controllers in Vivado and connect them to two Block Memory Generators. Allocate different address ranges in the Address Editor to divide the BRAM of ZYNQ into two blocks: BRAM1 (address: 40000000 - 4003FFFF) and BRAM2 (address: 40040000 - 4007FFFF).

[0052] Step 3.2: At a certain moment during system operation, write the detection data in the CH_DATA array on the PL side into block BRAM1.

[0053] Step 3.3: When block BRAM1 has stored data 200 times, the PL side of ZYNQ sends an interrupt signal irq to the PS side through the dedicated interrupt channel of ZYNQ, and starts writing the detection data in CH_DATA on the PL side into BRAM2.

[0054] Step 3.4: When the PS side of ZYNQ receives the interrupt signal irq from the PL side, the PS temporarily saves the data in BRAM1 to the WriteDataFirst array on the PS side through the AXI bus of ZYNQ.

[0055] Step 3.5: When block BRAM2 has stored data 200 times, the PL side of ZYNQ sends an interrupt signal irq to the PS side again through the dedicated interrupt channel of ZYNQ, and starts writing the data in the CH_DATA array on the PL side into BRAM1.

[0056] Step 3.6: When the PS side of ZYNQ receives the interrupt signal from the PL side, the PS temporarily saves the detection data in block BRAM2 to the WriteDataSecond array on the PS side through the AXI bus of ZYNQ.

[0057] Step 4: The PS side stores the data in the WriteDataFirst and WriteDataSecond arrays into the SD card.

[0058] Step 4.1: The PS side first mounts the memory card by calling the f_mount function in the FAT32 file system library, and opens the storage file 1.txt through the f_open function (at this time, i = 1, and when performing Step 5, i takes the actual value).

[0059] Step 4.2: When the PS side receives the interrupt signal generated by BRAM1 on the PL side storing data 200 times, it stores the 200 times of data in the WriteDataFirst array on the PS side into the storage file 1.txt.

[0060] Step 4.3: When the PS end receives the interrupt signal generated by the 200 - time storage in BRAM2 of the PL end, store the 200 - time data in the WriteDataSecond array at the PS end into the storage file 1.txt.

[0061] Step 4.4: When the file 1.txt has been written 600 times, close the storage file 1.txt through the f_close function, i = i + 1. At this time, i = 2 (when step 5 is performed, i takes the actual value), and then use the f_open function to open the file 2.txt to continue storage.

[0062] Step 5: Repeat the above steps 3.2 - step 4 until the detection work is completed;

[0063] Step 6: Read the in - pipe electromagnetic inspection data stored in the file;

[0064] After the in - pipe electromagnetic inspection work is completed, connect the high - speed storage module in the in - pipe inspection device to the PC end through the USB interface to read the data.

[0065] The above description is only the preferred embodiment of the present disclosure and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solution formed by the specific combination of the above - mentioned technical features. At the same time, it should also cover other technical solutions formed by any combination of the above - mentioned technical features or their equivalent features without departing from the above - mentioned inventive concept. For example, the technical solutions formed by mutually replacing the above - mentioned features with the (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ, characterized in that It includes the following steps: Step 1: Prepare before storing the in-pipe electromagnetic internal detection data; Step 2: Collect the in-pipe electromagnetic internal detection data; Step 3: Transfer the data in the PL-side distributed RAM to the PS-side global / static storage area static through BRAM buffering; Step 4: The PS side stores the data in the global / static storage area static into the memory card; Step 5: The detection is completed; Step 6: Read the in-pipe electromagnetic internal detection data stored in the file.

2. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, characterized in that The said Step 1 includes the following steps: Step 1.1: Before the start of the pipeline detection work, create a storage file i.txt in the memory card, where i = 1, 2, 3, 4…n, and n is the total number of storage files; Step 1.2: Define the communication timing, data frame structure, and control signals of the serial peripheral interface SPI; Step 1.3: Configure the communication mode for in-pipe electromagnetic internal detection data transmission, and select to sample the in-pipe electromagnetic internal detection data on the rising edge or falling edge; Step 1.4: Mount the memory card by calling the mount function in the file system library.

3. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, wherein The said Step 2 is specifically: Continuously transmit the data collected by the sensors continuously working in the in-pipe electromagnetic internal detection system into the distributed RAM of ZYNQ through any I / O port of ZYNQ using the protocol of the serial peripheral interface SPI.

4. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, wherein The said Step 3 includes the following steps: Step 3.1: Add two IP cores for connecting the AXI bus and BRAM in the compilation environment, and connect them to two IP cores for generating BRAM; Assign different address ranges to the two BRAMs, and divide the BRAM of ZYNQ into two different addresses, BRAM_A and BRAM_B; Step 3.2: Set the time t as the data flow time parameter. When t = t1, where t1 is the start time of transmitting the in-pipe electromagnetic internal detection data, write the detection data in the PL-side distributed RAM into BRAM_A; Step 3.3: When t = t2, BRAM_A reaches the storage peak, and the PL side of ZYNQ sends an interrupt signal irq to the PS side through the dedicated interrupt channel of ZYNQ, and starts to write the detection data in the registers of the PL side into BRAM_B; Step 3.4: When the PS side of ZYNQ receives the interrupt signal irq from the PL side, the PS temporarily saves the data in BRAM_A to the global / static storage area static of the PS side through the AXI bus of ZYNQ, and completes the data saving at the moment of t = t3; Step 3.5: When t = t4, BRAM_B reaches the storage peak, and the PL side of ZYNQ sends an interrupt signal irq to the PS side again through the dedicated interrupt channel of ZYNQ, and starts to write the data in the PL-side distributed RAM into BRAM_A; Step 3.6: When the PS side of ZYNQ receives the interrupt signal from the PL side, the PS temporarily saves the detection data in BRAM_B to the global / static storage area static of the PS side through the AXI bus of ZYNQ, and completes the data saving at the moment of t = t5.

5. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, characterized in that Step 4 includes the following steps: Step 4.1: The PS side first mounts the memory card by calling the function in the file system library for mounting the memory card, and opens the storage file i.txt through the file opening function. Step 4.2: When t = t3, the data from BRAM_A in the global / static storage area static of the PS side is stored in the storage file i.txt. Step 4.3: When t = t5, the data from BRAM_B in the global / static storage area static of the PS side is stored in the storage file i.txt. Step 4.4: When t = t6 and the storage file i.txt reaches the storage peak, the storage file i.txt is closed through the file closing function. At this time, i = i + 1, and the file opening function is used again to open the file i.txt to continue storage.

6. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, characterized in that Step 5 is specifically as follows: Repeat the above steps 3.2 - Step 4 until the detection work is completed.

7. The high-speed storage method for pipeline electromagnetic internal detection data based on ZYNQ according to claim 1, characterized in that Step 6 is specifically as follows: After the in-pipe electromagnetic detection work is completed, the high-speed storage module in the in-pipe detection device is connected to the PC side through the USB interface to read data.

Citation Information

Patent Citations

  • On-satellite ultra-high-speed storage system and method

    CN113918505A

  • Data storage and transmission system based on ZYNQ chip

    CN114780449A

  • Method and system for quickly and autonomously detecting and guiding interference based on ZYNQ platform

    CN116736241A