Document generation method, device and storage medium

Replace placeholders through SQL scripts and API dynamic parameter values, and generate target document pages in combination with online editing instructions, solving the problems of data consistency and accuracy in budget and final accounts reports, realizing the standardization and unified reporting, and reducing labor costs and improve the timeliness of data.

CN118657135BActive Publication Date: 2024-11-15深圳市金政软件技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411143518.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-15
Estimated Expiration
2044-08-20

AI Technical Summary

Technical Problem

In the prior art, the filling method of budget and final accounts reports lacks a unified format constraint and data verification mechanism, which makes it difficult to ensure data consistency and accuracy, which increases labor costs and reduces the timeliness and response speed of data, and is different units of The style and quality of the filling out report are uneven, making it difficult to standardize and unify the report.

Method used

By receiving document generation instructions, using SQL scripts and API dynamic parameter values, querying the target data source, replacing placeholders to generate preliminary data documents, and rendering and adjusting through online editing instructions, generating the target document page, and realizing the format and content of the data Verify to ensure the accuracy and consistency of the data.

Benefits of technology

It has achieved standardization and unified reporting documents, reduced labor costs, improved data accuracy and timeliness, and simplified report management and comparative analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657135B_ABST
    Figure CN118657135B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of document generation, and discloses a document generation method, device and storage medium. The method comprises: receiving a document generation instruction, wherein the document generation instruction comprises: an SQL script, an API dynamic parameter value; based on the SQL script, querying a target data source in a preset template database; accessing a configuration URL address in the API dynamic parameter value, and obtaining a MAP parameter returned by the configuration URL address; replacing a placeholder in the target data source with the MAP parameter, and generating a preliminary data document; receiving an online editing instruction, rendering the preliminary data document online, and generating a rendering editing page; based on the online editing instruction, adjusting and processing the rendering editing page, and generating a target document page. In an embodiment of the present invention, by using a template format to impose editing constraints on a report document, standardization and unification of the report document are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of document generation, and in particular to a document generation method, device and storage medium. Background Art

[0002] In the business work of public budget and final accounts, reporting units need to disclose important data such as budget and final accounts reports on public websites every year. However, the current reporting method has many challenges, which affects efficiency and accuracy.

[0003] First, reporting units usually rely on traditional local terminals to generate documents. This method lacks unified format constraints and data verification mechanisms, resulting in different data types, formats, and data source calibers during the filling process. This not only makes it difficult to ensure the consistency and accuracy of the reported data, but also increases the complexity of data processing and the risk of errors.

[0004] Secondly, the traditional reporting method requires a lot of manpower for manual entry and review. Especially when dealing with a large amount of repeated information and requiring manual verification of content, the labor cost increases significantly. This method is not only time-consuming and labor-intensive, but also reduces the real-time and response speed of reporting, affecting the timeliness and accuracy of data.

[0005] In addition, reliance on traditional filling methods also poses challenges to the management and efficiency of report documents. The filling styles and quality vary among different units, making it difficult to conduct effective data comparison and analysis, and to achieve standardization and unification of reports.

[0006] Therefore, in view of the technical problem that the format of the report document is difficult to standardize, a technology is needed to solve the current problem. Summary of the invention

[0007] The main purpose of the present invention is to solve the technical problem that the format of report documents is difficult to standardize.

[0008] A first aspect of the present invention provides a document generation method, the document generation method comprising:

[0009] Receiving a document generation instruction, wherein the document generation instruction includes: an SQL script and an API dynamic parameter value;

[0010] Based on the SQL script, query the target data source in the preset template database;

[0011] Access the configuration URL address in the API dynamic parameter value, and obtain the MAP parameter returned by the configuration URL address;

[0012] Substituting the MAP parameters for the placeholders in the target data source to generate a preliminary data document;

[0013] Receiving an online editing instruction, rendering the preliminary data document online, and generating a rendering editing page;

[0014] Based on the online editing instruction, the rendering editing page is adjusted to generate a target document page.

[0015] Optionally, in a first implementation of the first aspect of the present invention, before receiving the document generation instruction, the method further includes:

[0016] Receive template upload data;

[0017] Parsing and processing the template uploaded data to obtain page configuration data;

[0018] Based on the page configuration data, a script review rule is generated, and the page configuration data is stored in a preset template database, and a template data source ID and a mapping relationship between the template data source ID and the script review rule are generated.

[0019] Optionally, in a second implementation of the first aspect of the present invention, querying the target data source in the preset template database based on the SQL script includes:

[0020] Read the specified data source ID in the SQL script;

[0021] Verify the SQL script according to the script audit rule corresponding to the specified data source ID to obtain a verification result;

[0022] When the verification result is qualified, the data corresponding to the specified data source ID is queried in the preset template database to obtain the target data source.

[0023] Optionally, in a third implementation of the first aspect of the present invention, the receiving an online editing instruction, performing online rendering on the preliminary data document, and generating a rendering editing page includes:

[0024] Based on the online editing instruction, generating a publishing ID;

[0025] According to the publishing ID, the preliminary data document is rendered online to generate a rendering editing page.

[0026] Optionally, in a fourth implementation of the first aspect of the present invention, adjusting the rendering editing page based on the online editing instruction to generate a target document page includes:

[0027] Reading the editing configuration of the online editing instruction;

[0028] According to the editing configuration, dynamically replacing the preliminary data document corresponding to the rendering editing page to generate an editing data document;

[0029] According to the editing data document, the rendering editing page is subjected to rendering adjustment processing to obtain a target document page.

[0030] Optionally, in a fifth implementation of the first aspect of the present invention, after dynamically replacing the preliminary data document corresponding to the rendering editing page according to the editing configuration to generate the editing data document, and before performing rendering adjustment processing on the rendering editing page according to the editing data document to obtain the target document page, the method further includes:

[0031] According to preset audit rules, the format and content of the edited data document are verified to obtain a verification result;

[0032] When the verification result is unqualified, an error message is returned to the browser corresponding to the rendering editing page, and the error data in the rendering editing page is highlighted;

[0033] When the verification result is qualified, the editing data document is transmitted to the browser corresponding to the rendering editing page.

[0034] Optionally, in a sixth implementation of the first aspect of the present invention, after adjusting the rendering editing page based on the online editing instruction to generate a target document page, the method further includes:

[0035] When a confirmation instruction is received, the edited data document is output as a target data document.

[0036] Optionally, in a seventh implementation of the first aspect of the present invention, the target data source includes: an editable area and a non-editable area, and replacing the placeholder in the target data source with the MAP parameter to generate the preliminary data document includes:

[0037] The MAP parameters are used to replace the placeholders in the editable area of ​​the target data source to generate a preliminary data document.

[0038] The second aspect of the present invention provides a document generation method device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the document generation method device executes the above-mentioned document generation method.

[0039] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned document generation method.

[0040] In an embodiment of the present invention, by managing the template settings and obtaining template data in a targeted manner, as well as adapting the business code to various types of template data filling without any changes, the user can edit, modify and review the document content on the browser side. By utilizing the template format to impose editing constraints on the report document, the standardization and unification of the report document is achieved, solving the technical problem that the current format of the report document is difficult to standardize. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A schematic diagram of an embodiment of a document generation method in an embodiment of the present invention;

[0042] Figure 2 It is a schematic diagram of a specific embodiment of step 106 of the document generation method in an embodiment of the present invention;

[0043] Figure 3 It is a schematic diagram of a specific embodiment after step 1062 and before step 1063 of the document generation method in an embodiment of the present invention;

[0044] Figure 4 The figure is a schematic diagram of an embodiment of a document generation method and device in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The embodiments of the present invention provide a document generation method, device and storage medium.

[0046] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0047] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0048] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the document generation method in the embodiment of the present invention includes:

[0049] 101. Receive a document generation instruction, wherein the document generation instruction includes: an SQL script and an API dynamic parameter value;

[0050] In this embodiment, when a document generation instruction is received, the document generation instruction includes a configuration definition data acquisition SQL script, a dynamic parameter field, and a configuration data acquisition SQL pointing to a target data source (ie, a target template).

[0051] Furthermore, before step 101, the following specific implementation is also included:

[0052] 1011. Receive template upload data;

[0053] 1012. Parse and process the template upload data to obtain page configuration data;

[0054] 1013. Generate script review rules based on the page configuration data, store the page configuration data in a preset template database, and generate a template data source ID and a mapping relationship between the template data source ID and the script review rules.

[0055] In steps 1011-1013, the user designs a template document with a fixed format and partially fixed content, uploads a template in docx or doc format, defines the template configuration fields such as business type, template number, template name, year, etc., and parses and stores the elements (custom placeholders, bookmarks, sections, tables) in the uploaded template file into the template database.

[0056] In the SQL script mode, you can write an SQL script, specify the template data source ID, store the custom script configuration in the database, get the result set fields by executing the read script, and store the field set in the template database for subsequent filling of document configuration mapping relationships.

[0057] The data source configuration mainly provides the template database connection configuration required for querying and filling the target template document content SQL script and auditing the verification rule SQL script. The configuration is saved in the template database to obtain the data source to generate a unique ID.

[0058] 102. Based on the SQL script, query the target data source in the preset template database;

[0059] In this embodiment, the key-value pair format result {"key1":"value01","key2":"value02"} or the key-value pair array [{"key1":"value01",key2":"value02"},{"key1","value03",key2":"value04"}] is returned according to the amount of data in the SQL query, and the SQL data set depends on the data source. It should be noted that multiple versions are defined in a template configuration to manage different scenarios where different users of the same template have different sources of dynamic value data such as partial bookmarks or tables, which include fields such as version number and version name.

[0060] Furthermore, step 102 includes the following specific implementations:

[0061] 1021. Read the specified data source ID in the SQL script;

[0062] 1022. Verify the SQL script according to the script verification rule corresponding to the specified data source ID to obtain a verification result.

[0063] 1023. When the verification result is qualified, the data corresponding to the specified data source ID is queried in the preset template database to obtain the target data source.

[0064] In steps 1021-1023, a specified data source ID is set in the SQL script, the specified data source ID is mapped with a script review rule, the SQL script syntax is verified, the field name of the returned result set is correctly obtained, and the data corresponding to the specified data source ID is queried from the template database, which is the target data source (template without business configuration data).

[0065] Target data source description: Bind the result set field name with the elements parsed in the version configuration module and template configuration, and bind the result set field to the database persistent table field mapping. The binding method is template element->dataset field->database field; define the placeholder type, and configure the text content and table content in detail; the text content configuration includes the target document template element bookmark, custom placeholder (if not filled, fill the entire bookmark), dataset name, dataset result set field, default value and other main configuration fields. Multiple custom placeholders can be replaced in one bookmark; the table content configuration includes the specified filling method (overwrite, dynamic addition), the starting filling row of the table, the target document template element (section number, table sequence number), dataset name, template element table column sequence number > database persistent table field > data result set field, whether to copy the table, merge cell parameters and other main configuration information. According to the filling method, the scenarios of fixed table rows and dynamically added rows are handled. According to whether to copy the table, the grouped result set data is copied to the same format table sample to fill the grouped result scenario. According to the merge cell parameters, the scenario of some cell rows of dynamically added rows needs to be merged.

[0066] 103. Access the configuration URL address in the API dynamic parameter value, and obtain the MAP parameter returned by the configuration URL address;

[0067] In this embodiment, the API method configures the URL request address method, needs to configure the requested API interface address, and needs to configure the interface return result field column set for accepting the Map result set match returned by the interface.

[0068] In software documentation, MAP parameters may refer to parameters in a certain settings or configuration file that control the behavior or functionality of the software. This may involve various specific software functions and settings, such as map data parameters in a map application, print output settings, etc.

[0069] 104. Replace the placeholder in the target data source with the MAP parameter to generate a preliminary data document;

[0070] In this embodiment, the placeholder is obtained by parsing the document in a custom format, with the content enclosed in curly brackets in the format of p_custom identifier {p_XX}, and is bound according to the mapping relationship between the specified data set result set field and the target document placeholder configuration for subsequent database persistence and document filling. The default value field is used to set the replacement content when the value is empty. The custom placeholder is not limited to replacing text content. The target document placeholder can be positioned and inserted into charts, attachments, etc. according to the online editing configuration. The custom placeholder can only replace the target document once.

[0071] Text content mapping is a method of marking the content between specified content AB in the target template file with bookmarks, replacing the text content according to the defined data set, data set field, bookmark, and custom placeholder. By combining bookmarks with custom placeholders, part of the content in the bookmark is replaced according to the mapping, so that the entire section can be edited and modified according to the bookmark when the document is generated for the first time based on the data acquisition results and then modified again.

[0072] Table content mapping is a method of operating the table content by binding the data set configuration to the target document table number and section number. The mapping relationship is defined according to the configuration data set result field and the database persistence table and the column number of the target document table, and the starting replacement row is defined. The data set result is specified to be filled from the specified row of the table through the starting replacement row. The filling method is defined to specify that the result set is to copy the table rows according to the total number of results to dynamically add new filling or to overwrite the cell content from the specified row. For the filling method, the dynamic new filling configuration scenario is specified, and the merged cell configuration is defined. For example, if the table has 5 columns and the mapping field only configures 4 and 5 columns, 1-2-3 needs to be merged. The merged cell configuration includes merged columns and the number of merged rows of the initial template. It is defined whether to copy the table. For the same table, it needs to be copied multiple times according to the grouped result set to fill different content scenarios. For example, there is performance business in the business system, and one competent department manages multiple units, and different evaluation contents need to be filled in the same table for multiple units.

[0073] The MAP parameters are replaced with placeholders in the target data source according to the set rules to obtain a preliminary data document.

[0074] Further, the target data source includes: an editable area and a non-editable area, and step 104 includes the following specific implementations:

[0075] 1041. Replace the placeholder in the editable area of ​​the target data source with the MAP parameter to generate a preliminary data document.

[0076] In this embodiment, the target data source may limit the editable area and the non-editable area, and the MAP parameters filled with business data can only modify the placeholders in the editable area of ​​the target data source to generate a preliminary data document.

[0077] Business system administrators upload fixed templates or templates with partially fixed content, classify and define them according to different businesses, and can check the financial divisions to authorize the corresponding division system implementation personnel to perform subsequent management, release and generation operations.

[0078] 105. Receive an online editing instruction, render the preliminary data document online, and generate a rendering editing page;

[0079] In this embodiment, after receiving the online editing instruction, the preliminary data document is rendered to generate a rendering editing page.

[0080] The rendering editing page includes:

[0081] 1. Online text, according to the template configuration definition, the text content and rendering method in the document presented on the browser page, including primary text and secondary text configuration. The primary text is the result of the splicing of the secondary text content. The configured text segment includes parameters such as the inner margin of the next line, the outer margin of the upper and lower lines, and the line height. The secondary text configuration package configures detailed parameters for the first-level text content coordinates AB and BC points, including the default content field, whether it can be edited, the type of edit box (single-line text, multi-line text, amount, number), font size, font color, bold font, template element bookmark, etc. The content style configuration of different text segments in a primary text segment is saved in the database; according to the bound template element bookmark mapping, the result set field corresponding to the bookmark in the database is dynamically obtained for dynamic value rendering instead of the default content field.

[0082] 2. Online tables define the table content and rendering method in the document presented on the browser page according to the template configuration. The table is configured in a single table dimension. The table includes cell rows and columns, which are configured in detail for each fixed cell style. Each field configuration includes cell merging, cell binding bookmarks, font, color, size, top and bottom margins, whether it is editable, editable input type (number, single-line text, multi-line text, amount, etc.), document table sequence number, section number element, default content, etc., which are saved in the database. Table rendering queries data results from the database according to the data acquisition configuration mapping relationship. The table rows are copied according to the fill start row field and the total number of rows of queried data content to control the number of newly copied rows and fill or overwrite the content of the fixed table format.

[0083] 3. Online charts: Define the chart content and rendering method in the document presented on the browser page according to the template configuration. Customize the placeholders, data sets, select the chart type (bar chart, pie chart, line chart, dashboard, architecture diagram, etc.), chart style default parameters, and Y-axis and X-axis JSON format parameters according to the configuration and store them in the library table; generate the chart at the specified location in the online editing page according to the chart configuration, and then convert the image format after editing and insert it into the document coordinates where the custom placeholder is located.

[0084] 4. Online protection editing page, according to the template configuration, text configuration, table configuration, the entire word template presented on the browser page or a specified piece of content combination fixed format and content, through the data acquisition configuration, and the release of the generated ID to obtain the template database persistent table result set data to dynamically replace the page configuration bookmarks, tables rendering, which includes two layers of configuration, the first layer configuration directory name, directory level, etc., the second layer configuration association type (text configuration, table configuration, chart configuration, attachment configuration), in a one-to-many manner, according to the first-level configuration is used to click the directory in the page to quickly locate the corresponding content position, you can split the configuration of multiple page configurations according to the directory in the template document, to achieve a page configuration data when clicking the directory to handle documents with large data volume to flexibly adjust the combination configuration; attachment configuration according to the corresponding directory in accordance with the order of the position of the upload plug-in, users can upload doc, docx, excel, pdf in the protection editing page and merge them into the target document at the specified position of the target document configuration.

[0085] Furthermore, step 105 includes the following specific implementations:

[0086] 1051. Generate a publishing ID based on the online editing instruction;

[0087] 1052. Render the preliminary data document online according to the publishing ID to generate a rendering editing page.

[0088] In steps 1051-1052, the user selects a publishing data to be specified in the client browser, sends an online editing instruction to pass the corresponding publishing ID to the server interface, and renders the preliminary data document online based on the publishing ID to generate a rendering editing page.

[0089] 106. Based on the online editing instruction, adjust the rendering editing page to generate a target document page.

[0090] In this embodiment, the unit user logs in to the system in the client browser and loads the corresponding online editing page according to the permission configuration. The corresponding database persistent table information in the current published data and the online protection editing configuration information are queried according to the published data corresponding to the unit authority and the template content rendered by the client browser is returned. The user modifies and supplements the content in the editable area according to the editing configuration and finally generates the target document page.

[0091] Please refer to Figure 2 , Figure 2 The following is a schematic diagram of a specific embodiment of step 106 of the document generation method in an embodiment of the present invention. Step 106 includes the following specific implementation methods:

[0092] 1061. Read the editing configuration of the online editing instruction;

[0093] 1062. According to the editing configuration, dynamically replace the preliminary data document corresponding to the rendering editing page to generate an editing data document;

[0094] 1063. According to the editing data document, the rendering editing page is subjected to rendering adjustment processing to obtain a target document page.

[0095] In steps 1061-1063, the modified edit configuration may include:

[0096] 1. Online text configuration.

[0097] In the application scenario of this embodiment, the online text configuration module mainly provides the preset of fixed text content and text format definition in the designed template document, and binds bookmarks to dynamically replace the rendering configuration content. The specific steps for configuring multiple continuous texts are as follows:

[0098] 1) First-level text definition: add one or more continuous text paragraphs, set the paragraph top and bottom margins, line height, indentation, and alignment.

[0099] 2) Secondary text definition: split and configure a text paragraph with different styles and contents; set the style of the text through font, size, bold, color, and background color; and distinguish the fixed area and editable area of ​​the text through configurations such as editability, component type {display text, single-line text, multi-line text, number (integers, negatives, decimal places)}, bound bookmarks, and default content.

[0100] 2. Online form configuration.

[0101] In the application scenario of this embodiment, the online table configuration module mainly provides the preset of the table fixed content and table format definition in the designed template document, and binds sections, tables, and bookmarks to dynamically replace the rendering content. The specific steps for configuration through table rows and column cells are as follows:

[0102] 1) Cell row definition is a first-level configuration in table detail configuration. The fields include row number, whether the row is editable, row border, and other settings. It is mainly used to uniformly set the initial styles of multiple cells in a row.

