CN115563055A - OFD document merging and splitting method, system and storage medium - Google Patents
OFD document merging and splitting method, system and storage medium Download PDFInfo
- Publication number
- CN115563055A CN115563055A CN202211067522.4A CN202211067522A CN115563055A CN 115563055 A CN115563055 A CN 115563055A CN 202211067522 A CN202211067522 A CN 202211067522A CN 115563055 A CN115563055 A CN 115563055A
- Authority
- CN
- China
- Prior art keywords
- ofd
- file
- target
- split
- file structure
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/116—Details of conversion of file system types or formats
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/164—File meta data generation
- G06F16/166—File name conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Document Processing Apparatus (AREA)
Abstract
The invention relates to a method, a system and a storage medium for merging and splitting OFD documents, comprising the following steps: s1, constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged; s2, respectively copying the target file resources in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body; and S3, compressing the target OFD file structure to obtain a combined OFD file. By combining the OFD documents, the invention can ensure that the md5 values of the split OFD document and the OFD document before combination are the same while improving the OFD document combining efficiency so as to ensure the integrity of the OFD document.
Description
Technical Field
The invention relates to the technical field of OFD document processing, in particular to a method, a system and a storage medium for merging and splitting an OFD document.
Background
At present, a method for merging a plurality of OFD documents into one OFD document generally merges through a Doc directory in an OFD target structure or a page under the Doc directory, an OFD document is split through the page or the Doc directory, if one OFD document is generated by merging a plurality of OFD documents, the OFD document is split, but the md5 value of the split OFD document is different from that of the OFD document before merging. If the combined OFD documents all have signature data, since the signature is used to protect the contents of the OFD documents, the md5 value after splitting by the existing splitting method may change, which may result in a failure to check the OFD documents.
Therefore, it is highly desirable to provide a technical solution for splitting an OFD document and ensuring that md5 values of the split OFD document are the same as md5 values of OFD documents before merging, so that the split OFD document can be successfully verified.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method, a system and a storage medium for merging and splitting an OFD document.
The technical scheme of the OFD document merging method is as follows:
s1, constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
s2, respectively copying the target file resource in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body;
and S3, compressing the target OFD file structure to obtain a combined OFD file.
The OFD document merging method has the following beneficial effects:
by merging the OFD documents, the method can improve the merging efficiency of the OFD documents, and simultaneously can ensure that the md5 values of the split OFD documents are the same as the md5 values of the OFD documents before merging so as to ensure the integrity of the OFD documents.
On the basis of the above scheme, the OFD document merging method of the present invention may be further improved as follows.
Further, before step S2, the method includes:
s021, judging whether the basic OFD file structure contains an OFD.xml file or not to obtain a first judgment result;
s022, if the first determination result is yes, executing step S2.
Further, step S2 includes:
s21, respectively judging whether a file name identical to each target file resource in each first OFD decompression folder exists in the basic OFD file structure body, and obtaining all second judgment results;
s22, respectively copying the target file resources corresponding to each file name with the negative second judgment result to the basic OFD file structure;
s23, modifying each file name with the second judgment result of yes to obtain and copy the target file resource corresponding to each modified file name to the basic OFD file structure respectively, and storing each file name before and after modification to MergeInformation.
S24, copying the first target content of ofd.xml in each first OFD decompression folder to ofd.xml of the first OFD file structure, and storing the second target content of ofd.xml in each first OFD decompression folder to the mergenformation.xml file of the first OFD file structure, to obtain the target OFD file structure.
Further, the Mergeinformation. Xml file of the base OFD file structure includes: the OFDInformation node, step S23 includes:
s231, modifying the original file name of each target file resource with the second judgment result of yes into a target file name, and copying the target file resource corresponding to each target file name to the basic OFD file structure body respectively;
s232, storing the original filename of each target file resource into the OldName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, and storing the target filename of each target file resource into the NewName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, to obtain the first file structure.
Further, when the first determination result is no, copy the ofd.xml in any of the first OFD decompression folders to the base OFD file structure, and return to execute step S021.
The technical scheme of the OFD file splitting method is as follows:
s100, decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure of each file to be split;
s200, obtaining a target split OFD file structure corresponding to the original split OFD file structure of each file to be split, based on the mergergeinformation.
S300, sequentially compressing each target split OFD file structure to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
The OFD file splitting method has the following beneficial effects:
according to the splitting method, each OFD document before combination can be accurately obtained by splitting the combined OFD document, and the splitting efficiency of the OFD document is improved.
The technical scheme of the OFD file merging system is as follows:
the method comprises the following steps: the system comprises a first construction module, a first processing module and a merging module;
the first building block is configured to: constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
the first processing module is configured to: respectively copying the target file resources in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body;
the merging module is used for: and compressing the target OFD file structure body to obtain a combined OFD file.
The OFD file merging system has the following beneficial effects:
by combining the OFD documents, the combining efficiency of the OFD documents is improved, and meanwhile, the md5 value of the split OFD document is the same as that of the OFD document before combination, so that the integrity of the OFD document is ensured.
On the basis of the above scheme, the OFD file merging system of the present invention may be further improved as follows.
Further, before the first processing module, the method further comprises: a first judgment module; the first judging module is used for:
judging whether the basic OFD file structure contains an OFD.xml file or not to obtain a first judgment result; and when the first judgment result is yes, calling the first processing module.
The technical scheme of the OFD file splitting system is as follows:
the method comprises the following steps: the system comprises a second construction module, a second processing module and a splitting module;
the second building block is configured to: decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure body of each file to be split;
the second processing module is used for: obtaining a target split OFD file structure corresponding to the original split OFD file structure of each file to be split based on the MergeInformation.
The splitting module is configured to: and sequentially compressing each target split OFD file structure body to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
The OFD file splitting system has the following beneficial effects:
the splitting system of the invention can accurately obtain each OFD document before merging by splitting the merged OFD document, thereby improving the splitting efficiency of the OFD document.
The technical scheme of the storage medium of the invention is as follows:
the storage medium has stored therein instructions which, when read by a computer, cause the computer to execute an OFD file merging method according to the present invention, or/and an OFD file splitting method according to the present invention.
Drawings
Fig. 1 is a flowchart illustrating an OFD document merging method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of ofd.xml in an OFD document merging method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of mergeinformation.xml in an OFD document merging method according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating an OFD document splitting method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an OFD document specification in an OFD document merging method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an OFD file merging system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an OFD document splitting system according to an embodiment of the present invention.
Detailed Description
As shown in fig. 1, an OFD document merging method according to an embodiment of the present invention includes the following steps:
s1, constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged.
Wherein, the basic OFD file structure body is as follows: and the empty structure body is used for storing all related file contents of the OFD.
Each OFD file to be merged is a file in an OFD format, and each first OFD decompression folder is a folder obtained by decompressing a corresponding OFD file to be merged. Each of the first OFD decompressed folders includes: xml file and Doc _ N directory.
It should be noted that, an ofd.xml file is located under a root directory of the decompressed OFD file, where the ofd.xml file is a start file of the OFD file, and a plurality of Doc _ N directories exist below the root directory, where the Doc _ N directories are: doc _0, doc_1, etc. Xml file is a file that must exist in the OFD file, and the number is one and only one. The number of Doc _ N directories is N.
S2, respectively copying the target file resources in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body.
Wherein the target file resources include but are not limited to: the first OFD decompresses the mergelnformation xml file and Doc _ N directory in the folder.
And S3, compressing the target OFD file structure to obtain a combined OFD file.
Specifically, a zip compression algorithm is adopted to compress the target OFD file structure body, so as to obtain a combined OFD file.
It should be noted that, the process of compressing the target OFD file structure by using the zip compression algorithm is the prior art, and is not described herein in detail.
Preferably, before step S2, the method comprises:
s021, judging whether the basic OFD file structure contains an OFD.
S022, if the first judgment result is yes, executing step S2.
Specifically, after the base OFD file structure is constructed, a mergelnformation. Before copying the target file resources in each of the first OFD decompressed folders to the base OFD file structure, respectively, it is determined whether the base OFD file structure contains an OFD. If not, copying all files and directories in any first OFD decompressed folder to the basic OFD file structure body. Xml is included in the base OFD file structure at this time, and finally the step S021 is executed.
The MergeInformation xml file has the following functions: some information of the OFD files before and after the combining is stored at the time of the combining of the OFD files, and the splitting is performed based on the information at the time of the splitting. Xml file names can be modified and set according to requirements, and are not limited herein.
Preferably, step S2 comprises:
s21, in the basic OFD file structure, respectively determining whether there is a file name that is the same as each target file resource in each first OFD decompression folder, and obtaining all second determination results.
Specifically, for example, if there is a mergelnformation.
And S22, copying the target file resources corresponding to the file names with the negative second judgment results to the basic OFD file structure respectively.
Specifically, when the file name of any one target file resource does not exist in the base OFD file structure, the target file resource is directly copied to the base OFD file structure until the target file resource corresponding to each file name that does not exist in the base OFD file structure is copied to the base OFD file structure.
And S23, modifying the file name with the second judgment result of yes, obtaining and copying the target file resource corresponding to each modified file name to the basic OFD file structure respectively, and storing each file name before and after modification to MergeInformation.
Specifically, for example, if there is a mergeinformation.xml file below any first OFD decompression folder, the file name is modified to be mergeinformation.xml (N denotes 0,1,2 or the like). The modified file name at this time is: xml to the base OFD file structure and decompress this first OFD to the file name before and after modification under the folder: and storing the MergeInformation.xml and the MergeInformation.xml into the MergeInformation.xml file of the base OFD file structure until the target file resource corresponding to each modified file name is respectively copied to the base OFD file structure, and storing each file name before and after modification into the MergeInformation.xml file of the base OFD file structure to obtain a first OFD file structure.
It should be noted that, as shown in fig. 2, for the first copied first OFD decompressed folder (any one of the first OFD decompressed folders is determined as the first copied first OFD decompressed folder), some key information of the ofd.xml file and the directory name and the file name under the first copied first OFD decompressed folder need to be recorded in the merge information.
S24, copying the first target content of ofd.xml in each first OFD decompression folder to ofd.xml of the first OFD file structure, and storing the second target content of ofd.xml in each first OFD decompression folder to the mergenformation.xml file of the first OFD file structure, to obtain the target OFD file structure.
Wherein the first target content is: docBody. Specifically, N in DOC _ N in the DocBody in the ofd.xml file is modified to a value in NewName, and then the modified DocBody is copied to ofd.xml of the first OFD file structure.
Wherein the second target content is: <? xml > and < OFD: OFD >. Xml <? And xml and < OFD: OFD are stored in MergeInformation xml file of the first OFD file structure, so as to obtain the target OFD file structure.
It should be noted that each ofd file has an ofd.xml file, but <? xml > content and < OFD: OFD > content may both be different, so the content in both is stored to generate the corresponding OFD.
Preferably, the MergeInformation. Xml file of the base OFD file structure includes: the OFDInformation node, step S23 includes:
s231, modifying the original file name of the target file resource with the second judgment result as the target file name, and copying the target file resource corresponding to each target file name to the basic OFD file structure respectively.
For example, in the above example, the MergeInformation. Xml is the original file name, and the MergeInformation. Xml is the target file name.
S232, storing the original filename of each target file resource into the OldName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, and storing the target filename of each target file resource into the NewName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, to obtain the first file structure.
Specifically, as shown in fig. 3, the original file name of each target file resource is stored into the OldName attribute of the OFDInformation node of the mergenformation. Xml file of the base OFD file structure, such as OldName = "DOC — 0" in fig. 3; and storing the target file name of each target file resource into a NewName attribute of an office format node of a MergeInformation.
In addition, to better explain the technical solution of the present embodiment, the following steps are adopted for detailed description, and the technical solution of the present embodiment may also adopt the following steps:
1) Creating a basic OFD file structure body;
2) Creating a MergeInformation.
3) Decompressing each OFD file to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
4) Copying files and directories under a first OFD decompression folder into the basic OFD file structure;
5) If MergeInformationXml files exist under the first OFD decompression folder, the file name is modified to MergeInformationN.xml;
6) Storing some target information of the ofd.xml file under the first OFD-decompressed folder, the directory name under the first OFD-decompressed folder, and the file names before and after modification into a mergerenformation.xml file of a base OFD file structure, the target information including: header information in ofd.xml;
7) Copying the directory file under each of the rest OFD decompression folders into the basic OFD file structure; if any directory or file name already exists, renaming the directory or file name;
8) Xml file, wherein the file name before modification is stored in the OldName attribute of the OFDFile of the OFDInformation node, and the name after modification is stored in the NewName attribute of the OFDFile of the OFDInformation node;
9) Will each OFD remaining decompress? xml > < OFD OFD > is copied to the MergeInformation.xml file of the base OFD file structure; modifying N of DOC _ N in DocBody in the OFD.xml file under each residual OFD decompression folder into a numerical value in New Name, and copying the DocBody to OFD.xml in the basic OFD file structure body to obtain a target OFD file structure body;
10 Compressing the target OFD file structure to obtain a combined OFD file.
According to the technical scheme of the embodiment, the OFD documents are merged, so that the merging efficiency of the OFD documents is improved, and the md5 value of the split OFD documents is the same as that of the OFD documents before merging, so that the completeness of the OFD documents is ensured.
As shown in fig. 4, an OFD file splitting method according to an embodiment of the present invention is used for splitting a merged OFD file in an OFD file merging method according to an embodiment of the present invention, and includes the following steps:
s100, decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure of each file to be split.
Wherein, the process of decompressing the combined OFD file is the prior art. The second decompressed OFD folder is a folder obtained by decompressing the combined OFD file.
The original split OFD file structure body is as follows: and the empty structure body is used for storing all related file contents of the OFD. Each original split OFD file structure is finally compressed into a target split OFD file.
S200, based on the mergelnformation.
Specifically, according to a MergeInformation. According to the obtained OFDxml information, creating a corresponding OFD.xml file in each original split OFD file structure; acquiring a child node OFDInformation node under each OFDDocument node, and storing values corresponding to an OldName attribute and a NewName attribute in the child node OFDFile under the OFDInformation node in a map, wherein the key value of the map is the value of the NewName, and the value is the value of the OldName; traversing the map, renaming directories and files meeting preset requirements under the second decompression OFD folder, and copying the directories and files to the corresponding original split OFD file structure; traversing all DocRoot nodes in the OFD.xml under the second OFD-decompressing folder; acquiring the content in the DocRoot node, and then splitting the character strings to obtain all the character strings; and searching from the map according to each character string, if any character string exists in the map, modifying the contents of all protected Doc _ N nodes in the contents of the parent node DocBody of the DocRoot node into correct values of Doc _ N, and copying the contents of DocBody into OFD.xml of the corresponding original split OFD file structure according to the OFD specification to obtain all target split OFD file structures.
The map is a container which can be used for storing a plurality of data, the data are stored in pairs, the file names before and after the file modification are stored in the map in pairs, and the file names of the files are modified into the file names before the file modification according to the map during the splitting. The file name change of the OFD file when the merge operation occurs is stored below the OFDFile node. Because the original file name of the OFD file is renamed during merging, the original file name and the renamed file name are recorded in the place, and the original file name and the renamed file name are in one-to-one correspondence.
Wherein the preset requirements are as follows: and merging all the stored contents of the OFDInformation nodes.
The OFD specification is shown in fig. 4, which is a standard technical specification and is not described herein.
S300, sequentially compressing each target split OFD file structure to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
And compressing each target split OFD file structure body by zip, and changing the suffix name of each compressed file into OFD to obtain all target split OFD files.
In addition, to better explain the technical solution of the present embodiment, the following steps are adopted for detailed description, and the technical solution of the present embodiment may also adopt the following steps:
1) Decompressing the combined OFD file to obtain a second decompressed OFD folder;
2) Judging whether the second decompressed OFD folder contains MergeInformation.
3) If a MergeInformation.xml file exists, creating a plurality of ofd files according to the MergeInformation.xml file;
4) Creating an original split OFD file structure, and acquiring OFDxml under each OFDDocvent node under MergeInformation.
5) Creating an OFD.xml file in the corresponding original split OFD file structure according to each OFDxml;
6) According to a child node OFDInformation node under an OFDDocument node, storing the OldName in the child node OFDFile under the OFDInformation node and a value corresponding to a NewName attribute in a map, wherein the key value of the map is the value of the NewName, and the value is the value of the OldName;
7) Traversing the map, renaming directories and files meeting requirements under the second OFD decompression folder, and copying the directories and files to the corresponding original split OFD file structure;
8) Opening an OFD.xml file under the decompressed folder, and traversing all DocRoot nodes in the OFD.xml;
9) Acquiring content of DocRoot, and then splitting the character strings to obtain all the character strings;
10 Searching for if the obtained character string exists from the map, modifying the contents of all protected Doc _ N nodes in the content of the parent node DocBody of the DocRoot node into correct values of Doc _ N, and copying the content of the DocBody into the OFD.xml of the corresponding original split OFD file structure according to OFD specification;
11 Sequentially compressing each target split OFD file structure to obtain and modify file suffix names of all split compressed files to obtain all target split OFD files.
According to the splitting method, each OFD document before merging can be accurately obtained by splitting the merged OFD document, and the splitting efficiency of the OFD document is improved.
As shown in fig. 5, an OFD file merging system 400 according to an embodiment of the present invention includes: a first building module 410, a first processing module 420, and a merging module 430;
the first building block 410 is configured to: constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
the first processing module 420 is configured to: respectively copying the target file resource in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body;
the merge module 430 is configured to: and compressing the target OFD file structure to obtain a combined OFD file.
According to the technical scheme of the embodiment, the OFD documents are merged, so that the merging efficiency of the OFD documents is improved, and the md5 value of the split OFD documents is the same as that of the OFD documents before merging, so that the completeness of the OFD documents is ensured.
The above steps for realizing the corresponding functions of each parameter and each module in the OFD file merging system 400 of the present embodiment may refer to each parameter and step in the above embodiments of an OFD file merging method, which are not described herein again.
As shown in fig. 6, an OFD file splitting system 500 according to an embodiment of the present invention is configured to split the combined OFD file in an OFD file combining system according to an embodiment of the present invention, and includes: a second building module 510, a second processing module 520, and a splitting module 530;
the second building block 510 is configured to: decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure of each file to be split;
the second processing module 520 is configured to: obtaining a target split OFD file structure corresponding to the original split OFD file structure of each file to be split, based on the MergeInformation.
The splitting module 530 is configured to: and sequentially compressing each target split OFD file structure body to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
According to the splitting method, each OFD document before merging can be accurately obtained by splitting the merged OFD document, and the splitting efficiency of the OFD document is improved.
The above-mentioned steps for implementing the corresponding functions of each parameter and each module in the OFD file splitting system 500 of the present embodiment may refer to each parameter and step in the above-mentioned embodiment of the OFD file splitting method, and are not described herein again.
An embodiment of the present invention provides a storage medium, including: the storage medium stores instructions, and when the instructions are read by a computer, the computer is caused to execute a step of an OFD file merging method, or/and a step of an OFD file splitting method, for example, which may specifically refer to each parameter and step in the above embodiment of an OFD file merging method, or/and an OFD file splitting method, and details are not described herein.
Computer storage media such as: flash disks, portable hard disks, and the like.
As will be appreciated by one skilled in the art, the present invention may be embodied as methods, systems, and storage media.
Thus, the present invention may be embodied in the form of: may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software, and may be referred to herein generally as a "circuit," module "or" system. Furthermore, in some embodiments, the invention may also be embodied in the form of a computer program product in one or more computer-readable media having computer-readable program code embodied in the medium. Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.
Claims (10)
1. An OFD file merging method, comprising:
s1, constructing a basic OFD file structure, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
s2, respectively copying the target file resources in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body;
and S3, compressing the target OFD file structure to obtain a combined OFD file.
2. The OFD file merging method according to claim 1, before step S2, comprising:
s021, judging whether the basic OFD file structure contains an OFD.xml file or not to obtain a first judgment result;
s022, if the first judgment result is yes, executing step S2.
3. The OFD file merging method according to claim 2, wherein step S2 comprises:
s21, respectively judging whether a file name identical to each target file resource in each first OFD decompression folder exists in the basic OFD file structure body, and obtaining all second judgment results;
s22, respectively copying the target file resources corresponding to each file name with the negative second judgment result to the basic OFD file structure;
s23, modifying each file name with the second judgment result of yes to obtain and copy the target file resource corresponding to each modified file name to the basic OFD file structure respectively, and storing each file name before and after modification to MergeInformation.
S24, copying the first target content of ofd.xml in each first OFD decompression folder to ofd.xml of the first OFD file structure, and storing the second target content of ofd.xml in each first OFD decompression folder to the mergenformation.xml file of the first OFD file structure, to obtain the target OFD file structure.
4. The OFD file merging method according to claim 3, wherein the MergeInformation. The OFDInformation node, step S23 includes:
s231, modifying the original file name of the target file resource with the second judgment result as the target file name, and copying the target file resource corresponding to each target file name to the basic OFD file structure respectively;
s232, storing the original filename of each target file resource into the OldName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, and storing the target filename of each target file resource into the NewName attribute of the ofdiformation node of the mergenformation.xml file of the basic OFD file structure, to obtain the first file structure.
5. The OFD file combination method according to any of claims 2 to 4, wherein when the first determination result is negative, copying the ofd.xml in any of the first OFD decompressed folders to the base OFD file structure, and returning to execute step S021.
6. An OFD file splitting method, for splitting the combined OFD file in the OFD file combining method of any one of claims 1 to 5, comprising the following steps:
s100, decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure of each file to be split;
s200, obtaining a target split OFD file structure corresponding to the original split OFD file structure of each file to be split, based on the mergergeinformation.
S300, sequentially compressing each target split OFD file structure to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
7. An OFD file merging system, comprising: the system comprises a first construction module, a first processing module and a merging module;
the first building block is configured to: constructing a basic OFD file structure body, and decompressing a plurality of OFD files to be merged to obtain a first OFD decompressed folder corresponding to each OFD file to be merged;
the first processing module is configured to: respectively copying the target file resources in each first OFD decompression folder into the basic OFD file structure body to obtain a target OFD file structure body;
the merging module is used for: and compressing the target OFD file structure to obtain a combined OFD file.
8. The OFD file merging system according to claim 7, further comprising, before the first processing module: a first judgment module; the first judging module is used for:
judging whether the basic OFD file structure contains an OFD.xml file or not to obtain a first judgment result; and when the first judgment result is yes, calling the first processing module.
9. An OFD file splitting system, configured to split the combined OFD file in the OFD file combining system according to claim 8, comprising: the system comprises a second construction module, a second processing module and a splitting module;
the second building block is configured to: decompressing the combined OFD file to obtain a second decompressed OFD folder, and constructing an original split OFD file structure of each file to be split;
the second processing module is used for: obtaining a target split OFD file structure corresponding to the original split OFD file structure of each file to be split based on the MergeInformation.
The splitting module is configured to: and sequentially compressing each target split OFD file structure body to obtain and modify the file suffix names of all split compressed files to obtain all target split OFD files.
10. A storage medium having stored therein instructions, which, when read by a computer, cause the computer to execute an OFD file merging method according to any one of claims 1 to 5, or/and an OFD file splitting method according to claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211067522.4A CN115563055A (en) | 2022-09-01 | 2022-09-01 | OFD document merging and splitting method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211067522.4A CN115563055A (en) | 2022-09-01 | 2022-09-01 | OFD document merging and splitting method, system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115563055A true CN115563055A (en) | 2023-01-03 |
Family
ID=84738935
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211067522.4A Pending CN115563055A (en) | 2022-09-01 | 2022-09-01 | OFD document merging and splitting method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115563055A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116166617A (en) * | 2023-04-20 | 2023-05-26 | 福昕鲲鹏(北京)信息科技有限公司 | Catalog generation method and device for combined open format document OFD |
-
2022
- 2022-09-01 CN CN202211067522.4A patent/CN115563055A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116166617A (en) * | 2023-04-20 | 2023-05-26 | 福昕鲲鹏(北京)信息科技有限公司 | Catalog generation method and device for combined open format document OFD |
CN116166617B (en) * | 2023-04-20 | 2023-08-11 | 福昕鲲鹏(北京)信息科技有限公司 | Catalog generation method and device for combined open format document OFD |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20130067237A1 (en) | Providing random access to archives with block maps | |
US7316015B2 (en) | Method, apparatus, and program for constructing an execution environment, and computer readable medium recording program thereof | |
US8103621B2 (en) | HSM two-way orphan reconciliation for extremely large file systems | |
US11221992B2 (en) | Storing data files in a file system | |
JP2011520189A (en) | Document synchronization via stateless protocol | |
CN106599111B (en) | Data management method and storage system | |
WO2021237467A1 (en) | File uploading method, file downloading method and file management apparatus | |
CN107357920B (en) | Incremental multi-copy data synchronization method and system | |
WO2017036348A1 (en) | Method and device for compressing and decompressing extensible markup language document | |
US20110246451A1 (en) | Storage device having full-text search function | |
CN115563055A (en) | OFD document merging and splitting method, system and storage medium | |
JP4233564B2 (en) | Data processing apparatus, data processing program and recording medium | |
US20100287205A1 (en) | Operating system / electronic device and method for storing or reading a file | |
CN112416879B (en) | NTFS file system-based block-level data deduplication method | |
CN111984591A (en) | File storage method, file reading method, file storage device, file reading device, equipment and computer readable storage medium | |
CN115586872A (en) | Container mirror image management method, device, equipment and storage medium | |
CN107643959B (en) | Mirror image file processing method and device | |
CN113448920B (en) | Method, apparatus and computer program product for managing indexes in a storage system | |
CN111698330B (en) | Data recovery method and device of storage cluster and server | |
WO2018094689A1 (en) | Method, apparatus and device for improving browsing experience | |
CN111694808B (en) | Data processing method and device and computing equipment | |
CN112463736B (en) | Recovery method and system for APFS file | |
CN110109883B (en) | File filtering and storing method and device | |
CN118012656A (en) | Damaged PDF document repairing method, device, equipment and storage medium | |
CN117909138A (en) | File recovery method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |