CN101819602A - Method for implementing data file engine - Google Patents

Method for implementing data file engine Download PDF

Info

Publication number
CN101819602A
CN101819602A CN201010172057A CN201010172057A CN101819602A CN 101819602 A CN101819602 A CN 101819602A CN 201010172057 A CN201010172057 A CN 201010172057A CN 201010172057 A CN201010172057 A CN 201010172057A CN 101819602 A CN101819602 A CN 101819602A
Authority
CN
China
Prior art keywords
file
files
blocks
data
byte
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201010172057A
Other languages
Chinese (zh)
Inventor
陆舟
于华章
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Feitian Technologies Co Ltd
Original Assignee
Beijing Feitian Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Feitian Technologies Co Ltd filed Critical Beijing Feitian Technologies Co Ltd
Priority to CN201010172057A priority Critical patent/CN101819602A/en
Publication of CN101819602A publication Critical patent/CN101819602A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for implementing a data file engine, which belongs to the field of data processing. The method comprises a data file generation process and a data file resolving process, wherein the data file generation process comprises the following steps of: constructing a file header and a file block list of a data file; filling file identifier, version number, file creation time and final file modification time into the file header; filling file block type, Verify mark, file block alignment size, file block offset, file block size and aligned file block size into the file block list; filling file block number, file block list offset and CRC check codes into the file header; and writing user data into file blocks according to the file block offset. The data file resolving process comprises the following steps of: acquiring the data file; resolving the file header to acquire the file identifier, the file block number, the file block list offset and the CRC check codes; resolving the file block list according to the file block list offset to acquire the file block offset and the file block size; and resolving the file blocks according to the file block offset and the file block size to acquire file block contents.

Description

A kind of implementation method of data file engine
Technical field
The invention belongs to data processing field, relate in particular to a kind of implementation method of data file engine.
Background technology
Data file is to be used for the file of store data specially, is a kind of new construction data type, and it is that form with file is stored in a collection of data that are relative to each other on certain medium (as disk, CD etc.).It is again a kind of new file that is different from source files of program.The extension name of data file is usually titled with " .DAT " or " .TXT " etc.
The introducing of data file makes us can handle lot of data information easily.Because data file leaves on the disk, its length is not subjected to the restriction of internal memory, so be commonly used to handle information problems such as warehouse, books, finance account.In addition, we use data file can realize sharing of data.
Existing data file engine just analyzes and generates processing according to a certain set form to file, and do not support the file in the dynamic management operation, transplantability and ease for use are relatively poor, in case file layout to be processed and existing form is inequality or platform is more special, just need redesign and exploitation, waste of manpower, material resources.
Summary of the invention
At above-mentioned technological deficiency, a kind of implementation method of data file engine is now proposed, technical scheme is specific as follows:
A kind of implementation method of data file engine, described method comprise the generation of data file and resolve two processes:
The generative process of described data file is:
Construct the file header and the file block table of described data file;
File identification, version number, document creation time, the last modification time of file are filled in the described file header;
Blocks of files type, Verify mark, blocks of files alignment size, blocks of files side-play amount, blocks of files size, blocks of files alignment back size are filled in the described file block table;
Blocks of files quantity, file block table side-play amount, CRC check sign indicating number are filled in the described file header;
According to described blocks of files side-play amount, user data is written in the blocks of files of described data file.
The resolving of described data file is:
Obtain data file, described data file comprises file header, file block table, blocks of files;
File header in the described data file is resolved, obtain file identification, blocks of files quantity, file block table side-play amount, CRC check sign indicating number;
File block table side-play amount resolution file piece table according to described parsing obtains obtains blocks of files side-play amount, blocks of files size;
Resolve blocks of files according to blocks of files side-play amount and blocks of files size that described parsing obtains, obtain described blocks of files content.
File identification, version number, document creation time, the last modification time of file are filled in the described file header and are specially:
Fill file identification on first byte location in the file header of described structure;
On the next byte location of described file identification, fill version number;
From the next byte location of described version number begin to skip continuously comprise described version number next byte location behind five interior byte locations, fill the document creation time on continuous eight byte locations that the 6th byte location after described file identification begins;
On continuous eight byte locations that the next byte location of described document creation time begins, fill the last modification time of file;
Blocks of files type, Verify mark, blocks of files alignment size, blocks of files side-play amount, blocks of files size, blocks of files alignment back size are filled in the described file block table and are specially:
Fill the blocks of files type on first byte location in the file block table of described structure;
On the next byte location of described blocks of files type, fill the Verify mark;
From the next byte location of described Verify mark begin to skip continuously comprise described Verify mark next byte location behind two interior byte locations, fill blocks of files alignment size on continuous two byte locations that the 3rd byte location after described Verify mark begins;
On continuous four byte locations that the big or small next byte location of described blocks of files alignment begins, fill the blocks of files side-play amount;
On continuous four byte locations that the next byte location of described blocks of files side-play amount begins, fill the blocks of files size;
On continuous four byte locations that the next byte location of described blocks of files size begins, fill blocks of files alignment back size.
Blocks of files quantity, file block table side-play amount, CRC check sign indicating number are filled in the described file header and are specially:
On continuous two byte locations that the next byte location of described document creation time begins, fill blocks of files quantity;
On continuous two byte locations that the next byte location of described blocks of files quantity begins, fill the file block table side-play amount;
On continuous four byte locations that the next byte location of described file block table side-play amount begins, fill the CRC check sign indicating number.
According to described blocks of files side-play amount, described user data is written in the blocks of files of described data file, also comprise: whether the size of judging user data greater than described blocks of files size before,
If greater than, then return mistake;
Otherwise,, described user data is written in the described blocks of files according to described blocks of files side-play amount.
According to described blocks of files side-play amount, described user data be written in the described blocks of files be specially:
Judge that the filling mode that sets in advance is from offset of zero or the amount of specifying Offsets is written to described user data in the described blocks of files,
If the offset of zero place then from described blocks of files side-play amount, is written to described user data in the described blocks of files;
If the amount of specifying Offsets place, then calculate the arithmetic sum of described blocks of files side-play amount and the described amount of specifying Offsets, obtain first side-play amount, and, described user data is written in the described blocks of files from described first side-play amount.
Described user data is written in the described blocks of files is specially:
Described user data is carried out paging by the 4KB size handle, then, described user data is written in the described blocks of files by page or leaf.
Described method also comprises: file type, file header length are filled in the described file header.
File type, file header length are filled in the described file header and are specially:
Skip the next byte location of described version number, fill file type on continuous two byte locations that second byte location after described version number begins;
On continuous two byte locations that the next byte location of described file type begins, fill file header length.
Described file identification, version number, blocks of files alignment size are predefined;
Described document creation time, the last modification time of file, file type, blocks of files type, Verify mark, blocks of files size are obtained by computing machine;
Described file block table side-play amount determines that according to described file header length described file header length is fixed value;
Described blocks of files side-play amount is determined that by described file header length and file block table length described file block table length is fixed value.
File header in the described data file is resolved, obtains file identification, blocks of files quantity, file block table side-play amount, CRC check sign indicating number and be specially:
Obtain continuously according to first byte in the described data file and to comprise the data of described first byte, obtain the file identification in the file header of described data file at two interior byte lengths;
Skip continuously according to the next byte of described file identification comprise described file identification next byte after the data of 22 interior byte lengths, obtain the data of continuous two bytes that the 23 byte after described file identification begin, obtain the blocks of files quantity in the file header of described data file;
Obtain the next byte that comprises described blocks of files quantity data according to the next byte of described blocks of files quantity continuously, obtain the file block table side-play amount in the file header of described data file in two interior bytes;
Obtain next byte of comprising described file block table side-play amount data according to next byte of described file block table side-play amount, obtain the CRC check in the file header of described data file at interior continuous four byte lengths.
File block table side-play amount resolution file piece table according to described parsing obtains obtains the blocks of files side-play amount, the blocks of files size is specially:
From described file block table side-play amount, skip the data of six bytes continuously after, obtain since the data of continuous four bytes of the 7th byte, obtain the blocks of files side-play amount in the file block table of described data file;
Skip continuously according to the next byte of described blocks of files side-play amount and to comprise described blocks of files side-play amount after the data of four interior bytes, obtain since the data of continuous four bytes of the 5th byte, obtain the blocks of files size in the file block table of described data file.
Resolve blocks of files according to blocks of files side-play amount and blocks of files size that described parsing obtains, obtain described blocks of files content and be specially:
From described blocks of files side-play amount, obtain the byte data with the identical size of described blocks of files size, and the described byte data of obtaining is stored in the buffer zone.
The resolving of described data file also comprises:
Obtain the data of the next byte length of described file identification, obtain the version number in the file header;
And/or
Skip the next byte that comprises described file identification data in two interior bytes according to the next byte of described file identification, obtain the data that comprise after described file identification continuous two byte lengths that the 3rd byte begin, obtain the file type in the file header;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of four interior byte lengths, obtain the data of two byte lengths continuously, obtain the file header length in the file header;
Described file header length is used for quick locating file head and file block table;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of six interior byte lengths, obtain the data of eight byte lengths continuously, obtain the document creation time in the file header;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of 14 interior byte lengths, obtain the data of continuous eight byte lengths, obtain the last modification time of file in the file header;
Described method also comprises: judge whether the sign that presets in described file identification and the computing machine is consistent;
When judged result when being consistent, continue to obtain the version number in the file header of described data file;
When judged result when being inconsistent, end operation.
Described determination methods is specially:
The sign that presets in the described computing machine is changed through ASCII character, obtained the ASCII character sign of 16 systems;
Described file identification is compared with the ASCII character sign of described 16 systems;
If identical, then judged result is consistent;
If different, then judged result is inconsistent.
Described method also comprises: judge whether CRC check is correct,
If correct, continue to obtain the operation of the blocks of files side-play amount in the file block table of data file;
If incorrect, end operation.
The resolving of described data file also comprises:
From the file block table side-play amount, obtain the data of a byte length, obtain the blocks of files type in the file block table of described data file;
And/or
From described file block table side-play amount, skip after the data of a byte, obtain since the data of a byte of second byte, obtain the Verify mark in the file block table of described data file;
And/or
From described file block table side-play amount, skip after the data of four bytes, obtain since the data of continuous two bytes of the 5th byte, obtain the blocks of files alignment size in the file block table of described data file;
And/or
Obtain the data of four byte lengths of the next byte that comprises described blocks of files size continuously according to the next byte of described blocks of files size, obtain the blocks of files alignment back size in the file block table of described data file.
Beneficial effect:
Data file engine provided by the present invention has dirigibility, stability, transplantability three big fundamental characteristics, and the degree of coupling is low between basic characteristic and the advanced feature, changing the abstract mode of data, form of file or the like all only needs to revise corresponding sub-fraction code, has reduced the workload of safeguarding.
Description of drawings
Fig. 1 is the process flow diagram of the generation method of a kind of data file of providing of the embodiment of the invention 1;
Fig. 2 is the process flow diagram of the analytic method of a kind of data file of providing of the embodiment of the invention 2.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is further described below in conjunction with accompanying drawing.
Embodiment 1
The framework that table one has schematically provided data file of the present invention constitutes, and comprises file header, file block table, blocks of files, but is not subjected to the influence of file header, file block table, blocks of files composition order.
Table one
File header
File block table
Blocks of files
As shown in Table 1, file header has been described whole data file, includes but not limited in the following message one or multinomial: file identification (as " FT "), version number, file type, file header size Length, document creation time Creation time, the last modification time LastWriteTime of file, blocks of files quantity, file block table side-play amount, cyclic redundancy check (CRC) code CRC (Cyclic Redundancy Check).
File block table is deposited continuously, be used for the description document piece, blocks of files that its each bar has write down all unique correspondence, a record includes blocks of files type, Verify mark, blocks of files alignment size, blocks of files side-play amount, blocks of files size, blocks of files alignment back size.
Need to prove,, the blocks of files number of Verify mark and Verify will be set in file block table so if a blocks of files needs other auxiliary blocks that it is verified.
Blocks of files is used for store data, and it can be the part of single file, file or user-defined one piece of data etc.
Wherein, the file block table side-play amount has been located file block table, and the blocks of files side-play amount has been located blocks of files.
Wherein, file header byte length and file block table byte length are fixed, and are respectively 32 bytes and 18 bytes.
Referring to Fig. 1, present embodiment provides a kind of implementation method of data file engine, is used for user data is packaged into the data file (hereinafter to be referred as file) of above-mentioned form, comprising: dynamic generation and maintenance documentation head, file block table; At first, make up file structure figure, then, user data is written in the file; Wherein, file structure figure is the key map of file, include file head, file block table; File block table include file piece record; The blocks of files record is used for the description document piece, and corresponding one by one with blocks of files; File is discerned by file id, and blocks of files is discerned by blocks of files id.Concrete technical scheme is as follows:
Step 101: carry out initialization operation;
Particularly, check in the internal memory whether idle file id is arranged,, then discharge idle file id if having.
Step 102: create file, and file allocation file header and file block table for creating;
Particularly, the filename that provides according to the user, current directory (filename that provides does not comprise the path) or under assigned catalogue (filename that provides comprises the path) create file, if file of the same name exists, create again after then deleting described file of the same name;
Wherein, filename can be with any suffix, as .txt .doc etc., also can not be with suffix.
Specifically also comprise, be the unique file id of file allocation that creates.
Step 103: the application internal memory, for the file header and the file block table storage allocation space of above-mentioned distribution, construct file structure figure;
Wherein, file header in the structural drawing of structure and blocks of files tableau format are shown in table two and table three.
Table two
??Offset ??Size(Bytes) ??Description
??0x00 ??2 ??“FT”
??0x02 ??1 ??Version
??0x03 ??1 ??Reserve
??0x04 ??2 ??Files?Type
??0x06 ??2 ??Length
??0x08 ??8 ??CreationTime
??0x10 ??8 ??LastWriteTime
??0x18 ??2 ??Number?of?Sections
??0x1A ??2 ??SectionTables?Offset
??0x1C ??4 ??CRC(Check?Sum)
Table three
??Offset ??Size ??Description
??0x00 ??1(Bytes) ??Section?Type
??0x01 ??1 ??Verify?Flags
??0x02 ??1 ??0/Numbers(Verify)
??0x03 ??1 ??Reserve
??Offset ??Size ??Description
??0x04 ??2 ??SectionAlign
??0x06 ??4 ??SectionOffset
??0x0a ??4 ??Size?of?Original
??0x0e ??4 ??Size?of?Section
Step 104: fill file header and initialization files piece table;
Particularly, successively file identification, version number, file type, file header byte length Length, document creation time, the last modification time of file are filled into relevant position in the file header (table two) of structure.
Wherein, file identification, version number are predefined; Among the present invention, file identification is " FT ", version number is " 01 ".
Particularly, obtain file type, document creation time, the last modification time of file by computing machine, for example, file type be " JFIF ", the document creation time of obtaining is that " 2010.4.9 14:15:00 ", the last modification time of file are " 2010.4.9 17:22:00 ", and is converted into the relevant position that is filled into behind the sexadecimal in the file header.
Need to prove that file header length is under the situation of upgrading data file of the present invention, be used for quick locating file piece table and blocks of files; Generally use default value.
Need to prove that also the blocks of files quantity in the file header, file block table side-play amount, CRC check code field are filled to be 0 at this moment, recharge particular content when waiting until on disk spanned file.
Initialization files piece table is specially, and the content of file block table is filled to 0.
Step 105: obtain the descriptor of blocks of files, the file block table after the initialization is filled;
Particularly, successively that blocks of files type, Verify mark, blocks of files alignment size, blocks of files is big or small, blocks of files alignment back size is filled into the relevant position in the blocks of files record (table three);
Need explanation to be, the identification number of blocks of files type is predefined, for example, blocks of files SignatureSection is the signature block, type identification be " 0x01 ", blocks of files Rockey Info section is used to deposit key information, type identification be " 0x02 ", blocks of files Data Section is a block, type identification be " 0x03 ".As shown in Table 4:
Table four
??Value ??Description
??0x01 ??Signature?section
??0x02 ??Rockey?Info?section
??0x03 ??Data?section
??n ??Custom?section
Need to prove that also the Verify mark is predefined, for example, when blocks of files does not need other auxiliary blocks that it is carried out verification, Verify be labeled as " 0x00 ", when blocks of files was carried out verification to blocks of files self, Verify was labeled as " 0x01 " etc.As shown in Table 5:
Table five
??Value ??Description
??0x00 ??Not
??0x01 ??Self?Verify
??0x02 ??Other?Verify
??n ??Custom?Verify
Particularly, blocks of files type, Verify mark are obtained by computing machine.
Particularly, blocks of files alignment size is predefined, and in this example, blocks of files is with the alignment of 4KB size, part 0 polishing of promptly working as blocks of files data deficiencies 4KB.
For example, the blocks of files that the user provides is Signature Section, wherein, Signature Section is mainly used in file header and file block table is done anti-tamper verification, or particular file block done the deciphering verification, as doing deciphering usefulness to Data Section, then with the blocks of files type " 0x01 ", Verify mark " 0x02 ", blocks of files alignment size " 0x1000 ", and the actual size of Signature Section, as " 0x1024 " waits and is filled into corresponding position in the table three successively.
Again for example, the blocks of files that the user provides is Data Section, wherein, Data Section is used to deposit the data encrypted file, this document piece can be placed on the beginning or the end of file, be placed on the end place of file in this example, then with the blocks of files type " 0x03 ", Verify mark " 0x00 ", blocks of files alignment size " 0x1000 ", and the actual size of Data Section, as " 0x129c " etc. information be filled into corresponding position in the table three.
Need to prove, in file structure figure, can carry out such as operations such as adding, revise, enumerate, remove blocks of files.
Step 106, blocks of files quantity, file block table side-play amount, CRC sign indicating number are filled in the file header;
Particularly, the blocks of files quantity that provides according to the user is filled the blocks of files amount field in the file header, for example, the user only provides a blocks of files Data Section, then with " 0x01 " is filled in the blocks of files amount field in the file header, the user provides three blocks of files, then will " " it is medium to be filled in the file header file number of blocks field for 0x03.
Particularly, determine the file block table side-play amount according to the file header size, among the present invention, the file header byte-sized is 32 bytes, hexadecimal representation be " 0x20 ", then the file block table side-play amount is " 0x20 ";
Particularly, crc field be filled to file block table and blocks of files CRC check and;
Step 107: obtain user data, and judge whether the size of user data has exceeded the size of the blocks of files that will fill, if, then return mistake, otherwise, execution in step 108;
Particularly, the blocks of files id that provides according to the user determines the blocks of files that the user will fill, and read the blocks of files record of this document piece, judge according to the blocks of files size of describing in the blocks of files record that reads whether the size of data of obtaining has exceeded the size of the blocks of files that will fill, if the size of data of obtaining is greater than the blocks of files size described in the blocks of files record, the size of data of then obtaining has exceeded the default storage space of the blocks of files that the user will fill.
For example; The user will fill blocks of files Data Section; :46 57 53 05 ee d3 17 00 78 00 05 5f 00 00 0f a000 00 0c a9 2c 43 02 ff ff ff 1f 06 00 00 24 31 24 61 66 24 47 5a 45 6546 39 39 4c 37 4e 67 6d 36 53 72 38 39 79 64 54 55 30 00 86 04 27 26 9603 85 06 bf 00 29 00 00 00 01 00 7f 9e b7 51 1e b9 14 c8 80 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 85 f5e0 b6 36 69 e5 c8 da a9 a9 69 9b 86 02 6b 10 0b ed 49 f7 bd 30 05 a3 66ba 60 09 02 3d 89 c4 7d 74 67 2a 74 3f 15 ec 94 5e 3f 66 85 f5 e0 b6 3669 e5 c8 da a9 a9 69 9b 86 02 6b 10 0b ed 49 f7 bd 30 05 a3 66 ba 60 0902 3d 89 c4 7d 74 67 2a 74 3f 15 ec 94 5e 3f 66 00 96 02 00 08 00 1c 9605 00 07 06 00 00 00 49 12 9d 02 00 06 00 81 02 00 08 00 06 96 02 00 0800 1c 96 05 00 07 1d 00 00 00 49 12 9d 02 00 06 00 81 02 00 1f 00 06 9602 00 08 00 1c 96 05 00 07 3d 00 00 00 49 12 9d 02 00 06 00 81 02 00 3f00 06 96 02 00 08 00 1c 96 05 00 07 5d 00 00 00 49 12 9d 02 00 06 00 8102 00 60 00 06 00 91 06 16 0e 00 47 00 cd 19 99 a3 33 33 9b 0f 66 58 b901 40 00 00 00 16 0e 00 47 00 cd 19 99 a3 33 33 9b 0f 66 58 b9 01 40 0000 00 00 00 00 00 00 00 00 00 00 00 00 00; The size of data of then obtaining is 366 bytes; The blocks of files record of file reading piece Data Section as can be known; The blocks of files size of describing in the blocks of files record is the 0x129c byte, and the size of data of namely obtaining does not surpass the default memory space of blocks of files Data Section.
Particularly, can obtain the data that are used to fill that the user provides by computing machine.
Step 108: judge that the filling mode that the user sets in advance is any,
If the filling mode that the user is provided with is to fill from 0 skew of the blocks of files that will fill, then execution in step 109;
If the filling mode that the user is provided with is to fill from the specifying Offsets of blocks of files that will fill, then execution in step 110;
Step 109: the start offset amount that data write is set to the blocks of files side-play amount hereof that will fill, and execution in step 111 then;
Particularly, the blocks of files that fill side-play amount hereof can be by obtaining in the blocks of files record;
For example, the blocks of files Data Section side-play amount hereof that fill is " 0x32 ", then begins successively write in the blocks of files that will fill from side-play amount " 0x32 " the described data of obtaining;
Step 110: the start offset amount that data write be set to the blocks of files side-play amount hereof that will fill and the amount of specifying Offsets and;
For example, the blocks of files Data Section side-play amount hereof of filling is " 0x32 ", and the side-play amount of user's appointment be " 0x03 ", then the start offset amount that writes of data is " 0x35 ", that is, the data of obtaining are begun to be written in the blocks of files that will fill from side-play amount " 0x35 ".
Step 111: calculate obtain data can be divided into how many pages or leaves, and, be written to the data of obtaining in the blocks of files that will fill by page or leaf with the start offset amount of data of obtaining from writing;
Particularly, press the 4KB size and be paging unit, the data of obtaining are divided into the data block of a plurality of one page sizes and the tail data block of not enough one page size, then, several times the data of obtaining are begun to be written to the blocks of files that will fill from the start offset amount that writes by page or leaf, the partially filled of not enough one page size is 0.
Illustrate as follows:
Referring to table 6, the particular content of the picture file that the data in the table 6 provide for the user, this example specify the data file that how data encapsulation shown in the table 6 is become above-mentioned form, and wherein, the size of data in the table 6 is 0x129c.
Table 6
Offset address Data volume String representation
??0x0012DF40??0x00000010??0x00000020??0x00000030??0x00000040??0x00000050??0x00000060??0x00000070??0x00000080??0x00000090??0x000000A0??……………??0x00001200??0x00001210??0x00001220??0x00001230??0x00001240??0x00001250??0x00001260??0x00001270??0x00001280??0x00001290 ??ff?d8?ff?e0?00?10?4a?46?49?46?00?01?01?01?00?60??00?60?00?00?ff?db?00?43?00?08?06?06?07?06?05?08??07?07?07?09?09?08?0a?0c?14?0d?0c?0b?0b?0c?19?12??13?0f?14?1d?1a?1f?1e?1d?1a?1c?1c?20?24?2e?27?20??22?2c?23?1c?1c?28?37?29?2c?30?31?34?34?34?1f?27??39?3d?38?32?3c?2e?33?34?32?ff?db?00?43?01?09?09??09?0c?0b?0c?18?0d?0d?18?32?21?1c?21?32?32?32?32??32?32?32?32?32?32?32?32?32?32?32?32?32?32?32?32??32?32?32?32?32?32?32?32?32?32?32?32?32?32?32?32??32?32?32?32?32?32?32?32?32?32?32?32?32?32?32?32??00?11?08?00?3c?01?3c?03?01?22?00?02?11?01?03?11??……………………………………………………………??15?26?c1?ef?46?c1?ef?40?11?d1?52?6c?1e?f4?6c?1e??f4?01?1d?15?26?c1?ef?46?c1?ef?40?11?d1?52?6c?1e??f4?6c?1e?f4?01?1d?15?26?c1?ef?46?c1?ef?40?11?d1??52?6c?1e?f4?6c?1e?f4?01?1d?15?26?c1?ef?46?c1?ef??40?11?d1?52?6c?1e?f4?6c?1e?f4?01?1d?15?26?c1?ef??46?c1?ef?40?11?d1?52?6c?1e?f4?6c?1e?f4?01?1d?15??26?c1?ef?46?c1?ef?40?11?d1?52?6c?1e?f4?6c?1e?f4??01?1d?15?26?c1?ef?46?c1?ef?40?11?d1?52?6c?1e?f4??6c?1e?f4?01?1d?15?26?c1?ef?46?c1?ef?40?11?d4?a3??ee?8f?a5?26?c1?ef?4e?1c?0a?00?ff?d9 ??......JFIF.....`??.....C.........??.................??...........$.’??″,#..(7),01444.’??9=82<.342...C....??........2!.!2222??2222222222222222??2222222222222222??2222222222222222??....<.<..″......??.&..F..@..Rl..l.??....&..F..@..Rl.??.l.....&..F..@..??Rl..l.....&..F..??@..Rl..l.....&..??F..@..Rl..l.....??&..F..@..Rl..l..??...&..F..@..Rl..??l.....&..F..@...??...&..N.....
Step 201, application internal memory are constructed a file header and a file block table according to the form shown in table two and the table three in internal memory;
The data-bias start address is 0x00 in step 202, the file header, and the position of 2 byte lengths thereafter is filled to " FT ", the expression file identification;
Next data-bias address is 0x02 in step 203, the file header, and the position of a byte length thereafter is filled to " 0x01 ", the expression fileversion number;
Next data-bias address is 0x03 in step 204, the file header, and the position of a byte length thereafter is filled to " 0x00 ", and expression keeps;
Next data-bias address is 0x04 in step 205, the file header, and the position of 2 byte lengths thereafter is filled to " JFIF ", the expression file type;
Next data-bias address is 0x06 in step 206, the file header, and the position of 2 byte lengths thereafter is filled to " 0x00 ", expression file header length, and what adopt here is default value;
Next data-bias address is 0x08 in step 207, the file header, and the position of 8 byte lengths thereafter is filled to " fc 47 dc 8f 75 d1 ca 01 ", the expression document creation time;
Particularly, the document creation time that computing machine obtains is " 2010.4.9 14:15:00 ", be converted into hexadecimal representation and be " fc 47 dc 8f 75 d1 ca 01 ";
Next data-bias address is 0x10 in step 208, the file header, and the position of 8 byte lengths thereafter is filled to " 3c 24 26 f3 3d d1 ca 01 ", the last modification time of expression file;
Particularly, the last modification time of the file that computing machine obtains is " 2010.4.9 17:22:00 ", is converted into hexadecimal representation and is " 3c 24 26 f3 3d d1 ca 01 ";
Next data-bias address is 0x18 in step 209, the file header, and the position of 8 byte lengths thereafter is filled to 0;
Through above-mentioned steps, the file header after the filling is as follows:
??Offset ??Size(Bytes) ??Description
??0x00 ??2 ??“FT”
??0x02 ??1 ??01
??0x03 ??1 ??00
??0x04 ??2 ??JFIF
??0x06 ??2 ??00
??0x08 ??8 ??fc?47?dc?8f?75?d1?ca?01
??0x10 ??8 ??3c?24?26?f3?3d?d1?ca?01
??0x18 ??2 ??00
??0x1A ??2 ??00
??0x1C ??4 ??00
The data start offset address is " 0x00 " in step 210, the file block table, and the position of 1 byte length thereafter is filled to " 0x03 ", expression blocks of files type;
In step 212, the file block table next data-bias address be " 0x01 ", the position of 1 byte length thereafter is filled to " 0x00 ", expression Verify mark;
In step 213, the file block table next data-bias address be " 0x02 ", the position of 1 byte length thereafter is filled to 0, the blocks of files of expression Verify mark number;
In step 214, the file block table next data-bias address be " 0x03 ", the position of 1 byte length thereafter is filled to 0, expression keeps;
In step 215, the file block table next data-bias address be " 0x04 ", the position of 2 byte lengths thereafter is filled to " 0x1000 ", expression blocks of files alignment size, blocks of files is with the alignment of 4KB size in this example;
In step 216, the file block table next data-bias address be " 0x06 ", the position of 2 byte lengths thereafter is filled to 0;
In step 217, the file block table next data-bias address be " 0x0a ", the position of 4 byte lengths thereafter is filled to " 0x129c ", expression blocks of files original length, the i.e. true length of data shown in the table 6;
In step 218, the file block table next data-bias address be " 0x0e ", the position of 4 byte lengths thereafter is filled to " 0x1000 ", expression blocks of files alignment back size;
Pass through step 210 after 217, the file block table after obtaining filling, as follows:
??Offset ??Size ??Description
??0x00 ??1(Bytes) ??03
??0x01 ??1 ??00
??0x02 ??1 ??00
??0x03 ??1 ??00
??0x04 ??2 ??1000
??0x06 ??4 ??32
??0x0a ??4 ??129c
??0x0e ??4 ??1000
Blocks of files amount in step 219, the polishing file header, file block table side-play amount, CRC code field;
The user only provides a blocks of files as shown in table 6 in the present embodiment, thus in the file header file number of blocks field be filled to " 0x01 "; The file header size is " 0x20 ", then the file block table offset field is filled to " 0x20 "; CRC be file block table and blocks of files CRC check and, for " 0x7854AB3C "; Then the file header behind the polishing is as follows:
??Offset ??Size(Bytes) ??Description
??0x00 ??2 ??“FT”
??0x02 ??1 ??01
??0x03 ??1 ??00
??0x04 ??2 ??JFIF
??Offset ??Size(Bytes) ??Description
??0x06 ??2 ??00
??0x08 ??8 ??fc?47?dc?8f?75?d1?ca?01
??0x10 ??8 ??3c?24?26?f3?3d?d1?ca?01
??0x18 ??2 ??20
??0x1A ??2 ??01
??0x1C ??4 ??7854AB3C
Step 220, the file header after 0 skew place of disk file writes filling, the file block table after 0x20 skew place writes filling writes data in the table 6 in 0x32 skew place.
Need to prove, when the data with table 6 are written in the file, the data in the table 6 are pressed the paging of 4KB size after, write the part of not enough 4KB size 0 polishing successively by page or leaf.
The generation method of a kind of data file that the embodiment of the invention provides, data file is made up of file header, file block table, blocks of files three parts, hereof position of each several part, alignment thereof etc. can arbitrarily be distributed according to actual needs, mode is flexible and changeable, at any time according to market demand the data file content is adjusted paying under the less cost, in addition, data file of the present invention can compatible all types of data files and and platform independence.
Embodiment 2
The file header of data file is according to the needs to the data document analysis, except comprising file identification, file block table side-play amount, blocks of files quantity, cyclic redundancy check (CRC) code CRC (Cyclic Redundancy Check), can also comprise in version number, file type, file header length, document creation time, the last modification time of file any one or a plurality of; The file block table of data file is according to the needs that blocks of files is resolved, except comprising blocks of files side-play amount, blocks of files with how many byte-aligned, the blocks of files size, can also comprise in the size after Verify mark, blocks of files type, the blocks of files alignment any one or a plurality of.File header with data file in the present embodiment is made up of file identification, file block table side-play amount, blocks of files quantity, CRC; File block table becomes example explanation by blocks of files side-play amount, blocks of files with how many byte-aligned, blocks of files size groups.
Referring to Fig. 2, the embodiment of the invention provides a kind of data file engine, and by 16 systems and ASCII character table are carried out effectively in conjunction with coming the resolution data file.Concrete technical scheme is as follows:
Step 301: obtain data file, obtain the file identification in the file header of this data file;
Particularly, can be by obtaining data file in the computing machine.
Particularly, data file is made up of file header, file block table, blocks of files, and wherein, file block table is made up of the blocks of files record, the storage continuously of blocks of files record, and the blocks of files record is used to describe the corresponding file piece.
The method that obtains the file identification in the file header of this data file is specially: obtain the data of 2 byte lengths that comprise the 1st byte in this data file continuously, obtain the file identification in the file header of this data file.
Step 302: the file identification that presets in the file identification that obtains in the step 301 and the computing machine is compared,
If consistent, then execution in step 303;
If inconsistent, EO then.
Wherein, meeting storaging mark in the computing machine, this sign at first will obtain the ASCII character sign of 16 systems through the ASCII character conversion, the file identification of acquisition in the step 301 and the ASCII character sign of this 16 system is compared again.
Step 303: obtain blocks of files quantity, file block table side-play amount, CRC check in the file header of this data file;
Wherein, after beginning to skip the data of 22 bytes continuously by the next byte of the file identification in the step 301, obtain since the data of continuous 2 bytes that comprise the 23rd byte of the 23rd byte, obtain the blocks of files quantity in the file header of data file; Begin to obtain continuously the data of continuous 2 bytes of the next byte that comprises the file block table size by the next byte of file block table size, obtain the blocks of files side-play amount in the file header of this data file; From the next byte of this document block offset, obtain the data of 4 bytes of the next byte that comprises this document block offset, obtain the CRC in the file header of data file.
Here need to prove that the version number in the file header of data file can be obtained by 1 byte data after the file identification; Reservation item Reserve in the file header of data file can be obtained by a byte data after the version number; File type in the file header of data file can be obtained by two byte datas after the Reserve; File header length in the file header of data file can be obtained by two byte datas after the file type; The document creation time can be obtained by 8 byte datas after the blocks of files head length degree; The last modification time of file can be obtained by 8 byte datas after the document creation time;
Wherein, can be according to file header length quick locating file piece table and blocks of files.
Step 304: whether CRC is correct in checking, if correct, execution in step 305, otherwise, EO;
Need to prove that CRC provides the simplest a kind of verification mode, mainly is in order fast file header to be carried out verification, in case of necessity, can to select to carry out senior anti-tamper verification with a specific verification block.
For example, can introduce the notion of signature block Signature Section, this signature block can be done anti-tamper verification to file header and file block table, also can do deciphering verification etc. to specific blocks of files, as blocks of files Rockey Info Section is decrypted.
Step 305: the file block table side-play amount of obtaining from step 303 begins, and obtains the blocks of files side-play amount of blocks of files in this data file;
Particularly, from the file block table side-play amount, skip 6 byte datas continuously after, obtain continuous 4 byte datas that comprise the 7th byte since the 7th byte, obtain the blocks of files side-play amount;
Step 306: obtain blocks of files in the file block table of this data file with how many byte-aligned, blocks of files size;
Particularly, from the file block table side-play amount, skip 4 byte datas continuously after, obtain continuous 2 byte datas that comprise the 5th byte since the 5th byte, obtain blocks of files with how many byte-aligned; The blocks of files size can be obtained by 4 bytes after the blocks of files side-play amount.
Need to prove that from the file block table side-play amount, the 1st byte data of obtaining is the blocks of files type; Verify, Verify Flags can be obtained by 2 byte datas after the blocks of files type; Reserve can be obtained by 1 byte data after the Verify; Size after the blocks of files alignment can be obtained by 4 byte datas after the blocks of files size.
Step 307: the blocks of files side-play amount of obtaining from step 306 begins, obtain continuously with step 306 in the byte data of the identical size of blocks of files size obtained, and the data of obtaining are saved in the buffer zone.
Need to prove, if the size of the data of obtaining less than with the blocks of files size, then according to the alignment thereof of the blocks of files of obtaining in the step 306, that the part of not enough blocks of files size in the data of obtaining is neat with spot patch with how many byte-aligned.
Illustrate as follows:
Referring to table 7, provided the example of the data file of intercepting and capturing by computing machine in the table 7, wherein the intercepting of data is laterally intercepting successively in the data file.
Need to prove that what the memory module of data adopted in the table 7 is to hold memory module greatly.
Table 7
Figure GSA00000118391200191
According to the data file shown in the table 7, the method for resolution data file can comprise referring to Fig. 2:
Step 401: the data-bias start address is 0x000000, obtains the data of 2 byte lengths thereafter, i.e. 46 54 of the 16 systems file identifications as data file.
Can obtain by the ASCII character table: the data correspondence of these 2 byte lengths be " FT ";
Step 402: the sign " FT " that presets in the computing machine is changed through ASCII character, and the ASCII character that obtains 16 systems identifies 46 54; The sign that is converted in the sign of 16 systems that obtain in the step 401 and the step 402 is compared, and these two signs are consistent as can be known, execution in step 403;
Step 403: next data-bias address is 0x000002 in the data file, gets the data of 1 byte length thereafter, the version number of 01 expression data file of 16 systems.
Step 404: next data-bias address is 0x000003 in the data file, gets the data of 1 byte length thereafter, obtains 00 expression Reserve of 16 systems;
Step 405: next data-bias address is 0x000004 in the data file, gets the data of 2 byte lengths thereafter, obtains 01 00 expression file types of 16 systems;
Step 406: next data-bias address is 0x000006 in the data file, gets the data of 2 byte lengths thereafter, obtains 00 10 expression blocks of files head length degree of 16 systems;
Step 407: next data-bias address is 0x000008 in the data file, gets the data of 8 byte lengths thereafter, obtains the 47 dc 8f 01 expression document creation times of 75 d1 ca of fc of 16 systems.
Step 408: next data-bias address is 0x0000010 in the data file, gets the data of 8 byte lengths thereafter, obtains the last modification time of 3c 24 26 f3 3d d1 ca, 01 expression file of 16 systems;
Step 409: next data-bias address is 0x000018 in the data file, gets the data of 2 byte lengths thereafter, obtains 01 00 of 16 systems, expression blocks of files quantity;
Step 410: next data-bias address is 0x00001a in the data file, gets the data of 2 byte lengths thereafter, obtains 20 00 expression file block table skew reference positions of 16 systems;
Step 411: the next data-bias address in the data file is 0x00001c, gets the data of 4 byte lengths thereafter, and 08 fc, 32 b8 that obtain 16 systems represent CRC;
Whether step 412: it is correct to obtain CRC check in the determining step 411;
After receiving file header information 46 54 01 00 01 00 00 10 fc 47dc 8f75 d1 ca 01 3c 24 26 f3 8d d1 ca 01 01 00 20 00 08 fc 32 b8 that have the CRC check sign indicating number, the generated code that both sides are pre-set is done binary division, and eliminating then, the supporting paper header is correct; Be divided in this step.
Step 413: by step 410 as can be known the start offset address of the file block table of data file be 0x00000020, the data that begin to get a byte length thereafter by this offset address, i.e. 03 of 16 systems expression blocks of files type;
Step 414: the next data-bias address in the data file is 0x00000021, gets the data of a byte length thereafter, obtains 00 of 16 systems, expression blocks of files Verify mark;
Step 415: the next data-bias address in the data file is 0x00000022, gets the data of a byte length thereafter, obtains 00 of 16 systems, the blocks of files of expression blocks of files Verify mark number;
Step 416: the next data-bias address in the data file is 0x00000023, gets the data of a byte length thereafter, obtains 00 of 16 systems, and expression keeps item;
Step 417: the next data-bias address in the data file is 0x00000024, gets the data of 2 byte lengths thereafter, obtains 00 02 of 16 systems, and the expression blocks of files is with how many byte-aligned;
Step 418: the next data-bias address in the data file is 0x00000026, gets the data of 4 byte lengths thereafter, obtains 32 00 00 00 of 16 systems, expression blocks of files side-play amount;
Step 419: the next data-bias address in the data file is 0x0000002a, gets the data of 4 byte lengths thereafter, obtains 62 01 00 00 of 16 systems, expression blocks of files size;
Step 320: the next data-bias address in the data file is 0x0000002e, gets the data of 4 byte lengths thereafter, obtains 00 02 00 00 of 16 systems, the size after the alignment of expression blocks of files;
Step 414:by step 418 as can be known in the data file start offset address of blocks of files be 0x00000032, begin reading of data backward from this start offset address, the hexadecimal representation of the raw data size of blocks of files is 62 01 00 00; Insufficient section is neat with spot patch; Data after obtaining resolving; :46 57 53 05 ee d317 00 78 00 05 5f 00 00 0f a0 00 00 0c a9 2c 43 02 ff ff ff 1f 06 00 0024 31 24 61 66 24 47 5a 45 65 46 39 39 4c 37 4e 67 6d 36 53 72 38 39 7964 54 55 30 00 86 04 27 26 96 03 85 06 bf 00 29 00 00 00 01 00 7f 9e b751 1e b9 14 c8 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 85 f5 e0 b6 36 69 e5 c8 da a9 a9 69 9b 86 02 6b10 0b ed 49 f7 bd 30 05 a3 66 ba 60 09 02 3d 89 c4 7d 74 67 2a 74 3f 15ec 94 5e 3f 66 85 f5 e0 b6 36 69 e5 c8 da a9 a9 69 9b 86 02 6b 10 0b ed49 f7 bd 30 05 a3 66 ba 60 09 02 3d 89 c4 7d 74 67 2a 74 3f 15 ec 94 5e3f 66 00 96 02 00 08 00 1c 96 05 00 07 06 00 00 00 49 12 9d 02 00 06 0081 02 00 08 00 06 96 02 00 08 00 1c 96 05 00 07 1d 00 00 00 49 12 9d 0200 06 00 81 02 00 1f 00 06 96 02 00 08 00 1c 96 05 00 07 3d 00 00 00 4912 9d 02 00 06 00 81 02 00 3f 00 06 96 02 00 08 00 1c 96 05 00 07 5d 0000 00 49 12 9d 02 00 06 00 81 02 00 60 00 06 00 91 06 16 0e 00 47 00 cd19 99 a3 33 33 9b 0f 66 58 b9 01 40 00 00 00 16 0e 00 47 00 cd 19 99 a333 33 9b 0f 66 58 b9 01 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00,。
Similar in the parsing of other data files and the foregoing description, do not do at this and to give unnecessary details.
The embodiment of the invention provides a kind of method of resolution data file, by analysis to data file itself, the source code that need not know this data file just can obtain data from data file, no matter the kind of the file layout of data file, can use analytic method provided by the invention to come the resolution data file, improve the efficient of document analysis.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (18)

1. the implementation method of a data file engine is characterized in that, described method comprises the generation of data file and resolves two processes:
The generative process of described data file is:
Construct the file header and the file block table of described data file;
File identification, version number, document creation time, the last modification time of file are filled in the described file header;
Blocks of files type, Verify mark, blocks of files alignment size, blocks of files side-play amount, blocks of files size, blocks of files alignment back size are filled in the described file block table;
Blocks of files quantity, file block table side-play amount, CRC check sign indicating number are filled in the described file header;
According to described blocks of files side-play amount, user data is written in the blocks of files of described data file;
The resolving of described data file is:
Obtain data file, described data file comprises file header, file block table, blocks of files;
File header in the described data file is resolved, obtain file identification, blocks of files quantity, file block table side-play amount, CRC check sign indicating number;
File block table side-play amount resolution file piece table according to described parsing obtains obtains blocks of files side-play amount, blocks of files size;
Resolve blocks of files according to blocks of files side-play amount and blocks of files size that described parsing obtains, obtain described blocks of files content.
2. method according to claim 1 is characterized in that, file identification, version number, document creation time, the last modification time of file are filled in the described file header and are specially:
Fill file identification on first byte location in the file header of described structure;
On the next byte location of described file identification, fill version number;
From the next byte location of described version number begin to skip continuously comprise described version number next byte location behind five interior byte locations, fill the document creation time on continuous eight byte locations that the 6th byte location after described file identification begins;
On continuous eight byte locations that the next byte location of described document creation time begins, fill the last modification time of file.
3. method according to claim 1 is characterized in that, blocks of files type, Verify mark, blocks of files alignment size, blocks of files side-play amount, blocks of files size, blocks of files alignment back size are filled in the described file block table and are specially:
Fill the blocks of files type on first byte location in the file block table of described structure;
On the next byte location of described blocks of files type, fill the Verify mark;
From the next byte location of described Verify mark begin to skip continuously comprise described Verify mark next byte location behind two interior byte locations, fill blocks of files alignment size on continuous two byte locations that the 3rd byte location after described Verify mark begins;
On continuous four byte locations that the big or small next byte location of described blocks of files alignment begins, fill the blocks of files side-play amount;
On continuous four byte locations that the next byte location of described blocks of files side-play amount begins, fill the blocks of files size;
On continuous four byte locations that the next byte location of described blocks of files size begins, fill blocks of files alignment back size.
4. method according to claim 1 is characterized in that, blocks of files quantity, file block table side-play amount, CRC check sign indicating number are filled in the described file header and are specially:
On continuous two byte locations that the next byte location of described document creation time begins, fill blocks of files quantity;
On continuous two byte locations that the next byte location of described blocks of files quantity begins, fill the file block table side-play amount;
On continuous four byte locations that the next byte location of described file block table side-play amount begins, fill the CRC check sign indicating number.
5. method according to claim 1 is characterized in that, according to described blocks of files side-play amount, described user data is written in the blocks of files of described data file, also comprises before: whether the size of judging user data greater than described blocks of files size,
If greater than, then return mistake;
Otherwise,, described user data is written in the described blocks of files according to described blocks of files side-play amount.
6. method according to claim 5 is characterized in that, according to described blocks of files side-play amount, described user data is written in the described blocks of files is specially:
Judge that the filling mode that sets in advance is from offset of zero or the amount of specifying Offsets is written to described user data in the described blocks of files,
If the offset of zero place then from described blocks of files side-play amount, is written to described user data in the described blocks of files;
If the amount of specifying Offsets place, then calculate the arithmetic sum of described blocks of files side-play amount and the described amount of specifying Offsets, obtain first side-play amount, and, described user data is written in the described blocks of files from described first side-play amount.
7. method according to claim 6 is characterized in that, described user data is written in the described blocks of files be specially:
Described user data is carried out paging by the 4KB size handle, then, described user data is written in the described blocks of files by page or leaf.
8. method according to claim 1 is characterized in that, described method also comprises: file type, file header length are filled in the described file header.
9. method according to claim 8 is characterized in that, file type, file header length are filled in the described file header and are specially:
Skip the next byte location of described version number, fill file type on continuous two byte locations that second byte location after described version number begins;
On continuous two byte locations that the next byte location of described file type begins, fill file header length.
10. according to the described method of claim 1 to 9, it is characterized in that described file identification, version number, blocks of files alignment size are predefined;
Described document creation time, the last modification time of file, file type, blocks of files type, Verify mark, blocks of files size are obtained by computing machine;
Described file block table side-play amount determines that according to described file header length described file header length is fixed value;
Described blocks of files side-play amount is determined that by described file header length and file block table length described file block table length is fixed value.
11. method according to claim 1 is characterized in that, the file header in the described data file is resolved, and obtains file identification, blocks of files quantity, file block table side-play amount, CRC check sign indicating number and is specially:
Obtain continuously according to first byte in the described data file and to comprise the data of described first byte, obtain the file identification in the file header of described data file at two interior byte lengths;
Skip continuously according to the next byte of described file identification comprise described file identification next byte after the data of 22 interior byte lengths, obtain the data of continuous two bytes that the 23 byte after described file identification begin, obtain the blocks of files quantity in the file header of described data file;
Obtain the next byte that comprises described blocks of files quantity data according to the next byte of described blocks of files quantity continuously, obtain the file block table side-play amount in the file header of described data file in two interior bytes;
Obtain next byte of comprising described file block table side-play amount data according to next byte of described file block table side-play amount, obtain the CRC check in the file header of described data file at interior continuous four byte lengths.
12. method according to claim 1 is characterized in that, the file block table side-play amount resolution file piece table according to described parsing obtains obtains the blocks of files side-play amount, the blocks of files size is specially:
From described file block table side-play amount, skip the data of six bytes continuously after, obtain since the data of continuous four bytes of the 7th byte, obtain the blocks of files side-play amount in the file block table of described data file;
Skip continuously according to the next byte of described blocks of files side-play amount and to comprise described blocks of files side-play amount after the data of four interior bytes, obtain since the data of continuous four bytes of the 5th byte, obtain the blocks of files size in the file block table of described data file.
13. method according to claim 1 is characterized in that, resolves blocks of files according to blocks of files side-play amount and blocks of files size that described parsing obtains, obtains described blocks of files content and is specially:
From described blocks of files side-play amount, obtain the byte data with the identical size of described blocks of files size, and the described byte data of obtaining is stored in the buffer zone.
14. method according to claim 1 is characterized in that, the resolving of described data file also comprises:
Obtain the data of the next byte length of described file identification, obtain the version number in the file header;
And/or
Skip the next byte that comprises described file identification data in two interior bytes according to the next byte of described file identification, obtain the data that comprise after described file identification continuous two byte lengths that the 3rd byte begin, obtain the file type in the file header;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of four interior byte lengths, obtain the data of two byte lengths continuously, obtain the file header length in the file header;
Described file header length is used for quick locating file head and file block table;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of six interior byte lengths, obtain the data of eight byte lengths continuously, obtain the document creation time in the file header;
And/or
Skip according to the next byte of described file identification comprise described file identification next byte after the data of 14 interior byte lengths, obtain the data of continuous eight byte lengths, obtain the last modification time of file in the file header.
15. method according to claim 1 is characterized in that, described method also comprises: judge whether the sign that presets in described file identification and the computing machine is consistent;
When judged result when being consistent, continue to obtain the version number in the file header of described data file;
When judged result when being inconsistent, end operation.
16. method according to claim 15 is characterized in that, described determination methods is specially:
The sign that presets in the described computing machine is changed through ASCII character, obtained the ASCII character sign of 16 systems;
Described file identification is compared with the ASCII character sign of described 16 systems;
If identical, then judged result is consistent;
If different, then judged result is inconsistent.
17. method according to claim 1 is characterized in that, described method also comprises: judge whether CRC check is correct,
If correct, continue to obtain the operation of the blocks of files side-play amount in the file block table of data file;
If incorrect, end operation.
18. method according to claim 1 is characterized in that, the resolving of described data file also comprises:
From the file block table side-play amount, obtain the data of a byte length, obtain the blocks of files type in the file block table of described data file;
And/or
From described file block table side-play amount, skip after the data of a byte, obtain since the data of a byte of second byte, obtain the Verify mark in the file block table of described data file;
And/or
From described file block table side-play amount, skip after the data of four bytes, obtain since the data of continuous two bytes of the 5th byte, obtain the blocks of files alignment size in the file block table of described data file;
And/or
Obtain the data of four byte lengths of the next byte that comprises described blocks of files size continuously according to the next byte of described blocks of files size, obtain the blocks of files alignment back size in the file block table of described data file.
CN201010172057A 2010-05-07 2010-05-07 Method for implementing data file engine Pending CN101819602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010172057A CN101819602A (en) 2010-05-07 2010-05-07 Method for implementing data file engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010172057A CN101819602A (en) 2010-05-07 2010-05-07 Method for implementing data file engine

Publications (1)

Publication Number Publication Date
CN101819602A true CN101819602A (en) 2010-09-01

Family

ID=42654699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010172057A Pending CN101819602A (en) 2010-05-07 2010-05-07 Method for implementing data file engine

Country Status (1)

Country Link
CN (1) CN101819602A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235829A (en) * 2013-05-14 2013-08-07 厦门市美亚柏科信息股份有限公司 Method and device for uncompressing random address register (RAR) file
CN103310158A (en) * 2013-06-14 2013-09-18 大唐移动通信设备有限公司 File processing method and device
CN103530141A (en) * 2012-07-06 2014-01-22 河南思维自动化设备股份有限公司 Vehicle data updating method and vehicle data updating system
CN103902337A (en) * 2014-03-14 2014-07-02 北京金山网络科技有限公司 Data download method and device
CN104092780A (en) * 2014-07-29 2014-10-08 中国联合网络通信集团有限公司 File modification method and device and monofile synchronization method and device based on file blocks
CN104572153A (en) * 2013-10-23 2015-04-29 上海汽车集团股份有限公司 Update data conversion method for vehicle updating
CN104766018A (en) * 2014-01-06 2015-07-08 厦门雅迅网络股份有限公司 Mapinfo map encrypting and decrypting method
CN106227893A (en) * 2016-08-24 2016-12-14 乐视控股(北京)有限公司 A kind of file type acquisition methods and device
CN106557378A (en) * 2015-09-30 2017-04-05 四川效率源信息安全技术股份有限公司 Data parsing and extracting method based on the embedded security device of Chinese nation
CN107832356A (en) * 2017-10-23 2018-03-23 成都佳发安泰科技股份有限公司 A kind of data file system, generation and the method for showing test question files
CN109669622A (en) * 2017-10-13 2019-04-23 杭州海康威视系统技术有限公司 A kind of file management method, document management apparatus, electronic equipment and storage medium
CN111475473A (en) * 2020-04-14 2020-07-31 福建省福信富通网络科技股份有限公司 Streaming dynamic data storage method and system based on file system
CN111694576A (en) * 2020-05-22 2020-09-22 中国航空工业集团公司西安航空计算技术研究所 Software deployment control method for integrated avionics system
CN112817926A (en) * 2021-02-22 2021-05-18 北京安华金和科技有限公司 File processing method and device, storage medium and electronic device
CN113670643A (en) * 2021-08-30 2021-11-19 四川虹美智能科技有限公司 Intelligent air conditioner testing method and system
CN114996223A (en) * 2022-06-15 2022-09-02 上海博般数据技术有限公司 Data interaction method and system between heterogeneous systems and electronic equipment

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530141A (en) * 2012-07-06 2014-01-22 河南思维自动化设备股份有限公司 Vehicle data updating method and vehicle data updating system
CN103235829B (en) * 2013-05-14 2016-03-02 厦门市美亚柏科信息股份有限公司 The decompression method of RAR file and device
CN103235829A (en) * 2013-05-14 2013-08-07 厦门市美亚柏科信息股份有限公司 Method and device for uncompressing random address register (RAR) file
CN103310158A (en) * 2013-06-14 2013-09-18 大唐移动通信设备有限公司 File processing method and device
CN104572153A (en) * 2013-10-23 2015-04-29 上海汽车集团股份有限公司 Update data conversion method for vehicle updating
CN104766018B (en) * 2014-01-06 2018-10-16 厦门雅迅网络股份有限公司 A kind of Mapinfo maps encipher-decipher method
CN104766018A (en) * 2014-01-06 2015-07-08 厦门雅迅网络股份有限公司 Mapinfo map encrypting and decrypting method
CN103902337A (en) * 2014-03-14 2014-07-02 北京金山网络科技有限公司 Data download method and device
CN104092780A (en) * 2014-07-29 2014-10-08 中国联合网络通信集团有限公司 File modification method and device and monofile synchronization method and device based on file blocks
CN106557378A (en) * 2015-09-30 2017-04-05 四川效率源信息安全技术股份有限公司 Data parsing and extracting method based on the embedded security device of Chinese nation
CN106557378B (en) * 2015-09-30 2020-09-15 四川效率源信息安全技术股份有限公司 Data analysis and extraction method based on Hanbang embedded security equipment
CN106227893A (en) * 2016-08-24 2016-12-14 乐视控股(北京)有限公司 A kind of file type acquisition methods and device
CN109669622A (en) * 2017-10-13 2019-04-23 杭州海康威视系统技术有限公司 A kind of file management method, document management apparatus, electronic equipment and storage medium
CN107832356A (en) * 2017-10-23 2018-03-23 成都佳发安泰科技股份有限公司 A kind of data file system, generation and the method for showing test question files
CN111475473A (en) * 2020-04-14 2020-07-31 福建省福信富通网络科技股份有限公司 Streaming dynamic data storage method and system based on file system
CN111694576A (en) * 2020-05-22 2020-09-22 中国航空工业集团公司西安航空计算技术研究所 Software deployment control method for integrated avionics system
CN111694576B (en) * 2020-05-22 2023-06-13 中国航空工业集团公司西安航空计算技术研究所 Comprehensive avionics system software deployment control method
CN112817926A (en) * 2021-02-22 2021-05-18 北京安华金和科技有限公司 File processing method and device, storage medium and electronic device
CN113670643A (en) * 2021-08-30 2021-11-19 四川虹美智能科技有限公司 Intelligent air conditioner testing method and system
CN113670643B (en) * 2021-08-30 2023-05-12 四川虹美智能科技有限公司 Intelligent air conditioner testing method and system
CN114996223A (en) * 2022-06-15 2022-09-02 上海博般数据技术有限公司 Data interaction method and system between heterogeneous systems and electronic equipment

Similar Documents

Publication Publication Date Title
CN101819602A (en) Method for implementing data file engine
US10163135B2 (en) Combining user content with supplemental content at a data storage device
CN107992492B (en) Data block storage method, data block reading method, data block storage device, data block reading device and block chain
CN103530378A (en) Data paging query method and device and data base construction method and device
CN101706716A (en) VO-based form customization, configuration and parsing operation method
CN102467375B (en) Method and device for generating client interface
CN101382876A (en) Data storage method
CN105677904A (en) Distributed file system based small file storage method and device
CN102945679A (en) Video data processing method and video data read-write equipment
CN114239535A (en) Automatic Word document generation method and system based on webpage
CN102254023A (en) Method and device for editing webpage
CN101799785B (en) Information processing apparatus, information processing method, and program
CN101369953B (en) Font network distribution method and system
CN113239106A (en) Excel file export method and device, electronic equipment and storage medium
CN101894098B (en) Embedded font data processing method and device
CN101425096A (en) File memory method for embedded equipment
CN101373473B (en) Method and system for reducing file quantity in embedded system flash memory
CN110647577A (en) Data cube partitioning method and device, computer equipment and storage medium
CN105468304A (en) Native memory card and management method thereof
KR101017433B1 (en) A method for web map service using compressor
CN101146123B (en) A mobile phone reading system and its method
CN103491385A (en) Changing method of satellite user terminal storage programs
CN105391754A (en) Journal paper multimedia publishing system and method
CN102567209B (en) Flash memory chip data analyzing method and flash memory chip data analyzing device
CN102567210A (en) Method and device for reorganizing data analysis environment of flash memory chip

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20100901