Method for searching recorded data file
Technical Field
The invention relates to the field of computer communication. And more particularly to a method of retrieving a recorded data file.
Background
When recording data on channels such as a network, a recording file with a frame superimposed is formed, and the problem of frame position must be solved when data decomposition is performed. One common method is to store the frame data in a fixed length in a record file when the record data is stored. This method is simple but must ensure that the fixed length is greater than the length of the recording frame and results in wasted storage controls.
Disclosure of Invention
To solve at least one of the above problems, a first aspect of embodiments of the present invention provides a method of recording a data file,
the processor records the data into a data file and generates a corresponding frame length information file when receiving a frame of data;
and the processor sends the data file and the frame length information file to a storage end so that the storage end correspondingly stores the data file and the frame length information file.
The frame length information file is used for storing the frame length information of the data.
The frame length information file and the data file have the same file name and different suffixes.
A second aspect of embodiments of the present invention provides a method of recording a data file, including,
and the storage end receives and stores a data file and a corresponding frame length information file which are generated by the processor according to each frame of data, wherein the frame length information file is used for storing the frame length information of the data file.
A third aspect of embodiments of the present invention provides a method for retrieving a parsed data file, comprising,
the processor receives and simultaneously opens a data file and a corresponding frame length information file sent by a storage end, and retrieves and decomposes the data file according to each frame length information in the frame length information file;
the frame length information file is used for storing the frame length information of the data;
the frame length information file and the data file have the same file name and different suffixes.
A fourth aspect of embodiments of the present invention provides a method of retrieving a parsed data file, comprising,
and the storage end sends the data file and the corresponding frame length information file to a processor so that the processor retrieves and decomposes the data file according to the frame length data in the frame length information file.
The frame length information file and the data file have the same file name and different suffixes.
A fifth aspect of an embodiment of the present invention provides a processor, including:
the data processing module is used for receiving data, recording the frame length information of the data into a frame length information file when a data file is received every time a frame of data is received;
and the data sending module is used for sending the frame length information file and the data file to a storage end.
A sixth aspect of embodiments of the present invention provides a memory device, including
The storage unit is used for storing data files and corresponding frame length information files.
The invention has the following beneficial effects:
the invention synchronously generates the frame length information file of the recording data file during data recording, and each frame length data corresponds to one frame of recording data. And synchronously opening the frame length information file when retrieving the recorded data file, and decomposing the data recording file according to the frame length data in the frame length information file. The problem of frame decomposition of the recorded data is solved, and the waste of storage space is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of a recording data file according to an embodiment of the present invention.
FIG. 2 illustrates a schematic diagram of retrieving a parsed data file in accordance with one embodiment of the present invention.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the following will describe the embodiments of the present invention in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a scenario architecture of a method for recording a data file in an embodiment of the present invention, including a processor and a storage terminal.
When data recording is carried out, data received by a processor is transmitted in the form of a plurality of data frames, and when the processor receives a frame of data, the processor records the data in a data file and synchronously records the frame length information of the data in a frame length information file; after the recording is finished, a recording data file and a corresponding frame length information file are generated, and the data file and the frame length information file are named as two files with the same name but different suffixes; the file name includes time information of the file, and thus the same name phenomenon does not occur. For example:
the processor records data A at twenty-three points of fifty-one month, fifty-five days and twenty-four days in 2020, and the file name of the data file is as follows: "a 202011051320. sql", the file name of the frame length information of the data file is: "A202011051320. txt". The file name suffix in this embodiment is only one of the actual use manners.
Fig. 2 is a scenario architecture of a method for retrieving a decomposed data file in an embodiment of the present invention, including a processor and a storage terminal.
When the data retrieval and decomposition are carried out, the processor receives and sends a data extraction instruction, receives a data file and a corresponding frame length information file from the memory, retrieves and decomposes the data file according to each frame length information in the frame length information file and sends the decomposed data file to the storage end, wherein,
the data file and the frame length information file are two files with the same name but different suffixes.
It should be understood that the above-mentioned embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention, and it will be obvious to those skilled in the art that other variations or modifications may be made on the basis of the above description, and all embodiments may not be exhaustive, and all obvious variations or modifications may be included within the scope of the present invention.