Real-time data storage method, device, equipment and storage medium
By establishing a suitable data file structure in node-type seismic acquisition instruments based on the acquisition frequency and memory card status, the efficiency and timeliness problems of conventional file systems in real-time data acquisition are solved, and efficient and realistic real-time data storage is achieved. .
Patent Information
- Application Number
- CN202210804294.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-07
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-07-07
AI Technical Summary
When node-type seismic acquisition instruments collect data in real time, frequent updates of conventional file systems affect work efficiency and it is difficult to ensure the timeliness and authenticity of the data.
By obtaining the collection frequency of the collection device, calculating the file length required within a specific time period, and determining and establishing a suitable data file based on the status of the memory card and existing data file information to ensure the continuity and fixity of the data file. Real-time data storage.
It ensures continuous storage and timeliness of data without affecting the real-time collection of seismic data, reduces additional operations during the collection process, and improves data authenticity and storage efficiency.
Smart Images

Figure CN115145875B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to a method, device, equipment and storage medium for real-time data storage. Background Art
[0002] During the operation of the node-type seismic acquisition instrument, the digital seismic data continuously recorded by the instrument needs to be saved in real time to the instrument's local non-volatile storage unit. The most popular method at present is to store the data in the form of files in a storage card with a file system established. However, in the conventional file system of the storage card, basic operations such as file creation, file data addition, and file deletion require updating the content of the relevant area of the file system. This frequent update of the file system takes a certain amount of time, which directly affects the working efficiency of the node-type seismic acquisition instrument and limits the real-time acquisition speed of the instrument. At the same time, this operation mode of establishing files while collecting, if the data written in the early stage is modified, deleted, or added by mistake in the later stage, it is difficult for the conventional file system to find it, and it is impossible to fundamentally guarantee the timeliness and authenticity of the seismic data. How to ensure that the data is continuously stored in the form of files without affecting the real-time acquisition of seismic data and ensuring the timeliness and authenticity of seismic data is a difficult problem that needs to be solved in the current development process of node-type seismic acquisition instruments. Summary of the invention
[0003] The purpose of the present invention is to provide a real-time data storage method to solve the problem of effectively storing the collected real-time data during the working process of the collection instrument.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In a first aspect, a method for real-time data storage is provided, comprising the following steps:
[0006] S1. Obtaining the acquisition frequency of the acquisition device, and calculating the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information; each real-time data collected in the specific time period occupies a corresponding data file;
[0007] S2, obtaining the current state of the memory card and information about the data files already in the memory card;
[0008] S3, determining information of the data file last used in the memory card according to the current state of the memory card and information of the existing data files;
[0009] S4, judging whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information; if it meets the requirement, directly taking the next data file of the last used data file as the currently available data file, and then proceeding to step S6; if it does not meet the requirement, proceeding to step S5;
[0010] S5, formatting the memory card, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files is allocated a continuous and fixed storage space; the data file in the first storage space position is the currently available data file;
[0011] S6, start acquiring collected data; determine whether the collection time of the current data matches the name of the currently available data file; if not, proceed to step S7; if matched, proceed to step S8;
[0012] S7, if they do not match, determine whether the currently available data file is the last one, if the currently available data file is the last one, use the data file at the front for circular storage, and the data file at the front is used as the next available data file; update the name of the next available data file to the time of the current data, so that the name of the next available data file matches the current data collection time, thereby, the next available data file becomes the currently available data file;
[0013] S8. Store the collected current data into the corresponding position of the currently available data file.
[0014] In a possible design, if the real-time data collection time of the current available data file is not adjacent to the real-time data collection time of the previous data file, the data is stored in the next data file of the current available data file, and then jumps to step S6.
[0015] In a possible design, in step S5, the method of formatting the memory card and then creating a plurality of data files according to the memory card capacity and the file length includes:
[0016] After the memory card is formatted, the root directory of the file system is at the beginning, the root directory of the file system is extended to a fixed length exceeding 1 cluster, and then several data files with blank content are created according to the memory card capacity and the required file length.
[0017] In one possible design, the specific time period is 1 hour.
[0018] In a possible design, in step S5, the names of the several data files created are marked with time.
[0019] In a possible design, in step S5, each created data file is allocated a continuous and fixed storage space, and the fixed storage space includes a storage space for the file length in each data file and a reserved storage space.
[0020] In a second aspect, the present invention provides a device for real-time data storage, comprising:
[0021] The acquisition frequency acquisition module is used to acquire the acquisition frequency of the acquisition device and transmit the acquisition frequency to the file length calculation module;
[0022] A file length calculation module, used to receive the acquisition frequency transmitted by the acquisition frequency acquisition module, calculate the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information, and transmit the required file length information to the file requirement judgment module;
[0023] The memory card information acquisition module is used to acquire the current memory card status information and the information of the existing data files in the memory card; and determine the information of the data file last used in the memory card according to the current memory card status and the information of the existing data files; and then transmit the information of the data file last used to the file requirement judgment module;
[0024] A file requirement judgment module is used to receive the file length transmitted by the file length calculation module and the information of the last used data file transmitted by the memory card information acquisition module, and judge whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information;
[0025] A data file creation module, used for formatting the memory card if the file requirement judgment module determines that the existing data file does not meet the acquisition frequency requirement, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files being allocated a continuous and fixed storage space; the data file at the first storage space position is the currently available data file;
[0026] The data acquisition module is used to acquire the real-time data and transmit the real-time data to the file name matching module;
[0027] The file name matching module is used to determine whether the collection time of the current data matches the name of the currently available data file when receiving the real-time data transmitted by the collection data acquisition module;
[0028] The data file position identification module is used to determine whether the current available data file is the last one when the file name matching module determines that the collection time of the current data does not match the name of the current available data file. If the current available data file is the last one, the data file at the front is used for circular storage, and the data file at the front is used as the next available data file;
[0029] a data file name modification module, for updating the name of the next available data file identified by the data file position identification module to the time of the current data when the file name matching module determines that the acquisition time of the current data does not match the name of the currently available data file; thereby, the next available data file becomes the currently available data file; and
[0030] A real-time data storage module is used to store the collected current data to the corresponding position of the currently available data file when the file name matching module determines that the collection time of the current data matches the name of the currently available data file;
[0031] When the file name matching module determines that the collection time of the current data does not match the name of the currently available data file, the collected current data is stored in the corresponding position of the currently available data file whose name has been modified by the data file name modification module.
[0032] In a possible design, it also includes a data collection time judgment module, which is used to determine whether the real-time data collection time of the current data file obtained by the data collection module and the real-time data collection time of the previous data file are adjacent time periods. If they are not adjacent time periods, the file name matching module is triggered to perform a name matching operation on the next available data file until the real-time data is stored.
[0033] In a third aspect, the present invention provides a storage device comprising a memory and a processor, wherein the memory and the processor are interconnected via a bus; the memory stores processor execution instructions; the processor executes the processor execution instructions stored in the memory, so that the processor executes the real-time data storage method as described in the first aspect and any possible design of the first aspect.
[0034] In a fourth aspect, the present invention provides a storage medium having instructions stored thereon, which, when executed on a processor, executes the method for real-time data storage as described in the first aspect and any possible design of the first aspect.
[0035] Beneficial effects:
[0036] 1. The present invention can be used for acquisition instruments, such as node-type seismic acquisition instruments, and a real-time storage method for continuously recording data. The seismic data acquired by the node-type seismic acquisition instrument in real time is continuously and cyclically stored in chronological order. By establishing a data file in advance and allocating a fixed and continuous storage space, it is realized that in the storage process of real-time continuous data, there is no need to update information such as file length and storage location. It is only necessary to store the data in the acquisition order, thereby ensuring that the integrity of the seismic data is not affected during the high-speed real-time acquisition process;
[0037] 2. The present invention customizes the root directory status in the file system by designing, so that the data file entries and storage locations are fixed, and the data files cannot be modified, deleted, added, etc. through other access interfaces, thereby ensuring the authenticity of the seismic data;
[0038] 3. The present invention reduces extra operations during the acquisition process, ensures the real-time data acquisition and storage quality of the node-type seismic acquisition instrument, and at the same time, the circular storage method can ensure that the data collected within a period of time is not overwritten. In long-term continuous acquisition work, it only needs to be read back within one cycle, which reduces the on-site workload and improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0040] Figure 1 A flow chart of a method for real-time data storage provided by the present invention;
[0041] Figure 2 A module connection diagram of a real-time data storage device provided by the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the description of these embodiments is intended to help understand the present invention, but does not constitute a limitation of the present invention. It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, the first unit can be referred to as the second unit, and similarly, the second unit can be referred to as the first unit, without departing from the scope of the exemplary embodiments of the present invention.
[0043] In the first aspect, Figure 1 As shown, this embodiment provides a method for real-time data storage, including the following steps:
[0044] S1. Obtaining the acquisition frequency of the acquisition device, and calculating the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information; each real-time data collected in the specific time period occupies a corresponding data file;
[0045] S2, obtaining the current state of the memory card and information about the data files already in the memory card;
[0046] S3, determining information of the data file last used in the memory card according to the current state of the memory card and information of the existing data files;
[0047] S4, judging whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information; if it meets the requirement, directly taking the next data file of the last used data file as the currently available data file, and then proceeding to step S6; if it does not meet the requirement, proceeding to step S5;
[0048] S5, formatting the memory card, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files is allocated a continuous and fixed storage space; the data file in the first storage space position is the currently available data file;
[0049] S6, start acquiring collected data; determine whether the collection time of the current data matches the name of the currently available data file; if not, proceed to step S7; if matched, proceed to step S8;
[0050] S7, if they do not match, determine whether the currently available data file is the last one, if the currently available data file is the last one, use the data file at the front for circular storage, and the data file at the front is used as the next available data file; update the name of the next available data file to the time of the current data, so that the name of the next available data file matches the current data collection time, thereby, the next available data file becomes the currently available data file;
[0051] S8. Store the collected current data into the corresponding position of the currently available data file.
[0052] In a possible implementation, if the real-time data collection time of the current data file is not in an adjacent time period to the real-time data collection time of the previous data file, the data is stored in the next available data file of the current available data file, and then the file name matching operation is jumped to until the real-time data storage operation.
[0053] In a possible implementation manner, the method of formatting the memory card and then creating a plurality of data files according to the memory card capacity and the file length includes:
[0054] After formatting the memory card, the root directory of the file system is at the beginning. The root directory of the file system is extended to a fixed length of more than 1 cluster, and then several data files with blank content are created according to the memory card capacity and the required file length. The root directory of the file system is extended to a fixed length of more than 1 cluster to prevent the memory card from being copied;
[0055] In specific implementation, the specific time period is 1 hour; the data file name is marked with time; and each data file has reserved storage space.
[0056] The specific example is as follows. This embodiment is applied to a node-type seismic acquisition instrument. The node-type seismic acquisition instrument occupies a data file for each hour of acquisition. The file name is marked with year, month, day and time. Each data file occupies the same size of continuous storage space. Before starting the acquisition, a fixed-length data file is established and continuous storage space is allocated. New unused files are marked in sequence according to the storage position with specific names. During the acquisition data storage process, it is only necessary to modify the file name and time information at the beginning of each hour. There is no need to modify the file length and storage address, find available space, update the data cluster chain and other operations. After the acquisition instrument system starts working, first obtain the acquisition frequency from the configuration information, and calculate the length of the data file according to the current sampling frequency; then obtain the current status of the storage card and the established data file information, determine whether the root directory length of the file system meets the requirements, determine the length of each data file, and determine the data file information used last and currently available by comparing the storage order and name of the file; determine whether the established data file in the storage card meets the current acquisition rate requirements; if not, format the storage card, the root directory of the file system is at the beginning, and only 1 cluster of space is allocated by default, and the root directory of the file system is extended to a fixed length of more than 1 cluster, According to the capacity of the memory card and the required file length, several data files with blank content are established, and about 5% of the storage space is reserved. Continuous and fixed storage space is allocated to each data file, and the data file in the first storage space position is the currently available file; after starting the collection, if the collection time matches the currently available data file, the collected data is stored in the currently available corresponding position according to the minutes and seconds in the hour; if the current file is the last one, the file at the front is used for cyclic storage, and the name of the data file to be used is updated to the current year, month, day and hour; if the collection time is a new hour, the data is stored in the next available data file.
[0057] In the second aspect, Figure 2As shown, this embodiment provides a real-time data storage device, including
[0058] The acquisition frequency acquisition module is used to acquire the acquisition frequency of the acquisition device and transmit the acquisition frequency to the file length calculation module;
[0059] A file length calculation module, used to receive the acquisition frequency transmitted by the acquisition frequency acquisition module, calculate the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information, and transmit the required file length information to the file requirement judgment module;
[0060] The memory card information acquisition module is used to acquire the current memory card status information and the information of the existing data files in the memory card; and determine the information of the data file last used in the memory card according to the current memory card status and the information of the existing data files; and then transmit the information of the data file last used to the file requirement judgment module;
[0061] A file requirement judgment module is used to receive the file length transmitted by the file length calculation module and the information of the last used data file transmitted by the memory card information acquisition module, and judge whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information;
[0062] A data file creation module, used for formatting the memory card if the file requirement judgment module determines that the existing data file does not meet the acquisition frequency requirement, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files being allocated a continuous and fixed storage space; the data file at the first storage space position is the currently available data file;
[0063] The data acquisition module is used to acquire the real-time data and transmit the real-time data to the file name matching module;
[0064] The file name matching module is used to determine whether the collection time of the current data matches the name of the currently available data file when receiving the real-time data transmitted by the collection data acquisition module;
[0065] The data file position identification module is used to determine whether the current available data file is the last one when the file name matching module determines that the collection time of the current data does not match the name of the current available data file. If the current available data file is the last one, the data file at the front is used for circular storage, and the data file at the front is used as the next available data file;
[0066] a data file name modification module, for updating the name of the next available data file identified by the data file position identification module to the time of the current data when the file name matching module determines that the acquisition time of the current data does not match the name of the currently available data file; thereby, the next available data file becomes the currently available data file; and
[0067] A real-time data storage module is used to store the collected current data to the corresponding position of the currently available data file when the file name matching module determines that the collection time of the current data matches the name of the currently available data file;
[0068] When the file name matching module determines that the collection time of the current data does not match the name of the currently available data file, the collected current data is stored in the corresponding position of the currently available data file whose name has been modified by the data file name modification module.
[0069] In a possible implementation, it also includes a data collection time judgment module, which is used to judge whether the real-time data collection time of the current data file acquired by the data acquisition module and the real-time data collection time of the previous data file are adjacent time periods. If they are not adjacent time periods, the file name matching module is triggered to perform a name matching operation on the next available data file until the real-time data is stored.
[0070] In the third aspect, the present embodiment provides a storage device, including a memory and a processor, wherein the memory and the processor are interconnected via a bus; the memory stores processor execution instructions; the processor executes the processor execution instructions stored in the memory, so that the processor executes the method of real-time data storage as described in the first aspect and any possible implementation of the first aspect. Specifically, the memory may include, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a flash memory, a first-in-first-out memory (FIFO) and / or a first-in-last-out memory (FILO), etc.; the processor may not be limited to a processor of the ARM, INTEL, 8051, MIPS, AVR series or other microprocessors and programmable devices; in addition, the device for anti-counterfeiting and confirmation of commodity rights may also include, but is not limited to, a power module, a display screen and other necessary components.
[0071] In a fourth aspect, this embodiment provides a storage medium, on which instructions are stored, and when the instructions are executed on a processor, the method for real-time data storage as described in the first aspect and any possible implementation of the first aspect is executed. The readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive and / or a memory stick, etc., and the processor may not be limited to a processor of the ARM, INTEL, 8051, MIPS and AVR series or other microprocessors or other programmable devices.
[0072] The fourth aspect of this embodiment provides the working process, working details and technical effects of the aforementioned storage medium, which can be referred to the interaction method described in the first aspect or any possible implementation manner of the first aspect, and will not be repeated here.
[0073] In a fifth aspect, the present embodiment provides a processor program product including instructions, which, when executed on a processor, causes the processor to execute the test report intelligent management method as described in the first aspect or any possible design of the first aspect. The processor may not be limited to processors of the ARM, INTEL, 8051, MIPS, and AVR series or other microprocessors or other programmable devices.
[0074] The embodiments described above are merely illustrative. If a unit described as a separate component is involved, it may or may not be physically separated; if a component shown as a unit is involved, it may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0075] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for real-time data storage, characterized in that: The following steps are involved: S1. Obtaining the acquisition frequency of the acquisition device, and calculating the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information; each real-time data collected in the specific time period occupies a corresponding data file; S2, obtaining the current state of the memory card and information about the data files already in the memory card; S3, determining information of the data file last used in the memory card according to the current state of the memory card and information of the existing data files; S4, judging whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information; if it meets the requirement, directly taking the next data file of the last used data file as the currently available data file, and then proceeding to step S6; if it does not meet the requirement, proceeding to step S5; S5, formatting the memory card, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files is allocated a continuous and fixed storage space; the data file at the first storage space position is a currently available data file; S6, start acquiring collected data; determine whether the collection time of the current data matches the name of the currently available data file; if they match, proceed to step S8; if not, proceed to step S7; S7, determining whether the currently available data file is the last one, if the currently available data file is the last one, using the data file at the front for circular storage, and the data file at the front is used as the next available data file; Update the name of the next available data file to the time of the current data, so that the name of the next available data file matches the current data collection time, thereby, the next available data file becomes the current available data file; S8. Store the collected current data into the corresponding position of the currently available data file.
2. The method for real-time data storage according to claim 1, characterized in that: If the real-time data collection time of the current available data file is not adjacent to the real-time data collection time of the previous data file, the data is stored in the next data file of the current available data file, and then jumps to step S6.
3. The method for real-time data storage according to claim 1, characterized in that: In step S5, the method of formatting the memory card and then creating a plurality of data files according to the memory card capacity and the file length includes: After the memory card is formatted, the root directory of the file system is at the beginning, the root directory of the file system is extended to a fixed length exceeding 1 cluster, and then several data files with blank content are created according to the memory card capacity and the required file length.
4. The method for real-time data storage according to claim 1, characterized in that: The specific time period is 1 hour.
5. The method for real-time data storage according to claim 1, characterized in that: In step S5, the names of the created data files are marked with time.
6. The method for real-time data storage according to claim 1, characterized in that: In step S5, each created data file is allocated a continuous and fixed storage space, wherein the fixed storage space includes a storage space for the file length of each data file and a reserved storage space.
7. A device for real-time data storage, characterized in that: include The acquisition frequency acquisition module is used to acquire the acquisition frequency of the acquisition device and transmit the acquisition frequency to the file length calculation module; A file length calculation module, used to receive the acquisition frequency transmitted by the acquisition frequency acquisition module, calculate the file length required when the real-time data collected in a specific time period is stored according to the acquisition frequency, thereby obtaining the required file length information, and transmit the required file length information to the file requirement judgment module; A memory card information acquisition module is used to acquire the current memory card status information and the information of the data files already in the memory card; and determining the information of the data file last used in the memory card according to the current state of the memory card and the information of the existing data files; and then transmitting the information of the data file last used to the file requirement judgment module; A file requirement judgment module is used to receive the file length transmitted by the file length calculation module and the information of the last used data file transmitted by the memory card information acquisition module, and judge whether the existing data file meets the acquisition frequency requirement according to the information of the last used data file and the required file length information; A data file creation module, used for formatting the memory card if the file requirement judgment module determines that the existing data file does not meet the acquisition frequency requirement, and then creating a number of data files according to the capacity of the memory card and the required file length information, each of the created data files being allocated a continuous and fixed storage space; the data file at the first storage space position is the currently available data file; The data acquisition module is used to acquire the real-time data and transmit the real-time data to the file name matching module; The file name matching module is used to determine whether the collection time of the current data matches the name of the currently available data file when receiving the real-time data transmitted by the collection data acquisition module; The data file position identification module is used to determine whether the current available data file is the last one when the file name matching module determines that the collection time of the current data does not match the name of the current available data file. If the current available data file is the last one, the data file at the front is used for circular storage, and the data file at the front is used as the next available data file; The data file name modification module is used to update the name of the next available data file identified by the data file position identification module to the time of the current data when the file name matching module determines that the collection time of the current data does not match the name of the current available data file; thereby, the next available data file becomes the current available data file; as well as A real-time data storage module is used to store the collected current data to the corresponding position of the currently available data file when the file name matching module determines that the collection time of the current data matches the name of the currently available data file; It is also used to store the collected current data to the corresponding position of the currently available data file whose name has been modified by the data file name modification module when the file name matching module determines that the collection time of the current data does not match the name of the currently available data file.
8. The real-time data storage device according to claim 7, characterized in that: It also includes a data collection time judgment module, which is used to judge whether the real-time data collection time of the current data file obtained by the data collection acquisition module is an adjacent time period to the real-time data collection time of the previous data file. If not, the file name matching module is triggered to perform a name matching operation on the next available data file until the real-time data is stored.
9. A storage device, characterized in that: It includes a memory and a processor, the memory and the processor are interconnected via a bus; the memory stores processor execution instructions; the processor executes the execution instructions stored in the memory, so that the processor executes the real-time data storage method as described in any one of claims 1 to 6.
10. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed on the processor, the real-time data storage method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Method and device for improving storage efficiency of audio and video data in video surveillance system
CN109189724A
Access apparatus and available storage space calculation method
US20120131301A1