A report generation method and apparatus

By embedding markup language in the report template, processing instructions are generated to support independent data population from multiple data sources. This solves the problem of code modification required when data sources change in existing technologies, and achieves flexible automated report generation and low maintenance costs.

CN122133632APending Publication Date: 2026-06-02BEIJING BIG DATA CENT

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BIG DATA CENT
Filing Date
2026-03-24
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

The existing report generation technology is tightly coupled with business logic, which requires code modification when the data source structure changes, resulting in a lack of flexibility and high maintenance costs.

Method used

By embedding markup languages ​​in the target report template, processing instructions corresponding to each markup language are generated, thereby decoupling the data source from the code and supporting independent data population from multiple data sources.

Benefits of technology

It achieves flexibility and low maintenance costs in generating automated reports across different data sources, improving the system's versatility and reusability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133632A_ABST
    Figure CN122133632A_ABST
Patent Text Reader

Abstract

This invention provides a report generation method and apparatus, relating to the field of computer technology. One specific embodiment of the method includes: receiving a report generation instruction; the report generation instruction includes a template path and a data source address identifier; obtaining a target report template according to the template path; wherein the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; generating processing instructions corresponding to each markup language according to the markup language and the data source address identifier; executing the processing instructions to obtain fill data corresponding to each markup language; and generating a report based on the fill data. This embodiment, by embedding markup languages ​​in the target report template, can achieve data fill for different report types for different data sources, thus decoupling the data source from the code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a report generation method and apparatus. Background Technology

[0002] With the rapid development of information technology, the automatic generation of structured reports has become a common demand for users. Existing report generation technologies are generally tightly coupled with business logic, requiring specific calling code to retrieve data from specific data sources. Since different types of data sources have different retrieval methods, once the data source structure changes, the code must be modified and recompiled, resulting in a lack of flexibility and high maintenance costs. Summary of the Invention

[0003] This invention provides a report generation method and apparatus to solve the compatibility problem of existing technologies that can only generate reports based on a single data source. Specifically, by embedding markup languages ​​into the target report template, processing instructions corresponding to each markup language can be generated according to the data source. This enables independent data filling for different data sources during processing based on the processing instructions, thereby achieving decoupling between the data source and the code.

[0004] This invention provides a report generation method, comprising the following steps: receiving a report generation instruction; the report generation instruction includes a template path and a data source address identifier; obtaining a target report template according to the template path; wherein, the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; generating a processing instruction corresponding to each markup language according to the markup language and the data source address identifier; executing the processing instruction to obtain fill data corresponding to each markup language; and generating the report based on the fill data.

[0005] Optionally, the report generation instruction further includes an output path; the method further includes: sending the report to the user terminal corresponding to the output path according to the output path.

[0006] Optionally, if the report type indicated by the markup language is text, executing the processing instruction to obtain the fill data corresponding to each markup language includes: obtaining the field value corresponding to each markup language according to the prefix in the processing instruction and the field identifier in the data source address identifier.

[0007] Optionally, if the report type indicated by the markup language is a table, executing the processing instruction to obtain the fill data corresponding to each markup language includes: obtaining the fill data corresponding to each markup language according to the data source address identifier in the table in the processing instruction.

[0008] Optionally, obtaining the fill data corresponding to each markup language based on the data source address identifier in the table in the processing instruction includes: determining the table type based on the setting position of the data source address identifier in the table; when the table type is a vertical fill type, obtaining the fill data corresponding to each markup language based on at least one object in the processing instruction; when the table type is a horizontal and vertical fill type, creating a table column using the key name in the source data corresponding to the data source address identifier as the column header, and for each table column, performing the step of obtaining the fill data corresponding to each markup language based on at least one object in the processing instruction.

[0009] Optionally, if the report type indicated by the markup language is a chart, executing the processing instruction to obtain the fill data corresponding to each markup language includes: obtaining the fill data corresponding to each markup language based on the data source address identifier and the title and / or description attributes of the chart.

