Template document generation method and device

By performing structured data collection and field algorithm matching on template documents, target template documents that are automatically calculated are generated, solving the problems of time-consuming, laborious, and error-prone creation of content calculation documents for users, and improving the efficiency and accuracy of data aggregation.

CN119272743APending Publication Date: 2025-01-07ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310822909.4
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

Technical Problem

When creating documents that require content calculations, such as electronic exams or electronic contracts, users need to manually copy or compare key information, which is time-consuming, laborious, and prone to errors.

Method used

By structurally collecting multiple text regions with related calculation relationships in the initial template document, structured fields are generated, and the corresponding field algorithms are matched in a preset configuration table to generate the target template document, thereby achieving automatic calculation function.

Benefits of technology

It significantly reduces the workload of users performing repetitive calculations, lowers the error rate, improves the efficiency and accuracy of data aggregation, and reduces the learning cost and maintenance difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272743A_ABST
    Figure CN119272743A_ABST
Patent Text Reader

Abstract

The invention provides a template document generation method and device, and relates to the technical field of computers.The template document generation method comprises the steps that an initial template document containing a plurality of text areas is obtained, and a correlation calculation relation exists between the text areas; performing structured collection on each text region to obtain a structured field corresponding to each text region; in a preset configuration table, matching a corresponding field algorithm for each structured field; and associating the initial template document with the preset configuration table to generate a target template document. According to the method, the workload of a user for repeatedly calculating multiple data for summarization can be greatly reduced, errors caused by errors in manual calculation and errors in made documents are avoided, namely, the possibility of errors in the data calculation and filling process is reduced, and the efficiency and accuracy of data summarization are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a template 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.

[0003] When users create documents that require content calculation, such as electronic test papers, online assessments, and electronic contracts, some key information in the documents often have a relationship of mutual calculation. For example, in scoring statistics documents, when the specified content is hit, the score is automatically calculated, and all scores are finally summarized; in contract documents, the monthly repayment amount is automatically calculated based on the entered loan amount and interest rate. Users need to copy these data inputs into the table by themselves, or compare and calculate manually, which is not only time-consuming and labor-intensive, but also prone to errors. 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 template document generating method and device.

[0005] The present invention provides a template document generation method, comprising:

[0006] Acquire an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions;

[0007] Performing structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions;

[0008] In the preset configuration table, a corresponding field algorithm is matched for each of the structured fields;

[0009] The initial template document is associated with the preset configuration table to generate a target template document.

[0010] According to a template document generation method provided by the present invention, the preset configuration table includes a field identification category, a field name category and a field algorithm category;

[0011] Accordingly, in the preset configuration table, the corresponding field algorithm is matched for each structured field, including:

[0012] For each of the structured fields, fill in the field identifier of the structured field into the field identifier category, and fill in the field name of the structured field into the field name category;

[0013] In the field algorithm category, a corresponding field algorithm is matched for the structured field, and the field identifier, the field name and the field algorithm are associated.

[0014] According to a template document generation method provided by the present invention, the preset configuration table further includes a calculation category and a modification category, the calculation category indicates whether automatic calculation is allowed, and the modification category indicates whether modification is allowed;

[0015] Accordingly, after matching the corresponding field algorithm for the structured field in the field algorithm category, the method further includes:

[0016] For each of the structured fields, a corresponding calculation type is matched for the structured field in the calculation category, and a corresponding modification type is matched for the structured field in the modification category.

[0017] According to a template document generation method provided by the present invention, matching a corresponding field algorithm for the structured field in the field algorithm category includes:

[0018] receiving an algorithm input instruction for the structured field, wherein the algorithm input instruction carries an algorithm identifier;

[0019] In the field algorithm category, the field algorithm corresponding to the algorithm identifier is matched with the structured field.

[0020] According to a template document generation method provided by the present invention, matching a corresponding field algorithm for the structured field in the field algorithm category includes:

[0021] Performing semantic recognition on each of the field names under the field name category to obtain a recognition result;

[0022] Determine the calculation relationship between the field names according to the recognition result;

[0023] In the field algorithm category, the field algorithm corresponding to the calculation relationship is matched with the structured field.

[0024] According to a template document generation method provided by the present invention, after associating the initial template document with the preset configuration table to generate a target template document, the method further includes:

[0025] Acquire a document to be processed, wherein the document to be processed is obtained by filling text into the target template document;

[0026] Identifying the text content of each text area in the document to be processed;

[0027] Calculate each text content according to the field algorithm corresponding to each text area to obtain a calculated value;

[0028] The calculated value is added to the text area corresponding to the calculated value to obtain a processed document.

[0029] According to a template document generation method provided by the present invention, the step of obtaining a document to be processed includes:

[0030] In response to a text filling instruction for the target template document, fill in the text of the target template document to obtain a document to be processed; or;

[0031] Obtain a content reference document; extract text content corresponding to each text area in the target template document from the content reference document, and perform text filling to obtain a document to be processed.

[0032] According to a template document generation method provided by the present invention, the structured collection of each of the text regions to obtain the structured fields corresponding to each of the text regions includes:

[0033] For each text region, a semantic analysis is performed on the text content corresponding to the text region to obtain a semantic analysis result, and a corresponding structured field is matched for the text region according to the semantic analysis result.

[0034] According to a template document generation method provided by the present invention, the initial template document is associated with the preset configuration table to generate a target template document, including:

[0035] For each of the text areas in the initial template document, the text area is associated with a field algorithm corresponding to a specified structured field in the preset configuration table to obtain a target template document, wherein the specified structured field is a structured field corresponding to the text area.

[0036] The present invention also provides a template document generating device, comprising:

[0037] A first acquisition module is configured to acquire an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions;

[0038] A structured collection module is configured to perform structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions;

[0039] A first matching module is configured to match a corresponding field algorithm for each of the structured fields in a preset configuration table;

[0040] The generating module is configured to associate the initial template document with the preset configuration table to generate a target template document.

[0041] 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 template document generation methods described above is implemented.

[0042] 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 template document generation method described in any one of the above is implemented.

[0043] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the template document generating method as described above is implemented.

[0044] The template document generation method and device provided by the present invention obtains the structured fields corresponding to each text area by performing structured collection on multiple text areas with associated calculation relationships in the initial template document, matches the corresponding field algorithm for each structured field in the preset configuration table, and associates the initial template document with the preset configuration table to generate a target template document with the content automatic calculation function, so that the composition and calculation relationship of the key information in the target template document are fixed. When using the target template document to fill in new data, the calculation can be completed automatically, saving time for the user. The workload of users repeatedly calculating multiple data for aggregation is greatly reduced, and errors in human calculations are avoided, resulting in errors in the produced documents, that is, the possibility of errors in the process of calculating and filling data back and forth is reduced, and the efficiency and accuracy of data aggregation are greatly improved. Assist enterprises or users to configure the content automatic calculation rules for document information, quickly complete the automatic calculation of multiple contents, and avoid errors.

[0045] In addition, the template 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 software development companies to perform customized development based on report documents. 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

[0046] 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.

[0047] Figure 1 This is one of the flow charts of the template document generation method provided by the present invention;

[0048] Figure 2 This is the second flow chart of the template document generation method provided by the present invention;

[0049] Figure 3 It is a schematic diagram of the interface of the initial template document provided by the present invention;

[0050] Figure 4 It is a schematic diagram of the interface of the management background provided by the present invention;

[0051] Figure 5 This is one of the interface schematic diagrams of the preset configuration table provided by the present invention;

[0052] Figure 6 This is the second schematic diagram of the interface of the preset configuration table provided by the present invention;

[0053] Figure 7 It is a schematic diagram of the interface of the target template document provided by the present invention;

[0054] Figure 8 It is a schematic diagram of the interface of the document to be processed provided by the present invention;

[0055] Fig. 9 It is one of the interface schematic diagrams of the processed document provided by the present invention;

[0056] Fig.10 This is the second schematic diagram of the interface of the processed document provided by the present invention;

[0057] Fig.11 It is a structural schematic diagram of the template document generating device provided by the present invention;

[0058] Fig.12 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0059] 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.

[0060] In order to facilitate a clearer understanding of the embodiments of the present invention, some relevant background knowledge is first introduced as follows.

[0061] 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.

[0062] When users create documents that require content calculation, such as electronic test papers, online assessments, and electronic contracts, some key information in the documents often have a relationship of mutual calculation. For example, in scoring statistics documents, when the specified content is hit, the score is automatically calculated, and all scores are finally summarized; in contract documents, the monthly repayment amount is automatically calculated based on the loan amount and interest rate filled in. Users need to copy these data inputs into the table by themselves, or compare and calculate manually, which is not only time-consuming and labor-intensive, but also prone to errors.

[0063] For example, for a loan contract document, a user might go through the following steps:

[0064] (1) Open the loan contract document; (2) Fill in the loan term; (3) Fill in the loan amount; (4) Fill in the interest rate; (5) Use other tools to calculate the monthly repayment amount; (6) Fill in the monthly repayment amount.

[0065] When there are multiple loan contract documents with the same template, the above steps need to be repeated multiple times, which is time-consuming and error-prone.

[0066] Therefore, the present invention provides a template document generation method and device, which obtains structured fields corresponding to each text area by performing structured collection on multiple text areas with associated calculation relationships in the initial template document, matches the corresponding field algorithm for each structured field in the preset configuration table, and associates the initial template document with the preset configuration table to generate a target template document with content automatic calculation function, so that the composition and calculation relationship of key information in the target template document are fixed. When using the target template document to fill in new data, the calculation can be completed automatically, saving time for the user. The workload of users repeatedly calculating multiple data for aggregation is greatly reduced, and errors in human calculations are avoided, resulting in errors in the produced documents, that is, the possibility of errors in the process of calculating and filling data back and forth is reduced, which greatly improves the efficiency and accuracy of data aggregation.

[0067] Combine the following Figure 1-Figure 10 The template document generation method of the present invention is described.

[0068] Figure 1 This is one of the flow charts of the template document generation method provided by the present invention, see Figure 1 As shown, it includes steps 101 to 104, wherein:

[0069] Step 101: obtaining an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions.

[0070] First of all, it should be noted that the execution subject of the present invention can be any electronic device that generates a template document, for example, it can be any one of a smart phone, a smart watch, a desktop computer, a laptop computer, etc.

[0071] Specifically, a template refers to a fixed format for drawing or designing a plan. It can fix and standardize the structural rules of a thing, and is the standardization of the structural form. A template document refers to a document that carries a template, such as a document corresponding to a contract template, a document corresponding to a test paper, etc. An initial template document refers to a template document that cannot be automatically calculated based on the content in the document, that is, a template document that does not have an automatic calculation function.

[0072] The text area refers to the area in the document used to display text. The size of the document area can be the size of the area occupied by one character or the size of the area occupied by multiple characters, such as one line or two lines in the document. In addition, the text area can have corresponding text content or be empty.

[0073] The associated calculation relationship indicates that the text contents corresponding to the text areas are associated and need to be calculated with each other. For example, the text content corresponding to the first text area is the Chinese score, the text content corresponding to the second text area is the math score, and the text content corresponding to the third text area is the total score. The total score needs to add the Chinese score and the math score.

[0074] The initial template document is a text document, such as a Word document, a portable document format (PDF) document, a PPT (Power Point) document, and an open fixed-layout document (OFD) document, among which a Word document refers to an electronic document with the suffix ".doc" or ".docx".

[0075] In practical applications, there are many methods for obtaining an initial template document containing multiple text regions, which are not limited in the present invention.

[0076] Exemplarily, a user uploads an initial template document containing multiple text areas through an upload page provided by the report document generation platform, and accordingly, the execution subject obtains the initial template document containing multiple text areas.

[0077] Exemplarily, the execution subject receives a template document generation instruction or an initial template document acquisition instruction, and accordingly, the execution subject acquires the initial template document from the storage area pointed to by the template document generation instruction or the initial template document acquisition instruction.

[0078] Exemplarily, the execution subject receives a template document creation instruction, and accordingly, the execution subject creates a blank document, and in response to receiving a content filling instruction, displays the template content corresponding to the content filling instruction in the blank document, thereby obtaining a standby template document. Further, according to the received area selection instruction, multiple text areas are determined in the standby template document, thereby obtaining an initial template document.

[0079] It should be noted that if the obtained initial template document is a non-Word document, such as a PDF document, an OFD document, a PPT document, etc., the document format of the initial template document can be converted to obtain an initial template document in the Word document format.

[0080] Step 102: Perform structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions.

[0081] Specifically, structured fields, also known as keywords or keywords, refer to the index of some data, such as the keyword value Key-Value, where Key is a structured field and Value is specific data. Structured collection refers to the structural processing of the text content in the text area or the text content that needs to be filled in. For example, if a text area needs to be filled in with Chinese scores, the structured field corresponding to the text area, that is, Key is "Chinese scores", and the value corresponding to the Chinese scores is Value.

[0082] In actual applications, after obtaining an initial template document containing multiple text regions, each text region is further parsed and structured data is collected to obtain structured fields corresponding to each text region.

[0083] Exemplarily, semantic analysis may be performed on the corresponding title in the text region or the text content within a set range of the text region, thereby obtaining the structured fields corresponding to each text region.

[0084] Exemplarily, for each text area, a structured field input page is displayed, and the user inputs the structured field corresponding to the text area on the structured field input page, and each text area is traversed to obtain the structured field corresponding to each text area.

[0085] Step 103: In the preset configuration table, a corresponding field algorithm is matched for each of the structured fields.

[0086] Specifically, the preset configuration table is a table document used to configure structured fields, that is, a template for automatic field calculation. Field algorithm refers to the calculation method, calculation formula, etc. corresponding to the structured field, that is, the calculation rules followed by the text content in the text area. The preset configuration table is a table document, such as an Excel document, wherein the Excel document refers to an electronic document with the suffix ".xls" or ".xlsx".

[0087] In practical applications, after determining the structured fields corresponding to each text area, a preset configuration table is further obtained. The preset configuration table corresponding to the initial template document can be downloaded from a database, or a preset configuration table can be generated according to user operations.

[0088] Exemplarily, in response to a user's configuration table query instruction, multiple preset configuration tables or identifiers of preset configuration tables, such as names, identity numbers, etc., are displayed on the configuration table display page, and the user selects the corresponding preset configuration table on the configuration table display page for download. Accordingly, the execution entity receives the configuration table download instruction, wherein the configuration table download instruction carries the identifier of the preset configuration table, and then downloads the preset configuration table corresponding to the identifier from the database.

[0089] Exemplarily, the text content of the initial template document is parsed to determine the intent type of the initial template document, the intent type represents the intended function of the initial template document, and the intent types include content filling type, content calculation type and content association type, the content filling type represents filling the content of other documents into the document, the content calculation type represents automatic calculation of the content in the document, and the content association type represents associating the content in the document with the content of other documents. Then, a preset configuration table corresponding to the intent type of the initial template document is downloaded from the database.

[0090] Exemplarily, in response to a configuration table creation instruction from a user, a blank Excel document is created; a document setting instruction from the user is received, and content is filled in the blank Excel document according to the document setting instruction to obtain a preset configuration table.

[0091] Step 104: Associating the initial template document with the preset configuration table to generate a target template document.

[0092] Specifically, the target template document refers to a template document that can automatically calculate according to the content in the document, that is, a template document with an automatic calculation function.

[0093] In actual applications, on the basis of matching the corresponding field algorithms for each structured field, the preset configuration table containing the field algorithms that match the corresponding structured fields is associated with the initial template document, so that the contents in each text area in the initial template document can be automatically fielded according to the field algorithms that match the corresponding structured fields, and the target template document is obtained.

[0094] The template document generation method provided by the present invention performs structured collection on multiple text areas with associated calculation relationships in the initial template document to obtain structured fields corresponding to each text area, matches the corresponding field algorithm for each structured field in the preset configuration table, and associates the initial template document with the preset configuration table to generate a target template document with a content automatic calculation function, so that the composition and calculation relationship of key information in the target template document are fixed. When using the target template document to fill in new data, the calculation can be completed automatically, saving time for the user. The workload of users repeatedly calculating multiple data for aggregation is greatly reduced, and errors in human calculations are avoided, resulting in errors in the produced documents, that is, the possibility of errors in the process of calculating and filling data back and forth is reduced, and the efficiency and accuracy of data aggregation are greatly improved.

[0095] In one or more optional embodiments of the present invention, the preset configuration table includes a field name category and a field algorithm category. Accordingly, in the preset configuration table, a corresponding field algorithm is matched for each structured field. The specific implementation process may be as follows:

[0096] For each of the structured fields, fill in the field name of the structured field into the field name category;

[0097] A corresponding field algorithm is matched for the structured field in the field algorithm category, and the field name is associated with the field algorithm.

[0098] Specifically, the field name refers to the specific content corresponding to the structured field. For example, if the first structure field is "class", then the field name is "class". The field name category refers to a column or a row in the preset configuration table used to fill in the field name, that is, the column or row corresponding to the field name category, and its header is a text such as "field name". The rest of the column or row is used to fill in the field name of each structured field. The field algorithm category refers to a column or a row in the preset configuration table used to set the field algorithm, that is, the column or row corresponding to the field algorithm category, and its header is a text such as "field algorithm". The rest of the column or row is used to set the field name of each structured field.

[0099] In actual applications, except for the table header, each row or column in the preset configuration table corresponds to a structured field, so that the field name and field algorithm of the same structured field can be associated.

[0100] If all the table headers are in the same row, then in the preset configuration table, except for the table header, each row corresponds to a structured field. That is, when the field name category and the field algorithm category are in the same row, starting from the first structured field, the first row under the field name category and the field algorithm category corresponds to the first structured field, and the field name of the first structured field is filled in the column corresponding to the field name category in the first row, and the corresponding field algorithm is matched for the first structured field in the column corresponding to the field algorithm category in the first row. Then continue to start the second structured field, the second row under the field name category and the field algorithm category corresponds to the second structured field, and so on, until all structured fields are traversed.

[0101] If all the table headers are in the same column, then in the preset configuration table, except for the table header, each column corresponds to a structured field. That is, when the field name category and the field algorithm category are in the same column, starting from the first structured field, the first column on the right or left side of the column where the field name category and the field algorithm category are located corresponds to the first structured field, and the field name of the first structured field is filled in the row corresponding to the field name category in the first column, and the row corresponding to the field algorithm category in the first column matches the corresponding field algorithm for the first structured field. Then continue to start the second structured field, the second column on the right or left side of the field name category and the field algorithm category corresponds to the second structured field, and so on, until all structured fields are traversed.

[0102] In this way, the field name and field algorithm of the structured field will be associated and set in the preset configuration table. While achieving the calculation function, the smaller amount of data can reduce the computing power, thereby improving the efficiency of generating the target template document.

[0103] In one or more optional embodiments of the present invention, the preset configuration table includes a field identification category, a field name category, and a field algorithm category; accordingly, in the preset configuration table, a corresponding field algorithm is matched for each structured field, and the specific implementation process may be as follows:

[0104] For each of the structured fields, fill in the field identifier of the structured field into the field identifier category, and fill in the field name of the structured field into the field name category;

[0105] In the field algorithm category, a corresponding field algorithm is matched for the structured field, and the field identifier, the field name and the field algorithm are associated.

[0106] Specifically, the field name refers to the specific content corresponding to the structured field. The field name category refers to a column or a row in the preset configuration table used to fill in the field name. The field identifier, also known as the field ID (Identity Document), refers to the serial number corresponding to the structured field, which can uniquely represent the structured field. The field identifier category refers to a column or a row in the preset configuration table used to fill in the field representation, that is, the field identifier category corresponds to the column or row, and its header is a text such as "field identifier". The rest of the column or row is used to fill in the field identifier of each structured field. The field algorithm category refers to a column or a row in the preset configuration table used to set the field algorithm.

[0107] In actual applications, except for the table header, each row or column in the preset configuration table corresponds to a structured field, so that the field identifier, field name and field algorithm of the same structured field can be associated.

[0108] If all the table headers are in the same row, then in the preset configuration table, except for the table header, each row corresponds to a structured field. That is, when the field identification category, field name category, and field algorithm category are in the same row, starting from the first structured field, the first row under the field identification category, field name category, and field algorithm category corresponds to the first structured field, and the field identification of the first structured field is filled in the column corresponding to the field identification category in the first row, and the field name of the first structured field is filled in the column corresponding to the field name category in the first row, and the corresponding field algorithm is matched for the first structured field in the column corresponding to the field algorithm category in the first row. Then continue to start the second structured field, and the second row under the field identification category, field name category, and field algorithm category corresponds to the second structured field, and so on, until all structured fields are traversed.

[0109] If all the table headers are in the same column, then in the preset configuration table, except for the table header, each column corresponds to a structured field. That is, when the field identifier category, field name category, and field algorithm category are in the same column, starting from the first structured field, the first column on the right or left side of the column where the field identifier category, field name category, and field algorithm category are located corresponds to the first structured field, and the field identifier of the first structured field is filled in the row corresponding to the field name identifier category in the first column, and the field name of the first structured field is filled in the row corresponding to the field name category in the first column, and the corresponding field algorithm is matched for the first structured field in the row corresponding to the field algorithm category in the first column. Then continue to start the second structured field, and the second column on the right or left side of the field name category and field algorithm category corresponds to the second structured field, and so on, until all structured fields are traversed.

[0110] In this way, under the field identification category, field name category and field algorithm category of the preset configuration table, field identification and field name are added respectively, and the field algorithm is set. The field identification can be associated with the text area, and the field name can enable users to clearly identify the structured field. The field algorithm can be used to give the structured field or text area the function of automatic calculation, and based on the association between the field identification, field name and field algorithm, the accuracy of the calculation function of the target template document is improved.

[0111] Optionally, the preset configuration table may only include the categories related to content calculation, such as field identification category, field name category and field algorithm category, and may also include some functional categories, such as calculation category and modification category. That is, the preset configuration table also includes calculation category and modification category, the calculation category indicates whether automatic calculation is allowed, and the modification category indicates whether modification is allowed; accordingly, after matching the corresponding field algorithm for the structured field in the field algorithm category, it also includes:

[0112] For each of the structured fields, a corresponding calculation type is matched for the structured field in the calculation category, and a corresponding modification type is matched for the structured field in the modification category.

[0113] Specifically, the calculation category, that is, the automatic calculation category, indicates whether the text content of the text area is automatically calculated or manually filled in by the user. The modification category, that is, the user modification type, indicates whether the text content of the text area allows the user to modify it.

[0114] The calculation type indicates whether the text content in the text area corresponding to the structured field can be automatically calculated. It includes two types: yes and no. Yes indicates that automatic calculation is allowed, and no indicates that automatic calculation is not allowed. Yes can be represented by 1, and no can be represented by 0, or other content.

[0115] The modification type indicates whether the text content in the text area corresponding to the structured field can be modified by the user. It also includes two types: yes and no. Yes indicates that the user is allowed to modify it, and no indicates that the user is not allowed to modify it. Yes can be represented by 1, and no can be represented by 0, or represented by other content.

[0116] In actual applications, for each structured field, the calculation type and modification type corresponding to the structured field can also be set, that is, the calculation type and modification type of the structured field are filled in the area (row or column) corresponding to the structured field, and the calculation type is filled in under the calculation category, and the modification type is filled in under the modification category. In this way, the text area that needs to be automatically calculated can be set through the calculation type, and some important content can be set as a part that cannot be modified by the user through the modification type, avoiding errors in the document content. While realizing the automatic calculation of the target template document content, it can also improve personalized design and thus improve user stickiness.

[0117] It should be noted that the calculation type and modification type can be configured by the user in the preset configuration table, for example, receiving a configuration instruction for the structured field, the configuration instruction carrying the calculation type and / or modification type; according to the calculation type and / or modification type, setting the calculation type for the structured field in the calculation category, and / or setting the modification type for the structured field in the modification category. It can also be configured by the execution subject itself, for example, performing semantic analysis on the field name of the structured field to obtain semantic information, and determining the calculation type and / or modification type of the structured field according to the semantic information.

[0118] In addition, the preset configuration table may also include a field content category, the field content category indicates whether the field content is a numerical value, and accordingly, after matching the corresponding field algorithm for the structured field in the field algorithm category, it also includes: for each structured field, matching the corresponding field content type for the structured field in the field content representation, and matching the corresponding field content type for the structured field in the modification category. Field content types include text and numerical values.

[0119] In an optional embodiment of the present invention, the user may set a field algorithm for the structured field. That is, the corresponding field algorithm is matched for the structured field in the field algorithm category. The specific implementation process may be as follows:

[0120] receiving an algorithm input instruction for the structured field, wherein the algorithm input instruction carries an algorithm identifier;

[0121] In the field algorithm category, the field algorithm corresponding to the algorithm identifier is matched with the structured field.

[0122] Specifically, the algorithm input instruction refers to the instruction for the user to set the field algorithm for the structured field. The algorithm identifier refers to the unique identifier that represents the algorithm of a certain field.

[0123] In actual applications, the preset configuration table is displayed on a display, so that the user can input the field algorithm for the current structured field in the preset configuration table through an external device, such as a mouse, keyboard or stylus, such as selecting the cell corresponding to the current structured field under the field algorithm category, and then selecting a field algorithm from the algorithm library for the cell, or inputting a field algorithm in the algorithm editing window corresponding to the cell. Accordingly, the execution subject receives the algorithm input instruction for the current structured field, and matches the field algorithm corresponding to the algorithm input instruction with the current structured field in the field algorithm category: if the algorithm input instruction carries an algorithm identifier, obtain the field algorithm corresponding to the algorithm identifier, and match the field algorithm with the current structured field in the field algorithm category; if the algorithm input instruction carries a field algorithm, directly match the field algorithm with the current structured field in the field algorithm category.

[0124] In this way, configuring the field algorithm of the structured field according to the algorithm input instructions can not only improve the configuration success rate of the field algorithm, but also perform personalized structured collection according to user needs, thereby promoting human-computer interaction.

[0125] In another optional embodiment of the present invention, in order to improve intelligence, the execution subject can also automatically configure the field algorithm for the structured field without manual intervention. That is, the corresponding field algorithm is matched for the structured field in the field algorithm category, and the specific implementation process can be as follows:

[0126] Performing semantic recognition on each of the field names under the field name category to obtain a recognition result;

[0127] Determine the calculation relationship between the field names according to the recognition result;

[0128] In the field algorithm category, the field algorithm corresponding to the calculation relationship is matched with the structured field.

[0129] Specifically, semantic recognition is an important part of natural language processing (NLP) technology. Semantic recognition requires not only understanding the meaning of text words, but also understanding the meaning of the words in sentences and chapters. That is, semantic recognition should technically achieve: semantic analysis and ambiguity elimination at the level of text, vocabulary, syntax, morphology, and chapter (paragraph), as well as corresponding meaning reorganization to achieve the purpose of recognition itself. The recognition result is the result of semantic recognition, that is, semantic information.

[0130] In actual applications, semantic recognition is first performed on the field name of each structured field, that is, semantic recognition is performed on each field name under the field name category to obtain the recognition result, and then the calculation relationship between the field names is determined based on the recognition result, and then the corresponding field algorithm is obtained based on the calculation relationship, and the field algorithm is matched with the structured field in the field algorithm category.

[0131] Exemplarily, the template document is a template for a student's grades in various subjects, and has twelve structured fields, among which the field name of the first structured field is "Chinese grade", the field name of the second structured field is "Mathematics grade", the field name of the third structured field is "Foreign language grade", the field name of the fourth structured field is "Biology grade", the field name of the fifth structured field is "Chemistry grade", the field name of the sixth structured field is "Physics grade", the field name of the seventh structured field is "History grade", the field name of the eighth structured field is "Politics grade", the field name of the ninth structured field is "Geography grade", the field name of the tenth structured field is "Total score for liberal arts", the field name of the eleventh structured field is "Total score for science", and the field name of the twelfth structured field is "Total score".

[0132] After semantic recognition of the twelve field names mentioned above, the semantic results are as follows: "Total science score" includes "biology score", "chemistry score" and "physics score", "Total liberal arts score" includes "history score", "politics score" and "geography score", and "total score" includes "total liberal arts score", "total science score", "Chinese score", "mathematics score" and "foreign language score". It can be determined that the calculation relationship corresponding to the tenth structured field is "total score of science = biology score + chemistry score + physics score", the calculation relationship corresponding to the eleventh structured field is "total score of liberal arts = history score + political score + geography score", and the calculation relationship corresponding to the twelfth structured field is "total score = total score of liberal arts + total score of science", the calculation relationship corresponding to the first structured field is "Chinese score = input value", the calculation relationship corresponding to the second structured field is "mathematics score = input value", the calculation relationship corresponding to the third structured field is "foreign language score = input value", the calculation relationship corresponding to the fourth structured field is "biology score = input value", the calculation relationship corresponding to the fifth structured field is "chemistry score = input value", the calculation relationship corresponding to the sixth structured field is "physics score = input value", the calculation relationship corresponding to the seventh structured field is "history score = input value", the calculation relationship corresponding to the eighth structured field is "political score = input value", and the calculation relationship corresponding to the ninth structured field is "geography score = input value", where the input value is the text content entered in the text area.

[0133] Furthermore, in the field algorithm category, the corresponding field algorithm is matched for each structured field according to the calculation relationship corresponding to each structured field, that is, for each structured field, the field algorithm corresponding to the calculation relationship corresponding to the structured field is matched with the structured field. In this way, by semantically identifying the field name, the structured field that can be calculated and the corresponding field algorithm are automatically determined, so that the user does not need to configure, which not only reduces the user's workload, but also avoids the problem of manual configuration prone to errors and improves the efficiency of field algorithm configuration, thereby improving the efficiency of generating the target template document and the reliability of the target template document.

[0134] After the target template document is generated, the target template document can be used to create corresponding statistical documents (content calculation documents). For example, if the target template document is mainly used for grade statistics, a transcript can be created based on the target template document. If the target template document is mainly used for repayment calculation per period, a loan contract can be created based on the target template document. That is, after the target template document is associated with the preset configuration table and the target template document is generated, it also includes:

[0135] Acquire a document to be processed, wherein the document to be processed is obtained by filling text into the target template document;

[0136] Identifying the text content of each text area in the document to be processed;

[0137] Calculate each text content according to the field algorithm corresponding to each text area to obtain a calculated value;

[0138] The calculated value is added to the text area corresponding to the calculated value to obtain a processed document.

[0139] Specifically, the document to be processed refers to the document obtained after filling the text content in the target template document. Then read the text content of each text area of ​​the document to be processed, and for each text area, calculate the calculated value of the text area according to the field algorithm corresponding to the text area and the text content of each text area, and add the calculated value to the text area. It should be noted that if there is text content in the text area, the calculated value is used to replace the text content, or the calculated value is compared with the text content to see if they are the same. If they are the same, they are not processed. If they are different, the text content is replaced with the calculated value; if there is no text content in the text area, the calculated value is added to the text area. Traverse each text area to obtain the processed document.

[0140] Continuing with the above example, the text to be processed is the transcript to be processed. The field name corresponding to the first text area is "Chinese score", the field name corresponding to the second text area is "Mathematics score", the field name corresponding to the third text area is "Foreign language score", the field name corresponding to the fourth text area is "Biology score", the field name corresponding to the fifth text area is "Chemistry score", the field name corresponding to the sixth text area is "Physics score", the field name corresponding to the seventh text area is "History score", the field name corresponding to the eighth text area is "Politics score", the field name corresponding to the ninth text area is "Geography score", the field name corresponding to the tenth text area is "Total score for liberal arts", the field name corresponding to the eleventh text area is "Total score for science", and the field name corresponding to the twelfth text area is "Total score".

[0141] Among them, the text contents corresponding to the first to ninth text areas are 10, 20, 30, 40, 50, 60, 70, 80 and 90 respectively, the text contents corresponding to the tenth and eleventh text areas are empty, and the text content corresponding to the twelfth text area is 0. According to the field algorithm corresponding to each text area, the calculated values ​​corresponding to the first to tenth text areas are 10, 20, 30, 40, 50, 60, 70, 80, 90, 150, 240 and 450 respectively, then fill 150 into the tenth text area, fill 25 into the eleventh text area, and change the 0 in the twelfth text area to 450, thereby obtaining the processed transcript.

[0142] In this way, the target template document is used to prepare the document to be processed, and the content is automatically calculated through the field algorithm corresponding to each text area in the target template document, so as to quickly obtain the processed document.

[0143] Optionally, the target template document can be displayed to the user, and the user can fill in the text in the target template document to obtain the document to be processed. That is, the specific implementation process of obtaining the document to be processed can be as follows:

[0144] In response to the text filling instruction for the target template document, the target template document is filled with text to obtain a document to be processed.

[0145] Specifically, the text filling instruction refers to an instruction for editing text in the target template document, such as adding text and modifying text.

[0146] In actual applications, after the target template document is generated, the target template document can be fed back to the user, and the user can share the target template document with other users or use it by the user. The present invention does not limit this.

[0147] Furthermore, the target template document is displayed on the display, and the template user (any user) edits the text content in the target template document through an external device, such as a mouse or keyboard, or edits the text content in the target template document by sliding a finger or a stylus on a touch screen. Accordingly, the execution subject receives the text filling instruction, responds to the text filling instruction, and edits the content of the target template document according to the content indicated by the text filling instruction, that is, fills in the text, to obtain a document to be processed.

[0148] In this way, the key information (text area) in the target template document is structured, and the calculation relationship between different structured fields is configured in the background system. When filling in the content in the target template document, the final result is automatically calculated and filled in the specified position. This can not only allow users to personalize the text content of the target template document, but also promote human-computer interaction.

[0149] Optionally, a content reference document may be obtained, and the content may be captured from the content reference document to fill in the target template document with text, thereby obtaining a document to be processed. That is, the specific implementation process of obtaining the document to be processed may be as follows:

[0150] Obtain a content reference document; extract text content corresponding to each text area in the target template document from the content reference document, and perform text filling to obtain a document to be processed.

[0151] Specifically, the content reference document may be a document in any format, such as a PDF format, a picture format, etc. The content reference document includes information that needs to be filled in or reflected in the target template document.

[0152] In actual application, the execution subject first obtains at least one content reference document. The content reference document can be uploaded by the user. When receiving the instruction to construct the document to be processed, the content reference document uploaded by the user is read; the content reference document can be periodically obtained from the document repository. It can also be other, and the present invention does not impose any limitation on this. Further, the text content corresponding to each text area in the target template document is extracted from the content reference document and filled in, so as to obtain the document to be processed.

[0153] For example, the reference document records "loan amount: 1,000 yuan", "loan duration: 30 days" and "loan interest: 1%". The first text area and the third text area of ​​the target template document are used to fill in "loan amount", "loan duration" and "loan interest" respectively, then "1,000 yuan" is filled in the first text area, "30 days" is filled in the second text area, and "1%" is filled in the third text area.

[0154] In one or more optional embodiments of the present invention, the structured collection of each of the text regions is performed to obtain the structured fields corresponding to each of the text regions. The specific implementation process may be as follows:

[0155] For each text region, a semantic analysis is performed on the text content corresponding to the text region to obtain a semantic analysis result, and a corresponding structured field is matched for the text region according to the semantic analysis result.

[0156] Specifically, the text content corresponding to the text area may be a title corresponding to the text area, may be text content contained in the text area, or may be text content within a set range corresponding to the text area.

[0157] In actual applications, the execution subject can perform semantic analysis on the text content corresponding to each text area to obtain the semantic analysis result of the text content, and then select the initial structured field with the greatest semantic similarity to the semantic analysis result from the structured field library according to the semantic analysis result as the structured field corresponding to the text area, wherein the structured field library contains multiple initial structured fields, or directly use the field corresponding to the semantic analysis result as the structured field corresponding to the text area. In this way, based on the semantic analysis of the text content and matching the structured field based on the semantic analysis result, the efficiency of structured acquisition and the accuracy of the matched structured fields can be improved.

[0158] Exemplarily, the semantic analysis result is a keyword, that is, for each text region, a semantic analysis is performed on the text content corresponding to the text region to obtain the keyword of the text content, and the corresponding structured field is matched for the text region according to the keyword.

[0159] In one or more optional embodiments of the present invention, the structured collection of each of the text regions is performed to obtain the structured fields corresponding to each of the text regions. The specific implementation process may be as follows:

[0160] receiving a user's field setting instruction for a designated text area, wherein the designated text area is any designated text area;

[0161] The structured field carried by the field setting instruction is used as the structured field corresponding to the designated text area.

[0162] In actual applications, users can set structured fields for each text area, such as inputting a structured field corresponding to a text area on a structured field input page. Correspondingly, the execution subject receives a field setting instruction carrying a structured field, and uses the structured field in the field setting instruction as the structured field corresponding to the text area. In this way, setting structured fields for text areas based on the user's wishes can improve the humanization of structured collection and thus improve user satisfaction.

[0163] In one or more optional embodiments of the present invention, the initial template document is associated with the preset configuration table to generate a target template document, and the specific implementation process may be as follows:

[0164] For each of the text areas in the initial template document, the text area is associated with a field algorithm corresponding to a specified structured field in the preset configuration table to obtain a target template document, wherein the specified structured field is a structured field corresponding to the text area.

[0165] In actual applications, on the basis of matching the corresponding field algorithm for each structured field, the preset configuration table containing the field algorithm corresponding to each structured field is associated with the initial template document: for each text area, the text area is associated with the field algorithm of the structured field corresponding to the text area in the preset configuration table. All text areas are traversed so that the content in each text area in the initial template document can be automatically fielded according to the field algorithm corresponding to each structured field, and the target template document is obtained. In this way, by associating each text area, the accuracy of calculation and filling of the target template document can be improved.

[0166] For example, the target template document is used as the evaluation template document, and combined with Figure 2-Figure 10 The method for generating the target template document is described below. Figure 2 , Figure 2 This is the second flow chart of the template document generation method provided by the present invention, which mainly includes three stages: the first stage - the content structuring of the document, the second stage - the association import of the structured fields and the table formulas, and the third stage - the document reading calculation rules and completing the summary calculation.

[0167] Phase 1 - Structuring the content of the document:

[0168] 1. In the initial template document, select multiple text areas, convert them into structured fields, and generate field IDs, that is, the organization manager opens the document and performs structured collection.

[0169] See also Figure 3 , Figure 3It is a schematic diagram of the interface of the initial template document provided by the present invention. Open the initial template document of the admission assessment, and open the structured configuration function panel, that is, display the interface, which includes a menu bar, a structured editing window, the name of the initial template document, the specific content of the initial template document (as shown in the text 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, a batch add area, and a field management area. The insert field area includes a word insertion control and multiple fields (such as text, pictures, time, values, names, etc.). After the word insertion control is turned on, the user selects a text area in the initial template document for structured collection. After the word insertion control is turned off, the execution subject automatically performs structured collection on the text area of ​​the initial template document. The batch add area includes a full-text parsing control and multiple addable contents, such as icons, paragraphs, pictures, and tables. After the full-text parsing control is turned on, all text contents of the initial template document need to be parsed and added. After the full-text parsing control is turned off, no content is added. The field management area includes multiple structured fields collected from text areas. These structured fields are obtained by converting all calculation-related content (text areas) in the initial target document using word marking or controls, such as consciousness level, gaze, language and total score.

[0170] It should be noted that by clicking the setting icon behind a structured field (such as language), the structured field can be edited, and by clicking the delete icon behind a structured field (such as total score), the structured field can be deleted.

[0171] Phase 2 - Importing the association between structured fields and table formulas:

[0172] 2. Open the general table document (xlsx format), that is, the preset configuration table, and organize and manage the calculation relationship (field algorithm) between different structured fields through the table's formula capabilities.

[0173] You can download the preset configuration table first, and then set the calculation relationship based on the preset configuration table. Figure 4 , Figure 4It is a schematic diagram of the interface of the management background provided by the present invention. In the management background interface, select field management under document structuring. In the field management area, you can search, such as entering the field name to be searched (i.e., the search term) in the search box to find the corresponding preset configuration table, and you can also view it by clicking on the pre-set preset configuration table, such as content filling (batch content filling) and content calculation (field automatic calculation), etc., and batch association of preset content. There are also multiple fields for prompts below the field management area. After clicking on content calculation, a preset configuration table for content calculation pops up, including serial number, field ID, field name, field algorithm, calculation and modification, etc., and the preset configuration table is downloaded through the download template control. When the preset configuration table searched does not exist, the page will display the words "No content calculation, please upload a template". In addition, document structuring also includes template management and content management.

[0174] See also Figure 5 , Figure 5 It is one of the interface schematic diagrams of the preset configuration table provided by the present invention. The preset configuration table is an Excel document. Open the preset configuration table and configure the field algorithm, that is, display the interface, which includes a menu bar, a field algorithm configuration bar, the name of the preset configuration table, the specific content of the preset configuration table (as shown in the text and data in the cells), Table 1 and Table 2 under the preset configuration table (the current interface displays Table 1), minimize controls, maximize controls, close controls, and document display parameters, such as zoom factor, view type, etc. Among them, the field algorithm configuration bar includes a hit cell and a field algorithm selection area. When the value of any scoring score is greater than 0, the total score is 10 points, otherwise 0 points, and the field algorithm "fx=IF(SUM(D3:D5)>0,10,0)" is entered in the field algorithm category cell "D2" corresponding to the total score. In the preset configuration table, AF is used as the row label and 1-6 is used as the column label. The first row displays the table header: Field ID, Field Name, Field Content, Field Algorithm, Calculation and Modification, indicating that column A is the field ID category, column B is the field content category, column C is the field name category, column D is the field algorithm category, column E is the calculation category, and column F is the modification category. One row corresponds to one structured field, and the field ID, field name, field content, field algorithm, calculation and modification corresponding to each structured field are filled in.

[0175] For example, the field ID of the first structured field is c_t_1, the field name is total score, the field content is a number (the content corresponding to the total score is a number), the field algorithm is "fx=IF(SUM(D3:D5)>0, 10, 0)" (0 under the field algorithm category indicates that the text content corresponding to the total score is 0), the calculation type is yes (automatic calculation is allowed), and the modification type is no (the user is not allowed to modify the text content corresponding to the total score).

[0176] For example, the field ID of the fifth structured field is c_t_5, the field name is language text, the field content is text (the content corresponding to the total score is text), the field algorithm is not displayed, the calculation type is yes (allow automatic calculation), and the modification type is yes (allow the user to modify the text content corresponding to the language text).

[0177] In addition, there are the second to fourth structured fields, whose field IDs are c_t_2 to c_t_4, respectively. The field names are consciousness level, gaze, and language, respectively. The field contents are all text, the field algorithms are not displayed, the calculation types are all yes, and the modification types are all yes.

[0178] In addition to using numerical values ​​for calculations, field algorithms can also use text to calculate and determine the score by entering text. Figure 5 Based on Figure 6 , Figure 6 This is the second interface diagram of the preset configuration table provided by the present invention: the field algorithm of the "language" structured field. When the content of cell "D6" is "aphasia", that is, the language text is aphasia, the value or score corresponding to "language" is 1, otherwise it is 0. For cell D5, the field algorithm "fx=IF(D6="aphasia", 10, 0)" can be set to support all table formula calculation capabilities.

[0179] 3. Import the table in the background management interface.

[0180] See also Figure 4 After completing the field algorithm configuration, upload the preset configuration table through the upload template control of the background management interface to associate the preset configuration table with the initial template document to obtain the target template document.

[0181] Phase 3 - Document reads calculation rules and completes summary calculations:

[0182] 4. Share the target template document with other users for filling in, that is, the organization administrator shares the document with the document editor.

[0183] See also Figure 7 , Figure 7It is a schematic diagram of the interface of the target template document provided by the present invention: open the target template document and trigger sharing, that is, display the interface, which includes a menu bar, the name of the target template document, the specific content of the target template document (as shown in the text in the document), a sharing window, a minimize control, a maximize control, a close control, and document display parameters. Among them, the sharing window can invite others to join the sharing, such as displaying icons of multiple applications, and opening the application by clicking the icon to invite others to join the sharing; the link "***********" of the target template document is displayed in the sharing window, and the "copy link" control can be clicked to copy the link and share the target template document. The sharing window can also select the person you want to share with, and you can use the method of "searching user name, mobile phone number, adding collaborators", such as the searched user A and user B, by triggering the selection control of user A and user B, to add, where user A is the creator of the target template document and user B can edit the target template document; you can also select the person you want to share with through the address book. By triggering the selection control before "people who have joined sharing", you can view the users who have been shared, and you can set permissions for "people who have joined sharing" through advanced settings.

[0184] 5. Other users fill in the relevant data of the fields to be calculated, that is, the document editor (the user being shared) enters the content.

[0185] See also Figure 8 , Figure 8 This is a schematic diagram of the interface of the document to be processed provided by the present invention: the editor opens the target template document, fills in the text, obtains the document to be processed, and displays the interface, which includes a menu bar, the name of the document to be processed, the specific content of the document to be processed (as shown in the text in the document), a sharing window, a minimize control, a maximize control, a close control, document display parameters, and a digital control panel. For example, the score after "Sharp Reaction" is edited through the digital control panel, and 3 is selected in the digital control panel, then the score after "Sharp Reaction" becomes 3, and after clicking the "Confirm" control in the digital control panel, it is determined that the score after "Sharp Reaction" is 3.

[0186] 6. The document automatically generates the calculation results of the summary fields, that is, the set field algorithm automatically takes effect, the corresponding text content automatically calculates the results, and generates the processed document.

[0187] exist Figure 8 Based on Fig. 9 , Fig. 9This is one of the interface diagrams of the processed document provided by the present invention: the editor edits the score corresponding to "Consciousness level: awake, sharp reaction:" to 3 in the document to be processed, then according to "fx=IF(SUM(D3:D5)>0,10,0)", the score corresponding to the total score automatically becomes 10, and the processed document is obtained.

[0188] exist Figure 8 Based on Fig.10 , Fig.10 This is the second interface diagram of the processed document provided by the present invention: the editor edits the language text corresponding to "Language:" in the document to be processed to "Aphasia", then according to "fx=IF(D6="Aphasia", 10, 0)" and "fx=IF(SUM(D3:D5)>0, 10, 0)", the score corresponding to the total score automatically becomes 10, and the processed document is obtained.

[0189] The template document generating device provided by the present invention is described below. The template document generating device described below and the template document generating method described above can be referenced to each other.

[0190] Fig.11 is a schematic diagram of the structure of the template document generating device provided by the present invention, such as Fig.11 As shown, the template document generating device 1100 includes: a first acquisition module 1101, a structured acquisition module 1102, a first matching module 1103 and a generating module 1104, wherein:

[0191] The first acquisition module 1101 is configured to acquire an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions;

[0192] The structured collection module 1102 is configured to perform structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions;

[0193] The first matching module 1103 is configured to match a corresponding field algorithm for each structured field in a preset configuration table;

[0194] The generating module 1104 is configured to associate the initial template document with the preset configuration table to generate a target template document.

[0195] The template document generation device provided by the present invention performs structured collection of multiple text areas with associated calculation relationships in the initial template document to obtain structured fields corresponding to each text area, matches the corresponding field algorithm for each structured field in the preset configuration table, and associates the initial template document with the preset configuration table to generate a target template document with content automatic calculation function, so that the composition and calculation relationship of key information in the target template document are fixed. When using the target template document to fill in new data, the calculation can be completed automatically, saving time for the user. The workload of users repeatedly calculating multiple data for aggregation is greatly reduced, and errors in human calculations are avoided, resulting in errors in the produced documents, that is, the possibility of errors in the process of calculating and filling data back and forth is reduced, and the efficiency and accuracy of data aggregation are greatly improved.

[0196] Optionally, the preset configuration table includes a field identification category, a field name category and a field algorithm category;

[0197] Accordingly, the first matching module 1103 is further configured to:

[0198] For each of the structured fields, fill in the field identifier of the structured field into the field identifier category, and fill in the field name of the structured field into the field name category;

[0199] In the field algorithm category, a corresponding field algorithm is matched for the structured field, and the field identifier, the field name and the field algorithm are associated.

[0200] Optionally, the preset configuration table further includes a calculation category and a modification category, the calculation category indicates whether automatic calculation is allowed, and the modification category indicates whether modification is allowed;

[0201] Accordingly, the device further includes a second matching module, which is configured to:

[0202] For each of the structured fields, a corresponding calculation type is matched for the structured field in the calculation category, and a corresponding modification type is matched for the structured field in the modification category.

[0203] Optionally, the first matching module 1103 is further configured to:

[0204] receiving an algorithm input instruction for the structured field, wherein the algorithm input instruction carries an algorithm identifier;

[0205] In the field algorithm category, the field algorithm corresponding to the algorithm identifier is matched with the structured field.

[0206] Optionally, the first matching module 1103 is further configured to:

[0207] Performing semantic recognition on each of the field names under the field name category to obtain a recognition result;

[0208] Determine the calculation relationship between the field names according to the recognition result;

[0209] In the field algorithm category, the field algorithm corresponding to the calculation relationship is matched with the structured field.

[0210] Optionally, the device further comprises:

[0211] A second acquisition module is configured to acquire a document to be processed, wherein the document to be processed is obtained by filling text into the target template document;

[0212] A recognition module, configured to recognize text content of each text area in the document to be processed;

[0213] A calculation module, configured to calculate each of the text contents according to the field algorithm corresponding to each text area to obtain a calculated value;

[0214] The adding module is configured to add the calculated value to the text area corresponding to the calculated value to obtain a processed document.

[0215] Optionally, the second acquisition module is further configured to:

[0216] In response to a text filling instruction for the target template document, fill in the text of the target template document to obtain a document to be processed; or;

[0217] Obtain a content reference document; extract text content corresponding to each text area in the target template document from the content reference document, and perform text filling to obtain a document to be processed.

[0218] Optionally, the structured acquisition module 1102 is further configured to:

[0219] For each text region, a semantic analysis is performed on the text content corresponding to the text region to obtain a semantic analysis result, and a corresponding structured field is matched for the text region according to the semantic analysis result.

[0220] Optionally, the generating module 1104 is further configured to:

[0221] For each of the text areas in the initial template document, the text area is associated with a field algorithm corresponding to a specified structured field in the preset configuration table to obtain a target template document, wherein the specified structured field is a structured field corresponding to the text area.

[0222] 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 template document generation method, which includes: obtaining an initial template document containing multiple text regions, wherein there is an associated calculation relationship between the multiple text regions; performing structured collection on each of the text regions to obtain a structured field corresponding to each of the text regions; matching a corresponding field algorithm for each of the structured fields in the preset configuration table; and associating the initial template document with the preset configuration table to generate a target template document.

[0223] 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.

[0224] On the other hand, the present invention also provides a computer program product, which includes a computer program. 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 template document generation method provided by the above-mentioned methods, and the method includes: obtaining an initial template document containing multiple text areas, and there is an associated calculation relationship between the multiple text areas; performing structured collection on each of the text areas to obtain structured fields corresponding to each of the text areas; matching the corresponding field algorithm for each of the structured fields in the preset configuration table; and associating the initial template document with the preset configuration table to generate a target template document.

[0225] 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 template document generation method provided by the above-mentioned methods, the method comprising: obtaining an initial template document comprising multiple text areas, wherein there is an associated calculation relationship between the multiple text areas; performing structured collection on each of the text areas to obtain structured fields corresponding to each of the text areas; matching a corresponding field algorithm for each of the structured fields in a preset configuration table; and associating the initial template document with the preset configuration table to generate a target template document.

[0226] 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.

[0227] 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.

[0228] 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 template document generation method, characterized in that: include: Acquire an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions; Performing structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions; In the preset configuration table, matching a corresponding field algorithm for each of the structured fields; The initial template document is associated with the preset configuration table to generate a target template document.

2. The template document generation method according to claim 1, characterized in that: The preset configuration table includes a field identification category, a field name category and a field algorithm category; Accordingly, in the preset configuration table, the corresponding field algorithm is matched for each structured field, including: For each of the structured fields, fill in the field identifier of the structured field into the field identifier category, and fill in the field name of the structured field into the field name category; In the field algorithm category, a corresponding field algorithm is matched for the structured field, and the field identifier, the field name and the field algorithm are associated.

3. The template document generation method according to claim 2, characterized in that: The preset configuration table also includes a calculation category and a modification category, wherein the calculation category indicates whether automatic calculation is allowed, and the modification category indicates whether modification is allowed; Accordingly, after matching the corresponding field algorithm for the structured field in the field algorithm category, the method further includes: For each of the structured fields, a corresponding calculation type is matched for the structured field in the calculation category, and a corresponding modification type is matched for the structured field in the modification category.

4. The template document generation method according to claim 2, characterized in that: The matching of the corresponding field algorithm for the structured field in the field algorithm category includes: receiving an algorithm input instruction for the structured field, wherein the algorithm input instruction carries an algorithm identifier; In the field algorithm category, the field algorithm corresponding to the algorithm identifier is matched with the structured field.

5. The template document generation method according to claim 2, characterized in that: The matching of the corresponding field algorithm for the structured field in the field algorithm category includes: Performing semantic recognition on each of the field names under the field name category to obtain a recognition result; Determine the calculation relationship between the field names according to the recognition result; In the field algorithm category, the field algorithm corresponding to the calculation relationship is matched with the structured field.

6. The template document generation method according to claim 1, characterized in that: After associating the initial template document with the preset configuration table to generate a target template document, the process further includes: Acquire a document to be processed, wherein the document to be processed is obtained by filling text into the target template document; Identifying the text content of each text area in the document to be processed; Calculate each text content according to the field algorithm corresponding to each text area to obtain a calculated value; The calculated value is added to the text area corresponding to the calculated value to obtain a processed document.

7. The template document generation method according to claim 6, characterized in that: The step of obtaining the document to be processed includes: In response to a text filling instruction for the target template document, fill in the text of the target template document to obtain a document to be processed; or; Obtain a content reference document; extract text content corresponding to each text area in the target template document from the content reference document, and perform text filling to obtain a document to be processed.

8. The template document generation method according to claim 1, characterized in that: The performing structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions includes: For each text region, a semantic analysis is performed on the text content corresponding to the text region to obtain a semantic analysis result, and a corresponding structured field is matched for the text region according to the semantic analysis result.

9. The template document generation method according to claim 1, characterized in that: The step of associating the initial template document with the preset configuration table to generate a target template document includes: For each of the text areas in the initial template document, the text area is associated with a field algorithm corresponding to a specified structured field in the preset configuration table to obtain a target template document, wherein the specified structured field is a structured field corresponding to the text area.

10. A template document generating device, characterized in that: include: A first acquisition module is configured to acquire an initial template document including a plurality of text regions, wherein there is an associated calculation relationship between the plurality of text regions; A structured collection module is configured to perform structured collection on each of the text regions to obtain structured fields corresponding to each of the text regions; A first matching module is configured to match a corresponding field algorithm for each of the structured fields in a preset configuration table; The generating module is configured to associate the initial template document with the preset configuration table to generate a target template document.