CN112989782B - Method for automatic template configuration and report generation - Google Patents

Method for automatic template configuration and report generation Download PDF

Info

Publication number
CN112989782B
CN112989782B CN202110432936.1A CN202110432936A CN112989782B CN 112989782 B CN112989782 B CN 112989782B CN 202110432936 A CN202110432936 A CN 202110432936A CN 112989782 B CN112989782 B CN 112989782B
Authority
CN
China
Prior art keywords
template
report
data source
editing
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110432936.1A
Other languages
Chinese (zh)
Other versions
CN112989782A (en
Inventor
金震
张京日
张宪涛
张航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing SunwayWorld Science and Technology Co Ltd
Original Assignee
Beijing SunwayWorld Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing SunwayWorld Science and Technology Co Ltd filed Critical Beijing SunwayWorld Science and Technology Co Ltd
Priority to CN202110432936.1A priority Critical patent/CN112989782B/en
Publication of CN112989782A publication Critical patent/CN112989782A/en
Application granted granted Critical
Publication of CN112989782B publication Critical patent/CN112989782B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/253Grammatical analysis; Style critique
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Abstract

The invention provides a method for automatic template configuration and report generation, which comprises the following steps: step 1: developing a data source module based on a management system, maintaining a data source required by generating a report, and obtaining data source information based on business requirements; step 2: developing a report maintenance module based on the management system, and obtaining an initial report template based on service requirements; and step 3: in the process of editing the document online, according to the data source information and the initial report template, editing and generating a report template; and 4, step 4: associating the report template with report data to obtain an association result, and generating a report based on the association result; based on the management system and the online editing document, the report can be automatically generated by the user, the data source and the initial report template can be maintained and modified online according to the service requirement, the modification can be carried out at any time, and the modification can be carried out immediately, so that the report generation time is ensured.

Description

Method for automatic template configuration and report generation
Technical Field
The invention relates to the technical field of report automatic configuration, in particular to a method for automatic template configuration and report generation.
Background
There are many ways to generate reports, but there is no complete flow scheme from scratch with online editing usage, which is convenient for maintenance and immediate effect.
The existing process mainly comprises two types:
one is manual report compiling, the copying and pasting process is complicated and easy to make mistakes, and the efficiency is not high.
And the other method is that a developer locally edits a report template document according to a report template as expected, then the report template document is closely related with the back-end program assembly data logic, and a final report is generated by combining the report template and the data. The expected report in the scheme can not leave the development process of a management system software provider, the report template is closely connected with the logic for generating the report document and is not easy to change, if any information such as a certain section of characters or typesetting in the report needs to be changed, the report template nested in the program to the program logic for generating the report needs to be correspondingly modified to finally take effect, and the modification process is often fussy and irregular according to the development processes of different software providers, so that the expected time node for generating the report can be influenced.
Disclosure of Invention
The invention provides a method for automatic template configuration and report generation, which is based on a management system and an online editing document, realizes the automatic generation of a report by a user, carries out online maintenance and modification on a data source and an initial report template according to business requirements, and immediately takes effect when the modification is carried out at any time, thereby ensuring the time for generating the report.
The invention provides a method for automatic template configuration and report generation, which comprises the following steps:
step 1: developing a data source module based on a management system, maintaining a data source required by generating a report, and obtaining data source information based on business requirements;
step 2: developing a report maintenance module based on the management system, and obtaining an initial report template based on service requirements;
and step 3: in the process of editing the document online, according to the data source information and the initial report template, editing and generating a report template;
and 4, step 4: and associating the report template with report data to obtain an association result, and generating a report based on the association result.
In one possible way of realisation,
in step 1, based on the service requirement, obtaining the data source information includes:
defining the data source in SQL based on the data source module;
determining key information for configuring the data source according to business requirements;
defining a calling method of a data source based on the key information;
and matching the calling method with the key information, and obtaining data source information according to a matching result.
In one possible way of realisation,
in step 2, obtaining an initial report template based on the service requirement includes:
acquiring a dynamic template outline for storing and generating an initial report template based on service requirements;
acquiring template node information of the dynamic template based on the dynamic template outline, and acquiring a template file based on the node information;
acquiring general data of the dynamic template from the report maintenance module, and integrating the template file with the general data to obtain an initial report template;
based on the initial report template, carrying out query matching on template documents in the management system to obtain a matching result;
when the matching result meets a preset matching requirement, acquiring a corresponding template document in the management system as a target document;
otherwise, adding a blank template document as a target document in the management system;
and uploading the data corresponding to the initial report template to a target document of the management system.
In one possible way of realisation,
in step 3, in the process of editing the document online, according to the data source information and the initial report template, editing and generating a report template comprises:
step 301: acquiring a dynamic data source part according to the data source information;
step 302: obtaining a fixed content part according to the initial report template;
step 303: and in the process of editing the document online, editing the dynamic data source part and the fixed content part to generate a report template.
In one possible way of realisation,
in step 3, in the process of editing and generating a report template according to the data source information and the initial report template in the process of editing the document online, the method further comprises the step of processing the data source information, which comprises the following steps:
in the process of editing the document online, before editing and generating the report template according to the data source information and the initial report template, the method further comprises the following steps:
all the data source information is cached;
when a report template is generated by editing according to the data source information and the initial report template in the process of online document editing, the online document editing is used for searching the used data source information from all cached data source information and analyzing the data source information;
in the process of online document editing, after a report template is generated by editing according to the data source information and the initial report template, the online document editing is used for clearing all cached data source information;
and monitoring all buffered data source information in real time, editing the document on line when monitoring that an instruction for maintaining the data source information appears, emptying all buffered data source information, and buffering all maintained data source information.
In one possible way of realisation,
in step 4, associating the report template with report data to obtain an association result, and generating a report based on the association result includes:
acquiring report data of a user according to the management system, classifying the report data based on the category attribute information of the report data, and acquiring a plurality of groups of first type data;
setting a content identification method of each group of first type data based on the category attribute information of the plurality of groups of first type data, and classifying each group of first type data based on the identification method to obtain a plurality of groups of second type data;
setting data identifications for the second type data respectively based on the category attribute information and the content information of the second type data;
analyzing the report template to obtain a template code and a template attribute of the report template and obtain a plurality of modules of the report template;
acquiring first corresponding relations between the modules and the template codes, and determining calling parameters of the modules based on the first corresponding relations;
acquiring second corresponding relations between the modules and the template attributes, and determining attribute parameters of the modules based on the second corresponding relations;
determining template parameters of the report template based on the calling parameters and the attribute parameters, and associating the template parameters with an identification matching model to obtain a target identification model;
respectively inputting the data identification into the target identification matching model to obtain the matching degree between the data identification and the template parameter;
analyzing the matching degree, and selecting the data identifier corresponding to the maximum matching degree value and the template parameter to establish a matching relation;
associating the report template with report data based on the matching relation to obtain an association result;
and determining an interface of the report template based on the association result, and filling the report data into the report template based on the interface to generate a report.
In one possible way of realisation,
in step 301, obtaining a dynamic data source part according to the data source information includes:
acquiring dynamic data requirements in the process of editing a document online;
obtaining a query statement based on the dynamic data requirement;
performing semantic analysis on the query statement, and judging whether the semantic of the query statement is correct or not;
if the query statement is correct, converting the query statement into a syntax tree according to a semantic analysis result;
acquiring the node name and the node position of each node in the syntax tree to obtain the hierarchical structure of the syntax tree;
based on the hierarchical structure, obtaining a logical relation of the syntax tree, and generating a query plan based on the logical relation;
and inquiring the data source information based on the inquiry plan to obtain a dynamic data source part.
In one possible way of realisation,
in step 303, in the process of editing the document online, editing the dynamic data source part and the fixed content part, and generating a report template, the method further includes: monitoring the process of editing and generating the report template, wherein the process comprises the following steps:
inputting the dynamic data source part and the fixed content part into a data evaluation model respectively, evaluating the data quality results of the dynamic data source part and the fixed content part, and determining the data quality values of the dynamic data source part and the fixed content part according to the data quality results;
acquiring a working log when the dynamic data source part and the fixed content part are edited, and analyzing the working log to obtain the editing times, the editing time and an editing instruction;
determining an editing factor based on the editing instruction;
calculating and editing a report template according to the following formula and generating an editing quality value of the report template based on the working log;
Figure 54789DEST_PATH_IMAGE001
wherein Q represents an edit quality value of the report template, k represents the number of edits made to the dynamic data source portion and the fixed content portion,
Figure 238645DEST_PATH_IMAGE002
indicating an edit time for an ith edit of the dynamic data source portion and the fixed content portion,
Figure 342868DEST_PATH_IMAGE003
which represents the time of the standard editing process,
Figure 905567DEST_PATH_IMAGE004
the editing factor which represents the ith editing of the dynamic data source part and the fixed content part has the value range of (0, 1),
Figure 233780DEST_PATH_IMAGE005
the average editing factor is represented, and the value range is (0, 1);
judging whether the editing quality value is smaller than a preset quality value or not;
if yes, re-editing the dynamic data source part and the fixed content part;
otherwise, detecting the template quality of the report template, wherein the process is as follows:
comparing and analyzing the report template and a standard report template to obtain the similarity between the report template and the standard report template;
calculating a template quality value for the report template based on the data quality values of the dynamic data source portion and the fixed content portion according to the following formula;
Figure 725505DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 695735DEST_PATH_IMAGE007
a template quality value representing the report template,
Figure 440837DEST_PATH_IMAGE008
a data quality value representing a source portion of the dynamic data, taken as (0.5, 1),
Figure 80897DEST_PATH_IMAGE009
representing the dynamic data sourceThe value of the divided average data quality value is (0.6, 0.8),
Figure 911450DEST_PATH_IMAGE010
a data quality value representing the fixed content portion, taking a value of (0.5, 1),
Figure 419791DEST_PATH_IMAGE009
an average data quality value representing the fixed content portion, of (0.6, 0.8),
Figure 19400DEST_PATH_IMAGE011
representing the similarity between the report template and the standard report template, and taking the value as (0.6, 1);
judging whether the template quality value of the report template is smaller than a preset template quality value or not;
if so, re-acquiring the dynamic data source part and the fixed content part, editing the acquired new dynamic data source part and the fixed content part, and acquiring a new report template;
otherwise, the report template is saved.
Compared with the prior art, the invention provides a method for automatic template configuration and report generation, which has the following beneficial effects:
1. all configurations for automatically generating report documents can be accomplished off developers and software providers. The common flow in the existing implementation scheme is that a developer of a software provider edits a report template in a development environment off line based on report expectation, and needs to make the developer correspond a dynamic data part in the report template and a back-end assembly data part one by one, and finally the software provider delivers the template function of a certain type of report.
2. The use flow is simple and easy to operate. After the usage and the flow are briefly explained for the user, the user can finish the steps from configuration to report generation as required.
3. The template is modified at any time from editing and maintenance to report generation and is immediately effective. All the processes of the invention are on-line operation, the loop is buckled with the instant response, the redundant requirement development process is not required to wait, the report data source and the report template can trigger the updating of the corresponding cache after being modified on line, and the modification can be carried out at any time and the effect can be achieved instantly.
4. And once template configuration, generating reports for multiple times. The report templates can be classified according to the service types of the generated reports, and the reports can be generated for multiple times after one class of templates are dynamically filled with data according to the classification.
5. And the software development period is shortened. In the implementation scheme of the prior art, if a new report template needs to be drawn or an existing report template needs to be modified, a user needs to put forward a requirement to a software provider, and then a developer delivers the function after the development is completed.
6. And the software development investment cost is reduced. Based on the advantage 5, the corresponding requirement solution is provided while the software development period is shortened, and the software development input cost is reduced.
7. And the workload of developers is reduced. Based on the advantage 5, the software development period is shortened, and the workload of developers is reduced.
8. The user grasps the report function delivery time. If the report generation flow comprises a software provider, a developer and a tester, the completion time is possibly uncontrollable, based on the advantage 5, the whole process from the configuration of one report to the generation of the report is completed by a user, and the completion time of the user is controllable.
9. The expandability is strong, and most report generation scenes are met. The invention provides a scheme for automatic template configuration and report generation, which consists of a plurality of processes and can flexibly adjust the processes as required to meet various scenes for generating reports.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a method of automated template configuration and report generation in an embodiment of the present invention;
FIG. 2 is a flow chart illustrating the use of a method for automated template configuration and report generation in accordance with an embodiment of the present invention.
Fig. 3 is a flowchart illustrating an overall implementation of a method for automatic template configuration and report generation according to an embodiment of the present invention.
Fig. 4 is a flowchart illustrating a data source caching status of a method for automated template configuration and report generation according to an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
Example 1
The embodiment of the invention provides a method for automatic template configuration and report generation, which comprises the following steps of:
step 1: developing a data source module based on a management system, maintaining a data source required by generating a report, and obtaining data source information based on business requirements;
step 2: developing a report maintenance module based on the management system, and obtaining an initial report template based on service requirements;
and step 3: in the process of editing the document online, according to the data source information and the initial report template, editing and generating a report template;
and 4, step 4: and associating the report template with report data to obtain an association result, and generating a report based on the association result.
In this embodiment, a data source module is developed based on the management system, and includes the following fields: data source name, presentation type, SQL content, SQL condition, and enablement status.
In this embodiment, when a report maintenance module is developed based on the management system, the fields included in the development include: template name, service type, template file name, remark.
In this embodiment, the open source software of the online editing document is OnlyOffice, and the OnlyOffice is integrated under the management system.
In this embodiment, the overall flow chart of the implementation of the present invention is shown in fig. 3.
The beneficial effect of above-mentioned design is: based on the management system and online editing documents, automatic report generation by a user is realized, as shown in fig. 2, the use process of the invention is simple and easy to operate, and the use processes are all online operations, and are linked with each other to respond immediately, so that developers and software providers are separated, the redundant demand development process is not required to wait, online maintenance modification is carried out on a data source and an initial report template according to business demands, the modification is carried out at any time, and the modification is effective immediately, and the report generation time is ensured.
Example 2
Based on embodiment 1, an embodiment of the present invention provides a method for automatic template configuration and report generation, where, in step 1, obtaining data source information based on a service requirement includes:
defining the data source in SQL based on the data source module;
determining key information for configuring the data source according to business requirements;
defining a calling method of a data source based on the key information;
and matching the calling method with the key information, and obtaining data source information according to a matching result.
In this embodiment, the calling method is an SQL query data method defined according to the key information.
The beneficial effect of above-mentioned design is: the data source is defined in the SQL mode, the calling method of the data source is defined according to the business requirements, the corresponding data source information is obtained on line according to different business requirements and takes effect immediately, the data source information is provided for a report template generated subsequently, the time for generating the data source information is ensured, and therefore the time for generating the report is ensured.
Example 3
Based on the embodiment 1, the embodiment of the present invention provides a method for automatic template configuration and report generation, and in step 2, obtaining an initial report template based on a service requirement includes:
acquiring a dynamic template outline for storing and generating an initial report template based on service requirements;
acquiring template node information of the dynamic template based on the dynamic template outline, and acquiring a template file based on the node information;
acquiring general data of the dynamic template from the report maintenance module, and integrating the template file with the general data to obtain an initial report template;
based on the initial report template, carrying out query matching on template documents in the management system to obtain a matching result;
when the matching result meets a preset matching requirement, acquiring a corresponding template document in the management system as a target document;
otherwise, adding a blank template document as a target document in the management system;
and uploading the data corresponding to the initial report template to a target document of the management system.
In this embodiment, the template node information includes structure information of the template, content information of the template, layout information of the template, and the like.
In this embodiment, the preset requirement is to satisfy the template types stored in the corresponding template documents in the management system, the initial report templates are stored in different documents according to the types, and the report generation of one type of initial report template can be performed for multiple times according to the classification.
The beneficial effect of above-mentioned design is: the initial report template is obtained based on the service requirements, the corresponding initial report template is obtained on line according to different service requirements and is immediately effective, the initial report template is provided for the subsequent report generation template, the time for generating the initial report template is ensured, and therefore the time for generating the report is ensured.
Example 4
Based on embodiment 1, an embodiment of the present invention provides an automated template configuration and report generation method, in step 3, in a process of editing a document online, according to the data source information and an initial report template, editing and generating a report template includes:
step 301: acquiring a dynamic data source part according to the data source information;
step 302: obtaining a fixed content part according to the initial report template;
step 303: and in the process of editing the document online, editing the dynamic data source part and the fixed content part to generate a report template.
The beneficial effect of above-mentioned design is: in the process of editing the document online, the data source and the initial report template can be modified online in the process of automatically generating the report template according to the data source information and the initial report template, so that the modification can be immediately effective at any time, and the report generation time is ensured.
Example 5
Based on embodiment 1, an embodiment of the present invention provides an automated template configuration and report generation method, in step 3, in a process of editing and generating a report template according to the data source information and an initial report template in a process of editing and generating a document online, the method further includes processing the data source information, and includes:
in the process of editing the document online, before editing and generating the report template according to the data source information and the initial report template, the method further comprises the following steps:
all the data source information is cached;
when a report template is generated by editing according to the data source information and the initial report template, the online edited document searches for the used data source information from all the cached data source information and analyzes the data source information;
in the process of online document editing, after a report template is generated by editing according to the data source information and the initial report template, the online document editing is used for clearing all cached data source information;
and monitoring all cached data source information in real time, editing a document on line when monitoring that an instruction for maintaining the data source information appears, emptying all cached data source information, and buffering all maintained data source information.
The working principle of the design scheme is as follows: analyzing to obtain the maintained data source information used in the document, caching the used data source information according to the template data ID in the corresponding step two, as shown in FIG. 4, caching the template ID for use when the same template is tested and reports are generated for multiple times, and emptying the cache when the document is updated.
The beneficial effect of above-mentioned design is: caching the data source information before generating a report, and searching and analyzing used data source information from all cached data source information in the process of generating the report; the time consumption of frequent data source query is reduced, when the data source information is maintained and modified, the cache is automatically cleared to enable the modification to be immediately effective, and after the report is generated, the data source information cache is automatically cleared to enable the modification to be immediately effective.
Example 6
Based on embodiment 1, an embodiment of the present invention provides an automated template configuration and report generation method, in step 4, associating the report template with report data to obtain an association result, and generating a report based on the association result includes:
acquiring report data of a user according to the management system, classifying the report data based on the category attribute information of the report data, and acquiring a plurality of groups of first type data;
setting a content identification method of each group of first type data based on the category attribute information of the plurality of groups of first type data, and classifying each group of first type data based on the identification method to obtain a plurality of groups of second type data;
setting data identifications for the second type data respectively based on the category attribute information and the content information of the second type data;
analyzing the report template to obtain a template code and a template attribute of the report template and obtain a plurality of modules of the report template;
acquiring first corresponding relations between the modules and the template codes, and determining calling parameters of the modules based on the first corresponding relations;
acquiring second corresponding relations between the modules and the template attributes, and determining attribute parameters of the modules based on the second corresponding relations;
determining template parameters of the report template based on the calling parameters and the attribute parameters, and associating the template parameters with an identification matching model to obtain a target identification model;
respectively inputting the data identification into the target identification matching model to obtain the matching degree between the data identification and the template parameter;
analyzing the matching degree, and selecting the data identifier corresponding to the maximum matching degree value and the template parameter to establish a matching relation;
associating the report template with report data based on the matching relation to obtain an association result;
and determining an interface of the report template based on the association result, and filling the report data into the report template based on the interface to generate a report.
In this embodiment, the calling parameter is a custom function calling the report template.
In this embodiment, the attribute parameters include a template type, a template name, and the like.
In this embodiment, the interface calls an interface of operating Word or Excel document based on the Apache POI standard from a process required by the management system.
In this embodiment, the main operations of populating the report template with the report data are string replacement, inserting a form, inserting a picture, inserting a bookmark, and the like.
The beneficial effect of above-mentioned design is: the report template is associated with the report data to obtain an associated result, so that different associated results are obtained according to different report data through online operation, different reports are generated finally, the report is generated automatically by a user, and the operation of the user is simplified.
Example 7
Based on embodiment 4, the present invention provides a method for automatic template configuration and report generation, wherein in step 301, obtaining a dynamic data source part according to the data source information includes:
acquiring dynamic data requirements in the process of editing a document online;
obtaining a query statement based on the dynamic data requirement;
performing semantic analysis on the query statement, and judging whether the semantic of the query statement is correct or not;
if the query statement is correct, converting the query statement into a syntax tree according to a semantic analysis result;
acquiring the node name and the node position of each node in the syntax tree to obtain the hierarchical structure of the syntax tree;
based on the hierarchical structure, obtaining a logical relation of the syntax tree, and generating a query plan based on the logical relation;
and inquiring the data source information based on the inquiry plan to obtain a dynamic data source part.
In this embodiment, the query statement is an SQL query language.
The beneficial effect of above-mentioned design is: the query statement is analyzed to obtain a query plan, accuracy of obtaining a dynamic data source part is guaranteed, and a data basis is provided for report template generation.
Example 8
Based on embodiment 4, an embodiment of the present invention provides an automated template configuration and report generation method, in step 303, in a process of editing a document online, editing a dynamic data source portion and a fixed content portion, and generating a report template, further including: monitoring the process of editing and generating the report template, wherein the process comprises the following steps:
inputting the dynamic data source part and the fixed content part into a data evaluation model respectively, evaluating the data quality results of the dynamic data source part and the fixed content part, and determining the data quality values of the dynamic data source part and the fixed content part according to the data quality results;
acquiring a working log when the dynamic data source part and the fixed content part are edited, and analyzing the working log to obtain the editing times, the editing time and an editing instruction;
determining an editing factor based on the editing instruction;
calculating and editing a report template according to the following formula and generating an editing quality value of the report template based on the working log;
Figure 79629DEST_PATH_IMAGE001
wherein Q represents an edit quality value of the report template and k representsThe number of edits made to the dynamic data source portion and the fixed content portion,
Figure 397478DEST_PATH_IMAGE002
indicating an edit time for an ith edit of the dynamic data source portion and the fixed content portion,
Figure 443931DEST_PATH_IMAGE003
which represents the time of the standard editing process,
Figure 163625DEST_PATH_IMAGE004
the editing factor which represents the ith editing of the dynamic data source part and the fixed content part has the value range of (0, 1),
Figure 145488DEST_PATH_IMAGE005
the average editing factor is represented, and the value range is (0, 1);
judging whether the editing quality value is smaller than a preset quality value or not;
if yes, re-editing the dynamic data source part and the fixed content part;
otherwise, detecting the template quality of the report template, wherein the process is as follows:
comparing and analyzing the report template and a standard report template to obtain the similarity between the report template and the standard report template;
calculating a template quality value for the report template based on the data quality values of the dynamic data source portion and the fixed content portion according to the following formula;
Figure 950633DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure 800777DEST_PATH_IMAGE007
a template quality value representing the report template,
Figure 640557DEST_PATH_IMAGE008
a data quality value representing a source portion of the dynamic data, taken as (0.5, 1),
Figure 855638DEST_PATH_IMAGE009
an average data quality value representing the source portion of the dynamic data, of (0.6, 0.8),
Figure 305336DEST_PATH_IMAGE010
a data quality value representing the fixed content portion, taking a value of (0.5, 1),
Figure 959171DEST_PATH_IMAGE009
an average data quality value representing the fixed content portion, of (0.6, 0.8),
Figure 387879DEST_PATH_IMAGE011
representing the similarity between the report template and the standard report template, and taking the value as (0.6, 1);
judging whether the template quality value of the report template is smaller than a preset template quality value or not;
if so, re-acquiring the dynamic data source part and the fixed content part, editing the acquired new dynamic data source part and the fixed content part, and acquiring a new report template;
otherwise, the report template is saved.
In this embodiment, the editing factor is used to reflect the difficulty of the editing instruction, and the higher the difficulty, the larger the editing factor.
In the embodiment, the editing quality value is calculated through the editing times, the editing time and the editing instruction, whether the editing environment meets the requirements or not is judged according to the size of the editing quality value, and if the editing environment does not meet the requirements, re-editing is carried out, so that the editing quality is ensured, and the quality of generating the report template is ensured.
In the embodiment, the quality of the report template is calculated through the data quality values of the dynamic data source part and the fixed content part in the editing process of the report template and the similarity of the annotated report template, so that the stability and the accuracy of the report template are ensured.
The beneficial effect of above-mentioned design is: and monitoring the process of generating the report template by editing the document online, editing the dynamic data source part and the fixed content part and generating the report template, so that the quality of generating the report template is ensured and a foundation is provided for generating the report.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (7)

1. A method for automated template configuration and report generation, comprising:
step 1: developing a data source module based on a management system, maintaining a data source required by generating a report, and obtaining data source information based on business requirements;
step 2: developing a report maintenance module based on the management system, and obtaining an initial report template based on service requirements;
and step 3: in the process of editing the document online, according to the data source information and the initial report template, editing and generating a report template;
and 4, step 4: associating the report template with report data to obtain an association result, and generating a report based on the association result;
in step 2, obtaining an initial report template based on the service requirement includes:
acquiring a dynamic template outline for storing and generating an initial report template based on service requirements;
acquiring template node information of the dynamic template based on the dynamic template outline, and acquiring a template file based on the node information;
acquiring general data of the dynamic template from the report maintenance module, and integrating the template file with the general data to obtain an initial report template;
based on the initial report template, carrying out query matching on template documents in the management system to obtain a matching result;
when the matching result meets a preset matching requirement, acquiring a corresponding template document in the management system as a target document;
otherwise, adding a blank template document as a target document in the management system;
and uploading the data corresponding to the initial report template to a target document of the management system.
2. The method of claim 1, wherein the step 1 of obtaining data source information based on business requirements comprises:
defining the data source in SQL based on the data source module;
determining key information for configuring the data source according to business requirements;
defining a calling method of a data source based on the key information;
and matching the calling method with the key information, and obtaining data source information according to a matching result.
3. The method of claim 1, wherein in step 3, in the process of editing the document online, the editing and generating the report template according to the data source information and the initial report template comprises:
step 301: acquiring a dynamic data source part according to the data source information;
step 302: obtaining a fixed content part according to the initial report template;
step 303: and in the process of editing the document online, editing the dynamic data source part and the fixed content part to generate a report template.
4. The method according to claim 1, wherein in step 3, during the process of editing and generating the report template according to the data source information and the initial report template during the process of editing the document online, the method further comprises processing the data source information, including:
in the process of editing the document online, before editing and generating the report template according to the data source information and the initial report template, the method further comprises the following steps:
all the data source information is cached;
according to the data source information and the initial report template, when a report template is generated by editing, searching for the used data source information from all cached data source information, and analyzing;
in the process of editing the document online, after a report template is generated by editing according to the data source information and the initial report template, clearing all cached data source information;
monitoring all cached data source information in real time, when monitoring that an instruction for maintaining the data source information appears, clearing all cached data source information, and buffering all maintained data source information.
5. The method of claim 1, wherein in step 4, associating the report template with report data to obtain an association result, and generating a report based on the association result comprises:
acquiring report data of a user according to the management system, classifying the report data based on the category attribute information of the report data, and acquiring a plurality of groups of first type data;
setting a content identification method of each group of first type data based on the category attribute information of the plurality of groups of first type data, and classifying each group of first type data based on the identification method to obtain a plurality of groups of second type data;
setting data identifications for the second type data respectively based on the category attribute information and the content information of the second type data;
analyzing the report template to obtain a template code and a template attribute of the report template and obtain a plurality of modules of the report template;
acquiring first corresponding relations between the modules and the template codes, and determining calling parameters of the modules based on the first corresponding relations;
acquiring second corresponding relations between the modules and the template attributes, and determining attribute parameters of the modules based on the second corresponding relations;
determining template parameters of the report template based on the calling parameters and the attribute parameters, and associating the template parameters with an identification matching model to obtain a target identification model;
respectively inputting the data identification into the target identification matching model to obtain the matching degree between the data identification and the template parameter;
analyzing the matching degree, and selecting the data identifier corresponding to the maximum matching degree value and the template parameter to establish a matching relation;
associating the report template with report data based on the matching relation to obtain an association result;
and determining an interface of the report template based on the association result, and filling the report data into the report template based on the interface to generate a report.
6. The method of claim 3, wherein the step 301 of obtaining a dynamic data source part according to the data source information comprises:
acquiring dynamic data requirements in the process of editing a document online;
obtaining a query statement based on the dynamic data requirement;
performing semantic analysis on the query statement, and judging whether the semantic of the query statement is correct or not;
if the query statement is correct, converting the query statement into a syntax tree according to a semantic analysis result;
acquiring the node name and the node position of each node in the syntax tree to obtain the hierarchical structure of the syntax tree;
based on the hierarchical structure, obtaining a logical relation of the syntax tree, and generating a query plan based on the logical relation;
and inquiring the data source information based on the inquiry plan to obtain a dynamic data source part.
7. The method of claim 3, wherein in step 303, the dynamic data source portion and the fixed content portion are edited during online document editing, and the generating of the report template further comprises: monitoring the process of editing and generating the report template, wherein the process comprises the following steps:
inputting the dynamic data source part and the fixed content part into a data evaluation model respectively, evaluating the data quality results of the dynamic data source part and the fixed content part, and determining the data quality values of the dynamic data source part and the fixed content part according to the data quality results;
acquiring a working log when the dynamic data source part and the fixed content part are edited, and analyzing the working log to obtain the editing times, the editing time and an editing instruction;
determining an editing factor based on the editing instruction;
calculating and editing a report template according to the following formula and generating an editing quality value of the report template based on the working log;
Figure DEST_PATH_IMAGE002
wherein Q represents an edit quality value of the report template, k represents the number of edits made to the dynamic data source portion and the fixed content portion,
Figure DEST_PATH_IMAGE004
indicating an edit time for an ith edit of the dynamic data source portion and the fixed content portion,
Figure DEST_PATH_IMAGE006
which represents the time of the standard editing process,
Figure DEST_PATH_IMAGE008
the editing factor which represents the ith editing of the dynamic data source part and the fixed content part has the value range of (0, 1),
Figure DEST_PATH_IMAGE010
the average editing factor is represented, and the value range is (0, 1);
judging whether the editing quality value is smaller than a preset quality value or not;
if yes, re-editing the dynamic data source part and the fixed content part;
otherwise, detecting the template quality of the report template, wherein the process is as follows:
comparing and analyzing the report template and a standard report template to obtain the similarity between the report template and the standard report template;
calculating a template quality value for the report template based on the data quality values of the dynamic data source portion and the fixed content portion according to the following formula;
Figure DEST_PATH_IMAGE012
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE014
a template quality value representing the report template,
Figure DEST_PATH_IMAGE016
a data quality value representing a source portion of the dynamic data, taken as (0.5, 1),
Figure DEST_PATH_IMAGE018
an average data quality value representing the source portion of the dynamic data, of (0.6, 0.8),
Figure DEST_PATH_IMAGE020
a data quality value representing the fixed content portion, taking a value of (0.5, 1),
Figure 409329DEST_PATH_IMAGE018
an average data quality value representing the fixed content portion, of (0.6, 0.8),
Figure DEST_PATH_IMAGE022
representing the similarity between the report template and the standard report template, and taking the value as (0.6, 1);
judging whether the template quality value of the report template is smaller than a preset template quality value or not;
if so, re-acquiring the dynamic data source part and the fixed content part, editing the acquired new dynamic data source part and the fixed content part, and acquiring a new report template;
otherwise, the report template is saved.
CN202110432936.1A 2021-04-22 2021-04-22 Method for automatic template configuration and report generation Active CN112989782B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110432936.1A CN112989782B (en) 2021-04-22 2021-04-22 Method for automatic template configuration and report generation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110432936.1A CN112989782B (en) 2021-04-22 2021-04-22 Method for automatic template configuration and report generation

Publications (2)

Publication Number Publication Date
CN112989782A CN112989782A (en) 2021-06-18
CN112989782B true CN112989782B (en) 2021-08-27

Family

ID=76341568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110432936.1A Active CN112989782B (en) 2021-04-22 2021-04-22 Method for automatic template configuration and report generation

Country Status (1)

Country Link
CN (1) CN112989782B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036919B (en) * 2021-11-23 2022-05-24 北京三维天地科技股份有限公司 Electronic experiment record book management method and system
CN114398865B (en) * 2022-01-17 2023-01-10 广州天维信息技术股份有限公司 Performance report generation method, device, storage medium and computer equipment
CN114661751B (en) * 2022-03-22 2023-01-31 医渡云(北京)技术有限公司 Data production method, device, system, equipment and medium based on SQL (structured query language) knowledge base
CN115048915B (en) * 2022-08-17 2022-11-01 国网浙江省电力有限公司 Data processing method and system of electric power file based on operation platform
CN115796140B (en) * 2022-11-03 2023-09-05 广州天维信息技术股份有限公司 Report automatic generation and report template configuration method and device
CN116303641B (en) * 2023-02-01 2023-10-20 北京三维天地科技股份有限公司 Laboratory report management method supporting multi-data source visual configuration

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111344A1 (en) * 2002-06-18 2004-06-10 Fetter David S. Financial data reporting system
CN106649223A (en) * 2016-12-23 2017-05-10 北京文因互联科技有限公司 Financial report automatic generation method based on natural language processing
CN106681978A (en) * 2017-03-09 2017-05-17 山东浪潮商用系统有限公司 User-defined tax analysis monitoring report generation method
CN109255112A (en) * 2018-08-29 2019-01-22 中国信息通信研究院 A kind of report automatic generation method and system
CN110489462A (en) * 2019-08-23 2019-11-22 行吟信息科技(上海)有限公司 A kind of method and system of automatically generated data report
CN111178027A (en) * 2019-12-09 2020-05-19 北京尊冠科技有限公司 Report generation system and method based on online creation template and online specified data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457664A (en) * 2019-08-09 2019-11-15 同方知网(北京)技术有限公司 A kind of content dynamic reconfiguration method based on template
CN110674441A (en) * 2019-09-02 2020-01-10 中国平安财产保险股份有限公司 Page template configuration control method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040111344A1 (en) * 2002-06-18 2004-06-10 Fetter David S. Financial data reporting system
CN106649223A (en) * 2016-12-23 2017-05-10 北京文因互联科技有限公司 Financial report automatic generation method based on natural language processing
CN106681978A (en) * 2017-03-09 2017-05-17 山东浪潮商用系统有限公司 User-defined tax analysis monitoring report generation method
CN109255112A (en) * 2018-08-29 2019-01-22 中国信息通信研究院 A kind of report automatic generation method and system
CN110489462A (en) * 2019-08-23 2019-11-22 行吟信息科技(上海)有限公司 A kind of method and system of automatically generated data report
CN111178027A (en) * 2019-12-09 2020-05-19 北京尊冠科技有限公司 Report generation system and method based on online creation template and online specified data

Also Published As

Publication number Publication date
CN112989782A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112989782B (en) Method for automatic template configuration and report generation
CN111522816B (en) Data processing method, device, terminal and medium based on database engine
CN109582647B (en) Unstructured evidence file oriented analysis method and system
CN108762743B (en) Data table operation code generation method and device
CN110134613B (en) Software defect data acquisition system based on code semantics and background information
CN104133772A (en) Automatic test data generation method
CN101071378A (en) Source code generation method, apparatus and program
CN112328489B (en) Test case generation method and device, terminal equipment and storage medium
CN110543303A (en) Visual business platform
CN115576984A (en) Method for generating SQL (structured query language) statement and cross-database query by Chinese natural language
CN114281342A (en) Automatic code generation method
CN114372118A (en) Audit knowledge recommendation system and method based on recursive algorithm
CN112347120B (en) Automatic optimization method and device based on complex SQL
CN116303641B (en) Laboratory report management method supporting multi-data source visual configuration
CN112506488A (en) Method for generating programming language class based on sql creating statement
CN111753536A (en) Automatic patent application text writing method and device
CN115469860B (en) Method and system for automatically generating demand-to-software field model based on instruction set
CN116661756A (en) Object analysis method and device based on low-code DSL
CN112070224B (en) Revision system and method of samples for neural network training
CN107577476A (en) A kind of Android system source code difference analysis method, server and medium based on Module Division
CN113157691A (en) Configurable data searching method and system
CN110928535A (en) Derivative variable deployment method, device, equipment and readable storage medium
CN112130841B (en) SQL development method and device and terminal equipment
CN117009422B (en) Method for realizing data import by convenience business personnel
CN117389541B (en) Configuration system and device for generating template based on dialogue retrieval

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant