CN104933062A - File merging method and apparatus - Google Patents

File merging method and apparatus Download PDF

Info

Publication number
CN104933062A
CN104933062A CN201410102521.8A CN201410102521A CN104933062A CN 104933062 A CN104933062 A CN 104933062A CN 201410102521 A CN201410102521 A CN 201410102521A CN 104933062 A CN104933062 A CN 104933062A
Authority
CN
China
Prior art keywords
directory
item
file
information
directory entry
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.)
Granted
Application number
CN201410102521.8A
Other languages
Chinese (zh)
Other versions
CN104933062B (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.)
China Mobile Group Zhejiang Co Ltd
Original Assignee
China Mobile Group Zhejiang 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 China Mobile Group Zhejiang Co Ltd filed Critical China Mobile Group Zhejiang Co Ltd
Priority to CN201410102521.8A priority Critical patent/CN104933062B/en
Publication of CN104933062A publication Critical patent/CN104933062A/en
Application granted granted Critical
Publication of CN104933062B publication Critical patent/CN104933062B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The present invention provides a file merging method and apparatus and relates to the field of data processing. The file merging method comprises the following steps of: after detecting a file to be merged, which is selected by a user, extracting catalog item information of the file to be merged and generating an original catalog; acquiring operation/inoperation information of the user on the original catalog, re-editing the catalog item information and generating a target catalog; and merging file data of the target catalog and generating a target file. The method provided by the present invention solves the problem that an integral catalog of a system cannot be generated in the existing file merging process, and is more convenient for the user to look up.

Description

A kind of Piece file mergence method and device
Technical field
The present invention relates to data processing field, particularly a kind of Piece file mergence method and device.
Background technology
Along with the development of electronic technology, day by day become a kind of trend by the mode of electronic equipment read books file.And the source of e-file, carry out downloading often by network.
At present, when user selects multifile to download, the disposal route of normal employing is: use the file that multiple file synthesis one is packed by packing compressed software or method, existing common packing form is zip, rar, 7z, for zip, polyelectron book is packaged into zip form, and packing flow process as shown in Figure 1.
Although multiple file can be packaged into a file by this method, the e-book catalogue that neither one is complete is presented to user; Even if having software support to parse bag is the catalogue of each file, but because do not have catalogue relationship description, can only show according to each file separate category, be not an entirety yet.And when user selects the partial content in an e-book to download, and the content selected may be discontinuous, above-mentioned method cannot process, the content can only selected according to user independently downloads each block, same, is difficult to the catalogue of a generation system.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of Piece file mergence method and device, and what realize selecting according to user treats packaging file, generates a file destination with full directory, thus the object of conveniently consulting.
For solving the problems of the technologies described above, embodiments of the invention provide a kind of Piece file mergence method, comprise the following steps:
After the file to be combined that user has selected being detected, extract the directory entry information of described file to be combined, generate original directory;
Obtain user to the operation/inoperation information of described original directory, update directory entry information, generate target directory;
The file data of described target directory is merged, generating object file.
Wherein, obtain user to the operation/inoperation information of described original directory, update directory entry information, the step generating target directory comprises:
Obtain user to the operation information of described original directory, update directory entry information, generate target directory; Or
Obtain user to the inoperation information of described original directory, directly generate target directory according to original directory entry information.
Wherein, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
Wherein, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory comprises:
When the deletion action of user being detected, delete the directory entry chosen;
Judge whether the item that deltrees has sub-directory item, if there is sub-directory item, then father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Whether deltree described in judgement next directory entry of item and the described item that deltrees is coordination, if coordination, then and brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
Wherein, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory also comprises:
When detecting that user edits the operation of directory entry title, judging that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
Wherein, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory also comprises:
When detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
Judge whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, then new brother's item ID is revised as the directory entry ID of current brother's directory entry; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
Wherein, merge the file data of described target directory, the step of generating object file comprises:
Generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
Judge that each file is the need of compression, if desired compresses according to described target directory order, then carry out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
Fileinfo is inserted file information structure;
Generate catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, insert file directory information district;
According to directory information district quantity and the directory information district side-play amount of file directory information district data modification File header information.
The embodiment of the present invention additionally provides a kind of Piece file mergence device, comprising:
Original directory generation module, for after the file to be combined that user has selected being detected, extracts the directory entry information of described file to be combined, generates original directory;
Target directory generation module, for obtaining the operation/inoperation information of user to described original directory, updates directory entry information, generates target directory;
File destination generation module, for merging the file data of described target directory, generating object file.
Wherein, described target directory generation module comprises:
First object catalogue generates submodule, for obtaining the operation information of user to described original directory, updates directory entry information, generates target directory;
Second target directory generates submodule, for obtaining the inoperation information of user to described original directory, directly generates target directory according to original directory entry information.
Wherein, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
Wherein, described first object catalogue generation submodule comprises:
Delete cells, for when the deletion action of user being detected, deletes the directory entry chosen;
First processing unit, for judging whether the item that deltrees has sub-directory item, if there is sub-directory item, then father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Whether the second processing unit is coordination for next directory entry of the item that deltrees described in judging and the described item that deltrees, if coordination, then and brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
Wherein, described first object catalogue generation submodule also comprises:
3rd processing unit, for when detecting that user edits the operation of directory entry title, judges that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
Wherein, described first object catalogue generation submodule also comprises:
Fourth processing unit, for when detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
5th processing unit, for judging whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, is then revised as the directory entry ID of current brother's directory entry by new brother's item ID; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
Wherein, described file destination generation module comprises:
File destination header generation unit, for generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
Document flow writing unit, for judging that each file is the need of compression, if desired compresses according to described target directory order, then carries out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
File information structure inserts unit, for fileinfo is inserted file information structure;
File directory information district inserts unit, for generating catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, inserts file directory information district;
File header information amendment unit, for according to the directory information district quantity of file directory information district data modification File header information and directory information district side-play amount.
The beneficial effect of technique scheme of the present invention is as follows:
The Piece file mergence method of the embodiment of the present invention, by after the file to be combined that user has selected being detected, extracts the directory entry information of described file to be combined, generates original directory; And further obtain user to the operation/inoperation information of described original directory, update directory entry information, generate target directory; And the file data of described target directory is merged, generating object file.Like this, user only need choose file to be combined, and select at the original directory generated the chapters and sections content wanting reservation, go according to the needs of oneself to arrange the directory order made new advances, target directory will be generated according to the selection of user eventually through above-mentioned steps and finally obtain file destination; If user does not carry out operation adjustment to original directory, will directly obtain the target directory identical with original directory, after merging with file data, the file destination obtained comprises needed packaging file content.Said method generates the catalogue of the entirety of corresponding system, and more convenient user consults.
Accompanying drawing explanation
Fig. 1 is existing multifile packing flow chart of steps;
Fig. 2 is the flow chart of steps of the Piece file mergence method of the embodiment of the present invention;
Fig. 3 is the original directory schematic diagram of the embodiment of the present invention;
Fig. 4 is the concrete steps process flow diagram 1 of the Piece file mergence method of the embodiment of the present invention;
Fig. 5 is the schematic diagram after the original directory Delete superfluous item of the embodiment of the present invention;
Fig. 6 is the concrete steps process flow diagram 2 of the Piece file mergence method of the embodiment of the present invention;
Fig. 7 is the schematic diagram of the original directory adjustment directory location of the embodiment of the present invention;
Fig. 8 is the destination file format physical container structural representation of the embodiment of the present invention;
Fig. 9 is the concrete steps process flow diagram 3 of the Piece file mergence method of the embodiment of the present invention;
Figure 10 is the catalogue schematic diagram of the file destination of the embodiment of the present invention;
Figure 11 is the structural representation of the Piece file mergence device of the embodiment of the present invention.
Embodiment
For making the technical problem to be solved in the present invention, technical scheme and advantage clearly, be described in detail below in conjunction with the accompanying drawings and the specific embodiments.
The present invention is directed to existing Piece file mergence can not the problem of overall catalogue of generation system, provides a kind of Piece file mergence method and device, and what realize selecting according to user treats packaging file, generates the file destination that has full directory, thus the object of conveniently consulting.
As shown in Figure 2, a kind of Piece file mergence method of the embodiment of the present invention, comprises the following steps:
Step 11, after the file to be combined that user has selected being detected, extracts the directory entry information of described file to be combined, generates original directory;
Step 12, obtains user to the operation/inoperation information of described original directory, updates directory entry information, generate target directory;
Step 13, merges the file data of described target directory, generating object file.
Wherein, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
In the Piece file mergence method of the embodiment of the present invention, user only need choose file to be combined, and the chapters and sections content of reservation is wanted at the original directory reservation full content generated or selection, go according to the needs of oneself to arrange the directory order made new advances, this method will generate target directory according to the selection of user and finally obtain file destination, this file destination has the catalogue that the system of a correspondence is complete, and more convenient user consults.
Below, want the section in " highly skilled doctor Liuxia favour one " " highly skilled doctor Liuxia favour two " " highly skilled doctor Liuxia favour three " " the first military god " and " nature's mystery " to be merged into a file for user, so according to the Piece file mergence method of the embodiment of the present invention, just need:
First according to step 11, after the file to be combined that user has selected being detected, extract the directory entry ID of these files to be combined, directory entry title, father's item ID, brother's item ID, generate original directory.As shown in Figure 3, the chapters and sections wherein with suspension points represent multiple chapters and sections in original to this original directory.Certainly only have and first show this original directory, user could be facilitated to complete self-defining selection.It should be noted that directory entry ID is No. ID of the representative own identification that each directory entry carries; Father's item ID refers to the directory entry ID of the upper level directory entry of this directory entry, and when this directory entry is first class catalogue item, father's item ID is 0; Brother's item ID refers to the directory entry ID of the directory entry of the peer of this catalogue, and when this directory entry is first first class catalogue imported, brother's item ID is 0.The logical relation between directory entry can be well understood to by father's item ID and brother's item ID.
Will be appreciated that the demand due to user is different, have what want is exactly by file as a whole for all Piece file mergences to be combined, what have is then partial content in needs file to be combined, and therefore step 12 comprises:
Step 121, obtains user to the operation information of described original directory, updates directory entry information, generate target directory; Or
Step 122, obtains user to the inoperation information of described original directory, directly generates target directory according to original directory entry information.
So, if user wants to read the full content in " highly skilled doctor Liuxia favour one " " highly skilled doctor Liuxia favour two " " highly skilled doctor Liuxia favour three " " the first military god " and " nature's mystery ", other amendments are not made yet, the inoperation information of user to described original directory can be obtained according to step 122, target directory (comprising whole chapters and sections catalogues) is directly generated according to original directory entry information, but often, people can according to the reading habit adjustment catalogue of oneself, so obtain the operation information of user to described original directory according to step 121, update directory entry information, generate target directory
Namely step 121 is after user needs adjustment original directory according to oneself, generates the step of new target directory.So for the difference adjustment operation of user, concrete steps are different again.Sometimes have some otiose directory entries in original directory to be added, so the operation that user often the has unwanted directory entry that is Delete superfluous, at this moment, as shown in Figure 4, step 121 comprises:
Step 1211, when the deletion action of user being detected, deletes the directory entry chosen;
Step 1212, judges whether the item that deltrees has sub-directory item, if there is sub-directory item, then and father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Step 1213, whether next directory entry and the described item that deltrees of the item that deltrees described in judgement are coordination, if coordination, then brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
Such as when the operation that user deletes " nature's mystery chapter 1 " being detected, this chapters and sections directory entry will be deleted, then judge whether this directory entry has sub-directory item, know as shown in Figure 3 these chapters and sections be there is no a sub-directory item just need not carry out next step, if these chapters and sections exist sub-directory item, hypothesis is Section 1.1, so just needs the directory entry ID of the parent directory item ID(chapter 1 of Section 1.1) be revised as the parent directory item ID of chapter 1.Finally also will judge next directory entry of this directory entry and the relation of this directory entry, next directory entry is " nature's mystery chapter 2 " is coordination with this directory entry, so just need the brother's item ID revising " nature's mystery chapter 2 " to be revised as brother's item ID of this directory entry.Obtain bibliographic structure as shown in Figure 5 after Delete superfluous directory entry, this operation object is conveniently follow-up adjustment bibliographic structure, if user wants to retain all the elements and also can not carry out this operation certainly.
Step 1211, step 1212, step 1213 not only achieves the object of deleting the deleted entry that user chooses, and the information of other directory entries be associated with deleted entry is revised, and ensure that the orderliness of the logical relation of overall catalogue is clear.
Sometimes, in order to the later stage, to search convenient can be oneself more familiar content by directory entry name modifications to user, and when the operation of user is the title of amendment directory entry, step 121 also comprises:
Step 1214, when detecting that user edits the operation of directory entry title, judges that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
Certainly, in more situation, user also can adjust to the sequence of positions of directory entry, and now, as shown in Figure 6, step 121 also comprises:
Step 1215, when detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
Step 1216, judges whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, then new brother's item ID is revised as the directory entry ID of current brother's directory entry; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
Such as, as shown in Figure 7, to " highly skilled doctor Liuxia favour (two) chapter 1 " be put in the sub-directory of " highly skilled doctor Liuxia favour (one) chapter 1 ", when this operation of position that user adjusts " highly skilled doctor Liuxia favour (two) chapter 1 " being detected, will judge whether the parent directory item of this directory entry changes, now find the parent directory item change of this directory entry and exist, for " highly skilled doctor Liuxia favour (one) chapter 1 ", then by highly skilled doctor Liuxia favour (two) chapter 1 " new father's item ID be revised as the directory entry ID of " highly skilled doctor Liuxia favour (one) chapter 1 ", certainly parent directory item changes but does not exist sometimes, then new father's item ID is set to 0.Judge whether brother's directory entry of this directory entry changes again, now, brother's directory entry changes but does not exist, then new brother's item ID is set to 0, if brother's directory entry changes and exist, then new brother's item ID is revised as the directory entry ID of current brother's directory entry.
Same, step 1215, the information of other directory entries be associated with adjustment location entries while adjustment directory entry position, and is revised by step 1216, ensure that the orderliness of the logical relation of overall catalogue is clear.
Like this, just obtain user-defined target directory, adjustment can be gone for the demand of individual subscriber, have more specific aim and applicability.
Finally, according to step 13, the file data of described target directory is merged, generating object file.What user finally will obtain is exactly this file destination.In embodiments of the present invention, destination file format physical container as shown in Figure 9, comprises File header information: vessel head, describes the information such as copyright, version, old version quantity; File data district: container contents, the information such as form, version, file size of each file; File directory information district: each File Mapping table information in (newly-generated) file directory information, file.Wherein file directory information district and file data district may occur multiple in a vessel, form the Piece file mergence record of one group of history.Such as file header descriptor list structure (wherein wrap namely be under above-mentioned file destination with) as shown in table 1:
The explanation of table 1 file header descriptor list structure
Will be appreciated that and can add encryption and copyright protection in extend information.
And file directory information plot structure is as shown in table 2:
The explanation of table 2 file directory information plot structure
Should recognize:
(1) directory entry can be the non-directory entry selected in e-book, namely supports virtual directory item (corresponding catalogue source length is 0), to have facilitated overall catalogue;
(2) same directory information district directory entry is unique, and namely there is not same directory area has two or more catalogue ID identical, reports an error when present;
(3) same directory entry is when multiple directory area occurs, with being as the criterion of finally occurring, but when directory entry is operating as locking, ignores same directory entry below;
(4) allow directory information length to be 0, represent that this bag is without catalogue, each e-book root directory is that fraternal catalogue at the same level represents by the order occurred with electronic book documentary in File Mapping table.
Structure according to table 1 and table 2 illustrates, as shown in Figure 9, step 13 specifically comprises:
Step 131, generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
According to described target directory order, step 132, judges that each file is the need of compression, if desired compresses, then carries out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
Step 133, inserts file information structure by fileinfo;
Step 134, generates catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, inserts file directory information district;
Step 135, according to directory information district quantity and the directory information district side-play amount of file directory information district data modification File header information.
In embodiments of the present invention, the file data being completed target directory by above-mentioned steps 131-135 is merged, and finally obtains file destination, such as, continues above-mentioned example, obtain target order file as shown in Figure 10.This file destination includes according to target directory each file tactic, reaches that User Defined is selected, sequence, achieve select according to user treat packaging file, generate a file destination with full directory, thus the object of conveniently consulting.
In Piece file mergence process, omit the file of selection sometimes, sometimes want to add new file, will revise by increment in the file merged, shown in original Fig. 8, structure tail portions increases new file data district and file directory information district; Next directory information district skew of last directory information block original is pointed to the reference position in this newly-increased directory information district.
In sum, the Piece file mergence method of the embodiment of the present invention, solving that existing file merges can not the problem of overall catalogue of generation system, and more convenient user consults.
In order to better achieve the above object, the embodiment of the present invention additionally provides a kind of file packing treating apparatus, as shown in figure 11, comprising:
Original directory generation module 1, for after the file to be combined that user has selected being detected, extracts the directory entry information of described file to be combined, generates original directory;
Target directory generation module 2, for obtaining the operation/inoperation information of user to described original directory, updates directory entry information, generates target directory;
File destination generation module 3, for merging the file data of described target directory, generating object file.
Wherein, described target directory generation module comprises:
First object catalogue generates submodule, for obtaining the operation information of user to described original directory, updates directory entry information, generates target directory;
Second target directory generates submodule, for obtaining the inoperation information of user to described original directory, directly generates target directory according to original directory entry information.
Wherein, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
Wherein, described first object catalogue generation submodule comprises:
Delete cells, for when the deletion action of user being detected, deletes the directory entry chosen;
First processing unit, for judging whether the item that deltrees has sub-directory item, if there is sub-directory item, then father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Whether the second processing unit is coordination for next directory entry of the item that deltrees described in judging and the described item that deltrees, if coordination, then and brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
Wherein, described first object catalogue generation submodule also comprises:
3rd processing unit, for when detecting that user edits the operation of directory entry title, judges that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
Wherein, described first object catalogue generation submodule also comprises:
Fourth processing unit, for when detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
5th processing unit, for judging whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, is then revised as the directory entry ID of current brother's directory entry by new brother's item ID; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
Wherein, described file destination generation module comprises:
File destination header generation unit, for generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
Document flow writing unit, for judging that each file is the need of compression, if desired compresses according to described target directory order, then carries out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
File information structure inserts unit, for fileinfo is inserted file information structure;
File directory information district inserts unit, for generating catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, inserts file directory information district;
File header information amendment unit, for according to the directory information district quantity of file directory information district data modification File header information and directory information district side-play amount.
The Piece file mergence device of the embodiment of the present invention, also according to the demand of user, can generate the overall catalogue of a system, user friendlyly consults.
It should be noted that, this device is the device comprising above-mentioned Piece file mergence method, and the implementation of Piece file mergence method is applicable in the embodiment of this device, also can reach identical technique effect.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the prerequisite not departing from principle of the present invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (14)

