A method, system and storage medium for merging and splitting OFD documents
By constructing and managing OFD file structures and maintaining filename consistency, the problem of MD5 value changes during OFD document merging and splitting was solved, thus achieving successful seal verification and improved efficiency.
Patent Information
- Application Number
- CN202211067522.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-01
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-09-01
AI Technical Summary
Existing technologies suffer from a problem where signature data changes the MD5 value after merging and splitting OFD documents, leading to signature verification failures.
By constructing a basic OFD file structure, decompressing the files to be merged, copying the target file resources, and maintaining filename consistency during compression, the MergeInformation.xml file is used to record filename changes to ensure that the MD5 value remains unchanged after splitting.
It achieves consistency of MD5 values when merging and splitting OFD documents, ensuring successful verification and improving the efficiency of merging and splitting.
Smart Images

Figure CN115563055B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of OFD document processing technology, and in particular to a method, system, and storage medium for merging and splitting OFD documents. Background Technology
[0002] Currently, the method for merging multiple OFD documents into a single OFD document is generally through the Doc directory or pages within the Doc directory in the OFD target structure. OFD document splitting is also done through pages or Doc directories. If an OFD document is generated by merging multiple OFD documents, it is split, but the MD5 hash of the split OFD document will differ from that of the original OFD document. If the merged OFD documents all contain signature data, since signatures are used to protect the content of the OFD document, the MD5 hash of the split document will change using the existing splitting method, potentially causing signature verification failure.
[0003] Therefore, there is an urgent need to provide a technical solution that, while splitting OFD documents, ensures that the MD5 value of the split OFD documents is the same as that of the original OFD documents before merging, so that the split OFD documents can be successfully verified. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method, system, and storage medium for merging and splitting OFD documents.
[0005] The technical solution of the OFD document merging method of the present invention is as follows:
[0006] S1. Construct a basic OFD file structure and decompress multiple OFD files to be merged to obtain the first OFD decompression folder corresponding to each OFD file to be merged;
[0007] S2. Copy the target file resources from each of the first OFD decompression folders to the basic OFD file structure to obtain the target OFD file structure;
[0008] S3. Compress the target OFD file structure to obtain the merged OFD file.
[0009] The beneficial effects of the OFD document merging method of the present invention are as follows:
[0010] The method of the present invention improves the efficiency of OFD document merging while ensuring that the MD5 values of the split OFD documents are the same as those of the original OFD documents, thus guaranteeing the integrity of the OFD documents.
[0011] Based on the above solution, the OFD document merging method of the present invention can be further improved as follows.
[0012] Furthermore, prior to step S2, the following steps are included:
[0013] S021. Determine whether the basic OFD file structure contains an OFD.xml file to obtain the first determination result;
[0014] S022. If the first judgment result is yes, then step S2 is executed.
[0015] Furthermore, step S2 includes:
[0016] S21. In the basic OFD file structure, determine whether there is a filename that is the same as the filename of each target file resource in each first OFD decompression folder, and obtain all the second judgment results;
[0017] S22. Copy the target file resources corresponding to each filename for which the second judgment result is negative to the basic OFD file structure;
[0018] S23. Modify each filename for which the second judgment result is yes, and copy the target file resources corresponding to each modified filename to the basic OFD file structure. Store each filename before and after modification in the MergeInformation.xml file of the basic OFD file structure to obtain the first OFD file structure.
[0019] S24. Copy the first target content of OFD.xml in each first OFD decompression folder to OFD.xml in the first OFD file structure, and store the second target content of OFD.xml in each first OFD decompression folder to MergeInformation.xml file of the first OFD file structure to obtain the target OFD file structure.
[0020] Furthermore, the MergeInformation.xml file of the basic OFD file structure includes: an OFDInformation node, and step S23 includes:
[0021] S231. Modify the original file name of each target file resource whose second judgment result is yes to the target file name, and copy the target file resource corresponding to each target file name to the basic OFD file structure respectively;
[0022] S232. Store the original filename of each target file resource in the OldName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure, and store the target filename of each target file resource in the NewName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure to obtain the first file structure.
[0023] Furthermore, when the first judgment result is negative, copy the OFD.xml file from any of the first OFD decompression folders to the basic OFD file structure, and return to the execution step S021.
[0024] The technical solution of the OFD file splitting method of the present invention is as follows:
[0025] S100. Decompress the merged OFD file to obtain a second decompressed OFD folder, and construct the original split OFD file structure for each file to be split.
[0026] S200. Based on the MergeInformation.xml file in the second decompressed OFD folder, obtain the target split OFD file structure corresponding to the original split OFD file structure of each file to be split;
[0027] S300. Compress each target split OFD file structure sequentially to obtain and modify the file extensions of all split compressed files to obtain all target split OFD files.
[0028] The beneficial effects of the OFD file splitting method of the present invention are as follows:
[0029] The splitting method of the present invention can accurately obtain each OFD document before merging by splitting the merged OFD document, thereby improving the splitting efficiency of OFD documents.
[0030] The technical solution of the OFD file merging system of the present invention is as follows:
[0031] Includes: a first building module, a first processing module, and a merging module;
[0032] The first building module is used to: build a basic OFD file structure and decompress multiple OFD files to be merged to obtain a first OFD decompression folder corresponding to each OFD file to be merged;
[0033] The first processing module is used to: copy the target file resources of each first OFD decompression folder to the basic OFD file structure to obtain the target OFD file structure;
[0034] The merging module is used to compress the target OFD file structure to obtain a merged OFD file.
[0035] The beneficial effects of the OFD file merging system of the present invention are as follows:
[0036] By merging OFD documents, the efficiency of OFD document merging can be improved, while ensuring that the MD5 values of the split OFD documents are the same as those of the original OFD documents, thus guaranteeing the integrity of the OFD documents.
[0037] Based on the above solution, the OFD file merging system of the present invention can be further improved as follows.
[0038] Furthermore, prior to the first processing module, a first judgment module is included; the first judgment module is used to:
[0039] Determine whether the basic OFD file structure contains an OFD.xml file to obtain a first determination result; if the first determination result is yes, then call the first processing module.
[0040] The technical solution of the OFD file splitting system of the present invention is as follows:
[0041] This includes: a second building module, a second processing module, and a splitting module;
[0042] The second building module is used to: decompress the merged OFD file to obtain a second decompressed OFD folder, and build the original split OFD file structure for each file to be split;
[0043] The second processing module is used to: based on the MergeInformation.xml file in the second decompressed OFD folder, obtain the target split OFD file structure corresponding to the original split OFD file structure of each file to be split;
[0044] The splitting module is used to: sequentially compress each target split OFD file structure to obtain and modify the file extensions of all split compressed files to obtain all target split OFD files.
[0045] The beneficial effects of the OFD file splitting system of the present invention are as follows:
[0046] The splitting system of this invention can accurately obtain each OFD document before merging by splitting the merged OFD document, thereby improving the splitting efficiency of OFD documents.
[0047] The technical solution of a storage medium according to the present invention is as follows:
[0048] The storage medium stores instructions that, when read by a computer, cause the computer to execute steps of an OFD file merging method as described in this invention, or / and an OFD file splitting method as described in this invention. Attached Figure Description
[0049] Figure 1 This is a flowchart illustrating an OFD document merging method according to an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram of OFD.xml in an OFD document merging method according to an embodiment of the present invention;
[0051] Figure 3 This is a schematic diagram of MergeInformation.xml in an OFD document merging method according to an embodiment of the present invention;
[0052] Figure 4 This is a flowchart illustrating an OFD document splitting method according to an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of the OFD document specification in an OFD document merging method according to an embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of the structure of an OFD file merging system according to an embodiment of the present invention;
[0055] Figure 7 This is a schematic diagram of the structure of an OFD document splitting system according to an embodiment of the present invention. Detailed Implementation
[0056] like Figure 1 As shown, an OFD document merging method according to an embodiment of the present invention includes the following steps:
[0057] S1. Construct a basic OFD file structure and decompress multiple OFD files to be merged to obtain the first OFD decompression folder corresponding to each OFD file to be merged.
[0058] The basic OFD file structure is an empty structure used to store the contents of all OFD-related files.
[0059] Each OFD file to be merged is an OFD format file, and each first OFD decompression folder is the folder obtained after decompressing the corresponding OFD file to be merged. Each first OFD decompression folder includes: an OFD.xml file and a Doc_N directory.
[0060] It should be noted that the root directory after decompressing the OFD file contains an OFD.xml file, which is the starting file of the OFD file. There are also multiple Doc_N directories in the root directory, such as Doc_0, Doc_1, etc. The OFD.xml file is a mandatory file in the OFD file, and there is exactly one of them. There are N Doc_N directories.
[0061] S2. Copy the target file resources from each of the first OFD decompression folders to the basic OFD file structure to obtain the target OFD file structure.
[0062] The target file resources include, but are not limited to: the MergeInformation.xml file and the Doc_N directory in the first OFD decompression folder.
[0063] S3. Compress the target OFD file structure to obtain the merged OFD file.
[0064] Specifically, the target OFD file structure is compressed using the zip compression algorithm to obtain the merged OFD file.
[0065] It should be noted that the process of compressing the target OFD file structure using the zip compression algorithm is existing technology and will not be elaborated on here.
[0066] Preferably, before step S2, the following steps are included:
[0067] S021. Determine whether the basic OFD file structure contains an OFD.xml file to obtain the first determination result.
[0068] S022. If the first judgment result is yes, then step S2 is executed.
[0069] Specifically, after constructing the basic OFD file structure, a MergeInformation.xml file is created within the basic OFD file structure. Before copying the target file resources from each of the first OFD decompression folders to the basic OFD file structure, it is determined whether the basic OFD file structure contains an OFD.xml file. If yes, step S2 is executed. If not, all files and directories from any of the first OFD decompression folders are copied to the basic OFD file structure. At this point, the basic OFD file structure includes OFD.xml, and the process returns to step S021.
[0070] It should be noted that the purpose of the MergeInformation.xml file is to store information about the OFD files before and after the merge during the OFD file merging process, and to use this information to perform the splitting process during the splitting process. The naming of the MergeInformation.xml file can be modified and set according to needs, and there are no restrictions here.
[0071] Preferably, step S2 includes:
[0072] S21. In the basic OFD file structure, determine whether there is a filename that is the same as the filename of each target file resource in each first OFD decompression folder, and obtain all the second judgment results.
[0073] Specifically, for example, if a MergeInformation.xml file exists in any first OFD decompression folder, then it is determined that there exists a MergeInformation.xml file with the same filename as the MergeInformation.xml file in that first OFD decompression folder.
[0074] S22. Copy the target file resources corresponding to each filename for which the second judgment result is negative to the basic OFD file structure.
[0075] Specifically, when the filename of any target file resource does not exist in the basic OFD file structure, the target file resource is directly copied into the basic OFD file structure, until the target file resource corresponding to each filename that does not exist in the basic OFD file structure is copied into the basic OFD file structure.
[0076] S23. Modify the filename of each file whose second judgment result is yes, and copy the target file resource corresponding to each modified filename to the basic OFD file structure. Store the filename before and after each modification in the MergeInformation.xml file of the basic OFD file structure to obtain the first OFD file structure.
[0077] Specifically, for example, if a MergeInformation.xml file exists in any of the first OFD decompression folders, then rename the file to MergeInformationN.xml (N represents 0, 1, 2, etc.). The modified filename, MergeInformationN.xml, is then copied to the basic OFD file structure. The original and modified filenames, MergeInformation.xml and MergeInformationN.xml, from the first OFD decompression folder are also stored in the MergeInformation.xml file of the basic OFD file structure. This process continues until the target file resources corresponding to each modified filename are copied to the basic OFD file structure, and the original and modified filenames are stored in the MergeInformation.xml file of the basic OFD file structure, thus obtaining the first OFD file structure.
[0078] It should be noted that, as Figure 2 As shown, for the first OFD decompression folder of the first copy (any first OFD decompression folder is selected as the first OFD decompression folder of the first copy), some key information of the OFD.xml file, as well as the directory name and file name under the first OFD decompression folder of the first copy, need to be recorded in the MergeInformation.xml file of the basic OFD file structure. The main records are the names of the files and directories before copying, as well as the header information of OFD.xml.
[0079] S24. Copy the first target content of OFD.xml in each first OFD decompression folder to OFD.xml in the first OFD file structure, and store the second target content of OFD.xml in each first OFD decompression folder to MergeInformation.xml file of the first OFD file structure to obtain the target OFD file structure.
[0080] The first target content is: DocBody. Specifically, modify the N in DOC_N of DocBody in the OFD.xml file to the value in NewName, and then copy the modified DocBody into the OFD.xml of the first OFD file structure.
[0081] The second target content is: <?xml> and <ofd:ofd>Specifically, extract the <?xml> and <?xml> elements from the OFD.xml file in each first OFD unzipped folder. <ofd:ofd>The target OFD file structure is obtained by storing the data in the MergeInformation.xml file of the first OFD file structure.
[0082] It should be noted that each OFD file has an OFD.xml file, but the content of the <?xml> tags in each OFD.xml file is different from... <ofd:ofd>The content may differ, so the content of these two files is stored to generate the corresponding OFD.xml file during the splitting process.
[0083] Preferably, the MergeInformation.xml file of the basic OFD file structure includes: an OFDInformation node, and step S23 includes:
[0084] S231. Modify the original file name of each target file resource whose second judgment result is yes to the target file name, and copy the target file resource corresponding to each target file name to the basic OFD file structure respectively.
[0085] In the example above, MergeInformation.xml is the original filename, and MergeInformationN.xml is the target filename.
[0086] S232. Store the original filename of each target file resource in the OldName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure, and store the target filename of each target file resource in the NewName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure to obtain the first file structure.
[0087] Specifically, such as Figure 3 As shown, the original filename of each target file resource is stored in the OldName attribute of the OFDInformation node in the MergeInformation.xml file of the underlying OFD file structure, such as... Figure 3 The `OldName` parameter is set to "DOC_0"; and the target filename for each target file resource is stored in the `NewName` attribute of the `OFDInformation` node in the `MergeInformation.xml` file of the base OFD file structure, such as... Figure 3 The value of NewName is "DOC_1", which ultimately yields the first file structure.
[0088] Furthermore, to better explain the technical solution of this embodiment, the following steps are used for detailed description. The technical solution of this embodiment may also adopt the following steps:
[0089] 1) Create the basic OFD file structure;
[0090] 2) Create a MergeInformation.xml file within the basic OFD file structure;
[0091] 3) Decompress each OFD file to be merged to obtain the first OFD decompression folder corresponding to each OFD file to be merged;
[0092] 4) Copy the files and directories in the first OFD decompression folder to the basic OFD file structure;
[0093] 5) If there is a MergeInformation.xml file in the first OFD extraction folder, rename the file to MergeInformationN.xml;
[0094] 6) Store some target information of the OFD.xml file in the first OFD decompression folder, the directory name under the first OFD decompression folder, and the file names before and after modification into the MergeInformation.xml file of the basic OFD file structure. The target information includes: the header information in OFD.xml;
[0095] 7) Copy the directory files from each remaining OFD decompression folder to the basic OFD file structure; if any directory or file name already exists, rename it.
[0096] 8) Store the name information before and after each modification in the MergeInformation.xml file. The name before modification is stored in the OldName attribute of OFDFile in the OFDInformation node, and the name after modification is stored in the NewName attribute of OFDFile in the OFDInformation node.
[0097] 9) Extract the <?xml> file from the OFD.xml file in each of the remaining OFD extraction folders. <ofd:ofd>Copy the data to the MergeInformation.xml file of the basic OFD file structure; and modify the N in DOC_N of DocBody in each remaining OFD.xml file under the OFD decompression folder to the value in NewName, and copy DocBody to OFD.xml in the basic OFD file structure to obtain the target OFD file structure;
[0098] 10) Compress the target OFD file structure to obtain the merged OFD file.
[0099] The technical solution of this embodiment improves the efficiency of OFD document merging while ensuring that the MD5 values of the split OFD documents are the same as those of the original OFD documents, thus guaranteeing the integrity of the OFD documents.
[0100] like Figure 4 As shown, an OFD file splitting method according to an embodiment of the present invention is used to split the merged OFD file in an OFD file merging method according to an embodiment of the present invention, including the following steps:
[0101] S100. Decompress the merged OFD file to obtain a second decompressed OFD folder, and construct the original split OFD file structure for each file to be split.
[0102] The process of decompressing the merged OFD files is existing technology. The second decompressed OFD folder is the folder obtained after decompressing the merged OFD files.
[0103] The original split OFD file structure is an empty structure that stores the contents of all related OFD files. Each original split OFD file structure is eventually compressed into a target split OFD file.
[0104] S200. Based on the MergeInformation.xml file in the second decompressed OFD folder, obtain the target split OFD file structure corresponding to the original split OFD file structure of each file to be split.
[0105] Specifically, based on the MergeInformation.xml file, the OFDxml content under each OFDDocument node is obtained; based on the obtained OFDxml information, a corresponding OFD.xml file is created in each original split OFD file structure; the child nodes OFDInformation nodes under each OFDDocument node are obtained, and the values of the OldName and NewName attributes in the child nodes OFDFile under the OFDInformation node are stored in a map, where the key of the map is the value of NewName and the value is the value of OldName; the map is traversed, and the matching values in the second uncompressed OFD folder are retrieved. The system renames the required directories and files and copies them to the corresponding original split OFD file structures. It then iterates through all DocRoot nodes in the OFD.xml file in the second unzipped OFD folder. It retrieves the content of each DocRoot node, splits the strings, and obtains all the strings. For each string, it searches the map. If any string exists in the map, it modifies the content of all protected Doc_N nodes in the DocBody content of the parent node of the DocRoot node to the correct Doc_N value. Then, according to the OFD specification, it copies the DocBody content to the OFD.xml file of the corresponding original split OFD file structure, thus obtaining all the target split OFD file structures.
[0106] The `map` node is a container that stores multiple data items in pairs. It stores the filenames before and after a file modification, and during splitting, the filenames are modified to match the original filenames based on the `map` node. The `OFDFile` node stores the filename changes of OFD files during a merge operation. Because the original filenames of OFD files are renamed during merging, this node records the original and renamed filenames, ensuring a one-to-one correspondence.
[0107] The preset requirement is: the content of all OFDInformation nodes stored during the merging process.
[0108] Among them, the OFD specification is as follows Figure 4 As shown, this is a standard technical specification, which will not be elaborated upon here.
[0109] S300. Compress each target split OFD file structure sequentially to obtain and modify the file extensions of all split compressed files to obtain all target split OFD files.
[0110] Each target split OFD file structure is compressed using zip, and the file extension of each compressed file is changed to ofd to obtain all target split OFD files.
[0111] Furthermore, to better explain the technical solution of this embodiment, the following steps are used for detailed description. The technical solution of this embodiment may also adopt the following steps:
[0112] 1) Unzip the merged OFD file to obtain a second unzipped OFD folder;
[0113] 2) Check if the second extracted OFD folder contains a MergeInformation.xml file;
[0114] 3) If a MergeInformation.xml file exists, create multiple ofd files based on the MergeInformation.xml file;
[0115] 4) Create the original split OFD file structure and obtain the OFDxml file under each OFDDocument node in the MergeInformation.xml file;
[0116] 5) Create an OFD.xml file in the corresponding original split OFD file structure for each OFD.xml file;
[0117] 6) Based on the OFDInformation node, a child node of the OFDDocument node, store the values of the OldName and NewName attributes in the OFDFile node, a child node of the OFDInformation node, in a map. The key of the map is the value of NewName, and the value is the value of OldName.
[0118] 7) Traverse the map, rename the directories and files that meet the requirements in the second OFD decompression folder, and then copy them to the corresponding original split OFD file structure;
[0119] 8) Open the OFD.xml file in the extracted folder and iterate through all the DocRoot nodes in OFD.xml;
[0120] 9) Obtain the content of DocRoot, then split the string to get all the strings;
[0121] 10) If the obtained string is found in the map, modify the content of all protected Doc_N nodes in the content of the parent node DocBody of the DocRoot node to the correct Doc_N value, and then copy the DocBody content to the OFD file structure OFD.xml according to the OFD specification.
[0122] 11) Compress each target split OFD file structure sequentially, and modify the file extension of all split compressed files to obtain all target split OFD files.
[0123] The splitting method in this embodiment can accurately obtain each OFD document before merging by splitting the merged OFD document, thus improving the efficiency of OFD document splitting.
[0124] like Figure 5 As shown, an OFD file merging system 400 according to an embodiment of the present invention includes: a first construction module 410, a first processing module 420 and a merging module 430;
[0125] The first construction module 410 is used to: construct a basic OFD file structure and decompress multiple OFD files to be merged to obtain a first OFD decompression folder corresponding to each OFD file to be merged;
[0126] The first processing module 420 is used to: copy the target file resources of each first OFD decompression folder to the basic OFD file structure to obtain the target OFD file structure;
[0127] The merging module 430 is used to: compress the target OFD file structure to obtain the merged OFD file.
[0128] The technical solution of this embodiment improves the efficiency of OFD document merging while ensuring that the MD5 values of the split OFD documents are the same as those of the original OFD documents, thus guaranteeing the integrity of the OFD documents.
[0129] The parameters and steps for implementing the corresponding functions of each module in the OFD file merging system 400 of this embodiment can be referred to the parameters and steps in the embodiment of the OFD file merging method above, and will not be repeated here.
[0130] like Figure 6 As shown, an OFD file splitting system 500 according to an embodiment of the present invention is used to split the merged OFD file in an OFD file merging system according to an embodiment of the present invention, including: a second construction module 510, a second processing module 520 and a splitting module 530.
[0131] The second construction module 510 is used to: decompress the merged OFD file to obtain a second decompressed OFD folder, and construct the original split OFD file structure for each file to be split;
[0132] The second processing module 520 is used to: based on the MergeInformation.xml file in the second decompressed OFD folder, obtain the target split OFD file structure corresponding to the original split OFD file structure of each file to be split;
[0133] The splitting module 530 is used to: sequentially compress each target split OFD file structure to obtain and modify the file extension of all split compressed files to obtain all target split OFD files.
[0134] The splitting method in this embodiment can accurately obtain each OFD document before merging by splitting the merged OFD document, thus improving the efficiency of OFD document splitting.
[0135] The parameters and steps for implementing the corresponding functions of each module in the OFD file splitting system 500 described above in this embodiment can be referred to the parameters and steps in the embodiment of the OFD file splitting method above, and will not be repeated here.
[0136] An embodiment of the present invention provides a storage medium, comprising: the storage medium storing instructions, which, when a computer reads the instructions, cause the computer to execute steps such as an OFD file merging method, or / and steps such as an OFD file splitting method. For details, please refer to the parameters and steps in the embodiments of the OFD file merging method, or / and OFD file splitting method described above, which will not be repeated here.
[0137] Computer storage media include, for example, USB flash drives and external hard drives.
[0138] Those skilled in the art will know that the present invention can be implemented as a method, system, and storage medium.
[0139] Therefore, the present invention can be implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present invention can also be implemented as a computer program product contained in one or more computer-readable media, which contains computer-readable program code. Any combination of one or more computer-readable media can be used. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. Although embodiments of the invention have been shown and described above, it is to be understood that these embodiments are exemplary and should not be construed as limiting the invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the invention.< / ofd:ofd> < / ofd:ofd> < / ofd:ofd> < / ofd:ofd>
Claims
1. An OFD file merging method, characterized by, The method comprises the following steps: S1, constructing a basic OFD file structure and decompressing a plurality of to-be-merged OFD files to obtain a first OFD decompression folder corresponding to each to-be-merged OFD file; S2, copying target file resources in each first OFD decompression folder into the basic OFD file structure to obtain a target OFD file structure; S3, compressing the target OFD file structure to obtain a merged OFD file; Step S2 comprises: S21, judging whether there is a same file name as each target file resource in each first OFD decompression folder in the basic OFD file structure to obtain all second judgment results; S22, copying target file resources corresponding to each file name with a second judgment result of no into the basic OFD file structure; S23, modifying each file name with a second judgment result of yes to obtain target file resources corresponding to each modified file name and copying the target file resources into the basic OFD file structure, and storing each file name before and after modification into a MergeInformation.xml file of the basic OFD file structure to obtain a first OFD file structure; S24, copying first target content of OFD.xml in each first OFD decompression folder into OFD.xml of the first OFD file structure and storing second target content of OFD.xml in each first OFD decompression folder into a MergeInformation.xml file of the first OFD file structure to obtain the target OFD file structure; The MergeInformation.xml file of the basic OFD file structure comprises an OFDInformation node, and step S23 comprises: S231, modifying original file names of each target file resource with a second judgment result of yes into target file names and copying target file resources corresponding to each target file name into the basic OFD file structure; S232, storing original file names of each target file resource into an OldName attribute of an OFDInformation node of a MergeInformation.xml file of the basic OFD file structure and storing target file names of each target file resource into a NewName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure to obtain the first OFD file structure.
2. The OFD file merging method of claim 1, wherein, Before step S2, comprising: S021, judging whether the basic OFD file structure contains an OFD.xml file to obtain a first judgment result; S022, when the first judgment result is yes, performing step S2.
3. The OFD file merging method of claim 2, wherein, When the first determination result is no, OFD.xml in any first OFD decompression folder is copied to the basic OFD file structure, and the step S021 is returned to execute.
4. An OFD file splitting method, characterized by, The method comprises the following steps: S100, decompressing the merged OFD file to obtain a second decompression 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 MergeInformation.xml file in the second decompression OFD folder; S300, sequentially compressing each target split OFD file structure to obtain all target split OFD files by modifying the file suffixes of all split compressed files.
5. An OFD file merging system, characterized by, Comprise: A first construction module, a first processing module and a merging module; The first construction module is configured to construct a basic OFD file structure, and decompress a plurality of OFD files to be merged to obtain a first OFD decompression folder corresponding to each OFD file to be merged; The first processing module is configured to copy target file resources in each first OFD decompression folder into the basic OFD file structure to obtain a target OFD file structure; The merging module is configured to compress the target OFD file structure to obtain a merged OFD file; The first processing module is specifically configured to: In the basic OFD file structure, determine whether there is a same file name as each target file resource in each first OFD decompression folder to obtain all second determination results; Copy the target file resources corresponding to each file name with a second determination result of no into the basic OFD file structure; Modify each file name with a second determination result of yes to obtain the target file resources corresponding to each modified file name, copy the target file resources into the basic OFD file structure, and store each file name before and after the modification into a MergeInformation.xml file in the basic OFD file structure to obtain a first OFD file structure; Copy a first target content of OFD.xml in each first OFD decompression folder into OFD.xml in the first OFD file structure, and store a second target content of OFD.xml in each first OFD decompression folder into a MergeInformation.xml file in the first OFD file structure to obtain the target OFD file structure; The MergeInformation.xml file of the basic OFD file structure body includes an OFDInformation node, each file name for which the second determination result is YES is modified, each target file resource corresponding to each modified file name is copied to the basic OFD file structure body, each file name before and after the modification is stored in the MergeInformation.xml file of the basic OFD file structure body, and a first OFD file structure body is obtained, including: The original file name of each target file resource for which the second determination result is YES is modified into a target file name, and each target file resource corresponding to each target file name is copied to the basic OFD file structure body; The original file name of each target file resource is stored in the OldName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure body, and the target file name of each target file resource is stored in the NewName attribute of the OFDInformation node of the MergeInformation.xml file of the basic OFD file structure body, and the first OFD file structure body is obtained.
6. The OFD file merging system of claim 5, wherein, Before the first processing module, further comprising a first judgment module; the first judgment module is used for: determining whether the basic OFD file structure body contains an OFD.xml file to obtain a first determination result; when the first determination result is YES, the first processing module is called.
7. An OFD file splitting system characterized by, The OFD file merging system of claim 6 is used to split the merged OFD file, comprising a second construction module, a second processing module and a splitting module; The second construction module is used for: decompressing the merged 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: based on the MergeInformation.xml file in the second decompressed OFD folder, obtaining a target split OFD file structure body corresponding to the original split OFD file structure body of each file to be split; The splitting module is used for: sequentially compressing each target split OFD file structure body, modifying the file suffix name of all split compressed files to obtain all target split OFD files.
8. A storage medium, characterized by The storage medium stores instructions, when the computer reads the instructions, the computer executes the OFD file merging method of any one of claims 1 to 3, or / and the OFD file splitting method of claim 4.
Citation Information
Patent Citations
Method and device for combining multi-format files into OFD file
CN113961531A
Process Efficient Preprocessing For Any Encryption Standard
US20160234011A1