Virtual printing-based electronic file collection method and device, equipment and medium

By intercepting printing commands with a virtual printer and utilizing recognition templates and data dictionary translation technology, the problem of insufficient accuracy and structure of machine-readable information in the generation of electronic documents in existing technologies has been solved, achieving high-quality electronic document generation with strong adaptability and reduced system transformation costs.

CN121300725BActive Publication Date: 2026-03-17CHINA ELECTRONICS STANDARDIZATION INST
View PDF -1 Cites 0 Cited by

Patent Information

Application Number
CN202511881781.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-17
Estimated Expiration
2045-12-15

AI Technical Summary

Technical Problem

Existing technologies lack accuracy, completeness, and structure in generating electronic documents, particularly in terms of low OCR recognition accuracy and inability to restore implicit metadata items and hierarchical data content.

Method used

By configuring a virtual printer on the client to intercept printing commands, using recognition templates for structured marking and OCR recognition, and combining data dictionaries to translate variable content, hierarchical data nodes are generated and converted into electronic documents containing both human-readable and machine-readable information.

Benefits of technology

It improves the accuracy and completeness of machine-readable information in electronic documents, can restore implicit metadata items and hierarchical structures, generates high-quality electronic documents, is highly adaptable, and reduces system transformation costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121300725B_ABST
    Figure CN121300725B_ABST
Patent Text Reader

Abstract

This invention relates to a method, apparatus, device, and medium for acquiring electronic documents based on virtual printing, and pertains to the field of digital data information processing technology. The method includes: a client obtaining graphic and textual output content from a business system via a virtual printer; matching this content with a recognition template; marking textual content within the variable domain range recognized by the recognition template when a match is successful; performing OCR recognition on non-textual content and caching the result as variable content; correcting the recognition result according to the recognition template; organizing the variable content into hierarchical data nodes according to the recognition template; querying a local data dictionary to translate the corresponding variable content into corresponding data codes; converting the graphic and textual output content into a layout document; using the data nodes and data codes as indexes or data attachment fragments of the layout document; extracting information from the marked structured content and / or data codes according to the recognition template as metadata for the layout document; and generating an output electronic document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital data information processing technology, and in particular to an electronic document acquisition method, apparatus, device, and medium based on virtual printing. Background Technology

[0002] With the development of information technology, institutions and individuals are continuously raising their requirements for the standardization and evidentiary value of documents as information carriers. To adapt to this change, information systems, when generating electronic documents, must not only include text and graphic information for human reading, but also structured information for computer reading and processing, that is, to achieve "dual inclusion of human-readable and machine-readable information".

[0003] However, in reality, there are many types of information systems, with a long construction period and different technical approaches. Their original design is mostly focused on generating and outputting paper documents, and they do not have the ability to directly generate electronic documents that conform to relevant technical standards or regulations and are rich in structured data.

[0004] In related technologies, patent application CN103973692A proposes an automatic electronic document acquisition system and method based on virtual printing. It captures printed content through a virtual printer and uses optical character recognition (OCR) technology and a pattern library to extract metadata, ultimately generating an electronic document with an identification code. This avoids directly modifying the business system. However, it may have the following limitations:

[0005] (1) When the virtual printer captures a page in image format, OCR recognition is initiated. However, conventional OCR technology has a performance bottleneck. The upper limit of the recognition accuracy for printed single characters is about 97%-99%. When the accumulated metadata items are 10 characters in length, the overall recognition accuracy drops sharply to 73.7%-90.4% (99% to the power of 10). This performance bottleneck makes it difficult to use the output results directly as reliable structured data.

[0006] (2) Processing and analysis are limited to the visible content that appears in the print request, and are limited to metadata. On the one hand, it is impossible to restore the implicit metadata items (such as the "Male" code corresponding to gender "male" in medical documents), and on the other hand, it is difficult to process data content with hierarchical structure (such as the "drug name" in a Western medicine prescription having a "many-to-one" relationship with the prescription number), and it is impossible to restore the original logical structure of business data.

[0007] Therefore, the electronic documents generated by existing methods have certain limitations in terms of the accuracy, completeness, and structure of machine-readable information. Summary of the Invention

[0008] This invention provides a method, apparatus, device, and medium for acquiring electronic documents based on virtual printing, which solves the problems of insufficient accuracy, completeness, and structure of machine-readable information in generated electronic documents.

[0009] To achieve the above objectives, this application adopts the following technical solution:

[0010] Firstly, a method for acquiring electronic documents based on virtual printing is provided, including:

[0011] Configure the client to intercept and cache print commands from the business system through a pre-configured virtual printer, and obtain the graphic and text output content in the command;

[0012] The image and text output content is matched with the recognition template; the recognition template is used to perform structured marking and OCR recognition on the image and text output content; the recognition template is cached locally on the client according to the recognition template library preset on the server; the content to be recognized by the recognition template includes: fixed content, variable fields, data source relationships of variable content, expected content type and / or metadata items;

[0013] When a match is successful, the text content within the variable field range identified by the recognition template is marked; if the variable field range contains non-text content, the client-preset OCR module is invoked to perform content recognition, and the recognition result is cached as variable content; the recognition result is corrected according to the expected content type defined in the recognition template.

[0014] Based on the data relationships defined in the recognition template, the variable content is organized into hierarchical data nodes; according to the translation requirements preset in the recognition template, the local data dictionary is queried to translate the corresponding variable content into the corresponding data code; the local data dictionary is cached on the client's local machine according to the data dictionary preset on the server.

[0015] The text and image output content is converted into a set layout document; the data nodes and data codes are used as indexes or data attachment fragments in the layout document;

[0016] Based on the metadata items defined in the identification template, extract corresponding information from the tagged structured content and / or data codes as the metadata of the layout document; generate and output an electronic file containing human-readable and machine-readable information.

[0017] Secondly, an electronic document acquisition device based on virtual printing is provided, comprising:

[0018] The image and text output content acquisition module is used to configure the client to intercept and cache printing instructions from the business system through a preset virtual printer, and obtain the image and text output content in the instructions;

[0019] The recognition template matching module is used to match the image and text output content with the recognition template; the recognition template is used to perform structured marking and OCR recognition on the image and text output content; the recognition template is cached locally on the client according to the recognition template library preset on the server; the content to be recognized by the recognition template includes: fixed content, variable fields, data source relationships of variable content, expected content type and / or metadata items;

[0020] The structured tagging module is used to tag the text content within the variable field range identified by the recognition template when a match is successful; if the variable field range contains non-text content, the client-preset OCR module is invoked to perform content recognition, and the recognition result is cached as variable content; the recognition result is corrected according to the expected content type defined in the recognition template.

[0021] The data code translation module is used to organize variable content into hierarchical data nodes according to the data relationships defined in the recognition template; according to the translation requirements preset in the recognition template, it queries the local data dictionary to translate the corresponding variable content into the corresponding data code; the local data dictionary is cached on the client's local machine according to the data dictionary preset on the server.

[0022] The document page conversion module is used to convert the text and image output content into a set layout document; and to use the data nodes and data codes as indexes or data attachment fragments of the layout document;

[0023] The electronic document generation and output module is used to extract corresponding information from the marked structured content and / or data codes as metadata of the formatted document based on the metadata items defined in the identification template; and to generate and output electronic documents containing human-readable and machine-readable information.

[0024] Thirdly, an electronic device is provided, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the virtual printing-based electronic document acquisition method as described in the first aspect.

[0025] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the electronic document acquisition method based on virtual printing as described in the first aspect. Attached Figure Description

[0026] Figure 1 An architecture diagram of an electronic document acquisition system based on virtual printing is provided for embodiments of this application;

[0027] Figure 2A schematic flowchart illustrating an electronic document acquisition method based on virtual printing, provided for an embodiment of this application;

[0028] Figure 3 A schematic flowchart illustrating another method for acquiring electronic documents based on virtual printing, provided for embodiments of this application;

[0029] Figure 4 A schematic diagram of the structure of an electronic document acquisition device based on virtual printing provided in an embodiment of this application;

[0030] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0031] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the technical solutions in the embodiments of this application are clearly described. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art are within the scope of protection of this application.

[0032] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0033] The steps described in the specification and the flowcharts in the accompanying drawings of this invention are not necessarily strictly executed according to the step numbers; the execution order of the method steps can be changed. Furthermore, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be broken down into multiple steps.

[0034] First, the relevant technologies of this application will be explained in order to understand the technical solution of this application.

[0035] I. Principles of OCR Technology

[0036] OCR (Optical Character Recognition) is a technology that converts text (including printed and handwritten text) in an image into machine-encoded and editable text data. Its core process can be broken down into: image preprocessing, text detection, text recognition, and post-processing. The challenges lie in text detection and post-processing. Providing auxiliary layout segmentation during text detection and accurate targeting of the expected text content during post-processing can significantly improve OCR accuracy.

[0037] II. Virtual Printing Principle

[0038] The core idea of ​​virtual printers is to utilize the operating system's existing printing framework to insert a "virtual printer" into the system's printer list. When a user or application selects this virtual printer to "print," it does not send the data to the physical printer. Instead, it intercepts the data, processes it into a common file format using a conversion engine, and saves it to the disk.

[0039] The advantages of virtual printing are: firstly, its high compatibility and versatility. Any application capable of "printing" can generate electronic files such as PDFs through virtual printing. Secondly, its high fidelity; the quality of electronic files generated by virtual printing is theoretically identical to that printed on paper using a physical printer. Thirdly, it is user-friendly; users only need to perform the print operation, making it simple and intuitive. The disadvantages of virtual printing are: firstly, the quality of the generated files may be poor; sometimes the content obtained is a bunch of images instead of text and vector graphics, leading to difficulties in extracting text, excessively large file sizes, and poor scaling effects. Secondly, metadata and document interactive attributes may be lost.

[0040] Virtual printing to generate electronic files is a highly compatible fallback technology. However, if the application itself provides a "Save As" function, the latter should generally be preferred, as it usually produces higher quality electronic files.

[0041] This specification provides an electronic document acquisition system based on virtual printing, and also relates to an electronic document acquisition method based on virtual printing, an electronic document acquisition device based on virtual printing, a computer device, and a computer-readable storage medium. The following describes each of these in detail with reference to the accompanying drawings and preferred embodiments.

[0042] This virtual printing-based electronic document acquisition system includes a client and a server, which is a "C / S architecture". The client side deploys a customized virtual printer to implement the printing command driver interface and logic from the business system. The client can communicate and interact with the server. Figure 1 .

[0043] Please see Figure 2-3 This application provides an electronic document acquisition method based on virtual printing, such as... Figure 2-3 As shown, it includes:

[0044] Step S1: Configure the client to intercept and cache print commands from the business system through a pre-configured virtual printer, and obtain the graphic and text output content in the command.

[0045] The business system refers to the software system used by an enterprise or organization to handle daily operations and management tasks, such as office automation systems, hospital information systems, and banking or financial business systems.

[0046] In practice, the virtual printing processing logic caches all text and image output content of the current page, including text, images, and lines, which are obtained from print driver interfaces such as TextOut, ImageOut, and PathTo. The client creates a new layout document in the virtual printer's document start phase (corresponding to instructions such as StartDocument) and uses it as the current document.

[0047] Step S2: Match the image and text output content with the recognition template; the recognition template is used to perform structured marking and OCR recognition on the image and text output content; the recognition template is cached locally on the client according to the recognition template library preset on the server.

[0048] The identification template library is configured with multiple customized identification templates, tailored to the characteristics of the electronic documents to be collected and the relevant business information system. The specific content identified by each template includes: fixed content, the maximum variable area (variable domain) of the variable content, the data source relationship of the variable content, the expected content type, and / or metadata items (which variable content can be used as metadata in the file). For example, when this system is used on the doctor's end of a hospital outpatient system, identification templates need to be customized based on existing paper documents such as test reports, prescriptions, and outpatient medical records. All content identified by the above templates requires manual (administrator) confirmation.

[0049] In practice, the client performs template matching in the virtual printer's page-ending stage (corresponding to EndPage and other instructions). First, it queries the last update time of the client's locally cached recognition template library and compares it with the last update time of the server's recognition template library. If the client's last update time is earlier than the server's, newly added recognition templates are downloaded to the client's local machine, and the client's last update time is updated to match the server's. Second, the image and text output content is matched against the client's cached recognition templates, excluding all content within the variable field range of the recognition templates. Algorithms such as key feature matching and similarity matching can be used to match the closest recognition template based on the type and location characteristics of the cached content on this page. If no recognition template is matched due to similarity being below a threshold, the cached content of this page is pushed to the server to update the recognition template library.

[0050] Step S3: When a match is successful, the text content within the variable field range identified by the recognition template is marked; if the variable field range contains non-text content, the client's preset OCR module is called to perform content recognition, and the recognition result is cached as variable content; the recognition result is corrected according to the expected content type defined in the recognition template.

[0051] If a match fails, configure the server to generate a new recognition template and update the template library, or mark it as no longer being pushed.

[0052] In this step, the OCR recognition process utilizes the predefined variable domain position range of the recognition template to assist in locating the text detection area, and uses the expected content type and data relationship to optimize the post-processing correction of OCR.

[0053] The recognition templates in the recognition template library are dynamically updated. When no suitable recognition template is found, the client pushes the cached content of the current page to the server and waits for the template library to be updated. The server can then be processed by the administrator to generate a new template or mark it as no longer being pushed.

[0054] In practice, if a page captured by the virtual printer cannot find a suitable recognition template during template matching, it is immediately pushed to the backend. Administrators can observe the page content in the pending list. Once it is confirmed that the page needs to be used as a recognition template, its fixed content, the maximum variable area (variable domain) of the variable content, the data source relationship of the variable content, the expected content type, and / or metadata items are defined. After confirmation, it is marked as effective; otherwise, it can be marked as not to be pushed again. The client push-administrator confirmation-client effectiveness process is generally asynchronous. In the early stages of system application, this process can be compressed to 3-10 minutes by configuring multiple administrators and using rapid marking. In some possible implementations, the above dynamic update process requires manual confirmation in the initial stage to ensure accuracy. As data accumulates, the workload of manual confirmation will be significantly reduced. In some examples, this part of the work can also be partially or entirely replaced by a large model.

[0055] Step S4: Based on the data relationships defined in the recognition template, organize the variable content into hierarchical data nodes; based on the translation requirements preset in the recognition template, query the local data dictionary to translate the corresponding variable content into the corresponding data code; the local data dictionary is cached on the client's local machine according to the data dictionary preset on the server.

[0056] The hierarchical data nodes include master-detail table relationships and / or many-to-one relationships; this is the logical structure of the original business data fully restored based on the data source relationships defined in the recognition template. If the recognition template has a content translation configuration for this area, the local data dictionary will be queried to translate the corresponding variable content into the corresponding data code. For example, fields such as drug names can be configured as "translation required," while patient names can be configured as "translation not required." Since there is no corresponding standard code for names, they can be stored directly as text.

[0057] This step, based on the data source relationship definition within the identification template, first arranges the variable content to the designated position within the custom index or data attachment content, and marks it on data nodes that support master-child tables and many-to-one structures. Second, it searches the local data dictionary to translate the variable content into data codes and performs data relationship verification based on the data source relationship definition. If no valid information is returned from the local data dictionary, the data content, variable fields, and identification template identifiers are pushed to the server to update the data dictionary.

[0058] The data dictionary is also dynamically updated. If a query of the local data dictionary fails, the unrecognized data content, its variable domain, and template identification information are pushed to the server to trigger the data dictionary update process. The local data dictionary is then updated based on the updated data dictionary.

[0059] In practice, if the data code mapping process for virtual printing fails to find the data code in the local data dictionary, it is immediately pushed to the backend data dictionary. Administrators can observe the data content, associated data domain, and the corresponding identification template in the pending list. Administrators can add the confirmed variable content and its code to the data dictionary. Once the data content is identified as needing to be added to the data dictionary, its data value, code, usage scenario, and new data values ​​and data dictionary items are defined. After confirmation, it is marked as effective; otherwise, it can be marked as not to be pushed again. The client push-administrator confirmation-client effectiveness process is generally asynchronous. In the early stages of system application, this process can be further compressed by configuring multiple administrators and using rapid marking. In some possible implementations, the above-mentioned dynamic data dictionary update process initially requires manual confirmation to ensure accuracy. As data accumulates, the workload of manual confirmation will be significantly reduced. In some examples, the confirmation work can also be partially or entirely replaced by a large model.

[0060] Step S5: Convert the text and image output content into a set layout document; use the data nodes and data codes as indexes or data attachment fragments of the layout document.

[0061] In this step, the cached text and image output content is converted into the page content of the formatted document (e.g., OFD) according to the conventional virtual printing processing logic; the marked data nodes and translated code are converted into custom indexes for the page or data attachment fragments.

[0062] Step S6: Based on the metadata items defined in the identification template, extract the corresponding information from the marked structured content and / or data code as the metadata of the layout document; generate and output an electronic file containing human-readable and machine-readable information.

[0063] In this step, according to the metadata item definition in the matched identification template, appropriate content is selected from the text content of each page that has been marked with data structure relationships and the translated code and registered as the metadata of the corresponding layout document. The index or data attachment fragments of the layout document are merged into a complete index or data attachment and embedded into the layout document. After the client virtual printing and post-processing are completed, the document is output in the specified format, thus forming an electronic document containing human-readable and machine-readable information, which is then delivered to the client in an appropriate manner or collected into other information systems such as electronic document management.

[0064] The following section uses a medical institution's medical record management system as an example to further illustrate the implementation process of the above method.

[0065] 1. Deploy an electronic document acquisition system, deploying a recognition template library and data dictionary on the server side, and installing a virtual printer on the client side.

[0066] 2. Use the medical record management system to print the first page of the medical record, and select the virtual printer of this solution that has been installed. The generated OFD file contains only the page content and does not contain metadata, business data structure indexes, etc.

[0067] 3. The administrator logs into the electronic document acquisition system, selects the "Medical Record Homepage" file on the pending page of the recognition template, and opens it using the template definition tool. By dragging and dropping boxes in the tool, the administrator lists the variable fields (e.g., "Patient Information / Nationality"), the corresponding data item codes (e.g., "nationality"), whether to convert to codes (e.g., "true"), and the corresponding data dictionary items for code conversion (e.g., "Natural Person Information / Nationality"). After confirmation, the administrator uses it as the official recognition template.

[0068] 4. When the medical record cover page is printed again to the virtual printer of this solution, the post-processing of the printed page will match the "medical record cover page" recognition template, and mark the content within the variable field range as data items, convert the data content into code, etc., and record it in the custom index.

[0069] 5. After the printing task is completed, according to the configuration of the recognition template, record some data items as metadata in the OFD file, and organize the marked data nodes such as "Patient Information / Nationality" into semantic indexes for the medical record homepage according to categories such as "Patient Information", "Admission Information", "Symptoms" and "Diagnosis".

[0070] 6. Observe the regenerated OFD file. Metadata already exists, and all modifiable positions on the page are reasonably marked (for example, "China" is marked as "Patient Information / Nationality", and the converted "CHN" is attached as the code for this data item).

[0071] In this embodiment, the template region division with manual marking is used instead of conventional text detection. The text search and matching range is reduced by defining the data source relationship, which improves the accuracy of the OCR process. It can identify the data source relationship of the template to support the complete restoration of the data structure relationship and can automatically match the metadata of electronic documents. This greatly improves the implementation effect of the existing technical solution, meets the new requirements of electronic document management, and has the following advantages:

[0072] 1. A non-intrusive electronic document acquisition scheme based on virtual printing is proposed. It does not disturb the system or software being acquired, is highly practical and adaptable, and significantly reduces the financial, human and communication costs incurred by conventional solutions due to data integration and system transformation.

[0073] 2. By adopting the "match template before recognition" method, the recognition success rate is higher, and the generated electronic documents contain both human-readable and machine-readable information, resulting in higher quality and data value of the collected electronic documents.

[0074] 3. The data dictionary supports data code translation with high translation accuracy. It can restore data items that are not present on the page, greatly improving the completeness of business data structure restoration and making the collected electronic documents more usable.

[0075] 4. Adopting a "server-client" interaction mechanism, the system has the characteristic of "self-evolution". As the "text recognition template" and "data dictionary" are added and improved, the post-printing processing speed is faster and the data accuracy is higher. Moreover, this accumulated and upgraded "wisdom results" can be freely transferred with the export of "recognition template" and "data dictionary".

[0076] See Figure 4 Corresponding to the above-described embodiment of the electronic document acquisition method based on virtual printing, this application embodiment provides an electronic document acquisition device based on virtual printing, comprising:

[0077] The image and text output content acquisition module 1001 is used to configure the client to intercept and cache printing instructions from the business system through a preset virtual printer, and obtain the image and text output content in the instructions;

[0078] The recognition template matching module 1002 is used to match the image and text output content with the recognition template; the recognition template is used to perform structured marking and OCR recognition on the image and text output content; the recognition template is cached locally on the client according to the recognition template library preset on the server; the content to be recognized by the recognition template includes: fixed content, variable fields, data source relationships of variable content, expected content type and / or metadata items;

[0079] The structured tagging module 1003 is used to tag the text content within the variable field range identified by the recognition template when a match is successful; if the variable field range contains non-text content, the client-preset OCR module is called to perform content recognition, and the recognition result is cached as variable content; the recognition result is corrected according to the expected content type defined in the recognition template.

[0080] The data code translation module 1004 is used to organize variable content into hierarchical data nodes according to the data relationship defined in the recognition template; according to the translation requirements preset in the recognition template, it queries the local data dictionary to translate the corresponding variable content into the corresponding data code; the local data dictionary is cached on the client side according to the data dictionary preset on the server side.

[0081] The document page conversion module 1005 is used to convert the text and image output content into a set layout document; and to use the data nodes and data codes as indexes or data attachment fragments of the layout document;

[0082] The electronic document generation and output module 1006 is used to extract corresponding information from the marked structured content and / or data code as metadata of the formatted document based on the metadata items defined in the identification template; and to generate and output an electronic document containing human-readable and machine-readable information.

[0083] Furthermore, if a match fails, the server is configured to generate a new recognition template and update the template library, or it is marked as no longer being pushed.

[0084] Furthermore, the data nodes include master-child table relationships and / or many-to-one relationships to fully restore the logical structure of the original business data.

[0085] Furthermore, if querying the data dictionary fails, the server is configured to update the data dictionary based on the unrecognized data content, its variable domain, and template identifier information.

[0086] The above-described electronic document acquisition device based on virtual printing implements the steps and processes of the above-described electronic document acquisition method based on virtual printing, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0087] See Figure 5 Corresponding to the above embodiments of the electronic document acquisition method based on virtual printing, this application provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps and processes of the above embodiments of the electronic document acquisition method based on virtual printing, and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0088] The memory 1009 can be used to store software programs and various data. The memory 1009 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback function, image playback function, etc.). Furthermore, the memory 1009 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1009 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.

[0089] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into the processor 1010.

[0090] Corresponding to the above embodiments of the electronic document acquisition method based on virtual printing, this application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps and processes of the above embodiments of the electronic document acquisition method based on virtual printing, and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0091] The processor is the processor in the electronic device described in the above embodiments of this application. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk.

[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0094] It is understood that the embodiments of this application have been described above in conjunction with the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. As those skilled in the art will know, various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, those skilled in the art, under the guidance or instruction of this application, can modify these features and embodiments to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, this invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of this invention.

Claims

1. A virtual printing-based electronic document acquisition method, characterized by, The method comprises the following steps: configuring a client to intercept and cache print instructions from a business system through a preset virtual printer to obtain graphic and text output content in the instructions; matching the graphic and text output content with an identification template; the identification template is used for structured labeling and OCR identification of the graphic and text output content; the identification template is cached to the local of the client according to a preset identification template library on the server side; the content identified by the identification template includes fixed content, variable fields, data source relationship of variable content, expected content type and / or metadata items; when the matching is successful, labeling the text content in the variable field range identified by the identification template; if the variable field position range is non-text content, calling a preset OCR module of the client to identify the content, and caching the identification result as variable content; the identification result is corrected according to the expected content type defined in the identification template; organizing the variable content into data nodes with a hierarchical structure according to the data relationship defined in the identification template; according to the preset translation requirements in the identification template, querying a local data dictionary to translate the corresponding variable content into corresponding data codes; the local data dictionary is cached to the local of the client according to a preset data dictionary on the server side; converting the graphic and text output content into a set format document; taking the data nodes and data codes as indexing or data attachment fragments of the format document; extracting corresponding information from the labeled structured content and / or data codes as metadata of the format document according to the metadata items defined in the identification template; generating and outputting an electronic file containing human-readable and machine-readable information.

2. The virtual printing-based electronic file collection method according to claim 1, wherein if the matching fails, the server side generates a new identification template and updates the template library, or marks it as no longer pushed.

3. The virtual printing-based electronic file collection method according to claim 1, wherein the data nodes include primary-subtable relationship and / or many-to-one relationship, which are the logical structure of the original business data restored according to the data source relationship defined in the identification template.

4. The virtual printing-based electronic file collection method according to claim 1, wherein if the local data dictionary fails to be queried, the server side updates the data dictionary; and the local data dictionary is updated according to the updated data dictionary.

5. An electronic document acquisition apparatus based on virtual printing, characterized by comprising: The method comprises the following steps: a graphic and text output content acquisition module configured to intercept and cache print instructions from a business system through a preset virtual printer to obtain graphic and text output content in the instructions; an identification template matching module configured to match the graphic and text output content with an identification template; the identification template is used for structured labeling and OCR identification of the graphic and text output content; the identification template is cached to the local of the client according to a preset identification template library on the server side; the content identified by the identification template includes fixed content, variable fields, data source relationship of variable content, expected content type and / or metadata items; a structured marking module configured to mark the text content within the variable field range identified by the identification template if the matching is successful; if the variable field position range is non-text content, call the OCR module preset by the client to identify the content, and cache the identification result as variable content; the identification result is corrected according to the expected content type defined in the identification template; a data code translation module configured to organize the variable content into a data node with a hierarchical structure according to the data relationship defined in the identification template; according to the translation requirements preset in the identification template, query the local data dictionary to translate the corresponding variable content into the corresponding data code; the local data dictionary is cached in the client local according to the data dictionary preset by the server side; a document page conversion module configured to convert the graphic-text output content into a set format document; the data node and data code are used as indexing or data attachment fragments of the format document; an electronic file generation and output module configured to extract corresponding information from the marked structured content and / or data code as metadata of the format document according to the metadata items defined in the identification template; generate and output an electronic file containing human-readable and machine-readable information.

6. The virtual printing-based electronic file acquisition device according to claim 5, wherein if the matching fails, the server side generates a new identification template and updates the template library, or marks it as no longer pushed.

7. The virtual printing-based electronic file acquisition device according to claim 5, wherein the data node includes a primary-subtable relationship and / or a many-to-one relationship, so as to be able to completely restore the logical structure of the original business data.

8. The virtual printing-based electronic file acquisition device according to claim 5, wherein if the data dictionary fails to be queried, the server side updates the data dictionary according to the un-identified data content, the variable field to which it belongs, and the template identification information.

9. An electronic device, comprising: The electronic device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is executed by the processor to implement the steps of the virtual printing-based electronic file acquisition method according to any one of claims 1 to 4.

10. A readable storage medium, characterized by, The readable storage medium stores a program or instructions, and the program or instructions are executed by the processor to implement the steps of the virtual printing-based electronic file acquisition method according to any one of claims 1 to 4.