Customizable report generation method and device, computer equipment and storage medium

文档序号:1922117 发布日期:2021-12-03 浏览:2次 中文

阅读说明:本技术 可定制的报表生成方法、装置、计算机设备及存储介质 (Customizable report generation method and device, computer equipment and storage medium ) 是由 许少伟 魏聪惠 于 2021-08-30 设计创作,主要内容包括:本文涉及计算机技术领域,适用于金融领域,尤其涉及一种可定制的报表生成方法、装置、计算机设备及存储介质。其方法包括,获取终端用户的报表定制请求,所述报表定制请求中包括报表样例;根据所述报表定制请求,生成所述终端用户的与所述报表样例相同的报表模板,所述报表模板中包括与所述报表样例对应的报表参数;获取包括终端用户数据的报表生成指令;根据所述报表生成指令以及所述报表模板,生成报表。通过本文的方法,实现了根据终端用户的需求定制个性化报表,并提高了报表生成的效率,提高系统的稳定性。(The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a customizable report, a computer device, and a storage medium. The method comprises the steps of obtaining a report customization request of a terminal user, wherein the report customization request comprises a report sample; generating a report template which is the same as the report sample of the terminal user according to the report customizing request, wherein the report template comprises report parameters corresponding to the report sample; acquiring a report generation instruction comprising terminal user data; and generating a report according to the report generating instruction and the report template. By the method, the personalized report can be customized according to the requirements of the terminal user, the report generation efficiency is improved, and the system stability is improved.)

1. A customizable report generation method, characterized in that the method comprises,

acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

generating a report template identical to the report sample according to the report customizing request, wherein the report template comprises report parameters corresponding to the report sample;

acquiring a report generation instruction comprising terminal user data;

and generating a report according to the terminal user data in the report generating instruction and the report template.

2. The customizable report generation method of claim 1, wherein generating a report template identical to the report sample according to the report customization request further comprises,

analyzing the report customization request to obtain data in the report sample;

dividing the data in the report sample into fixed data and dynamic data according to the characteristics of the data in the report sample;

generating the report parameters according to the dynamic data;

and generating the report template according to the report parameters and the fixed data.

3. The customizable report generation method of claim 2, wherein the dividing of the data in the reporting sample into fixed data and dynamic data according to the characteristics of the data in the reporting sample further comprises,

extracting the characteristics of the data in the report sample;

matching the features with a preset feature set, wherein the preset feature set comprises a dynamic feature set corresponding to dynamic data and a fixed feature set corresponding to fixed data;

and dividing the data in the report sample with the characteristics conforming to the dynamic characteristic set into dynamic data, and dividing the data in the report sample with the characteristics conforming to the fixed characteristic set into fixed data.

4. The customizable report generation method of claim 2, wherein generating the report parameters according to the dynamic data further comprises,

and analyzing the format of the dynamic data, and converting the dynamic data into the report parameters with the data format corresponding to the data value.

5. The customizable report generation method of claim 1, wherein generating a report template identical to the report sample according to the report customization request further comprises,

recording the corresponding relation between the terminal user and the report template;

and controlling the terminal user to modify the report template according to the corresponding relation.

6. The customizable report generation method of claim 1, wherein generating a report according to the report generation instruction and the report template further comprises,

analyzing the report generation instruction to obtain the terminal user data;

and filling the terminal user data into the report template according to the corresponding relation between the terminal user data and the report parameters to generate a report.

7. The customizable report generation method of claim 1, wherein obtaining report generation instructions comprising end-user data further comprises,

receiving a report generation instruction which is sent by the terminal user and comprises the terminal user data; or the like, or, alternatively,

and acquiring the terminal user data corresponding to the report parameters at regular time, and generating a report generation instruction according to the terminal user data.

8. The customizable report generation method of claim 7, wherein receiving report generation instructions sent by the end user that include the end user data further comprises,

and storing the received report generation instruction sent by the terminal user into a message queue according to a receiving time sequence so as to read the report generation instruction from the message queue in sequence, analyze the report generation instruction and generate a report.

9. The customizable report generation method according to claim 1, further comprising, after generating the report template identical to the report sample according to the report customization request,

splitting the report template into a plurality of sub-report templates according to the format of the report template content;

splitting the report parameters into a plurality of sub-report parameters for generating the sub-report template according to the sub-report template;

acquiring a report generation instruction comprising the terminal user data, wherein the terminal user data corresponds to the sub-report parameters;

splitting the report generation instruction into a plurality of sub-report generation instructions according to the sub-report parameters;

generating a plurality of sub-reports according to the sub-report generation instruction and the sub-report template;

and combining the sub-reports into the report.

10. The customizable report generation method according to claim 9, wherein splitting the report template into a plurality of sub-report templates according to the format of the report template content further comprises recording an association relationship between the plurality of sub-report templates;

merging the plurality of sub-reports into the report further comprises,

and merging the sub-reports according to the association relationship among the sub-report templates and the content in each sub-report.

11. The customizable report generation method of claim 9, wherein generating a plurality of sub-reports according to the sub-report generation instructions and the sub-report template further comprises,

and according to the sub-report generation instruction and the sub-report template, generating the sub-reports concurrently.

12. The customizable report generation method according to claim 1, wherein after generating a report according to the report generation instruction and the report template, further comprising,

and converting the format of the report according to the report format requirement of the terminal user so as to facilitate the terminal user to operate the content in the report.

13. A customizable report generation apparatus, comprising,

the report customizing request acquiring unit is used for acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

the report template generating unit is used for generating a report template which is the same as the report sample according to the report customizing request, and the report template comprises report parameters corresponding to the report sample;

the report generation instruction acquisition unit is used for acquiring a report generation instruction comprising terminal user data;

and the report generation unit generates a report according to the terminal user data in the report generation instruction and the report template.

14. A computer device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, performs the instructions of the method of any one of claims 1-12.

15. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor of a computer device, executes instructions of a method according to any one of claims 1-12.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for generating a customizable report, a computer device, and a storage medium.

Background

With the continuous development of science and technology, the summarization and analysis of data become the focus of attention in the computer technical field, and in the prior art, data are analyzed by making a report, the current situation is shown, the difference between the data and a target is determined, and the report is further used for follow-up guidance for improving schemes and action plans.

In the prior art, reports are mostly generated by using an Apache POI or Jasperreport report generation tool, but the reports generated by the Apache POI report generation tool are too simple and are not suitable for reports with complex service indexes and various display forms, the generated report generation template has poor reusability, the generated report format is single, and the user cannot operate the report content. Although the Jasperreport report generation tool can support the graphical drawing of the report template, the Jasperreport report generation tool needs to be manually drawn according to the description of a client by a worker, the drawn report style is greatly different from the report style required by the client, the drawn report cannot be directly edited by the user, the customizability of the report is low, in addition, the Jaspeerrport report generation tool is poor in performance, when the size of the generated report exceeds 20M, the consumed time is high, the system occupies more resources, and when the report is generated in batches, the system is poor in stability, and equipment downtime may occur.

A customizable report generation method is needed to solve the problems of low report customizability, low report generation efficiency and poor stability in the prior art.

Disclosure of Invention

In order to solve the problems of low report customizability, low report generation efficiency and poor stability in the prior art, embodiments herein provide a customizable report generation method and apparatus, which can customize a report template individually according to a report sample of a terminal user, and generate a report with the same format as the report sample according to the terminal user data and the report template. The method and apparatus of the embodiments herein may be applied to the financial field, such as application scenarios like banking, and may also be applied to other relevant scenarios, which are not limited herein.

The embodiment of the invention provides a customizable report generation method, which comprises the following steps,

acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

generating a report template identical to the report sample according to the report customizing request, wherein the report template comprises report parameters corresponding to the report sample;

acquiring a report generation instruction comprising terminal user data;

and generating a report according to the terminal user data in the report generating instruction and the report template.

Embodiments herein also provide a customizable report generation apparatus, including,

the report customizing request acquiring unit is used for acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

the report template generating unit is used for generating a report template which is the same as the report sample according to the report customizing request, and the report template comprises report parameters corresponding to the report sample;

the report generation instruction acquisition unit is used for acquiring a report generation instruction comprising terminal user data;

and the report generation unit generates a report according to the terminal user data in the report generation instruction and the report template.

Embodiments herein also provide a computer device comprising a memory, a processor, and a computer program stored on the memory, the processor implementing the above-described method when executing the computer program.

Embodiments herein also provide a computer storage medium having a computer program stored thereon, the computer program, when executed by a processor of a computer device, performing the above-described method.

By utilizing the embodiment, the report customizing request of the terminal user is obtained, the report template of the terminal user is generated according to the report sample in the report customizing request of the terminal user, the customized personalized report is customized according to the requirement of the terminal user, the problem of low report customizing performance in the prior art is solved, the report generating instruction comprising the data of the terminal user is obtained, the report is generated according to the report generating instruction and the report template, the report generating efficiency is improved, and the stability of the system is improved.

Drawings

In order to more clearly illustrate the embodiments or technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a schematic structural diagram of a customizable report generation apparatus according to an embodiment of the present disclosure;

FIG. 2 is a flow chart illustrating a customizable report generation method according to an embodiment of the disclosure;

FIG. 3 is a detailed block diagram of a customizable report generation apparatus according to an embodiment of the present disclosure;

FIG. 4 is a flowchart illustrating generating a report template according to a report sample according to an embodiment of the present disclosure;

FIG. 5 is a flowchart illustrating generating a report according to a report template and end user data according to an embodiment of the present disclosure;

FIG. 6 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;

[ description of reference ]:

101. a report customization request acquisition unit;

102. a report template generating unit;

103. a report generation instruction acquisition unit;

104. a report generation unit;

301. a report customization request acquisition unit;

302. a report template generating unit;

3021. a data format conversion module;

3022. a data analysis module;

3023. a report parameter construction module;

3024. a report template generation module;

3025. a report template splitting module;

3026. a report template storage module;

303. a report generation instruction acquisition unit;

3031. a report generation instruction receiving module;

30311. a message queue submodule;

3032. a report generation instruction building module;

30321. a timing submodule;

30322. a data acquisition submodule;

304. a report generation unit;

3041. a data analysis module;

3042. an instruction splitting module;

3043. a sub-report generation module;

3044. a report merging module;

3045. a report storage module;

3046. a report format conversion module;

3047. a report sending module;

602. a computer device;

604. a processing device;

606. a storage resource;

608. a drive mechanism;

610. an input/output module;

612. an input device;

614. an output device;

616. a presentation device;

618. a graphical user interface;

620. a network interface;

622. a communication link;

624. a communication bus.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments herein without making any creative effort, shall fall within the scope of protection.

Fig. 1 is a schematic structural diagram of a customizable report generation apparatus according to an embodiment of the present disclosure, including: a report customizing request obtaining unit 101, a report template generating unit 102, a report generating instruction obtaining unit 103, and a report generating unit 104.

The report customizing request obtaining unit 101 obtains a report customizing request of a terminal user, wherein the report customizing request includes a report sample. In the embodiment of the present disclosure, the report sample may be a Microsoft Word document;

the report template generating unit 102 generates a report template identical to the report sample according to the report sample in the report customizing request of the terminal user, which is acquired by the report customizing request acquiring unit 101, wherein the report template comprises report parameters corresponding to the report sample;

the report generation instruction acquisition unit 103 acquires a report generation instruction including terminal user data;

the report generation unit 104 generates a report according to the terminal user data in the report generation instruction of the user acquired by the report generation instruction acquisition unit 103 and the report template of the terminal user generated by the report template generation unit 102. In an embodiment herein, the report may be a Microsoft Word document.

Fig. 2 is a flow chart of a customizable report generation method according to an embodiment of the present disclosure, and specifically describes a process of generating a customizable report in the present drawing, which specifically includes:

step 201: acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

step 202: generating a report template identical to the report sample according to the report customizing request, wherein the report template comprises report parameters corresponding to the report sample;

step 203: acquiring a report generation instruction comprising terminal user data;

step 204: and generating a report according to the terminal user data in the report generating instruction and the report template.

By the method of the embodiment, the report customizing request of the terminal user is obtained, the report template of the terminal user is generated according to the report customizing request of the terminal user, the personalized report is customized according to the requirement of the terminal user, the problem of low report customizing performance in the prior art is solved, then the report generating instruction comprising the data of the terminal user is obtained, and the report is generated according to the report template of the terminal user and the data of the terminal user, so that the report generating efficiency is improved, and the stability of the system is improved.

According to an embodiment of the present disclosure, in order to solve the problems in the prior art that a difference between a report style and a report style required by a terminal user is large, and customizability of a report is low, step 202 further includes analyzing the report customization request to obtain data in the report sample; dividing the data in the report sample into fixed data and dynamic data according to the characteristics of the data in the report sample; generating the report parameters according to the dynamic data; and generating the report template according to the report parameters and the fixed data.

In this step, the report sample and the report template may be Microsoft word documents, which may include data such as text and diagrams, and title and text formats. The data in the report sample is divided into fixed data and dynamic data, the report parameter is generated according to the dynamic data, the report template is generated according to the report parameter and the fixed data, the customizability of the report template is improved, and the report which is the same as the report sample of the terminal user can be generated only by inputting the data of the terminal user in the report template according to the report parameter.

According to an embodiment herein, dividing the data in the report sample into fixed data and dynamic data according to the characteristics of the data in the report sample further comprises extracting the characteristics of the data in the report sample; matching the features with a preset feature set, wherein the preset feature set comprises a dynamic feature set corresponding to dynamic data and a fixed feature set corresponding to fixed data; and dividing the data in the report sample with the characteristics conforming to the dynamic characteristic set into dynamic data, and dividing the data in the report sample with the characteristics conforming to the fixed characteristic set into fixed data.

In this step, the feature may be a character feature of the data, and according to the definition of the Microsoft XML data format, the $ < > symbol may be taken as a member in the dynamic feature set, the < > symbol may be taken as a member in the fixed feature set, according to the dynamic feature set and the fixed feature set, the data matching the $ < > symbol may be taken as the dynamic data, and the data matching the $ < > symbol (but not matching the $ < > symbol) may be taken as the fixed data.

According to an embodiment of the present disclosure, generating the report parameter according to the dynamic data further includes parsing a format of the dynamic data, and converting the dynamic data into the report parameter having a data format corresponding to a data value.

In this step, the format of the dynamic data includes, but is not limited to, a picture, a table, a text, and a title style, for example, a report parameter may represent data required for generating a table and generating a table. In addition, the report parameters also record the source data address and the data table name of the terminal user data, so as to obtain the terminal user data according to the report parameters.

According to an embodiment of the present disclosure, in order to ensure the security of the report template, the step 202 of generating the report template identical to the report sample according to the report customization request further includes recording a corresponding relationship between the terminal user and the report template; and controlling the terminal user to modify the report template according to the corresponding relation.

After the report template is generated, the terminal user can directly modify the report template, and then the report is generated according to the modified report template and the data of the terminal user, so that the customizability of the report is further improved.

In this step, in order to ensure the security of the report template, the corresponding relationship between the report template and the terminal user is recorded when the report template is generated, and when the terminal user modifies the report template, whether the terminal user has the modification authority of the report template is determined, so that the security of the report template is ensured.

