Electronic certificate management method and device and storage medium
By verifying electronic voucher files and identifying and extracting XBRL files, and data encapsulation is carried out according to the bill type, the problem of low efficiency in electronic voucher management in the existing technology is solved, and automated full-process management and multi-type bills are realized. Automatic archive.
Patent Information
- Application Number
- CN202310664236.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2024-12-06
AI Technical Summary
The existing technology lacks mature tools for automatic analysis and archiving of electronic credentials, resulting in low management efficiency and relying on manual analysis, making it impossible to effectively manage electronic credentials.
By obtaining electronic voucher files, performing visa verification and identifying XBRL files, extracting keywords and structured data, and encapsulating and archiving data according to the ticket type, reducing human operations and realizing integrated management of the entire process.
It improves the efficiency of electronic credential management, ensures file validity, realizes automatic parsing and archiving, reduces human operations, and supports automatic data encapsulation of multiple ticket types.
Smart Images

Figure CN119090499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic certificates, and in particular to an electronic certificate management method, device and storage medium. Background Art
[0002] Based on today's environmental protection requirements, it is necessary to promote the digitalization and paperless process of issuing, receiving and recording electronic vouchers, achieve full coverage of various electronic vouchers and enterprises, and systematically solve the common problems of receiving and recording electronic vouchers when enterprises handle various electronic vouchers. However, there are no mature and complete tools for electronic vouchers that can automatically parse and archive the electronic vouchers of standard data and manage the entire process in an integrated manner. It still relies on manual analysis and input, which is inefficient and not conducive to the effective management of electronic vouchers. Summary of the invention
[0003] In view of this, in order to solve at least one of the above technical problems, an object of the present invention is to provide an electronic certificate management method, device and storage medium to improve management efficiency.
[0004] An embodiment of the present invention provides an electronic credential management method, including:
[0005] Obtain electronic credential documents;
[0006] Performing signature verification on the electronic certificate file according to the file type of the electronic certificate file;
[0007] When the signature verification result indicates success, the electronic certificate file is identified, the XBRL file is identified, and keywords and structured data in the XBRL file are extracted;
[0008] The bill type of the electronic voucher file is determined according to the keyword, and the structured data is packaged according to the bill type for archiving.
[0009] Further, the performing signature verification processing on the electronic certificate file according to the file type of the electronic certificate file includes:
[0010] When the file type of the electronic certificate file is PDF, the signature is verified by SPIRE PDF Free for Java;
[0011] or,
[0012] When the file type of the electronic credential file is OFD, obtain the first signature file according to the signature entry information of the ofd.xml file after the electronic credential file is decompressed, read the protection file, digest algorithm and first digest of the first signature file, perform digest calculation on the protection file through the digest algorithm to obtain the second digest, and when the first digest is the same as the second digest, read the first signature file to obtain the signature algorithm, and verify the signature through the signature algorithm.
[0013] Further, the step of obtaining the first signature file according to the signature entry information of the ofd.xml file after the electronic certificate file is decompressed includes:
[0014] Searching for a second signature file according to the signature entry information;
[0015] The first signature file is found according to the tag information of the second signature file.
[0016] Further, the signature verification by the signature algorithm includes:
[0017] Generate a third digest according to the signature algorithm and the first signature file;
[0018] Read the signature value file to obtain the signature value, signature attribute value, public key certificate and original text summary value;
[0019] When the third digest is the same as the original text digest value, performing digest preprocessing on the signature attribute value;
[0020] The signature is verified according to the signature value, the public key certificate and the summary preprocessing result to obtain a signature verification processing result.
[0021] Further, the electronic voucher file is identified and processed, an XBRL file is identified, and keywords and structured data in the XBRL file are extracted, including:
[0022] Searching for the Document.xml file according to the file entry information of the ofd.xml file after the electronic voucher file is decompressed, and searching for the Attachments.xml file according to the tag of the Document.xml file, searching for the XBRL file according to the tag of the Attachments.xml file, identifying the XBRL file and extracting keywords and structured data in the XBRL file;
[0023] or,
[0024] The target virtual file of the electronic voucher file is extracted by an open source tool, an XBRL file is extracted from the target virtual file, the XBRL file is identified, and keywords and structured data in the XBRL file are extracted.
[0025] Further, encapsulating the structured data according to the bill type for archiving includes:
[0026] Convert the structured data in XML format into JSON structured data for data encapsulation according to the bill type;
[0027] Generate a target archive format file according to the json structure data, and archive the target archive format file and the electronic certificate file.
[0028] Furthermore, the method further comprises reviewing the archived electronic credential file:
[0029] Obtain archived electronic voucher files through http or ftp interface;
[0030] When the file type of the electronic certificate file is PDF, convert the electronic certificate file into a picture set or access the electronic certificate file through a PDF control;
[0031] or,
[0032] When the file type of the electronic certificate file is OFD, the electronic certificate file is subjected to graphic drawing processing to generate an SVG vector graphic for reference;
[0033] or,
[0034] The electronic certificate file is rendered through a template engine so as to be viewed on the front end.
[0035] The embodiment of the present invention further provides an electronic certificate management device, including:
[0036] An acquisition module, used for acquiring an electronic certificate file;
[0037] A signature verification module, used to perform signature verification processing on the electronic certificate file according to the file type of the electronic certificate file;
[0038] An identification module, used for, when the signature verification result indicates success, performing identification processing on the electronic voucher file, identifying the XBRL file and extracting keywords and structured data from the XBRL file;
[0039] The archiving module is used to determine the bill type of the electronic voucher file according to the keyword, and encapsulate the structured data according to the bill type for archiving.
[0040] An embodiment of the present invention also provides an electronic credential management device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the method.
[0041] An embodiment of the present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method.
[0042] The beneficial effects of the present invention are:
[0043] By acquiring the electronic certificate file and performing a signature verification process on the electronic certificate file according to the file type of the electronic certificate file, the validity of the electronic certificate file is ensured, which is beneficial to improving the effectiveness of electronic certificate management; when the signature verification process result indicates success, the electronic certificate file is identified, the XBRL file is identified and the keywords and structured data in the XBRL file are extracted, the bill type of the electronic certificate file is determined according to the keywords, the structured data is packaged for archiving according to the bill type, the electronic certificate file is automatically identified and extracted, and the data is packaged for archiving according to the bill type, which reduces manual operations, realizes the integrated management of the entire process of electronic certificates, and is beneficial to improving management efficiency.
[0044] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of the steps of the electronic certificate management method of the present invention;
[0046] Figure 2 This is a schematic diagram of part of the contents of the first signature file in a specific embodiment of the present invention;
[0047] Figure 3 It is a schematic diagram of an electronic voucher file of the OFD file type of the electronic itinerary of an air transport passenger ticket according to a specific embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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.
[0049] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. 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 limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0050] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0051] like Figure 1 As shown, an embodiment of the present invention provides an electronic certificate management method, including steps S100-S400:
[0052] S100, obtaining an electronic certificate file.
[0053] It should be noted that the electronic voucher file complies with the electronic voucher accounting data standard, meets the full electronic invoice data standard and management requirements, and supports the electronic voucher for the full chain closed-loop management of issuance, reimbursement, deduction, accounting, and archiving. Optionally, the file types of the electronic voucher file include but are not limited to OFD and PDF, and the OFD file type of each type of electronic voucher is generated in accordance with the "Electronic Document Storage and Exchange Format Layout Document" (GB / T 33190-2016) standard specification.
[0054] S200: Perform signature verification on the electronic certificate file according to the file type of the electronic certificate file.
[0055] It should be noted that the electronic certificate signature verification process is to verify the received electronic certificate file to ensure that the source of the file is legal, authentic and has not been tampered with; the electronic signature is carried out in accordance with the "GB / T 35275-2017 Information Security Technology SM2 Cryptographic Algorithm Encrypted Signature Message Syntax Specification", and the electronic invoice format file uses the national secret algorithm for electronic signature. The purpose of signature verification is to prove the identity of the sender and verify the integrity of the data to prevent data tampering or incomplete data by a third party, so each file in the electronic certificate needs to be tampered with.
[0056] Optionally, step S200 includes step S201 or S202:
[0057] S201. When the file type of the electronic certificate file is PDF, the signature is verified through SPIRE PDF Free for Java.
[0058] In the embodiment of the present invention, when the file type of the electronic certificate file is PDF, the signature is verified through SPIRE PDF Free forJava, thereby obtaining the signature verification processing result of the electronic certificate file with the file type of PDF.
[0059] S202. When the file type of the electronic certificate file is OFD, obtain the first signature file according to the signature entry information of the ofd.xml file after the electronic certificate file is decompressed, read the protection file, digest algorithm and first digest of the first signature file, perform digest calculation on the protection file through the digest algorithm to obtain the second digest, and when the first digest is the same as the second digest, read the first signature file to obtain the signature algorithm, and verify the signature through the signature algorithm.
[0060] Optionally, in step S202, obtaining the first signature file according to the signature entry information of the ofd.xml file after the electronic certificate file is decompressed includes steps S211-S212:
[0061] S211. Search for a second signature file according to the signature entry information.
[0062] In the embodiment of the present invention, when the file type of the electronic certificate file is OFD, the electronic certificate file is decompressed to obtain the ofd.xml file, and the Signatures.xml file (second signature file) is found according to the signature entry information ofd:Signatures in the ofd.xml file.
[0063] S212: Find the first signature file according to the tag information of the second signature file.
[0064] In the embodiment of the present invention, the Signature.xml file (the first signature file) is found according to the tag information ofd:Signature of the Signatures.xml file (the second signature file).
[0065] like Figure 2 As shown, optionally, after finding the Signature.xml file (the first signature file), read the protection file list, digest algorithm and first digest of the Signature.xml file (the first signature file), and there is at least one protection file in the protection file list. For example, the digest algorithm is CheckMethod:sm3 in ofd:Reference in the Signature.xml file (the first signature file), that is, the digest algorithm is sm3. Then, the digests of the protection files are calculated respectively by the digest algorithm to obtain the second digest, and compare it with the first digest in the Signature.xml file (the first signature file). If the first digest and the second digest are the same, it means that the protection file has not been tampered with and the data is complete. If the comparison is inconsistent, it means that the protection file has been tampered with and the file signature verification is illegal.
[0066] It should be noted that when the first digest and the second digest are the same, the Signature.xml file (first signature file) is read to obtain the signature algorithm, and the signature is verified by the signature algorithm. For example, if the value of the tag ofd:SignatureMethod in the Signature.xml file (first signature file) is 1.2.156.10197.1.501, it can be known that it is sm3 encryption, that is, the signature algorithm is sm3.
[0067] Optionally, the signature verification is performed by a signature algorithm in step S200, including steps S221-S224:
[0068] S221. Generate a third digest according to the signature algorithm and the first signature file.
[0069] Optionally, the entire first signature file is calculated using a signature algorithm to generate a third summary, and the generation method can refer to the cryptographic industry standard "GM / T 0004-2012".
[0070] S222. Read the signature value file to obtain the signature value, signature attribute value, public key certificate and original text summary value.
[0071] Optionally, according to the tag information ofd:SignedValue of the Signatures.xml file (the second signature file), the SignedValue.dat file (signature value file) is found, and then the SignedValue.dat (signature value file) is read, and the signature value, signature attribute value, public key certificate and original summary value are parsed with reference to the "GB T 38540-2020 Information Security Technology Security Electronic Signature Cryptography Technical Specifications", and the original summary value can be obtained from the signature attribute value.
[0072] S223: When the third digest is the same as the original digest value, perform digest preprocessing on the signature attribute value.
[0073] In the embodiment of the present invention, the original text summary value is compared with the third summary. If the comparison is consistent, it means that the Signature.xml file (the first signature file) has not been tampered with and the data is complete. If the comparison is inconsistent, it means that the Signature.xml (the first signature file) has been tampered with and the file signature verification is illegal. Optionally, when the Signature.xml file (the first signature file) has not been tampered with, the signature attribute value is subjected to summary preprocessing, for example, the original text summary value and the signature original (the file in ofd: Reference) are concatenated and then subjected to SM3 summary operation, and the result obtained is the summary preprocessing result, that is, the summary preprocessing value.
[0074] S224. Perform signature verification based on the signature value, public key certificate and summary preprocessing result.
[0075] Optionally, the signature value is decrypted using the public key certificate to obtain the digest value before encryption, and the digest value is compared with the digest preprocessing result to verify the signature, and the signature verification result is obtained. If they are consistent, the signature verification result indicates success, and if they are inconsistent, the signature verification result indicates failure. It can be understood that the signature verification result obtained at this time is the signature verification result corresponding to the electronic certificate file with the file type of OFD.
[0076] S300: When the signature verification result indicates success, the electronic voucher file is identified, the XBRL file is identified, and keywords and structured data in the XBRL file are extracted.
[0077] Optionally, the electronic voucher file is identified in step S300, an XBRL file is identified and keywords and structured data in the XBRL file are extracted, including step S310 or S320:
[0078] S310, searching for the Document.xml file according to the file entry information of the ofd.xml file after the electronic voucher file is decompressed, and searching for the Attachments.xml file according to the tag of the Document.xml file, searching for the XBRL file according to the tag of the Attachments.xml file, identifying the XBRL file and extracting keywords and structured data in the XBRL file.
[0079] Optionally, when the file type of the electronic voucher file is OFD, the Document.xml file is searched according to the file entry information ofd:DocRoot of the ofd.xml file obtained after decompressing the electronic voucher file, and the Attachments.xml file is searched according to the tag ofd:Attachments of the Document.xml file, and the corresponding XBRL (XBRL--Extensible Business Reporting Language) file is searched according to the tag ofd:Attachment of the Attachments.xml file, the XBRL file is identified and the keywords and structured data (specifically, structured data in XML format, XML structured data) in the XBRL file are extracted. It should be noted that different keywords can determine different bill types, as shown in Table 1:
[0080] Table 1
[0081]
[0082]
[0083] S320: extract the target virtual file of the electronic voucher file through an open source tool, extract the XBRL file from the target virtual file, identify the XBRL file and extract keywords and structured data in the XBRL file.
[0084] Optionally, when the file type of the electronic voucher file is PDF, an open source tool including but not limited to PDFBOX is used to extract a target virtual file named voucher_issuer.xbrl from the electronic voucher file. Since the XBRL file of PDF is stored in the target virtual file, the XBRL file can be extracted from the target virtual file. Then, the XBRL file is identified and keywords and structured data (specifically structured data in XML format, XML structured data) in the XBRL file are extracted. It can be understood that the form of the keywords is as shown in Table 1.
[0085] S400: Determine the bill type of the electronic voucher file according to the keyword, and encapsulate the structured data according to the bill type for archiving.
[0086] Optionally, the bill type corresponding to the electronic voucher file may be determined according to the keywords in Table 1.
[0087] Optionally, step S400 includes steps S410-S420:
[0088] S410. Convert the structured data in XML format into JSON structured data for data encapsulation according to the bill type.
[0089] Optionally, according to different bill types, the structured data in XML format is converted into corresponding json structured data for data encapsulation through the dom4j tool class. The json structured data can extract key field information according to the electronic voucher accounting data specification for different bill types. For example, if the bill type is a general payment book for non-tax revenue, the key field information required is extracted according to the accounting data specification for general payment books for non-tax revenue; if the bill type is a railway electronic ticket, the key field information required is extracted according to the railway electronic passenger accounting data specification.
[0090] S420. Generate a target archive format file according to the json structure data, and archive the target archive format file and the electronic voucher file.
[0091] Optionally, the electronic voucher file of each bill type is encapsulated into XML structured data and pushed to the accounting archive. After receiving the electronic voucher file of each bill type, the accounting archive converts the XML structured data into the corresponding JSON structured data for data encapsulation in the above manner, sorts the fields, and generates the JSON sample files corresponding to each bill type. Then, an XBRL file in the required archiving format (i.e., the target archiving format file) is generated according to the JSON sample file and archived. Optionally, when archiving, the original file of the electronic voucher file is also archived together with the target archiving format file.
[0092] Archiving in the embodiment of the present invention may also include generating an OFD accounting information file based on xml structured data or json structured data and archiving it. For example, the OFD file generation service provides an independent interface service to the outside, transmits structured data (xml structured data or json structured data) via http or ftp, combines the OFD template file, encapsulates the structured data into the OFD file by drawing, generates an OFD file for archiving and returns, so that users can obtain archived electronic voucher files such as OFD files through http or ftp interfaces. It should be noted that in order to draw OFD files more flexibly and freely, the open source component OFD R&W is used, and a special element Canvas is provided. Therefore, by drawing Canvas and implementing a drawer, an OFD file can be generated. The process of drawing OFD is as follows: 1. Create Canvas and set the width and height; 2. Determine the number of drawing pages based on the structured data; 3. Use Canvas to draw pages and fill in data.
[0093] Optionally, the electronic credential management method of the embodiment of the present invention further includes consulting the archived electronic credential file, which may include step S501, and one of S502, S503, and S504:
[0094] S501. Obtain the archived electronic certificate file through http or ftp interface.
[0095] Optionally, the user can obtain the electronic credential file stored in the server archive through the http or ftp interface. For example, if it is anonymous access, if the FTP URL to be previewed can be accessed anonymously (no username and password are required), then the preview can be performed directly by downloading the URL; if it is non-anonymous access, and the preview service only accesses one FTP server, only the FTP link information needs to be configured in the configuration file, then the preview can be performed directly by downloading the URL; if it is non-anonymous access, and the preview service needs to access multiple FTP servers, and the username and password are inconsistent, the URL can be obtained by adding the username and password and other parameters to the URL for preview (the URL parameters are optimized in the configuration file) to obtain the URL for preview.
[0096] S502: When the file type of the electronic certificate file is PDF, the electronic certificate file is converted into a picture set or the electronic certificate file is viewed through a PDF control.
[0097] Optionally, after obtaining the electronic certificate file, when the file type of the electronic certificate file is PDF, the electronic certificate file is converted into a picture set, so that it can be directly previewed online in the form of pictures, or the electronic certificate file can be viewed online through a PDF control.
[0098] S503: When the file type of the electronic voucher file is OFD, the electronic voucher file is subjected to graphic drawing processing to generate an SVG vector graphic for reference.
[0099] like Figure 3 As shown, optionally, after obtaining the electronic credential file, when the file type of the electronic credential file is OFD, the electronic credential file is subjected to graphic drawing processing, for example, including but not limited to introducing the OFD document parsing package (ofdrw-reade.jar), using the graphics drawing implementation java.awtAPI provided by Apachebatik-transcoder to draw, and finally generating SVG vector graphics for online reference. It should be noted that the use of SVG vector graphics for online reference has the following advantages: 1) Clarity: The size of SVG files can be increased and they can be resized as many times as needed without losing clarity - this is a huge benefit compared to raster images, which can become blurry or look grainy if they are not sized appropriately; 2) Small file size: The size of an SVG file can be much smaller than a PNG or JPG of the same image. SVG files can be 60% to 80% smaller than PNG files, which helps to minimize loading time and improve user experience.
[0100] S504: Render the electronic voucher file through a template engine so as to be viewed on the front end.
[0101] Optionally, when the file type of the electronic voucher file is OFD, PDF or other file types such as jpg, cad, txt, xlsx, mp4, md and other formats, the electronic voucher file can be rendered through the template engine for online viewing on the front end. For example, including but not limited to rendering the electronic voucher file through the ftl type freemaker file, realizing online reading and previewing of various electronic vouchers, improving financial work efficiency; at the same time, the online preview service is an abstract interface, which is convenient for supporting preview of other types of files added.
[0102] Compared with the prior art, the electronic voucher management method of the embodiment of the present invention: 1) introduces XBRL technology to realize paperless full-process management of electronic voucher reception, parsing, reading, and archiving, reduces manual operations, and is conducive to improving management efficiency; 2) supports a variety of different bill types, and realizes automatic data packaging and archiving according to different bill types, which is convenient and highly practical.
[0103] The embodiment of the present invention further provides an electronic certificate management device, including:
[0104] An acquisition module, used for acquiring an electronic certificate file;
[0105] The signature verification module is used to verify the signature of the electronic certificate file according to the file type of the electronic certificate file;
[0106] The identification module is used to identify the electronic voucher file when the signature verification result is successful, identify the XBRL file and extract the keywords and structured data in the XBRL file;
[0107] The archiving module is used to determine the bill type of the electronic voucher file according to the keyword, and encapsulate the structured data according to the bill type for archiving.
[0108] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments, and will not be repeated herein.
[0109] The embodiment of the present invention also provides another electronic credential management device, which includes a processor and a memory, wherein at least one instruction, at least one program, code set or instruction set is stored in the memory, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the electronic credential management method of the above embodiment. Optionally, the electronic credential management device includes but is not limited to a mobile phone, a tablet computer, a computer, and a car computer.
[0110] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments, and will not be repeated herein.
[0111] An embodiment of the present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the electronic credential management method of the aforementioned embodiment.
[0112] The embodiment of the present invention also provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the electronic credential management method of the aforementioned embodiment.
[0113] The terms "first", "second", "third", "fourth", etc. (if any) in the specification 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 of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0114] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0115] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and 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, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0116] 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 multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0117] 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 replace some of the technical features therein by equivalents. 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. An electronic voucher management method, characterized in that: include: Obtain electronic credential documents; Performing signature verification on the electronic certificate file according to the file type of the electronic certificate file; When the signature verification result indicates success, the electronic certificate file is identified, the XBRL file is identified, and keywords and structured data in the XBRL file are extracted; The bill type of the electronic voucher file is determined according to the keyword, and the structured data is packaged according to the bill type for archiving.
2. The electronic certificate management method according to claim 1, characterized in that: The performing signature verification processing on the electronic certificate file according to the file type of the electronic certificate file includes: When the file type of the electronic certificate file is PDF, the signature is verified by SPIRE PDF Free for Java; or, When the file type of the electronic credential file is OFD, obtain the first signature file according to the signature entry information of the ofd.xml file after the electronic credential file is decompressed, read the protection file, digest algorithm and first digest of the first signature file, perform digest calculation on the protection file through the digest algorithm to obtain the second digest, and when the first digest is the same as the second digest, read the first signature file to obtain the signature algorithm, and verify the signature through the signature algorithm.
3. The electronic certificate management method according to claim 2, characterized in that: The step of obtaining the first signature file according to the signature entry information of the ofd.xml file after decompression of the electronic certificate file comprises: Searching for a second signature file according to the signature entry information; The first signature file is found according to the tag information of the second signature file.
4. The electronic certificate management method according to claim 2, characterized in that: The verifying the signature by using the signature algorithm includes: Generate a third digest according to the signature algorithm and the first signature file; Read the signature value file to obtain the signature value, signature attribute value, public key certificate and original text summary value; When the third digest is the same as the original text digest value, performing digest preprocessing on the signature attribute value; The signature is verified according to the signature value, the public key certificate and the summary preprocessing result to obtain a signature verification processing result.
5. The electronic certificate management method according to claim 1, characterized in that: The step of performing identification processing on the electronic voucher file, identifying the XBRL file and extracting keywords and structured data from the XBRL file includes: Searching for the Document.xml file according to the file entry information of the ofd.xml file after the electronic voucher file is decompressed, and searching for the Attachments.xml file according to the tag of the Document.xml file, searching for the XBRL file according to the tag of the Attachments.xml file, identifying the XBRL file and extracting keywords and structured data in the XBRL file; or, The target virtual file of the electronic voucher file is extracted by an open source tool, an XBRL file is extracted from the target virtual file, the XBRL file is identified, and keywords and structured data in the XBRL file are extracted.
6. The electronic certificate management method according to claim 1, characterized in that: The step of encapsulating the structured data according to the bill type for archiving includes: Convert the structured data in XML format into JSON structured data for data encapsulation according to the bill type; Generate a target archive format file according to the json structure data, and archive the target archive format file and the electronic certificate file.
7. The electronic certificate management method according to claim 1, characterized in that: The method further comprises reviewing the archived electronic credential file: Obtain archived electronic voucher files through http or ftp interface; When the file type of the electronic certificate file is PDF, convert the electronic certificate file into a picture set or access the electronic certificate file through a PDF control; or, When the file type of the electronic certificate file is OFD, the electronic certificate file is subjected to graphic drawing processing to generate an SVG vector graphic for reference; or, The electronic certificate file is rendered through a template engine so as to be viewed on the front end.
8. An electronic certificate management device, characterized in that: include: An acquisition module, used for acquiring an electronic certificate file; A signature verification module, used to perform signature verification processing on the electronic certificate file according to the file type of the electronic certificate file; An identification module, used for, when the signature verification result indicates success, performing identification processing on the electronic voucher file, identifying the XBRL file and extracting keywords and structured data from the XBRL file; The archiving module is used to determine the bill type of the electronic voucher file according to the keyword, and encapsulate the structured data according to the bill type for archiving.
9. An electronic certificate management device, characterized in that: The electronic credential management device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method as described in any one of claims 1-7.