[0010] The present invention also provides a report generation apparatus, comprising the following modules: The receiving module is used to receive report generation instructions; the report generation instructions include a template path and a data source address identifier. The acquisition module is used to acquire a target report template according to the template path; wherein, the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; The processing instruction generation module is used to obtain source data based on the data source address, and generate processing instructions corresponding to each markup language according to the markup language and the data source address identifier. The padding module is used to execute the processing instructions and obtain padding data corresponding to each markup language. The report generation module is used to generate the report based on the populated data.

[0011] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the report generation method as described above.

[0012] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the report generation method as described above.

[0013] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the report generation method as described above.

[0014] The report generation method and apparatus provided by the present invention can generate processing instructions corresponding to each markup language according to the data source by embedding markup language in the target report template. This enables independent data filling for different data sources during the processing based on the processing instructions, thereby achieving decoupling between the data source and the code. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is one of the flowcharts illustrating the report generation method provided by the present invention.

[0017] Figure 2 This is the second flowchart of the report generation method provided by the present invention.

[0018] Figure 3 This is the third flowchart of the report generation method provided by the present invention.

[0019] Figure 4 This is a schematic diagram of the specific process of step 304 provided by the present invention.

[0020] Figure 5 This is the fourth flowchart of the report generation method provided by the present invention.

[0021] Figure 6 This is a schematic diagram of the framework flow of the report generation method provided by the present invention.

[0022] Figure 7 This is a schematic diagram of the report generation device provided by the present invention.

[0023] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0025] Figure 1 This is one of the flowcharts illustrating the report generation method provided by the present invention, such as... Figure 1 As shown, the method includes the following: Step 101: Receive report generation instructions; the report generation instructions include the template path and the data source address identifier; The report generation instruction can be a command line or an API call request. Once the server receives the report generation instruction, it can execute the report generation method provided by this invention based on the template path and data source address in the report generation instruction.

[0026] Step 102: Obtain the target report template according to the template path; wherein, the target report template is a Word template with at least one markup language embedded; the markup language indicates at least one of the following report types: text, table, chart; It should be noted that the report can be presented in different formats, such as Word, PDF, and Excel. However, considering Word's powerful editing capabilities and broad user base, this embodiment of the invention uses Word as the target report template for report generation. This does not mean that it cannot be applied to other presentation formats such as PDF and Excel. In specific applications, markup languages ​​can be used to generate reports in other presentation formats such as PDF and Excel according to the user's actual needs. This invention does not impose specific limitations on this.

[0027] In this context, markup language refers to code with a unified syntax embedded in the target report template. Specifically, the location marked by markup language defines the display position of data. The markup language code can describe various types of data, such as data types, data parameters, and rendering behaviors. For example, the markup language format can be {{prefix:datasource@field,parameter}}, where each prefix corresponds to a unique data type, and different prefixes correspond to different data types. For example, prefixes can be text, repeat-text, data, and repeat-paragraph, representing text, repeated text, table, and repeated paragraph, respectively. By setting different markup languages ​​at different locations in the target report template, the specific report types to be included in the generated report and the specific display positions of different report types can be defined.

[0028] Step 103: Generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier; The markup language is obtained by parsing the underlying XML structure of the target report template through a hybrid template parser. The hybrid template parser can identify the various components of the markup language in the target report template and convert them into an instruction structure that the instruction processing engine can understand, so as to facilitate the smooth execution of subsequent processing instructions.

[0029] Regarding the specific method of generating processing instructions, processing instructions can be obtained by concatenating and combining markup language and data source address identifiers in a preset manner, or by generating processing instructions in other ways known in the art. This invention will not elaborate on these methods.

[0030] It should be noted that since this invention only focuses on the location of the data source storage and does not consider the method of data source storage, the acquisition of the data source will not be affected regardless of whether the data source is stored in a database or other storage methods such as distributed cluster storage. It is only necessary to call the corresponding adapter (such as HTTP API adapter, file system adapter, database adapter) based on the data source address identifier to acquire the data source. This greatly improves the universality and reusability of the target report template provided by the embodiments of this invention, and significantly reduces the cost of system integration and change maintenance.

[0031] Step 104: Execute the processing instructions to obtain the padding data corresponding to each markup language; The process of executing processing instructions is actually the process of obtaining the data that needs to be filled into the target report template from the source data based on the data source address identifier and markup language included in the processing instructions.

[0032] Step 105: Generate a report based on the populated data.

[0033] Understandably, obtaining and filling data is a step performed by the server on the backend. In order to generate the final visual report file, it needs to be rendered together with the elements in the target report template.

[0034] Based on steps 101 to 105 above, this embodiment of the invention, by embedding markup languages ​​in the target report template, can generate processing instructions corresponding to each markup language according to the data source. This enables independent data filling for different data sources during processing based on the processing instructions, thereby achieving decoupling between the data source and the code. Moreover, this embodiment of the invention does not contain any specific business logic; automated report generation can be achieved solely through report generation instructions and the target report template, improving automation efficiency.

[0035] For step 104 provided in the embodiments of the present invention, different processing methods actually correspond to different report types involved in the markup language. Therefore, in an optional embodiment, when the report type indicated by the markup language is text, the flowchart of the report generation method provided by the present invention is as follows: Figure 2 As shown, it includes: Step 201: Receive report generation instructions; the report generation instructions include the template path and the data source address identifier; Step 202: Obtain the target report template according to the template path; wherein, the target report template is a Word template with at least one markup language embedded; Step 203: Generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier; Step 204: Based on the prefix in the processing instruction and the field identifier of the data source address, obtain the field value corresponding to each markup language; Step 205: Generate a report based on field values.

[0036] Understandably, when the report type is text, only the text needs to be replaced. Therefore, based on the field identifier in the data source address identifier, the corresponding field value can be directly obtained from the source data corresponding to the data source address identifier, and the field value can be used as the fill data.

[0037] Specifically, text can be divided into plain text (which only needs to be filled in once for replacement) and duplicate text (which needs to be filled in multiple times and replaced separately). The following example illustrates the data source address identifier for duplicate text and the corresponding generated report.

[0038] For example, the data source address identifier for the repeated text in the target report template is: {{ @ index}}、{{ @name}}; Inspection item category: {{ @category}}; Inspection content: {{ @content}}; Inspection instructions: {{ @description}}; Repair suggestions: {{ @proposal}}; Override host: {{ @host_succeeded}} / {{ @host_covered}}; Through the host: {{ @host_passed}}; Pass rate: {{ @host_passed_percent}}; {{repeat-paragraph:end}}.

[0039] Since there are multiple indices and names in the source data, multiple sets of duplicate text will be generated according to the number of indices and names in the source data. The content of each set of text is displayed at the location set by the above data source address identifier.

[0040] The corresponding report generated is as follows: 1. Check if the SELinux policy is configured; Inspection item category: Mandatory access control; Check the following: In the / etc / selinux / config file, SELINUXTYPE should be set to "targeted" or "mls"; Check notes: Configure SELinux to meet or exceed the default target policy that only restricts daemons and system software; Recommended fix: Edit the ` / etc / selinux / config` file and set the `SELINUXTYPE` parameter: `SELINUXTYPE=targeted`; Override host: 0 / 2; Via host: 0; Pass rate: 0.00%.

[0041] 2. Check if all groups in / etc / passwd exist in / etc / group; Check item category: User and group settings; Check the following: All groups in / etc / passwd should exist in / etc / group; Inspection Note: Over time, system administration errors and changes may cause groups to appear in / etc / passwd but not defined in / etc / group; Recommended fix: Perform the appropriate steps to correct the identified discrepancies; Override host: 0 / 2; Via host: 0; Pass rate: 0.00%.

[0042] 3. Check if duplicate UIDs do not exist; Check item category: User and group settings; Check for duplicate UIDs: Should be: Not found. Note: Although the useradd program will not allow the creation of duplicate user IDs (UIDs), administrators can manually edit the / etc / passwd file and change the UID field; Recommended fix: Create a unique UID and examine all files owned by the shared UID to determine which UID they belong to; Override host: 0 / 2; Via host: 0; Pass rate: 0.00%.

[0043] As can be seen, for each index (checking whether SELinux policy is set, checking whether all groups in / etc / passwd exist in / etc / group, and checking whether duplicate UIDs do not exist), the check item category, check content, check description, repair suggestions, and specific content corresponding to the overridden host are generated.

[0044] In another optional embodiment, when the report type indicated by the markup language is a table, the flowchart of the report generation method provided by the present invention is as follows: Figure 3 As shown, it includes: Step 301: Receive report generation instruction; the report generation instruction includes the template path and data source address identifier; Step 302: Obtain the target report template according to the template path; wherein, the target report template is a Word template with at least one markup language embedded; Step 303: Generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier; Step 304: Based on the data source address identifier in the table of the processing instructions, obtain the fill data corresponding to each markup language; Step 305: Generate a report based on the populated data.

[0045] Unlike text, when the report type is table, there may be a situation where a table is filled with multiple rows and / or multiple columns. Therefore, when processing table data, it is necessary to refer to the first row of the table to determine whether multiple rows and / or multiple columns need to be filled.

[0046] For example, Tables 1 and 2 below illustrate the cases of expanding multiple rows and the cases of simultaneously expanding multiple rows and columns.

[0047] Table 1. Expanding a table with multiple rows Table 2 Expanding tables with multiple rows and columns As can be seen from the headers of Tables 1 and 2, the header of Table 1 is already filled with the fixed fields "Grouping" and "Quantity," and the markup language is located on the next line after "Grouping" and "Quantity." Therefore, when filling in data, it will only fill multiple lines downwards based on the markup language. The header of Table 2, however, not only has the fixed field "IP" filled in, but also a markup language entry "{{attack_top5@ Therefore, when filling Table 2 with data, multiple rows are filled downwards while multiple columns are filled to the right, achieving the effect of filling multiple rows and columns simultaneously.

[0048] It should be noted that most existing technologies simply replace table content, while this invention dynamically retrieves data from the data source and dynamically expands the row and column data content, achieving a technical effect that cannot be achieved in existing technologies.

[0049] Specifically, in order to achieve the different extension methods described above, in one optional embodiment, step 304 can be as follows: Figure 4 As shown, it specifically includes: Step 401: Determine the table type based on the fields in the first row of the table; When the table type is vertical fill type, execute step 402 to obtain the fill data corresponding to each markup language according to at least one object in the processing instruction; When the table type is horizontal and vertical fill type, execute step 403: create a table column with the key name in the source data corresponding to the data source address as the column header, and for each table column, execute the step of obtaining the fill data corresponding to each markup language according to at least one object in the processing instruction.

[0050] In a further optional embodiment, when the report type indicated by the markup language is a chart, the flowchart of the report generation method provided by the present invention is as follows: Figure 5 As shown, it includes: Step 501: Receive report generation instruction; the report generation instruction includes the template path and data source address identifier; Step 502: Obtain the target report template according to the template path; wherein, the target report template is a Word template with at least one markup language embedded; Step 503: Generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier; Step 504: Based on the data source address identifier and the chart's title and / or description attributes, obtain the populated data corresponding to each markup language; Step 505: Generate a report based on the populated data.

[0051] As can be seen, the embodiments of the present invention adopt different methods to dynamically acquire and fill data according to the different characteristics of different report types, which can generate reports that include multiple different report types at the same time. Compared with the existing technology that can only generate reports in a single form, it can support the report requirements of complex elements and does not require writing complex scripts or source code, which greatly improves the efficiency of template generation.

[0052] For example, the expansion process of the above tables is specifically illustrated in Tables 3 and 4 below, where Table 3 is a table in the target report template and Table 4 is a table in the generated report: Table 3 Statistical Scope Table 4 Statistical Scope Grouping quantity Ungrouped 61 units hongna 12 units Migration Test 111 2 units wbb 3 units 2 7 units Ungrouped 1 0 units Ubunt16 1 unit Baseline adaptation 2 units As can be seen from Tables 3 and 4 above, based on the data source address identifier {{data:group}}{{name}}, multiple group data will be found from the source data, and the corresponding quantity will be generated according to each group data and populated into the same table to generate the final report.

[0053] In a further optional embodiment, the report generation instruction may also include an output path, and after step 105, may further include: Step 106: Send the report to the user terminal corresponding to the output path.

[0054] It is understood that the report generation instruction in step 101 can also be sent by the user terminal. The server for the report generation method provided in this embodiment of the invention responds to the received report generation instruction to generate a report and feeds back the generated report to the user terminal, so as to realize complete interaction between the user terminal and the server.

[0055] The following is based on Figure 6 The framework and flow of the report generation method provided in this embodiment of the invention will be further explained using examples, such as... Figure 6 As shown, upon receiving a report generation instruction, the system retrieves source data from the data source address identifier included in the instruction using a data source loader corresponding to the data source type. Simultaneously, it loads the target report template according to the template path included in the instruction and uses a template parser to parse the template to obtain the markup language. Then, based on the markup language and the data source address identifier, it generates processing instructions for each markup language, which are then executed by the executor to obtain population data from the source data. Finally, the target report template with population data is rendered, and the report document is output.

[0056] As can be seen, by embedding markup languages ​​in the target report template, the embodiments of the present invention can generate processing instructions corresponding to each markup language according to the data source, so that independent data filling can be achieved for different data sources during the processing based on the processing instructions, thereby achieving decoupling between the data source and the code.

[0057] The report generation apparatus provided by the present invention is described below. The report generation apparatus described below and the report generation method described above can be referred to in correspondence.

[0058] Figure 7 A schematic diagram of the structure of the report generation apparatus 700 provided in an embodiment of the present invention is shown, as follows: Figure 7 As shown, it includes: The receiving module 701 is used to receive a report generation instruction; the report generation instruction includes a template path and a data source address identifier. The acquisition module 702 is used to acquire a target report template according to the template path; wherein, the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; The processing instruction generation module 703 is used to generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier. The filling module 704 is used to execute the processing instructions to obtain filling data corresponding to each markup language. The report generation module 705 is used to generate the report based on the populated data.

[0059] In one alternative embodiment, the markup language indicates at least one of the following report types: text, table, and chart.

[0060] In an optional embodiment, if the report type indicated by the markup language is text, the filling module 704 is further configured to obtain the field value corresponding to each markup language according to the prefix in the processing instruction and the field identifier in the data source address identifier.

[0061] In an optional embodiment, if the report type indicated by the markup language is a table, the filling module 704 is further configured to obtain the filling data corresponding to each markup language according to the first row field of the table in the processing instruction and the data source address identifier.

[0062] In an optional embodiment, the filling module 704 is further configured to: determine the table type based on the first row field of the table; when the table type is a vertical filling type, obtain the filling data corresponding to each markup language according to at least one object in the processing instruction; when the table type is a horizontal and vertical filling type, create a table column using the key name in the source data corresponding to the data source address identifier as the column header, and for each table column, perform the step of obtaining the filling data corresponding to each markup language according to at least one object in the processing instruction.

[0063] In an optional embodiment, if the report type indicated by the markup language is a chart, the filling module 704 is further configured to obtain the filling data corresponding to each markup language based on the data source address identifier and the title and / or description attributes of the chart.

[0064] In an optional embodiment, the report generation instruction further includes an output path; the report generation module 705 is further configured to send the report to the user terminal corresponding to the output path according to the output path.

[0065] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can invoke logical instructions in the memory 830 to execute a report generation method, which includes: receiving a report generation instruction; the report generation instruction includes a template path and a data source address identifier; obtaining a target report template according to the template path; wherein the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; generating processing instructions corresponding to each markup language according to the markup language and the data source address identifier; executing the processing instructions to obtain fill data corresponding to each markup language; and generating the report based on the fill data.

[0066] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0067] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the report generation method provided by the above methods. The method includes: receiving a report generation instruction; the report generation instruction includes a template path and a data source address identifier; obtaining a target report template according to the template path; wherein the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; generating a processing instruction corresponding to each markup language according to the markup language and the data source address identifier; executing the processing instruction to obtain fill data corresponding to each markup language; and generating the report based on the fill data.

[0068] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a report generation method provided by the above methods. The method includes: receiving a report generation instruction; the report generation instruction including a template path and a data source address identifier; obtaining a target report template according to the template path; wherein the target report template is a Word template embedded with at least one markup language; the markup language indicating at least one of the following report types: text, table, and chart; generating a processing instruction corresponding to each markup language according to the markup language and the data source address identifier; executing the processing instruction to obtain fill data corresponding to each markup language; and generating the report based on the fill data.

[0069] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0070] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A report generation method, characterized in that, include: Receive a report generation instruction; the report generation instruction includes a template path and a data source address identifier; The target report template is obtained according to the template path; wherein, the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; Based on the markup language and the data source address identifier, generate processing instructions corresponding to each markup language; Execute the processing instructions to obtain the padding data corresponding to each of the markup languages; The report is generated based on the populated data.

2. The report generation method according to claim 1, characterized in that, The report generation instruction also includes an output path; the method further includes: sending the report to the user terminal corresponding to the output path according to the output path.

3. The report generation method according to claim 2, characterized in that, If the report type indicated by the markup language is text, the execution of the processing instruction yields the padding data corresponding to each markup language, including: Based on the prefix in the processing instruction and the field identifier in the data source address identifier, the field value corresponding to each markup language is obtained.

4. The report generation method according to claim 2, characterized in that, If the report type indicated by the markup language is a table, the execution of the processing instruction yields the populated data corresponding to each markup language entry, including: Based on the data source address identifier in the table of the processing instructions, the fill data corresponding to each markup language is obtained.

5. The report generation method according to claim 4, characterized in that, Based on the data source address identifier in the table of the processing instructions, the fill data corresponding to each markup language is obtained, including: The table type is determined based on the location of the data source address identifier in the table. When the table type is a vertical fill type, the fill data corresponding to each markup language is obtained according to at least one object in the processing instruction; When the table type is a horizontal and vertical fill type, a table column is created using the key name in the source data corresponding to the data source address as the column header, and for each table column, the step of obtaining the fill data corresponding to each markup language according to at least one object in the processing instruction is executed.

6. The report generation method according to claim 2, characterized in that, If the report type indicated by the markup language is a chart, the execution of the processing instruction yields the populated data corresponding to each markup language entry, including: Based on the data source address identifier and the title and / or description attributes of the chart, the corresponding fill data for each markup language is obtained.

7. A report generation device, characterized in that, include: The receiving module is used to receive report generation instructions; the report generation instructions include a template path and a data source address identifier. The acquisition module is used to acquire a target report template according to the template path; wherein, the target report template is a Word template embedded with at least one markup language; the markup language indicates at least one of the following report types: text, table, and chart; The processing instruction generation module is used to generate processing instructions corresponding to each markup language based on the markup language and the data source address identifier. The padding module is used to execute the processing instructions and obtain padding data corresponding to each markup language. The report generation module is used to generate the report based on the populated data.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the report generation method as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the report generation method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the report generation method as described in any one of claims 1 to 6.