Analytical report generation method and device, equipment, storage medium and program product
By obtaining data source report data and template configuration information, and generating and filling report templates, flexible generation and merging of analysis reports is achieved, and the problem of difficult analysis reports is solved in the existing technology is difficult to generate reports, and the report generation performance is improved.
Patent Information
- Application Number
- CN202411774640.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is difficult to streamline, calculate and convert a large number of complex structured data into analytical reports, making it difficult to generate analytical reports.
By obtaining the report data and report template configuration information corresponding to the data source, a structured report template is generated, and the report data is filled into the template to generate the first analysis report. Then, the plurality of first analysis reports are merged to generate a second analysis report.
It realizes the structured configuration of report templates, which facilitates the configuration of templates according to different business scenarios, supports the generation of multiple analytical reports, improves the generation performance of analytical reports, and adapts to the huge amount of data in business scenarios.
Smart Images

Figure CN119720974A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for generating an analysis report. Background Art
[0002] With the development of Internet technology, there is a large amount of business data that needs to be analyzed in various links of many business scenarios. Currently, data analysis is mainly achieved through data analysis platforms or Excel tables, but it is difficult to generate report files in combination with business data. How to streamline, calculate and convert these large amounts of complex structured data into analyzable reports has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of this, the present disclosure provides a method, apparatus, device, storage medium and program product for generating an analysis report to solve the problem that it is difficult to generate an analysis report for business data.
[0004] In a first aspect, the present disclosure provides a method for generating an analysis report, comprising: obtaining report data and report template configuration information corresponding to a data source, the report template configuration information comprising at least one first report configuration information; generating a first report template according to the first report configuration information, and filling the report data into the first report template to obtain a first analysis report corresponding to the first report template; merging the first analysis reports to generate a second analysis report.
[0005] In a second aspect, the present disclosure provides a device for generating an analysis report, including: an acquisition module, used to obtain report data and report template configuration information corresponding to a data source, the report template configuration information including at least one first report configuration information; a filling module, used to generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template; a merging module, used to merge the first analysis reports to generate a second analysis report.
[0006] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for generating an analysis report of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for generating an analysis report according to the first aspect or any corresponding embodiment thereof.
[0008] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for generating an analysis report of the first aspect or any corresponding embodiment thereof.
[0009] The analysis report generation method, device, equipment, storage medium and program product provided by the present disclosure obtains report data and report template configuration information corresponding to a data source, and multiple first report configuration information are set in the report template configuration information, so that a first report template can be generated according to the first report configuration information, and a structured configuration of the report template is realized, which is convenient for configuring the report template according to different business scenarios, thereby supporting the generation of multiple first analysis reports and realizing flexible configuration of the generation of the first analysis report. By filling the report data into the first report template to obtain the first analysis report corresponding to the first report template, and merging the first analysis reports to generate a second analysis report, so as to simultaneously include a set of reports of different dimensions in one analysis report, so as to adapt to the huge amount of data in the business scenario and improve the generation performance of the analysis report. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 is a schematic diagram of a hierarchical structure of an analysis report according to an embodiment of the present disclosure;
[0012] Figure 2 is a flowchart of a method for generating an analysis report according to an embodiment of the present disclosure;
[0013] Figure 3 is a flowchart of another method for generating an analysis report according to an embodiment of the present disclosure;
[0014] Figure 4 is a schematic diagram of a one-dimensional static header according to an embodiment of the present disclosure;
[0015] Figure 5 is a schematic diagram of a two-dimensional static header according to an embodiment of the present disclosure;
[0016] Figure 6 is a schematic diagram of merging row and column headers according to an embodiment of the present disclosure;
[0017] Figure 7 is a schematic diagram of a dynamic header according to an embodiment of the present disclosure;
[0018] Figure 8 is a schematic diagram of a specific table header according to an embodiment of the present disclosure;
[0019] Fig. 9 It is a schematic diagram of splicing multiple types of tables according to an embodiment of the present disclosure;
[0020] Fig.10 is a flowchart of another method for generating an analysis report according to an embodiment of the present disclosure;
[0021] Fig.11 is a schematic diagram of a second analysis report according to an embodiment of the present disclosure;
[0022] Fig.12 is a schematic diagram of specific generation of an analysis report according to an embodiment of the present disclosure;
[0023] Fig.13 is a structural block diagram of a device for generating an analysis report according to an embodiment of the present disclosure;
[0024] Fig.14 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0029] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0030] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0031] There are two main types of data analysis solutions in related technologies: one is a data analysis platform, which can provide flexible data analysis services, but the data analysis platform restricts users from operating within the platform and does not provide the function of generating analysis report files; the other is an open source tool for generating Excel. Although this type of tool can provide file conversion functions, it cannot be combined with business data and custom reports.
[0032] like Figure 1 As shown, a second analysis report is composed of multiple first analysis reports (i.e., Sheet pages), and a first analysis report is composed of multiple tables. Through such a hierarchical structure, a complex report template can be described, and it has strong maintainability and scalability. Based on this, the technical solution disclosed in the present invention combines the hierarchical structure of the analysis report, abstracts the analysis report into streamlining or calculating different data sources, and combines it with a customized report template to generate a corresponding analysis report, and the analysis report supports both online viewing and downloading as a separate file.
[0033] According to an embodiment of the present disclosure, an embodiment of a method for generating an analysis report is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] In this embodiment, a method for generating an analysis report is provided, which can be used in computer devices, such as computers, notebook computers, etc. Figure 2 is a flow chart of a method for generating an analysis report according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0035] Step S101: Acquire report data and report template configuration information corresponding to a data source, where the report template configuration information includes at least one first report configuration information.
[0036] Report data is the data required to generate analytical reports, and can be extracted from data sources. Specifically, different business data sources are used for different business scenarios. Report data can come from the same business data source or from different business data sources. Multi-threaded parallel processing is used to extract different report data to improve the efficiency of report data extraction. For analytical report generation with huge data volumes, it can greatly reduce the report generation time.
[0037] In a specific example, the report data includes common data, which is obtained by cleaning, combining or calculating data from different business data sources. Since common data can be applied to the generation of different analysis reports, when extracting report data, it is possible to detect whether there is common data in the report data. If there is common data in the report data, the common data can be directly obtained to avoid repeated extraction and calculation, which is conducive to improving the efficiency of obtaining header data.
[0038] The report template configuration information is the structured configuration information set for generating an analysis report, such as column headers, row headers, cell styles, cell fill logic, row and column merging, and other structured configuration information. The first report configuration information is the structured configuration information for a certain analysis report. In the first report template configuration information, different structured configuration information can be set for different business data sources, that is, the first report template configuration information can include one or more first report configuration information.
[0039] Step S102: Generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template.
[0040] The first report template is a template for generating an analysis report, which may include structured information such as the header structure, style, and data presentation method of the analysis report. Since the first report configuration information is structured configuration information set for report generation, the report structure can be determined in combination with the first report configuration information, and the corresponding first report template can be constructed according to the report structure.
[0041] Determine the required fill-in data in conjunction with the first report template, extract the fill-in data from the report data, fill the fill-in data into the first report template for rendering, and generate a first analysis report in the form of a web page. Specifically, different first report configuration information corresponds to different report structures, and different report structures can generate different report templates, so that different report configuration information can be set based on different business scenarios, so that different report templates can be generated in combination with different business scenarios. Then, extract the fill-in data required for each header template from the report data, and fill the fill-in data into the corresponding position of the report template for web page rendering, so that the corresponding first analysis report can be generated, thereby realizing flexible generation and flexible configuration of analysis reports.
[0042] Step S103: merge the first analysis reports to generate a second analysis report.
[0043] The second analysis report has a report structure including multiple first analysis reports, and each first analysis report is independent in the second analysis report. Specifically, after the first analysis report is generated using the report data, each first analysis report is merged into the same report in accordance with the report merging method, so as to obtain the second analysis report. The report merging method indicates that each first analysis report is merged independently.
[0044] The method for generating an analysis report provided in this embodiment obtains report data and report template configuration information corresponding to a data source, and multiple first report configuration information are set in the report template configuration information, so that a first report template can be generated according to the first report configuration information, thereby realizing structured configuration of the report template, facilitating configuration of the report template according to different business scenarios, thereby supporting the generation of multiple first analysis reports, and realizing flexible configuration of the generation of the first analysis report. By filling the report data into the first report template to obtain the first analysis report corresponding to the first report template, and merging the first analysis reports to generate a second analysis report, so as to simultaneously include a set of reports of different dimensions in one analysis report, so as to adapt to the huge amount of data in the business scenario and improve the generation performance of the analysis report.
[0045] In this embodiment, a method for generating an analysis report is provided, which can be used in computer devices, such as computers, notebook computers, etc. Figure 3 is a flow chart of a method for generating an analysis report according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes the following steps:
[0046] Step S201, obtain report data and report template configuration information corresponding to the data source, where the report template configuration information includes at least one first report configuration information. For details, please refer to the relevant description of the corresponding steps in the above embodiment, which will not be repeated here.
[0047] Step S202: Generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template.
[0048] Specifically, the above step S202 includes:
[0049] Step S2021: extracting header configuration information from the first report configuration information, and generating a first report template according to the header configuration information.
[0050] As described above, the first report configuration information is structured configuration information generated for the first analysis report. The first report configuration information includes header configuration information, which is header information required to generate the first analysis report, including header name, header style, sub-header, etc.
[0051] The first report configuration information is parsed, the header configuration information contained therein is extracted from the first report configuration information, the header structure is determined according to the header configuration information, and the first report template is constructed according to the table structure and the cells corresponding to the header.
[0052] Step S2022: determine the header of the first report template based on the header configuration information.
[0053] The header of the first report template includes a row header and a column header. The row header indicates the title or name of each row, and the column header indicates the title or name of each column. The header configuration information carries structured information for the report header. By parsing the structured information of the report header, the row header and column header of the first report template can be determined.
[0054] In some optional implementations, the header corresponding to the first report template includes at least one of a static header, a dynamic header, and a specific header. The static header refers to a fixed row header or a column header; the dynamic header refers to a dynamically generated header; and the specific header refers to a dynamically generated special header.
[0055] Accordingly, the above step S2022 includes:
[0056] Step a1, parsing the header configuration information of the first report template, and determining the static header corresponding to the first report template.
[0057] The header configuration information is parsed to determine whether the header represented by the header configuration information is fixed. If the header represented by the header configuration information is fixed, it can be determined that the header is a static header. Specifically, for a one-dimensional table, its static header can be a fixed row header or a fixed column header, such as Figure 4 As shown; for a two-dimensional table, its static header may include a fixed row header and a fixed column header, such as Figure 5 shown.
[0058] After the static header is determined, the header configuration information can be further parsed to determine whether there is a sub-header for the static header. If there is a sub-header, it can be determined that there is a header merger, such as Figure 6 The row and column headers shown are merged.
[0059] Step a2: determining a dynamic header corresponding to the first report template based on the report data and the static header.
[0060] Dynamic headers are dynamically generated based on report data and static headers, such as Figure 7 The static header referenced by the dynamic header is set in the header configuration information, so that the dynamic header can be generated by combining the report data and the static header by parsing the header configuration information.
[0061] Step a3: determining a specific header corresponding to the first report template based on the report data and the static header.
[0062] A specific header is a special header that is dynamically generated based on report data and static headers, that is, a header with a special format, such as Figure 8 As shown in the figure, the method of generating a dynamic header is consistent with that of setting a static header referenced by a specific header in the header configuration information, and the specific header is dynamically generated by combining the report data and the static header.
[0063] By supporting the configuration of various types of row and column headers to achieve a variety of complex functions, the generation cost of different analysis reports is greatly reduced, and the scalability and maintainability of analysis report generation are improved.
[0064] Step S2023: extracting first report data corresponding to the first report template from the report data, filling the first report data into the first report template according to the table header, and generating a first analysis report.
[0065] The first report data is the data required to fill in the first report template. Specifically, according to the header information in the first report template, the first report data required for the first report template is determined, and the report data is queried to extract the first report data to fill in the first report template. After obtaining the first report data, according to the position of each header in the first report template, the first report data is filled into the cell area under each header to generate the corresponding first analysis report.
[0066] In some optional implementations, the above step S2023 includes:
[0067] Step b1, extracting header data corresponding to the header from the first report data, and filling the header data into the cell corresponding to the header to obtain the cell data.
[0068] Step b2: merge each table header and the cell data corresponding to each table header to obtain a first analysis report.
[0069] The header data includes the row data corresponding to the row header and / or the column data corresponding to the column header. Specifically, for a one-dimensional table, the header data is the row data corresponding to the row header or the column data corresponding to the column header; for a two-dimensional table, the header data includes the row data corresponding to the row header and the column data corresponding to the column header.
[0070] The first report data is classified according to the table headers to determine the row data corresponding to each row table header and / or the column data corresponding to each column table header. The row data is filled according to the cells corresponding to the row table headers, and the column data is filled according to the cells corresponding to the column table headers, thereby obtaining the filled cell data. Then, each table header and its corresponding cell data are spliced, combined and rendered to generate the corresponding first analysis report.
[0071] It should be noted that if multiple types of tables are obtained by combining the table header and its corresponding cell data, the multiple types of tables can be combined into one report page for rendering to generate the corresponding first analysis report, such as Fig. 9 shown.
[0072] By combining the table header and its corresponding cell data to render and generate the first analysis report, the generation accuracy of the first analysis report is improved, and the mutual independence of multiple first analysis reports is ensured, so that each first analysis report can be viewed or downloaded separately.
[0073] In some optional implementations, the above step S2023 further includes: if the header data corresponding to the header does not exist in the first report data, setting the cell corresponding to the header to blank.
[0074] If the header data corresponding to the header is not found in the first report data, it means that the header data under the header should be empty. In order to avoid the generation of the first analysis report being disturbed by damaged data, the cell data corresponding to the header can be set to be empty in the report configuration information, that is, it is determined that there is no data under the header. In this way, it is ensured that the generation of the first analysis report will not be affected by unexpected data, and the generation stability of the first analysis report is improved.
[0075] Step S203: merge the first analysis reports to generate a second analysis report. For details, please refer to the description of the corresponding steps in the above embodiment, which will not be repeated here.
[0076] The method for generating an analysis report provided in this embodiment abstracts the table header into structured header configuration information so as to configure the report functions such as row and column headers, row and column and cell styles, main cell filling logic, row and column merging, and multi-table merging of the analysis report. The header of the first report template is extracted from the table header configuration information to fill the first report data in the corresponding position to generate the first analysis report. In this way, a structured configuration for the report template is achieved, which facilitates the configuration of different information for multi-dimensional data in different business scenarios, and realizes flexible configuration for the generation of analysis reports, which is conducive to improving the scalability and maintainability of the generation of analysis reports.
[0077] In this embodiment, a method for generating an analysis report is provided, which can be used in computer devices, such as computers, notebook computers, etc. Fig.10 is a flow chart of a method for generating an analysis report according to an embodiment of the present disclosure, such as Fig.10 As shown, the process includes the following steps:
[0078] Step S301, obtain report data and report template configuration information corresponding to the data source, where the report template configuration information includes at least one first report configuration information. For details, please refer to the relevant description of the corresponding steps in the above embodiment, which will not be repeated here.
[0079] Step S302: Generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template. For details, please refer to the relevant description of the corresponding steps in the above embodiment, which will not be repeated here.
[0080] Step S303: merge the first analysis reports to generate a second analysis report.
[0081] Specifically, the above step S303 includes:
[0082] Step S3031, parallel processing is performed on the merged data of each first analysis report.
[0083] The data of each first analysis report is merged, and the merged data is divided into multiple small blocks of data to ensure that each small block of data can be processed independently and the processing results can be merged. Specifically, multiple threads can be used in a single process to process the merged data in parallel; the capabilities of a multi-core processor can also be used to use multiple processes to process the merged data in parallel.
[0084] Step S3032: Render the merged data according to the parallel processing result to generate a second analysis report.
[0085] Collect the parallel processing results of the merged data from the parallel processing tasks (different processes or threads), and render the parallel processing results in parallel according to the page layout and page format of the analysis report. Specifically, each time a part of the data is merged, it can be rendered, thereby realizing web page rendering for the parallel processing results, so as to merge and render multiple first analysis reports into the same second analysis report for display.
[0086] In some optional implementations, the second analysis report includes a plurality of report tabs, and the report tabs are used to switch and display a plurality of first analysis reports included in the second analysis report. Accordingly, the above method further includes:
[0087] Step c1, in response to a trigger operation on a report page tab, determining a target analysis report that needs to be activated currently according to the trigger operation.
[0088] Step c2, loading data for the target analysis report that needs to be activated currently.
[0089] Trigger operations are operations that occur when a user triggers a report tab, such as Fig.11 The second analysis report shown in FIG. 1 has multiple report tabs (i.e. Fig.11 Analytical Report 1, Analytical Report 2 and Analytical Report 3 shown in ).
[0090] The target analysis report currently to be activated is the first analysis report to be displayed (such as Fig.11 1). When the user triggers the report tab in the second analysis report, the second analysis report can respond to the user's trigger operation on the report tab and determine the target analysis report that needs to be activated for the report tab. When switching the target analysis report, an on-demand loading method is adopted to render the web page corresponding to the target analysis report, so as to avoid rendering too many analysis reports in the web page and affecting the browsing performance, thereby avoiding browsing jams and ensuring that the scrolling, switching, clicking and other operations of the web page corresponding to the target analysis report are not jammed, thereby ensuring the real-time preview effect of the target analysis report.
[0091] In some optional implementations, the above method further includes:
[0092] Step d1, obtaining a report structure of a second analysis report, and converting the report structure into a first data structure.
[0093] The report structure is a table data structure possessed by the second analysis report, such as a table in HTML format in a web page. The first data structure is a table data structure to be converted, such as a table in XLSX format. Specifically, the first analysis report included in the second analysis report is parsed, and the table metadata in the second analysis report is read according to the first analysis report dimension to determine the report structure of the second analysis report. Then, in combination with the conversion relationship between the report structure and the first data structure, the report structure of the second analysis report is converted into the first data structure.
[0094] When table metadata of multiple tables are read from the same first analysis report, the table metadata of each table is traversed, and the table metadata of each table is spliced and data structure converted to form report page data in the first data structure form.
[0095] Step d2: exporting a second analysis report according to the first data structure.
[0096] Combine the report page data in the first data structure format with the table metadata in the second analysis report to generate a complete report file in the first data structure format (such as XLSX), and export the report file in the first data structure format.
[0097] In business, analysis reports usually need to be exported as report files for further data analysis, transmission and archiving. By converting the report structure and the first data structure, the analysis report can be converted into the structure required by the report file to be exported, thereby achieving flexible export of the analysis report to support the analysis requirements of the report file.
[0098] The analysis report generation method provided in this embodiment realizes the processing and rendering of the first analysis report by parallel processing of the merged data of each first analysis report and rendering in combination with the parallel processing results, thereby reducing the generation time of the analysis report, improving the generation efficiency of the analysis report, and greatly improving the generation performance of the analysis report.
[0099] As a specific application example of the present disclosure, Fig.12 As shown, data sources of different businesses (business X data source and business Y data source) are obtained, wherein business X data source corresponds to data source X1, data source X2 and data source X3, and business Y data source corresponds to data source Y1, data source Y2 and data source Y3.
[0100] Clean, combine or calculate the data sources of different businesses to obtain some common data, such as Fig.12The general data 1 and general data 2 are shown. The general data is combined with the data extracted from the data source as report data, such as Fig.12 As shown, data source X1, data source X3, general data 1 and general data 2 are combined to generate report data 1 of analysis report 1, and data source Y2, data source Y3 and general data 2 are combined to generate report data 4 of analysis report 4.
[0101] Determine report configuration information (such as Fig.12 Then, a corresponding report template is generated according to the report configuration information, the report data of the first analysis report and the corresponding report template are combined to render and generate a corresponding first analysis report, and each first analysis report is merged to render and generate a corresponding second analysis report.
[0102] Each second analysis report may include multiple report pages corresponding to the first analysis reports, that is, one second analysis report includes multiple report sheet pages corresponding to the first analysis reports, and each first analysis report supports online preview and export to XLSX format report files.
[0103] In this embodiment, a device for generating an analysis report is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] This embodiment provides a device for generating an analysis report, such as Fig.13 As shown, including:
[0105] The acquisition module 401 is used to acquire report data and report template configuration information corresponding to a data source, where the report template configuration information includes at least one first report configuration information.
[0106] The filling module 402 is used to generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template.
[0107] The merging module 403 is used to merge the first analysis reports to generate a second analysis report.
[0108] In some optional implementations, the filling module 402 includes:
[0109] The header configuration extraction unit is used to extract the header configuration information from the first report configuration information and generate a first report template according to the header configuration information.
[0110] The header determining unit is used to determine the header of the first report template based on the header configuration information.
[0111] The first report generating unit is used to extract first report data corresponding to the first report template from the report data, fill the first report data into the first report template according to the table header, and generate a first analysis report.
[0112] In some optional implementations, the header of the first report template includes at least one of a static header, a dynamic header, and a specific header. Accordingly, the header determination unit includes:
[0113] The static header determination subunit is used to parse the header configuration information of the first report template and determine the static header corresponding to the first report template.
[0114] The dynamic header determination subunit is used to determine the dynamic header corresponding to the first report template based on the report data and the static header.
[0115] The specific header determination subunit is used to determine the specific header corresponding to the first report template based on the report data and the static header.
[0116] In some optional implementations, the first report generating unit includes:
[0117] The cell data determination subunit is used to extract the header data corresponding to the header from the first report data, and fill the header data into the cell corresponding to the header to obtain the cell data.
[0118] The merging subunit is used to merge each table header and the cell data corresponding to each table header to obtain a first analysis report.
[0119] In some optional implementations, the first report generating unit further includes:
[0120] The data blanking subunit is used to blank the cell corresponding to the header if the header data corresponding to the header does not exist in the first report data.
[0121] In some optional embodiments, the above device further includes:
[0122] The data structure conversion module is used to obtain the report structure of the second analysis report and convert the report structure into the first data structure.
[0123] The export module is used to export the second analysis report according to the first data structure.
[0124] In some optional implementations, the merging module 403 includes:
[0125] The parallel processing unit is used to perform parallel processing on the merged data of each first analysis report.
[0126] The second report generating unit is used to render the merged data according to the parallel processing result to generate a second analysis report.
[0127] In some optional implementations, the second analysis report includes a plurality of report tabs, and the apparatus further includes:
[0128] The activation module is used to respond to the trigger operation on the report page tab and determine the target analysis report that needs to be activated currently according to the trigger operation.
[0129] The data loading module is used to load data for the target analysis report that needs to be activated currently.
[0130] The analysis report generation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0131] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0132] The analysis report generation device provided by the embodiment of the present disclosure obtains the report data and report template configuration information corresponding to the data source, and multiple first report configuration information are set in the report template configuration information, so that the first report template can be generated according to the first report configuration information, and the structured configuration of the report template is realized, which is convenient for configuring the report template according to different business scenarios, thereby supporting the generation of multiple first analysis reports and realizing flexible configuration of the generation of the first analysis report. By filling the report data into the first report template to obtain the first analysis report corresponding to the first report template, and merging the first analysis reports to generate the second analysis report, so as to simultaneously include a set of reports of different dimensions in one analysis report, so as to adapt to the huge amount of data in the business scenario and improve the generation performance of the analysis report.
[0133] The present disclosure also provides a computer device having the above Fig.13 The analysis report generation device shown.
[0134] See also Fig.14 , Fig.14 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Fig.14As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.14 A processor 10 is taken as an example.
[0135] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0136] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0137] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0139] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.14 The example of connecting through bus is taken in the following.
[0140] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0141] The computer device also includes a communication interface, which is used for the computer device to communicate with other devices or a communication network.
[0142] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0143] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0144] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for generating an analysis report, characterized in that: The method comprises: Acquire report data and report template configuration information corresponding to the data source, wherein the report template configuration information includes at least one first report configuration information; Generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template; The first analysis reports are merged to generate a second analysis report.
2. The method according to claim 1, characterized in that The step of generating a first report template according to the first report configuration information, and filling the report data into the first report template to obtain a first analysis report corresponding to the first report template includes: Extracting header configuration information from the first report configuration information, and generating the first report template according to the header configuration information; Determine a header of the first report template based on the header configuration information; The first report data corresponding to the first report template is extracted from the report data, and the first report data is filled into the first report template according to the table header to generate the first analysis report.
3. The method according to claim 2, characterized in that The determining the header of the first report template based on the header configuration information includes: Parsing the header configuration information of the first report template to determine the static header corresponding to the first report template; and / or, Determine a dynamic header corresponding to the first report template based on the report data and the static header; and / or, Determine a specific header corresponding to the first report template based on the report data and the static header; The header of the first report template includes at least one of the static header, the dynamic header and the specific header.
4. The method according to claim 2 or 3, characterized in that: The step of filling the first report data into the first report template according to the table header to generate the first analysis report includes: Extracting the header data corresponding to the header from the first report data, and filling the header data into the cell corresponding to the header to obtain the cell data; Each of the table headers and the cell data corresponding to each of the table headers are merged to obtain the first analysis report.
5. The method according to claim 4, characterized in that Also includes: If the header data corresponding to the header does not exist in the first report data, the cell corresponding to the header is set to blank.
6. The method according to claim 1, characterized in that Also includes: Acquire the report structure of the second analysis report, and convert the report structure into a first data structure; The second analysis report is exported according to the first data structure.
7. The method according to claim 1, characterized in that The first analysis reports are combined to generate a second analysis report, including: Processing the merged data of each of the first analysis reports in parallel; The merged data is rendered according to the parallel processing result to generate the second analysis report.
8. The method according to claim 1, characterized in that The second analysis report includes a plurality of report tabs, and the method further includes: In response to a trigger operation on the report page tab, determining a target analysis report that needs to be activated currently according to the trigger operation; Load data for the target analysis report that needs to be activated currently.
9. A device for generating an analysis report, characterized in that: The device comprises: An acquisition module, used to acquire report data and report template configuration information corresponding to a data source, wherein the report template configuration information includes at least one first report configuration information; A filling module, used to generate a first report template according to the first report configuration information, and fill the report data into the first report template to obtain a first analysis report corresponding to the first report template; The merging module is used to merge the first analysis reports to generate a second analysis report.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for generating an analysis report according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for generating an analysis report according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the method for generating an analysis report according to any one of claims 1 to 8.