A method and device for detecting the quality of OFD files
Patent Information
- Application Number
- CN202311657870.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-12-05
AI Technical Summary
[0004]本发明所要解决的技术问题是:提供一种OFD文件质量检测方法及装置,解决检测效率低以及无法准确检测OFD文件质量的问题
[0021]本发明的有益效果在于:基于验证需求将OFD模板文件转化成验证文件,以及采集待生成数据信息中的数据生成数据文件,再将数据文件与验证文件叠加生成OFD签章文件,由于最终是生成一个文件,使得在校验时可以只通过OFD签章文件内的验证部分对数据部分进行验证,无需依赖第三方控件或阅读器对OFD文件进行验证,实现通过OFD文件自身就可以校验OFD文件中的数据以及签章信息,从而解决现有OFD文件检测效率低以及无法检测文件质量的问题。
Smart Images

Figure CN117709321B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data quality inspection technology, and in particular to a method and apparatus for OFD file quality inspection. Background Technology
[0002] OFD format documents are a format standard for document layout independently developed and formulated in my country. Currently, OFD has been applied in fields such as electronic documents, electronic certificates, electronic archives, and electronic invoices.
[0003] With the widespread use of OFD (Off-Demand Facility) format documents, the quality of OFD document data has become increasingly important. Quality inspection of OFD document data typically involves using a reader to read signature and metadata information. However, verifying signature information alone cannot accurately determine the accuracy of an OFD file; it only verifies the legality of the OFD file itself, but cannot check for data quality issues. Furthermore, using a reader for inspection is inefficient. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide an OFD file quality detection method and apparatus to solve the problems of low detection efficiency and inability to accurately detect OFD file quality.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0006] An OFD file quality inspection method, comprising:
[0007] Obtain the data to be generated and the OFD template file;
[0008] The OFD template file is converted into a verification file according to the verification requirements;
[0009] Data is collected from the aforementioned data information to obtain a data file;
[0010] The data file and the verification file are superimposed to form an OFD signature file;
[0011] Read the verification file and data file from the OFD signature file;
[0012] The data file is verified according to the verification document.
[0013] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0014] An OFD document quality inspection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0015] Obtain the data to be generated and the OFD template file;
[0016] The OFD template file is converted into a verification file according to the verification requirements;
[0017] Data is collected from the aforementioned data information to obtain a data file;
[0018] The data file and the verification file are superimposed to form an OFD signature file;
[0019] Read the verification file and data file from the OFD signature file;
[0020] The data file is verified according to the verification document.
[0021] The beneficial effects of this invention are as follows: Based on verification requirements, the OFD template file is converted into a verification file, and data from the data to be generated is collected to generate a data file. Then, the data file and the verification file are superimposed to generate an OFD signature file. Since only one file is generated in the end, the data part can be verified only through the verification part in the OFD signature file during verification, without relying on third-party controls or readers to verify the OFD file. This enables the verification of data and signature information in the OFD file itself, thereby solving the problems of low detection efficiency and inability to detect file quality in existing OFD files. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating the steps of an OFD file quality detection method according to an embodiment of the present invention.
[0023] Figure 2 This is a schematic diagram of an OFD file quality detection device according to an embodiment of the present invention. Detailed Implementation
[0024] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0025] Please refer to Figure 1 An OFD file quality inspection method, comprising:
[0026] Obtain the data to be generated and the OFD template file;
[0027] The OFD template file is converted into a verification file according to the verification requirements.
[0028] Data is collected from the aforementioned data information to obtain a data file;
[0029] The data file and the verification file are superimposed to form an OFD signature file;
[0030] Read the verification file and data file from the OFD signature file;
[0031] The data file is verified according to the verification document.
[0032] As described above, the beneficial effects of this invention are as follows: based on verification requirements, the OFD template file is converted into a verification file, and data from the data to be generated is collected to generate a data file. Then, the data file and the verification file are superimposed to generate an OFD signature file. Since only one file is generated in the end, the data part can be verified only through the verification part in the OFD signature file during verification, without relying on third-party controls or readers to verify the OFD file. This enables the verification of data and signature information in the OFD file itself, thereby solving the problems of low detection efficiency and inability to detect file quality in existing OFD files.
[0033] Furthermore, the OFD template file includes the region coordinates, field information, data format, and constraints for each object;
[0034] The verification requirements include the verification object and the verification method;
[0035] The step of converting the OFD template file into a verification file according to the verification requirements includes:
[0036] The current verification object is selected from at least one of the region coordinates, field information, data format, and constraints, and the corresponding verification method of the current verification object is obtained.
[0037] The OFD template file is traversed and parsed to transform the current verification object into a verification file containing at least one verification area based on the region coordinates, field information, data format, or constraints of the current verification object.
[0038] As described above, the template file includes items such as regional coordinates, field information, data format, and constraints. This allows for the selection of appropriate verification items to validate the OFD file based on different validation requirements, making the validation method more flexible and diverse to meet various validation needs.
[0039] Further, the step of verifying the data file according to the verification file includes:
[0040] The corresponding content in the data file is verified based on at least one of the region coordinates, field information, data format, and constraints in the verification file.
[0041] As described above, validating the corresponding content in the data file based on at least one of the following: regional coordinate location, field information, data format, and constraints, can meet different validation requirements.
[0042] Further, the step of overlaying the data file and the verification file to form a signed OFD file includes:
[0043] The data file and the verification file are overlaid to form a layout file;
[0044] The aforementioned document is signed to obtain an OFD signed document.
[0045] As described above, the data file and verification file are first converted into a standard format file so that the final file meets the OFD file format requirements, and then the format file is signed to generate an OFD signed file.
[0046] Furthermore, the step of overlaying the data file and the verification file to form an OFD signature file also includes:
[0047] Obtain template base image information;
[0048] The data file, verification file, and template base map information are superimposed to form the OFD signature file.
[0049] As described above, by overlaying data files, verification files, and template base map information to form OFD signed files, different template base map information can be selected to generate OFD signed files according to the file design requirements, thereby meeting different design needs.
[0050] An OFD document quality inspection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0051] Obtain the data to be generated and the OFD template file;
[0052] The OFD template file is converted into a verification file according to the verification requirements.
[0053] Data is collected from the aforementioned data information to obtain a data file;
[0054] The data file and the verification file are superimposed to form an OFD signature file;
[0055] Read the verification file and data file from the OFD signature file;
[0056] The data file is verified according to the verification document.
[0057] As described above, based on verification requirements, the OFD template file is converted into a verification file, and data from the data to be generated is collected to create a data file. The data file and the verification file are then superimposed to generate an OFD signature file. Since only one file is generated in the end, the data part can be verified only through the verification part within the OFD signature file during verification, without relying on third-party controls or readers to verify the OFD file. This allows the data and signature information in the OFD file to be verified through the OFD file itself, thereby solving the problems of low efficiency and inability to detect file quality in existing OFD file detection methods.
[0058] Furthermore, the OFD template file includes the region coordinates, field information, data format, and constraints for each object;
[0059] The verification requirements include the verification object and the verification method;
[0060] The step of converting the OFD template file into a verification file according to the verification requirements includes:
[0061] The current verification object is selected from at least one of the region coordinates, field information, data format, and constraints, and the corresponding verification method of the current verification object is obtained.
[0062] The OFD template file is traversed and parsed to transform the current verification object into a verification file containing at least one verification area based on the region coordinates, field information, data format, or constraints of the current verification object.
[0063] As described above, the template file includes items such as regional coordinates, field information, data format, and constraints. This allows for the selection of appropriate verification items to validate the OFD file based on different validation requirements, making the validation method more flexible and diverse to meet various validation needs.
[0064] Further, the step of verifying the data file according to the verification file includes:
[0065] The corresponding content in the data file is verified based on at least one of the region coordinates, field information, data format, and constraints in the verification file.
[0066] As described above, validating the corresponding content in the data file based on at least one of the following: regional coordinate location, field information, data format, and constraints, can meet different validation requirements.
[0067] Further, the step of overlaying the data file and the verification file to form a signed OFD file includes:
[0068] The data file and the verification file are overlaid to form a layout file;
[0069] The aforementioned document is signed to obtain an OFD signed document.
[0070] As described above, the data file and verification file are first converted into a standard format file so that the final file meets the OFD file format requirements, and then the format file is signed to generate an OFD signed file.
[0071] Furthermore, the step of overlaying the data file and the verification file to form an OFD signature file also includes:
[0072] Obtain template base image information;
[0073] The data file, verification file, and template base map information are superimposed to form the OFD signature file.
[0074] As described above, OFD signature documents are formed by overlaying data files, verification files, and template base map information. This allows for the selection of different template base map information to generate OFD signature documents based on document design requirements, thereby meeting diverse design needs.
[0075] The OFD file quality detection method and apparatus provided by this invention are applicable to OFD file detection scenarios and can realize self-detection of OFD files. The following is a description through specific embodiments:
[0076] Example 1
[0077] Please refer to Figure 1 An OFD file quality inspection method, comprising:
[0078] S1. Obtain the data information to be generated and the OFD template file; for example, in this embodiment, a business license is used as an example, and the data information to be generated is the business license; obtain the corresponding data information by uploading the business license base image, such as the unified social credit code, certificate number, name, registered capital, legal representative, establishment date, and registration unit information that a business license usually includes; at the same time, configure the field information of the business license (including the English name of the field, field length limit, field type, etc.), which can be configured through the OFD template file; wherein, the OFD template file includes the regional coordinate position, field information, data format, and constraints of each object, that is, the object includes the above-mentioned unified social credit code, certificate number, and other information.
[0079] S2. Convert the OFD template file into a verification file according to the verification requirements; wherein, the verification requirements include verification objects and verification methods; according to the specific verification requirements, take at least one of the region coordinate position, field information, data format, and constraint conditions as the current verification object, and obtain the corresponding verification method of the current verification object; by traversing and parsing the current verification objects in the OFD template file, convert the OFD template file into a verification file containing at least one verification region according to the region coordinate position, field information, data format, or constraint conditions of the current verification object. If it includes multiple objects, convert it into a verification file containing verification for each region. The format of the verification file can be JSON format or other types of formats. Specifically:
[0080] Design the template area by dragging the face field information defined in step S1 to the corresponding position on the base map and configuring the area data verification rules. For example, if the area contains a unified social credit code (i.e., the verification object), the verification file can be configured with the legal entity database verification address and verification parameters, etc. Configure the unified credit code verification rules, allowing the following rules (i.e., verification rules):
[0081] (1) Whether the unified social credit code is accurate: such as needing to meet 18 letters and numbers;
[0082] (2) Configure whether to call third-party verification: If third-party verification is required, you can configure the call address, call method (including GET and POST methods), call parameters (defining input parameters), and return parameters; multiple third-party verification calls are allowed.
[0083] (3) Configure whether to verify the accuracy of the data source through the database: By configuring the database connection string, the target table is compared to determine whether the entered data exists;
[0084] In this embodiment, the data itself is verified, such as whether the unified credit code is legal and valid, whether the ID card number is valid, or whether the individual has a criminal record, which would render the OFD file an invalid data verification form. Simultaneously, after completing step S2, two JSON files will be generated: the first JSON file is the template file, i.e., the OFD template design file; the second JSON file is the verification file, i.e., the OFD data verification file.
[0085] S3. Collect the data from the data information to obtain a data file; for example, submit the business license data in JSON format to generate a JSON data file.
[0086] S4. Overlay the data file and the verification file to form an OFD signature file, specifically:
[0087] S41. Obtain template base image information; the template base image information is the base image file in the template design process, which is equivalent to the background image; at the same time, the template base image information can also be obtained in step S1;
[0088] S42. The data file, the verification file, and the template base image information are superimposed to form a layout file; that is, the template base image information, OFD template design file, OFD data verification file, and JSON data file obtained above are superimposed to form the layout file;
[0089] S43. Sign the aforementioned document to obtain an OFD signed document.
[0090] S5. Read the verification file and data file in the OFD signature file; that is, read the OFD data verification file and JSON data file.
[0091] S6. Verify the data file according to the verification file, that is, verify the JSON data file in the OFD signature file with the JSON data verification file; and verify the corresponding content in the data file according to at least one of the area coordinate positions, field information, data format, and constraints in the JSON verification file, such as checking whether there are problems with data quality, whether the seal coordinate information is accurate, whether the font size is compliant, and other multi-dimensional verifications. Specifically:
[0092] For example, if a company uploads its OFD business license (i.e., the OFD signed document) through a window service based on steps S1-S4, and the validity of the OFD business license needs to be verified, the OFD business license is parsed to obtain the corresponding JSON data file and JSON data verification file. The corresponding node data in the JSON data file is obtained by traversing the English names of the fields corresponding to the nodes in the JSON data verification file, and the verification is performed according to the verification rules of the corresponding nodes in the JSON data verification file. Taking the unified social credit code as an example, the verification is performed based on the rules defined in step S2. Other data value objects are also traversed in a loop, and finally the validity of the business license is verified.
[0093] Example 2
[0094] Please refer to Figure 2 An OFD document quality inspection device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0095] S1. Obtain the data information to be generated and the OFD template file; wherein, the OFD template file includes the region coordinate position, field information, data format and constraints of each object.
[0096] S2. Convert the OFD template file into a verification file according to the verification requirements; wherein, the verification requirements include verification objects and verification methods; according to the specific verification requirements, take at least one of the region coordinate position, field information, data format, and constraint conditions as the current verification object, and obtain the corresponding verification method of the current verification object; by traversing and parsing the current verification object in the OFD template file, convert the OFD template file into a verification file containing at least one verification region according to the region coordinate position, field information, data format, or constraint conditions of the current verification object, and if it includes multiple objects, convert it into a verification file containing verification for each region, wherein the format of the verification file can be JSON format or other types of formats.
[0097] S3. Collect the data from the data information to obtain a data file; for example, submit the corresponding data in JSON format to generate a JSON format data file.
[0098] S4. Overlay the data file and the verification file to form an OFD signature file;
[0099] S41. Obtain template base image information; the template base image information is the base image file in the template design process, which is equivalent to the background image; at the same time, the template base image information can also be obtained in step S1;
[0100] S42. The data file, the verification file, and the template base image information are superimposed to form a layout file; that is, the template base image information, OFD template file, verification file, and data file obtained above are superimposed to form the layout file;
[0101] S43. Sign the aforementioned document to obtain an OFD signed document.
[0102] S5. Read the verification file and data file from the OFD signature file.
[0103] S6. Verify the data file according to the verification file.
[0104] In summary, the OFD file quality inspection method and apparatus provided by this invention converts an OFD template file into a verification file based on verification requirements, collects data from the data to be generated to create a data file, and then superimposes the data file and the verification file to generate an OFD signature file. Since a single file is ultimately generated, verification can be performed on the data portion only through the verification part of the OFD signature file, eliminating the need for third-party controls or readers to verify the OFD file itself. This allows for the verification of data and signature information within the OFD file itself, thus solving the problems of low efficiency and inability to detect file quality in existing OFD file inspection methods, and improving the security of OFD file data quality. Furthermore, this method supports diverse data formats, enabling verification of any OFD file and not limiting its application scenarios.
[0105] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for detecting the quality of OFD files, characterized in that, include: Obtain the data to be generated and the OFD template file; The OFD template file is converted into a verification file according to the verification requirements. Data is collected from the aforementioned data information to obtain a data file; The data file and the verification file are superimposed to form an OFD signature file; Read the verification file and data file from the OFD signature file; The data file is verified according to the verification document; The OFD template file includes the region coordinates, field information, data format, and constraints for each object; The verification requirements include the verification object and the verification method; The step of converting the OFD template file into a verification file according to the verification requirements includes: The current verification object is selected from at least one of the region coordinates, field information, data format, and constraints, and the corresponding verification method of the current verification object is obtained. The OFD template file is traversed and parsed to transform the current verification object into a verification file containing at least one verification area based on the region coordinates, field information, data format, or constraints of the current verification object.
2. The OFD file quality detection method according to claim 1, characterized in that, The step of verifying the data file according to the verification file includes: The corresponding content in the data file is verified based on at least one of the region coordinates, field information, data format, and constraints in the verification file.
3. The OFD file quality detection method according to claim 1, characterized in that, The step of overlaying the data file and the verification file to form a signed OFD file includes: The data file and the verification file are overlaid to form a layout file; The aforementioned document is signed to obtain an OFD signed document.
4. The OFD document quality detection method according to claim 1 or 3, characterized in that, The step of overlaying the data file and the verification file to form an OFD signature file further includes: Obtain template base image information; The data file, verification file, and template base map information are superimposed to form the OFD signature file.
5. An OFD document quality inspection device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it performs the following steps: Obtain the data to be generated and the OFD template file; The OFD template file is converted into a verification file according to the verification requirements. Data is collected from the aforementioned data information to obtain a data file; The data file and the verification file are superimposed to form an OFD signature file; Read the verification file and data file from the OFD signature file; The data file is verified according to the verification document; The OFD template file includes the region coordinates, field information, data format, and constraints for each object; The verification requirements include the verification object and the verification method; The step of converting the OFD template file into a verification file according to the verification requirements includes: The current verification object is selected from at least one of the region coordinates, field information, data format, and constraints, and the corresponding verification method of the current verification object is obtained. The OFD template file is traversed and parsed to transform the current verification object into a verification file containing at least one verification area based on the region coordinates, field information, data format, or constraints of the current verification object.
6. The OFD document quality inspection device according to claim 5, characterized in that, The step of verifying the data file according to the verification file includes: The corresponding content in the data file is verified based on at least one of the region coordinates, field information, data format, and constraints in the verification file.
7. The OFD document quality inspection device according to claim 5, characterized in that, The step of overlaying the data file and the verification file to form a signed OFD file includes: The data file and the verification file are overlaid to form a layout file; The aforementioned document is signed to obtain an OFD signed document.
8. An OFD document quality inspection device according to claim 5 or 7, characterized in that, The step of overlaying the data file and the verification file to form an OFD signature file further includes: Obtain template base image information; The data file, verification file, and template base map information are superimposed to form the OFD signature file.
Citation Information
Patent Citations
Method for converting PDF form domain template file into OFD template file
CN115510833A
Technology for reading four-property data of OFD virtual partition by reading robot to simulate human processing
CN116719777A