Document generation method, device, computer equipment and computer readable storage medium
By obtaining document type and template information, querying the tag library and generating documents, the problem of low document generation efficiency is solved, the efficiency and accuracy of document generation are achieved, and a complete tag library is formed, suitable for the generation of legal documents.
Patent Information
- Application Number
- CN202010859282.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-08-24
AI Technical Summary
The efficiency of document generation in the existing technology is low, and the efficiency of document generation needs to be improved.
By obtaining document type and template information, querying the preset tag library, receiving tag values, and generating documents based on the target template and tag values, avoiding the need to enter tags and templates each time a document is generated, using regular expressions and POI component technology to process text Replace, incrementally update the tag library to improve efficiency.
It has improved the efficiency of document generation, reduced the repeated entry of tags and templates, improved the speed and accuracy of document generation, and formed a more complete tag library, suitable for the generation of court and other legal documents.
Smart Images

Figure CN112001158B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a document generation method, device, computer equipment and computer-readable storage medium. Background Art
[0002] Documents are legal documents used by courts, procuratorates, public security departments, etc. to handle litigation and non-litigation cases. Various departments, organizations, and structures need to generate a large number of documents.
[0003] Currently, the efficiency of document generation is low, and how to improve the efficiency of document generation has become a problem to be solved. Summary of the invention
[0004] In view of the above, it is necessary to propose a document generation method, apparatus, computer device and computer-readable storage medium, which can improve the efficiency of document generation.
[0005] A first aspect of the present application provides a document generation method, the document generation method comprising:
[0006] Obtain the document type and template information of the target document;
[0007] Querying a target tag from a preset tag library according to the document type and the template information;
[0008] Acquire a target template according to the document type and the template information;
[0009] Receiving a label value of the target label;
[0010] Determining a designated tag corresponding to the target tag from the target template;
[0011] The target document is generated according to the target template, the label value of the target label, and the designated label.
[0012] In another possible implementation, querying a target tag from a preset tag library according to the document type and the template information includes:
[0013] Generate a first regular expression according to the document type and the template information;
[0014] The target tag is queried according to the first regular expression.
[0015] In another possible implementation, the document generation method further includes:
[0016] Receive standard templates;
[0017] Determine the tags in the standard template that are inconsistent with the preset tag library as newly added tags;
[0018] The newly added tag is updated to the preset tag library.
[0019] In another possible implementation, before querying the target tag from the preset tag library according to the document type and the template information, the document generation method further includes:
[0020] Receiving a tag addition request, a tag deletion request and / or a tag modification request for the preset tag library;
[0021] According to the tag adding request, tag deleting request and / or tag modifying request of the preset tag library, adding, deleting and / or modifying operations are performed on the tags in the preset tag library respectively.
[0022] In another possible implementation, determining the designated tag corresponding to the target tag from the target template includes:
[0023] Obtaining the identifier of the specified tag;
[0024] Generate a second regular expression according to the identifier of the specified tag;
[0025] searching for a plurality of middle tags from the target template according to the second regular expression;
[0026] Determine whether the label content of each intermediate label is consistent with the label content of the target label;
[0027] The intermediate tags with the same tag contents are determined as the designated tags.
[0028] In another possible implementation, generating the target document according to the target template, the tag value of the target tag, and the designated tag includes:
[0029] Get the tag value query interface;
[0030] Calling the tag value query interface to query the tag value of the target tag;
[0031] In the target template, the tag value of the target tag is replaced with the tag value of the designated tag based on the POI component technology.
[0032] In another possible implementation, the document generation method further includes:
[0033] In the target template, the designated tag is replaced with the target tag.
[0034] A second aspect of the present application provides a document generation device, the document generation device comprising:
[0035] A first acquisition module is used to acquire the document type and template information of the target document;
[0036] A query module, used for querying a target tag from a preset tag library according to the document type and the template information;
[0037] A second acquisition module, used for acquiring a target template according to the document type and the template information;
[0038] A receiving module, used for receiving the label value of the target label;
[0039] A determination module, configured to determine a designated tag corresponding to the target tag from the target template;
[0040] A generation module is used to generate the target document according to the target template, the label value of the target label, and the specified label.
[0041] A third aspect of the present application provides a computer device, the computer device comprising a processor, the processor being configured to implement the document generation method when executing a computer program stored in a memory.
[0042] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the document generation method when executed by a processor.
[0043] The present invention is applied to the field of artificial intelligence technology. Labels and templates are classified and managed by document types and the template information, and the templates and labels are combined to generate target documents, thereby increasing the efficiency of document generation. In addition, by incrementally updating the label library, the labels included in the preset label library can be made more comprehensive. When each label and template is needed, the label can be quickly obtained, or a new template can be synthesized by the label and the existing template. The present invention avoids the need to enter the document label and generate the template each time a document is generated, thereby improving the efficiency of document generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a flow chart of the document generation method provided by an embodiment of the present invention.
[0045] Figure 2 It is a structural diagram of a document generation device provided in an embodiment of the present invention.
[0046] Figure 3 It is a schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0048] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than 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.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0050] Preferably, the document generation method of the present invention is applied in one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.
[0051] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0052] Embodiment 1
[0053] Figure 1 The flowchart of the document generation method provided in the first embodiment of the present invention is shown in FIG. The document generation method is applied to a computer device to generate a document and improve the efficiency of generating the document.
[0054] like Figure 1 As shown, the document generation method includes:
[0055] 101. Obtain document type and template information of the target document.
[0056] The target documents include judicial documents. Judicial documents are the general term for legal documents in litigation cases and non-litigation cases handled by courts, procuratorates, public security departments, prisons, etc., as well as legally effective documents written or written on behalf of by case parties, lawyers, and law firms. The target documents also include documents with the characteristic of fixed structure.
[0057] The document types may include civil complaints, civil mediation statements, judgments, etc.
[0058] The template information includes the unique identifier of the template. The target documents of different document types may correspond to one or more templates. One template includes one or more tags.
[0059] 102. Query the target tags from a preset tag library according to the document type and the template information.
[0060] In a specific embodiment, the querying the target tags from a preset tag library according to the document type and the template information includes:
[0061] Generate a first regular expression according to the document type and the template information;
[0062] Query the target tags according to the first regular expression.
[0063] For example, when the document type is a civil complaint and the template information is 001, the generated first regular expression is "SELECT label FROM table WHERE 'type' REGEXP 'civil complaint' and 'template' REGEXP '001'". Run the first regular expression in the database manager of the preset tag library to query the target tags. Wherein, label is the query target, table is the preset table in the preset tag library, type is the column name corresponding to the document type in the preset table, and template is the column name corresponding to the template information in the preset table.
[0064] The 'civil complaint' can be replaced with a preset string composed of letters and numbers.
[0065] The first regular expression can be generated by combining a preset first template, the document type, and the template information. The preset first template is "SELECT label FROM table WHERE 'type' REGEXP variable1 and 'template' REGEXP variable2". The first regular expression is generated by assigning the above document type to variable1 of the preset first template and assigning the above template information to variable2 of the preset first template. When querying, the target tags are associated and queried in the preset tag library through the values of variable1 and variable2.
[0066] In another embodiment, the document generation method further includes:
[0067] Receive standard templates;
[0068] Determine the tags in the standard template that are inconsistent with the preset tag library as newly added tags;
[0069] The newly added tag is updated to the preset tag library.
[0070] Specifically, each time a standard template is uploaded, tags that exist in the standard template but not in the preset tag library are added to the preset tag library. By repeatedly uploading standard templates to update tags to the preset tag library, the preset tag library is gradually improved.
[0071] Add tags by uploading a standard template. Use a template parsing algorithm to extract tags on the standard template, upload the standard template to a file server, and save the standard template returned by the file server, the document type to which the standard template belongs, and the tags of the standard template to the preset tag library.
[0072] The standard template can be edited online, and after the editing is completed, the standard template is saved. The standard tag on the saved standard template is extracted using a template parsing algorithm, and the saved standard template is uploaded to the file server, and the standard tag, the document type to which the standard tag belongs (i.e., the document type to which the standard template belongs) and the standard tag template information (i.e., the template information of the standard template) are updated. Check whether the standard tag exists in the preset tag library based on the standard tag, the document type to which the standard tag belongs and the template information of the standard tag. If the standard tag does not exist in the preset tag library, the standard tag is stored in the preset tag library, and the standard template is re-uploaded to the above-mentioned file server based on the standard tag. The standard template uploaded this time can overwrite the standard template uploaded last time, and the overwritten standard template is stored as a historical standard template. Among them, the use of a template parsing algorithm to extract the standard tag on the saved template specifically refers to using poi technology to read the template of the word document type, and then extracting the tag through a regular expression.
[0073] The formation of the preset label library is an incremental process, which requires continuous input of labels related to the domain knowledge of different document types to gradually form a more complete judicial document label library, namely the preset label library. When each business system generates a document in the future, it is no longer necessary to input the document label, but to directly obtain the label from the judicial document label library. For labels that are common to each business system, these labels can be collected to form a common label set to reduce redundant labels in the document label library.
[0074] In another embodiment, before querying the target tag from the preset tag library according to the document type and the template information, the document generation method further includes:
[0075] Receiving a tag addition request, a tag deletion request and / or a tag modification request for the preset tag library;
[0076] According to the tag adding request, tag deleting request and / or tag modifying request of the preset tag library, adding, deleting and / or modifying operations are performed on the tags in the preset tag library respectively.
[0077] For example, a label modification request for a preset label library is received, the label modification request includes a first label and a second label, the label to be modified is searched from the preset label library according to the first label in the label modification request, and the label to be modified in the preset label library is replaced with the second label in the label modification request to obtain a modified label.
[0078] For non-query operations, you need to generate a new template based on the latest tag associated with the template, upload it to the file server, and then update the template information.
[0079] The types of labels include display labels, non-display labels, and range labels. The label value corresponding to the display label can be displayed in the document, and the label corresponding to the non-display label will not be displayed in the document. The range label includes one or more display labels and non-display labels. For example, the display label is "[+...+]", the non-display label is "[-...-]", and the range label is "{+...+}" or "{-...-}".
[0080] It should be emphasized that in order to further ensure the privacy and security of the preset tag library, the preset tag library can also be stored in a node of a blockchain.
[0081] 103. Acquire a target template according to the document type and the template information.
[0082] The template information is used to determine a target template from multiple templates.
[0083] For example, the document type is a civil complaint, and the template information is 001; multiple templates of the civil complaint are obtained; and the first template is obtained from the multiple templates according to the template information 001.
[0084] For another example, the document type is a judgment, and the template information is 202001; multiple templates of the judgment are obtained; and the first template of 2020 is obtained from multiple templates according to the template information 202001.
[0085] 104. Receive a label value of the target label.
[0086] For example, the target label is "[+Plaintiff's name+]", and the label value is "Zhang San". For another example, the target label is "[-Lawyer Agent-]", and the label value is "1".
[0087] 105 , determining a designated tag corresponding to the target tag from the target template.
[0088] In a specific embodiment, determining the designated tag corresponding to the target tag from the target template includes:
[0089] Obtaining the identifier of the specified tag;
[0090] Generate a second regular expression according to the identifier of the specified tag;
[0091] searching for a plurality of middle tags from the target template according to the second regular expression;
[0092] Determine whether the label content of each intermediate label is consistent with the label content of the target label;
[0093] The intermediate tags with the same tag contents are determined as the designated tags.
[0094] For example, the second regular expression is run, and multiple intermediate tags are searched from the target template through the identifiers "[+" and "+]" in the second regular expression. It is determined whether the label content of each intermediate tag is consistent with the label content of the target tag; and the intermediate tags with consistent label content are determined as designated tags.
[0095] The middle tag with the same tag content is determined as the designated tag
[0096] 106. Generate the target document according to the target template, the tag value of the target tag, and the designated tag.
[0097] In a specific embodiment, generating the target document according to the target template, the tag value of the target tag, and the designated tag includes:
[0098] Get the tag value query interface;
[0099] Calling the tag value query interface to query the tag value of the target tag;
[0100] In the target template, the tag value of the target tag is replaced with the tag value of the designated tag based on the POI component technology.
[0101] After the preset tag library is established, the tag value of the target tag is queried by obtaining the tag value query interface, and then the tag value of the target tag is replaced with the tag value of the specified tag through the Apache POI component technology to generate the final target document and upload it to the file server.
[0102] Embodiment 1 is applied to the field of artificial intelligence technology. Labels and templates are classified and managed by document types and the template information, and the templates and labels are combined to generate target documents, thereby increasing the efficiency of document generation. In addition, by incrementally updating the label library, the labels included in the preset label library can be made more comprehensive. When each label and template is needed, the label can be quickly obtained, or a new template can be synthesized by using the label and the existing template. This avoids the need to enter the document label and generate the template each time a document is generated, thereby improving the efficiency of document generation.
[0103] In another embodiment, the document generation method further includes:
[0104] In the target template, the designated tag is replaced with the target tag.
[0105] The text content of the target template is read through the POI technology, and then the tags in the text content of the target template are replaced using the template engine. Then, the processed text content is put back into the target template through the POI technology to obtain the document.
[0106] Embodiment 2
[0107] Figure 2 2 is a structural diagram of a document generation device provided in Embodiment 2 of the present invention. The document generation device 20 is applied to a computer device. The document generation device 20 is used to generate documents and improve the efficiency of generating documents.
[0108] like Figure 2 As shown, the document generation device 20 may include a first acquisition module 201, a query module 202, a second acquisition module 203, a receiving module 204, a determination module 205, and a generation module 206.
[0109] The first acquisition module 201 is used to acquire the document type and template information of the target document.
[0110] The target documents include judicial documents. Judicial documents are the general term for legal documents in litigation and non-litigation cases handled by courts, procuratorates, public security departments, prisons, etc., as well as legally effective documents written or commissioned by case parties, lawyers, and law firms. The target documents also include documents with the characteristic of fixed structure.
[0111] The document types may include civil complaints, civil mediation agreements, judgments, etc.
[0112] The template information includes the unique identifier of the template. The target documents of different document types may correspond to one or more templates. One template includes one or more tags.
[0113] The query module 202 is used to query the target tags from a preset tag library according to the document type and the template information.
[0114] In a specific embodiment, the querying of the target tags from the preset tag library according to the document type and the template information includes:
[0115] Generating a first regular expression according to the document type and the template information;
[0116] Querying the target tags according to the first regular expression.
[0117] For example, when the document type is a civil complaint and the template information is 001, the generated first regular expression is "SELECT label FROM table WHERE 'type' REGEXP 'civil complaint' and 'template' REGEXP '001'". Run the first regular expression in the database manager of the preset tag library to query the target tags. Here, label is the query target, table is the preset table in the preset tag library, type is the column name corresponding to the document type in the preset table, and template is the column name corresponding to the template information in the preset table.
[0118] The 'civil complaint' can be replaced with a preset string composed of letters and numbers.
[0119] The first regular expression can be generated by combining the preset first template, the document type, and the template information. The preset first template is "SELECT label FROM table WHERE'type'REGEXP variable 1and'template'REGEXP variable 2". The first regular expression is generated by assigning the above document type to variable 1 of the preset first template and assigning the above template information to variable 2 of the preset first template. When querying, the target label is queried in the preset label library by associating the values of variable 1 and variable 2.
[0120] In another embodiment, the document generation method further includes:
[0121] Receive standard templates;
[0122] Determine the tags in the standard template that are inconsistent with the preset tag library as newly added tags;
[0123] The newly added tag is updated to the preset tag library.
[0124] Specifically, each time a standard template is uploaded, tags that exist in the standard template but not in the preset tag library are added to the preset tag library. By repeatedly uploading standard templates to update tags to the preset tag library, the preset tag library is gradually improved.
[0125] Add tags by uploading a standard template. Use a template parsing algorithm to extract tags on the standard template, upload the standard template to a file server, and save the standard template returned by the file server, the document type to which the standard template belongs, and the tags of the standard template to the preset tag library.
[0126] The standard template can be edited online, and after the editing is completed, the standard template is saved. The standard tag on the saved standard template is extracted using a template parsing algorithm, and the saved standard template is uploaded to the file server, and the standard tag, the document type to which the standard tag belongs (i.e., the document type to which the standard template belongs) and the standard tag template information (i.e., the template information of the standard template) are updated. Check whether the standard tag exists in the preset tag library based on the standard tag, the document type to which the standard tag belongs and the template information of the standard tag. If the standard tag does not exist in the preset tag library, the standard tag is stored in the preset tag library, and the standard template is re-uploaded to the above-mentioned file server based on the standard tag. The standard template uploaded this time can overwrite the standard template uploaded last time, and the overwritten standard template is stored as a historical standard template. Among them, the use of a template parsing algorithm to extract the standard tag on the saved template specifically refers to using poi technology to read the template of the word document type, and then extracting the tag through a regular expression.
[0127] The formation of the preset label library is an incremental process, which requires continuous input of labels related to the domain knowledge of different document types to gradually form a more complete judicial document label library, namely the preset label library. When each business system generates a document in the future, it is no longer necessary to input the document label, but to directly obtain the label from the judicial document label library. For labels that are common to each business system, these labels can be collected to form a common label set to reduce redundant labels in the document label library.
[0128] In another embodiment, before querying the target tag from the preset tag library according to the document type and the template information, the document generation method further includes:
[0129] Receiving a tag addition request, a tag deletion request and / or a tag modification request for the preset tag library;
[0130] According to the tag adding request, tag deleting request and / or tag modifying request of the preset tag library, adding, deleting and / or modifying operations are performed on the tags in the preset tag library respectively.
[0131] For example, a label modification request for a preset label library is received, the label modification request includes a first label and a second label, the label to be modified is searched from the preset label library according to the first label in the label modification request, and the label to be modified in the preset label library is replaced with the second label in the label modification request to obtain a modified label.
[0132] For non-query operations, you need to generate a new template based on the latest tag associated with the template, upload it to the file server, and then update the template information.
[0133] The types of labels include display labels, non-display labels, and range labels. The label value corresponding to the display label can be displayed in the document, and the label corresponding to the non-display label will not be displayed in the document. The range label includes one or more display labels and non-display labels. For example, the display label is "[+...+]", the non-display label is "[-...-]", and the range label is "{+...+}" or "{-...-}".
[0134] It should be emphasized that in order to further ensure the privacy and security of the preset tag library, the preset tag library can also be stored in a node of a blockchain.
[0135] The second acquisition module 203 is used to acquire a target template according to the document type and the template information.
[0136] The template information is used to determine a target template from multiple templates.
[0137] For example, the document type is a civil complaint, and the template information is 001; multiple templates of the civil complaint are obtained; and the first template is obtained from the multiple templates according to the template information 001.
[0138] For another example, the document type is a judgment, and the template information is 202001; multiple templates of the judgment are obtained; and the first template of 2020 is obtained from multiple templates according to the template information 202001.
[0139] The receiving module 204 is configured to receive the label value of the target label.
[0140] For example, the target label is "[+Plaintiff's name+]", and the label value is "Zhang San". For another example, the target label is "[-Lawyer Agent-]", and the label value is "1".
[0141] The determination module 205 is configured to determine a designated tag corresponding to the target tag from the target template.
[0142] In a specific embodiment, determining the designated tag corresponding to the target tag from the target template includes:
[0143] Obtaining the identifier of the specified tag;
[0144] Generate a second regular expression according to the identifier of the specified tag;
[0145] searching for a plurality of middle tags from the target template according to the second regular expression;
[0146] Determine whether the label content of each intermediate label is consistent with the label content of the target label;
[0147] The intermediate tags with the same tag contents are determined as the designated tags.
[0148] For example, run the second regular expression and search for multiple intermediate tags from the target template through the identifiers "[+" and "+]" in the second regular expression. Determine whether the label content of each intermediate tag is consistent with the label content of the target tag; determine the intermediate tags with consistent label content as the designated tags
[0149] The generation module 206 is used to generate the target document according to the target template, the label value of the target label, and the designated label.
[0150] In a specific embodiment, generating the target document according to the target template, the tag value of the target tag, and the designated tag includes:
[0151] Get the tag value query interface;
[0152] Calling the tag value query interface to query the tag value of the target tag;
[0153] In the target template, the tag value of the target tag is replaced with the tag value of the designated tag based on the POI component technology.
[0154] After the preset tag library is established, the tag value of the target tag is queried by obtaining the tag value query interface, and then the tag value of the target tag is replaced with the tag value of the specified tag through the Apache POI component technology to generate the final target document and upload it to the file server.
[0155] The document generation device 20 of the second embodiment is applied to the field of artificial intelligence technology. The labels and templates are classified and managed by the document type and the template information, and the template and label are combined to generate the target document, thereby increasing the efficiency of document generation. In addition, by incrementally updating the label library, the labels included in the preset label library can be made more comprehensive. When each label and template is needed, the label can be quickly obtained, or a new template can be synthesized by the label and the existing template. It is avoided that the document label needs to be entered and the template needs to be generated every time a document is generated, thereby improving the efficiency of document generation.
[0156] In another embodiment, the document generation device 20 further includes a replacement module for replacing the designated tag with the target tag in the target template.
[0157] The text content of the target template is read through the POI technology, and then the tags in the text content of the target template are replaced using the template engine. Then, the processed text content is put back into the target template through the POI technology to obtain the document.
[0158] Embodiment 3
[0159] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned document generation method embodiment are implemented, such as Figure 1 Steps 101-106 shown:
[0160] 101, obtaining the document type and template information of the target document;
[0161] 102, querying a target tag from a preset tag library according to the document type and the template information;
[0162] 103, acquiring a target template according to the document type and the template information;
[0163] 104, receiving a label value of the target label;
[0164] 105, determining a designated tag corresponding to the target tag from the target template;
[0165] 106. Generate the target document according to the target template, the tag value of the target tag, and the designated tag.
[0166] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-206:
[0167] The first acquisition module 201 is used to acquire the document type and template information of the target document;
[0168] A query module 202, configured to query a target tag from a preset tag library according to the document type and the template information;
[0169] A second acquisition module 203, used to acquire a target template according to the document type and the template information;
[0170] The receiving module 204 is used to receive the label value of the target label;
[0171] A determination module 205, configured to determine a designated tag corresponding to the target tag from the target template;
[0172] The generation module 206 is used to generate the target document according to the target template, the label value of the target label, and the designated label.
[0173] Embodiment 4
[0174] Figure 3Schematic diagram of a computer device provided in Embodiment 3 of the present invention. The computer device 30 includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and executable on the processor 302, such as a document generation program. When the processor 302 executes the computer program 303, the steps in the above-mentioned document generation method embodiment are implemented, such as Figure 1 101-106 shown:
[0175] 101, obtaining the document type and template information of the target document;
[0176] 102, querying a target tag from a preset tag library according to the document type and the template information;
[0177] 103, acquiring a target template according to the document type and the template information;
[0178] 104, receiving a label value of the target label;
[0179] 105, determining a designated tag corresponding to the target tag from the target template;
[0180] 106. Generate the target document according to the target template, the tag value of the target tag, and the designated tag.
[0181] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-206:
[0182] The first acquisition module 201 is used to acquire the document type and template information of the target document;
[0183] A query module 202, configured to query a target tag from a preset tag library according to the document type and the template information;
[0184] A second acquisition module 203, used to acquire a target template according to the document type and the template information;
[0185] The receiving module 204 is used to receive the label value of the target label;
[0186] A determination module 205, configured to determine a designated tag corresponding to the target tag from the target template;
[0187] The generation module 206 is used to generate the target document according to the target template, the label value of the target label, and the designated label.
[0188] Exemplarily, the computer program 303 may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the computer device 30. For example, the computer program 303 may be divided into Figure 2 For the first acquisition module 201, the query module 202, the second acquisition module 203, the receiving module 204, the determination module 205, and the generation module 206, please refer to the second embodiment for the specific functions of each module.
[0189] Those skilled in the art will understand that the Figure 3 It is only an example of the computer device 30 and does not constitute a limitation of the computer device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, etc.
[0190] The processor 302 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 302 may also be any conventional processor, etc. The processor 302 is the control center of the computer device 30, and uses various interfaces and lines to connect various parts of the entire computer device 30.
[0191] The memory 301 can be used to store the computer program 303. The processor 302 implements various functions of the computer device 30 by running or executing the computer program or module stored in the memory 301 and calling the data stored in the memory 301. The memory 301 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer device 30, etc. In addition, the memory 301 can include non-volatile and volatile memories, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0192] If the module integrated in the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), etc.
[0193] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0194] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0195] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0196] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0198] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute some steps of the document generation method described in each embodiment of the present invention.
[0199] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any accompanying figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or devices stated in the system claim can also be implemented by one module or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0200] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A document generation method, characterized in that: The document generation method comprises: Acquire the document type and template information of the target document, wherein the template information includes a unique identifier of the template, and each target document of each document type corresponds to one or more templates, and a template includes one or more tags, wherein the tags at least include a display tag, a non-display tag, and a range tag; Querying a target tag from a preset tag library according to the document type and the template information, including generating a first regular expression according to the document type and the template information; and querying the target tag according to the first regular expression; Acquire a target template according to the document type and the template information; Receiving a label value of the target label; Determining a designated tag corresponding to the target tag from the target template; Generate the target document according to the target template, the tag value of the target tag, and the designated tag; Receive a standard template; check whether the standard tag exists in the preset tag library according to the standard tag in the standard template, the document type to which the standard tag belongs, and the template information of the standard template; determine the standard tag in the standard template that is inconsistent with the preset tag library as a new tag; and update the new tag to the preset tag library.
2. The document generation method according to claim 1, characterized in that: Before querying the target tag from the preset tag library according to the document type and the template information, the document generation method further includes: Receiving a tag addition request, a tag deletion request and / or a tag modification request for the preset tag library; According to the tag adding request, tag deleting request and / or tag modifying request of the preset tag library, adding, deleting and / or modifying operations are performed on the tags in the preset tag library respectively.
3. The document generation method according to claim 1, wherein: The determining of the designated tag corresponding to the target tag from the target template comprises: Obtaining the identifier of the specified tag; Generate a second regular expression according to the identifier of the specified tag; searching for a plurality of middle tags from the target template according to the second regular expression; Determine whether the label content of each intermediate label is consistent with the label content of the target label; The intermediate tags with the same tag contents are determined as the designated tags.
4. The document generation method according to claim 1, wherein: The generating the target document according to the target template, the tag value of the target tag, and the designated tag comprises: Get the tag value query interface; Calling the tag value query interface to query the tag value of the target tag; In the target template, the tag value of the target tag is replaced with the tag value of the designated tag based on the POI component technology.
5. The document generation method according to any one of claims 1 to 4, characterized in that: The document generation method further includes: In the target template, the designated tag is replaced with the target tag.
6. A document generation device, characterized in that: The document generating device comprises: A first acquisition module is used to acquire the document type and template information of the target document, wherein the template information includes a unique identifier of the template, and each document type corresponds to one or more templates, and a template includes one or more tags, wherein the tags at least include a display tag, a non-display tag, and a range tag; A query module, used for querying a target tag from a preset tag library according to the document type and the template information, including generating a first regular expression according to the document type and the template information; and querying the target tag according to the first regular expression; A second acquisition module, used for acquiring a target template according to the document type and the template information; A receiving module, used for receiving the label value of the target label; A determination module, configured to determine a designated tag corresponding to the target tag from the target template; A generating module, configured to generate the target document according to the target template, the tag value of the target tag, and the designated tag; Receive a standard template; check whether the standard tag exists in the preset tag library according to the standard tag in the standard template, the document type to which the standard tag belongs, and the template information of the standard template; determine the standard tag in the standard template that is inconsistent with the preset tag library as a new tag; and update the new tag to the preset tag library.
7. A computer device, characterized in that: The computer device includes a processor, which is used to execute a computer program stored in a memory to implement the document generation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the document generation method as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Legal trial business processing method and device
CN108009299A
Contract data processing method and device, computer equipment and storage medium
CN109816327A
Template type legal document information filling method and device
CN110096689A
Method and device for generating document template
CN110263317A
Method and system for supporting the creation of a legal document in online
KR1020170007013A
