CN105808534B - A kind of method that isomeric data merges extraction initial data in file - Google Patents

A kind of method that isomeric data merges extraction initial data in file Download PDF

Info

Publication number
CN105808534B
CN105808534B CN201410824980.7A CN201410824980A CN105808534B CN 105808534 B CN105808534 B CN 105808534B CN 201410824980 A CN201410824980 A CN 201410824980A CN 105808534 B CN105808534 B CN 105808534B
Authority
CN
China
Prior art keywords
data
file
byte arrays
isomeric
isomeric data
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.)
Active
Application number
CN201410824980.7A
Other languages
Chinese (zh)
Other versions
CN105808534A (en
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.)
Zhuzhou CRRC Times Electric Co Ltd
Original Assignee
Zhuzhou CRRC Times Electric 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 Zhuzhou CRRC Times Electric Co Ltd filed Critical Zhuzhou CRRC Times Electric Co Ltd
Priority to CN201410824980.7A priority Critical patent/CN105808534B/en
Publication of CN105808534A publication Critical patent/CN105808534A/en
Application granted granted Critical
Publication of CN105808534B publication Critical patent/CN105808534B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

A kind of method that isomeric data merges extraction initial data in file, process are as follows: S1: obtains isomeric data fusion file and file size;S2: file is read in a binary fashion and is stored in file content byte arrays;Apply for that a byte arrays are DataFlagArray, initialize array makes each array element be n;Apply for original content byte arrays, it is assumed that be FileDataArray;S3: filename, the initial position, length that various isomeric data bodies are stored are obtained;S4: each isomeric data body is screened;Judge that isomeric data body is for example just to execute operation in byte arrays DataFlagArray whether in isomeric data fusion file;S5: obtaining each element DataFlag in byte arrays DataFlagArray, judge whether the data of DataFlag are equal to n, if being equal to n, is assigned to the corresponding position of FileDataArray in application original content byte arrays;S6: initial data is successfully obtained.The present invention have many advantages, such as principle it is simple, it is versatile, can simplify operation, improve module design efficiency.

Description

A kind of method that isomeric data merges extraction initial data in file
Technical field
Present invention relates generally to technical field of memory, refer in particular to a kind of merge in file from isomeric data and extract initial data Method.
Background technique
With the fast development of IT technology, file system is constantly improve, and the range that application field covers is also increasingly wider, When carrying out data transmission or transmitting, it may need to merge the data of a variety of different structures in a file.And it was merging Cheng Zhong, the initial data of this document tend not to provide corresponding feature to be extracted.For example, in document transmission process In, it is sometimes desirable to the digital digest of this document is added to any possible position in file in different phase, is also needed sometimes Other flag datas are added to any possible position in this document, require an effective method energy thus It is enough to extract the initial data of file, and the purposes without prejudice to file initial data is ready.
Currently, being all made of same structured data in the file of existing file system, isomeric data being merged File, it is desirable to provide the start memory location of each isomeric data and length and dependency structure.If the data of original document If body does not provide corresponding feature, the process of extraction document initial data is extremely complex, inefficiency.
Summary of the invention
The technical problem to be solved in the present invention is that, for technical problem of the existing technology, the present invention provides one Kind of principle is simple, it is versatile, can simplify operation, improve the isomeric data fusion file of module design efficiency in extract it is original The method of data.
In order to solve the above technical problems, the invention adopts the following technical scheme:
A kind of method that isomeric data merges extraction initial data in file, process are as follows:
S1: isomeric data fusion file and file size are obtained;
S2: isomeric data fusion file is read in a binary fashion and is stored in file content byte arrays, it is assumed that File content byte arrays are IntrojectedFileArray;Apply for a byte arrays, it is assumed that it is DataFlagArray, Length is Length, and initialize array makes each array element be n, and n is the number for being greater than 1 less than 256;Apply in original Hold byte arrays, it is assumed that are as follows: FileDataArray;
S3: filename, the initial position StartPosition, length that various isomeric data bodies are stored are obtained DataLength;
S4: each isomeric data body is screened;Judge whether isomeric data body merges in file in isomeric data, If be just arranged in byte arrays DataFlagArray from marked as StartPosition to StartPosition+ The element data of DataLength be m, m be different from n be more than or equal to zero, the number less than or equal to 255;Last is executed After a isomeric data body, it is transferred to next step;
S5: each element DataFlag in byte arrays DataFlagArray is obtained one by one, judges the number of DataFlag According to whether n is equal to, if being equal to n, it is assigned to the correspondence position of FileDataArray in application original content byte arrays It sets;Until completing the judgement of all elements DataFlag;
S6: successfully obtaining initial data, is output to external interface.
As a further improvement of the present invention: the detailed process of the step S4 are as follows:
S401: setting I=1, i.e., since first isomeric data body;
S402: storage file name, the initial position StartPosition, length of i-th isomeric data body are obtained DataLength;
S403: judging whether isomeric data body I is stored in the fusion file, if so, just in byte arrays DataFlagArray executes operation, otherwise enters in next step;
S404: setting i=i+1 executes S402.
As a further improvement of the present invention: the detailed process of the step S5 are as follows:
S501: assuming that the element in byte arrays DataFlagArray is DataFlag, i-th element is DataFlag_ i;Assuming that i-th element is IntrojectedFlag_i in file content byte arrays IntrojectedFileArray;If I= 1;Obtain the element number that DataFlag_i is n, it is assumed that be FileDataLength;Apply for original content byte arrays, it is long Degree is FileDataLength, it is assumed that is that j-th of element is FileData_j in FileDataArray;Set j=0;
S502: DataFlag_i is obtained;
S503: judging whether the data of DataFlag_i are equal to n, if being equal to n, into next step, is otherwise transferred to S506;
S504: setting FileData_j=IntrojectedFlag_i;
S505: setting J=j+1;
S506: judging whether i is equal to FileDataLength, if unequal, into next step, otherwise completes operation;
S507: setting i=i+1;It is transferred to S502.
Compared with the prior art, the advantages of the present invention are as follows:
1, original data extraction method is not necessarily to raw data file after application in isomeric data of the invention fusion file Founder provides any relevant data volume attribute, and addition isomeric data body person can restore initial data like clockwork, The conjunction coupling between raw data file founder and isomeric data body adder is thus greatly reduced, module is improved The efficiency of design.
2, original data extraction method is after application in isomeric data of the invention fusion file, in the transmitting for carrying out file Or in transmission process, in each addition isomeric data level, any addition isomeric data body person, it is only necessary to which offer is added different It is equal that structure data volume stores the filename of file, isomeric data body storage initial position and length, the data acquisition person of latter level The initial data of previous level can smoothly be restored.And so on, if all addition isomeric data body persons are each provided with text Part name, initial position and length, then the initial data in any file available per capita.
Detailed description of the invention
Fig. 1 is flow diagram of the present invention in specific application example.
Fig. 2 is logic diagram of the present invention in specific application example.
Specific embodiment
The present invention is described in further details below with reference to Figure of description and specific embodiment.
As depicted in figs. 1 and 2, the method that initial data is extracted in a kind of isomeric data of the invention fusion file, stream Journey are as follows:
S1: isomeric data fusion file and file size are obtained;Assuming that length is IntrojectedFilelength.
S2: isomeric data fusion file is read in a binary fashion and is stored in file content byte arrays, it is assumed that File content byte arrays are IntrojectedFileArray;Apply for a byte arrays, it is assumed that it is DataFlagArray, Length is Length, and initialize array makes each array element be n, and n is the number for being greater than 1 less than 256.Apply in original Hold byte arrays, it is assumed that are as follows: FileDataArray;
S3: filename, the initial position StartPosition, length that various isomeric data bodies are stored are obtained DataLength;Assuming that there is I isomeric data body;
S4: each isomeric data body is screened;Judge whether isomeric data body merges in file in isomeric data, If be just arranged in byte arrays DataFlagArray from marked as StartPosition to StartPosition+ The element data of DataLength be m, m be different from n be more than or equal to zero, the number less than or equal to 255;Last is executed After a isomeric data body, it is transferred to next step;
S5: each element DataFlag in byte arrays DataFlagArray is obtained one by one, judges the number of DataFlag According to whether n is equal to, if being equal to n, it is assigned to the correspondence position of FileDataArray in application original content byte arrays It sets;Until completing the judgement of all elements DataFlag;
S6: successfully obtaining initial data, is output to external interface.
The present invention in specific application, the detailed process of step S4 are as follows:
S401: setting I=1, i.e., since first isomeric data body;
S402: storage file name, the initial position StartPosition, length of i-th isomeric data body are obtained DataLength;
S403: judging whether isomeric data body I is stored in the fusion file, if so, just in byte arrays DataFlagArray executes operation, otherwise enters in next step;
S404: setting i=i+1 executes S402.
The present invention in specific application, the detailed process of step S5 are as follows:
S501: assuming that the element in byte arrays DataFlagArray is DataFlag, i-th element is DataFlag_ i;Assuming that i-th element is IntrojectedFlag_i in file content byte arrays IntrojectedFileArray;If I= 1;Obtain the element number that DataFlag_i is n, it is assumed that be FileDataLength;Apply for original content byte arrays, it is long Degree is FileDataLength, it is assumed that is that j-th of element is FileData_j in FileDataArray;Set j=0;
S502: DataFlag_i is obtained;
S503: judging whether the data of DataFlag_i are equal to n, if being equal to n, into next step, is otherwise transferred to S506;
S504: setting FileData_j=IntrojectedFlag_i;
S505: setting J=j+1;
S506: judging whether i is equal to FileDataLength, if unequal, into next step, otherwise completes operation;
S507: setting i=i+1;It is transferred to S502.
The above is only the preferred embodiment of the present invention, protection scope of the present invention is not limited merely to above-described embodiment, All technical solutions belonged under thinking of the present invention all belong to the scope of protection of the present invention.It should be pointed out that for the art For those of ordinary skill, several improvements and modifications without departing from the principles of the present invention should be regarded as protection of the invention Range.

Claims (3)

1. extracting the method for initial data in a kind of isomeric data fusion file, which is characterized in that process are as follows:
S1: isomeric data fusion file and file size are obtained;
S2: isomeric data fusion file is read in a binary fashion and is stored in file content byte arrays, it is assumed that file Content byte arrays are IntrojectedFileArray;Apply for a byte arrays, it is assumed that be DataFlagArray, length For Length, initializes byte arrays DataFlagArray and each byte arrays DataFlagArray element is made to be n, n is It is greater than 1 number less than 256;Apply for original data content byte arrays, it is assumed that are as follows: FileDataArray;
S3: filename, initial position StartPosition, length DataLength that various isomeric data bodies are stored are obtained;
S4: each isomeric data body is screened;Judge whether isomeric data body merges in file in isomeric data, if Just it is being arranged in byte arrays DataFlagArray from marked as StartPosition to StartPosition+ The element data of DataLength be m, m be different from n be more than or equal to zero, the number less than or equal to 255;Last is executed After a isomeric data body, it is transferred to next step;
S5: each element DataFlag in byte arrays DataFlagArray is obtained one by one, judges that the data of DataFlag are It is no to be equal to n, if being equal to n, the element in the file content byte arrays IntrojectedFileArray is assigned to Corresponding position in the original data content byte arrays FileDataArray;Until completing all elements DataFlag's Judgement;
S6: successfully obtaining initial data, is output to external interface.
2. extracting the method for initial data in isomeric data fusion file according to claim 1, which is characterized in that described The detailed process of step S4 are as follows:
S401: setting I=1, i.e., since first isomeric data body;
S402: storage file name, the initial position StartPosition, length of i-th isomeric data body are obtained DataLength;
S403: judging whether isomeric data body I is stored in isomeric data fusion file, if so, just in byte arrays It is arranged in DataFlagArray from the element data marked as StartPosition to StartPosition+DataLength For m, m be different from n be more than or equal to zero, the number less than or equal to 255, otherwise enter in next step;
S404: setting I=I+1 executes S402.
3. extracting the method for initial data in isomeric data fusion file according to claim 1 or 2, which is characterized in that The detailed process of the step S5 are as follows:
S501: assuming that the element in byte arrays DataFlagArray is DataFlag, i-th element is DataFlag_I;It is false If i-th element is IntrojectedFlag_I in file content byte arrays IntrojectedFileArray;If I=1;It obtains Taking DataFlag_I is the element number of n, it is assumed that is FileDataLength;Apply for original data content byte arrays, length For FileDataLength, it is assumed that j-th element is FileData_J in FileDataArray;Set J=0;
S502: DataFlag_I is obtained;
S503: judging whether the data of DataFlag_I are equal to n, if being equal to n, into next step, is otherwise transferred to S506;
S504: setting FileData_J=IntrojectedFlag_I;
S505: setting J=J+1;
S506: judging whether I is equal to FileDataLength, if unequal, into next step, otherwise completes operation;
S507: setting I=I+1;It is transferred to S502.
CN201410824980.7A 2014-12-27 2014-12-27 A kind of method that isomeric data merges extraction initial data in file Active CN105808534B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410824980.7A CN105808534B (en) 2014-12-27 2014-12-27 A kind of method that isomeric data merges extraction initial data in file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410824980.7A CN105808534B (en) 2014-12-27 2014-12-27 A kind of method that isomeric data merges extraction initial data in file

Publications (2)

Publication Number Publication Date
CN105808534A CN105808534A (en) 2016-07-27
CN105808534B true CN105808534B (en) 2019-06-11

Family

ID=56981168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410824980.7A Active CN105808534B (en) 2014-12-27 2014-12-27 A kind of method that isomeric data merges extraction initial data in file

Country Status (1)

Country Link
CN (1) CN105808534B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103596A (en) * 2009-12-18 2011-06-22 康佳集团股份有限公司 Method for implementing file system in embedded system
CN102855280A (en) * 2012-07-31 2013-01-02 北京壹人壹本信息科技有限公司 Heterogeneous data processing method and device
CN103500123A (en) * 2013-10-12 2014-01-08 浙江大学 Parallel computation dispatch method in heterogeneous environment
CN103559217A (en) * 2013-10-17 2014-02-05 北京航空航天大学 Heterogeneous database oriented massive multicast data storage implementation method
CN103970914A (en) * 2014-04-29 2014-08-06 合肥城市云数据中心有限公司 Acquisition and storage method for heterogeneous data between sewage treatment plants

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102103596A (en) * 2009-12-18 2011-06-22 康佳集团股份有限公司 Method for implementing file system in embedded system
CN102855280A (en) * 2012-07-31 2013-01-02 北京壹人壹本信息科技有限公司 Heterogeneous data processing method and device
CN103500123A (en) * 2013-10-12 2014-01-08 浙江大学 Parallel computation dispatch method in heterogeneous environment
CN103559217A (en) * 2013-10-17 2014-02-05 北京航空航天大学 Heterogeneous database oriented massive multicast data storage implementation method
CN103970914A (en) * 2014-04-29 2014-08-06 合肥城市云数据中心有限公司 Acquisition and storage method for heterogeneous data between sewage treatment plants

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于XML 的Excel 数据提取和集成研究";夏开建 等;《常熟理工学院学报(自然科学)》;20100430;全文

Also Published As

Publication number Publication date
CN105808534A (en) 2016-07-27

Similar Documents

Publication Publication Date Title
Cao et al. Feature-fused SSD: Fast detection for small objects
CN110633698A (en) Infrared picture identification method, equipment and medium based on loop generation countermeasure network
CN106326361A (en) HBase database-based data inquiry method and device
WO2018125669A4 (en) Identifying a structure presented in portable document format (pdf)
CN108885683B (en) Method and system for pose estimation
CN109242796A (en) Character image processing method, device, electronic equipment and computer storage medium
Li et al. A single-shot object detector with feature aggregation and enhancement
CN110210479A (en) A kind of text information extraction method on waste items
CN109426831A (en) The method, apparatus and computer equipment of picture Similarity matching and model training
CN114821096A (en) Image processing method, neural network training method and related equipment
CN103177105A (en) Method and device of image search
CN105808534B (en) A kind of method that isomeric data merges extraction initial data in file
CN106355247B (en) Data processing method and device, chip and electronic equipment
Wong et al. Adaptive learning feature pyramid for object detection
US20170147873A1 (en) Motion recognition method and motion recognition device
WO2023273196A1 (en) Text recognition method and related apparatus
Bribiesca et al. Multimodal weighted fusion of transformers for movie genre classification
CN111667547B (en) GAN network training method, garment picture generation method and device and electronic equipment
CN106446902B (en) non-character image recognition method and device
CN113627242A (en) Text processing method and related device
CN109558585A (en) A kind of answer Automatic-searching method and electronic equipment based on educational system
KR20110056999A (en) Method and apparatus for malicious photo filtering using semantic features of digital photo
CN113704417B (en) Method and system for displaying relation between document fixed tracking and document chapter tracking
CN103294697B (en) A kind of data adaptive analysis method and device
CN112989139B (en) Data searching method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: The age of 412001 in Hunan Province, Zhuzhou Shifeng District Road No. 169

Applicant after: ZHUZHOU CRRC TIMES ELECTRIC CO., LTD.

Address before: The age of 412001 in Hunan Province, Zhuzhou Shifeng District Road No. 169

Applicant before: Zhuzhou CSR Times Electric Co., Ltd.

CB02 Change of applicant information
CB03 Change of inventor or designer information

Inventor after: Chen Chaolu

Inventor after: Ji Anhui

Inventor after: Qiao Xianhua

Inventor after: Xiao Zhijun

Inventor after: Chen Jianxiao

Inventor after: Xu Yijing

Inventor after: Liao Yun

Inventor after: Wang Long

Inventor after: Han Lu

Inventor after: Li Bowen

Inventor after: Xu Nannan

Inventor before: Chen Jianxiao

Inventor before: Ji Anhui

Inventor before: Qiao Xianhua

Inventor before: Chen Chaolu

Inventor before: Xiao Zhijun

Inventor before: Xu Yijing

Inventor before: Liao Yun

Inventor before: Wang Long

Inventor before: Han Lu

Inventor before: Li Bowen

Inventor before: Xu Nannan

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant