Intelligent document processing method, system, computer equipment and medium
By standardizing the XML files of data source documents in Internet financial services and data extraction, establishing a document database, and automatically editing documents, solving the problems of low efficiency and high cost of manual editing in the existing technology, and improving the intelligence of document editing degree and efficiency.
Patent Information
- Application Number
- CN202111048195.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-08
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-09-08
AI Technical Summary
In the existing Internet financial business, document interaction is conducted based on the coded XML model, resulting in inconsistent coded data formats, manual and manual editing of reports is time-consuming and labor-intensive, inefficient and costly.
By obtaining the XML file of the data source document, standardized processing is carried out, including target text node merging, splitting and adding node identifiers, compressing processing, extracting data and establishing a document database, and realizing the software program to automatically edit documents.
It improves the efficiency and accuracy of document editing, reduces labor costs and time costs, realizes intelligent document editing operations, and solves the problems of low efficiency and high cost in the existing technology.
Smart Images

Figure CN113761840B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to an intelligent document processing method, system, computer equipment and medium. Background Art
[0002] With the improvement of Internet security, the service model of conducting financial business based on Internet technology has been widely promoted in the financial field.
[0003] In the prior art, Internet financial services usually interact with documents based on a coded XML model. Operators manually input the required data into reports based on the coded data. This has the following problems: the format of the coded data is not uniform, and operations such as filling, modifying and deleting report contents are performed manually. A lot of time and human resources need to be invested in editing and approving the text, which is inefficient and costly. Summary of the invention
[0004] The present invention provides an intelligent document processing method, system, computer equipment and medium to realize the use of software programs to replace manual document editing, which has a high degree of intelligence, solves the problems of high cost and low efficiency of manual editing, and is convenient and easy.
[0005] In a first aspect, an embodiment of the present invention provides an intelligent document processing method, comprising the following steps: obtaining an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node; performing standardization processing on the XML file to obtain a target XML file, wherein the standardization processing includes sequentially performing target text node merging, target text node splitting, and adding node identifiers; performing compression processing on the target XML file to obtain a standardized data source document; performing data extraction on the standardized data source document, and establishing a document database based on the data extraction results.
[0006] Optionally, the XML file is standardized, including the following steps: using a recursive algorithm to traverse all paragraph nodes in the XML file; merging all target text nodes in any paragraph node into a first target text node in the same paragraph node; and determining the first XML file based on the target text node merging result.
[0007] Optionally, the XML file is standardized, including the following steps: obtaining a first XML file obtained by merging target text nodes; traversing all paragraph nodes in the first XML file using a recursive algorithm; splitting the text content in the first target text node based on a preset anchor point tag in the first target text node; and determining a second XML file based on the target text node splitting result.
[0008] Optionally, the XML file is standardized, including the following steps: obtaining a second XML file obtained by splitting the target text node; traversing all target nodes in the second XML file using a recursive algorithm, the target nodes including paragraph nodes and target text nodes; determining a node identifier of the target node according to a recursive order, the node identifier corresponding to the target node one-to-one, and the value of the node identifier increasing in sequence according to the recursive order; adding the node identifier to the corresponding attribute list of the target node; and determining the target XML file according to the result of adding the node identifier.
[0009] Optionally, the data extraction of the standardized data source document includes the following steps: decompressing the standardized data source document to obtain a target XML file with a node identifier; parsing the node data of all nodes in the target XML file, wherein the node data includes text content data, node label data and text type data; and determining the target structured data according to the data parsing result.
[0010] Optionally, establishing a document database based on the data extraction results includes the following steps: obtaining all directory title nodes in the target structured data based on the node label data; obtaining directory title data of each directory title node and the correspondence between the directory title node and the main text; and determining a document directory data set in the document database based on the directory title data and the correspondence.
[0011] Optionally, establishing a document database based on the data extraction results includes the following steps: acquiring all paragraph nodes in the target structured data based on the node label data; traversing the node paragraph data of the target text node in each paragraph node; and determining a document paragraph data set in the document database based on the paragraph nodes and the node paragraph data.
[0012] Optionally, establishing a document database based on the data extraction results includes the following steps: acquiring all table nodes in the target structured data based on the node label data; traversing the table row nodes and cell nodes in each of the table nodes; determining the coordinate parameters of each cell in the overall table based on the traversal results; and determining a document table data set in the document database based on the table nodes, the cell nodes and the coordinate parameters.
[0013] Optionally, after establishing the document database, the intelligent document processing method further includes: creating a target document according to the document database.
[0014] In a second aspect, an embodiment of the present invention further provides an intelligent document processing system, including:
[0015] A data source acquisition module, used to acquire an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node;
[0016] A document preprocessing module, used for performing standardization processing on the XML file to obtain a target XML file, wherein the standardization processing includes sequentially performing target text node merging, target text node splitting and adding node identifiers;
[0017] A document compression module is used to compress the target XML file to obtain a standardized data source document;
[0018] The data extraction module is used to extract data from the standardized data source document and establish a document database according to the data extraction result.
[0019] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned intelligent document processing method when executing the program.
[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned intelligent document processing method is implemented.
[0021] The intelligent document processing system, computer device and computer-readable storage medium provided by the embodiments of the present invention execute an intelligent document processing method. The document processing method obtains an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node; performs standardization processing on the XML file to obtain a target XML file, wherein the standardization processing includes sequentially performing target text node merging, target text node splitting and adding node identifiers; performs compression processing on the target XML file to obtain a standardized data source document; performs data extraction on the standardized data source document, and establishes a document database based on the data extraction results. The document database is used to create the target document, which solves the problems of low efficiency and high cost caused by existing manual editing of documents, provides a data basis for intelligent document editing operations, has a high degree of intelligence, and is convenient and fast in document processing, which is conducive to saving labor costs and time costs, and improving document editing efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of an intelligent document processing method provided by Embodiment 1 of the present invention;
[0023] Figure 2is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0024] Figure 3 is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0025] Figure 4 is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0026] Figure 5 is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0027] Figure 6 is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0028] Figure 7 is a flow chart of another intelligent document processing method provided by the first embodiment of the present invention;
[0029] Figure 8 is a structural diagram of an intelligent document processing system provided by Embodiment 2 of the present invention;
[0030] Fig. 9 It is a structural diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0032] Embodiment 1
[0033] Figure 1 : is a flowchart of an intelligent document processing method provided by the first embodiment of the present invention. This embodiment can be applied to application scenarios in which operations such as filling, modifying and deleting documents are performed based on an Internet financial office system (for example, a web office system). The method can be executed by a specific software program or functional module, and specifically includes the following steps:
[0034] Step S1: Acquire an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node.
[0035] Among them, XML (Extensible Markup Language) is a markup language designed specifically for the Internet. XML can be used to mark data and define data types, and is an important tool for Internet data transmission.
[0036] A data source document refers to a word document that records specific data. The data source document can provide a data source for subsequent document editing operations. Typically, the data source document can be financial report data sent by a stock exchange. The file extension of the word document can be docx.
[0037] The extensible markup language XML file of the data source document refers to a plain text file for Internet transmission formed by adding node tags to the text content in the data source document. Node is the most basic component of the XML file. Each part in the XML file can be called a node, for example: attributes, text, comments, etc. are all nodes. The node tag is a marking symbol composed of the symbol "<>" and the tag name.
[0038] Typically, node tags in XML files include the following three types:
[0039] It is a paragraph type node, that is, a paragraph node, with a tag name of p, indicating an independent paragraph. Each paragraph corresponds to a paragraph start tag. and a paragraph ending tag ;
[0040] <r>A text attribute node, i.e., a text attribute node, has a tag name of r, which indicates a style string indicating the display style of the text it contains, for example, the font is bold, the font size is 12, and the font name is "Songti", etc.
[0041] <t>A text node is a text node with a label of t, which indicates the actual text content, such as "Company Name", "Balance Sheet", "Income Statement", "Cash Flow Statement", etc.
[0042] In this step, an automated program can be used to change the file extension of the data source document to ZIP (data compression file format), and the compressed file can be decompressed using the ZIP decompression method to obtain an XML file of the data source document, which includes at least one paragraph node. , each paragraph node Include at least one text attribute node <r>, each text attribute node <r>Include at least one target text node <t>.
[0043] Step S2: Standardize the XML file to obtain a target XML file, wherein the standardization process includes sequentially performing target text node merging, target text node splitting, and adding node identifiers.
[0044] The target text node merging refers to merging the same paragraph node< / t> < / r> < / r> All text attribute nodes in <r>The target text node in <t>The text content recorded in is merged into the same text attribute node <r> The target text node splitting means splitting the same paragraph node< / r> < / t> < / r> The merged target text node is split into multiple text attribute nodes <r>; Adding node identifiers means adding one-to-one corresponding identifiers to all nodes in the file.
[0045] In this step, a recursive algorithm may be used to traverse the nodes in the XML file, and operations such as target text node merging, target text node splitting, and adding node identifiers may be performed in sequence to obtain a target XML file with a node identifier.
[0046] Step S3: compress the target XML file to obtain a standardized data source document.
[0047] Among them, the suffix of the standardized data source document can be docx, and the target xml file can be compressed using an xml-based compression file format instead of the default file format to form a standardized data source document with a suffix of docx format, and the text content in the standardized data source document is saved in xml format.
[0048] Step S4: extract data from the standardized data source document and establish a document database based on the data extraction results.
[0049] Among them, the document database refers to a collection of structured data stored in the Internet office system, and automated office work can be achieved by calling the data in the document database.
[0050] Optionally, data extraction may include extracting directory title data in the document, extracting paragraph data in the document, and extracting table data in the document. Those skilled in the art may set a specific extraction method according to actual needs, and this is not limited.
[0051] Specifically, after receiving the data source document, the data structure of the data source document is preprocessed first, and the data source document is decompressed to obtain its xml file, which includes at least one paragraph node, and the paragraph node includes at least one target text node. A recursive algorithm is used to traverse all nodes in the xml file, and different nodes are identified according to node labels. The target text node is merged, the target text node is split, and node identifiers are added to the xml file in turn to obtain a target xml file with simplified text data. Each node in the target xml file has a one-to-one corresponding node identifier. The target xml file with the node identifier is compressed using an xml-based compression file format to obtain a standardized data source document in docx format.
[0052] After completing the data structure preprocessing, data extraction is performed on the standardized data source document. The parser can be used to obtain the data stored in all nodes in the standardized data source document, and a recursive algorithm is used to classify, extract and clean all the data, and integrate all the data into the database. The document database finally established can be used to create the target document, which solves the problems of low efficiency and high cost caused by the existing manual editing of documents, and provides a data basis for intelligent document editing operations. It has a high degree of intelligence and convenient and fast document processing, which is conducive to saving labor costs and time costs and improving document editing efficiency and accuracy.
[0053] Optionally, Figure 2 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention. Figure 1 On this basis, a specific implementation method for standardizing XML files is exemplarily shown, rather than limiting the above method.
[0054] refer to Figure 2 As shown, when executing the above step S2, the following steps are included:
[0055] Step S21: merge target text nodes of the XML file.
[0056] Step S22: split the target text nodes of the XML file after the nodes are merged.
[0057] Step S23: adding node identifiers to the XML file after node splitting.
[0058] Step S24: Determine the XML file after adding the node identifier as the target XML file.
[0059] Specifically, the xml file obtained by decompressing the data source document can be defined as the initial xml file, the xml file after the nodes are merged can be defined as the first xml file, and the xml file after the nodes are split can be defined as the second xml file.< / r> In the text attribute node <r>Merge all text contents in the same text attribute node <r> The first XML file is obtained; then, each paragraph node in the first XML file is< / r> < / r> The text content in is split into multiple text attribute nodes <r>, obtain the second XML file; then add unique node identifiers to all nodes in the second XML file to achieve a unified document data structure to facilitate data extraction.
[0060] The following describes in detail the preprocessing method of the XML file provided in the above steps S21 to S23 in conjunction with the accompanying drawings.
[0061] Figure 3 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention. Figure 2 On the basis of, a specific implementation method of merging target text nodes is exemplarily shown, rather than limiting the above-mentioned node merging method.
[0062] refer to Figure 3 As shown, merging the target text nodes of the XML file specifically includes the following steps:
[0063] Step S201: Use a recursive algorithm to traverse all paragraph nodes in the XML file< / r> .
[0064] Among them, recursive algorithm refers to a method in computer science to solve problems by repeatedly decomposing the problem into similar sub-problems.
[0065] In this step, the nodes in the XML file are hierarchical. The node hierarchy is called the document tree. A recursive algorithm is used to traverse all nodes in the XML file, including paragraph nodes. And each paragraph node Text attribute node in <r>and the target text node <t>.
[0066] Step S202: any paragraph node< / t> < / r> All target text nodes in <t> Merge into the same paragraph node< / t> The first target text node in .
[0067] The first target text node can be the same paragraph node Any text attribute node in <r>The target text node in <t> , preferably, the same paragraph node< / t> < / r> The first text attribute node in <r>The target text node in <t>as the first target text node.
[0068] In this step, all target text nodes <t> After merging to the first target text node, delete the same paragraph node< / t> < / t> < / r> All target text nodes except the first target text node in <t>and its child nodes.
[0069] Step S203: Determine a first XML file according to the target text node merging result, wherein the same paragraph node in the first XML file< / t> Merge the text content in the target text node into the same target text node <t>.
[0070] Specifically, in the process of recursively traversing all nodes in the XML file, the same paragraph node< / t> All text attribute nodes in <r>The target text node in <t> Merge all into this paragraph node< / t> < / r> The first target text node in <t> and delete the same paragraph node< / t> All target text nodes except the first target text node in <t> and its child nodes, to obtain the first XML file, in which the same paragraph node< / t> Merge the text content in the target text node into the same target text node <t>, to achieve the merging of document contents.
[0071] Optionally, Figure 4 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention. Figure 2 On this basis, a specific implementation method of target text node splitting is exemplarily shown, rather than limiting the above node splitting method.
[0072] refer to Figure 4 As shown, the target text node is split for the XML file after the node is merged, which specifically includes the following steps:
[0073] Step S204: Obtain a first XML file obtained by merging the target text nodes. In the first XML file, the same paragraph node< / t> Merge the text content in the target text node into the same target text node <t>middle.
[0074] Step S205: Use a recursive algorithm to traverse all paragraph nodes in the first XML file< / t> .
[0075] In this step, each node of the first XML file is in a tree structure, and a recursive algorithm is used to traverse all nodes in the XML file, including paragraph nodes. And each paragraph node Text attribute node in <r>and the target text node <t>.
[0076] Step S206: Based on the first target text node <t>The preset anchor tag in the first target text node <t>Split the text content in .
[0077] The anchor is a location marker set in the document. A preset anchor marker can be added to the data source document through the document processing program. The preset anchor marker can be used to point to specific text in the XML file. Typically, the specific text pointed to by the preset anchor marker may include text such as title, directory, and specific data. Each target text node <t>The may include at least one preset anchor mark.
[0078] Exemplarily, the preset anchor tag may be "[]", that is, the preset anchor tag "[]" may be used to mark specific text in the XML file.
[0079] Step S207: Determine a second XML file according to the target text node splitting result, wherein in the second XML file, the text content in the same paragraph node is split into multiple target text nodes according to the preset anchor mark <t>.
[0080] Specifically, after the nodes are merged, a recursive algorithm is used to traverse all paragraph nodes in the first XML file.< / t> < / t> < / t> < / t> < / t> < / r> , each paragraph node All text contents in the text node are merged and recorded in the first target text node <t>, the first target text node <t>The text content in is split into multiple target text nodes according to the preset anchor mark <t>In the text, each preset anchor tag becomes a separate paragraph, and the text content outside the preset anchor tag is integrated into a separate target text node. <t>In the above example, all the target text nodes after integration are <t> Insert into this paragraph node< / t> < / t> < / t> < / t> < / t> A second XML file is obtained, in which the text content is split according to preset anchor tags, which is conducive to extracting specific paragraph data.
[0081] Optionally, Figure 5 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention. Figure 5 On the basis of, a specific implementation method of adding a node identifier is exemplarily shown, rather than limiting the above method.
[0082] refer to Figure 5 As shown, adding a node identifier to the XML file after node splitting specifically includes the following steps:
[0083] Step S208: Obtain a second XML file obtained by splitting the target text node.
[0084] Step S209: Use a recursive algorithm to traverse all target nodes in the second XML file, including paragraph nodes. and the target text node <t>.
[0085] In this step, each node of the second XML file is in a tree structure, and a recursive algorithm is used to traverse all target nodes in the XML file, including paragraph nodes.< / t> , each paragraph node Text attribute node in <r>, and text attribute nodes <r>The target text node in <t>.
[0086] Step S210: Determine the node identifier of the target node according to the recursive order, the node identifier corresponds to the target node one by one, and the value of the node identifier increases in sequence according to the recursive order.
[0087] The value of the node identifier may be a self-increasing number. In an XML file, the node identifier is unique. Typically, the value of the node identifier may be set to self-increment from 0 in a recursive order. Each time a new target node is traversed, the value of the node identifier increases by 1.
[0088] Step S211: Add the node identifier to the attribute list of the corresponding target node.
[0089] The attribute list of the target node refers to a list used to record the attributes of the target node. Typically, the attributes of a node include the node name, the node value (Value) and the node type. The value of a text node is the text itself, and the value of a text attribute node is the value of the attribute.
[0090] Exemplarily, the key value (key value, i.e. keyword) of the newly added attribute may be defined as yuxin_uid.
[0091] Step S212: Determine the target XML file according to the node identifier adding result.
[0092] Specifically, after the node is split, a recursive algorithm is used to traverse all target nodes in the second XML file. The value of the node identifier is calculated from 0. Each time a new target node is traversed, the value of the node identifier increases by 1. The node identifier is written into the attribute list of each target node. The newly added attribute key value is yuxin_uid, and the node value is the value of the node identifier. After adding unique node identifiers to all target nodes, the target XML file is obtained.
[0093] Therefore, the present invention modifies the data structure of the initial XML file through the above steps S201 to S212 to obtain a modified target XML file, the node identifiers of all nodes of the target XML file are unique, and the target XML file is compressed into a standardized data source document in docx format to facilitate data transmission.
[0094] Optionally, Figure 6 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention. Figure 1 On this basis, a specific implementation method of data extraction is exemplarily shown, rather than limiting the above data extraction method.
[0095] refer to Figure 6 As shown, data is extracted from the standardized data source document, and a document database is established based on the data extraction results, including the following steps:
[0096] Step S401: decompress the standardized data source document to obtain a target XML file with a node identifier.
[0097] In this step, .zip may be appended to the document with the suffix docx, and then the compressed package may be decompressed using the ZIP decompression method. The content recorded in the obtained xml file is all the text content in the entire standardized data source document in the docx format.
[0098] Step S402: parsing the node data of all nodes in the target XML file, the node data including text content data (text), node tag data (tag), text type data and node identifier.
[0099] Among them, text content data (text) can be used to limit text content, node label data (tag) can be used to limit the type of node, and text type data can be used to limit the text type. Typically, the text type may include text, table or picture.
[0100] In this embodiment, lxml or xml parser can be used to parse the decompressed target xml file, and a recursive algorithm can be used to read and clean the node data of all nodes.
[0101] Step S403: Determine target structured data according to the data analysis result.
[0102] Exemplarily, the target structured data may be two-dimensional structured data.
[0103] Step S404: Establish a document database based on the target structured data.
[0104] Specifically, when extracting data from standardized data source documents, first use an automated program to change the suffix of the document with the suffix docx to .zip, then use the ZIP decompression method to decompress it to obtain the target xml file, use lxml or xml parser to perform data analysis on the decompressed target xml file, use a recursive algorithm to traverse the node data of all nodes in the target xml file, integrate and clean the node data to form two-dimensional structured data, extract data based on the two-dimensional structured data, and establish a document database to facilitate data classification and storage.
[0105] Optionally, Figure 7 is a flowchart of another intelligent document processing method provided by the first embodiment of the present invention, referring to Figure 7 As shown, a document database is established based on the target structured data, which specifically includes the following steps:
[0106] Step S701: extract directory title data of all nodes in the target XML file.
[0107] The directory title data includes the text content and text attributes of the directory title, and the text content includes the directory name and title name.
[0108] Optionally, establishing a document database based on the target structured data includes the following steps: obtaining all directory title nodes in the target structured data based on the node label data; obtaining the directory title data of each directory title node and the correspondence between the directory title node and the main text; and determining the document directory data set in the document database based on the directory title data and the correspondence.
[0109] Among them, the correspondence between the directory title node and the main text includes the structural data of the directories and titles at all levels in the main text. For example, the structural data includes the first-level directory, the second-level directory, the first-level title, the second-level title, etc.
[0110] Specifically, a paragraph node is defined as< / t> < / r> < / r> , traverse the paragraph nodes All child node information in the node, and determine whether the child node exists <instrtext>Node, and whether the text content contains the "PAGEREF" text, if it exists in the child node <instrtext>If a node is found and the text content contains the "PAGEREF" text, the directory position is quickly located through the "PAGEREF" text, and the directory title data of the corresponding directory title node and the correspondence between the directory title node and the main text are obtained. The document directory can be formed through the directory title data and the correspondence, providing directory data for intelligent office.
[0111] Step S702: extracting node paragraph data of all nodes in the target XML file.
[0112] The node paragraph data includes at least one target text node and the specific text content in each node.
[0113] Optionally, establishing a document database based on the target structured data includes the following steps: obtaining all paragraph nodes in the target structured data based on the node label data; traversing the node paragraph data of the target text node in each paragraph node; and determining a document paragraph data set in the document database based on the paragraph nodes and the node paragraph data.
[0114] Specifically, a paragraph node is defined as< / instrtext> < / instrtext> , by traversing each The content in the node obtains the node paragraph data of the corresponding paragraph node, and all paragraph nodes and the one-to-one corresponding paragraph data are integrated into the database to provide text content data for intelligent office.
[0115] Step S703: extracting the table data of all nodes in the target XML file.
[0116] The table data includes the coordinates of each cell in the table in the entire table and the text content in each cell.
[0117] Optionally, establishing a document database based on the target structured data includes the following steps: obtaining all table nodes in the target structured data based on the node label data; traversing the table row nodes and cell nodes in each table node; determining the coordinate parameters of each cell in the overall table based on the traversal results; and determining the document table data set in the document database based on the table nodes, cell nodes and coordinate parameters.
[0118] Specifically, the node label of the table node can be defined as <tbl>, by identifying the tag <tbl>, traverse the table nodes <tbl>Table row nodes and cell nodes in <tc>, the coordinate parameters of each cell in the overall table are calculated through algorithms to provide table data for intelligent office.
[0119] Step S704: Classify and integrate the directory title data, node paragraph data and table data to establish a document database.
[0120] Specifically, outlier and missing value processing is performed on the extracted directory title data, node paragraph data and table data, and the directory title data, node paragraph data and table data are classified and stored to realize the classification and warehousing of document data, providing a data basis for the document editing operation of the Internet financial office system, which is conducive to improving the efficiency and accuracy of document editing.
[0121] Optionally, after establishing the document database, the intelligent document processing method further includes: creating a target document according to the document database.
[0122] The target document refers to a project table created through a web office system. Typically, the project table may be a financial statement of any company.
[0123] Specifically, project personnel can call up data such as directories, paragraph contents or tables in the document database according to actual business needs, and perform operations such as modifying, filling or deleting the target document.
[0124] Therefore, the present invention obtains a standardized data source document by performing preprocessing such as merging target text nodes, splitting target text nodes, and adding node identifiers on the xml file of the data source document, extracts data from the standardized data source document, establishes a document database according to the data extraction results, and realizes automatic creation of the target document by calling the data in the document database, thereby solving the problems of low efficiency and high cost caused by the existing manual editing of documents, providing a data basis for the document editing operation of the Internet financial office system, having a high degree of intelligence, and convenient and fast document processing, which is conducive to saving labor costs and time costs and improving document editing efficiency and accuracy.
[0125] Embodiment 2
[0126] Embodiment 2 of the present invention provides an intelligent document processing system. The intelligent document processing system provided by the embodiment of the present invention can execute the intelligent document processing method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0127] Figure 8 It is a structural diagram of an intelligent document processing system provided in Embodiment 2 of the present invention.
[0128] like Figure 8 As shown, the intelligent document processing system 00 includes: a data source acquisition module 101, a document preprocessing module 102, a document compression module 103 and a data extraction module 104, wherein the data source acquisition module 101 is used to obtain an XML file of a data source document, the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node; the document preprocessing module 102 is used to perform standardization processing on the XML file to obtain a target XML file, and the standardization processing includes sequentially performing target text node merging, target text node splitting and adding node identifiers; the document compression module 103 is used to compress the target XML file to obtain a standardized data source document; the data extraction module 104 is used to extract data from the standardized data source document and establish a document database according to the data extraction results.
[0129] Optionally, the document preprocessing module 102 is used to traverse all paragraph nodes in the XML file using a recursive algorithm; merge all target text nodes in any paragraph node into a first target text node in the same paragraph node; and determine the first XML file based on the target text node merging result.
[0130] Optionally, the document preprocessing module 102 is also used to obtain a first xml file obtained by merging the target text nodes; use a recursive algorithm to traverse all paragraph nodes in the first xml file; split the text content in the first target text node based on a preset anchor point tag in the first target text node; and determine a second xml file based on the target text node splitting result.
[0131] Optionally, the document preprocessing module 102 is also used to obtain a second XML file obtained by splitting the target text node; use a recursive algorithm to traverse all target nodes in the second XML file, the target nodes include paragraph nodes and target text nodes; determine the node identifier of the target node according to the recursive order, the node identifier corresponds to the target node one by one, and the value of the node identifier increases sequentially according to the recursive order; add the node identifier to the attribute list of the corresponding target node; and determine the target XML file according to the result of adding the node identifier.
[0132] Optionally, the data extraction module 104 is used to decompress the standardized data source document to obtain a target XML file with a node identifier; perform data parsing on the node data of all nodes in the target XML file, the node data including text content data, node label data and text type data; and determine the target structured data based on the data parsing results.
[0133] Optionally, the data extraction module 104 is also used to obtain all directory title nodes in the target structured data based on the node label data; obtain the directory title data of each directory title node and the correspondence between the directory title node and the main text; and determine the document directory data set in the document database based on the directory title data and the correspondence.
[0134] Optionally, the data extraction module 104 is also used to obtain all paragraph nodes in the target structured data based on the node label data; traverse the node paragraph data of the target text node in each paragraph node; and determine the document paragraph data set in the document database based on the paragraph nodes and the node paragraph data.
[0135] Optionally, the data extraction module 104 is also used to obtain all table nodes in the target structured data based on the node label data; traverse the table row nodes and cell nodes in each table node; determine the coordinate parameters of each cell in the overall table based on the traversal results; and determine the document table data set in the document database based on the table nodes, cell nodes and coordinate parameters.
[0136] Optionally, a document database may be used to create the target document.
[0137] Therefore, the intelligent document processing system provided by the embodiment of the present invention executes an intelligent document processing method. The document processing method solves the problems of low efficiency and high cost caused by existing manual editing of documents by standardizing the XML file of the data source document, extracting data based on the standardized XML file, and establishing a document database according to the data extraction results. It provides a data basis for intelligent document editing operations, has a high degree of intelligence, and convenient and fast document processing, which is conducive to saving labor costs and time costs and improving document editing efficiency and accuracy.
[0138] Embodiment 3
[0139] Fig. 9 It is a structural diagram of a computer device provided in Embodiment 3 of the present invention. Fig. 9 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Fig. 9 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0140] like Fig. 9 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors 16, a memory 28, a bus 18 connecting different system components (including the memory 28 and the processor 16), and a computer program stored in the memory and executable on the processor. When the processor executes the program, the above-mentioned intelligent document processing method is implemented, and the corresponding functional modules and beneficial effects of the method are executed.
[0141] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0142] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0143] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0144] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0145] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and / or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0146] The processor 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the intelligent document processing method provided in the embodiment of the present invention.
[0147] Embodiment 4
[0148] Embodiment 4 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned intelligent document processing method is implemented.
[0149] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0150] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0151] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0152] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0153] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.< / tc> < / tbl> < / tbl> < / tbl> < / t> < / r>
Claims
1. An intelligent document processing method, characterized in that: The following steps are involved: Acquire an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node; Performing standardization processing on the xml file to obtain a target xml file, wherein the standardization processing includes sequentially performing target text node merging, target text node splitting, and adding node identifiers; Compressing the target XML file to obtain a standardized data source document; Extracting data from the standardized data source document includes: decompressing the standardized data source document to obtain a target XML file with a node identifier; parsing the node data of all nodes in the target XML file; determining target structured data according to the data parsing result; the data extraction includes extracting directory title data, node paragraph data and table data in the document; the node data includes text content data, node label data and text type data; the target structured data is two-dimensional structured data; the text content data is used to limit the text content; the node label data is used to limit the type of the node; the text type data is used to limit the text type; Establishing a document database according to the data extraction result, including: processing the directory title data, the node paragraph data and the table data for abnormal values and missing values, and classifying and storing the directory title data, the node paragraph data and the table data to establish a document database; Creating a target document according to the document database; the document database refers to a structured data set stored in an Internet office system; The step of standardizing the XML file comprises the following steps: Using a recursive algorithm to traverse all paragraph nodes in the XML file; merging all target text nodes in any paragraph node into a first target text node in the same paragraph node; and determining a first XML file according to the target text node merging result; A recursive algorithm is used to traverse all paragraph nodes in the first xml file; the text content in the first target text node is split based on a preset anchor mark in the first target text node; a second xml file is determined according to the target text node splitting result; the specific text pointed to by the preset anchor mark includes a title, a directory and / or specific data; A node identifier is added to the second XML file to obtain a target XML file.
2. The intelligent document processing method according to claim 1, characterized in that: The xml file is standardized, comprising the following steps: Get the second XML file obtained by splitting the target text node; Using a recursive algorithm to traverse all target nodes in the second XML file, the target nodes include paragraph nodes and target text nodes; Determine a node identifier of the target node according to a recursive order, wherein the node identifier corresponds to the target node one by one, and the value of the node identifier increases in sequence according to the recursive order; Adding the node identifier to the corresponding attribute list of the target node; The target XML file is determined according to the node identifier adding result.
3. The intelligent document processing method according to claim 1, characterized in that: The step of establishing a document database according to the data extraction results comprises the following steps: Acquire all directory title nodes in the target structured data based on the node label data; Acquire the directory title data of each directory title node and the corresponding relationship between the directory title node and the body text; A document directory data set in the document database is determined according to the directory title data and the corresponding relationship.
4. The intelligent document processing method according to claim 1, characterized in that: The step of establishing a document database according to the data extraction results comprises the following steps: Acquire all paragraph nodes in the target structured data based on the node label data; Traverse the node paragraph data of the target text node in each paragraph node; A document paragraph data set in the document database is determined according to the paragraph node and the node paragraph data.
5. The intelligent document processing method according to claim 1, characterized in that: The step of establishing a document database according to the data extraction results comprises the following steps: Acquire all table nodes in the target structured data based on the node label data; Traversing the table row nodes and cell nodes in each of the table nodes; Determine the coordinate parameters of each cell in the overall table according to the traversal results; A document table data set in the document database is determined according to the table node, the cell node and the coordinate parameters.
6. An intelligent document processing system, characterized in that: include: A data source acquisition module, used to acquire an XML file of a data source document, wherein the XML file includes at least one paragraph node, and the paragraph node includes at least one target text node; A document preprocessing module, used for performing standardization processing on the XML file to obtain a target XML file, wherein the standardization processing includes sequentially performing target text node merging, target text node splitting and adding node identifiers; A document compression module is used to compress the target XML file to obtain a standardized data source document; A data extraction module is used to extract data from the standardized data source document and establish a document database based on the data extraction results; create a target document based on the document database; the document database refers to a structured data set stored in an Internet office system; The data extraction module is specifically used to decompress the standardized data source document to obtain a target XML file with a node identifier; perform data analysis on the node data of all nodes in the target XML file; determine the target structured data according to the data analysis result; the data extraction includes extracting the directory title data, node paragraph data and table data in the document; the node data includes text content data, node label data and text type data; the target structured data is two-dimensional structured data; the text content data is used to limit the text content; the node label data is used to limit the type of the node; the text type data is used to limit the text type; The data extraction module is also used to process the abnormal values and missing values of the directory title data, the node paragraph data and the table data, and classify and store the directory title data, the node paragraph data and the table data to establish a document database; The document preprocessing module is specifically used to traverse all paragraph nodes in the xml file using a recursive algorithm; merge all target text nodes in any paragraph node into a first target text node in the same paragraph node; and determine the first xml file according to the target text node merging result; A recursive algorithm is used to traverse all paragraph nodes in the first xml file; the text content in the first target text node is split based on a preset anchor mark in the first target text node; a second xml file is determined according to the target text node splitting result; a node identifier is added to the second xml file to obtain a target xml file; the specific text pointed to by the preset anchor mark includes a title, a directory and / or specific data.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the intelligent document processing method as described in any one of claims 1-5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the intelligent document processing method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Document processing method and apparatus
CN108334481A
Method and system for converting Word file into EPUB file
CN110083805A
Document management and operation method and system
CN112667563A