A method and apparatus for packaging electronic documents
By receiving, verifying, and encapsulating electronic format files to generate OPG files, the problem of secure and efficient transfer of multiple OFD files within the same OPG file is solved, achieving efficient circulation and security of multiple versions of electronic files.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies have not been able to effectively solve the problem of how to securely and efficiently transfer/transmit multiple OFD files within the same OPG file.
Receive electronic document templates, verify their validity, encapsulate multiple valid electronic document templates into a preset file structure based on preset file hierarchy rules, generate an OPG file, and sign it using electronic signature data.
It enables the efficient circulation of multiple versions of electronic documents on a single carrier, ensuring document security and integrity.
Smart Images

Figure CN116266199B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an electronic document encapsulation method and apparatus. Background Technology
[0002] Electronic voucher OPG files are a packaged format based on OFD files, used in fields such as electronic invoices, electronic documents, archives, electronic certificates, and electronic contracts. They are compatible with existing paper vouchers, supporting reading and printing with common format reading software, and providing a consistent or similar display / reading and printing experience. They have a complete electronic signature or digital signature mechanism; all data within the file is protected by electronic signature data or digital signatures, and any modification to the electronic voucher should be detectable. The appearance of the seal or a specific area is associated with the electronic signature data or voucher data within the file, facilitating verification. They have attachment and extension mechanisms, supporting the inclusion of additional background information related to the voucher as attachments. They support characters specified in GB 18030 and are easy for both machine and human reading.
[0003] Therefore, how to enable multiple OFD files to coexist in the same OPG file to facilitate the secure and efficient transfer / transmission of multiple versions of OFD files is an urgent problem to be solved. Summary of the Invention
[0004] This application provides an electronic document encapsulation method and apparatus.
[0005] In a first aspect, this application provides a method for encapsulating electronic documents, the method comprising:
[0006] Receive electronic files;
[0007] Verify the validity of the electronic document;
[0008] Based on preset file hierarchy rules, multiple verified and valid electronic format files are encapsulated into a preset file structure.
[0009] Optionally, the steps for receiving electronic files include:
[0010] Receive electronic files via a Java interface.
[0011] Optionally, the electronic document is an OFD (Open Document Format) document, and includes electronic signature data; the steps for verifying the validity of the electronic document include:
[0012] Obtain the first electronic signature data of the electronic document;
[0013] Determine the validity of the first electronic signature data;
[0014] If the first electronic signature data is determined to be valid, then the validity of the electronic document is determined.
[0015] Optionally, the step of encapsulating multiple verified electronic format files into a preset file structure based on preset file hierarchy rules includes:
[0016] Based on preset file hierarchy rules, multiple electronic format files are embedded into a specific file structure;
[0017] Generate its description file and entry file according to the standard format of OPG files, and package them to generate the corresponding OPG files.
[0018] Optionally, the method further includes:
[0019] Obtain the second electronic signature data and verify the validity of the second electronic signature data;
[0020] If the second electronic seal data is verified to be valid, the OPG file is signed based on the second electronic seal data.
[0021] Secondly, this application provides an electronic document packaging device, the device comprising:
[0022] The receiving unit is used to receive electronic format files;
[0023] Verification unit, used to verify the validity of the electronic document;
[0024] The encapsulation unit is used to encapsulate multiple verified electronic format files into a preset file structure based on preset file hierarchy rules.
[0025] Optionally, when receiving electronic format files, the receiving unit is specifically used for:
[0026] Receive electronic files via a Java interface.
[0027] Optionally, the electronic document is an OFD open format document, and includes electronic signature data; when verifying the validity of the electronic document, the verification unit is specifically used for:
[0028] Obtain the first electronic signature data of the electronic document;
[0029] Determine the validity of the first electronic signature data;
[0030] If the first electronic signature data is determined to be valid, then the validity of the electronic document is determined.
[0031] Optionally, when encapsulating multiple verified electronic format files into a preset file structure based on preset file hierarchy rules, the encapsulation unit is specifically used for:
[0032] Based on preset file hierarchy rules, multiple electronic format files are embedded into a specific file structure;
[0033] Generate its description file and entry file according to the standard format of OPG files, and package them to generate the corresponding OPG files.
[0034] Optionally, the device further includes:
[0035] The acquisition unit is used to acquire the second electronic signature data;
[0036] The verification unit is also used to verify the validity of the second electronic signature data;
[0037] If the verification unit verifies that the second electronic seal data is valid, the signing unit is used to sign the OPG file based on the second electronic seal data.
[0038] Thirdly, this application provides an electronic document packaging device, the device comprising:
[0039] Memory, used to store program instructions;
[0040] A processor is configured to invoke program instructions stored in the memory and execute the steps of the method as described in any one of the first aspects above, according to the obtained program instructions.
[0041] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of the method as described in any of the first aspects above.
[0042] In summary, the electronic document encapsulation method provided in this application embodiment receives electronic format files; verifies the validity of the electronic format files; and encapsulates multiple verified valid electronic format files into a preset file structure based on preset file hierarchy rules.
[0043] The electronic document encapsulation method provided in this application embodiment can accommodate multiple versions of electronic documents into one OPG file, which is a carrier for realizing the derivative functions of multi-version electronic documents. Multiple versions of electronic documents can be circulated through multiple channels in one carrier, realizing the efficient circulation of multiple versions of electronic documents. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments of this application or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings of the embodiments of this application.
[0045] Figure 1 A detailed flowchart of an electronic document packaging method provided for embodiments of this application;
[0046] Figure 2 This application provides a schematic diagram of an electronic document packaging process.
[0047] Figure 3 This is a schematic diagram of the structure of an electronic document packaging device provided in an embodiment of this application;
[0048] Figure 4 This is a schematic diagram of another electronic document packaging device provided in an embodiment of this application. Detailed Implementation
[0049] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0050] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to a determination."
[0051] For example, see Figure 1 The diagram shown is a detailed flowchart of an electronic document packaging method provided in an embodiment of this application. The method includes the following steps:
[0052] Step 100: Receive the electronic version file.
[0053] In this embodiment of the application, a preferred approach to receiving electronic files is to receive them via a Java interface.
[0054] In practical applications, if the interface for receiving electronic files is developed based on a JAVA interface, the generation efficiency will be higher, the cross-platform applicability will be stronger, and the user experience will be better.
[0055] Step 110: Verify the validity of the electronic document.
[0056] In this embodiment of the application, the file type of the electronic layout document is OFD (Open Fixed-layout Document), and the electronic layout document includes electronic signature data.
[0057] Therefore, in this embodiment of the application, the steps for verifying the validity of the electronic document include:
[0058] Obtain the first electronic signature data of the electronic document; determine the validity of the first electronic signature data; if the first electronic signature data is determined to be valid, then determine the validity of the electronic document.
[0059] In other words, when an electronic document is generated, it is signed using valid electronic signature data to prevent unauthorized alteration during transmission. In this embodiment, upon receiving an electronic document, its legitimacy needs to be verified, specifically the validity of the electronic signature data it contains. If the verification confirms the validity of the electronic signature data, then the electronic document is deemed valid.
[0060] Step 120: Based on the preset file hierarchy rules, encapsulate multiple verified and valid electronic format files into the preset file structure.
[0061] In this embodiment of the application, when multiple verified electronic format files are packaged into a preset file structure based on preset file hierarchy rules, a preferred implementation is to embed multiple electronic format files into a specific file structure based on preset file hierarchy rules; generate its description file and entry file according to the standard format of OPG (OpenPackage) file, and package it to generate the corresponding OPG file.
[0062] In other words, multiple OFD files can be packaged into a single multi-version OPG file based on preset file hierarchy rules. That is, based on preset storage rules for each file / its different content, each file / its different content is stored in a preset file structure.
[0063] Furthermore, in this embodiment of the application, the above-mentioned file encapsulation method may further include the following steps:
[0064] Obtain the second electronic signature data and verify its validity; if the second electronic signature data is verified to be valid, then sign the OPG file based on the second electronic signature data.
[0065] Specifically, each received OFD file carries an invoice identifier. After embedding each OFD file into a specific file structure to generate the corresponding OPG file, a second electronic signature data matching the invoice identifier can be obtained based on the invoice identifier included in each OFD file. This electronic signature data includes at least electronic seal information and digital signature information.
[0066] Next, the validity of the second electronic signature data needs to be verified. Once the validity of the second electronic signature data is confirmed, it can be used to sign the OPG file generated above.
[0067] The electronic document encapsulation method provided in this application embodiment will be described in detail below with reference to a specific application scenario (electronic voucher issuance scenario). For example, see [link to relevant documentation]. Figure 2 The diagram shown is a schematic representation of an electronic document packaging process according to an embodiment of this application. The method includes the following steps:
[0068] Step 1: The issuing end receives electronic voucher data.
[0069] Specifically, electronic voucher data includes at least invoice identifiers, which include: invoice type, invoice code, invoice number, etc.
[0070] Step 2: Select the matching electronic voucher template.
[0071] Preferably, an electronic voucher template that matches the invoicing identifier included in the electronic voucher data can be selected from the template library.
[0072] Step 3: Fill the selected template with the electronic voucher data according to certain calculation rules.
[0073] Specifically, the process involves parsing the electronic voucher template and calculating the coordinates, font, size, and alignment of the voucher data according to certain rules. The electronic voucher data is then filled into the template. These calculation rules can be understood as a series of formatting specifications established by the State Taxation Administration for electronic invoice templates, including the absolute and relative positions, alignment, line breaks, font, and size of the content on the voucher.
[0074] Step 4: Generate OFD electronic voucher A for the issuing end.
[0075] Specifically, after generating the OFD electronic voucher A at the issuing end, the OFD electronic voucher A is signed using first electronic signature data that matches the invoicing identifier included in the electronic voucher data received by the issuing end. Simultaneously, the issuing end sends the signed OFD electronic voucher A to the receiving end.
[0076] Step 5: The receiving end receives the electronic voucher data.
[0077] At the same time, the receiving end receives electronic voucher A sent by the issuing end.
[0078] Step 6: The receiving end verifies the validity of the OFD electronic signature data.
[0079] Specifically, the receiving end verifies the validity of the electronic signature data of OFD electronic credential A, and if the verification is valid, proceeds to step 7.
[0080] Step 7: Select the matching electronic voucher template.
[0081] Step 8: Fill the selected template with the electronic voucher data according to certain calculation rules.
[0082] Step 9: Generate OFD electronic credentials B for the receiving end.
[0083] Step 10: Generate an OPG type package file from A and B according to certain rules.
[0084] OFD e-credentials A and B will be packaged into an OPG type file according to certain rules.
[0085] Step 11: Obtain the matching electronic signature data.
[0086] Step 12: Verify the validity of the electronic signature data.
[0087] Step 13: Generate OPG electronic credentials containing electronic signature data.
[0088] Based on the same inventive concept as the above-described method embodiments, see, for example, the following: Figure 3 The diagram shown is a structural schematic of an electronic document packaging device provided in an embodiment of this application. The device includes:
[0089] Receiving unit 30 is used to receive electronic format files;
[0090] Verification unit 31 is used to verify the validity of the electronic document;
[0091] The encapsulation unit 32 is used to encapsulate multiple verified electronic format files into a preset file structure based on preset file hierarchy rules.
[0092] Optionally, when receiving electronic format files, the receiving unit 30 is specifically used for:
[0093] Receive electronic files via a Java interface.
[0094] Optionally, the electronic document is an OFD open format document, and includes electronic signature data; when verifying the validity of the electronic document, the verification unit 31 is specifically used for:
[0095] Obtain the first electronic signature data of the electronic document;
[0096] Determine the validity of the first electronic signature data;
[0097] If the first electronic signature data is determined to be valid, then the validity of the electronic document is determined.
[0098] Optionally, when encapsulating multiple verified electronic format files into a preset file structure based on preset file hierarchy rules, the encapsulation unit 32 is specifically used for:
[0099] Based on preset file hierarchy rules, multiple electronic format files are embedded into a specific file structure;
[0100] Generate its description file and entry file according to the standard format of OPG files, and package them to generate the corresponding OPG files.
[0101] Optionally, the device further includes:
[0102] The acquisition unit is used to acquire the second electronic signature data;
[0103] The verification unit is also used to verify the validity of the second electronic signature data;
[0104] If the verification unit verifies that the second electronic seal data is valid, the signing unit is used to sign the OPG file based on the second electronic seal data.
[0105] In summary, the electronic document encapsulation method provided in this application embodiment receives electronic format files; verifies the validity of the electronic format files; and encapsulates multiple verified valid electronic format files into a preset file structure based on preset file hierarchy rules.
[0106] The electronic document encapsulation method provided in this application embodiment can accommodate multiple versions of electronic documents into one OPG file, which is a carrier for realizing the derivative functions of multi-version electronic documents. Multiple versions of electronic documents can be circulated through multiple channels in one carrier, realizing the efficient circulation of multiple versions of electronic documents.
[0107] These units can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when one of these units is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these units can be integrated together to form a system-on-a-chip (SOC).
[0108] Furthermore, regarding the electronic document packaging device provided in this application embodiment, from a hardware perspective, the hardware architecture schematic diagram of the electronic document packaging device can be found in [reference needed]. Figure 4 As shown, the electronic document packaging device may include: a memory 40 and a processor 41.
[0109] The memory 40 is used to store program instructions; the processor 41 calls the program instructions stored in the memory 40 and executes the above method embodiment according to the obtained program instructions. The specific implementation method and technical effect are similar, and will not be described again here.
[0110] Optionally, this application also provides an electronic document packaging device, including at least one processing element (or chip) for performing the above method embodiments.
[0111] Optionally, this application also provides a program product, such as a computer-readable storage medium storing computer-executable instructions for causing the computer to perform the above-described method embodiments.
[0112] Here, a machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, a machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0113] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0114] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0115] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0117] Furthermore, these computer program instructions can also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0119] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for packaging electronic documents, characterized in that, The method includes: Receive multiple electronic document formats; wherein, the electronic document format is of OFD (Open Document Format) type and includes electronic signature data; Verify the validity of the electronic document; this step specifically involves: obtaining the first electronic signature data of the electronic document; and determining the validity of the first electronic signature data. Based on preset file hierarchy rules, multiple verified electronic format files are encapsulated into a preset file structure. This step specifically involves: embedding multiple electronic format files into a preset file structure based on preset file hierarchy rules; generating its description file and entry file according to the standard format of OPG files, and packaging them to generate the corresponding OPG files. The method further includes acquiring second electronic signature data and verifying the validity of the second electronic signature data; if the second electronic signature data is verified to be valid, the OPG file is signed based on the second electronic signature data.
2. The method as described in claim 1, characterized in that, The steps for receiving electronic files include: Receive electronic files via a Java interface.
3. An electronic document packaging device, characterized in that, The device includes: The receiving unit is used to receive multiple electronic document formats; the file type of the electronic document format is OFD (Open Document Format), and the electronic document format includes electronic signature data; Verification unit, used to verify the validity of the electronic document; The encapsulation unit is used to encapsulate multiple verified electronic format files into a preset file structure based on preset file hierarchy rules. When verifying the validity of the electronic document, the verification unit is specifically used to: obtain the first electronic signature data of the electronic document; determine the validity of the first electronic signature data; and if the first electronic signature data is determined to be valid, then determine the validity of the electronic document. The encapsulation unit is also specifically used for: embedding multiple electronic format files into a preset file structure based on preset file hierarchy rules; generating its description file and entry file according to the standard format of OPG files, and packaging them to generate the corresponding OPG files; It also includes: an acquisition unit and a signing unit, wherein the acquisition unit is used to acquire second electronic signature data; the verification unit is also used to verify the validity of the second electronic signature data; and the signing unit is used to sign the OPG file based on the second electronic signature data if the verification unit verifies that the second electronic signature data is valid.
4. The apparatus as described in claim 3, characterized in that, When receiving electronic format files, the receiving unit is specifically used for: Receive electronic files via a Java interface.
Citation Information
Patent Citations
Electronic file packaging method
CN112464267A