1. a Piece file mergence method, is characterized in that, comprises the following steps:
After the file to be combined that user has selected being detected, extract the directory entry information of described file to be combined, generate original directory;
Obtain user to the operation/inoperation information of described original directory, update directory entry information, generate target directory;
The file data of described target directory is merged, generating object file.
2. Piece file mergence method according to claim 1, is characterized in that, obtain user to the operation/inoperation information of described original directory, update directory entry information, the step generating target directory comprises:
Obtain user to the operation information of described original directory, update directory entry information, generate target directory; Or
Obtain user to the inoperation information of described original directory, directly generate target directory according to original directory entry information.
3. Piece file mergence method according to claim 2, is characterized in that, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
4. the Piece file mergence method according to Claims 2 or 3, is characterized in that, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory comprises:
When the deletion action of user being detected, delete the directory entry chosen;
Judge whether the item that deltrees has sub-directory item, if there is sub-directory item, then father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Whether deltree described in judgement next directory entry of item and the described item that deltrees is coordination, if coordination, then and brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
5. the Piece file mergence method according to Claims 2 or 3, is characterized in that, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory also comprises:
When detecting that user edits the operation of directory entry title, judging that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
6. the Piece file mergence method according to Claims 2 or 3, is characterized in that, obtain user to the operation information of described original directory, update directory entry information, the step generating target directory also comprises:
When detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
Judge whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, then new brother's item ID is revised as the directory entry ID of current brother's directory entry; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
7. Piece file mergence method according to claim 1, is characterized in that, merges the file data of described target directory, and the step of generating object file comprises:
Generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
Judge that each file is the need of compression, if desired compresses according to described target directory order, then carry out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
Fileinfo is inserted file information structure;
Generate catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, insert file directory information district;
According to directory information district quantity and the directory information district side-play amount of file directory information district data modification File header information.
8. a Piece file mergence device, is characterized in that, comprising:
Original directory generation module, for after the file to be combined that user has selected being detected, extracts the directory entry information of described file to be combined, generates original directory;
Target directory generation module, for obtaining the operation/inoperation information of user to described original directory, updates directory entry information, generates target directory;
File destination generation module, for merging the file data of described target directory, generating object file.
9. Piece file mergence device according to claim 8, is characterized in that, described target directory generation module comprises:
First object catalogue generates submodule, for obtaining the operation information of user to described original directory, updates directory entry information, generates target directory;
Second target directory generates submodule, for obtaining the inoperation information of user to described original directory, directly generates target directory according to original directory entry information.
10. Piece file mergence method according to claim 9, is characterized in that, described directory entry information comprises: directory entry ID, directory entry title, father's item ID, brother's item ID.
11. Piece file mergence devices according to claim 9 or 10, is characterized in that, described first object catalogue generates submodule and comprises:
Delete cells, for when the deletion action of user being detected, deletes the directory entry chosen;
First processing unit, for judging whether the item that deltrees has sub-directory item, if there is sub-directory item, then father's item ID of the item that deltrees described in father's item ID of all sub-directory items of the described item that deltrees being revised as;
Whether the second processing unit is coordination for next directory entry of the item that deltrees described in judging and the described item that deltrees, if coordination, then and brother's item ID of the item that deltrees described in brother's item ID of next directory entry of the described item that deltrees being revised as.
12. Piece file mergence devices according to claim 9 or 10, is characterized in that, described first object catalogue generates submodule and also comprises:
3rd processing unit, for when detecting that user edits the operation of directory entry title, judges that whether new directory item title is empty, if new directory item title be sky, is then new directory item title by former directory entry name modifications; If new directory key name is called sky, then retain former directory entry title.
13. Piece file mergence devices according to claim 9 or 10, is characterized in that, described first object catalogue generates submodule and also comprises:
Fourth processing unit, for when detecting that user adjusts the operation of directory entry position, judging whether the parent directory item adjusting directory entry changes, if parent directory item changes and exist, then new father's item ID being revised as the directory entry ID of current parent directory item; If parent directory item changes but do not exist, then new father's item ID is set to 0;
5th processing unit, for judging whether the brother's directory entry adjusting catalogue changes, if brother's directory entry changes and exist, is then revised as the directory entry ID of current brother's directory entry by new brother's item ID; If brother's directory entry changes but do not exist, then new brother's item ID is set to 0.
14. Piece file mergence devices according to claim 8, is characterized in that, described file destination generation module comprises:
File destination header generation unit, for generating object file header, described header comprises: directory information district quantity and directory information district side-play amount;
Document flow writing unit, for judging that each file is the need of compression, if desired compresses according to described target directory order, then carries out compressing according to the compress mode of specifying and current file stream is write active data area afterbody; If do not need compression, then direct by current file stream write active data area afterbody;
File information structure inserts unit, for fileinfo is inserted file information structure;
File directory information district inserts unit, for generating catalogue data district data according to described target directory information, according to described file information structure spanned file mapping (enum) data district data, inserts file directory information district;
File header information amendment unit, for according to the directory information district quantity of file directory information district data modification File header information and directory information district side-play amount.
CN201410102521.8A 2014-03-19 2014-03-19 A kind of Piece file mergence method and device Active CN104933062B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410102521.8A CN104933062B (en) 2014-03-19 2014-03-19 A kind of Piece file mergence method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410102521.8A CN104933062B (en) 2014-03-19 2014-03-19 A kind of Piece file mergence method and device

Publications (2)

Publication Number Publication Date
CN104933062A true CN104933062A (en) 2015-09-23
CN104933062B CN104933062B (en) 2018-09-04

Family

ID=54120230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410102521.8A Active CN104933062B (en) 2014-03-19 2014-03-19 A kind of Piece file mergence method and device

Country Status (1)

Country Link
CN (1) CN104933062B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106066874A (en) * 2016-05-27 2016-11-02 腾讯科技(深圳)有限公司 Object processing method and terminal
WO2018010530A1 (en) * 2016-07-13 2018-01-18 杭州海康威视数字技术股份有限公司 Method and apparatus for storing, reading, and displaying plurality of multimedia files
CN109683744A (en) * 2018-12-24 2019-04-26 杭州达现科技有限公司 Display interface-based directory integration method and device
CN116016553A (en) * 2023-03-27 2023-04-25 天津联想协同科技有限公司 File sharing method and device based on network disk, network disk and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070005627A1 (en) * 2005-07-01 2007-01-04 Dan Dodge File system having transaction record coalescing
WO2008063800A2 (en) * 2006-11-02 2008-05-29 Microsoft Corporation Virtual deletion in merged file system directories
CN102508880A (en) * 2011-10-18 2012-06-20 广东威创视讯科技股份有限公司 Method for joining files and method for splitting files
CN103034642A (en) * 2011-09-30 2013-04-10 高德软件有限公司 Data file generating method, application program, data downloading system and data downloading method
CN103150402A (en) * 2013-03-27 2013-06-12 网宿科技股份有限公司 Index-code-based virtual file system, establishment method and access method
CN103390005A (en) * 2012-05-11 2013-11-13 北大方正集团有限公司 Method and system for merging documents

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070005627A1 (en) * 2005-07-01 2007-01-04 Dan Dodge File system having transaction record coalescing
WO2008063800A2 (en) * 2006-11-02 2008-05-29 Microsoft Corporation Virtual deletion in merged file system directories
CN103034642A (en) * 2011-09-30 2013-04-10 高德软件有限公司 Data file generating method, application program, data downloading system and data downloading method
CN102508880A (en) * 2011-10-18 2012-06-20 广东威创视讯科技股份有限公司 Method for joining files and method for splitting files
CN103390005A (en) * 2012-05-11 2013-11-13 北大方正集团有限公司 Method and system for merging documents
CN103150402A (en) * 2013-03-27 2013-06-12 网宿科技股份有限公司 Index-code-based virtual file system, establishment method and access method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106066874A (en) * 2016-05-27 2016-11-02 腾讯科技(深圳)有限公司 Object processing method and terminal
CN106066874B (en) * 2016-05-27 2019-11-12 腾讯科技(深圳)有限公司 Object processing method and terminal
WO2018010530A1 (en) * 2016-07-13 2018-01-18 杭州海康威视数字技术股份有限公司 Method and apparatus for storing, reading, and displaying plurality of multimedia files
CN107622067A (en) * 2016-07-13 2018-01-23 杭州海康威视数字技术股份有限公司 A kind of storage, reading and display methods and device to multiple multimedia files
CN107622067B (en) * 2016-07-13 2020-11-20 杭州海康威视数字技术股份有限公司 Method and device for storing, reading and displaying multiple multimedia files
US11210330B2 (en) 2016-07-13 2021-12-28 Hangzhou Hikvision Digital Technology Co., Ltd. Method and apparatus for storing, reading, and displaying plurality of multimedia files
CN109683744A (en) * 2018-12-24 2019-04-26 杭州达现科技有限公司 Display interface-based directory integration method and device
CN116016553A (en) * 2023-03-27 2023-04-25 天津联想协同科技有限公司 File sharing method and device based on network disk, network disk and storage medium
CN116016553B (en) * 2023-03-27 2023-08-11 天津联想协同科技有限公司 File sharing method and device based on network disk, network disk and storage medium

Also Published As

Publication number Publication date
CN104933062B (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN103428242B (en) A kind of method of increment synchronization, Apparatus and system
CN104933062A (en) File merging method and apparatus
CN102521280B (en) Loading method and loading device of EPub electronic book
CN103037005B (en) The file synchronisation method of online storage service and device
CN109325158B (en) Automatic electronic file filing method and system
EP2883155A2 (en) E-reader systems
CN105183475A (en) Method and system for customizing individuality pages of portal website by user himself
CN106095871A (en) A kind of method and device setting up data base directory structure
CN101777056A (en) Data storage method and device
CN102722386A (en) Method and device for generating firmware over the air (FOTA) upgrade pack
CN102486769A (en) Document directory processing method and device
JP2005302038A (en) Method and system for renaming consecutive key in b-tree
CN105868286A (en) Parallel adding method and system for merging small files on basis of distributed file system
CN104462147A (en) Storage method for document
CN102937924A (en) File allocation table (FAT) data recovery method based on file characteristic and file system
KR100737043B1 (en) A file management method, a content playback method, a content recording/playback apparatus, a recording medium with a computer executable program and a recording medium with a computer executable content playback program
CN102387120B (en) File transmission method and network transmission system
CN102646133B (en) Two-dimensional table organization method based on metadata storage
CN104331342B (en) The matched method of file path and its device
CN104881206A (en) File selecting processing method and device
CN110196841B (en) File storage method and device, query method and device and server
CN105446951A (en) Layout generation method and apparatus
Sergeyev et al. Deterministic global optimization
CN104978355B (en) A kind of operating method and device of CPIO files
CN102750287A (en) Method for including index information and download authentication server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant