Dynamic generation method and device for litigation documents, electronic equipment and storage medium
By labeling the litigation document templates and correlating them with the case database, automatically filling in data to generate documents, the problem of manual filling errors is solved, improving case processing efficiency and adapting to complex scenarios.
Patent Information
- Application Number
- CN202411166341.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-31
AI Technical Summary
Traditional litigation documents are prone to errors when manually filling in templates, which affects the efficiency of case handling, and inadequate review may cause unnecessary trouble.
By labeling the case template, parsing the tag variables and associating them with the case database, traversing the tag object list, automatically filling the data to generate litigation documents, it supports object processing logic and nested use of different document types.
It realizes the rapid and accurate generation of litigation documents, avoids manual filling errors, improves case handling efficiency, and supports the adaptability of complex scenarios.
Smart Images

Figure CN119227644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and storage medium for dynamically generating litigation documents. Background Art
[0002] In litigation cases, agents need to prepare evidence materials, indictments, and other materials required by judicial institutions, which are usually manually compiled and written. According to the requirements of judicial institutions and relevant experience, case agencies form different template materials for indictments according to different types of cases, manually fill in the information of relevant cases into the templates, and form documents submitted to the court. Although there are templates, these templates only restrict manual filling in form and format, and do not guarantee the accuracy of the manually filled content. Since it is filled in manually, errors are inevitable. If the review is not in place, once it is submitted to the court, it may cause unnecessary trouble. Summary of the invention
[0003] The present invention provides a method, device, electronic device and storage medium for dynamically generating litigation documents, which are used to solve the defects that traditional litigation documents are filled out manually in templates, which may cause errors and affect the efficiency of handling cases.
[0004] The present invention provides a method for dynamically generating litigation documents, comprising: Labeling the information that needs to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; Parsing the label variables in the multiple label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and binding the association relationship between the label variables and the case data in the case database; Obtain a corresponding label template according to the type of litigation document to be generated, and traverse a list of label objects in the corresponding label template; According to the association relationship between the label variable and the case data in the case database, the case data corresponding to each label object in the label object list is obtained, and the case data is filled into the corresponding label template to generate a litigation document.
[0005] According to the method for dynamically generating litigation documents provided by the present invention, the traversing the list of label objects in the corresponding label template includes: Get all tags in the corresponding tag template; Different tags are encapsulated in different objects according to the document type, the tag location and the tag type. The object includes a reference to the document element where the tag is located and at least one of the location, tag information and expression information.
[0006] According to the method for dynamically generating litigation documents provided by the present invention, the document types include Word documents and Excel documents, the Word document includes a block object, a table object and a text interpolation object; the Excel document includes a block object, a cell object and a text interpolation object; The block object is used to process a text block as a subunit, and the block object includes a loop block and a judgment block. The loop block is used to control whether to loop access multiple text blocks; the judgment block is used to control whether to display the text block; the block object includes nested objects, and the nested objects are one or more of block objects, table objects, cell objects and text interpolation objects, and the nested objects are subsets of the block object; The cell object inherits the properties of the block object and controls the text block in the same cell; The table object is used to add or reduce the table in the Word document; The text interpolation object is the value of the label variable.
[0007] The method for dynamically generating litigation documents provided by the present invention further includes: Different types of objects correspond to different access processing logic, including: For block objects, calculate the parent tag variable to obtain data, determine whether the data to be filled belongs to the loop block or the judgment block, if it belongs to the loop block, obtain the child tag object list, copy the block object, and fill the content of the block object into the corresponding tag template through text interpolation until all loop block data are filled; If it belongs to a judgment block, when the judgment is true, the content of the block object is filled into the corresponding label template through text interpolation. If the judgment is false, the block object is not filled.
[0008] According to the method for dynamically generating litigation documents provided by the present invention, the different types of objects corresponding to different access processing logics also include: For cell objects, if the text block in each cell belongs to a loop block, obtain the sub-label object list, copy the block object, and fill the content of the block object into the corresponding label template through text interpolation until all loop block data filling is completed; if it belongs to a judgment block, fill the content of the block object into the corresponding label template through text interpolation when the judgment is true, and do not fill the block object if the judgment is false; For table objects, fill in the data in the table; For text interpolation objects, process and replace the text label.
[0009] The method for dynamically generating litigation documents provided by the present invention further includes: In the process of filling the case data into the corresponding label template, the label variable is preprocessed, and the preprocessing includes one or more of format standardization, dictionary conversion, digital calculation, string processing and list data screening.
[0010] According to the method for dynamically generating litigation documents provided by the present invention, after generating the litigation documents, the method further includes: Export the litigation document to the same format as the original template document, or export the litigation document to the format required by the user.
[0011] The present invention also provides a litigation document dynamic generation device, comprising: A processing module, used for labeling the information to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; A binding module, used to parse the label variables in the multiple label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and bind the association relationship between the label variables and the case data in the case database; A traversal module, used to obtain a corresponding label template according to the type of litigation document to be generated, and traverse a list of label objects in the corresponding label template; A filling module is used to obtain the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, fill the case data into the corresponding label template, and generate litigation documents.
[0012] 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, the method for dynamically generating litigation documents as described in any one of the above items is implemented.
[0013] 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, it implements any of the above-mentioned methods for dynamically generating litigation documents.
[0014] The method, device, electronic device and storage medium for dynamically generating litigation documents provided by the present invention obtain multiple label templates by labeling the information that needs to be replaced in multiple original case templates corresponding to different case types; parsing the label variables in the multiple label templates into a structure, which includes the parent-child relationship of different label variables, and binding the association relationship between the label variables and the case data in the case database; obtaining the corresponding label template according to the type of litigation document to be generated, and traversing the label object list in the corresponding label template; obtaining the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, filling the case data into the corresponding label template, generating litigation documents, and using the existing formed complaint template, only label sorting and binding need to be performed during initialization, and subsequent case complaints can be quickly generated, avoiding manual filling errors and improving case processing efficiency. In addition, different types of template objects support nested use, can support various complex scenarios, and have strong adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] 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.
[0016] Figure 1 It is a flowchart of a method for dynamically generating litigation documents provided by an embodiment of the present invention; Figure 2 It is a functional structure diagram of a litigation document dynamic generation device provided by an embodiment of the present invention; Figure 3 It is a functional structure diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0017] 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.
[0018] Figure 1 A flowchart of a method for dynamically generating litigation documents provided by an embodiment of the present invention, such as Figure 1 As shown, the method for dynamically generating litigation documents provided by the embodiment of the present invention includes: Step 101: Label the information to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; The embodiment of the present invention utilizes an existing formed complaint template, and only needs to organize and bind some labels during initialization, and subsequent case complaints can be quickly generated according to this template.
[0019] Step 102: parsing the label variables in the plurality of label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and binding the association relationship between the label variables and the case data in the case database; Step 103: Obtain a corresponding label template according to the type of litigation document to be generated, and traverse a label object list in the corresponding label template; Step 104: Obtain case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, fill the case data into the corresponding label template, and generate litigation documents.
[0020] The traditional method of dynamically generating litigation documents is filled out manually, so errors are inevitable. If they are not properly reviewed, they may cause unnecessary trouble once submitted to the court.
[0021] The method for dynamically generating litigation documents provided by an embodiment of the present invention obtains multiple label templates by labeling the information that needs to be replaced in multiple original case templates corresponding to different case types; parsing the label variables in the multiple label templates into a structure, which includes the parent-child relationship of different label variables, and binding the association relationship between the label variables and the case data in the case database; obtaining the corresponding label template according to the type of litigation document to be generated, and traversing the label object list in the corresponding label template; obtaining the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, filling the case data into the corresponding label template, generating litigation documents, and using the existing formed complaint template, only label sorting and binding need to be performed during initialization, and subsequent case complaints can be quickly generated, avoiding manual filling errors and improving case processing efficiency. In addition, different types of template objects support nested use, can support various complex scenarios, and have strong adaptability.
[0022] Based on any of the above embodiments, the method for dynamically generating litigation documents provided by the embodiments of the present invention includes a binding process and a generation process. In the binding process, the original complaint template needs to be prepared first, and the information to be replaced is replaced with a label (the label is in the form of ${expression or variable}, as shown in Table 1, and different information uses different variable names. This process requires preparing relevant templates according to different case types.
[0023] Table 1 Labels and descriptions of objects in the template
[0024] After completing the label replacement, the program parses the template and parses all label variables into a structure to reflect the parent-child relationship of different variables. Then, the parsed label variables are bound to the existing data variables in the database, and the bound case data is placed in the data pool for standby use.
[0025] During the generation process, the case information is extracted according to the bound data variables. The information data can be collected by the system or manually entered. The list of acquired label objects is traversed; different types of objects have different access processing logics. The unified scheduling entry determines the processing component according to the traversed object type and then processes it.
[0026] Based on any of the foregoing embodiments, traversing the label object list in the corresponding label template includes: Get all tags in the corresponding tag template; Different tags are encapsulated in different objects according to the document type, the tag location and the tag type. The object includes a reference to the document element where the tag is located and at least one of the location, tag information and expression information.
[0027] In the embodiment of the present invention, the document type includes a Word document and an Excel document, the Word document includes a block object, a table object and a text interpolation object; the Excel document includes a block object, a cell object and a text interpolation object; The block object is used to process a text block as a subunit, and the block object includes a loop block and a judgment block. The loop block is used to control whether to loop access multiple text blocks; the judgment block is used to control whether to display the text block; the block object includes nested objects, and the nested objects are one or more of block objects, table objects, cell objects and text interpolation objects, and the nested objects are subsets of the block object; The cell object inherits the properties of the block object and controls the text block in the same cell; The table object is used to add or reduce the table in the Word document; The text interpolation object is the value of the label variable.
[0028] In the embodiment of the present invention, different types of objects correspond to different access processing logics, specifically including: For block objects, calculate the parent tag variable to obtain data, determine whether the data to be filled belongs to the loop block or the judgment block, if it belongs to the loop block, obtain the child tag object list, copy the block object, and fill the content of the block object into the corresponding tag template through text interpolation until all loop block data are filled; If it belongs to a judgment block, when the judgment is true, the content of the block object is filled into the corresponding label template through text interpolation. If the judgment is false, the block object is not filled.
[0029] In the embodiment of the present invention, the different types of objects corresponding to different access processing logics also include: For cell objects, if the text block in each cell belongs to a loop block, obtain the sub-label object list, copy the block object, and fill the content of the block object into the corresponding label template through text interpolation until all loop block data filling is completed; if it belongs to a judgment block, fill the content of the block object into the corresponding label template through text interpolation when the judgment is true, and do not fill the block object if the judgment is false; For table objects, fill in the data in the table; For text interpolation objects, process and replace the text label.
[0030] In the embodiment of the present invention, a Word document includes a block object, a table object, a text interpolation object and corresponding processing components. An Excel document includes a block object, a cell object, a text interpolation object and corresponding processing components.
[0031] In the embodiment of the present invention, the above-mentioned different component logics are supported by a tag system, so that the tag usage of Word and Excel is completely consistent, which is convenient for visual editing.
[0032] Based on any of the above embodiments, the method for dynamically generating litigation documents further includes: In the process of filling the case data into the corresponding label template, the label variable is preprocessed, and the preprocessing includes one or more of format standardization, dictionary conversion, digital calculation, string processing and list data screening.
[0033] In the embodiment of the present invention, format standardization includes adaptively modifying the label variable according to different formats of the date, for example, the formats of filling in the date include XX year XX month XX day, yyyy.mm.rr, etc.; digital calculation such as yuan*100 converted to cents; dictionary conversion such as female is displayed as female, male is displayed as male; string processing such as segmentation, splicing, etc.; list data screening such as screening the names of all male employees in the company, etc. The preprocessing of the label variable can be achieved by the processing calculation binding variables or functions in Table 1.
[0034] Based on any of the above embodiments, after the litigation document is generated, the litigation document dynamic generation method further includes: Export the litigation document to the same format as the original template document, or export the litigation document to the format required by the user.
[0035] In the embodiment of the present invention, the format required by the user is, for example, PDF, web page, picture, etc., which is not limited by the present invention.
[0036] The method for dynamically generating litigation documents provided by the embodiment of the present invention forms relevant templates according to different case types, binds the templates and standardized case information, and then automatically fills them into the templates by automated means, so as to efficiently and accurately complete the preparation of litigation materials; the label system is simple and easy to understand, and at the same time, the standards are unified between different formats, and the learning cost is not high; in the data binding process, the data can be relied on for automatic collection by the system, or it can be supplemented manually, so that standardization is achieved and various requirements for online processing, approval, and filing are fully supported; different types of template objects support nested use, can support various complex scenarios, and have strong adaptability. At the same time, an extension interface is reserved, and your own logic can be designed as needed.
[0037] The following is a description of the litigation document dynamic generation device provided by the present invention. The litigation document dynamic generation device described below and the litigation document dynamic generation method described above can be referenced to each other.
[0038] Figure 2 A schematic diagram of the structure of a device for dynamically generating litigation documents provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the litigation document dynamic generation device provided by the embodiment of the present invention includes: Processing module 201, used for labeling information to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; A binding module 202, used to parse the label variables in the plurality of label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and bind the label variables to an association relationship between the case data in a case database; A traversal module 203 is used to obtain a corresponding label template according to the type of litigation document to be generated, and traverse a list of label objects in the corresponding label template; The filling module 204 is used to obtain the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, fill the case data into the corresponding label template, and generate litigation documents.
[0039] The litigation document dynamic generation device provided by the embodiment of the present invention obtains multiple label templates by labeling the information that needs to be replaced in multiple original case templates corresponding to different case types; parses the label variables in the multiple label templates into a structure, which includes the parent-child relationship of different label variables, and binds the association relationship between the label variables and the case data in the case database; obtains the corresponding label template according to the type of litigation document to be generated, and traverses the label object list in the corresponding label template; obtains the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, fills the case data into the corresponding label template, generates litigation documents, and uses the existing formed complaint template, only needs to organize and bind labels during initialization, and subsequent case complaints can be quickly generated, avoiding manual filling errors and improving case processing efficiency. In addition, different types of template objects support nested use, can support various complex scenarios, and have strong adaptability.
[0040] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the server may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The memory 330 includes a computer program, an operating system and acquired data, and the processor 310 may call the logic instructions in the memory 330 to execute the method for dynamically generating litigation documents, which includes: labeling the information to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; parsing the label variables in the multiple label templates into a structure, wherein the structure includes the parent-child relationship of different label variables, and binding the association relationship between the label variables and the case data in the case database; obtaining the corresponding label template according to the type of litigation document to be generated, and traversing the label object list in the corresponding label template; obtaining the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, and filling the case data into the corresponding label template to generate litigation documents.
[0041] In addition, the logic instructions in the above-mentioned memory 330 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, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable 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: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0042] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the method for dynamically generating litigation documents provided by the above-mentioned methods. The method includes: labeling the information that needs to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; parsing the label variables in the multiple label templates into a structure, wherein the structure includes the parent-child relationship of different label variables, and binding the association relationship between the label variables and the case data in the case database; obtaining the corresponding label template according to the type of litigation document to be generated, and traversing the list of label objects in the corresponding label template; obtaining the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, filling the case data into the corresponding label template, and generating a litigation document.
[0043] 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.
[0044] 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, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology 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 embodiment.
[0045] 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 method for dynamically generating litigation documents, characterized in that: include: Labeling the information that needs to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; Parsing the label variables in the multiple label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and binding the association relationship between the label variables and the case data in the case database; Obtain a corresponding label template according to the type of litigation document to be generated, and traverse a list of label objects in the corresponding label template; According to the association relationship between the label variable and the case data in the case database, the case data corresponding to each label object in the label object list is obtained, and the case data is filled into the corresponding label template to generate a litigation document.
2. The method for dynamically generating litigation documents according to claim 1, characterized in that: The traversing the label object list in the corresponding label template includes: Get all tags in the corresponding tag template; Different tags are encapsulated in different objects according to the document type, the tag location and the tag type. The object includes a reference to the document element where the tag is located and at least one of the location, tag information and expression information.
3. The method for dynamically generating litigation documents according to claim 2, characterized in that: The document types include Word documents and Excel documents, wherein the Word document includes a block object, a table object and a text interpolation object; the Excel document includes a block object, a cell object and a text interpolation object; The block object is used to process a text block as a subunit, and the block object includes a loop block and a judgment block. The loop block is used to control whether to loop access multiple text blocks; the judgment block is used to control whether to display the text block; the block object includes nested objects, and the nested objects are one or more of block objects, table objects, cell objects and text interpolation objects, and the nested objects are subsets of the block object; The cell object inherits the properties of the block object and controls the text block in the same cell; The table object is used to add or reduce the table in the Word document; The text interpolation object is the value of the label variable.
4. The method for dynamically generating litigation documents according to claim 3 is characterized in that: Also includes: Different types of objects correspond to different access processing logic, including: For block objects, calculate the parent tag variable to obtain data, determine whether the data to be filled belongs to the loop block or the judgment block, if it belongs to the loop block, obtain the child tag object list, copy the block object, and fill the content of the block object into the corresponding tag template through text interpolation until all loop block data are filled; If it belongs to a judgment block, when the judgment is true, the content of the block object is filled into the corresponding label template through text interpolation, and when the judgment is false, the block object is not filled.
5. The method for dynamically generating litigation documents according to claim 4, characterized in that: The different types of objects corresponding to different access processing logics also include: For cell objects, if the text block in each cell belongs to a loop block, obtain the sub-label object list, copy the block object, and fill the content of the block object into the corresponding label template through text interpolation until all loop block data filling is completed; if it belongs to a judgment block, fill the content of the block object into the corresponding label template through text interpolation when the judgment is true, and do not fill the block object if the judgment is false; For table objects, fill in the data in the table; For text interpolation objects, process and replace the text label.
6. The method for dynamically generating litigation documents according to claim 1, characterized in that: Also includes: In the process of filling the case data into the corresponding label template, the label variable is preprocessed, and the preprocessing includes one or more of format standardization, dictionary conversion, digital calculation, string processing and list data screening.
7. The method for dynamically generating litigation documents according to claim 1, characterized in that: After the litigation documents are generated, the following is also included: Export the litigation document to the same format as the original template document, or export the litigation document to the format required by the user.
8. A device for dynamically generating litigation documents, characterized in that: include: A processing module, used for labeling the information to be replaced in multiple original case templates corresponding to different case types to obtain multiple label templates; A binding module, used to parse the label variables in the multiple label templates into a structure, wherein the structure includes a parent-child relationship between different label variables, and bind the association relationship between the label variables and the case data in the case database; A traversal module, used to obtain a corresponding label template according to the type of litigation document to be generated, and traverse a list of label objects in the corresponding label template; A filling module is used to obtain the case data corresponding to each label object in the label object list according to the association relationship between the label variable and the case data in the case database, fill the case data into the corresponding label template, and generate litigation documents.
9. 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, the method for dynamically generating litigation documents as described in any one of claims 1 to 7 is implemented.
10. A non-transitory readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method for dynamically generating litigation documents as described in any one of claims 1 to 7.