[0103] 2) The cell column definition configuration refines the style of each cell. The fields include the default cell content, template bookmark binding, whether it is editable, edit box type {display text, single-line text, multi-line text, number (whole or negative, decimal place)}, number of merged cells, whether to display, alignment method, font, font size, color, background color, bold and other settings. The cell merging operation can control the number of horizontal merges according to the number of merged cells, control the vertical cell merging according to whether to display, and dynamically replace the target cell content value according to the bookmark binding.

[0104] 3) In the table, the data of the list result set is filled by configuring an initial style of one row, and the starting fill control copy target row is specified in the data acquisition configuration module to dynamically insert row results according to the data length. If there are multiple list result sets in a table, the table data is filled by inserting the starting fill row in reverse order of the starting row.

[0105] 3. Online chart configuration.

[0106] In the application scenario of this embodiment, the online chart configuration mainly provides the definition of chart content and rendering method in the document. According to the configuration, custom placeholders, data sets, selected chart types (bar charts, pie charts, line charts, dashboards, architecture diagrams, etc.), chart style default parameters, and Y-axis and X-axis JSON format parameters are stored in the library table; according to the chart configuration, a chart is generated at a specified location in the online editing page, and then after editing is completed, the image format is converted and inserted into the document coordinates where the custom placeholder is located.

[0107] 4. Online protection editing page configuration.

[0108] In the application scenario of this embodiment, the online protection editing page configuration mainly provides flexible arrangement and combination of online text configuration and online table configuration information, creates a directory according to the target template document format, configures multiple text, table, chart, attachment and other types of combinations and binds the directory for each directory, and the server outputs the configuration information to the browser in sequence for users to edit online.

[0109] 1) Directory definition configures the directory structure of the target template document, providing users with a location for clicking on a directory to jump to the corresponding content area. It includes fields such as directory name, directory level, and directory serial number.

[0110] 2) Associated binding: Configure one or more text, tables, charts, attachments or other configurations or components in a directory. Bind the directory in the configuration order, including fields such as binding type and target configuration.

[0111] Based on the modified data of the editing configuration, the preliminary data document corresponding to the rendering editing page is dynamically replaced to generate an editing data document, which is then transmitted back to the browser, and the rendering editing page is rendered and adjusted to generate a target document page.

[0112] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a specific embodiment after step 1062 and before step 1063 of the document generation method in an embodiment of the present invention, which includes the following specific implementation methods after step 1062 and before step 1063:

[0113] 10621. Perform format and content verification processing on the edited data document according to preset review rules to obtain a verification result;

[0114] 10622. When the verification result is unqualified, error information is returned to the browser corresponding to the rendering editing page, and the error data in the rendering editing page is highlighted;

[0115] 10623. When the verification result is qualified, the editing data document is transmitted to the browser corresponding to the rendering editing page.

[0116] In steps 10621-10623, the audit rules may be pre-set rules, or the content of the editable area may be audited and verified after the target template document content is edited and filled online. The data content and format of the text table are filled using SQL scripts or API interfaces according to the template configuration, online configuration binding, and data set binding associations to verify accuracy and consistency. The format and content of the edited data document are verified according to the audit rules to obtain the verification results. If the verification result is a verification failure, an error message is returned to the client to prompt modification and highlight the error content. If the verification result is qualified, the edited data document is passed to the browser corresponding to the rendered edit page so that the browser renders the edited data document to generate the target document page.

[0117] Specifically, after step 106, the following specific implementation methods are also included:

[0118] 107. When a confirmation instruction is received, the edited data document is output as a target data document.

[0119] In this embodiment, the target document page is not converted, but the edited data document of the intermediate data is output as the target data document. Because the edited data document format of the intermediate data is word and the target document page format is H5 page, outputting the edited data document of the intermediate data as the target data document can facilitate subsequent conversion into specified document formats such as PDF.

[0120] In an embodiment of the present invention, by managing the template settings and obtaining template data in a targeted manner, as well as adapting the business code to various types of template data filling without any changes, the user can edit, modify and review the document content on the browser side. By utilizing the template format to impose editing constraints on the report document, the standardization and unification of the report document is achieved, solving the technical problem that the current format of the report document is difficult to standardize.

[0121] Figure 4 4 is a schematic diagram of the structure of a document generation method device provided by an embodiment of the present invention. The document generation method device 400 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 410 (for example, one or more processors) and a memory 420, and one or more storage media 430 (for example, one or more mass storage devices) storing application programs 433 or data 432. Among them, the memory 420 and the storage medium 430 can be temporary storage or permanent storage. The program stored in the storage medium 430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the document generation method device 400. Furthermore, the processor 410 may be configured to communicate with the storage medium 430 to execute a series of instruction operations in the storage medium 430 on the document generation method device 400.

[0122] Based on the document generation method, the device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input and output interfaces 460, and / or one or more operating systems 431, such as Windows Serve, Mac OS X, Unix, Linux, Free BSD, etc. It can be understood by those skilled in the art that Figure 4 The document generation method device structure shown does not constitute a limitation on the device based on the document generation method, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0123] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the document generation method.

[0124] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0126] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A document generation method, characterized in that: Includes steps: Receiving a document generation instruction, wherein the document generation instruction includes: an SQL script and an API dynamic parameter value; Based on the SQL script, query the target data source in the preset template database; Access the configuration URL address in the API dynamic parameter value, and obtain the MAP parameter returned by the configuration URL address; Substituting the MAP parameters for the placeholders in the target data source to generate a preliminary data document; Receiving an online editing instruction, rendering the preliminary data document online, and generating a rendering editing page; Based on the online editing instruction, adjusting the rendering editing page to generate a target document page; Before receiving the document generation instruction, the method further includes: Receive template upload data; Parsing and processing the template uploaded data to obtain page configuration data; Generate script audit rules based on the page configuration data, store the page configuration data in a preset template database, generate a template data source ID and a mapping relationship between the template data source ID and the script audit rules; Wherein, querying the target data source in the preset template database based on the SQL script includes: Read the specified data source ID in the SQL script; Verify the SQL script according to the script audit rule corresponding to the specified data source ID to obtain a verification result; When the verification result is qualified, the data corresponding to the specified data source ID is queried in the preset template database to obtain the target data source.

2. The document generation method according to claim 1, characterized in that: The receiving of the online editing instruction, online rendering of the preliminary data document, and generating a rendering editing page comprises: Based on the online editing instruction, generating a publishing ID; According to the publishing ID, the preliminary data document is rendered online to generate a rendering editing page.

3. The document generation method according to claim 1, characterized in that: The adjusting the rendering editing page based on the online editing instruction to generate a target document page includes: Reading the editing configuration of the online editing instruction; According to the editing configuration, dynamically replacing the preliminary data document corresponding to the rendering editing page to generate an editing data document; According to the editing data document, the rendering editing page is subjected to rendering adjustment processing to obtain a target document page.

4. The document generation method according to claim 3, characterized in that: After dynamically replacing the preliminary data document corresponding to the rendering editing page according to the editing configuration to generate the editing data document, and before performing rendering adjustment processing on the rendering editing page according to the editing data document to obtain the target document page, the method further includes: According to preset audit rules, the format and content of the edited data document are verified to obtain a verification result; When the verification result is unqualified, an error message is returned to the browser corresponding to the rendering editing page, and the error data in the rendering editing page is highlighted; When the verification result is qualified, the editing data document is transmitted to the browser corresponding to the rendering editing page.

5. The document generation method according to any one of claims 4 or 3, characterized in that: After adjusting the rendering editing page based on the online editing instruction to generate a target document page, the method further includes: When a confirmation instruction is received, the edited data document is output as a target data document.

6. The document generation method according to claim 1, characterized in that: The target data source includes: an editable area and a non-editable area, and replacing the placeholder in the target data source with the MAP parameter to generate a preliminary data document includes: The MAP parameters are used to replace the placeholders in the editable area of ​​the target data source to generate a preliminary data document.

7. A document generation device, characterized in that: The document generation device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the document generation method device to execute the document generation method according to any one of claims 1 to 6.

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 according to any one of claims 1 to 6 is implemented.