According to an embodiment of the present disclosure, the step 204 of generating a report according to the report generating instruction and the report template further includes analyzing the report generating instruction to obtain the end user data; and filling the terminal user data into the report template according to the corresponding relation between the terminal user data and the report parameters to generate a report.

In this step, the report generation instruction includes the terminal user data corresponding to the report parameter, and the report template includes the report parameter required for generating the report, so that according to the corresponding relationship between the terminal user data and the report parameter, the terminal user data is converted into the parameter required for generating the report according to the report template, and the terminal user data converted into the corresponding report parameter is filled into the report template, so as to generate the report. The content of the report includes end user data and the rendering form of the end user data in the report. In embodiments herein, the generated report may be a Microsoft Word document.

According to an embodiment of the present disclosure, in order to increase flexibility of generating a report, the step 203 of obtaining a report generation instruction including end user data further includes receiving a report generation instruction including the end user data sent by the end user; or, the terminal user data corresponding to the report parameters are acquired at regular time, and a report generation instruction is generated according to the terminal user data.

In this step, a report generation instruction sent by the terminal user can be received to generate a report. Before receiving a report generation instruction sent by a terminal user, informing the terminal user of report parameters required by generating a report so that the terminal user can obtain data corresponding to a data format from a database of the terminal user according to the data format and the data value in the report parameters to generate the report generation instruction.

And terminal user data corresponding to the report parameters can be acquired at regular time, and an API (application program interface) provided by a terminal user can be called to acquire the terminal user data. Before the terminal user data is obtained regularly, firstly, report parameters are generated according to the data format returned by the API provided by the terminal user and the dynamic data in the report sample, so that the generated report parameters are the same as the data format returned by the API provided by the terminal user. The timing time can be set according to the service requirements of the terminal user. And after the timing time is up, calling an API (application program interface) provided by the terminal user to acquire the data of the terminal user, and then generating a report generation instruction.

The data of the terminal user is obtained by receiving the report generation instruction sent by the terminal user or calling the API provided by the terminal user regularly, so that the flexibility of generating the report is improved.

According to an embodiment of the present disclosure, in order to solve the problem that a system may have a fault when a terminal user issues report generation instructions in batch, the step of receiving the report generation instructions including terminal user data sent by the terminal user further includes storing the received report generation instructions sent by the terminal user into a message queue according to a receiving time sequence, so as to read the report generation instructions from the message queue in sequence, and analyze the report generation instructions and generate reports.

According to an embodiment of the present disclosure, in order to solve the problems of long time consumption and low efficiency in generating a large report, after generating a report template identical to the report sample according to the report customization request in step 202, the method further includes splitting the report template into a plurality of sub-report templates according to the format of the report template content; splitting the report parameters into a plurality of sub-report parameters for generating the sub-report template according to the sub-report template; acquiring a report generation instruction comprising the terminal user data, wherein the terminal user data corresponds to the sub-report parameters; splitting the report generation instruction into a plurality of sub-report generation instructions according to the sub-report parameters; generating a plurality of sub-reports according to the sub-report generation instruction and the sub-report template; and combining the sub-reports into the report.

In this step, the format of the report template content includes a font, a paragraph, a title, a diagram, and the like, where the diagram may be a fixed picture for rendering the report content and/or a dynamic picture such as a data pie diagram, and the table may be drawn according to a data display mode formulated by a terminal user, and the font paragraph format is a requirement of the terminal user for the report format. Splitting the report template generated in the step 202 into a plurality of sub-report templates according to the format of the content of the report template, splitting the report parameters into a plurality of sub-report parameters corresponding to the sub-report templates, splitting the obtained report generation instruction including the terminal user data into a plurality of sub-report generation instructions according to the sub-report parameters, generating sub-reports through the sub-report generation instructions and the terminal user data, and finally combining the sub-reports into a complete report.

For example:

storing the chart in the report template in a sub-report template 1, storing the field format of the report template in a sub-report template 2, and storing the text content in the report template in a sub-report template 3;

taking the report parameter of the generated chart in the sub-report template 1 as a sub-report parameter 1, taking the report parameter of the generated font paragraph format in the sub-report template 2 as a sub-report parameter 2, and taking the report parameter of the generated text content in the sub-report template 3 as a sub-report parameter 3;

splitting a report generation instruction comprising terminal user data into a sub-report generation instruction 1 for generating chart content according to a sub-report parameter 1, a sub-report parameter 2 and a sub-report parameter 3, generating a sub-report generation instruction 2 in a font paragraph format, and generating a sub-report generation instruction 3 for generating text content;

obtaining a sub-report 1 for storing chart contents, a sub-report 2 for storing font paragraph formats and a sub-report 3 for storing text contents;

and finally, combining the sub-report 1, the sub-report 2 and the sub-report 3 to obtain a complete report.

According to an embodiment of the present disclosure, splitting the report template into a plurality of sub-report templates according to the format of the report template content further includes recording an association relationship between the plurality of sub-report templates; merging the sub-reports into the report further comprises merging the sub-reports according to the association relationship between the sub-report templates and the content in each sub-report.

In the step, the sub-report is generated according to the terminal user data and the sub-report template, and the content in the sub-report comprises the terminal user data and the rendering form of the terminal user data in the sub-report. In embodiments herein, the generated sub-report may be a Microsoft Word document.

Merging the sub-reports according to the association relationship among the sub-report templates, for example:

(1) the sub-report generated by the sub-report template 3 for storing the text needs to be combined with the content of the sub-report generated by the sub-report 1 for storing the diagram;

(2) the sub-report generated by the sub-report template 3 for storing the text needs to adjust the font paragraph format according to the content of the sub-report generated by the sub-report template 2 for storing the font paragraph format.

According to the association relationship, the combination mode of the sub-report 1, the sub-report 2 and the sub-report 3 is as follows:

and combining the text content of the sub-report 3 with the chart content of the sub-report 1, and modifying the font paragraph of the combined sub-report 1_3 according to the font paragraph content of the sub-report 2 to finally obtain the report which is the same as the report example customized by the user.

According to an embodiment of the present disclosure, generating a plurality of sub-reports according to the sub-report generating instruction and the sub-report template further includes concurrently generating the plurality of sub-reports according to the sub-report generating instruction and the sub-report template.

In this step, the multithreading and velocity template technology can be used to fill the terminal user data into the corresponding sub-report template, and a plurality of sub-reports are generated concurrently, so that the generation speed of the sub-reports is increased.

According to an embodiment of the present disclosure, after generating a report according to the report generation instruction and the report template, the method further includes converting a format of the report according to a report format requirement of the end user, so that the end user can operate contents in the report.

In this step, the format of the generated report may be converted into a report format required by the user through a report conversion interface provided by OpenOffice, so that the terminal user may directly operate the report content after the format conversion. And the operability of the report is improved. In addition, the generated report can be sent to the terminal user, and in the embodiment of the present disclosure, the report can be sent to the terminal user by way of sending an email, pushing a download address, and/or uploading a file server.

Fig. 3 is a detailed structure diagram of the customizable report generation apparatus according to an embodiment of the present disclosure, and the detailed structure of the customizable report generation apparatus is described in the present diagram, and specifically includes a report customization request obtaining unit 301, a report template generating unit 302, a report generation instruction obtaining unit 303, and a report generating unit 304.

According to an embodiment of the present disclosure, the report customization request obtaining unit 301 obtains a report customization request of an end user, where the report customization request includes a report sample designed by the end user, so that the report template generating unit 302 generates a report template identical to the report sample. In this embodiment, the report sample may be a Microsoft word document, which may include data such as words and diagrams, and a title and a text format.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a data format converting module 3021, configured to perform format conversion on data of the report example in the report customization request acquired by the report customization request acquiring unit 301, so that the data analyzing module 3022 analyzes the data of the report example. In embodiments herein, the format of the data in the reporting sample may be converted to Microsoft XML format to facilitate creation of the document using a program external to Microsoft office, and the document may be edited.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a data parsing module 3022, configured to parse data in the report sample converted by the data format converting module 3021. Firstly, extracting the characteristics of the data in the report sample, then matching the characteristics with a preset characteristic set, wherein the preset characteristic set comprises a dynamic characteristic set corresponding to dynamic data and a fixed characteristic set corresponding to fixed data, finally dividing the data in the report sample with the characteristics conforming to the dynamic characteristic set into dynamic data, and dividing the data in the report sample with the characteristics conforming to the fixed characteristic set into fixed data.

In this step, the feature may be a character feature of the data, and according to the definition of the Microsoft XML data format, the $ < > symbol may be taken as a member in the dynamic feature set, the < > symbol may be taken as a member in the fixed feature set, according to the dynamic feature set and the fixed feature set, the data matching the $ < > symbol may be taken as the dynamic data, and the data matching the $ < > symbol (but not matching the $ < > symbol) may be taken as the fixed data.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a report parameter constructing module 3023, configured to generate the report parameter according to the dynamic data obtained by the data analyzing module 3022. Firstly, the format of the dynamic data is analyzed, and then the dynamic data is converted into report parameters of the corresponding relation between the data format and the data value. In this context, the format of the dynamic data includes, but is not limited to, pictures, tables, text, and title styles.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a report template generating module 3024, which generates a report template according to the fixed data obtained by the data analyzing module 3022 and the report parameters obtained by the report parameter constructing module 3023, and further generates a report according to the report parameters in the report template. In this embodiment, the format of the report template may be Microsoft word format.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a report template splitting module 3025, which splits the report template into a plurality of sub-report templates according to the format of the content of the report template, and splits the report parameters generated by the report parameter constructing module 3023 into a plurality of sub-report parameters for generating the sub-report templates according to the content of the report template. In the embodiment, the format of the report template content includes font, paragraph, title, diagram, and the like. When the report template is split into a plurality of sub-report templates, the incidence relation between each sub-report template is recorded, so that the plurality of sub-reports are combined according to the incidence relation between the sub-report templates and the content in each sub-report.

For example, a chart in the report template is stored in the sub-report template 1, a field format of the report template is stored in the sub-report template 2, a text content in the report template is stored in the sub-report template 3, and the association relationship among the sub-reports is recorded as follows:

(1) the sub-report generated by the sub-report template 3 for storing the text needs to be combined with the content of the sub-report generated by the sub-report 1 for storing the diagram;

(2) the sub-report generated by the sub-report template 3 for storing the text needs to adjust the font paragraph format according to the content of the sub-report generated by the sub-report template 2 for storing the font paragraph format.

According to an embodiment of the present disclosure, the report template generating unit 302 further includes a report template storage module 3026, configured to store the report template generated by the report template generating module 3024, each sub-report template obtained by the report template splitting module 3025, and an association relationship between the sub-report templates.

In addition, the report template storage module 3026 records the correspondence between the end user and the report template, so as to control the end user to modify the report template according to the correspondence. When the terminal user modifies a certain report template, whether the terminal user has the modification authority of the report template is judged according to the corresponding relation, and the safety of the report template is ensured.

According to an embodiment of the present disclosure, the report generation instruction obtaining unit 303 further includes a report generation instruction receiving module 3031, configured to receive a report generation instruction including terminal user data sent by a terminal user, and send the received report generation instruction to the report generation unit 304, so that the report generation unit 304 generates a report according to the terminal user data in the report generation instruction.

In this embodiment, before receiving a report generation instruction issued by a user, the terminal user is informed of the parameter format generated by the report parameter construction module 3023, and the terminal user acquires data of its own database according to the requirement of the report parameter format and constructs a report generation instruction according to the acquired data.

According to an embodiment of the present disclosure, the report generation instruction receiving module 3031 further includes a message queue submodule 30311, which stores the received report generation instructions sent by the terminal user into a message queue according to a receiving time sequence, so that the report generation unit 304 sequentially reads the report generation instructions from the message queue, analyzes the report generation instructions, and generates a report.

According to an embodiment of the present disclosure, the report generation instruction obtaining unit 303 further includes a report generation instruction constructing module 3032, which actively obtains data of the terminal user, and generates a report generation instruction according to the data of the terminal user, and sends the report generation instruction to the report generating unit 304, so that the report generating unit 304 generates a report according to the data of the terminal user obtained by the report generation instruction constructing module 3032.

According to an embodiment of the present disclosure, the report generation instruction building module 3032 further includes a timing sub-module 30321, and after the timing time is reached, the command data obtaining sub-module 30322 calls an API interface provided by the end user to obtain the data of the end user. In this embodiment, the user may set the timing time of the timing submodule 30321 according to the service requirement of the user.

According to an embodiment of the present disclosure, the report generation instruction building module 3032 further includes a data obtaining sub-module 30322, which calls an API interface provided by the terminal user according to the report parameters generated by the report parameter building module 3023, so as to obtain data of the terminal user, so that the report generation instruction building module 3032 generates the report generation instruction. For example, the API interface to be called is determined according to the source data address and the data table name in the report parameter.

In this embodiment, before calling an API interface provided by the terminal user to obtain data of the terminal user, the report parameter constructing module 3023 constructs a report parameter according to a data format returned by the API interface of the terminal user, so that the terminal user data obtained by the data obtaining sub-module 30322 corresponds to the report parameter constructed by the report parameter constructing module 3023.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a data analyzing module 3041, configured to analyze the report generating instruction including the end user data acquired by the report generating instruction acquiring unit 303, so as to obtain the end user data corresponding to the report parameter.

According to an embodiment of the present disclosure, the report generating unit 304 further includes an instruction splitting module 3042, which splits the report generating instruction obtained by the report generating instruction obtaining unit 303 into a plurality of sub-report generating instructions according to the plurality of sub-report parameters split by the report template splitting module 3025, where each sub-report generating instruction includes end user data corresponding to a sub-report parameter, and each sub-report generating instruction corresponds to the sub-report template split by the report template splitting module 3025, so that the sub-report generating module 3043 generates a sub-report according to the end user data in the sub-report generating instruction and the sub-report template.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a sub-report generating module 3043, which extracts the end user data in the sub-report generating instruction obtained by splitting by the instruction splitting module 3042, and then fills the end user data in the sub-report template split by the report template splitting module 3025 to generate a sub-report.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a report merging module 3044, configured to merge the sub-reports generated by the sub-report generating module 3043 to obtain a report that is the same as the report sample of the end user. Firstly, the incidence relation between each sub-report template recorded by the report template splitting module 3025 is obtained, and the sub-reports are merged according to the incidence relation between the sub-report templates.

For example, the report template splitting module 3025 splits the report template into a sub-report template 1, a sub-report template 2, and a sub-report template 3, where the sub-report template 1 is used to store the chart content in the report template, the sub-report template 2 is used to store the font paragraph format in the report template, the sub-report template 3 is used to store the text content in the report template, and it is recorded that the sub-report template 3 needs to be combined with the sub-report template 1, and the sub-report template 3 needs to modify the text format according to the sub-report template 2 to obtain a complete report.

The sub-report generation module generates a sub-report 1 including chart contents according to the sub-report template 1 and the terminal user data, generates a sub-report 2 including font paragraph format according to the sub-report template 2 and the terminal user data, and generates a sub-report 3 including text contents according to the sub-report template 3 and the terminal user data. According to the above association relationship, the report merging module 3044 merges the text content of the sub-report 3 and the chart content of the sub-report 1, and modifies the font paragraph of the merged sub-report 1_3 according to the font paragraph content of the sub-report 2, so as to finally obtain a report identical to the report sample customized by the user.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a report storing module 3045, configured to store the report obtained by the report merging module 3044, and record a relationship between the report and the terminal user, so that the terminal user can obtain the report of the terminal user.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a report format converting module 3046, which converts the format of the report of the end user stored in the report storing module 3045 according to the requirement of the end user, so that the end user can directly operate the content of the report after converting the format.

According to an embodiment of the present disclosure, the report generating unit 304 further includes a report sending module 3047, which sends the report stored in the report storing module 3045 or the report whose format is converted by the report format converting module 3046 to the end user. In this embodiment, the report may be sent to the end user by email sending, or by pushing the download address, or may be uploaded to a designated file server by other methods, for example, without limitation.

Fig. 4 is a flowchart illustrating a process of generating a report template according to a report sample according to the present embodiment, where the process includes:

step 401: and acquiring a report customization request of a terminal user to obtain a report sample.

In this step, a report sample personalized by the terminal user is obtained, where the report sample is a Microsoft Word document, and the document includes a diagram, a text content, a font paragraph format, and the like, where the diagram may be a fixed picture for rendering the report content and/or a dynamic picture such as a data pie chart, and the table may be drawn according to a data display mode formulated by the terminal user, the text content may be an explanation of the report content by the terminal user, for example, an explanation of some nouns, and the font paragraph format is a requirement of the terminal user on the report format.

Step 402: and carrying out format conversion on the data in the report sample.

In this step, in order to facilitate analysis of the data in the report sample, the data in the report sample obtained in step 401 is converted into a Microsoft XML format, so as to create a document using a program outside Microsoft office, and the document can be edited, for example, the fixed picture in the report sample obtained in step 401 is converted into < pic _ map _ in _ page _ two and pic > after format conversion, and the data pie chart is converted into $ < pic _ app _ static _ in _ page _ two and pic _ chart.

Step 403: and matching characteristic values of the data after format conversion to determine fixed data and dynamic data.

In this step, according to the definition of the Microsoft XML data format, the $ < > symbol is used as the feature value to match the data in step 402 converted into the report sample in the Microsoft XML format, the data including the $ < > symbol is used as dynamic data, the data not including the $ < > symbol is used as fixed data, for example, the fixed picture obtained in step 402 is < pic _ map _ in _ page _ two, pic > and the data pie chart $ < pic _ app _ static _ in _ page _ two, pic _ chart, and the fixed picture is obtained as fixed data after the feature value matching, and the data pie chart is dynamic data.

Step 404: and analyzing the format of the dynamic data to generate report parameters.

In this step, the dynamic data obtained in step 403 is analyzed, the format of the dynamic data is converted into a report parameter having a data format and data value corresponding relationship, for example, the data pie chart $ < pic _ app _ static _ in _ page _ two, pic _ chart > obtained in step 403 is dynamic data, and after the analysis, the data format of the data is pic _ chart, the data value is app _ static (application control statistics), the obtained report parameter is $ { app _ static, pic _ chart }, which is represented as a pie chart of application control statistics, and the data required by the parameter is application control statistics data.

Step 405: and generating a report template according to the fixed data and the report parameters.

In this step, the fixed data is combined with the report parameters to generate a Microsoft Word report template.

Step 406: and splitting the report template into a plurality of sub-report templates according to the format of the content of the report template.

In this step, in order to improve the efficiency of generating the report according to the report template, the report template generated in step 405 is split into a plurality of sub-report templates according to the format of the contents of the report template, so that the sub-reports are generated in parallel according to the sub-report templates. In an embodiment herein, the format of the report template content includes attributes, font paragraph style, body content, etc. of a Microsoft Word document.

For example, the chart in the report template is stored in the sub-report template 1, the field format of the report template is stored in the sub-report template 2, and the text content in the report template is stored in the sub-report template 3.

Step 407: and splitting the report parameters into a plurality of sub-report parameters for generating the sub-report template.

In this step, according to the sub-report templates obtained in step 406, the report parameters generated in step 404 are split into a plurality of sub-report parameters corresponding to the sub-report templates, so that the sub-reports are generated according to the sub-report parameters and the sub-report templates.

For example, the report parameter of the chart generated in the sub-report template 1 is taken as the sub-report parameter 1, the report parameter of the font paragraph format generated in the sub-report template 2 is taken as the sub-report parameter 2, and the report parameter of the text content generated in the sub-report template 3 is taken as the sub-report parameter 3.

Step 408: and recording the corresponding relation between the report template and the terminal user so as to control the modification authority of the terminal user on the report template.

After generating the report template, the terminal user may directly modify the Microsoft Word report template generated in step 405, split the report template into sub-report templates, and then the terminal user may also directly modify the sub-report template split in step 406. In order to ensure the security of the report template, in the step, the corresponding relationship between the report template and the terminal user is recorded, and when the terminal user modifies the report template, whether the terminal user has the modification authority of the report template is judged, so that the security of the report template is ensured.

Fig. 5 is a flowchart illustrating a process of generating a report according to a report template and end user data in the embodiment of the present disclosure, where the process of generating a report according to a report template and end user data is described in the embodiment of the present disclosure, and the specific process is as follows:

step 501: and receiving a report generation instruction sent by a terminal user.

In this step, the report generation instruction sent by the terminal user includes the report parameters and the corresponding data of the terminal user, so as to generate the report according to the data of the terminal user.

Step 502: and storing the report generation instruction into a message queue.

In this step, the report generation instructions received in step 501 are stored in the message queue in the order of the receiving time, so that the report generation instructions are read from the message queue in order, and a report is generated according to the report generation instructions.

Step 503: and calling an API (application program interface) of the terminal user at regular time to acquire data.

In this step, the API interface of the terminal user is connected to the database of the terminal user, and the data for generating the report is obtained by calling the API interface of the terminal user through the timer. And calling a plurality of API interfaces to acquire a plurality of data so as to generate a report by using the plurality of data. And determining the API interface to be called according to the source data address and the data table name in the report parameter.

Step 504: and generating a report generation instruction according to the data of the terminal user.

In this step, the data of the end user acquired in step 503 is processed to correspond to the report parameters, and then a report generation instruction of the end user is generated according to the data of the end user.

Step 505: and splitting the report generation instruction into a plurality of sub-report generation instructions.

In this step, when it is determined that there is an unread report generation instruction in the message queue of step 502, the report generation instruction is read in the stored time sequence, and when it is determined that there is a report generation instruction generated in step 504, the report generation instruction is read.

And then splitting the report generation instruction into a plurality of sub-report generation instructions according to the split sub-report parameters so as to generate a plurality of sub-reports.

Step 506: and generating the sub-report according to the sub-report generating instruction and the sub-report template.

In the step, firstly, a corresponding sub-report template is searched according to a sub-report generating instruction, the sub-report template is obtained by splitting a report template generated according to a report sample of the terminal user, then, terminal user data in the sub-report generating instruction is converted into a format of a corresponding sub-report parameter, and the terminal user data is filled into the corresponding sub-report template by utilizing multithreading and velocity template technologies to obtain a sub-report.

Step 507: and merging the sub-reports according to the association relation between the sub-report templates.

When the report template is split into a plurality of sub-report templates, the association relationship between the sub-report templates is recorded, and in this step, the sub-reports generated in step 506 are merged according to the association relationship of the sub-report templates to obtain a complete report.

Step 508: and sending the combined report to a terminal user.

In this step, according to the needs of the terminal user, the sub-report generated in step 507 is converted into a report format required by the user through a report conversion interface provided by OpenOffice, and then the report after the format conversion is sent to the terminal user in a manner of sending a mail, pushing a download address and/or uploading a file server.

As shown in fig. 6, which is a schematic structural diagram of a computer device in this embodiment, the customizable report generation apparatus in this embodiment may be a computer device in this embodiment, and perform the method in this embodiment. The computer device 602 may include one or more processing devices 604, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 602 may also include any storage resources 606 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, storage resources 606 may include any one or more of the following in combination: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any storage resource may use any technology to store information. Further, any storage resource may provide volatile or non-volatile reservation of information. Further, any storage resources may represent fixed or removable components of computer device 602. In one case, when processing device 604 executes associated instructions stored in any memory resource or combination of memory resources, computer device 602 can perform any of the operations of the associated instructions. The computer device 602 also includes one or more drive mechanisms 608, such as a hard disk drive mechanism, an optical disk drive mechanism, etc., for interacting with any storage resource.

Computer device 602 may also include an input/output module 60(I/O) for receiving various inputs (via input device 612) and for providing various outputs (via output device 614). One particular output mechanism may include a presentation device 616 and an associated Graphical User Interface (GUI) 618. In other embodiments, input/output module 610(I/O), input device 612, and output device 614 may also be excluded, as just one computer device in a network. Computer device 602 may also include one or more network interfaces 620 for exchanging data with other devices via one or more communication links 622. One or more communication buses 624 couple the above-described components together.

Communication link 622 may be implemented in any manner, such as through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. Communication link 622 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.

Embodiments herein also provide a computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:

acquiring a report customizing request of a terminal user, wherein the report customizing request comprises a report sample;

generating a report template identical to the report sample according to the report customizing request, wherein the report template comprises report parameters corresponding to the report sample;

acquiring a report generation instruction comprising terminal user data;

and generating a report according to the terminal user data in the report generating instruction and the report template.

The computer device provided by the embodiment can also implement the methods as in fig. 2, 4-5.

Corresponding to the methods in fig. 2, 4-5, the embodiments herein also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the above-described method.

Embodiments herein also provide computer readable instructions, wherein when executed by a processor, a program thereof causes the processor to perform the methods as shown in fig. 2, 4-5.

It should be understood that, in various embodiments herein, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments herein.

It should also be understood that, in the embodiments herein, the term "and/or" is only one kind of association relation describing an associated object, meaning that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.

Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

In the several embodiments provided herein, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments herein.

In addition, functional units in the embodiments herein may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present invention may be implemented in a form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The principles and embodiments of this document are explained herein using specific examples, which are presented only to aid in understanding the methods and their core concepts; meanwhile, for the general technical personnel in the field, according to the idea of this document, there may be changes in the concrete implementation and the application scope, in summary, this description should not be understood as the limitation of this document.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数值范围调整方法、装置、电子设备和可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!