Ground penetrating radar data read-write method and system and storage medium

By writing ground-penetrating radar data into storage space in frames and combining frame table and page table management, the problem of excessively large ground-penetrating radar data file size is solved, and variable-length storage and space utilization optimization are achieved.

CN121900691APending Publication Date: 2026-04-21ANDESPACE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANDESPACE
Filing Date
2025-12-19
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing ground-penetrating radar data files are too large due to their fixed-length storage method, making it difficult to meet the needs of network transmission and long-term storage. At the same time, variable-length data storage results in wasted storage space.

Method used

The method involves writing ground-penetrating radar data into storage space in frames. By calculating frame numbers, loading frame tables and page tables, merging or writing data frames, and writing storage pages, variable-length data storage is achieved. Released storage pages are reclaimed through an idle table to avoid wasting storage space.

Benefits of technology

It achieves efficient storage of variable-length ground-penetrating radar data, avoids wasting storage space, and meets the actual reading and writing requirements of ground-penetrating radar data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121900691A_ABST
    Figure CN121900691A_ABST
Patent Text Reader

Abstract

The invention provides a ground penetrating radar data read-write method and system and a storage medium, and the method comprises the steps: a data writing step: completing the writing of ground penetrating radar data by taking a frame as a unit, and achieving the storage of variable-length data; a data reading step: reading one or more continuous channels of ground penetrating radar data from the storage space, and reading multiple channels of data; the list loading step is used for loading the list; a list item adding step, which is used for adding list items and realizing dynamic extension of the list; the list item deleting step is used for deleting the list items and releasing redundant list pages; the list closing step is used for closing the list; the storage page distribution step is used for distributing a new storage page, and the last idle page is preferentially taken out from the idle table to serve as the new storage page. According to the invention, the data storage requirement of the variable-length ground penetrating radar can be met, the problem of storage space waste can be effectively avoided, and the actual read-write requirement of the ground penetrating radar data is well met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a data reading and writing method, particularly to a method for reading and writing ground penetrating radar data, and further to a reading and writing system and storage medium employing the method for reading and writing ground penetrating radar data. Background Technology

[0002] Existing ground-penetrating radar (GPR) data files generally use a method of storing data sequentially for each channel. In a single acquisition, the number of sampling points and the length of the sampled data for each channel remain fixed. Writing data in the order and with a fixed length for each channel forms a complete survey line data. During data retrieval, the offset position of each channel's data within the file is calculated based on the channel number, and the data is read in fixed lengths, thus completing the reading of one channel's data.

[0003] However, with the increasingly widespread use of high-speed vehicle-mounted 3D ground-penetrating radar (GPR) systems, the size and scale of GPR data have exploded. Traditional GPR data files, which store fixed-length raw data, are too large to meet the needs of network transmission and long-term storage. After compressing GPR data to reduce its size, the length of each data track is no longer fixed, therefore, the existing sequential storage method is no longer applicable.

[0004] If conventional methods for storing variable-length data are used, an index is created for each data entry as it is written sequentially, recording the offset and length of each entry. The index is typically stored in a separate index file, or a sufficiently large storage space is allocated at a fixed location within the data file. However, this method suffers from significant storage waste because the lengths of the data before and after modification differ, requiring additional storage space to be allocated. Furthermore, the existing storage space is difficult to reclaim. Summary of the Invention

[0005] The technical problem to be solved by this invention is to provide a method for reading and writing ground-penetrating radar (GPR) data that not only meets the data storage requirements of GPR data with variable lengths but also avoids the problem of wasted storage space. Furthermore, this invention provides a reading and writing system and storage medium employing this GPR data reading and writing method.

[0006] To address this, the present invention provides a method for reading and writing ground-penetrating radar data, comprising the following steps:

[0007] The data writing step is used to complete the writing of ground penetrating radar data. One or multiple consecutive ground penetrating radar data are written to the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames and writing storage pages, the storage of variable-length ground penetrating radar data is realized.

[0008] The data reading step is used to complete the reading of ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially and splicing the data to read multiple data.

[0009] The list loading step is used to load the list. It reads the list entry on the homepage and reads each list page in sequence until the last page of the list, thus completing the loading of the list data.

[0010] The list item addition step is used to add list items. By calculating the target position, allocating a new list page, writing the list item data, and updating the list item's sequence number, a new list item is added to the list, realizing the dynamic expansion of the list.

[0011] The list item deletion step is used to delete list items, remove the list item with the specified index from the list, and free up redundant list pages;

[0012] The list closing step is used to close the list. It writes the data of each list page in the list to the corresponding storage page in sequence, and writes the 0th page of the list to the list entry on the homepage.

[0013] The storage page allocation step is used to allocate new storage pages. First, the last free page is taken from the idle table as the new storage page; when the idle table is empty, a new storage page is allocated from the storage space.

[0014] A further improvement of the present invention is that a storage page of a preset fixed size is used as the management unit of the storage space, and the sequence number of each storage page in the storage space is called the page number. The page numbers are assigned sequentially, and the page number multiplied by the size of the storage page is used as the position of the storage page in the storage space. In the data writing step and the data reading step, the ground penetrating radar data is divided into data frames according to a fixed number of channels, and the data frame is used as the data granularity for one write and read.

[0015] The storage pages include a homepage, a list page, and a data page;

[0016] The homepage is the 0th page of the storage space, which saves pagination information, test line format and acquisition information in a fixed format; the pagination information includes multiple list entries, with list entry 0 as the entry for the idle table and list entry 1 as the entry for the frame table;

[0017] The list page is used to store data that has a sequential order and is of the same size, including frame table, page table and idle table. Each piece of data is called a list item. The page number of the next list page is recorded in the list header of each list page to realize the storage of an unlimited number of list items across multiple storage pages, and the page number of the 0th page of the list is used as the list entry.

[0018] The data page is used to store the sampling data of the ground penetrating radar. Each frame of sampling data is divided into multiple data blocks according to the size of the storage page, and each block is saved to a different data page.

[0019] A further improvement of the present invention is that the data writing step includes the following sub-steps:

[0020] Step A1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width; calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width.

[0021] Step A2: Write the data for each frame from the start frame to the end frame sequentially;

[0022] Step A2 includes the following sub-steps:

[0023] Step A21: Obtain the frame table entry corresponding to the current frame from the frame table, and determine whether the total number of frame table entries in the frame table is less than the frame number of this frame. If so, add a frame table entry and set the data length and page table entry in the new frame table entry to 0. If not, load the page table of this frame according to the page table entry in the frame table entry. When the page table entry is 0, construct an empty page table.

[0024] Step A22: Extract the trace data belonging to this frame from the data to be written, and calculate the start trace number and end trace number within the frame;

[0025] Step A23: Determine whether the frame already contains data and whether the start channel number or end channel number within the frame is not 0 or is not the data frame width. If yes, read the existing data and merge it with the data to be written to form a complete data frame to be written. If no, use the data to be written as the complete data frame to be written.

[0026] Step A24: Write this frame of data sequentially to the storage pages according to the page table;

[0027] Step A25: Write the data length and page table entry of this frame into the corresponding frame table entry.

[0028] A further improvement of the present invention is that, in step A23, the process of merging existing data with data to be written is as follows: First, data is read sequentially according to each data page number of the page table and spliced ​​into complete data for this frame; then, according to the compression algorithm type of the test line format in the first page, the corresponding decompression algorithm is called to decompress the data of this frame; finally, according to the channel number in the frame, the number of channels in the test line format, and the number of samples, the position of the channel to be written in this frame data is obtained and written.

[0029] In step A24, the process of sequentially writing to storage pages is as follows: First, based on the compression algorithm type of the test line format in the home page, the corresponding compression algorithm is called to compress the frame data; then, the compressed data is divided into multiple data pages according to the size of the storage page in the paging information, and it is determined whether the number of page table entries is less than the required number of data pages. If so, storage pages are requested and the data pages are sequentially appended to the page table; otherwise, the excess storage pages are released and the released storage pages are appended to the idle table for recycling; finally, the corresponding data pages are sequentially written to the corresponding storage pages according to each data page number in the page table.

[0030] A further improvement of the present invention is that the data reading step includes the following sub-steps:

[0031] Step B1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width; calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width.

[0032] Step B2: Read each frame of data from the start frame to the end frame sequentially;

[0033] Step B3 involves concatenating the data extracted from each frame into a continuous multi-channel data stream to complete the reading process.

[0034] Step B2 includes the following sub-steps:

[0035] Step B21: Determine whether the total number of frame table entries is less than the frame number of this frame. If yes, end the reading process; otherwise, retrieve the corresponding frame table entry from the frame table.

[0036] Step B22: Determine whether the data length or page table entry in the frame table entry is 0. If yes, end the reading process; otherwise, load the page table of this frame according to the page table entry in the frame table entry.

[0037] Step B23: Read the data sequentially according to each data page number of the page table and assemble them into the complete data of this frame;

[0038] Step B24: Based on the compression algorithm type of the test line format on the homepage, call the corresponding decompression algorithm to decompress this frame of data.

[0039] A further improvement of the present invention is that the list loading step includes the following sub-steps:

[0040] Step C1: Determine if the list entry point on the homepage is 0. If yes, loading ends; otherwise, read the 0th list page based on the list entry point.

[0041] Step C2: Read the list repeatedly until the next list page in the current list header is 0, then the loading ends.

[0042] A further improvement of the present invention is that the step of adding list items includes the following sub-steps:

[0043] Step D1: First, subtract the size of the list header from the size of the storage page to obtain the difference. Then, divide this difference by the size of the list items to calculate the number of list items that each list page can hold. Divide the index of the list item to be added by the number of list items that each page can hold, round down to obtain the list page index corresponding to the list item, and take the remainder to obtain the position of the list item within the list page.

[0044] Step D2: Determine if the number of list pages is less than the list page number of the list items. If yes, allocate list pages and append them to the list sequentially, setting the next list page in the header of the last page to the allocated page number, completing the appending of list pages, and proceed to step D3; otherwise, proceed directly to step D3.

[0045] Step D3: Write the list item data into the corresponding position according to the list page number and position within the list page of the corresponding list item;

[0046] Step D4: Determine whether the total number of list items in the list header of page 0 of the list is less than the index of the added list item. If yes, change it to the index of the added list item; otherwise, end the process.

[0047] A further improvement of the present invention is that the list item deletion step includes the following sub-steps:

[0048] Step E1: Determine whether the total number of list items in the list header of page 0 of the list is less than the number of the list item to be deleted. If yes, then report that the deletion is complete; otherwise, proceed to step E2.

[0049] Step E2: Loop through the list and move the data of each subsequent list item forward by one list item position;

[0050] Step E3: Decrease the total number of list items in the list header of page 0 of the list by 1;

[0051] Step E4: Calculate the number of list pages required to modify the list based on the total number of list items. If the required number of list pages is less than the current number of list pages, release the excess list pages.

[0052] This invention also provides a ground-penetrating radar data reading and writing system, which employs the ground-penetrating radar data reading and writing method described above, and includes:

[0053] The data writing module is used to write ground penetrating radar data. It writes one or more consecutive ground penetrating radar data into the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames, and writing storage pages, it realizes the storage of ground penetrating radar data of variable length.

[0054] The data reading module is used to read ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially, and splicing the data.

[0055] The list loading module is used to load lists. It reads the list entry from the homepage and sequentially reads each list page until the last page of the list to complete the loading of list data.

[0056] The list item addition module is used to add list items. By calculating the target position, allocating a new list page, writing list item data, and updating the list item's sequence number, new list items are added to the list, realizing the dynamic expansion of the list.

[0057] The list item deletion module is used to delete list items, remove the list item with a specified index from the list, and free up redundant list pages;

[0058] The list closing module is used to close the list. It writes the data of each list page in the list to the corresponding storage page in turn, and writes the 0th page of the list to the list entry on the homepage.

[0059] The storage page allocation module is used to allocate new storage pages. First, it retrieves the last free page from the idle table as the new storage page; when the idle table is empty, it allocates a new storage page from the storage space.

[0060] The present invention also provides a storage medium for ground penetrating radar data, wherein the storage medium employs the ground penetrating radar data reading and writing method described above.

[0061] Compared with existing technologies, the advantages of this invention are as follows: It writes one or more consecutive ground-penetrating radar (GPR) data streams to storage space in frames, achieving variable-length GPR data storage by calculating frame numbers, loading frame and page tables, merging or writing data frames, and writing storage pages. During the reading of GPR data, multiple data streams are read by calculating frame numbers, sequentially reading data, and splicing data. In the overall read / write process, it also proposes operation steps for each list, including loading lists, adding list items, deleting list items, and closing lists. Furthermore, it reclaims freed storage pages through an idle list and uses them to allocate new storage pages, effectively avoiding storage space waste. Specifically, a fixed-size storage page is used as the unit of storage space management. The sequence number of each storage page in the storage space is called the page number. The page numbers are assigned sequentially, and the page number multiplied by the size of the storage page is used as the position of the storage page in the storage space. Furthermore, the ground-penetrating radar data is divided into data frames according to a fixed number of channels. The data frame is used as the data granularity for one write and read operation. This not only meets the data storage requirements of variable-length ground-penetrating radar data, but also effectively avoids the problem of wasted storage space, thus well meeting the actual read and write requirements of ground-penetrating radar data. Attached Figure Description

[0062] Figure 1 This is a schematic diagram of the data structure principle of one embodiment of the present invention. Detailed Implementation

[0063] In the description of this invention, the term "several" means one or more; the term "multiple" means two or more; the terms "greater than," "less than," and "exceeding" are all understood to exclude the stated number; and the terms "above," "below," and "within" are all understood to include the stated number. The terms "first," "second," etc., are understood to be used only to distinguish identical or similar technical feature names, and should not be construed as implying / indicating the relative importance of the technical features, the number of technical features, or the sequential relationship between the technical features.

[0064] The preferred embodiments of the present invention will now be described in further detail with reference to the accompanying drawings.

[0065] This embodiment provides a method for reading and writing ground-penetrating radar data, including the following steps:

[0066] The data writing step is used to complete the writing of ground penetrating radar data. One or multiple consecutive ground penetrating radar data are written to the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames and writing storage pages, the storage of variable-length ground penetrating radar data is realized.

[0067] The data reading step is used to complete the reading of ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially and splicing the data to read multiple data.

[0068] The list loading step is used to load the list. It reads the list entry on the homepage and reads each list page in sequence until the last page of the list, thus completing the loading of the list data.

[0069] The list item addition step is used to add list items. By calculating the target position, allocating a new list page, writing the list item data, and updating the list item's sequence number, a new list item is added to the list, realizing the dynamic expansion of the list.

[0070] The list item deletion step is used to delete list items, remove the list item with the specified index from the list, and free up redundant list pages;

[0071] The list closing step is used to close the list. It writes the data of each list page in the list to the corresponding storage page in sequence, and writes the 0th page of the list to the list entry on the homepage.

[0072] The storage page allocation step is used to allocate new storage pages. First, the last free page is taken from the idle table as the new storage page; when the idle table is empty, a new storage page is allocated from the storage space.

[0073] It should be noted that in practical applications, the data writing step and the storage page allocation step are not limited to sequential execution, but are steps used to complete different operations / functions. That is, this embodiment writes one or more consecutive ground-penetrating radar data streams to the storage space in frames. By calculating frame numbers, loading frame tables and page tables, merging or writing data frames, and writing storage pages, variable-length ground-penetrating radar data is stored. During the reading of ground-penetrating radar data, multiple streams of data are read by calculating frame numbers, reading data sequentially, and splicing data. In the overall read and write process, operation steps for each list are also proposed, including loading lists, adding list items, deleting list items, and closing lists. Furthermore, freed storage pages are reclaimed through an idle list and used to allocate new storage pages, effectively avoiding the waste of storage space. In summary, the data writing step is a general description of the writing method; the data reading step is a general description of the reading method; the list loading step, list item adding step, list item deleting step, and list closing step are general methods for list operations that are frequently called during the writing or reading process; the storage page allocation step is a brief description of how new storage pages are allocated during the data writing process, and it also calls the idle table deletion operation.

[0074] In this embodiment, on the one hand, a preset fixed-size storage page is used as the basic unit for storage space management. The sequence number of each storage page within the storage space is called the page number, which is assigned sequentially. The page number multiplied by the storage page size determines the storage page's position within the storage space. On the other hand, to avoid storage space fragmentation, during the data writing and reading steps, the ground-penetrating radar data is divided into data frames according to a fixed number of channels. Each data frame serves as the granularity for a single write and read operation. The preset fixed size can be set and adjusted according to actual conditions and needs; the default storage page size is 4096 bytes.

[0075] Therefore, through this data structure principle / organization, this embodiment can not only meet the data storage requirements of variable-length ground-penetrating radar, but also effectively avoid the problem of wasted storage space, thus well meeting the actual read and write requirements of ground-penetrating radar data.

[0076] Depending on the nature of the content stored in the storage pages, the storage pages in this embodiment include homepages, list pages, and data pages. The specific data structure principles are as follows: Figure 1 As shown.

[0077] The homepage is page 0 of the storage space, which stores pagination information, test line format and acquisition information in a fixed format; the pagination information includes multiple list entries, with list entry 0 as the entry for the idle table and list entry 1 as the entry for the frame table.

[0078] The list pages are used to store data that are sequential and of the same size, including frame tables, page tables, and idle tables. Each piece of data is called a list item. The page number of the next list page is recorded in the list header of each list page, thereby enabling the storage of an unlimited number of list items across multiple storage pages, with the page number of page 0 of the list serving as the list entry point.

[0079] The data page is used to store the sampling data of the ground penetrating radar. Each frame of sampling data is divided into multiple data blocks according to the size of the storage page, and each block is saved to a different data page.

[0080] More specifically, the homepage stores pagination information, test line format, and collection information in a fixed format.

[0081] The paging information includes, but is not limited to, the following fields: word sequence stamp, a preset specific integer, such as 0x01020304, used to indicate the byte order used by the homepage; size of storage page, used to indicate the number of bytes in each storage page, with a default of 4096 bytes; total number of storage pages, used to indicate the number of all storage pages; multiple list entries, used to indicate the entries of multiple lists, such as list entry 0 being the entry of the idle table, list entry 1 being the entry of the frame table, and if the list is empty, the list entry is set to 0.

[0082] Preferably, the pagination information structure is defined as follows: struct PagingInfo { uint endian_stamp; / / Word sequence stamp: 0x01020304 uint page_size; / / Page size: default 4096 uint page_count; / / Total number of pages stored uint lists[MAX_LIST_NUM]; / / List entry: lists[0] entry for idle lists; lists[1] entry for frame lists }

[0083] The survey line format includes, but is not limited to, the following fields: format version number, used to indicate the version number of the data format for this survey line; compression algorithm type, used to indicate whether the data for this survey line is compressed, and if so, whether lossy or lossless compression is used; data frame width, used to indicate the number of channels contained in each data frame, with a default of 400 channels; number of channels, used to indicate the number of radar channels for this survey line; number of channels, used to indicate the total number of channels contained in this survey line; number of samples, used to indicate the number of sampling points contained in each data channel; compression parameters, used to indicate the parameters required by the data compression algorithm, such as quantization table and encoding table.

[0084] Preferably, the survey line format structure is defined as follows: struct DataFormat { uchar version; / / Test line format version number uchar compress; / / Compression type: 0 Uncompressed, 1 Lossy compression, 2 Lossless compression uint frame_size; / / Data frame width: default 400 uint channels; / / Number of channels uint traces; / / Number of traces uint samples; / / Number of sampling points uchar compress_param[COMPRESS_PARAM_SIZE]; / / Compression parameters }

[0085] The acquired information includes, but is not limited to, the following fields: ground-penetrating radar (GPR) equipment model, GPR equipment serial number, start and end times of acquisition, total acquisition distance, GPR antenna frequency, GPR sampling frequency, GPR sampling window, sampling triggering method, track spacing when the ranging wheel is triggered, time interval when the time is triggered, and preprocessing type. The preprocessing type indicates which preprocessing steps the GPR data has undergone, such as signal alignment, background removal, signal gain adjustment, noise reduction, strong reflection reduction, and contrast normalization.

[0086] Preferably, the structure of the collected information is defined as follows: struct ScanInfo { char device_model[DEVICE_MODEL_SIZE]; / / Device model char serial_no[SERIAL_NO_SIZE]; / / Device serial number uint start_time; / / Data collection start time uint end_time; / / Data collection end time float total_distance; / / Collect total distance (meters) uint antenna_freq; / / Antenna frequency (MHz) uint sample_freq; / / Sampling frequency (MHz) uint time_window; / / Sampling time window (nanoseconds) uchar trigger_mode; / / Trigger mode: 0 Manual trigger, 1 Distance wheel trigger, 2 Time trigger float dist_interval; / / Track spacing (meters) float time_interval; / / Time interval (seconds) uchar proc_types[MAX_PROC_TYPE_NUM]; / / Preprocessing type: 0 None, 1 Signal alignment, 2 Background removal, 3 Signal gain, 4 Noise removal, 5 Strong reflection removal, 6 Contrast normalization }

[0087] The lists described in this embodiment include frame tables, page tables, and idle tables. The frame table records the size of each frame of data and its corresponding entry in the page table; the page table records the page number of each data page occupied by a frame of data; and the idle table records each reclaimed storage page. The list consists of multiple list pages, and each list page consists of a list header and list items.

[0088] The list header includes, but is not limited to, the following fields: word sequence stamp, a preset specific integer, such as 0x01020304, used to indicate the byte order used in this list; the page number of the next list page, which is 0 when there is no next list page; and the total number of list items, recorded in the list header of page 0.

[0089] Preferably, the list header structure is defined as follows: struct ListHeader { uint endian_stamp; / / Word sequence stamp: 0x01020304 uint next_page_no; / / Page number of the next list page uint entry_count; / / Total number of list items }

[0090] Preferably, the list item structure of the frame table is defined as follows: struct FrameEntry { uint data_length; / / Data length uint page_list; / / Page table entry }

[0091] Preferably, the list item structure of the idle table and page table is defined as follows: struct PageEntry { uint page_no; / / Page number };

[0092] Different list items contain different fields. For page tables and idle tables, the list items preferably only need to include the page number of the data page or idle page. Frame table list items include, but are not limited to, the following fields: data length, indicating the number of bytes of data in this frame (0 for empty frames); page table entry, indicating the entry point of the page table in this frame (0 for empty frames).

[0093] The following will describe each step in more detail.

[0094] The data writing step described in this embodiment is used to write ground-penetrating radar data, writing one or multiple consecutive data channels, and preferably includes the following sub-steps:

[0095] Step A1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width. Specifically, divide the starting channel number by the data frame width, round down to obtain the frame number of the starting frame, and take the remainder to obtain the intra-frame channel number of the starting frame. Calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width. Similarly, divide the ending channel number by the data frame width, round down to obtain the frame number of the ending frame, and take the remainder to obtain the intra-frame channel number of the ending frame.

[0096] Step A2: Write the data for each frame from the start frame to the end frame sequentially;

[0097] Step A2 includes the following sub-steps:

[0098] Step A21: Obtain the frame table entry corresponding to the current frame from the frame table, and determine whether the total number of frame table entries in the frame table is less than the frame number of this frame. If so, add enough frame table entries and set the data length and page table entry in the new frame table entry to 0. If not, load the page table of this frame according to the page table entry in the frame table entry. When the page table entry is 0, construct an empty page table.

[0099] Step A22: Extract the trace data belonging to this frame from the data to be written, and calculate the start trace number and end trace number within the frame;

[0100] Step A23: Determine whether the frame already contains data and whether the start channel number is not 0 or the end channel number is not the data frame width. If yes, read the existing data and merge the existing data with the data to be written to form a complete data frame to be written. If no, that is, the frame contains no data, or the start channel number is 0 and the end channel number is the data frame width, then use the data to be written as the complete data frame to be written.

[0101] Step A24: Write this frame of data sequentially to the storage pages according to the page table;

[0102] Step A25: Write the data length and page table entry of this frame into the corresponding frame table entry.

[0103] In step A22 of this embodiment, each data track in the data to be written has a fixed length and is simply represented in memory as a three-dimensional array, such as data[channels][traces][samples]. Therefore, the position of each data track can be obtained by the index of the data to be written, thereby realizing the extraction of the data track. The process of calculating the start and end track numbers within the frame is as follows: Start track number within the frame = max(data frame width × (frame number - 1), start track number to be written), End track number within the frame = min(data frame width × (frame number - 1), end track number to be written); For example, if the frame width is 100 and the track numbers of the data to be written are 110 to 290, when the frame number is 1, the track numbers within the frame are 110-199; when the frame number is 2, the track numbers within the frame are 200-290.

[0104] Preferably, in step A23 of this embodiment, the process of merging existing data with data to be written is as follows: First, data is read sequentially according to each data page number of the page table and concatenated into complete data for this frame. Concatenation refers to storing each page of data sequentially and continuously. Then, according to the compression algorithm type of the test line format in the first page, the corresponding decompression algorithm is called to decompress the data of this frame. Finally, according to the intra-frame channel number, the number of channels in the test line format, and the number of samples, the position of the channel to be written in this frame of data is obtained and written. Since each channel data in the data to be written has a fixed length, it is simply represented in memory as a three-dimensional array, such as data[channels][traces][samples]. Therefore, the position of the channel to be written in this frame of data (i.e., the position of each channel data) can be obtained by the index of the data to be written. Here, channels represent the intra-frame channel number, traces represent the number of channels in the test line format, and samples represent the number of samples.

[0105] In step A24, the process of writing this frame of data to the storage page according to the page table is as follows: First, according to the compression algorithm type of the test line format in the home page, the corresponding compression algorithm is called to compress the frame of data; then, the compressed data is divided into multiple data pages according to the size of the storage page in the paging information, and it is determined whether the number of page table entries is less than the number of required data pages. If so, sufficient storage pages are requested and the data pages are appended to the page table in sequence; if not, the excess storage pages are released and the released storage pages are appended to the idle table for recycling; finally, the corresponding data page is written to the corresponding storage page in sequence according to each data page number in the page table.

[0106] The data reading step described in this embodiment is used to read ground-penetrating radar data, reading one or multiple consecutive data channels, and preferably includes the following sub-steps:

[0107] Step B1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width; calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width.

[0108] Step B2: Read each frame of data from the start frame to the end frame sequentially;

[0109] Step B3 involves concatenating the data extracted from each frame into a continuous multi-channel data stream to complete the reading process.

[0110] Step B2 includes the following sub-steps:

[0111] Step B21: Determine whether the total number of frame table entries is less than the frame number of this frame. If yes, it means there is no corresponding frame table entry, and the reading process ends; otherwise, retrieve the corresponding frame table entry from the frame table.

[0112] Step B22: Determine if the data length or page table entry in the frame table entry is 0. If it is, the entry is empty and the reading process ends. If not, load the page table of this frame according to the page table entry in the frame table entry.

[0113] Step B23: Read the data sequentially according to each data page number of the page table and concatenate them into the complete data of this frame; concatenation means that the data of each page is stored sequentially in order.

[0114] Step B24: Based on the compression algorithm type of the test line format on the homepage, call the corresponding decompression algorithm to decompress this frame of data.

[0115] The ground-penetrating radar data reading and writing method provided in this embodiment includes numerous list operations on the frame table, page table, and idle table. Therefore, this embodiment provides a set of general operation steps for each list, including loading the list, adding list items, deleting list items, and closing the list, as detailed in the list loading step to the list closing step.

[0116] The list loading step described in this embodiment is used to load a list. The list loading step preferably includes the following sub-steps:

[0117] Step C1: Determine if the list entry point on the homepage is 0. If it is, it means the list is empty and loading is complete; otherwise, read the 0th list page based on the list entry point.

[0118] Step C2: Read the list in a loop until the next list page in the current list header is 0. If the next list page is 0, it means that the current list page is the last page of the list, and then the loading ends.

[0119] The list item addition step described in this embodiment is used to add list items. The list item addition step preferably includes the following sub-steps:

[0120] Step D1: First, subtract the size of the list header from the size of the storage page to obtain the difference. Then, divide the difference by the size of the list item to calculate the number of list items that each list page can hold. Divide the index of the list item to be added by the number of list items that each page can hold, round down to obtain the list page index corresponding to the list item (i.e., which list page it is located on), and take the remainder to obtain the position of the list item within the list page.

[0121] Step D2: Determine if the number of list pages in the list is less than the list page number of the list item. If yes, allocate enough list pages and append them to the list in sequence, and set the next list page in the list header of the last page as the allocated page number to complete the appending of list pages, then jump to step D3; otherwise, jump directly to step D3.

[0122] Step D3: Write the list item data into the corresponding position according to the list page number and position within the list page of the corresponding list item;

[0123] Step D4: Determine whether the total number of list items in the list header of page 0 of the list is less than the index of the added list item. If yes, change it to the index of the added list item; otherwise, end the process.

[0124] The list item deletion step described in this embodiment is used to delete list items. The list item deletion step preferably includes the following sub-steps:

[0125] Step E1: Determine if the total number of list items in the list header of page 0 of the list is less than the number of the list item to be deleted. If yes, it means that there is no corresponding list item in the list, and the deletion is completed. If no, proceed to step E2.

[0126] Step E2: Loop through the list and move the data of each subsequent list item forward by one list item position;

[0127] Step E3: Decrease the total number of list items in the list header of page 0 of the list by 1;

[0128] Step E4: Calculate the number of list pages required to modify the list based on the total number of list items. If the required number of list pages is less than the current number of list pages, release the excess list pages.

[0129] In this embodiment, step E2 preferably includes the following sub-steps:

[0130] Step E21: Calculate the list page number and position within the list page of the list item to be moved by dividing the list item number by the number of list items that can be accommodated per page, rounding down to obtain the list page number, and taking the remainder to obtain the position within the list page.

[0131] Step E22: Subtract 1 from the index of the list item to be moved, calculate the new list page index and its position within the list page. Specifically, divide the list item index by the number of list items that can be accommodated per page, round down to get the list page index, and take the remainder to get the position within the list page.

[0132] Step E23: Read the data of the list item to be moved and write its new position.

[0133] Similarly, steps A to E in this embodiment are merely elaborations on each step individually, and the different letters do not represent the order of the steps. Only within the same step / letter, such as steps A1 and A2 included in step A, are sub-steps that have a sequence.

[0134] The list closing step described in this embodiment is used to close the list. First, the data of each list page in the list is written to the corresponding storage page in sequence, and then the 0th page of the list is written to the list entry on the homepage.

[0135] The storage page allocation step described in this embodiment is used to implement storage page allocation. In this storage page allocation step, released storage pages are reclaimed through an idle table to avoid wasting storage space. When a storage page needs to be allocated, the last free page in the idle table is first retrieved as the allocation page. If the idle table is empty, a new storage page is allocated from the storage space according to the total number of storage pages in the homepage pagination information.

[0136] This embodiment also provides a ground-penetrating radar data reading and writing system, which employs the ground-penetrating radar data reading and writing method described above, and includes:

[0137] The data writing module is used to write ground penetrating radar data. It writes one or more consecutive ground penetrating radar data into the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames, and writing storage pages, it realizes the storage of ground penetrating radar data of variable length.

[0138] The data reading module is used to read ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially, and splicing the data.

[0139] The list loading module is used to load lists. It reads the list entry from the homepage and sequentially reads each list page until the last page of the list to complete the loading of list data.

[0140] The list item addition module is used to add list items. By calculating the target position, allocating a new list page, writing list item data, and updating the list item's sequence number, new list items are added to the list, realizing the dynamic expansion of the list.

[0141] The list item deletion module is used to delete list items, remove the list item with a specified index from the list, and free up redundant list pages;

[0142] The list closing module is used to close the list. It writes the data of each list page in the list to the corresponding storage page in turn, and writes the 0th page of the list to the list entry on the homepage.

[0143] The storage page allocation module is used to allocate new storage pages. First, it retrieves the last free page from the idle table as the new storage page; when the idle table is empty, it allocates a new storage page from the storage space.

[0144] This embodiment also provides a storage medium for ground-penetrating radar data, which employs the ground-penetrating radar data reading and writing method described above.

[0145] Specifically, the ground-penetrating radar data reading and writing method provided in this embodiment is applicable to various storage media. The storage media are used to store files from various file systems, such as local files, network file systems, and distributed file systems. It is also applicable to various character devices, block devices, and raw partition devices in computer systems.

[0146] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for reading and writing ground-penetrating radar data, characterized in that, Includes the following steps: The data writing step is used to complete the writing of ground penetrating radar data. One or multiple consecutive ground penetrating radar data are written to the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames and writing storage pages, the storage of variable-length ground penetrating radar data is realized. The data reading step is used to complete the reading of ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially and splicing the data to read multiple data. The list loading step is used to load the list. It reads the list entry on the homepage and reads each list page in sequence until the last page of the list, thus completing the loading of the list data. The list item addition step is used to add list items. By calculating the target position, allocating a new list page, writing the list item data, and updating the list item's sequence number, a new list item is added to the list, realizing the dynamic expansion of the list. The list item deletion step is used to delete list items, remove the list item with the specified index from the list, and free up redundant list pages; The list closing step is used to close the list. It writes the data of each list page in the list to the corresponding storage page in sequence, and writes the 0th page of the list to the list entry on the homepage. The storage page allocation step is used to allocate new storage pages. First, the last free page is taken from the idle table as the new storage page; when the idle table is empty, a new storage page is allocated from the storage space.

2. The method for reading and writing ground-penetrating radar data according to claim 1, characterized in that, A fixed-size storage page is used as the unit of storage space management. The sequence number of each storage page in the storage space is called the page number. The page numbers are assigned sequentially, and the page number multiplied by the size of the storage page is used as the position of the storage page in the storage space. In the data writing and data reading steps, the ground penetrating radar data is divided into data frames according to a fixed number of channels, and the data frame is used as the data granularity for one write and read. The storage pages include a homepage, a list page, and a data page; The homepage is page 0 of the storage space, which saves pagination information, test line format and acquisition information in a fixed format; the pagination information includes multiple list entries, with list entry 0 as the entry for the idle table and list entry 1 as the entry for the frame table; The list page is used to store data that has a sequential order and is of the same size, including frame table, page table and idle table. Each piece of data is called a list item. The page number of the next list page is recorded in the list header of each list page to realize the storage of an unlimited number of list items across multiple storage pages, and the page number of the 0th page of the list is used as the list entry. The data page is used to store the sampling data of the ground penetrating radar. Each frame of sampling data is divided into multiple data blocks according to the size of the storage page, and each block is saved to a different data page.

3. The method for reading and writing ground-penetrating radar data according to claim 1 or 2, characterized in that, The data writing step includes the following sub-steps: Step A1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width; calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width. Step A2: Write the data for each frame from the start frame to the end frame sequentially; Step A2 includes the following sub-steps: Step A21: Obtain the frame table entry corresponding to the current frame from the frame table, and determine whether the total number of frame table entries in the frame table is less than the frame number of this frame. If so, add a frame table entry and set the data length and page table entry in the new frame table entry to 0. If not, load the page table of this frame according to the page table entry in the frame table entry. When the page table entry is 0, construct an empty page table. Step A22: Extract the trace data belonging to this frame from the data to be written, and calculate the start trace number and end trace number within the frame; Step A23: Determine whether the frame already contains data and whether the start channel number or end channel number within the frame is not 0 or is not the data frame width. If so, read the existing data and merge the existing data with the data to be written to form a complete data frame to be written. If not, the data to be written will be treated as a complete data frame for writing; Step A24: Write this frame of data into the storage pages sequentially according to the page table; Step A25: Write the data length and page table entry of this frame into the corresponding frame table entry.

