Document analysis method and device, electronic equipment and computer readable storage medium
By searching and configuring the resolution solution in the cloud, the problems of frequent configuration of electronic document analysis templates and low reuse rate are solved, and the efficiency and user experience of document analysis are improved.
Patent Information
- Application Number
- CN202411385989.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, the analysis template of electronic documents needs to be frequently configured according to new business types, resulting in time-consuming and labor-intensive local configuration and unreusable between different stores, which makes the user experience poor.
By finding the parsing solutions of other stores in the cloud, improving the reuse rate of the parsing solutions, realizing the parsing of documents at the store terminal, using the first keyword and the second keyword to find or configure the parsing solutions in the local and cloud analysis solution library, Ensure that the documents can be parsed correctly.
Improve the reuse rate and user experience of the analysis solution, reduce the time to configure the analysis template between stores, and realize the ability to quickly resolve new documents.
Smart Images

Figure CN119274195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a document parsing method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the popularization of electronic documents, a lot of resource waste has been reduced. Enterprises need to parse electronic documents to read relevant data information in order to conduct business. Each store will involve many types of electronic documents, which require different parsing templates. However, when a new type of business is launched, a new parsing template needs to be configured to parse the electronic documents. At present, local configuration of parsing templates is time-consuming and laborious, and the configured templates cannot be reused between different stores, resulting in poor user experience. Summary of the invention
[0003] The purpose of the present invention is to provide a document parsing method, device, electronic device and computer-readable storage medium, which can search for parsing solutions uploaded by other stores in the cloud for documents that cannot be parsed locally, thereby increasing the reuse rate of parsing solutions and improving user experience.
[0004] In a first aspect, the present invention provides a document parsing method, which is applied to a business data management system, and the method comprises:
[0005] Obtaining a receipt from a store terminal and extracting a first keyword from the receipt; wherein the first keyword represents the type of the receipt and the type of digital text in the receipt;
[0006] Searching for a first parsing solution corresponding to the first keyword in a preset local parsing solution library;
[0007] If the first parsing solution is found, the document is parsed based on the first parsing solution to obtain structured data;
[0008] If the first parsing solution is not found, the type of the document is determined based on the first keyword;
[0009] If the document type is direct parsing type, parse the document to get structured data;
[0010] If the type of the document is not a direct parsing type, the store terminal uploads the document to the cloud server; searches the cloud server for a second parsing solution corresponding to the document; if the second parsing solution is found, sends the second parsing solution to the store; and parses the document based on the second parsing solution to obtain structured data.
[0011] In some preferred embodiments of the present invention, after the step of searching the cloud server for the second analysis solution corresponding to the document, the method further includes:
[0012] If the second resolution solution is not found, configure the third resolution solution based on the document;
[0013] Determine whether the third parsing solution contains all the keywords in the document;
[0014] If the third parsing solution contains all the keywords in the document, save the third parsing solution.
[0015] In some preferred embodiments of the present invention, the step of configuring the third parsing solution based on the document includes:
[0016] Identify the type of document and a second keyword in the document; wherein the second keyword represents the type of digital text in the document;
[0017] Identify the numeric text area corresponding to the second keyword in the document;
[0018] Identify the overall value area in the document;
[0019] Identify ignored content in the document;
[0020] The third parsing scheme is configured based on the type of document, the second keyword, the numeric text area corresponding to the second keyword, the overall value area and the ignored content.
[0021] In some preferred embodiments of the present invention, the step of marking ignored content in the document includes:
[0022] Identify overall ignored areas in the document;
[0023] In the overall ignored area, remove the document type, the second keyword, and the digital text corresponding to the second keyword;
[0024] The type of document, the second keyword and the digital text corresponding to the second keyword are removed from the overall ignored area and the remaining contents are regarded as ignored contents.
[0025] In some preferred embodiments of the present invention, after the step of saving the third parsing solution if the third parsing solution includes all the keywords in the document, the method further includes:
[0026] Determine whether the third parsing solution can be used to parse documents with a quantity greater than a preset number;
[0027] If the third parsing solution can be used to parse documents greater than the preset quantity, the third parsing solution is uploaded to the cloud server.
[0028] In some preferred embodiments of the present invention, the cloud server is a high-performance matching node or a global solution library.
[0029] In a second aspect, the present invention provides a document parsing device, which is applied to a commercial data management system, and the device comprises:
[0030] The document processing module is used to obtain the document from the store terminal and extract the first keyword of the document; wherein the first keyword represents the type of the document and the type of the digital text in the document;
[0031] A resolution solution search module, used to search for a first resolution solution corresponding to a first keyword in a preset local resolution solution library;
[0032] A first document parsing module, for parsing the document based on the first parsing solution to obtain structured data if a first parsing solution is found;
[0033] A document type determination module, used for determining the type of the document based on the first keyword if the first parsing solution is not found;
[0034] The second document parsing module is used to parse the document to obtain structured data if the document type is direct parsing type;
[0035] The third document parsing module is used for uploading the document to the cloud server by the store terminal if the document type is not a direct parsing type; searching for the second parsing solution corresponding to the document in the cloud server; if the second parsing solution is found, sending the second parsing solution to the store; parsing the document based on the second parsing solution to obtain structured data.
[0036] In some preferred embodiments of the present invention, the device also includes: a parsing scheme configuration module, which is used to configure a third parsing scheme based on the document if the second parsing scheme is not found; determine whether the third parsing scheme contains all the keywords in the document; if the third parsing scheme contains all the keywords in the document, save the third parsing scheme.
[0037] In a third aspect, the present invention provides an electronic device including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the document parsing method of the first aspect.
[0038] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the document parsing method of the first aspect.
[0039] The present invention brings the following beneficial effects:
[0040] The present invention provides a document parsing method, device, electronic device and computer-readable storage medium, which are applied to a commercial data management system. The method includes: obtaining a document from a store terminal and extracting a first keyword of the document; wherein the first keyword represents the type of the document and the type of digital text in the document; searching for a first parsing solution corresponding to the first keyword in a preset local parsing solution library; if the first parsing solution is found, parsing the document based on the first parsing solution to obtain structured data; if the first parsing solution is not found, judging the type of the document based on the first keyword; if the type of the document is a direct parsing type, parsing the document to obtain structured data; if the type of the document is not a direct parsing type, the store terminal uploads the document to a cloud server; searching for a second parsing solution corresponding to the document in the cloud server; if the second parsing solution is found, sending the second parsing solution to the store; parsing the document based on the second parsing solution to obtain structured data; searching for parsing solutions uploaded by other stores in the cloud for documents that cannot be parsed locally, thereby improving the reuse rate of parsing solutions and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A flow chart of a document parsing method provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a document provided in an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of structured data provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of the structure of a document parsing device provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0047] Icons: 310 - document processing module; 320 - resolution solution search module; 330 - first document resolution module; 340 - document type determination module; 350 - second document resolution module; 360 - third document resolution module; 400 - memory; 401 - processor; 402 - bus; 403 - communication interface. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0049] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0051] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the invention is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0052] In addition, the terms "horizontal", "vertical", "overhanging" and the like do not mean that the components are required to be absolutely horizontal or overhanging, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0053] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0054] Some receipt styles of different stores are highly similar, but cannot be reused at all. The purpose of the present invention is to provide a receipt parsing method, device, electronic device and computer-readable storage medium, which can search for parsing solutions uploaded by other stores in the cloud for receipts that cannot be parsed locally, thereby increasing the reuse rate of parsing solutions and improving user experience.
[0055] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0056] Embodiment 1
[0057] The embodiment of the present invention provides a document parsing method, which is applied to a commercial data management system. Figure 1 The embodiment of the present invention provides a flowchart of a document parsing method, the method comprising:
[0058] Step S102, obtaining the receipt from the store terminal and extracting the first keyword of the receipt; wherein the first keyword represents the type of the receipt and the type of the digital text in the receipt.
[0059] Specifically, the first keyword is the key to parsing the document, which can characterize the type of document, such as sales document, inventory report, matching menu, etc., as well as the type of digital text in the document, such as price, quantity, etc. By accurately identifying these keywords, the system can determine the specific solution required for subsequent parsing.
[0060] Step S104: searching a preset local resolution solution library for a first resolution solution corresponding to the first keyword.
[0061] Specifically, the system will search for a first parsing solution corresponding to the first keyword in a preset local parsing solution library. This local parsing solution library is a knowledge base containing a variety of parsing strategies and rules, which enables the system to select the most appropriate parsing method according to different types of documents. If a matching first parsing solution is found, the system will execute step S106, that is, parse the document based on the solution to obtain structured data.
[0062] The specific matching rule may be: if all keywords in a certain parsing solution in the local parsing solution library can cover the first keyword, it is determined as the first parsing solution.
[0063] Furthermore, if there are multiple analysis solutions that can cover the first keyword, the text similarity can be calculated, and the analysis solution with the highest text similarity is determined as the first analysis solution.
[0064] Step S106: If the first parsing solution is found, the document is parsed based on the first parsing solution to obtain structured data.
[0065] Specifically, the parsing solution includes data extraction rules, which extract the data in the document according to the first keyword to form structured data. The document includes a variety of data, but in the storage process, it is not necessary to store all the data, only the key content needs to be focused. For example, see Figure 2 A document schematic diagram provided by the embodiment of the present invention, the key data we are concerned about usually include: document type: applet, order number: D00172541779685553826, order time: 20XX / XX / XX 10:43:15, amount, etc.; the remaining other data and text are usually data that will not be paid attention to in the document storage.
[0066] Extract structured data based on the first parsing solution, see Figure 3 A schematic diagram of structured data provided by an embodiment of the present invention is shown, in which the data in the document is extracted based on the first keyword and stored accordingly, usually including three data types: document information, collection information and auxiliary information; the document information focuses on the document type, the document transaction serial number, that is, the order number in the document, and the document transaction time; the collection information includes: the actual amount collected, the amount receivable and the total amount; in some preferred embodiments of the present invention, the collection information may also include: preferential amount, rounding off, etc.; the auxiliary information can be considered to add some remarks.
[0067] Step S108: If the first parsing solution is not found, determine the type of the document based on the first keyword.
[0068] Specifically, further determine the type of document and determine the parsing path of the document.
[0069] Step S110: If the document type is direct parsing type, parse the document to obtain structured data.
[0070] Specifically, if the first parsing solution cannot be found, the bill type of the document is determined. If it is not a document that requires template parsing (such as a menu or inventory list), the parsing is completed directly to extract structured data.
[0071] Step S112, if the type of the document is not a direct parsing type, the store terminal uploads the document to the cloud server; searches the cloud server for a second parsing solution corresponding to the document; if the second parsing solution is found, sends the second parsing solution to the store; and parses the document based on the second parsing solution to obtain structured data.
[0072] Specifically, if the document type is not a direct parsing type, but a document that needs normal parsing, such as a checkout order, daily checkout order, etc., the store terminal will upload the document to the cloud server. In the cloud, the system will try to find the second parsing solution corresponding to the document. If all the keywords of a parsing solution can be found on the document, and each character on the document is marked, the document is considered to match the second parsing solution.
[0073] If the second parsing solution is found, the cloud server will send the solution back to the store terminal, and then the store terminal will parse the document based on this solution to obtain structured data.
[0074] The second parsing solution is essentially the same as the first parsing solution, except for the storage location. The first parsing solution is stored locally, and the commonly used documents of this store are quickly parsed to extract data. The second parsing solution is stored in the cloud, and more parsing paths are provided for the new documents of this store.
[0075] The present invention provides a document parsing method, which is applied to a commercial data management system. The method comprises: obtaining a document from a store terminal and extracting a first keyword of the document; wherein the first keyword represents the type of the document and the type of digital text in the document; searching for a first parsing solution corresponding to the first keyword in a preset local parsing solution library; if the first parsing solution is found, parsing the document based on the first parsing solution to obtain structured data; if the first parsing solution is not found, judging the type of the document based on the first keyword; if the type of the document is a direct parsing type, parsing the document to obtain structured data; if the type of the document is not a direct parsing type, the store terminal uploads the document to a cloud server; searching for a second parsing solution corresponding to the document in the cloud server; if the second parsing solution is found, sending the second parsing solution to the store; parsing the document based on the second parsing solution to obtain structured data; searching for parsing solutions uploaded by other stores in the cloud for documents that cannot be parsed locally, thereby improving the reuse rate of parsing solutions and improving user experience.
[0076] Embodiment 2
[0077] On the basis of the above embodiments, in some preferred embodiments of the present invention, after the step of searching for the second parsing solution corresponding to the document in the cloud server, the method also includes: if the second parsing solution is not found, configuring a third parsing solution based on the document; determining whether the third parsing solution includes all the keywords in the document; if the third parsing solution includes all the keywords in the document, saving the third parsing solution.
[0078] Specifically, when a store terminal uploads an unrecognizable document to the cloud server, the cloud server will try to find the corresponding second resolution solution in the broader resolution solution library. If a matching solution is still not found even with the help of the cloud's extensive resources, the cloud server will not give up immediately, but will further try to configure a new third resolution solution for this unknown document type.
[0079] The key step is to analyze and understand the content of the document, especially the keywords contained in it. Keywords are not only important clues to understand the type and structure of the document, but also the basis for building an effective parsing solution. The system will carefully review each keyword in the document and their relationship with the overall structure of the document.
[0080] The system will automatically draft an initial third-party analysis plan based on these keywords and their relationships. The system needs to determine how to effectively identify, classify and analyze the data in the document. For example, if one keyword points to the price of the product and another keyword points to the quantity of the product, the analysis plan needs to ensure that this data can be accurately extracted and calculated.
[0081] After generating the preliminary third parsing solution, the system will conduct a series of verification processes to ensure the validity of the solution. This includes checking whether the solution can cover all the keywords in the document and whether the structured data can be correctly parsed. If the third parsing solution can successfully extract all the keywords and related data in the document and organize the data according to the predetermined structure, then the solution is considered to have passed the verification.
[0082] Once the third parsing solution is verified, it will be saved in the parsing solution library of the cloud server. Usually, it is checked whether all characters on the entire document have been marked and whether all keywords exist. Only when the above conditions are met can it be saved successfully. This not only enriches the system's parsing capabilities, but also provides solutions for similar documents in the future. In this way, the system constantly learns and adapts, and continuously improves its ability to handle new and complex documents.
[0083] The embodiment of the present invention provides a method for configuring a new parsing solution, which is highly automated and adaptive.
[0084] Furthermore, in some preferred embodiments of the present invention, the step of configuring the third parsing scheme based on the document includes: identifying the type of document and the second keyword in the document; wherein the second keyword represents the type of digital text in the document; identifying the digital text area corresponding to the second keyword in the document; identifying the overall value area in the document; identifying ignored content in the document; configuring the third parsing scheme based on the document type, the second keyword, the digital text area corresponding to the second keyword, the overall value area and the ignored content.
[0085] Specifically, the specific process of configuring a new plan can be as follows: identify all keywords used to determine the bill type and value, such as "billing bill" and "serial number".
[0086] Identify all value-taking rules, such as "take the value in the first column of the next row under the keyword "Serial Number" as the serial number information of the document."
[0087] Identify the areas that require the entire area to be valued, such as the detail area, payment area, and discount area.
[0088] Mark the ignored areas, such as ignoring all the contents from "Remarks" to the end of the document.
[0089] A third analysis solution is generated according to the content of the above identification.
[0090] Furthermore, in some preferred embodiments of the present invention, the step of identifying ignored content in the document includes: identifying an overall ignored area in the document; excluding the document type, the second keyword, and the digital text corresponding to the second keyword in the overall ignored area; and treating the remaining content in the overall ignored area after excluding the document type, the second keyword, and the digital text corresponding to the second keyword as ignored content.
[0091] Specifically, the overall ignored area may contain some key information that needs to be extracted. For example, the data from the beginning of the document to the "serial number" is ignored, but the keyword "invoice" must be included. If the overall ignored area also contains the second keyword, then the second keyword and the digital text corresponding to the second keyword also need to be extracted, and the remaining content is regarded as ignored content.
[0092] Furthermore, in some preferred embodiments of the present invention, if the third parsing scheme contains all the keywords in the document, after the step of saving the third parsing scheme, the method also includes: determining whether the third parsing scheme can be used to parse documents greater than a preset number; if the third parsing scheme can be used to parse documents greater than a preset number, uploading the third parsing scheme to the cloud server.
[0093] Specifically, the newly configured solution needs to be judged whether it is universal. If the third parsing solution can be used in the parsing process of multiple documents, it is considered to be universal and uploaded to the cloud server. In some preferred embodiments of the present invention, it can also be examined whether the parsing solution can be used in the parsing of documents of multiple stores. If so, it is also considered to be universal.
[0094] Furthermore, in some preferred embodiments of the present invention, the cloud server is a high-performance matching node or a global solution library.
[0095] Specifically, high-performance matching nodes mainly refer to servers with many threads and high computing power; the global solution library can be a database that stores a large number of resolution solutions; high-performance nodes respond faster and usually only store resolution solutions that have been used frequently recently, while the global solution library saves all resolution solutions, but responds slower.
[0096] Specifically, the second analysis solution stored in the global solution library and whose call times within the preset first time period are greater than the preset first time period are transferred to the high-performance matching node, thereby improving the server's effect efficiency; the second analysis solution stored in the high-performance matching node and whose call times within the preset second time period are less than the preset second time period are transferred to the global solution library, thereby saving the storage space of the high-performance matching node.
[0097] Embodiment 3
[0098] Based on the above embodiments, the present invention provides a document parsing device, which is applied to a commercial data management system. Figure 4 The schematic diagram of the structure of a document parsing device provided by an embodiment of the present invention is shown, and the device includes:
[0099] The document processing module 310 is used to obtain the document from the store terminal and extract the first keyword of the document; wherein the first keyword represents the type of the document and the type of the digital text in the document;
[0100] A resolution solution search module 320, configured to search a preset local resolution solution library for a first resolution solution corresponding to a first keyword;
[0101] A first document parsing module 330, for parsing the document based on the first parsing solution to obtain structured data if a first parsing solution is found;
[0102] A document type determination module 340, configured to determine the type of the document based on the first keyword if the first analysis solution is not found;
[0103] A second document parsing module 350 is used to parse the document to obtain structured data if the document type is a direct parsing type;
[0104] The third document parsing module 360 is used for, if the document type is not a direct parsing type, the store terminal uploads the document to the cloud server; searches for a second parsing solution corresponding to the document in the cloud server; if the second parsing solution is found, sends the second parsing solution to the store; and parses the document based on the second parsing solution to obtain structured data.
[0105] Furthermore, in some preferred embodiments of the present invention, the device also includes: a parsing scheme configuration module, which is used to configure a third parsing scheme based on the document if the second parsing scheme is not found; determine whether the third parsing scheme contains all the keywords in the document; if the third parsing scheme contains all the keywords in the document, save the third parsing scheme.
[0106] Furthermore, in some preferred embodiments of the present invention, the device also includes: a parsing scheme verification module, which is used to configure a third parsing scheme based on the document if the second parsing scheme is not found; determine whether the third parsing scheme contains all the keywords in the document; if the third parsing scheme contains all the keywords in the document, save the third parsing scheme.
[0107] Furthermore, in some preferred embodiments of the present invention, a parsing scheme configuration module is used to identify the type of document and a second keyword in the document; wherein the second keyword represents the type of digital text in the document; to identify the digital text area corresponding to the second keyword in the document; to identify the overall value area in the document; to identify ignored content in the document; and to configure a third parsing scheme based on the document type, the second keyword, the digital text area corresponding to the second keyword, the overall value area and the ignored content.
[0108] Furthermore, in some preferred embodiments of the present invention, the parsing scheme configuration module is used to identify the overall ignored area in the document; exclude the document type, the second keyword, and the digital text corresponding to the second keyword in the overall ignored area; and use the remaining content in the overall ignored area after excluding the document type, the second keyword, and the digital text corresponding to the second keyword as ignored content.
[0109] Furthermore, in some preferred embodiments of the present invention, the device also includes: a universality verification module, used to determine whether the third parsing solution can be used to parse documents greater than a preset number; if the third parsing solution can be used to parse documents greater than a preset number, the third parsing solution is uploaded to the cloud server.
[0110] Furthermore, in some preferred embodiments of the present invention, the cloud server is a high-performance matching node or a global solution library.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the document parsing device described above can refer to the corresponding process in the aforementioned embodiment of the document parsing method, and will not be repeated here.
[0112] Embodiment 4
[0113] The embodiment of the present invention also provides an electronic device for executing the document parsing method; see Figure 5The structural diagram of an electronic device provided by an embodiment of the present invention is shown, and the electronic device includes a memory 400 and a processor 401, wherein the memory 400 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 401 to implement the above-mentioned document parsing method.
[0114] Further, Figure 5 The electronic device shown further includes a bus 402 and a communication interface 403 , and the processor 401 , the communication interface 403 and the memory 400 are connected via the bus 402 .
[0115] Among them, the memory 400 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 403 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. Bus 402 can be an ISA bus, PCI bus or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0116] The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 401. The above processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 400, and the processor 401 reads the information in the memory 400 and completes the steps of the method of the above embodiment in combination with its hardware.
[0117] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned business recommendation method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0118] The computer program products of the document parsing method, device and electronic device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0120] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0121] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A document parsing method, characterized in that: Applied to a business data management system, the method comprises: Obtaining a receipt from a store terminal and extracting a first keyword from the receipt; wherein the first keyword represents the type of the receipt and the type of digital text in the receipt; Searching for a first resolution solution corresponding to the first keyword in a preset local resolution solution library; If the first parsing solution is found, the document is parsed based on the first parsing solution to obtain structured data; If the first parsing solution is not found, determining the type of the document based on the first keyword; If the document is of a direct parsing type, parsing the document to obtain the structured data; If the type of the document is not a direct parsing type, the store terminal uploads the document to a cloud server; searches the cloud server for a second parsing solution corresponding to the document; if the second parsing solution is found, sends the second parsing solution to the store; and parses the document based on the second parsing solution to obtain the structured data.
2. The document parsing method according to claim 1, characterized in that: After the step of searching the cloud server for the second analysis solution corresponding to the document, the method further includes: If the second resolution solution is not found, configuring a third resolution solution based on the document; Determining whether the third parsing solution includes all the keywords in the document; If the third parsing solution includes all the keywords in the document, the third parsing solution is saved.
3. The document parsing method according to claim 2, characterized in that: The steps of configuring the third parsing solution based on the document include: Identify the type of the document and a second keyword in the document; wherein the second keyword represents the type of digital text in the document; Identifying a numeric text area corresponding to the second keyword in the document; Identifying the overall value area in the document; Identifying the ignored content in the document; The third parsing scheme is configured based on the type of the document, the second keyword, the numeric text area corresponding to the second keyword, the overall value area and the ignored content.
4. The document parsing method according to claim 3, characterized in that: The step of identifying ignored content in the document comprises: identifying the overall ignored area in said document; Eliminate the type of the document, the second keyword, and the digital text corresponding to the second keyword in the overall ignored area; The remaining contents of the overall ignored area after removing the type of the document, the second keyword, and the digital text corresponding to the second keyword are used as the ignored contents.
5. The document parsing method according to claim 2, characterized in that: If the third parsing solution includes all the keywords in the document, after the step of saving the third parsing solution, the method further includes: Determining whether the third parsing solution can be used to parse the documents greater than a preset number; If the third parsing solution can be used to parse the documents greater than the preset quantity, the third parsing solution is uploaded to the cloud server.
6. The document parsing method according to claim 1, characterized in that: The cloud server is a high-performance matching node or a global solution library.
7. A document parsing device, characterized in that: Applied to a commercial data management system, the device comprises: A receipt processing module, used to obtain receipts from store terminals and extract a first keyword from the receipt; wherein the first keyword represents the type of the receipt and the type of digital text in the receipt; A resolution solution search module, used to search for a first resolution solution corresponding to the first keyword in a preset local resolution solution library; A first document parsing module, configured to parse the document based on the first parsing solution to obtain structured data if the first parsing solution is found; a document type determination module, configured to determine the type of the document based on the first keyword if the first parsing solution is not found; A second document parsing module, configured to parse the document to obtain the structured data if the document is of a direct parsing type; The third document parsing module is used for, if the type of the document is not a direct parsing type, the store terminal uploads the document to the cloud server; searches the cloud server for a second parsing solution corresponding to the document; if the second parsing solution is found, sends the second parsing solution to the store; and parses the document based on the second parsing solution to obtain the structured data.
8. The document analysis device according to claim 7, characterized in that: The device also includes: a parsing scheme configuration module, which is used to configure a third parsing scheme based on the document if the second parsing scheme is not found; determine whether the third parsing scheme includes all the keywords in the document; if the third parsing scheme includes all the keywords in the document, save the third parsing scheme.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the document parsing method described in any one of claims 1 to 6 above.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the document parsing method described in any one of claims 1 to 6.