A conversion method, system and related device based on OFD electronic invoice file

By analyzing and verifying the OFD electronic invoice file and converting it into the target format, the problem that the OFD electronic invoice file can only be previewed on the Windows operating system is solved, and normal display and use on other electronic devices is achieved.

CN114970496BActive Publication Date: 2025-03-18KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210591058.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2025-03-18
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

The OFD electronic invoice file can only be previewed on the Windows operating system and cannot be displayed normally on other electronic devices, resulting in inconvenience in use.

Method used

By obtaining OFD electronic invoice files, parsing its structure directory files, signature result files and signature files, and after verification, converting them to the target format (such as PDF, picture, or SVG) for display on other electronic devices.

Benefits of technology

It realizes that OFD electronic invoice files are displayed normally on electronic devices other than Windows operating systems, improving user convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114970496B_ABST
    Figure CN114970496B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a conversion method based on OFD electronic invoice files and a related device, which is used to convert the OFD electronic invoice file into an electronic invoice file in a target format so as to be displayed on a target electronic device. The method of the embodiment of the present application includes: obtaining an OFD electronic invoice file; parsing the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file; verifying the structure directory file and the seal file according to the signature result file; if the signature verification passes, converting the OFD electronic invoice file into an electronic invoice file in a target format for display.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic invoices, and in particular to a conversion method, system and related devices based on OFD electronic invoice files. Background Art

[0002] OFD (Open Fixed-layout Document) is a national standard for layout documents developed by the Layout Writing Group established by the China Electronics Standardization Institute under the leadership of the Software Department of the Ministry of Industry and Information Technology. It is an independent format in China that facilitates the storage, reading and editing of electronic documents.

[0003] With the announcement in the "Announcement of the State Administration of Taxation on the Comprehensive Service Platform for Value-Added Tax Invoices and Other Matters" (Announcement No. 1 of the State Administration of Taxation in 2020), that "the format of the VAT electronic general invoice layout file is OFD format", the OFD document format has gradually become known to the public.

[0004] OFD is currently widely used in administrative office documents, electronic invoices and other fields. However, OFD files currently only support preview on the Windows operating system and cannot be displayed normally on other electronic devices, which brings many inconveniences to enterprises and users. Summary of the invention

[0005] The embodiments of the present application provide a conversion method, system and related device based on OFD electronic invoice files, which are used to convert OFD electronic invoice files into electronic invoice files in a target format so as to facilitate display on a target electronic device other than a Windows operating system.

[0006] The first aspect of the embodiment of the present application provides a conversion method based on OFD electronic invoice files, which is characterized by comprising:

[0007] Obtain OFD electronic invoice files;

[0008] Parsing the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0009] Verify the structure directory file and the signature file according to the signature result file;

[0010] If the signature verification is passed, the OFD electronic invoice file is converted into an electronic invoice file in the target format for display.

[0011] Optionally, verifying the signature of the structure directory file according to the signature result file includes:

[0012] Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0013] Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0014] If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

[0015] Optionally, verifying the signature file according to the signature result file includes:

[0016] Obtaining the signature algorithm in the signature result file;

[0017] According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files;

[0018] Obtaining the hash summary in the signature file;

[0019] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0020] Optionally, verifying the signature file according to the signature result file further includes:

[0021] Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0022] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, then it is determined that the signature file has passed the verification, including:

[0023] If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0024] Optionally, the structure directory file includes a template file, a data file, a resource file and / or an invoice attachment file of an OFD electronic invoice file; the electronic invoice file in the target format includes at least one of an electronic invoice PDF file, an electronic invoice image file and an electronic invoice SVG file;

[0025] If the target electronic invoice file is an electronic invoice SVG file, converting the OFD electronic invoice file into an electronic invoice file in the target format for display includes:

[0026] Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0027] Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0028] Extracting the image file and the location coordinates of the image file from the resource file;

[0029] According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0030] Optionally, if the electronic invoice file in the target format is an electronic invoice PDF file or an electronic invoice image file;

[0031] The converting the OFD electronic invoice file into an electronic invoice file in a target format for display includes:

[0032] Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

[0033] Optionally, after obtaining the OFD electronic invoice file, the method further includes:

[0034] Acquire the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0035] The parsing of the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file includes:

[0036] Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0037] The converting the OFD electronic invoice file into an electronic invoice file in a target format for display includes:

[0038] The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

[0039] Optionally, after obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, the method further includes:

[0040] According to the format standard of the OFD electronic invoice file, determining whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file;

[0041] If so, the step of parsing the OFD electronic invoice file is triggered.

[0042] A second aspect of the embodiment of the present application provides a conversion system based on OFD electronic invoice files, including:

[0043] An acquisition unit, used to acquire OFD electronic invoice files;

[0044] A parsing unit, used for parsing the OFD electronic invoice file to extract a structure directory file, a signature result file and a signature file of the OFD electronic invoice file;

[0045] A signature verification unit, used to verify the structure directory file and the signature file according to the signature result file;

[0046] The conversion unit is used to convert the OFD electronic invoice file into an electronic invoice file of a target format for display when the structure directory file and the signature file are verified and signed.

[0047] Optionally, the signature verification unit is specifically used for:

[0048] Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0049] Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0050] If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

[0051] Optionally, the signature verification unit is specifically used for:

[0052] Obtaining the signature algorithm in the signature result file;

[0053] According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files;

[0054] Obtaining the hash summary in the signature file;

[0055] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0056] Optionally, the signature verification unit is further used to:

[0057] Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0058] If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0059] Optionally, the structure directory file includes a template file, a data file, a resource file and / or an invoice attachment file of an OFD electronic invoice file; the electronic invoice file in the target format includes at least one of an electronic invoice PDF file, an electronic invoice image file and an electronic invoice SVG file;

[0060] The conversion unit is specifically used for:

[0061] Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0062] Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0063] Extracting the image file and the location coordinates of the image file from the resource file;

[0064] According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0065] Optionally, if the electronic invoice file in the target format is an electronic invoice PDF file or an electronic invoice image file;

[0066] The conversion unit is also used for:

[0067] Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

[0068] Optionally, the acquisition unit is further used for:

[0069] After obtaining the OFD electronic invoice file, obtaining the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0070] The parsing unit is specifically used for:

[0071] Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0072] The conversion unit is specifically used for:

[0073] The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

[0074] Optionally, the system further includes:

[0075] The judgment unit is used to judge whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file according to the pre-stored format standard of the OFD electronic invoice file after obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, and trigger the step of parsing the OFD electronic invoice file when the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file.

[0076] A third aspect of an embodiment of the present application provides a computer device, including a processor, which, when executing a computer program stored in a memory, is used to implement the conversion method based on OFD electronic invoice files provided in the first aspect of the embodiment of the present application.

[0077] The fourth aspect of the embodiments of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the conversion method based on OFD electronic invoice files provided in the first aspect of the embodiments of the present application.

[0078] The fifth aspect of the embodiments of the present application provides a computer program product on which a computer program is stored. When the computer program is executed by a computer device, it is used to implement the conversion method based on OFD electronic invoice files provided in the first aspect of the embodiments of the present application.

[0079] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0080] In the embodiment of the present application, an OFD electronic invoice file is obtained; the OFD electronic invoice file is parsed to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file; the structure directory file and the seal file are verified according to the signature result file; if the verification passes, the OFD electronic invoice file is converted into an electronic invoice file of the target format for display. That is, the embodiment of the present application can convert the OFD electronic invoice file into an electronic invoice file of the target format that can be displayed on other electronic devices when the OFD electronic invoice file has not been tampered with, so that the OFD electronic invoice file can also be displayed normally on other electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 This is a schematic diagram of the architecture of the conversion system based on OFD electronic invoice files in an embodiment of the present application;

[0082] Figure 2 This is a schematic diagram of an embodiment of a conversion method based on OFD electronic invoice files in an embodiment of the present application;

[0083] Figure 3 For this application Figure 2 A refinement of step 203 in the embodiment;

[0084] Figure 4 For this application Figure 2 A refinement of step 204 in the embodiment;

[0085] Figure 5 This is another schematic diagram of an embodiment of the conversion method based on OFD electronic invoice files in the embodiment of the present application;

[0086] Figure 6 The format standard of the OFD electronic invoice in the embodiment of this application;

[0087] Figure 7 This is a schematic diagram of an embodiment of a conversion system based on OFD electronic invoice files in an embodiment of the present application. DETAILED DESCRIPTION

[0088] The embodiments of the present application provide a conversion method, system and related device based on OFD electronic invoice files, which are used to convert OFD electronic invoice files into electronic invoice files in a target format so as to facilitate display on a target electronic device other than a Windows operating system.

[0089] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0090] The terms "first", "second", "third", "fourth", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0091] Based on the problem in the prior art that OFD electronic invoice files cannot be displayed normally on electronic devices other than Windows systems, the present application proposes a conversion method based on OFD electronic invoice files, which is used to convert OFD electronic invoice files into electronic invoice files in a target format for display on the target electronic device.

[0092] The embodiment of the present application provides a conversion method based on OFD electronic invoice files. The general principle of the method is as follows:

[0093] When an OFD electronic invoice file is received, the OFD electronic invoice is parsed to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file, and the structure directory file and seal file are verified according to the signature result file. If the verification passes, the OFD electronic invoice file is converted into an electronic invoice file in the target format for display.

[0094] In order to implement the above-mentioned conversion method based on OFD electronic invoice files, the present application embodiment proposes a conversion system based on OFD electronic invoice files. Figure 1 , Figure 1A schematic diagram of the architecture of a conversion system based on OFD electronic invoice files provided in an embodiment of the present application. The conversion system based on OFD electronic invoice files may include at least one terminal device 101 and a server 102; different types of applications may be installed on the terminal device 101, such as folders or various applications that can receive files, such as wps, office, etc. The terminal device may be a smart phone, tablet computer, laptop computer, desktop computer, smart wearable device, etc. The server 102 is used to store application data and file data generated by different types of applications of the terminal device 101. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc.

[0095] Among them, the above-mentioned conversion method based on OFD electronic invoice files can be executed by the terminal device 101 and / or the server 102. When the conversion method based on OFD electronic invoice files is interactively executed by the terminal device and the server, the terminal device can obtain the OFD electronic invoice file from the server, and then the terminal device extracts the structure directory file, signature result file and seal file of the OFD electronic invoice file from the OFD electronic invoice file, and verifies the structure directory file and the seal file according to the signature result file. If the verification passes, the OFD electronic invoice file is converted into an electronic invoice file in the target format for display.

[0096] Based on the above-mentioned OFD electronic invoice file conversion method and conversion system, please refer to Figure 2 , Figure 2 This is a schematic diagram of an embodiment of a conversion method based on OFD electronic invoice files in an embodiment of the present application. The conversion method can be executed by a smart device, which can be the above-mentioned terminal device 101 and / or server 102.

[0097] 201. Obtain OFD electronic invoice file;

[0098] Specifically, before converting the OFD electronic invoice file, the smart device in the embodiment of the present application needs to first obtain the OFD electronic invoice file, where the OFD electronic invoice file can be an electronic invoice file pre-stored in the smart device, or an electronic invoice file temporarily obtained by the smart device from a terminal device or a server, where the acquisition here can be active downloading by the smart device or passive reception by the smart device. The specific process of obtaining the OFD electronic invoice file is not limited here.

[0099] 202. Parse the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0100] After the smart device obtains the OFD electronic invoice file, it automatically parses the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file.

[0101] Specifically, the parsing here at least includes the decompression process of the OFD electronic invoice file to obtain the structural directory file, signature result file and seal file of the electronic invoice file from the decompressed electronic invoice file, wherein the structural directory file of the electronic invoice file includes the template file, data file, resource file and / or invoice attachment file of the OFD electronic invoice.

[0102] Furthermore, the template file of OFD electronic invoice includes the outer contour line template of the electronic invoice and the basic information template of the electronic invoice (such as the issuer, the recipient, the invoice date, etc.), and the data file of the electronic invoice mainly includes the invoice information in the electronic invoice and the location coordinates of the invoice information, such as the issuer is 1xxx1, the location coordinates are (x1, y1), the recipient is 2xxx, the location coordinates are (x2, y2), and the resource file of the electronic invoice mainly includes the QR code image and signature image in the electronic invoice, as well as the location coordinates of the images.

[0103] The invoice attachment files include: template files, data files and resource files of the electronic invoice file, as well as the mapping relationship between the various parts, to form a complete electronic invoice file.

[0104] Furthermore, the signature result file is used to prevent the structural directory file and signature file of the OFD electronic invoice file from being tampered with, and records the tamper-proof information of the structural directory file and signature file (such as the hash summary of each structural directory file, the hash summary in the signature file, etc.).

[0105] The signature file records the certificate information used to sign the electronic invoice and the date the invoice was signed, etc., to prevent counterfeiting of the electronic invoice.

[0106] 203. Verify the structure directory file and the signature file according to the signature result file;

[0107] Because the signature result file records the anti-tampering information for preventing the structure directory file and the signature file of the electronic invoice from being tampered with, the embodiment of the present application can verify the structure directory file and the signature file through the signature result file, and execute step 204 after the verification is passed.

[0108] Specifically, the process of how to verify the structure directory file and the signature file according to the signature result file will be described in the following embodiments and will not be repeated here.

[0109] 204. If the signature verification is passed, the OFD electronic invoice file is converted into an electronic invoice file in a target format for display.

[0110] In step 203, if the structural directory file and the signature file in the electronic invoice file are verified and passed, the OFD electronic invoice file is converted into an electronic invoice file of the target format for display, thereby improving the convenience of displaying the OFD electronic invoice file on other electronic devices.

[0111] Specifically, the target format in the present application includes at least one of PDF, image or SVG formats, and no specific limitation is made here. The process of how to convert the OFD electronic invoice file into an electronic invoice file in the target format will also be described in the following embodiments and will not be repeated here.

[0112] In the embodiment of the present application, an OFD electronic invoice file is obtained; the OFD electronic invoice file is parsed to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file; the structure directory file and the seal file are verified according to the signature result file; if the verification passes, the OFD electronic invoice file is converted into an electronic invoice file of the target format for display. That is, the embodiment of the present application can convert the OFD electronic invoice file into an electronic invoice file of the target format that can be displayed on other electronic devices when the OFD electronic invoice file has not been tampered with, so that the OFD electronic invoice file can also be displayed normally on other electronic devices.

[0113] based on Figure 2 The embodiment described above is described below. Figure 2 For a detailed description of step 203 in the embodiment, please refer to Figure 3 , Figure 3 The detailed steps of step 203 are as follows:

[0114] 301. Obtain a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0115] Specifically, the signature result file pre-stores the file signature and signature algorithm, and the file signature includes the hash value of each structure directory file digest, and the signature algorithm is a specific algorithm used to calculate the digest of each structure directory file, such as SM3, MD5, MD2, or SHA-1, etc. There is no restriction on the specific signature algorithm here.

[0116] 302. Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0117] After the signature algorithm for calculating the digest of each structured directory file is obtained in step 301 , a hash operation is performed on the digest of each structured directory file in turn according to the signature algorithm to obtain the hash value of each structured directory file digest, so as to execute step 303 .

[0118] 303. Determine whether the calculated hash value of each structure directory file digest is the same as the hash value of each structure directory file digest in the file signature; if so, execute step 304; if not, execute step 305;

[0119] After the hash value of each structure directory file digest is calculated according to the signature algorithm in step 302, it is determined in turn whether the hash value of each structure directory file digest is the same as the hash value of the corresponding structure directory file digest recorded in the file signature. If so, execute step 304; if not, execute step 305.

[0120] 304. Determine that the structure directory file has passed the signature verification;

[0121] If the calculated hash value of each structure directory file digest is the same as the hash value of each structure directory file digest in the file signature, it is determined that the structure directory file signature verification has passed, that is, the structure directory file has not been tampered with.

[0122] 305. Determine that the structure directory file fails the signature verification.

[0123] If the calculated hash value of any structure target file digest is different from the hash value of the corresponding structure directory file digest in the file signature, it is determined that the structure directory file signature verification fails, that is, the structure directory file of the OFD electronic invoice file has been tampered with, and the user can be prompted that the structure directory file has been tampered with.

[0124] 306. Perform hash calculation again on the hash values ​​of the digests of multiple structure directory files according to the signature algorithm to obtain hash values ​​of all the digests of the structure directory files;

[0125] After the signature algorithm is obtained in step 301, hash calculation is further performed again on the hash values ​​of the digests of multiple structured directory files according to the signature algorithm to obtain the hash values ​​of all the digests of the structured directory files.

[0126] Specifically, assuming that there are 3 structure directory files, among which the hash value of the first structure target file digest is SDxxFD1, the hash value of the second structure directory file digest is FFDxxA1, and the hash value of the third structure directory file digest is DDFFDA, then this step is to further perform hash operation on SDxxFD1, FFDxxA1 and DDFFDA according to the signature algorithm to obtain the hash values ​​of all the structure directory file digests.

[0127] 307. Obtain the hash summary in the signature file;

[0128] Specifically, a hash summary value is also stored in the signature file in the embodiment of the present application, and the hash summary value is the hash value of the summary of all structural target files. In order to verify the signature file, the hash summary in the signature file can be further obtained, and the hash summary in the signature file can be compared with the hash summary value of all structural target files calculated in step 306 to verify the signature file.

[0129] 308. Obtain the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0130] Furthermore, in order to ensure the authenticity of the signed document, the embodiment of the present application can also obtain the signature certificate information and signature date in the signed document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint, and verify the signature date according to the signature certificate information, and verify the signature fingerprint in the signature certificate according to the pre-stored signature fingerprint to ensure the validity of the signature certificate.

[0131] 309. Determine whether the signature date is within the validity period of the certificate, whether the signature fingerprint is consistent with the pre-stored signature fingerprint, and whether the hash value of the summary of all structure directory files is the same as the hash summary in the signature file;

[0132] After obtaining the validity period, signature fingerprint and hash value of all structure directory file summaries of the signature certificate, the embodiment of the present application determines whether the signature date in the signature file is within the validity period of the certificate, whether the signature fingerprint of the signature certificate is the same as the pre-stored certificate fingerprint, and whether the hash value of all structure directory file summaries is the same as the hash summary in the signature file. If so, execute step 310; if not, execute step 311.

[0133] 310. Determine whether the signature document has passed the verification.

[0134] If the signature date is within the validity period of the certificate, and the signature fingerprint of the signature certificate is the same as the pre-stored certificate fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, then it is determined that the signature file verification has passed.

[0135] 311. Determine that the signature document fails the verification.

[0136] If the signature date is not within the validity period of the certificate, or the signature fingerprint of the signature certificate is different from the pre-stored certificate fingerprint, or the hash value of the summary of all structure directory files is different from the hash summary in the signature file, it is determined that the signature file verification fails, and it can be further prompted that the signature file may be false.

[0137] The embodiment of the present application describes in detail the process of verifying the structure directory file and the signature file based on the signature result file, which on the one hand improves the security of the structure directory file and the signature file in the OFD electronic invoice file, and on the other hand also improves the reliability of the verification process.

[0138] based on Figures 2 to 3 The embodiment described above is described below. Figure 2 Step 204 in the embodiment is described in detail, wherein the target format of the electronic invoice file can be a PDF electronic invoice file, a picture invoice file or an SVG electronic invoice file. The format conversion process is described in detail below using the SVG format as an example. Figure 4 , Figure 4 The detailed steps of step 204 are as follows:

[0139] 401. Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0140] Specifically, the structure directory file of the OFD electronic invoice file includes a template file, a data file, a resource file and / or an invoice attachment file of the OFD electronic invoice file.

[0141] Among them, the template file of OFD electronic invoice includes the external contour line template of the electronic invoice and the basic information template of the electronic invoice (such as the issuer, the recipient, the invoice date, etc.), and the data file of the electronic invoice mainly includes the invoice information in the electronic invoice and the location coordinates of the invoice information, such as the issuer is 1xxx1, the location coordinates are (x1, y1), the recipient is 2xxx, the location coordinates are (x2, y2), and the resource file of the electronic invoice mainly includes the QR code image and signature image in the electronic invoice, as well as the location coordinates of the images.

[0142] In order to convert an electronic invoice in OFD format into an electronic invoice in SVG format, the embodiment of the present application draws the format template of the electronic invoice SVG file according to the template of the OFD electronic invoice file, such as drawing the contour lines in the SVG format, and fills the basic information in the OFD electronic invoice file template (such as the issuer, the recipient, and the invoice date) into the format template of the SVG file.

[0143] 402. Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0144] Furthermore, the embodiment of the present application extracts the location coordinates of the invoice data set of the invoice from the data file, such as the specific content corresponding to the issuer: 1xxx1, and the location coordinates of the specific content of the issuer (x1, y1), the specific content corresponding to the recipient: 2xxx, and the location coordinates of the specific content of the recipient (x2, y2), so as to fill the specific content corresponding to each item into the electronic invoice file in SVG format.

[0145] 403. Extracting the image file and the location coordinates of the image file from the resource file;

[0146] Because the face content of the electronic invoice includes, in addition to the corresponding text, some pictures, such as QR code pictures, signature pictures, etc., the embodiment of the present application further extracts the picture file and the location coordinates of the picture file from the resource file, so as to fill the corresponding picture into the electronic invoice file in SVG format according to the location coordinates of the picture.

[0147] 404. According to the location coordinates of the invoice data and the location coordinates of the image file, fill the invoice data and the image file into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0148] After step 402 and step 403 respectively obtain the invoice data of the electronic invoice and the location coordinates of the invoice data, as well as the image file and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file according to the location coordinates of the invoice data and the location coordinates of the image file to obtain the electronic invoice SVG file and display it.

[0149] The embodiment of the present application provides a detailed description of the process of converting an electronic invoice file in OFD format into an electronic invoice file in SVG format, thereby improving the reliability of the format conversion process in the embodiment of the present application.

[0150] Further, based on Figure 4After obtaining the electronic invoice file in SVG format, if the target format is an electronic invoice file in PDF format or image format, the embodiment of the present application can also use file conversion tools (such as Adobe Illustrator tools, SVGToImage) to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file respectively.

[0151] Based on the above embodiment, the conversion method based on OFD electronic invoice file in this application is further described in detail below. Figure 5 Another embodiment of the conversion method based on OFD electronic invoice file in the embodiment of the present application includes:

[0152] 501. Acquire the OFD electronic invoice file and the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0153] Specifically, in the embodiment of the present application, after obtaining the OFD electronic invoice, the functional parameters and extended data of the OFD electronic invoice file are further obtained, wherein the functional parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data is used to indicate the clarity of the electronic invoice file after the format conversion.

[0154] Generally, the content extracted from the electronic invoice includes the signature data of the OFD electronic invoice file and the electronic invoice data. Figure 1 The signature file in the embodiment is consistent with the signature result file description, which is used to verify the signature file, while the electronic invoice data is consistent with the Figure 1 The structural directory file description in the embodiment is consistent, so as to obtain the template file and invoice data of the OFD electronic invoice, so as to convert the OFD electronic invoice file into an electronic invoice file of a target format according to the template file and invoice data of the OFD electronic invoice.

[0155] In addition, the function parameters also include the first target format to be converted, which is used to indicate the format of the electronic invoice file to be converted into. Generally, the first target format includes at least one of the PDF format, the image format and the SVG format. The extended data is used to indicate the clarity of the electronic invoice file after the format conversion. Generally, the electronic invoice file after the format conversion will have a default clarity value. When the extended data clearly stipulates the clarity of the electronic invoice file after the format conversion, the electronic invoice file after the format conversion needs to meet the clarity parameter.

[0156] 502. According to the format standard of the OFD electronic invoice file, determine whether the OFD electronic invoice file conforms to the format standard of the OFD electronic invoice file. If so, execute step 503. If not, end the process.

[0157] Furthermore, in order to avoid obtaining electronic invoice files that are not in OFD format, the embodiment of the present application can also determine whether the obtained OFD electronic invoice file complies with the format standard of OFD electronic invoice files based on the format standard of OFD electronic invoice files. If so, execute step 503; if not, end the process of this application.

[0158] Specifically, for ease of understanding, Figure 6 The hierarchical organizational structure of OFD electronic invoice is given. For the description of each structure name, please refer to Table 1.

[0159] Table 1 OFD electronic invoice file hierarchy organization structure

[0160]

[0161]

[0162] 503. Parse the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0163] The description of this step is Figure 2 The description of step 202 in the embodiment is similar and will not be repeated here.

[0164] 504. Verify the structure directory file and the signature file according to the signature result file;

[0165] The description of this step is Figure 2 In the embodiment, step 203 and Figure 3 The description of the embodiment is similar and will not be repeated here.

[0166] 505. Determine whether the signature verification of the structure target file and the signature file is passed. If so, execute step 506. If not, end the process.

[0167] After obtaining the verification results of the structure directory file and the signature file, it is further determined whether the verification of the structure directory file and the signature file is passed. If so, step 506 is executed; if not, the process ends.

[0168] 506. Convert the OFD electronic invoice file into an electronic invoice file in the first target format, and display the electronic invoice file that meets the clarity parameter.

[0169] If the structure directory file and the signature file of the OFD electronic invoice file are verified and passed, it means that the electronic invoice file has not been tampered with, and the OFD electronic invoice file is converted into an electronic invoice file of the first target format, and the electronic invoice file that meets the clarity parameter in step 501 is displayed.

[0170] In an embodiment of the present application, not only can the conversion process of the present application be directly exited when the acquired electronic invoice file is a non-OFD electronic invoice file, but the OFD electronic invoice file can also be converted into an electronic invoice file of the first target format that meets the preset clarity parameters, thereby meeting the user's personalized needs.

[0171] The above describes in detail the conversion method based on OFD electronic invoice file in the embodiment of the present application. Next, the conversion system based on OFD electronic invoice file in the embodiment of the present application is described. Figure 7 , an embodiment of the conversion system based on OFD electronic invoice files in the embodiment of the present application includes:

[0172] An acquisition unit 701 is used to acquire an OFD electronic invoice file;

[0173] The parsing unit 702 is used to parse the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0174] The signature verification unit 703 is used to verify the structure directory file and the signature file according to the signature result file;

[0175] The conversion unit 704 is used to convert the OFD electronic invoice file into an electronic invoice file in a target format for display when the structure directory file and the signature file are verified.

[0176] Optionally, the signature verification unit 703 is specifically used to:

[0177] Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0178] Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0179] If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

[0180] Optionally, the signature verification unit 703 is specifically used to:

[0181] Obtaining the signature algorithm in the signature result file;

[0182] According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files;

[0183] Obtaining the hash summary in the signature file;

[0184] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0185] Optionally, the signature verification unit 703 is further configured to:

[0186] Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0187] If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0188] Optionally, the structure directory file includes a template file, a data file, a resource file and / or an invoice attachment file of an OFD electronic invoice file; the electronic invoice file in the target format includes at least one of an electronic invoice PDF file, an electronic invoice image file and an electronic invoice SVG file;

[0189] The conversion unit 704 is specifically used for:

[0190] Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0191] Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0192] Extracting the image file and the location coordinates of the image file from the resource file;

[0193] According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0194] Optionally, if the electronic invoice file in the target format is an electronic invoice PDF file or an electronic invoice image file;

[0195] The conversion unit 704 is further used for:

[0196] Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

[0197] Optionally, the acquiring unit 701 is further configured to:

[0198] After obtaining the OFD electronic invoice file, obtaining the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0199] The parsing unit 702 is specifically used for:

[0200] Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0201] The conversion unit 704 is specifically used for:

[0202] The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

[0203] Optionally, the system further includes:

[0204] The judgment unit 705 is used to judge whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file according to the pre-stored format standard of the OFD electronic invoice file after obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, and trigger the step of parsing the OFD electronic invoice file when the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file.

[0205] Specifically, the functions of each unit in the embodiment of the present application are similar to Figures 2 to 5 The description in the embodiment is similar and will not be repeated here.

[0206] In the embodiment of the present application, the OFD electronic invoice file is obtained by the acquisition unit 701; the OFD electronic invoice file is parsed by the parsing unit 702 to extract the structure directory file, the signature result file and the seal file of the OFD electronic invoice file; the structure directory file and the seal file are verified by the signature verification unit 703 according to the signature result file; if the signature verification passes, the OFD electronic invoice file is converted into an electronic invoice file of the target format for display by the conversion unit 704. That is, the embodiment of the present application can convert the OFD electronic invoice file into an electronic invoice file of the target format that can be displayed on other electronic devices when the OFD electronic invoice file has not been tampered with, so that the OFD electronic invoice file can also be displayed normally on other electronic devices.

[0207] The present application also provides a computer program product having a computer program stored thereon, which is used to implement the present application when the computer program is executed by a computer device. Figures 2 to 5 The conversion method based on OFD electronic invoice file described in the embodiment.

[0208] The above describes the conversion system based on OFD electronic invoice files in the embodiment of the present application from the perspective of modular functional entities. The following describes the computer device in the embodiment of the present application from the perspective of hardware processing:

[0209] The computer device is used to implement the function of the conversion system based on OFD electronic invoice files. In the embodiment of the present application, one embodiment of the computer device includes:

[0210] Processor and memory;

[0211] The memory is used to store a computer program, and when the processor is used to execute the computer program stored in the memory, the following steps can be implemented:

[0212] Obtain OFD electronic invoice files;

[0213] Parsing the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0214] Verify the structure directory file and the signature file according to the signature result file;

[0215] If the signature verification is passed, the OFD electronic invoice file is converted into an electronic invoice file in the target format for display.

[0216] In some embodiments of the present application, the processor may also be used to implement the following steps:

[0217] Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0218] Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0219] If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

[0220] In some embodiments of the present application, the processor may also be used to implement the following steps:

[0221] Obtaining the signature algorithm in the signature result file;

[0222] According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files;

[0223] Obtaining the hash summary in the signature file;

[0224] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0225] In some embodiments of the present application, the processor may also be used to implement the following steps:

[0226] Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0227] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, then it is determined that the signature file has passed the verification, including:

[0228] If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0229] In some embodiments of the present application, the structure directory file includes a template file, a data file, a resource file and / or an invoice attachment file of an OFD electronic invoice file; the electronic invoice file in the target format includes at least one of an electronic invoice PDF file, an electronic invoice image file and an electronic invoice SVG file. The processor may also be used to implement the following steps:

[0230] Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0231] Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0232] Extracting the image file and the location coordinates of the image file from the resource file;

[0233] According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0234] In some embodiments of the present application, if the electronic invoice file in the target format is an electronic invoice PDF file or an electronic invoice image file, the processor may also be used to implement the following steps:

[0235] Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

[0236] In some embodiments of the present application, after obtaining the OFD electronic invoice file, the processor may also be used to implement the following steps:

[0237] Acquire the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0238] In some embodiments of the present application, the processor may also be used to implement the following steps:

[0239] Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0240] In some embodiments of the present application, the processor may also be used to implement the following steps:

[0241] The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

[0242] In some embodiments of the present application, after obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, the processor may also be used to implement the following steps:

[0243] According to the format standard of the OFD electronic invoice file, determining whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file;

[0244] If so, the step of parsing the OFD electronic invoice file is triggered.

[0245] It can be understood that when the processor in the computer device described above executes the computer program, it can also implement the functions of the various units in the above-mentioned corresponding device embodiments, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present application. The one or more modules / units can be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program in the conversion system based on OFD electronic invoice files. For example, the computer program can be divided into the various units in the above-mentioned conversion system based on OFD electronic invoice files, and each unit can implement the specific functions described in the above-mentioned corresponding conversion system based on OFD electronic invoice files.

[0246] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that a processor and a memory are merely examples of computer devices and do not constitute a limitation of the computer device. The computer device may include more or fewer components, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, and the like.

[0247] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and various interfaces and lines are used to connect various parts of the entire computer device.

[0248] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0249] The present application also provides a computer-readable storage medium, which is used to implement the function of the conversion system based on OFD electronic invoice files, and has a computer program stored thereon. When the computer program is executed by a processor, the processor can be used to perform the following steps:

[0250] Obtain OFD electronic invoice files;

[0251] Parsing the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0252] Verify the structure directory file and the signature file according to the signature result file;

[0253] If the signature verification is passed, the OFD electronic invoice file is converted into an electronic invoice file in the target format for display.

[0254] In some embodiments of the present application, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0255] Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file;

[0256] Calculate the hash value of each structure directory file digest according to the signature algorithm;

[0257] If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

[0258] In some embodiments of the present application, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0259] Obtaining the signature algorithm in the signature result file;

[0260] According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files;

[0261] Obtaining the hash summary in the signature file;

[0262] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0263] In some embodiments of the present application, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0264] Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint;

[0265] If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, then it is determined that the signature file has passed the verification, including:

[0266] If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

[0267] In some embodiments of the present application, the structure directory file includes a template file, a data file, a resource file and / or an invoice attachment file of an OFD electronic invoice file; the electronic invoice file in the target format includes at least one of an electronic invoice PDF file, an electronic invoice image file and an electronic invoice SVG file. When the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0268] Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file;

[0269] Extracting the invoice data and the location coordinates of the invoice data from the data file;

[0270] Extracting the image file and the location coordinates of the image file from the resource file;

[0271] According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

[0272] In some embodiments of the present application, if the electronic invoice file in the target format is an electronic invoice PDF file or an electronic invoice image file, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0273] Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

[0274] In some embodiments of the present application, after obtaining the OFD electronic invoice file, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0275] Acquire the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion;

[0276] In some embodiments of the present application, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0277] Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file;

[0278] In some embodiments of the present application, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0279] The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

[0280] In some embodiments of the present application, after obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, when the computer program stored in the computer-readable storage medium is executed by the processor, the processor may also be used to implement the following steps:

[0281] According to the format standard of the OFD electronic invoice file, determining whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file;

[0282] If so, the step of parsing the OFD electronic invoice file is triggered.

[0283] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0284] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0285] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0286] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0287] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A conversion method based on OFD electronic invoice files, characterized in that: include: Obtain OFD electronic invoice files; Parsing the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file; Verify the structure directory file and the signature file according to the signature result file; If the signature verification is passed, the OFD electronic invoice file is converted into an electronic invoice file of the target format for display; The structure directory file includes template files, data files, resource files and / or invoice attachment files of the OFD electronic invoice. The template files of the OFD electronic invoice include the external outline template of the electronic invoice and the basic information template of the electronic invoice. The data files of the OFD electronic invoice include the invoicing information in the electronic invoice and the location coordinates of the invoicing information. The resource files of the OFD electronic invoice include the QR code image and the signature image in the electronic invoice, as well as the location coordinates of the images. If the electronic invoice file in the target format is an electronic invoice SVG file, converting the OFD electronic invoice file into an electronic invoice file in the target format for display includes: Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice; Extracting the invoice data and the location coordinates of the invoice data from the data file; Extracting the image file and the location coordinates of the image file from the resource file; According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

2. The method according to claim 1, characterized in that: The structure directory file is verified according to the signature result file, including: Obtaining a file signature and a signature algorithm in the signature result file, wherein the file signature includes a hash value of a digest of each structure directory file; Calculate the hash value of each structure directory file digest according to the signature algorithm; If the calculated hash value of each structured directory file digest is the same as the hash value of each structured directory file digest in the file signature, it is determined that the structured directory file signature verification has passed.

3. The method according to claim 1, characterized in that Verify the signature of the signature file according to the signature result file, including: Obtaining the signature algorithm in the signature result file; According to the signature algorithm, performing hash calculation again on the hash values ​​of the digests of the plurality of structured directory files to obtain the hash values ​​of all the digests of the structured directory files; Obtaining the hash summary in the signature file; If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

4. The method according to claim 3, characterized in that Verifying the signature of the signed document according to the signature result document also includes: Obtaining the signature certificate information and the signature date in the signature document, wherein the signature certificate information includes the certificate validity period and the signature fingerprint; If the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, then it is determined that the signature file has passed the verification, including: If the signature date is within the validity period of the certificate, and the signature fingerprint is consistent with the pre-stored signature fingerprint, and the hash value of the summary of all structure directory files is the same as the hash summary in the signature file, it is determined that the signature file has passed the verification.

5. The method according to claim 1, characterized in that If the target electronic invoice file is an electronic invoice PDF file or an electronic invoice image file; The converting the OFD electronic invoice file into an electronic invoice file in a target format for display includes: Use a file conversion tool to convert the electronic invoice SVG file into an electronic invoice PDF file or an electronic invoice image file.

6. The method according to claim 1, characterized in that After obtaining the OFD electronic invoice file, the method further includes: Acquire the function parameters and extended data of the OFD electronic invoice file, wherein the function parameters are used to indicate the content extracted from the OFD electronic invoice file and the first target format to be converted, and the extended data are used to indicate the clarity parameters of the electronic invoice file after the format conversion; The parsing of the OFD electronic invoice file to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file includes: Parsing the OFD electronic invoice file according to the functional parameters to extract the structure directory file, signature result file and seal file of the OFD electronic invoice file; The converting the OFD electronic invoice file into an electronic invoice file in a target format for display includes: The OFD electronic invoice file is converted into an electronic invoice file in the first target format, and the electronic invoice file that meets the clarity parameter is displayed.

7. The method according to any one of claims 1 to 6, characterized in that After obtaining the OFD electronic invoice file and before parsing the OFD electronic invoice file, the method further includes: According to the format standard of the OFD electronic invoice file, determining whether the OFD electronic invoice file complies with the format standard of the OFD electronic invoice file; If so, the step of parsing the OFD electronic invoice file is triggered.

8. A conversion system based on OFD electronic invoice files, characterized in that: include: An acquisition unit, used to acquire OFD electronic invoice files; A parsing unit, used for parsing the OFD electronic invoice file to extract a structure directory file, a signature result file and a signature file of the OFD electronic invoice file; A signature verification unit, used to verify the structure directory file and the signature file according to the signature result file; A conversion unit, used for converting the OFD electronic invoice file into an electronic invoice file of a target format for display when the structure directory file and the signature file are verified and signed; The structure directory file includes template files, data files, resource files and / or invoice attachment files of the OFD electronic invoice. The template files of the OFD electronic invoice include the external outline template of the electronic invoice and the basic information template of the electronic invoice. The data files of the OFD electronic invoice include the invoicing information in the electronic invoice and the location coordinates of the invoicing information. The resource files of the OFD electronic invoice include the QR code image and the signature image in the electronic invoice, as well as the location coordinates of the images. If the target electronic invoice file is an electronic invoice SVG file, the conversion unit is specifically used to: Draw the format template of the electronic invoice SVG file according to the template file of the OFD electronic invoice file; Extracting the invoice data and the location coordinates of the invoice data from the data file; Extracting the image file and the location coordinates of the image file from the resource file; According to the location coordinates of the invoice data and the location coordinates of the image file, the invoice data and the image file are filled into the format template of the electronic invoice SVG file to obtain the electronic invoice SVG file and display it.

9. A computer device comprising a processor, characterized in that: When executing the computer program stored in the memory, the processor is used to implement the conversion method based on the OFD electronic invoice file as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the conversion method based on OFD electronic invoice file as described in any one of claims 1 to 7.

11. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the conversion method based on OFD electronic invoice file as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • OFD-based electronic signature multi-version traceable rapid signature verification method

    CN111625787A

  • Format conversion method and system for value-added tax electronic invoice

    CN113986822A