4. The method for reading and writing ground-penetrating radar data according to claim 3, characterized in that, In step A23, the process of merging existing data with data to be written is as follows: First, data is read sequentially according to each data page number of the page table and concatenated into complete data for this frame; then, according to the compression algorithm type of the test line format in the first page, the corresponding decompression algorithm is called to decompress the data of this frame; finally, according to the channel number in the frame, the number of channels in the test line format, and the number of samples, the position of the channel to be written in this frame data is obtained and written. In step A24, the process of sequentially writing to storage pages is as follows: First, based on the compression algorithm type of the test line format in the home page, the corresponding compression algorithm is called to compress the frame data; then, the compressed data is divided into multiple data pages according to the size of the storage page in the paging information, and it is determined whether the number of page table entries is less than the required number of data pages. If so, storage pages are requested and the data pages are sequentially appended to the page table; otherwise, the excess storage pages are released and the released storage pages are appended to the idle table for recycling; finally, the corresponding data pages are sequentially written to the corresponding storage pages according to each data page number in the page table.

5. The method for reading and writing ground-penetrating radar data according to claim 1 or 2, characterized in that, The data reading step includes the following sub-steps: Step B1: Calculate the frame number and corresponding intra-frame channel number of the starting frame by dividing the starting channel number by the data frame width; calculate the frame number and corresponding intra-frame channel number of the ending frame by dividing the ending channel number by the data frame width. Step B2: Read each frame of data from the start frame to the end frame sequentially; Step B3 involves concatenating the data extracted from each frame into a continuous multi-channel data stream to complete the reading process. Step B2 includes the following sub-steps: Step B21: Determine whether the total number of frame table entries is less than the frame number of this frame. If yes, end the reading process; otherwise, retrieve the corresponding frame table entry from the frame table. Step B22: Determine if the data length or page table entry in the frame table entry is 0. If yes, end the reading process; otherwise, load the page table of this frame according to the page table entry in the frame table entry. Step B23: Read the data sequentially according to each data page number of the page table and assemble them into the complete data of this frame; Step B24: Based on the compression algorithm type of the test line format on the homepage, call the corresponding decompression algorithm to decompress this frame of data.

6. The method for reading and writing ground-penetrating radar data according to claim 1 or 2, characterized in that, The list loading step includes the following sub-steps: Step C1: Determine if the list entry point on the homepage is 0. If yes, loading ends; otherwise, read the 0th list page based on the list entry point. Step C2: Read the list repeatedly until the next list page in the current list header is 0, then the loading ends.

7. The method for reading and writing ground-penetrating radar data according to claim 1 or 2, characterized in that, The step of adding a list item includes the following sub-steps: Step D1: First, subtract the size of the list header from the size of the storage page to obtain the difference. Then, divide the difference by the size of the list item to calculate the number of list items that each list page can hold. Divide the index of the list item to be added by the number of list items that each page can hold, round down to obtain the list page index corresponding to the list item, and take the remainder to obtain the position of the list item within the list page. Step D2: Determine if the number of list pages is less than the list page number of the list item. If yes, allocate list pages and append them to the list in sequence, and set the next list page in the list header of the last page as the allocated page number to complete the appending of list pages, then jump to step D3; otherwise, jump directly to step D3. Step D3: Write the list item data into the corresponding position according to the list page number and position within the list page of the corresponding list item; Step D4: Determine whether the total number of list items in the list header of page 0 of the list is less than the index of the added list item. If yes, change it to the index of the added list item; otherwise, end the process.

8. The method for reading and writing ground-penetrating radar data according to claim 1 or 2, characterized in that, The list item deletion step includes the following sub-steps: Step E1: Determine whether the total number of list items in the list header of page 0 of the list is less than the number of the list item to be deleted. If yes, then report that the deletion is complete; otherwise, proceed to step E2. Step E2: Loop through the list and move the data of each subsequent list item forward by one list item position; Step E3: Decrease the total number of list items in the list header of page 0 of the list by 1; Step E4: Calculate the number of list pages required to modify the list based on the total number of list items. If the required number of list pages is less than the current number of list pages, release the excess list pages.

9. A system for reading and writing ground-penetrating radar data, characterized in that, The method for reading and writing ground-penetrating radar data as described in any one of claims 1 to 8 is adopted, and includes: The data writing module is used to write ground penetrating radar data. It writes one or more consecutive ground penetrating radar data into the storage space in units of frames. By calculating the frame number, loading the frame table and page table, merging or writing data frames, and writing storage pages, it realizes the storage of ground penetrating radar data of variable length. The data reading module is used to read ground penetrating radar data. It reads one or multiple consecutive ground penetrating radar data from the storage space by calculating the frame number, reading the data sequentially, and splicing the data. The list loading module is used to load lists. It reads the list entry from the homepage and sequentially reads each list page until the last page of the list to complete the loading of list data. The list item addition module is used to add list items. By calculating the target position, allocating a new list page, writing list item data, and updating the list item's sequence number, new list items are added to the list, realizing the dynamic expansion of the list. The list item deletion module is used to delete list items, remove the list item with a specified index from the list, and free up redundant list pages; The list closing module is used to close the list. It writes the data of each list page in the list to the corresponding storage page in turn, and writes the 0th page of the list to the list entry on the homepage. The storage page allocation module is used to allocate new storage pages. First, it retrieves the last free page from the idle table as the new storage page; when the idle table is empty, it allocates a new storage page from the storage space.

10. A storage medium for ground-penetrating radar data, characterized in that, The storage medium employs the ground-penetrating radar data reading and writing method as described in any one of claims 1 to 8.