WASM-based OCR document entry method and device, and medium
By using WASM to perform OCR processing on the client, the problem of low efficiency of manually inputting paper documents is solved, efficient and accurate data entry is achieved, server load and security risks are reduced, and response speed and user trust are improved.
Patent Information
- Application Number
- CN202411264553.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-27
AI Technical Summary
Manually inputting paper documents data is inefficient and prone to errors, which increases labor costs and limits the ability of enterprises to quickly respond to market changes and optimize decision-making processes.
The WASM-based OCR document entry method is adopted to obtain document files through the client's web interface, perform OCR processing, extract text information, parse and fill preset fields, reduce server load, enhance user privacy protection, and realize instant recognition and feedback.
It improves the efficiency and accuracy of data entry, reduces waiting time and interaction costs, reduces server load and network pressure, enhances system response speed and concurrent processing capabilities, and reduces security risks and maintenance complexity.
Smart Images

Figure CN119203947A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a WASM-based OCR document entry method, device and medium. Background Art
[0002] With the surging wave of global digital transformation, enterprises and organizations are moving towards digitalization and intelligence at an unprecedented speed. This transformation has not only profoundly changed the business model, but also greatly improved operational efficiency and management level. In this context, converting traditional paper documents and receipts into digital format has become an indispensable part of achieving comprehensive digital management. The digitization of paper documents not only helps to reduce the demand for physical storage space and reduce storage costs, but more importantly, it makes the retrieval, sharing, analysis and processing of information more efficient and convenient than ever before. However, facing the mountains of paper receipts and documents, manually entering the data in them is undoubtedly a cumbersome and time-consuming task. This method is not only inefficient and prone to errors, but also greatly increases labor costs. More importantly, it limits the ability of enterprises to quickly respond to market changes and optimize decision-making processes. Therefore, finding an efficient and accurate automated solution to replace the traditional manual input method has become an urgent need for many enterprises and organizations. Summary of the invention
[0003] In order to solve the above problems, the present application proposes a WASM-based OCR document entry method, including: determining a client's Web interface, obtaining a document file uploaded by a user through the Web interface, wherein the document file includes a document image; performing OCR processing on the document file through the client, and extracting text information based on the document file after OCR processing; parsing the text information to obtain a data object, determining a pre-set field, and filling the field according to the data object.
[0004] In one example, performing OCR processing on the document file through the client specifically includes: compiling according to the OCR processing logic to obtain a WebAssembly module; executing the WebAssembly module through the client to perform OCR processing on the image in the document file through the WebAssembly module.
[0005] In one example, the method further includes: determining a template selection function through the web interface of the client, so that a user can determine a preset template through the template selection function, wherein the template includes a field structure and field correspondence of a document; parsing the text information through the template to obtain a data object, and filling the data object into the field of the template.
[0006] In one example, the method further includes: detecting the format of the text information by the client to determine an abnormal value in the text information; determining correction data corresponding to the abnormal value, and filling the correction data into the field.
[0007] In one example, after filling the field according to the data object, the method further includes: sending the filled data object to a server, and performing data processing on the data object by the server to synchronize data between the client and the server, wherein the data processing includes data analysis and report generation.
[0008] In one example, the method further includes: determining a preset user interface through a server, obtaining a field structure of a WebAssembly module through the user interface, and displaying the field structure, wherein the field structure includes but is not limited to comments, primary keys, and indexes.
[0009] In one example, the method further includes: obtaining the field correspondence through a server, and displaying the field correspondence, wherein the field correspondence includes but is not limited to a warehouse number, a production line number, and an employee number.
[0010] In one example, the text information includes a document number, a date, and an amount.
[0011] On the other hand, the present application also proposes a WASM-based OCR document entry device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the WASM-based OCR document entry device can execute: determining a client's Web interface, obtaining a document file uploaded by a user through the Web interface, wherein the document file includes a document image; performing OCR processing on the document file through the client, and extracting text information based on the document file after OCR processing; parsing the text information to obtain a data object, determining a pre-set field, and filling the field according to the data object.
[0012] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to: determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image; perform OCR processing on the document file through the client, and extract text information based on the document file after OCR processing; parse the text information to obtain a data object, determine pre-set fields, and fill in the fields according to the data object.
[0013] By using Wasm to perform the OCR process on the client side, this application can reduce the server-side load and network transmission pressure, improve the system's response speed and concurrent processing capabilities, and reduce server costs and maintenance complexity. This application moves OCR processing to the client side to enhance user privacy protection, reduce data leakage and security risks, and improve user trust and satisfaction. This application achieves instant recognition and feedback by performing OCR on the client side, allowing users to immediately see the recognition results and make necessary corrections, improving the efficiency and accuracy of data entry while reducing user waiting time and unnecessary interaction costs. This application's Wasm-based OCR solution can be easily integrated into existing Web applications, and has good scalability and customization. Developers can customize and expand the OCR module according to actual needs to meet the needs and requirements in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 This is a flowchart of a WASM-based OCR document entry method in an embodiment of the present application;
[0016] Figure 2 This is a schematic diagram of the process between the client and the server in the embodiment of the present application;
[0017] Figure 3 This is a schematic diagram of a WASM-based OCR document entry device in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. 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 making creative work are within the scope of protection of the present application.
[0019] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0020] like Figure 1 As shown, in order to solve the above problems, an embodiment of the present application provides a WASM-based OCR document entry method, the method comprising:
[0021] S101. Determine a Web interface of a client, and obtain a document file uploaded by a user through the Web interface, wherein the document file includes a document image.
[0022] With the popularity of mobile Internet and Web applications, more and more users tend to use browser-based applications to complete various tasks. Therefore, applying OCR technology to Web applications can provide users with a more convenient and flexible way to enter documents. The continuous development and maturity of optical character recognition (OCR) technology makes it feasible to automatically recognize text in documents. OCR technology realizes the digital processing of paper documents by converting images in documents into editable text, providing technical support for document entry. With the continuous enhancement of modern browsers' support for client computing capabilities, the emergence of technologies such as WebAssembly (Wasm) makes it possible to perform high-performance computing in browsers. This provides a technical basis for performing complex OCR processing on the client, thereby realizing a Wasm-based OCR document fast entry method. From the browser client, the image document is quickly recognized and entered according to the specified template. The user uploads the document file containing the document image through the Web application interface, that is, the image is uploaded through the client for recognition.
[0023] S102: Perform OCR processing on the document file through the client, and extract text information from the document file after OCR processing.
[0024] The client performs OCR processing and compiles the OCR processing logic to obtain a WebAssembly module, which executes the OCR processing process in the client browser. The client computing power is used to reduce the server load and network transmission pressure, and improve the system's response speed and concurrent processing capabilities. Text information is extracted from the document image according to the template, and the text information includes key information such as document number, date, amount, etc.
[0025] S103: Parse the text information to obtain a data object, determine pre-set fields, and fill the fields according to the data object.
[0026] The client formats and parses the extracted text information, generates structured data objects, and fills them into the specified fields of the document according to the template.
[0027] like Figure 2 As shown, the client initiates a business function request to the server. The server provides OCR resources such as Wasm. The client loads the resources and the Wasm resource reading and loading is completed. The client initiates a request for template resources. The server backend queries the maintained template information. The client loads the template information. After the template resources are loaded, the corresponding template is selected and the image document is uploaded. The client fills the identified data object into the specified location according to the template.
[0028] In one embodiment, the server provides a visual maintenance function for the template list, which can maintain templates of different forms. The table of the data structure OCR_MBWH (ORC_Template Maintenance) is as follows:
[0029]
[0030] In one embodiment, the corresponding field correspondence is maintained in the maintenance template, and the field correspondence includes warehouse number, production line number, employee number, latest inspection time, etc. Among them, the table of data structure OCR_MBWHMX (device management_scanning strategy) is as follows:
[0031]
[0032] The front end of the server provides a public method call, which triggers a pop-up window to select a template, upload the corresponding image, identify ORC on the client, and then fill in the corresponding fields according to the template.
[0033] In one embodiment, through the client's web interface navigation, browse and filter out templates that meet the needs. Each template intuitively displays the field layout, data type and possible validation rules it contains, helping users to quickly understand and make choices. Once the template is selected, the system immediately starts the intelligent parsing engine, conducts in-depth analysis of the input text information, automatically extracts key information, and converts it into structured data objects. Subsequently, these accurately extracted data objects will be seamlessly connected to the corresponding fields of the selected template to achieve automatic data filling. This process not only improves the accuracy and efficiency of data processing, but also reduces the possibility of human errors, bringing users an unprecedented convenient experience. Whether it is finance, administration or other departments that need to process documents frequently, this function can significantly improve work efficiency and optimize workflows.
[0034] In one embodiment, the client uses a built-in format detection algorithm to comprehensively scan the input text information and identify abnormal values that do not conform to preset rules or common patterns. These abnormal values may include format errors, such as incorrect date format, abnormal data range, such as amount outside the reasonable range, missing key information, such as required fields are empty, etc. After detecting an abnormal value, the client will immediately trigger the correction mechanism. According to the type and context of the abnormal value, the system will retrieve the corresponding correction data from the preset database, user historical data or external data source. After the correction data is verified, it will be automatically filled into the field where the original abnormal value is located to restore the integrity and accuracy of the text information. This process not only enhances the data processing capabilities of the client, but also improves the user experience. Users do not need to manually check and correct errors in text information, and can focus more on the business logic itself, thereby improving work efficiency and satisfaction. At the same time, through automated correction, the potential risks brought by human intervention are also reduced, ensuring the accuracy and reliability of data processing.
[0035] In one embodiment, after the fields are filled according to the data object, the filled data object is sent to the server through the client, realizing the data synchronization mechanism between the client and the server. This mechanism ensures the real-time and consistency of the data and provides a solid foundation for subsequent data processing. After the data object is successfully sent to the server, the server will immediately start the data processing process. This process includes but is not limited to further analysis, verification and cleaning of the received data object to ensure the accuracy and completeness of the data. Subsequently, the server will use data analysis techniques, such as data mining, statistical analysis, etc., to deeply mine the information in the data object and extract valuable information and insights. Based on the analysis results, the server can also automatically generate various reports, such as summary reports, trend analysis reports, exception reports, etc., to meet the different needs of users. These reports not only intuitively show the distribution, changes and trends of the data, but also help users better understand the business operation status and provide strong support for decision-making.
[0036] like Figure 3 As shown, the embodiment of the present application also provides an OCR document entry device based on WASM, including:
[0037] at least one processor; and,
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the WASM-based OCR document entry device to execute:
[0040] Determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image;
[0041] Performing OCR processing on the document file through the client, and extracting text information from the document file after OCR processing;
[0042] The text information is parsed to obtain a data object, a pre-set field is determined, and the field is filled according to the data object.
[0043] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0044] Determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image;
[0045] Performing OCR processing on the document file through the client, and extracting text information from the document file after OCR processing;
[0046] The text information is parsed to obtain a data object, a pre-set field is determined, and the field is filled according to the data object.
[0047] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0048] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0049] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0050] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0051] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0052] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0053] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0054] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0055] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0056] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0057] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A WASM-based OCR document entry method, characterized in that: include: Determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image; Performing OCR processing on the document file through the client, and extracting text information from the document file after OCR processing; The text information is parsed to obtain a data object, a pre-set field is determined, and the field is filled according to the data object.
2. The method according to claim 1, characterized in that Performing OCR processing on the document file through the client specifically includes: Compile according to the OCR processing logic to obtain the WebAssembly module; The WebAssembly module is executed by the client to perform OCR processing on the image in the document file through the WebAssembly module.
3. The method according to claim 1, characterized in that The method further comprises: Determining a template selection function through the web interface of the client, so that the user can determine a preset template through the template selection function, wherein the template includes a field structure and a field correspondence relationship of a document; The text information is parsed through the template to obtain a data object, and the data object is filled into the field of the template.
4. The method according to claim 1, characterized in that: The method further comprises: Detecting the format of the text information by the client to determine abnormal values in the text information; Correction data corresponding to the abnormal value is determined, and the correction data is filled into the field.
5. The method according to claim 1, characterized in that After filling the fields according to the data object, the method further includes: The filled data object is sent to the server, and the data object is processed by the server to synchronize data between the client and the server, wherein the data processing includes data analysis and report generation.
6. The method according to claim 3, characterized in that The method further comprises: A pre-set user interface is determined by a server, a field structure of a WebAssembly module is obtained by the user interface, and the field structure is displayed, wherein the field structure includes but is not limited to comments, primary keys, and indexes.
7. The method according to claim 3, characterized in that The method further comprises: The field correspondence is obtained through a server and displayed, wherein the field correspondence includes but is not limited to a warehouse number, a production line number, and an employee number.
8. The method according to claim 1, characterized in that The text information includes document number, date, and amount.
9. A WASM-based OCR document entry device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the WASM-based OCR document entry device to execute: Determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image; Performing OCR processing on the document file through the client, and extracting text information from the document file after OCR processing; The text information is parsed to obtain a data object, a pre-set field is determined, and the field is filled according to the data object.
10. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Determine a web interface of a client, and obtain a document file uploaded by a user through the web interface, wherein the document file includes a document image; Performing OCR processing on the document file through the client, and extracting text information from the document file after OCR processing; The text information is parsed to obtain a data object, a pre-set field is determined, and the field is filled according to the data object.
Citation Information
Cited By
WebPPT file exporting method, device and product
CN120430296A
