Document generation method and device
By configuring structured fields in the initial document, automatically searching and adding target data from the data set, the cumbersome problems of copying and summarizing in report document generation are solved, and fast and accurate document generation is achieved, reducing error rate and management costs are reduced. .
Patent Information
- Application Number
- CN202310822888.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-01-07
AI Technical Summary
When making report documents, users need to copy, collect data from multiple documents and summarize them, which makes them time-consuming, error-prone, and cumbersome management, and lacks efficient automation solutions.
By obtaining the initial document configured with structured fields, the target field information and corresponding target data are automatically searched in the pre-built data set, and added it to the initial document to generate the target document to achieve automatic document generation.
It greatly reduces the workload of users to copy and paste between multiple documents, reduces the error rate, improves the efficiency and accuracy of document generation, avoids information errors and deposits valuable information into corporate assets.
Smart Images

Figure CN119272739A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a document generation method and device. Background Art
[0002] With the rapid development of computer technology, various electronic documents have emerged, and people's daily life and work are increasingly inseparable from electronic documents. For example, electronic documents are used for work reports.
[0003] When users create reporting documents, such as monthly revenue reports, they usually need to copy and collect relevant data from different documents and tables and summarize the data. Such operations are often periodic, such as weekly or monthly. Such repetitive operations are time-consuming, error-prone, and ultimately generate multiple documents, which are cumbersome to manage. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention
[0004] In view of the problems existing in the prior art, an embodiment of the present invention provides a document generation method and device.
[0005] The present invention provides a document generation method, comprising:
[0006] Obtaining an initial document configured with at least one first structured field;
[0007] In a pre-constructed data set, searching for target field information corresponding to each of the first structured fields, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document contents of associated documents;
[0008] Determining target data corresponding to the target field information according to the target field information;
[0009] For each of the first structured fields, the target data corresponding to the first structured field is added to the display area corresponding to the first structured field in the initial document to generate a target document.
[0010] According to a document generation method provided by the present invention, before searching the pre-constructed data set for target field information corresponding to each of the first structured fields, the method further includes:
[0011] Get at least one associated document;
[0012] For each associated document, structured collection is performed on the document content of the associated document to obtain a second structured field;
[0013] Initial field information is generated according to the second structured field, and the second structured field and the initial field information are associated and stored in the data set.
[0014] According to a document generation method provided by the present invention, the structured collection of the document content of the associated document to obtain the second structured field includes:
[0015] Identifying a document type of the associated document;
[0016] According to the processing strategy corresponding to the document type, the document content of the associated document is structured and collected to obtain a second structured field.
[0017] According to a document generation method provided by the present invention, the document content of the associated document is structuredly collected according to the processing strategy corresponding to the document type to obtain the second structured field, including:
[0018] In the case where the document type is a text document, identifying each first content to be collected in the text document, performing structured collection on each first content to be collected, and obtaining a second structured field of each first content to be collected, wherein the first content to be collected is a picture or a table in the document content;
[0019] In the case where the document type is a table document, each second content to be collected in the table document is structured and collected respectively to obtain a second structured field of each second content to be collected, and the second content to be collected is the document content in the cell in the table document.
[0020] According to a document generation method provided by the present invention, the structured collection of the document content of the associated document to obtain the second structured field includes:
[0021] receiving a content selection instruction, wherein the content selection instruction carries a selection range;
[0022] The document content corresponding to the selected range in the associated document is structured and collected to obtain a second structured field.
[0023] According to a document generation method provided by the present invention, the structured collection of the document content of the associated document to obtain the second structured field includes:
[0024] Get the setting keywords;
[0025] Filtering the document contents in the associated documents according to the set keywords;
[0026] The filtered document content is structured and collected to obtain a second structured field.
[0027] According to a document generation method provided by the present invention, after associating and storing the second structured field and the initial field information in the data set, the method further includes:
[0028] Setting a first screening field in the data set;
[0029] According to the first screening field, each of the initial field information in the data set is classified.
[0030] According to a document generation method provided by the present invention, the initial document further includes a second screening field;
[0031] Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes:
[0032] Determine a target category, wherein the first screening field and the second screening field corresponding to the target category are the same;
[0033] For each of the first structured fields, matching the first structured field with the second structured field corresponding to each initial field information in the target classification;
[0034] The successfully matched initial field information is determined as the target field information corresponding to the first structured field.
[0035] According to a document generation method provided by the present invention, before searching the pre-constructed data set for target field information corresponding to each of the first structured fields, the method further includes:
[0036] receiving a set selection instruction, wherein the set selection instruction carries a set identifier;
[0037] Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes:
[0038] In the data set corresponding to the set identifier, target field information corresponding to each of the first structured fields is searched.
[0039] The present invention also provides a document generating device, comprising:
[0040] A first acquisition module is configured to acquire an initial document configured with at least one first structured field;
[0041] A search module is configured to search for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document content of associated documents;
[0042] a determination module, configured to determine target data corresponding to the target field information according to the target field information;
[0043] The generating module is configured to add, for each of the first structured fields, target data corresponding to the first structured field to a display area corresponding to the first structured field in the initial document, so as to generate a target document.
[0044] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the document generation methods described above is implemented.
[0045] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the document generation method described in any one of the above is implemented.
[0046] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the document generation method described above is implemented.
[0047] The document generation method and device provided by the present invention automatically obtains target field information and its corresponding target data from a data set through the first structured field configured in the initial document, and then adds the target data to the initial document to automatically generate the target document, which can not only greatly reduce the workload of users repeatedly copying and pasting from multiple related documents to produce documents, but also avoid errors in manual copying and pasting, resulting in errors in the produced target document, that is, reducing the possibility of errors and omissions in the process of information flowing between different documents. The present invention can assist enterprises or users to achieve the purpose of quickly generating report-type documents by directly collecting and extracting target data from a data set (data source).
[0048] In addition, the document generation method provided by the present invention has zero or low cost for users, low learning cost, and supports various personalized configurations. Users do not need to find a software development company to perform customized development based on the document. This not only avoids the problems of high cost, difficult maintenance, high learning cost, and insufficient subsequent personalized support, but also avoids the leakage of user data, and deposits the valuable information in the document into user or corporate assets. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 It is one of the flow charts of the document generation method provided by the present invention;
[0051] Figure 2 This is the second flow chart of the document generation method provided by the present invention;
[0052] Figure 3 It is one of the interface schematic diagrams of the table document provided by the present invention;
[0053] Figure 4 It is one of the interface schematic diagrams of the text document provided by the present invention;
[0054] Figure 5 This is the second interface schematic diagram of the table document provided by the present invention;
[0055] Figure 6 This is the second schematic diagram of the interface of the text document provided by the present invention;
[0056] Figure 7 It is a schematic diagram of the interface of the management background provided by the present invention;
[0057] Figure 8 It is one of the interface schematic diagrams of the report provided by the present invention;
[0058] Fig. 9 This is the second schematic diagram of the interface of the report provided by the present invention;
[0059] Fig.10 This is the third interface schematic diagram of the report provided by the present invention;
[0060] Fig.11 It is a structural schematic diagram of the document generating device provided by the present invention;
[0061] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. 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.
[0063] In order to facilitate a clearer understanding of the embodiments of the present invention, some relevant background knowledge is first introduced as follows.
[0064] With the rapid development of computer technology, various electronic documents have emerged. Electronic documents refer to text materials formed by people in social activities, which are carried by chemical magnetic materials such as computer disks, magnetic disks and optical disks. People's daily life and work are increasingly inseparable from electronic documents, for example, using electronic documents for work reports.
[0065] When users create reporting documents, such as monthly revenue reports, they usually need to copy and collect relevant data from different documents and tables and summarize the data. Such operations are often periodic, such as weekly or monthly. Such repetitive operations are time-consuming, error-prone, and ultimately generate multiple documents, which are cumbersome to manage.
[0066] For example, for a monthly report, a user might go through the following steps:
[0067] (1) Open the monthly report document;
[0068] (2) Open the revenue data table, copy some data, and paste it into the monthly report document;
[0069] (3) Open the expenditure data table, copy some data, and paste it into the monthly report document;
[0070] (4) Repeat the above steps (1) to (3) multiple times;
[0071] (5) Organize the format and content of monthly report documents and present them;
[0072] (6) When making the monthly report in the next month, repeat steps (1) to (5).
[0073] This operation is not only time-consuming and error-prone, but also generates multiple documents, which are cumbersome to manage. And the large amount of information statistics work is time-sensitive and demanding.
[0074] Therefore, the present invention provides a document generation method and device, which automatically obtains target field information and its corresponding target data from a data set through a first structured field configured in an initial document, and then adds the target data to the initial document to automatically generate a target document, which can not only greatly reduce the workload of users repeatedly copying and pasting from multiple related documents to produce documents, but also avoid errors in manual copying and pasting, resulting in errors in the produced target document, that is, reducing the possibility of errors and omissions in the process of information flowing between different documents. The present invention can assist enterprises or users to achieve the purpose of quickly generating report-type documents by directly collecting and extracting target data from a data set (data source).
[0075] In addition, the document generation method provided by the present invention has zero or low cost for users, low learning cost, and supports various personalized configurations. Users do not need to find a software development company to perform customized development based on the document. This not only avoids the problems of high cost, difficult maintenance, high learning cost, and insufficient subsequent personalized support, but also avoids the leakage of user data, and deposits the valuable information in the document into user or corporate assets.
[0076] Combine the following Figure 1-Figure 10 The document generation method of the present invention is described.
[0077] Figure 1 This is one of the flowcharts of the document generation method provided by the present invention, see Figure 1 As shown, it includes steps 101 to 104, wherein:
[0078] Step 101: Obtain an initial document configured with at least one first structured field.
[0079] First of all, it should be noted that the execution subject of the present invention can be any electronic device for generating documents, for example, it can be any one of a smart phone, a smart watch, a desktop computer, a laptop computer, etc.
[0080] Specifically, the initial document can be any kind of document for summarizing or reporting, generally including summary documents and report documents, etc., wherein a report document is a document that records reports, which dynamically displays data in formats such as tables and charts, and is usually used for situation descriptions, for example, report documents for monthly revenue reports, report documents for statistics on the work status of company personnel, etc. A summary document refers to a document obtained by summarizing multiple documents together. For example, to count the graduation status of all graduated students of a school, it is necessary to summarize the graduation status of graduates from all walks of life into one document.
[0081] A structured field, also known as a keyword or a key word, refers to an index of some data, such as a key-value, where the key is a structured field and the value is specific data. The first structured field refers to a structured field set in the initial document.
[0082] In practical applications, there are many methods for obtaining an initial document configured with at least one first structured field, which is not limited in the present invention.
[0083] Exemplarily, a user uploads an initial document configured with at least one first structured field through an upload page provided by the document generation platform, and accordingly, the execution entity obtains the initial document configured with at least one first structured field.
[0084] Exemplarily, the execution subject receives a document generation instruction or an initial document acquisition instruction, and accordingly, the execution subject acquires the initial document from the storage area pointed to by the document generation instruction or the initial document acquisition instruction.
[0085] Exemplarily, the execution subject receives a document creation instruction, and accordingly, the execution subject creates a blank document, and in response to the text filling instruction, displays the text content corresponding to the text filling instruction in the blank document. Further, according to the received structured configuration instruction, a first structured field is set for the target text content to obtain an initial document, wherein the structured configuration instruction carries a text identifier and a first structured field, and the text identifier points to the target text content, and the text identifier can be the position, paragraph, number of lines, etc. of the target text content in the document; or the execution subject automatically identifies the text content, matches the text content with each pre-set first structured field, and obtains the initial document.
[0086] Step 102: Searching for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document contents of associated documents.
[0087] Specifically, field information can be a data identifier or a field identifier, such as data ID, data storage location, field ID, etc. Since the size of data varies, such as pictures, articles, etc., using data identifiers as field information can avoid directly storing data in data sets, which may cause the data set to store too much data and cause freezes, downtime, and other phenomena that cannot be used normally. Field information can also be binary data corresponding to the target data. In this way, after determining the target field information, the target field information can be used to restore the target data for use without having to search for the target data again based on the data identifier.
[0088] A data set refers to a set storing multiple initial field information, which is used to search for matching target data. The data set can be in the form of a data table, for example, a data table, in which the initial field information is stored in the cells. The data set can also be in the form of a database, for example, a data set is a database, and the initial field information is stored in the data storage area of the database. The data set can also be any other form of data storage that can be realized now or in the future, and the present invention does not specifically limit this.
[0089] An associated document is an original document that stores the required content of a target document. For example, if the target document is a document that reports monthly revenue and expenditure of a company, the associated document can be the company's purchase record document, sales record document, cost record document, etc. The document content is the content recorded in the associated document.
[0090] In actual applications, for each first structured field, the first structured field can be matched with each initial field information in the data set, and the initial field information that is successfully matched is used as the target field information of the first structured field.
[0091] Exemplarily, each initial field information carries a field symbol, and the first structured field is matched with each field symbol. If a target field symbol representing the first structured field is found, the initial field information corresponding to the target field symbol is determined as the target field information of the first structured field.
[0092] Exemplarily, the initial field information in the data set is stored in association with the second structured field, and the target second structured field that is the same as the first structured field is found from each second structured field, and the initial field information stored in association with the target second structured field is determined as the target field information of the first structured field.
[0093] Step 103: Determine the target data corresponding to the target field information according to the target field information.
[0094] Specifically, the target data refers to the specific content corresponding to the second structure field, such as the value in the keyword value key-value.
[0095] In actual applications, when the target field information is a data identifier or a field identifier, the target data can be obtained from the data storage area according to the target field information. For example, when the target field information is a field ID, the data corresponding to the field ID is obtained from the associated document pointed to by the field ID, which is the target data. When the target field information is binary data corresponding to the target data, the binary data is restored to obtain the target data.
[0096] Step 104: For each of the first structured fields, add the target data corresponding to the first structured field to the display area corresponding to the first structured field in the initial document to generate a target document.
[0097] Specifically, the display area refers to an area or portion of the initial document used to display, present or insert target data.
[0098] In actual applications, after obtaining the target data, the display area corresponding to each first structured field is identified in the initial document, and then for each first structured field, the target data corresponding to the current first structured field is inserted into the display area corresponding to the current first structured field, and all first structured fields are traversed to obtain the target document.
[0099] It should be noted that when adding target data, you can complete the addition of one target data before adding the next target data. The order of adding can be from front to back, from back to front, random, etc.; it can also be done synchronously in multiple threads, with each thread used to add one target data.
[0100] The document generation method provided by the present invention automatically obtains target field information and its corresponding target data from a data set through the first structured field configured in the initial document, and then adds the target data to the initial document to automatically generate the target document, which can not only greatly reduce the workload of users repeatedly copying and pasting from multiple documents to produce documents, but also avoid errors in manual copying and pasting, resulting in errors in the produced documents, that is, reducing the possibility of errors and omissions in the process of information flowing between different documents. The present invention can assist enterprises or users to achieve the purpose of quickly generating report-type documents by directly collecting and extracting target data from a data set (data source).
[0101] In addition, the document generation method provided by the present invention has zero or low cost for users, low learning cost, and supports various personalized configurations. Users do not need to find a software development company to perform customized development based on the document. This not only avoids the problems of high cost, difficult maintenance, high learning cost, and insufficient subsequent personalized support, but also avoids the leakage of user data, and deposits the valuable information in the document into user or corporate assets.
[0102] In one or more optional embodiments of the present invention, when the data set is in a table format, the pre-built data set can be uploaded by the user, and the user can modify the initial field information in the data set to change the corresponding target data, thereby generating different target documents. In this way, the execution subject does not need to build a data set, which can reduce the amount of data processing of the execution subject, allowing the execution subject to use more computing power in the process of generating the target document from the initial document, thereby improving the efficiency of generating the target document.
[0103] In one or more optional embodiments of the present invention, the data set may be constructed by the execution subject based on the document content of the associated document. That is, before searching for the target field information corresponding to each of the first structured fields in the pre-constructed data set, the method further includes:
[0104] Get at least one associated document;
[0105] For each associated document, structured collection is performed on the document content of the associated document to obtain a second structured field;
[0106] Initial field information is generated according to the second structured field, and the second structured field and the initial field information are associated and stored in the data set.
[0107] Specifically, structured collection refers to the structured processing of related data in the document content, such as "Name", "Xiaohong", "Xiaoming", "Class", "Grade 3, Class 4", where "Xiaohong" and "Xiaoming" are names, and "Grade 3, Class 4" is a class; then structured collection can be performed to obtain the structured data "Name-Xiaohong", "Name-Xiaoming" and "Class-Grade 3, Class 8", where name and class are the second structured fields.
[0108] In practical applications, at least one associated document for making a target document is first obtained. The associated document may be uploaded by a user, and when a data set construction instruction or a data set update instruction is received, the associated document uploaded by the user is read; the associated document may be periodically obtained from a document repository, or when an update to the document repository is detected, the associated document may be obtained from the document repository. Other methods are also possible, and the present invention does not impose any limitation on this.
[0109] Furthermore, for each associated document, the document content of the associated document is parsed to determine key content in the document content that can be used to generate structured data, and the key content is structured and collected to obtain a second structured field.
[0110] Then, for each second structured field, the target data corresponding to the current second structured field is converted into binary data to obtain initial field information; or the data identifier (such as data ID, data location information) of the target data corresponding to the current second structured field is obtained, and the data identifier is used as the initial field information; or the field identifier (such as field ID) of the current second structured field is obtained, and the field identifier is used as the initial field information. Accordingly, the second structured field and the initial field information are associated and stored in the data set, for example, when the data set is in a table form, the second structured field is used as the header, and the initial field information corresponding to the second structured field is used as the cell information of the header for storage; for example, when the data set is in a database form, the initial field information corresponding to the second structured field is stored in a storage area named after the second structured field.
[0111] In this way, the data set is constructed by the execution entity rather than by the user uploading it, which avoids the problem of errors that may exist in the artificial construction of the data set, thereby avoiding errors in searching the target field information, which is conducive to providing the credibility of the target data, and thus improving the reliability and accuracy of the target document.
[0112] In an achievable embodiment of the present invention, the same processing strategy is used to perform structured collection on the associated documents of each document type, that is, the document contents of the associated documents are structured collected to obtain the second structured field. The specific implementation process may be:
[0113] Extracting the document content of the associated document, and adding the extracted document content to the set text document;
[0114] The document content in the added setting text document is structured and collected to obtain a second structured field.
[0115] In practical applications, each associated document is first normalized, that is, regardless of whether the document type of the associated document is a text document (such as a PDF document, a Word document, or a TXT document), an image document, a table document (such as an Excel document), or a presentation document (such as a PPT document), the document content of the associated document is extracted using optical character recognition (OCR) technology, and the extracted document content is added to a blank set text document, such as a Word document, to obtain the added set text document. Then, the document content in the added set text document is structured and collected to obtain a second structured field.
[0116] In this way, the same processing strategy is adopted for the associated documents of different document types, avoiding the need to set different processing strategies for different document types and simplifying the processing flow. At the same time, the extracted document content is added to the set text document, avoiding the problem that some types of documents cannot be directly processed, ensuring the smooth progress of structured collection, and thus improving the generation efficiency of the target document. In addition, in order to ensure further improvement of the efficiency of structured collection, preferably, the set text document is a word document.
[0117] In an achievable embodiment of the present invention, different processing strategies are used for structured collection of related documents of different document types. That is, the document content of the related documents is structured collected to obtain the second structured field. The specific implementation process can be as follows:
[0118] Identifying a document type of the associated document;
[0119] According to the processing strategy corresponding to the document type, the document content of the associated document is structured and collected to obtain a second structured field.
[0120] Specifically, the document type, or document format, refers to the special encoding method used by computers to store information, and is used to identify internally stored data. The processing strategy is a general term for the way, method, and plan for structured collection.
[0121] In actual applications, the document type can be identified based on the suffix of the associated document. For example, the associated document with the suffix ".doc" or ".docx" is a word document in a text document; another example is the associated document with the suffix ".xls" or ".xlsx", which is an excel document in a spreadsheet document; another example is the associated document with the suffix ".pdf", which is a pdf document in a text document, etc. In this way, identifying the document type by the document suffix is simple and fast, and can improve the efficiency of identifying the document type.
[0122] For some associated documents, there may be a problem that the suffix name is missing or changed, resulting in the inability to identify the document type through the document suffix name. In order to avoid the failure of document type identification, the magic number of the associated document can be viewed through the binary viewer (BinaryViewer), and the document type corresponding to the magic number is determined as the document type of the associated document. For example, the magic number of a certain associated document viewed through the binary viewer (Binary Viewer) is 89504E47, and the document type corresponding to the "magic number 89504E47" is a png document, then the document type of the associated document is a png document in the picture document. In this way, the accuracy and effectiveness of document identification can be improved.
[0123] On the basis of identifying the document type, further, a processing policy corresponding to the document type is obtained from the policy library, and according to the processing policy, the document content of the associated document is structured and collected to obtain a second structured field.
[0124] By adopting different processing strategies for structured collection of the document content of associated documents of different document types, it is possible to carry out structured collection of the document content of associated documents of different document types in a targeted manner, which can greatly improve the efficiency and accuracy of structured collection, improve the accuracy and efficiency of the obtained second structured field, and thereby improve the efficiency of constructing the data set and improve the reliability of the data set.
[0125] Optionally, the document content of the associated document is structuredly collected according to the processing strategy corresponding to the document type to obtain the second structured field. The specific implementation process may be as follows:
[0126] In the case where the document type is a text document, identifying each first content to be collected in the text document, performing structured collection on each first content to be collected, and obtaining a second structured field of each first content to be collected, wherein the first content to be collected is a picture or a table in the document content;
[0127] In the case where the document type is a table document, each second content to be collected in the table document is structured and collected respectively to obtain a second structured field of each second content to be collected, and the second content to be collected is the document content in the cell in the table document.
[0128] Specifically, text documents include PDF documents, TXT documents, and Word documents, and spreadsheet documents include Excel documents, etc.
[0129] In actual applications, if the document type is a text document, it means that the associated document may contain tables and pictures. The tables and pictures in the associated document are all regarded as the first content to be collected, one picture is one first content to be collected, and one table is one first content to be collected. For any first content to be collected, the first content to be collected is structured and collected to obtain the second structured field corresponding to the first content to be collected. All the first contents to be collected in the associated document can be traversed to obtain the second structured field of each first content to be collected; or only the first content to be collected selected by the user can be structured and collected, that is, in response to the first content to be collected selection instruction, each target first content to be collected selected by the first content to be collected selection instruction is structured and collected to obtain the second structured field of each target first content to be collected.
[0130] In addition, the first content to be collected may also be text in the document content.
[0131] It should be noted that, for any table in a text document, when a first cell selection instruction is received, a structured collection can be performed on the target cell in the table selected by the first cell selection instruction to obtain a second structured field of the target cell. At this time, it can also be determined whether to perform structured collection on the table based on the collection parameters. For example, if the collection parameter is 1, not only the table needs to be structured, but also the target cells in the table need to be structured; if the collection parameter is 2, only the target cells in the table need to be structured.
[0132] If the document type is a table document, it means that the associated document only contains cells, and the document content in each cell in the associated document is used as the second content to be collected, and one cell corresponds to one second content to be collected. For any second content to be collected, the second content to be collected is structured and collected to obtain the second structured field corresponding to the second content to be collected. All second contents to be collected in the associated document can be traversed to obtain the second structured field of each second content to be collected; or only the second content to be collected selected by the user can be structured and collected, that is, in response to the second content to be collected selection instruction, each target second content to be collected selected by the second content to be collected selection instruction is structured and collected to obtain the second structured field of each target second content to be collected.
[0133] By performing structured collection of images and tables in text documents, the accuracy of structured collection of associated documents of text document types can be achieved in a more fine-grained manner. Similarly, by performing structured collection of cell contents in table documents, the accuracy of structured collection of associated documents of table document types can be achieved more comprehensively.
[0134] It should be noted that, for associated documents that are neither text documents nor table documents, structured collection can be achieved through format conversion.
[0135] Exemplarily, when the document type is a special document, the special document can be formatted to obtain an associated document whose document type is a text document; each first content to be collected in the text document is identified, and each first content to be collected is structured to obtain a second structured field of each first content to be collected, wherein the first content to be collected is a picture or table in the document content. Among them, special documents are document types that are non-text documents and non-table documents, including presentation documents and open layout documents (OpenDocument Format, ODF), etc. Presentation documents are such as slide documents (ppt documents). That is, as long as the document type is a special document, the associated documents of the special document are converted into associated documents of the text document, and then structured collection is performed.
[0136] Exemplarily, when the document type is a special document, it is also possible to determine whether the document content of the associated document is table data, and if so, the associated document is converted into an associated document of a table document; if not, the associated document is converted into an associated document of a text document. Then, structured collection is performed according to the processing strategy corresponding to the table document or the text document.
[0137] Optionally, when performing structured collection on the document content of the associated document to obtain the second structured field, in order to avoid data omission, structured collection may be performed on all document contents in the associated document to obtain the second structured field corresponding to each document content.
[0138] Optionally, since there may be redundant or irrelevant content in the associated document, the document content in the associated document may be screened and then structured collection may be performed, that is, structured collection may continue according to the user's selection. That is, the document content of the associated document may be structured to obtain the second structured field. The specific implementation process may be as follows:
[0139] receiving a content selection instruction, wherein the content selection instruction carries a selection range;
[0140] The document content corresponding to the selected range in the associated document is structured and collected to obtain a second structured field.
[0141] In actual applications, users select document content in associated documents through external devices such as a mouse or keyboard, or select document content in associated documents by sliding a finger or stylus on a touch screen, and accordingly, the execution subject receives a content selection instruction, wherein the content selection instruction carries a selection range. The selection range can mark the selected document content, that is, the document content corresponding to the selection range, and perform structured collection on the selected document content to obtain a second structured field. In this way, not only can the amount of data processing for structured collection be reduced, but also personalized structured collection can be performed according to user needs, thereby promoting human-computer interaction.
[0142] Optionally, in order to improve intelligence, the execution subject can also automatically perform structured collection without manual intervention. That is, the document content of the associated document is structured collected to obtain the second structured field. The specific implementation process can be as follows:
[0143] Get the setting keywords;
[0144] Filtering the document contents in the associated documents according to the set keywords;
[0145] The filtered document content is structured and collected to obtain a second structured field.
[0146] Specifically, the set keyword refers to a pre-set keyword used to filter out the second structured field.
[0147] In actual applications, the set keywords are first obtained. For each set keyword, the document content containing the set keyword and / or the document content whose semantic similarity with the set keyword is greater than the set threshold in the associated document is searched as the target document content. All set keywords are traversed to obtain all target document contents in the associated documents. The set keyword or the target document content is used as the second structured field (for example, key), and the associated document content corresponding to the target document content is used as the specific data (for example, value). The second structured field and the associated document content constitute structured data. In this way, manual participation is avoided, the intelligence of structured collection is improved, and then the intelligence of document generation is improved.
[0148] Optionally, in order to improve the efficiency of querying in the data set, a filter field may be set in the data set. That is, after the second structured field and the initial field information are associated and stored in the data set, the method further includes:
[0149] Setting a first screening field in the data set;
[0150] According to the first screening field, each of the initial field information in the data set is classified.
[0151] Specifically, the screening field refers to a field used to screen part of the initial field information.
[0152] In actual applications, for different initial field information, the corresponding second structured fields may be the same. For example, initial field information A is "spring", initial field information B is "summer", initial field information C is "autumn", and initial field information D is "winter", that is, the second structured fields corresponding to initial field information A to initial field information D are all "seasons".
[0153] In order to distinguish these initial field information, you can set a filter field, such as month, attribute, cycle, etc. Then, based on the filter field, classify each initial field information. For example, if the filter field is "20230405", the initial field information generated on April 5, 2023 will be grouped together, or the initial field information whose generation time of the target data is April 5, 2023 will be grouped together.
[0154] In this way, each initial field information can have not only a corresponding second structured field but also a corresponding screening field, so that the initial field information can be located from more dimensions.
[0155] In one or more optional embodiments of the present specification, the initial document further includes a second screening field; accordingly, the process of searching the target field information corresponding to each of the first structured fields in the pre-constructed data set may be specifically implemented as follows:
[0156] Determine a target category, wherein the first screening field and the second screening field corresponding to the target category are the same;
[0157] For each of the first structured fields, matching the first structured field with the second structured field corresponding to each initial field information in the target classification;
[0158] The successfully matched initial field information is determined as the target field information corresponding to the first structured field.
[0159] In practical applications, the target first screening field that is the same as the second screening field can be found from each first screening field of the data set, and the category corresponding to the target first screening field is determined as the target category. Further, for each first structured field, the first structured field is matched with the second structured field of each initial field information in the target category, and the initial field information corresponding to the second structured field that successfully matches the first structured field is used as the target field information of the first structured field.
[0160] In this way, by searching the target field information in two dimensions, namely the filter field and the second structured field, the target field information can be found quickly and accurately, which improves the search efficiency and the reliability of the search, thereby ensuring the accuracy of the generated target document.
[0161] In addition, for each first structured field, the initial field information (candidate field information) in which the second structured field successfully matches the first structured field can be found, and then the target field information can be filtered out from the candidate field information based on the filter field information.
[0162] It should be noted that in the initial document, there may be only one second filtering field, and all first structured fields correspond to the second filtering field. For example, if the initial document is a work report for March, the second filtering field is "March", and the first structured fields corresponding to "working hours", "completed projects", "unprocessed projects", etc. all correspond to "March".
[0163] In the initial document, there may also be multiple second filter fields, and different first structured fields may correspond to different second filter fields. For example, if the initial document is an annual report, the second filter field corresponding to the first structured field "January-March Situation Description" is "First Quarter", the second filter field corresponding to the first structured field "April-June Situation Description" is "Second Quarter", the second filter field corresponding to the first structured field "July-September Situation Description" is "Third Quarter", and the second filter field corresponding to the first structured field "October-December Situation Description" is "Fourth Quarter"; or multiple second filter fields corresponding to the first structured field are unified, for example, if the initial document is a quarterly report, the second filter fields corresponding to the first structured field "Expenditure Details" include "January", "February" and "March".
[0164] In one or more optional embodiments of the present invention, there may be only one data set, in which case the target field information may be directly searched from the data set. There may also be multiple data sets, in which case the target field information may be directly searched from all data sets, or one data set may be selected from multiple data sets to search for the target field information.
[0165] Optionally, before searching the pre-built data set for target field information corresponding to each of the first structured fields, the method further includes:
[0166] receiving a set selection instruction, wherein the set selection instruction carries a set identifier;
[0167] Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes:
[0168] In the data set corresponding to the set identifier, target field information corresponding to each of the first structured fields is searched.
[0169] Specifically, the set selection instruction refers to an instruction generated when a user selects a certain data set. The set identifier refers to an identifier that represents a certain data set, such as the name of the data set, the ID of the data set, etc.
[0170] In actual applications, when there are multiple data sets, each data set can be displayed to the user through a display device to facilitate the user's selection. Furthermore, after the user selects a data set through an external device, the execution subject will receive a set selection instruction carrying a set identifier, and then search for the target field information corresponding to each first structured field in the data set corresponding to the set identifier, that is, search for the target field information corresponding to each first structured field in the data set selected by the user. In this way, through the set selection instruction, a suitable data set can be selected to search for the target field information, which improves the accuracy of the target field information to a certain extent, and then searches for the target data to generate the target document, which is conducive to improving the accuracy of the target document.
[0171] Optionally, before searching the target field information corresponding to each of the first structured fields in the pre-constructed data set, the method further includes:
[0172] Identify the summary content of the initial document;
[0173] Calculate the semantic similarity between the collection name of each data collection and the summary content, and determine the data collection corresponding to the maximum semantic similarity as the target data collection;
[0174] Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes:
[0175] In the target data set, target field information corresponding to each of the first structured fields is searched.
[0176] In practical applications, when there are multiple data sets, the summary content of the initial document is extracted, and the collection name of each data set is obtained. For each collection name, the semantic similarity between the collection name and the summary content is calculated, and then the data set corresponding to the maximum semantic similarity among the semantic similarities is determined as the target data set. Then, the target field information corresponding to each first structured field is searched in the target data set. In this way, the target data set can be automatically matched without manual selection, which improves the intelligence and the speed of finding the target field information, thereby improving the efficiency of generating the target document.
[0177] For example, taking the report in the report document as an example, combined with Figure 2-Figure 10The above document generation method is described below. Figure 2 , Figure 2 This is the second flow chart of the document generation method provided by the present invention, which mainly includes three stages: the first stage - data collection, the second stage - data processing, and the third stage - report generation.
[0178] Phase 1 - Data Collection:
[0179] 1. Get multiple related documents, namely document A and document B.
[0180] See also Figure 3 , Figure 3 It is one of the interface schematic diagrams of the table document provided by the present invention, and document A is an excel document. Open document A and open the structured configuration function panel, that is, display the interface, which includes a menu bar, a structured editing window, the name of document A, the specific content of document A (as shown in each text and data in the cell), Table 1 and Table 2 under document A (the current interface displays Table 1), minimize controls, maximize controls, close controls, and document display parameters, such as zoom multiples, view types, etc. Among them, the structured editing window contains a close control for closing the structured editing window, an insert field area, and an intelligent extraction area. The insert field area includes a selection area generation control and multiple fields (such as text, pictures, time, values, names, etc.). After the selection area generation control is turned on, the user selects a cell in Table 1 of document A for structured collection. After the selection area generation control is closed, the execution subject automatically performs structured collection on the document content of document A. The intelligent extraction area displays a start parsing button. Click the start parsing button to trigger structured collection immediately.
[0181] See also Figure 4 , Figure 4 It is one of the interface schematic diagrams of the text document provided by the present invention, and document B is a word document. Open document B and open the structured configuration function panel, that is, display the interface, which includes a menu bar, a structured editing window, the name of document B, the specific content of document B (such as the text, table and picture in the document), a minimize control, a maximize control, a close control and document display parameters, such as zoom multiples, view type, etc. Among them, the structured editing window contains a close control for closing the structured editing window, an insert field area and an intelligent extraction area, and the insert field area includes a selection area generation control and multiple fields (such as text, picture, time, value, name, etc.). After the selection area generation control is turned on, the user selects the document content in Table 1 of document B for structured collection. After the selection area generation control is closed, the execution subject automatically performs structured collection on the document content of document B. The intelligent extraction area displays a start parsing button. Clicking the start parsing button immediately triggers structured collection.
[0182] 2. Select the required content from document A and document B respectively for structured collection. The collection process can be manually added one by one, or it can be intelligently collected in batches through keyword matching.
[0183] exist Figure 3 See on the basis of Figure 5 , Figure 5 This is the second interface diagram of the table document provided by the present invention. On the basis of the selection area generation control being turned on, a cell is selected, and the selected cell is shown as a bold cell. Further, by clicking the Start Parsing button, the text content in each selected cell is automatically structured and collected to obtain a second structured field, such as "single product revenue" under the corresponding field management of "10000" and "office expenses" under the corresponding field management of "2000". It should be noted that by clicking the setting icon after the second structured field (such as single product revenue), the second structured field can be edited, and by clicking the delete icon after the second structured field (such as office expenses), the second structured field can be deleted.
[0184] exist Figure 4 See on the basis of Figure 6 , Figure 6 This is the second interface diagram of the text document provided by the present invention. On the basis of the selection area generation control being turned on, the table and picture in document B are selected. Further, by clicking the Start Parsing button, the selected table and picture are automatically structured and collected to obtain the second structured field, such as the "sales composition table" under the table corresponding field management and the "sales analysis chart" under the picture corresponding field management. It should be noted that by clicking the setting icon after the second structured field (sales composition table), the second structured field can be edited, and by clicking the delete icon after the second structured field (sales analysis chart), the second structured field can be deleted.
[0185] Phase 2 - Data Processing:
[0186] 3. In the management backend interface, the initial field information (such as field ID, i.e., the ID of the second structured field) obtained through structured collection is synchronized to the data center.
[0187] 4. Merge the initial field information corresponding to document A and document B to generate a data set (data summary table).
[0188] In addition, the second structured field needs to be stored in the data set and associated with the initial field information, see Figure 7 , Figure 7It is a schematic diagram of the interface of the management background provided by the present invention. In the management background interface, select the data center under document structuring, create a new data set (data table) about revenue data in the data center, and then associate each field ID with the second structured field and add it to the data set. For example, the field IDs "Te_11" to "Te_17" corresponding to the second structured field "single product revenue", where Te represents text (Text); such as the field IDs "Te_21" to "Ta_27" corresponding to the second structured field "office expenses"; such as the field IDs "Ta_11" to "Ta_17" corresponding to the second structured field "sales composition table", where Ta represents a table (Table); such as the field IDs "P_11" to "P_17" corresponding to the second structured field "sales analysis chart", where P represents a picture (Picture). In addition, document structuring also includes template management, field management, content management, and material library. You can also set a filter field in the data set, such as year and month, to classify the collected initial field information, as shown in "202001"-"202007".
[0189] Phase 3 - Report Generation
[0190] 5. Create a document for generating the report, configure the first structured field in the document to be consistent with the second structured field in the previous data set, and obtain the initial report. Select the "One-click Generate" report function to automatically associate the initial report with the data set through the first structured field and the second structured field.
[0191] See also Figure 8 , Figure 8It is one of the interface schematic diagrams of the report provided by the present invention. A document named "Report" is loaded, and the interface displays the document content of the report, including "Product Sales Report", "(202006)", "1. Single Product Revenue", "XX Yuan", "2. Sales Composition", "(Supplement the sales composition table of the current month)", "3. Sales Analysis Chart" and "(Supplement the sales analysis chart of the current month)". The interface also displays document display parameters, structured editing window, minimize control, maximize control, close control, etc. Among them, the structured editing window contains a close control for closing the structured editing window, an insert field area and an intelligent report area. The insert field area includes a selection generation control and multiple fields (such as text, picture, time, value, name, etc.). After the selection generation control is turned on, the user selects the document content in the report for structured collection. After the selection generation control is closed, the execution subject automatically performs structured collection on the document content of the report. For example, "202006" corresponds to the first structured field "Year and Month" in field management, "XX" corresponds to the first structured field "Product Revenue" in field management, "Supplement the Sales Composition Table of the Current Month" corresponds to the first structured field "Sales Composition Table" in field management; "Supplement the Sales Analysis Chart of the Current Month" corresponds to the first structured field "Sales Analysis Chart" in field management. The "One-Click Generate" button is displayed in the smart report area. Click "One-Click Generate" to start generating the target report.
[0192] exist Figure 8 See on the basis of Fig. 9 , Fig. 9 This is the second interface diagram of the report provided by the present invention: after clicking the "One-click Generate" button, the "Associated Data Center" window will pop up, which includes the "Select [Data Set]" area and the "Set Matching Relationship" area. The "Select [Data Set]" area has a search box for searching data sets and displays some data sets, such as revenue data, product data, and market data. The "Set Matching Relationship" area is used to match the data set field (the second structured field in the data set) and the document field (the first structured field in the report), that is, it can be manually adjusted according to the field intelligent matching. For example, the "year and month" in the data set field matches the "year and month" in the document field, and the type of "year and month" is a screening field; the "single product revenue" in the data set field matches the "single product revenue" in the document field, the "sales composition table" in the data set field matches the "sales composition table" in the document field, and the "sales analysis chart" in the data set field matches the "sales analysis chart" in the document field, and the types of "single product revenue", "sales composition table" and "sales analysis chart" are all ordinary fields (structured fields). Further, click the "Cancel" button in the "Associate Data Center" window to return to Figure 8In the interface shown, click the "OK" button in the "Associate Data Center" window to associate with the selected data set.
[0193] 6. Switch the filter field and the target data will be automatically filled in, that is, select the target data and generate the target report.
[0194] exist Fig. 9 Based on Fig.10 , Fig.10 This is the third interface diagram of the report provided by the present invention: After clicking the "OK" button in the "Associate Data Center" window, enter Fig.10 In the report interface shown, by switching the filter fields, such as the year and month "202006" in the "Structured Fill" window, you can switch the target data such as single product revenue "10000", sales composition table "sales composition table.xls" and sales analysis chart "sales analysis chart.png". The target data is automatically filled in the position corresponding to the second structured field in the report to obtain the target report.
[0195] The document generating device provided by the present invention is described below. The document generating device described below and the document generating method described above can be referred to each other.
[0196] Fig.11 is a schematic diagram of the structure of the document generation device provided by the present invention, such as Fig.11 As shown, the document generation device 1100 includes: a first acquisition module 1101, a search module 1102, a determination module 1103 and a generation module 1104, wherein:
[0197] A first acquisition module 1101 is configured to acquire an initial document configured with at least one first structured field;
[0198] A search module 1102 is configured to search for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document contents of associated documents;
[0199] The determination module 1103 is configured to determine the target data corresponding to the target field information according to the target field information;
[0200] The generating module 1104 is configured to add, for each of the first structured fields, the target data corresponding to the first structured field to the display area corresponding to the first structured field in the initial document, so as to generate a target document.
[0201] The document generation device provided by the present invention automatically obtains target field information and its corresponding target data from the data set through the first structured field configured in the initial document, and then adds the target data to the initial document to automatically generate the target document, which can not only greatly reduce the workload of users repeatedly copying and pasting from multiple documents to make documents, but also avoid errors in manual copying and pasting, resulting in errors in the produced documents, that is, reducing the possibility of errors and omissions in the process of information flowing between different documents. The present invention can assist enterprises or users to achieve the purpose of quickly generating report-type documents by directly collecting and extracting target data from a data set (data source).
[0202] In addition, the present invention has zero or low cost for users, low learning cost, and supports various personalized configurations. Users do not need to find software development companies to perform customized development based on documents. This not only avoids problems such as high cost, difficult maintenance, high learning cost, and insufficient subsequent personalized support, but also avoids the leakage of user data, and deposits valuable information in the documents into user or corporate assets.
[0203] Optionally, the device further comprises:
[0204] A second acquisition module is configured to acquire at least one associated document;
[0205] A structured collection module is configured to perform structured collection on the document content of each associated document to obtain a second structured field;
[0206] The storage module is configured to generate initial field information according to the second structured field, and associate the second structured field with the initial field information and store them in the data set.
[0207] Optionally, the structured acquisition module is further configured to:
[0208] Identifying a document type of the associated document;
[0209] According to the processing strategy corresponding to the document type, the document content of the associated document is structured and collected to obtain a second structured field.
[0210] Optionally, the structured acquisition module is further configured to:
[0211] In the case where the document type is a text document, identifying each first content to be collected in the text document, performing structured collection on each first content to be collected, and obtaining a second structured field of each first content to be collected, wherein the first content to be collected is a picture or a table in the document content;
[0212] In the case where the document type is a table document, each second content to be collected in the table document is structured and collected respectively to obtain a second structured field of each second content to be collected, and the second content to be collected is the document content in the cell in the table document.
[0213] Optionally, the structured acquisition module is further configured to:
[0214] receiving a content selection instruction, wherein the content selection instruction carries a selection range;
[0215] The document content corresponding to the selected range in the associated document is structured and collected to obtain a second structured field.
[0216] Optionally, the structured acquisition module is further configured to:
[0217] Get the setting keywords;
[0218] Filtering the document contents in the associated documents according to the set keywords;
[0219] The filtered document content is structured and collected to obtain a second structured field.
[0220] Optionally, the device further comprises:
[0221] A setting module, configured to set a first screening field in the data set;
[0222] The classification module is configured to classify each of the initial field information in the data set according to the first screening field.
[0223] Optionally, the initial document further includes a second screening field;
[0224] Accordingly, the search module 1102 is further configured to:
[0225] Determine a target category, wherein the first screening field and the second screening field corresponding to the target category are the same;
[0226] For each of the first structured fields, matching the first structured field with the second structured field corresponding to each initial field information in the target classification;
[0227] The successfully matched initial field information is determined as the target field information corresponding to the first structured field.
[0228] Optionally, the device further includes a receiving module configured to:
[0229] receiving a set selection instruction, wherein the set selection instruction carries a set identifier;
[0230] Accordingly, the search module 1102 is further configured to:
[0231] In the data set corresponding to the set identifier, target field information corresponding to each of the first structured fields is searched.
[0232] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12 As shown, the electronic device may include: a processor 1210, a communication interface 1220, a memory 1230 and a communication bus 1240, wherein the processor 1210, the communication interface 1220 and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 may call the logic instructions in the memory 1230 to execute the document generation method, which includes: obtaining an initial document configured with at least one first structured field; searching for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores a plurality of initial field information, wherein the initial field information is determined based on structured collection of the document content of the associated document; determining the target data corresponding to the target field information according to the target field information; and for each of the first structured fields, adding the target data corresponding to the first structured field to the display area corresponding to the first structured field in the initial document to generate the target document.
[0233] In addition, the logic instructions in the above-mentioned memory 1230 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0234] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the document generation method provided by the above-mentioned methods, and the method includes: obtaining an initial document configured with at least one first structured field; searching for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores multiple initial field information, and the initial field information is determined based on structured collection of document content of associated documents; determining target data corresponding to the target field information based on the target field information; for each of the first structured fields, adding the target data corresponding to the first structured field to the display area corresponding to the first structured field in the initial document to generate a target document.
[0235] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the document generation method provided by the above-mentioned methods, the method comprising: obtaining an initial document configured with at least one first structured field; searching for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores multiple initial field information, and the initial field information is determined based on structured collection of document content of associated documents; determining target data corresponding to the target field information based on the target field information; for each of the first structured fields, adding the target data corresponding to the first structured field to the display area corresponding to the first structured field in the initial document to generate a target document.
[0236] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0237] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0238] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A document generation method, characterized in that: include: Obtaining an initial document configured with at least one first structured field; In a pre-constructed data set, searching for target field information corresponding to each of the first structured fields, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document contents of associated documents; Determining target data corresponding to the target field information according to the target field information; For each of the first structured fields, the target data corresponding to the first structured field is added to the display area corresponding to the first structured field in the initial document to generate a target document.
2. The document generation method according to claim 1, characterized in that: Before searching the target field information corresponding to each of the first structured fields in the pre-built data set, the method further includes: Get at least one associated document; For each associated document, structured collection is performed on the document content of the associated document to obtain a second structured field; Initial field information is generated according to the second structured field, and the second structured field and the initial field information are associated and stored in the data set.
3. The document generation method according to claim 2, characterized in that: The structured collection of the document content of the associated document to obtain the second structured field includes: Identifying a document type of the associated document; According to the processing strategy corresponding to the document type, the document content of the associated document is structured and collected to obtain a second structured field.
4. The document generation method according to claim 3, characterized in that: The step of performing structured collection on the document content of the associated document according to the processing strategy corresponding to the document type to obtain a second structured field includes: In the case where the document type is a text document, identifying each first content to be collected in the text document, performing structured collection on each first content to be collected, and obtaining a second structured field of each first content to be collected, wherein the first content to be collected is a picture or a table in the document content; In the case where the document type is a table document, each second content to be collected in the table document is structured and collected respectively to obtain a second structured field of each second content to be collected, and the second content to be collected is the document content in the cell in the table document.
5. The document generation method according to claim 2, characterized in that: The structured collection of the document content of the associated document to obtain the second structured field includes: receiving a content selection instruction, wherein the content selection instruction carries a selection range; The document content corresponding to the selected range in the associated document is structured and collected to obtain a second structured field.
6. The document generation method according to claim 2, characterized in that: The structured collection of the document content of the associated document to obtain the second structured field includes: Get the setting keywords; Filtering the document contents in the associated documents according to the set keywords; The filtered document content is structured and collected to obtain a second structured field.
7. The document generation method according to claim 2, characterized in that: After associating and storing the second structured field and the initial field information in the data set, the method further includes: Setting a first screening field in the data set; According to the first screening field, each of the initial field information in the data set is classified.
8. The document generation method according to claim 7, characterized in that: The initial document also includes a second screening field; Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes: Determine a target category, wherein the first screening field and the second screening field corresponding to the target category are the same; For each of the first structured fields, matching the first structured field with the second structured field corresponding to each initial field information in the target classification; The successfully matched initial field information is determined as the target field information corresponding to the first structured field.
9. The document generation method according to claim 1, characterized in that: Before searching the target field information corresponding to each of the first structured fields in the pre-built data set, the method further includes: receiving a set selection instruction, wherein the set selection instruction carries a set identifier; Accordingly, searching the pre-built data set for target field information corresponding to each of the first structured fields includes: In the data set corresponding to the set identifier, target field information corresponding to each of the first structured fields is searched.
10. A document generation device, characterized in that: include: A first acquisition module is configured to acquire an initial document configured with at least one first structured field; A search module is configured to search for target field information corresponding to each of the first structured fields in a pre-constructed data set, wherein the data set stores a plurality of initial field information, and the initial field information is determined based on structured collection of document content of associated documents; a determination module, configured to determine target data corresponding to the target field information according to the target field information; The generating module is configured to add, for each of the first structured fields, target data corresponding to the first structured field to a display area corresponding to the first structured field in the initial document, so as to generate a target document.