Report generation method and device, electronic equipment and readable storage medium

By providing a report generation method, users can enter report name and field information through the interactive interface, and the system will automatically generate reports, solving the problem of high technical threshold for the report generation process in the existing technology and reducing the difficulty of operation.

CN119476231APending Publication Date: 2025-02-18BEIJING JIAHE HAISEN HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411535724.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the existing technology, the report generation process has a high technical threshold and is heavily dependent on technicians, making it difficult to provide a simple report generation solution.

Method used

Provides a report generation method, which can display an interactive interface in response to a report creation request, obtain report name and field information, generate SQL statements based on the value formula, and execute the generation of reports.

Benefits of technology

It reduces the difficulty of generating reports. Users only need to enter the report name and field information, and the system automatically generates reports, which significantly improves the report generation ability of non-technical personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476231A_ABST
    Figure CN119476231A_ABST
Patent Text Reader

Abstract

The invention discloses a report generation method and device, electronic equipment and a readable storage medium. The method comprises the steps of displaying a first interactive interface in response to a report creation request; obtaining a report name input in the first interactive interface, a field name of each column / row in the report to be created, an attribute, a value formula and configuration information of the value formula, wherein the configuration information comprises a target data element corresponding to a logic calculation factor in the value formula and an identifier of a data table to which the target data element belongs; in response to a report generation request input in the first interaction interface, generating an SQL statement based on the value formula corresponding to each column / line and the configuration information of the value formula, and executing the SQL statement to generate target data of each column / line based on the data in the data warehouse; and generating the report according to the report name, the field name of each column / row in the report to be created and the target data. Based on the technical scheme disclosed by the invention, the operation difficulty of generating the report can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and in particular, relates to a report generation method, device, electronic device and readable storage medium. Background Art

[0002] Reports are a widely used data display method that can display data intuitively. For example, in the medical industry (such as hospitals, scientific research institutions, and management institutions), a large amount of medical data needs to be counted, and the data is usually displayed in the form of reports.

[0003] In the prior art, the report generation process has a high technical threshold and is heavily dependent on technical personnel. For those skilled in the art, how to provide a simpler solution for generating reports is an urgent problem to be solved. Summary of the invention

[0004] In view of this, the purpose of the present application is to provide a report generation method, device, electronic device and readable storage medium to reduce the difficulty of generating reports.

[0005] To achieve the above objectives, this application provides the following technical solutions:

[0006] In a first aspect, the present application discloses a report generation method, comprising:

[0007] In response to the report creation request, a first interactive interface is displayed;

[0008] Obtaining the report name entered in the first interactive interface;

[0009] Obtaining the field name, attribute, value formula and configuration information of each column / row in the report to be created input in the first interactive interface, wherein the configuration information includes: the target data element corresponding to the logical calculation factor in the value formula and the identifier of the data table to which the target data element belongs;

[0010] In response to a report generation request inputted in the first interactive interface, for each column / row in the report to be created, generating an SQL statement based on a value formula corresponding to each column / row and configuration information of the value formula, and executing the SQL statement to generate target data for each column / row based on data in the data warehouse;

[0011] A report is generated according to the report name, the field name of each column / row in the report to be created, and the target data.

[0012] Optionally, generating an SQL statement based on a value formula corresponding to any column / any row and configuration information of the value formula includes:

[0013] For the columns / rows of the report by category, the logical calculation factors in the value formula corresponding to the columns / rows of the report by category are replaced with the corresponding target data elements;

[0014] Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set;

[0015] The field name in the SQL template statement is replaced with the corresponding logical calculation factor in the current value formula, and the data table identifier in the SQL template statement is replaced with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the column / row of the report of the sub-type.

[0016] Optionally, generating an SQL statement based on a value-taking formula corresponding to any column and configuration information of the value-taking formula further includes:

[0017] For a numerical report column, replace the logical calculation factor in the value formula corresponding to the numerical report column with the corresponding target data element;

[0018] Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set;

[0019] For each cell in the numerical report column, the following steps are performed: replacing the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replacing the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and adding a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the row where the current cell is located in the sub-type report column.

[0020] Optionally, generating an SQL statement based on a value formula corresponding to any row and configuration information of the value formula further includes:

[0021] For a numerical report row, replace the logical calculation factor in the value formula corresponding to the numerical report row with the corresponding target data element;

[0022] Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set;

[0023] For each cell in the numerical report row, the following steps are performed respectively: replacing the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replacing the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and adding a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the column where the current cell is located in the sub-type report row.

[0024] Optionally, based on the above report generation method, it also includes:

[0025] In response to the visualization display request, display a second interactive interface;

[0026] Obtaining an identifier of a target report input in the second interactive interface;

[0027] Obtaining a location identifier of target data inputted in the second interactive interface;

[0028] Obtaining an identifier of a target chart style input in the second interactive interface;

[0029] In response to a graphical report generation request inputted in the second interactive interface, an interface of a chart template corresponding to the target chart style is called, and a target graphical report is generated based on target data in the target report.

[0030] Optionally, based on the above report generation method, it also includes:

[0031] In response to a naming request input in the second interactive interface, a name of the target graphical report is set.

[0032] In a second aspect, the present application provides a report generation device, comprising:

[0033] A creation request processing module is used to respond to a report creation request and display a first interactive interface;

[0034] A report data acquisition module, used to obtain the report name input in the first interactive interface; obtain the field name, attribute, value formula and configuration information of each column / row in the report to be created input in the first interactive interface, wherein the configuration information includes: the target data element corresponding to the logical calculation factor in the value formula, and the identifier of the data table to which the target data element belongs;

[0035] a target data generation module, for responding to a report generation request inputted in the first interactive interface, generating, for each column / row in the report to be created, an SQL statement based on a value formula corresponding to each column / row and configuration information of the value formula, and executing the SQL statement to generate target data for each column / row based on data in the data warehouse;

[0036] The report creation module is used to generate a report according to the report name, the field name of each column / row in the report to be created, and the target data.

[0037] Optionally, based on the above report generation device, further configuration is performed:

[0038] A display request processing module, used to respond to the visual display request and display the second interactive interface;

[0039] A display data acquisition module, used to obtain the identifier of the target report inputted in the second interactive interface; obtain the location identifier of the target data inputted in the second interactive interface; obtain the identifier of the target chart style inputted in the second interactive interface;

[0040] The graphical report generation module is used to respond to the graphical report generation request input in the second interactive interface, call the interface of the chart template corresponding to the target chart style, and generate a target graphical report based on the target data in the target report.

[0041] In a third aspect, the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0042] The memory is used to store programs;

[0043] The processor is used to execute the program so that the electronic device can implement any one of the report generation methods described above.

[0044] In a fourth aspect, the present application provides a readable storage medium, which carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device can implement any one of the report generation methods described above.

[0045] It can be seen that the beneficial effects of this application are:

[0046] Based on the report generation method disclosed in the present application, the user inputs the report name, the field name, attributes, value-taking formula and configuration information of each column / row in the report to be created in the first interactive interface, so that the electronic device can automatically generate the report. The user only needs to understand the role of the value-taking formula and configure the target data element corresponding to the logical calculation factor in the value-taking formula and the data table to which the target data element belongs according to business needs. Compared with the existing technology, the operational difficulty of generating reports is significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0048] Figure 1 A flow chart of a report generation method disclosed in this application;

[0049] Figure 2 A flowchart of another report generation method disclosed in this application;

[0050] Figure 3 A structural schematic diagram of a report generation device disclosed in this application;

[0051] Figure 4 This is a structural schematic diagram of another report generation device disclosed in this application;

[0052] Figure 5 This is a schematic diagram of the structure of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0053] In the existing technology, the report generation process is highly professional and complex. Due to its high technical threshold, the generation of reports is heavily dependent on technical personnel. Compared with business personnel, technical personnel have a much lower understanding of business data. This will lead to contradictions. Business personnel have a better understanding of business data, but do not have the ability to generate reports, while technical personnel have the ability to generate reports, but do not understand business data. This results in the report generated by the technical personnel being different from the needs of the business personnel, and the report needs to be modified repeatedly.

[0054] This problem is even more prominent in the medical field.

[0055] In order to strengthen medical quality management, standardize clinical diagnosis and treatment behaviors, and promote the standardization and homogenization of medical services, the management department has issued a series of specialized medical quality control indicator sets, aiming to continuously improve the scientific and refined level of medical quality management in medical institutions of all levels and types. Among them, the calculation of medical quality control indicators is the final link in the medical quality evaluation work. In actual practice, medical quality control indicators often change the definition of indicators, increase indicators, and eliminate indicators. The display forms of indicators in different quality control centers vary greatly.

[0056] In view of this, the present application discloses a report generation method, device, electronic device and readable storage medium to reduce the difficulty of generating reports.

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0058] See also Figure 1 , Figure 1 This is a flow chart of a report generation method disclosed in this application. The report generation method is executed by an electronic device, which may be a mobile phone or a computer. The report generation method includes:

[0059] S101: In response to a report creation request, a first interactive interface is displayed.

[0060] Optionally, when the user needs to create a report, the user clicks a control in the interface of the electronic device for indicating the creation of a new report, thereby sending a report creation request to the electronic device. Of course, the user can also send a report creation request to the electronic device in other ways, for example, the user sends a report creation request to the electronic device by voice, such as saying "create a report".

[0061] Optionally, when the user needs to create a report, the user enters the data management system and clicks a control in the data management system for indicating the creation of a new report, thereby sending a report creation request to the electronic device.

[0062] The electronic device responds to the report creation request and displays a preset interaction interface. For the convenience of description, the interaction interface is referred to as a first interaction interface.

[0063] S102: Obtaining a report name input in the first interactive interface.

[0064] Optionally, the first interactive interface at least displays: first prompt information prompting the user to input a name of the report to be created.

[0065] In implementation, the first prompt information displayed on the first interactive interface may include: an input box, and prompt information prompting the user to enter the name of the report to be created in the input box. The user enters the name of the report to be created in the input box.

[0066] S103: Obtain the field name of each column / row in the report to be created that is input in the first interactive interface.

[0067] Optionally, the first interactive interface at least displays: second prompt information prompting the user to input a field name for each column / row in the report to be created.

[0068] In implementation, the second prompt information displayed on the first interactive interface may include: multiple input boxes, and prompt information prompting to enter the field name of each column / row in the report to be created in each input box. The user enters the field name of each column / row in the report to be created in each input box.

[0069] S104: Obtaining the attributes of each column / row in the report to be created that is input in the first interactive interface.

[0070] Optionally, the first interactive interface at least displays: third prompt information prompting the user to input attributes of each column / row in the report to be created.

[0071] In implementation, the third prompt information displayed in the first interactive interface may include: multiple input boxes, and prompt information prompting to enter the attributes of each column / row in the report to be created in each input box. The user enters the attributes of each column / row in the report to be created in each input box.

[0072] Optionally, the attributes of a column include: a report column of a sub-type and a report column of a numerical type. The report column of a sub-type is used to define the classification dimension of the data in the report, and the report column of a numerical type is used to define the calculation rules of the data in the report. In addition, for the report column of a sub-type, the reference value of the column can be further defined. The attributes of a row include: a report row of a sub-type and a report row of a numerical type. The report row of a sub-type is used to define the classification dimension of the data in the report, and the report row of a numerical type is used to define the calculation rules of the data in the report.

[0073] S105: Obtaining the value formula and configuration information of the value formula corresponding to each column / row in the report to be created input in the first interactive interface.

[0074] The configuration information of the value-taking formula includes: the target data element corresponding to the logical calculation factor in the value-taking formula and the identifier of the data table to which the target data element belongs.

[0075] The data warehouse stores multiple data tables, each of which contains one or more data elements. Each data element in the aforementioned data table can be used as the data source for the columns / rows in the report to be created. It should be noted that any column / row in the report to be created may require the use of multiple data elements in the data table, where a data element is also called a data element, which is a data unit that uses a set of attributes to describe its definition, identification, representation, and allowed values.

[0076] The data table is stored in a specific structure. The source of the data table consists of two parts. One part is the public variables in the system, such as the name of the institution, and the other part is the variables collected from the form. The storage structure is "data set_data element", for example, "basic information reporting_number of cesarean sections".

[0077] If the column in the report to be created is a categorical report column (i.e., the field of the column is a categorical field), the value formula of the column is limited to a categorical formula; if the column in the report to be created is a numeric report column (i.e., the field of the column is a numeric field), the value formula of the column is limited to a counting formula. If the line in the report to be created is a categorical report row (i.e., the field of the row is a categorical field), the value formula of the row is limited to a categorical formula; if the line in the report to be created is a numeric report row (i.e., the field of the row is a numeric field), the value formula of the row is limited to a counting formula. The classification formula is mainly used to clarify the statistical dimension of the report column / row, and the counting formula is mainly used to clarify the calculation rules of the report column / row.

[0078] The following is an example to illustrate the value-determining formula.

[0079] Classification formula:

[0080] time(a, yyyy-mm): classifies data according to the year-month of field a, which is time data.

[0081] time(a, yyyy): classifies according to the year of field a, which is time data;

[0082] group(a, 'good', 'good', 'bad'): classify by the keyword in field a. Field a is text or options. Classify and count the text content by keyword.

[0083] group(a, count): classifies according to the text in field a, field a is text or option, and classifies and counts the text content;

[0084] section group(a, "0-100", "100-200", "200-300"): Classify according to the numerical range of field a. By default, each numerical range includes the left endpoint but excludes the right endpoint. Field a is numeric data.

[0085] Counting formula:

[0086] sum(a+b+c,[f,2020-01-01,2021-01-01]and{d,"Level 3"}and{e,"Public"}and<j,"0-100"or"200-300"> ): Add multiple field values. Field a, field b, and field c are all numeric. [] indicates the time filter interval for data statistics, {} indicates the variable filter condition for text data statistics, and <> indicates the filter condition for numeric variables.

[0087] In the above examples of value-taking formulas, "a", "b" and "c" represent a variable respectively, "yyyy-mm" represents "year-month", "yyyy" represents "year", and "count" represents "total number".

[0088] Optionally, the first interactive interface at least displays: the names of the alternative value formulas. That is, the first interactive interface displays the names of the alternative value formulas, and the user can select the corresponding value formula from the alternative value formulas according to business needs. For example, the first interactive interface displays a drop-down box, which contains the names of the alternative value formulas, and the user can select the corresponding value formula in the drop-down box.

[0089] Optionally, the first interactive interface further displays prompt information about the value formula. Optionally, the prompt information about the value formula is used to illustrate the function of the formula.

[0090] After the user selects a value formula for any row or column, the first interactive interface displays a control for inputting configuration information of the value formula. The user can input the configuration information of the value formula in the corresponding control.

[0091] Here we take the value formula radio(sum(a) / sum(b)&100) as an example to illustrate:

[0092] After the user selects the value formula, the first interactive interface displays the target data element input boxes of the logical calculation factors "a" and "b" and the corresponding data table identifier input boxes. The user enters the target data element in the target data element input box of the logical calculation factor "a" and enters the identifier of the data table to which the target data element belongs in the corresponding data table identifier input box. Similarly, the user enters the target data element in the target data element input box of the logical calculation factor "b" and enters the identifier of the data table to which the target data element belongs in the corresponding data table identifier input box.

[0093] It should be noted that after understanding the function of the value formula, the user can select the corresponding value formula according to the business needs. In implementation, only simple training is needed for business personnel to enable them to have the ability to select and configure the value formula.

[0094] S106: In response to the report generation request input in the first interactive interface, for each column / each row in the report to be created, generate an SQL statement based on the value formula corresponding to each column / each row and the configuration information of the value formula, and execute the SQL statement to generate target data for each column / each row based on the data in the data warehouse.

[0095] The user inputs a report generation request in the first interactive interface, and the electronic device responds to the report generation request and executes for each column / row in the report: Generate an SQL statement based on the value formula corresponding to the column / row and the configuration information of the value formula, and execute the SQL statement to generate the target data of the column / row based on the data in the data warehouse. In the case where the value formula is a classification formula, execute the SQL statement to obtain the matching data (i.e., target data) from the data warehouse. In the case where the value formula is a counting formula, execute the SQL statement to obtain the matching data from the data warehouse, and calculate the data to obtain the target data. The target data is the data that needs to be filled in the cells of the report to be created. The full name of SQL in English is Structured Query Language, and the full name in Chinese is Structured Query Language.

[0096] S107: Generate a report based on the report name, the field name of each column / row in the report to be created, and the target data.

[0097] The report generation method disclosed in the present application, the electronic device displays a first interactive interface in response to a report creation request, obtains the report name entered by the user in the first interactive interface, the field name, attribute, value formula and configuration information of the value formula of each column / row in the report to be created, and then, in response to the report generation request entered in the first interactive interface, generates an SQL statement for each column / row in the report to be created based on the value formula corresponding to each column / row and the configuration information of the value formula, executes the SQL statement, so as to generate the target data of each column / row based on the data in the data warehouse, and then generates the report according to the report name entered by the user, the field name and target data of each column / row in the report to be created. Based on the report generation method disclosed in the present application, the user enters the report name, the field name, attribute, value formula and configuration information of the value formula of each column / row in the report to be created in the first interactive interface, so that the electronic device can automatically generate the report, and the user only needs to understand the role of the value formula and configure the target data element corresponding to the logical calculation factor in the value formula and the data table to which the target data element belongs according to the business needs. Compared with the prior art, the difficulty of generating the report is significantly reduced.

[0098] In the report generation method disclosed above in the present application, for any column in the report, an SQL statement is generated based on the value formula corresponding to the column and the configuration information of the value formula. The following scheme can be adopted:

[0099] First, replace the logical calculation factor in the value formula with the target data element corresponding to the logical calculation factor;

[0100] Second, based on the keywords in the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set;

[0101] Third, determine the attributes of the column, and perform corresponding processing based on the attributes of the column.

[0102] Specific:

[0103] If the column is a sub-type report column, the field name in the SQL template statement is replaced with the corresponding logical calculation factor in the current value formula, and the data table identifier in the SQL template statement is replaced with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the sub-type report column. In implementation, according to specific needs, the predicate parameter in the SQL template statement can be configured as DISTINCT.

[0104] If the column is a numeric report column, execute the following steps for each cell in the column: replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause to the SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the row where the cell is located in the report column of the sub-type.

[0105] Optionally, an SQL statement is generated based on a value-taking formula corresponding to any column and configuration information of the value-taking formula, including:

[0106] For a sub-type report column, replace the logical calculation factor in the value formula corresponding to the sub-type report column with the target data element corresponding to the logical calculation factor; based on the keyword in the value formula, obtain an SQL template statement matching the value formula from a pre-built SQL template statement set (for ease of distinction, it can be called a first SQL template statement); replace the field name in the first SQL template statement with the corresponding logical calculation factor in the current value formula, and replace the data table identifier in the first SQL template statement with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the sub-type report column;

[0107] For a numerical report column, replace the logical calculation factor in the value formula corresponding to the numerical report column with the target data element corresponding to the logical calculation factor; based on the keyword in the value formula, obtain the SQL template statement (which can be called the second SQL template statement) that matches the value formula from the pre-built SQL template statement set; for each cell in the numerical report column, respectively execute: replace the field name in the second SQL template statement with the logical calculation factor corresponding to the current value formula, replace the data table identifier in the second SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause in the second SQL template statement to obtain the SQL statement of the cell, wherein the query condition in the where clause is: the data in the row where the cell is located in the report column of the classification type.

[0108] It should be noted that the report to be created usually includes a classification report column and at least one numerical report column. Since the where clause in the SQL statement corresponding to the numerical report column needs to be generated based on the query result of the classification report column, the electronic device, in response to the report generation request, first generates an SQL statement for the classification report column, executes the SQL statement, obtains the target data of the classification report column, and then generates an SQL statement for each numerical report column, executes the generated SQL statement, and obtains the target data of the numerical report column.

[0109] In the report generation method disclosed above in the present application, for any row in the report, an SQL statement is generated based on the value formula corresponding to the row and the configuration information of the value formula. The following scheme can be adopted:

[0110] First, replace the logical calculation factor in the value formula with the target data element corresponding to the logical calculation factor;

[0111] Second, based on the keywords in the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set;

[0112] Third, determine the attributes of the row, and perform corresponding processing based on the attributes of the row.

[0113] Specific:

[0114] If the row is a sub-type report row, replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, and replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the sub-type report row. Usually, the predicate parameter in the SQL template statement is configured as DISTINCT.

[0115] If the row is a numerical report row, execute the following for each cell in the row: replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause to the SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the column where the cell is located in the report row of the sub-type.

[0116] Optionally, an SQL statement is generated based on a value formula corresponding to any row and configuration information of the value formula, including:

[0117] For a sub-type report row, replace the logical calculation factor in the value formula corresponding to the sub-type report row with the target data element corresponding to the logical calculation factor; based on the keyword in the value formula, obtain an SQL template statement (which may be referred to as a third SQL template statement) that matches the value formula from a pre-built SQL template statement set; replace the field name in the third SQL template statement with the logical calculation factor corresponding to the current value formula, and replace the data table identifier in the third SQL template statement with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the sub-type report row;

[0118] For a numerical report row, replace the logical calculation factor in the value formula corresponding to the numerical report row with the target data element corresponding to the logical calculation factor; based on the keyword in the value formula, obtain an SQL template statement (which can be called the fourth SQL template statement) that matches the value formula from a pre-built SQL template statement set; for each cell in the numerical report row, execute respectively: replace the field name in the fourth SQL template statement with the logical calculation factor corresponding to the current value formula, replace the data table identifier in the fourth SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause in the fourth SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the column where the cell is located in the report row of the sub-type.

[0119] It should be noted that the report to be created usually includes a sub-type report row and at least one numeric report row. Since the where clause in the SQL statement corresponding to the numeric report row needs to be generated based on the query result of the sub-type report row, the electronic device, in response to the report generation request, first generates an SQL statement for the sub-type report row, executes the SQL statement, obtains the target data of the sub-type report row, and then generates an SQL statement for each numeric report row, executes the generated SQL statement, and obtains the target data of the numeric report row.

[0120] The report generation method disclosed in this application is described below by taking the creation of a report as shown in Table 1 as an example.

[0121] Table 1

[0122] Reporting year Number of cesarean sections Cesarean section rate 2012 100 15% 2013 80 20% 2014 90 25% ... ... ...

[0123] 1) The electronic device responds to the report creation request and displays a first interactive interface.

[0124] 2) The electronic device obtains the report name input by the user in the first interactive interface, the field name of each column in the report to be created, the attribute of each column, the value formula corresponding to each column, and the configuration information of the value formula.

[0125] Specific:

[0126] The report name entered by the user is "Cesarean Section Data".

[0127] The field name of the first column entered by the user is "reporting year", the attribute of the first column is a report column of different types, and the corresponding value formula of the first column is "time(a,yyyy)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "year_column", and the identifier of the data table to which the target data element "year_column" belongs is table_A.

[0128] The field name of the second column entered by the user is "Number of Cesarean Sections", the attribute of the second column is a numeric report column, and the corresponding value formula of the second column is "sum(a)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "Number of Cesarean Sections", and the identifier of the data table to which the target data element "Number of Cesarean Sections" belongs is table_A.

[0129] The field name of the third column entered by the user is "Cesarean Section Rate", the attribute of the third column is a numeric report column, and the corresponding value formula of the third column is "radio(sum(a) / sum(b)&100)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "Number of Cesarean Sections", the target data element corresponding to the logical calculation factor "b" is "Total Number of Parturients", the identifier of the data table to which the target data element "Number of Cesarean Sections" belongs is table_A, and the identifier of the data table to which the target data element "Total Number of Parturients" belongs is tabel_B.

[0130] 3) The electronic device responds to the report generation request input by the user in the first interactive interface, generates an SQL statement for each column in the report based on the value formula corresponding to the column and the configuration information of the value formula, and executes the SQL statement to generate the target data of the column based on the data in the data warehouse.

[0131] For the first column in the report:

[0132] First, replace the logical calculation factor "a" in the value-taking formula "time(a,yyyy)" with the target data element "year_column". In other words, the value-taking formula "time(a,yyyy)" is transformed into "time(year_column,yyyy)".

[0133] Second, based on the keyword "time" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0134] For example, the SQL template statement obtained based on the keyword "time" is as follows:

[0135] select DISTINCT DATE_FORMAT(a,'%Y')from table_name

[0136] Third, replace the field name "DATE_FORMAT(a,'%Y')" in the SQL template statement with the current logical calculation factor "year_column", and replace the data table identifier "table_name" in the SQL template statement with "table_A", so as to obtain the SQL statement for the first column, specifically:

[0137] SELECT DISTINCT year_column FROM table_A

[0138] Fourth, the electronic device executes the above SQL statement to generate the target data of the first column.

[0139] For the second column in the report:

[0140] First, replace the logical calculation factor "a" in the value formula "sum(a)" with the target data element "number of cesarean sections", that is, the value formula "sum(a)" is transformed into "sum(number of cesarean sections)".

[0141] Second, based on the keyword "sum" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0142] For example, the SQL template statement obtained based on the keyword "sum" is as follows:

[0143] select sum(a)as total_sum from table_name

[0144] Third, replace the field name "a" in the SQL template statement with the current logical calculation factor "number of cesarean sections", and replace the data table identifier "table_name" in the SQL template statement with "table_A"; in addition, the second column in the report is a numeric report column, and the SQL statement generated for each cell in this column needs to include a where clause.

[0145] Specifically, the query condition in the where clause of the cell located in the second column and second row of the report is the query result (i.e., target data) of the cell located in the first column and second row of the report; the query condition in the where clause of the cell located in the second column and third row of the report is the query result of the cell located in the first column and third row of the report, and so on.

[0146] The SQL statement for the cell in the second column and second row of the report is as follows:

[0147] SELECT SUM (number of cesarean sections)AS sum_total FROM table_A WHERE year_column=2012

[0148] The SQL statement for the cell in the second column and third row of the report is as follows:

[0149] SELECT SUM (number of cesarean sections)AS sum_total FROM table_A WHERE year_column=2013

[0150] The SQL statement for the cell in the second column and fourth row of the report is as follows:

[0151] SELECT SUM (number of cesarean sections)AS sum_total FROM table_A WHERE year_column=2014

[0152] The SQL statements for other cells in the column are similar.

[0153] Fourth, the electronic device executes the above SQL statement to generate target data in the second column.

[0154] For the third column in the report:

[0155] First, replace the logical calculation factor "a" in the value formula "radio(sum(a) / sum(b)&100)" with the target data element "number of cesarean sections", and replace the logical calculation factor "b" in the value formula with "total number of parturients". In other words, the value formula "radio(sum(a) / sum(b)&100)" is transformed into "radio(sum(number of cesarean sections) / sum(total number of parturients)&100)".

[0156] Second, based on the keyword "radio" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0157] For example, the SQL template statement obtained based on the keyword "radio" is as follows:

[0158] (select sum(a)from table_name) / (select sum(b)from table_name)*100ASpercentage

[0159] Third, replace the field name "a" in the SQL template statement with the current logical calculation factor "number of cesarean sections", replace the first data table identifier "table_name" in the SQL template statement with "table_A", replace the field name "b" in the SQL template statement with the current logical calculation factor "total number of parturients", and replace the second data table identifier "table_name" in the SQL template statement with "table_B"; in addition, the third column in the report is a numerical report column, and the SQL statement generated for each cell in this column needs to include a where clause.

[0160] Specifically, the query condition in the where clause of the cell located in the third column and second row of the report is the query result of the cell located in the first column and second row of the report; the query condition in the where clause of the cell located in the third column and third row of the report is the query result of the cell located in the first column and third row of the report, and so on.

[0161] The SQL statement for the cell in the third column and second row of the report is as follows:

[0162] (select sum(number of cesarean sections) from table_A where year_column=2012) / (select sum(total number of parturients) from table_B where year_column=2012)*100AS percentage

[0163] The SQL statement for the cell in the third column and third row of the report is as follows:

[0164] (select sum(number of cesarean sections) from table_A where year_column=2013) / (select sum(total number of parturients) from table_B where year_column=2013)*100AS percentage

[0165] The SQL statement for the cell in the third column and fourth row of the report is as follows:

[0166] (select sum(number of cesarean sections) from table_A where year_column=2014) / (select sum(total number of parturients) from table_B where year_column=2014)*100AS percentage

[0167] The SQL statements for other cells in the column are similar.

[0168] Fourth, the electronic device executes the above SQL statement to generate target data in the third column.

[0169] 4) The electronic device generates a report according to the report name, the field name of each column in the report, and the target data of each column in the report input by the user.

[0170] The report generation method disclosed in this application is described below by taking the creation of a report as shown in Table 2 as an example.

[0171] Table 2

[0172] Reporting year 2012 2013 2014 ... Number of cesarean sections 100 80 90 ... Cesarean section rate 15% 20% 25% ...

[0173] 1) The electronic device responds to the report creation request and displays a first interactive interface.

[0174] 2) The electronic device obtains the report name input by the user in the first interactive interface, the field name of each row in the report to be created, the attribute of each row, the value formula corresponding to each row, and the configuration information of the value formula.

[0175] Specific:

[0176] The report name entered by the user is "Cesarean Section Data".

[0177] The field name of the first row entered by the user is "reporting year", the attribute of the first row is the report row of the classification, and the corresponding value formula of the first row is "time(a,yyyy)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "year_column", and the identifier of the data table to which the target data element "year_column" belongs is table_A.

[0178] The field name of the second row entered by the user is "Number of Cesarean Sections", the attribute of the second row is a numeric report row, and the corresponding value formula of the second row is "sum(a)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "Number of Cesarean Sections", and the identifier of the data table to which the target data element "Number of Cesarean Sections" belongs is table_A.

[0179] The field name of the third row entered by the user is "Cesarean Section Rate", the attribute of the third row is a numeric report row, and the corresponding value formula of the third row is "radio(sum(a) / sum(b)&100)". The configuration information of the value formula is as follows: the target data element corresponding to the logical calculation factor "a" is "Number of Cesarean Sections", the target data element corresponding to the logical calculation factor "b" is "Total Number of Parturients", the identifier of the data table to which the target data element "Number of Cesarean Sections" belongs is table_A, and the identifier of the data table to which the target data element "Total Number of Parturients" belongs is tabel_B.

[0180] 3) The electronic device responds to the report generation request input by the user in the first interactive interface, generates an SQL statement for each row in the report based on the value formula corresponding to the row and the configuration information of the value formula, and executes the SQL statement to generate the target data of the column based on the data in the data warehouse.

[0181] For the first row in the report:

[0182] First, replace the logical calculation factor "a" in the value-taking formula "time(a,yyyy)" with the target data element "year_column". In other words, the value-taking formula "time(a,yyyy)" is transformed into "time(year_column,yyyy)".

[0183] Second, based on the keyword "time" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0184] For example, the SQL template statement obtained based on the keyword "time" is as follows:

[0185] select DISTINCT DATE_FORMAT(a,'%Y')from table_name

[0186] Third, replace the field name "DATE_FORMAT(a,'%Y')" in the SQL template statement with the current logical calculation factor "year_column", and replace the data table identifier "table_name" in the SQL template statement with "table_A", so as to obtain the SQL statement for the first column, specifically:

[0187] SELECT DISTINCT year_column FROM table_A

[0188] Fourth, the electronic device executes the above SQL statement to generate the first row of target data.

[0189] For the second row in the report:

[0190] First, replace the logical calculation factor "a" in the value formula "sum(a)" with the target data element "number of cesarean sections", that is, the value formula "sum(a)" is transformed into "sum(number of cesarean sections)".

[0191] Second, based on the keyword "sum" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0192] For example, the SQL template statement obtained based on the keyword "sum" is as follows:

[0193] select sum(a)as total_sum from table_name

[0194] Third, replace the field name "a" in the SQL template statement with the current logical calculation factor "number of cesarean sections", and replace the data table identifier "table_name" in the SQL template statement with "table_A"; in addition, the second row in the report is a numerical report column, and the SQL statement generated for each cell in this row needs to include a where clause.

[0195] Specifically, the query condition in the where clause of the cell located in the second row and second column of the report is the query result of the cell located in the first row and second column of the report; the query condition in the where clause of the cell located in the second row and third column of the report is the query result of the cell located in the first row and third column of the report; the query condition in the where clause of the cell located in the second row and fourth column of the report is the query result of the cell located in the first row and fourth column of the report; and so on.

[0196] The SQL statement for the cell in the second row and second column of the report is as follows:

[0197] SELECT SUM (number of cesarean sections)AS sum_total FROM table_AWHERE year_column=2012

[0198] The SQL statement for the cell in the second row and third column of the report is as follows:

[0199] SELECT SUM (number of cesarean sections)AS sum_total FROM table_AWHERE year_column=2013

[0200] The SQL statement for the cell in the second row and fourth column of the report is as follows:

[0201] SELECT SUM (number of cesarean sections)AS sum_total FROM table_AWHERE year_column=2014

[0202] The SQL statements for other cells in the row are similar.

[0203] Fourth, the electronic device executes the above SQL statement to generate the target data of the second row.

[0204] For the third row in the report:

[0205] First, replace the logical calculation factor "a" in the value formula "radio(sum(a) / sum(b)&100)" with the target data element "number of cesarean sections", and replace the logical calculation factor "b" in the value formula with "total number of parturients". In other words, the value formula "radio(sum(a) / sum(b)&100)" is transformed into "radio(sum(number of cesarean sections) / sum(total number of parturients)&100)".

[0206] Second, based on the keyword "radio" of the value-taking formula, an SQL template statement matching the value-taking formula is obtained from a pre-built SQL template statement set.

[0207] For example, the SQL template statement obtained based on the keyword "radio" is as follows:

[0208] (select sum(a)from table_name) / (select sum(b)from table_name)*100ASpercentage

[0209] Third, replace the field name "a" in the SQL template statement with the current logical calculation factor "number of cesarean sections", replace the first data table identifier "table_name" in the SQL template statement with "table_A", replace the field name "b" in the SQL template statement with the current logical calculation factor "total number of parturients", and replace the second data table identifier "table_name" in the SQL template statement with "table_B"; in addition, the third row in the report is a numerical report row, and the SQL statement generated for each cell in this row needs to include a where clause.

[0210] Specifically, the query condition in the where clause of the cell located in the third row and second column of the report is the query result of the cell located in the first row and second column of the report; the query condition in the where clause of the cell located in the third row and third column of the report is the query result of the cell located in the first row and third column of the report; the query condition in the where clause of the cell located in the third row and fourth column of the report is the query result of the cell located in the first row and fourth column of the report; and so on.

[0211] The SQL statement for the cell in the third row and second column of the report is as follows:

[0212] (select sum(number of cesarean sections) from table_A where year_column=2012) / (select sum(total number of parturients) from table_B where year_column=2012)*100AS percentage

[0213] The SQL statement for the cell in the third row and third column of the report is as follows:

[0214] (select sum(number of cesarean sections) from table_A where year_column=2013) / (select sum(total number of parturients) from table_B where year_column=2013)*100AS percentage

[0215] The SQL statement for the cell in the third row and fourth column of the report is as follows:

[0216] (select sum(number of cesarean sections) from table_A where year_column=2014) / (select sum(total number of parturients) from table_B where year_column=2014)*100AS percentage

[0217] The SQL statements for other cells in the row are similar.

[0218] Fourth, the electronic device executes the above SQL statement to generate the target data of the third row.

[0219] 4) The electronic device generates a report according to the report name input by the user, the field name of each row in the report, and the target data of each row in the report.

[0220] See also Figure 2 , Figure 2This is a flow chart of another report generation method disclosed in this application. Figure 1 Based on the report generation method shown, further settings are made:

[0221] S201: In response to a visualization display request, a second interactive interface is displayed.

[0222] Optionally, when the user needs to graphically display the created report, the user clicks a control in the interface of the electronic device for indicating the graphical display of the report, thereby sending a visualization display request to the electronic device.

[0223] In implementation, a control for indicating a graphical presentation report may be provided in the first interactive interface. Figure 1 After the method shown generates a report, if the user needs to graphically display the report or other created reports, a user can click the corresponding control in the first interactive interface to send a visual display request to the electronic device.

[0224] Of course, the user may also send a visualization display request to the electronic device in other ways, for example, the user sends a visualization display request to the electronic device by voice, such as saying "visual display report".

[0225] Optionally, when the user needs to graphically display the created report, the user enters the data management system and clicks a control in the data management system for indicating visual display of data, thereby sending a visual display request to the electronic device.

[0226] S202: Obtaining the identifier of the target report input in the second interactive interface.

[0227] The user inputs the identifier of the report that needs to be visualized in the second interactive interface. The target report is the report that needs to be visualized.

[0228] Optionally, the second interactive interface at least displays: an input box for inputting the identifier of the target report. The user can write the identifier of the target report into the input box. In order to facilitate the user to input the identifier of the target report, the second interactive interface can also display: a hyperlink of a file selection window. The user clicks on the hyperlink to trigger the electronic device to display a file selection window on the second interactive interface, and the user selects the target report in the file selection window. It should be noted that the identifier of the target report can be the storage path of the target report, or the name of the target report.

[0229] S203: Obtain a location identifier of target data input on the second interactive interface.

[0230] Target data is the data that needs to be displayed graphically in the target report.

[0231] The location identifier of the target data may be: a row identifier and / or a column identifier in the target report.

[0232] In implementation, the user can use a variety of solutions to input the location identifier of the target data on the second interactive interface.

[0233] As an optional method, the second interactive interface at least displays: an input box for inputting row identifiers and column identifiers. The user can enter the identifier (such as a serial number or field name) of the column / row where the data to be visualized in the target report is located in the input box. In addition, the second interactive interface can also display: the serial number and field name of each column / row in the target report, so that the user can intuitively know the information of each column / row in the target report, and thus quickly and accurately input the information of the target column / row.

[0234] Optionally, the second interactive interface at least displays: identifiers of each column / row in the target report (such as serial numbers or field names) and selection boxes corresponding to each column / row. The user can select the selection boxes corresponding to each column to be visualized one by one in the second interactive interface.

[0235] As another optional manner, the second interactive interface displays the target report, the user selects the data that needs to be graphically displayed in the target report, and the electronic device obtains the location identifier of the data selected by the user.

[0236] It should be noted that the target data can be data located in one or more columns in the target report, data located in one or more rows in the target report, data located between two rows and two columns in the target report, and of course, the target data can also be all the data in the target report. The choice of target data is determined by the user according to needs.

[0237] S204: Obtaining an identifier of a target chart style input in the second interactive interface.

[0238] The user inputs the identifier of the chart style to be adopted in the second interactive interface. The target chart style is the chart style to be adopted.

[0239] Optionally, the second interactive interface at least displays: an input box for inputting the identifier of a target chart style. The user can input the identifier (such as the name) of the chart style required for the target report in the input box. In addition, the second interactive interface can also display: the identifiers of all chart styles that the electronic device can provide, so that the user can intuitively know the chart styles that can be used, and thus quickly and accurately input the identifier of the target chart style.

[0240] Optionally, the second interactive interface at least displays: the identifiers of all chart styles that the electronic device can provide and the selection boxes corresponding to the chart styles. The user can select the selection box corresponding to the desired chart style in the second interactive interface.

[0241] Chart styles include but are not limited to: bar chart, line chart, pie chart, bar chart, area chart, scatter chart, radar chart, tree map, and histogram.

[0242] S205: In response to the graphical report generation request inputted in the second interactive interface, the interface of the chart template corresponding to the target chart style is called, and a target graphical report is generated based on the target data in the target report.

[0243] After receiving the request for generating a graphical report, the electronic device obtains the target report based on the identifier of the target report, calls the interface of the chart template corresponding to the target chart style, and generates a graphical report based on the target data in the target report.

[0244] Optionally, after generating the target graphical report, the method further includes: responding to a naming request input on the second interactive interface and setting a name of the target graphical report.

[0245] The user inputs a naming request on the second interactive interface, the naming request including a name, and the electronic device names the target graphical report as the name included in the naming request.

[0246] This application Figure 2 In the report generation method shown, the electronic device displays a second interactive interface in response to a visualization display request, obtains the identifier of the target report (i.e., the report that needs to be graphically displayed) input by the user on the second interactive interface, the location identifier of the target data (the data that needs to be graphically displayed in the target report), and the identifier of the target chart style (the chart style required to be adopted), and then responds to the graphical report generation request input by the user on the second interactive interface, calls the interface of the chart template corresponding to the target chart style, generates a target graphical report based on the target data, and realizes graphical display of the created report according to user needs, thereby reducing the user's operation difficulty.

[0247] The present application discloses a report generation method as mentioned above, and correspondingly, the present application also discloses a report generation device, and the descriptions of the two in the specification can be referenced to each other.

[0248] See also Figure 3 , Figure 3 This is a structural diagram of a report generation device disclosed in this application. The report generation device includes:

[0249] A creation request processing module 301 is used to respond to a report creation request and display a first interactive interface;

[0250] The report data acquisition module 302 is used to obtain the report name input in the first interactive interface; obtain the field name, attribute, value formula and configuration information of the value formula of each column / row in the report to be created input in the first interactive interface, wherein the configuration information includes: the target data element corresponding to the logical calculation factor in the value formula, and the identifier of the data table to which the target data element belongs;

[0251] The target data generation module 303 is used to respond to the report generation request input in the first interactive interface, generate SQL statements for each column / row in the report to be created based on the value formula corresponding to each column / row and the configuration information of the value formula, and execute the SQL statements to generate target data for each column / row based on the data in the data warehouse;

[0252] The report creation module 304 is used to generate a report according to the report name, the field name of each column / row in the report to be created, and the target data.

[0253] Optionally, the target data generation module 303 generates an SQL statement based on a value-taking formula corresponding to any column and configuration information of the value-taking formula, including:

[0254] For a sub-type report column, replace the logical calculation factor in the value formula corresponding to the sub-type report column with the corresponding target data element; based on the keyword in the value formula, obtain an SQL template statement matching the value formula from a pre-built SQL template statement set; replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, and replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the sub-type report column;

[0255] For a numerical report column, replace the logical calculation factor in the value formula corresponding to the numerical report column with the corresponding target data element; based on the keywords in the value formula, obtain the SQL template statement matching the value formula from the pre-built SQL template statement set; for each cell in the numerical report column, execute respectively: replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the row where the current cell is located in the report column of the classification type.

[0256] Optionally, the target data generation module 303 generates an SQL statement based on a value formula corresponding to any row and configuration information of the value formula, including:

[0257] For a report row of a sub-type, replace the logical calculation factor in the value formula corresponding to the report row of the sub-type with the corresponding target data element; based on the keywords in the value formula, obtain an SQL template statement matching the value formula from a pre-built SQL template statement set; replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, and replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the report row of the sub-type;

[0258] For a numerical report row, replace the logical calculation factor in the value formula corresponding to the numerical report row with the corresponding target data element; based on the keywords in the value formula, obtain the SQL template statement matching the value formula from the pre-built SQL template statement set; for each cell in the numerical report row, respectively execute: replace the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replace the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and add a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the column where the current cell is located in the report row of the sub-type.

[0259] Based on this application Figure 3 In the report generating device shown, the user inputs the report name, the field name, attributes, value-taking formula and configuration information of each column / row in the report to be created in the first interactive interface, so that the electronic device can automatically generate the report. The user only needs to understand the role of the value-taking formula and configure the target data element corresponding to the logical calculation factor in the value-taking formula and the data table to which the target data element belongs according to business needs. Compared with the prior art, the operational difficulty of generating reports is significantly reduced.

[0260] See also Figure 4 , Figure 4 This is a structural diagram of another report generation device disclosed in this application, and Figure 3 Compared with the report generation device shown in the figure, the following further configuration is provided:

[0261] A display request processing module 305 is used to respond to the visual display request and display the second interactive interface;

[0262] The display data acquisition module 306 is used to obtain the identifier of the target report inputted in the second interactive interface; obtain the location identifier of the target data inputted in the second interactive interface; obtain the identifier of the target chart style inputted in the second interactive interface;

[0263] The graphical report generation module 307 is used to respond to the graphical report generation request input in the second interactive interface, call the interface of the chart template corresponding to the target chart style, and generate a target graphical report based on the target data in the target report.

[0264] Based on this application Figure 4 The report generation device shown displays a second interactive interface in response to a visualization display request, obtains the identifier of the target report (i.e., the report that needs to be graphically displayed) input by the user on the second interactive interface, the location identifier of the target data (the data that needs to be graphically displayed in the target report), and the identifier of the target chart style (the chart style to be used), and then responds to the graphical report generation request input by the user on the second interactive interface, calls the interface of the chart template corresponding to the target chart style, generates a target graphical report based on the target data, and realizes graphical display of the created report according to user needs, thereby reducing the user's operation difficulty.

[0265] The application also discloses an electronic device.

[0266] See also Figure 5 , Figure 5 The hardware structure of the electronic device is shown. The electronic device includes: a processor 501 , a memory 502 , a communication interface 503 , a display module 504 and a communication bus 505 .

[0267] In the embodiment of the present application, the number of the processor 501, the memory 502, the communication interface 503, and the communication bus 505 is at least one, and the processor 501, the memory 502, the communication interface 503 and the display module 504 complete the communication with each other through the communication bus 505. The communication bus 505 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0268] It should be noted that those skilled in the art can understand that Figure 5 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include Figure 5 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.

[0269] Combine the following Figure 5 Provide a detailed introduction to the various components of electronic equipment.

[0270] The processor 501 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 502 and calling data stored in the memory 502, thereby monitoring the electronic device as a whole.

[0271] The processor 501 may be a central processing unit (CPU), or an application specific integrated circuit ASIC (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0272] The memory 502 may include a memory, such as a high-speed random-access memory (RAM) and a read-only memory (ROM), and may also include a large-capacity storage device, such as at least one disk storage.

[0273] The memory 502 stores a program, and the processor 501 can call the program stored in the memory 502 to enable the electronic device to implement any report generation method provided in the embodiments of the present application.

[0274] The present application also discloses a readable storage medium, which carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device can implement any report generation method provided in the embodiments of the present application.

[0275] It should be noted that the technical features recorded in the various embodiments in the specification can be replaced or combined with each other, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. The steps in the methods of the various embodiments of the present application can be adjusted in sequence, merged and deleted according to actual needs. The modules and sub-modules in the devices and equipment of the various embodiments of the present application can be merged, divided and deleted according to actual needs.

[0276] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0277] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. The technical features in each embodiment can be arranged and combined to form a new embodiment. For the report generation device, electronic device and readable storage medium disclosed in the embodiment, since they correspond to the report generation method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0278] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A report generation method, characterized in that: include: In response to the report creation request, a first interactive interface is displayed; Obtaining the report name entered in the first interactive interface; Obtaining the field name, attribute, value formula and configuration information of each column / row in the report to be created input in the first interactive interface, wherein the configuration information includes: the target data element corresponding to the logical calculation factor in the value formula and the identifier of the data table to which the target data element belongs; In response to a report generation request inputted in the first interactive interface, for each column / row in the report to be created, generating an SQL statement based on a value formula corresponding to each column / row and configuration information of the value formula, and executing the SQL statement to generate target data for each column / row based on data in the data warehouse; A report is generated according to the report name, the field name of each column / row in the report to be created, and the target data.

2. The report generation method according to claim 1, characterized in that: Generate an SQL statement based on a value formula corresponding to any column / any row and configuration information of the value formula, including: For the columns / rows of the report by category, the logical calculation factors in the value formula corresponding to the columns / rows of the report by category are replaced with the corresponding target data elements; Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set; The field name in the SQL template statement is replaced with the corresponding logical calculation factor in the current value formula, and the data table identifier in the SQL template statement is replaced with the identifier of the data table to which the target data element belongs, so as to obtain the SQL statement for the column / row of the report of the sub-type.

3. The report generation method according to claim 2, characterized in that: Generate an SQL statement based on a value formula corresponding to any column and configuration information of the value formula, and also include: For a numerical report column, replace the logical calculation factor in the value formula corresponding to the numerical report column with the corresponding target data element; Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set; For each cell in the numerical report column, the following steps are performed: replacing the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replacing the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and adding a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the row where the current cell is located in the sub-type report column.

4. The report generation method according to claim 2, characterized in that: Generate an SQL statement based on the value formula corresponding to any row and the configuration information of the value formula, and also include: For a numerical report row, replace the logical calculation factor in the value formula corresponding to the numerical report row with the corresponding target data element; Based on the keywords in the value-taking formula, obtaining an SQL template statement matching the value-taking formula from a pre-built SQL template statement set; For each cell in the numerical report row, the following steps are performed respectively: replacing the field name in the SQL template statement with the corresponding logical calculation factor in the current value formula, replacing the data table identifier in the SQL template statement with the identifier of the data table to which the target data element belongs, and adding a where clause to the current SQL template statement to obtain the SQL statement for the cell, wherein the query condition in the where clause is: the data in the column where the current cell is located in the sub-type report row.

5. The report generation method according to claim 1, characterized in that: Also includes: In response to the visualization display request, display a second interactive interface; Obtaining an identifier of a target report input in the second interactive interface; Obtaining a location identifier of target data inputted in the second interactive interface; Obtaining an identifier of a target chart style input in the second interactive interface; In response to a graphical report generation request inputted in the second interactive interface, an interface of a chart template corresponding to the target chart style is called, and a target graphical report is generated based on target data in the target report.

6. The report generation method according to claim 5, characterized in that: Also includes: In response to a naming request input in the second interactive interface, a name of the target graphical report is set.

7. A report generation device, characterized in that: include: A creation request processing module is used to respond to a report creation request and display a first interactive interface; A report data acquisition module, used to obtain the report name input in the first interactive interface; Obtaining the field name, attribute, value formula and configuration information of each column / row in the report to be created input in the first interactive interface, wherein the configuration information includes: the target data element corresponding to the logical calculation factor in the value formula and the identifier of the data table to which the target data element belongs; a target data generation module, for responding to a report generation request inputted in the first interactive interface, generating, for each column / row in the report to be created, an SQL statement based on a value formula corresponding to each column / row and configuration information of the value formula, and executing the SQL statement to generate target data for each column / row based on data in the data warehouse; The report creation module is used to generate a report according to the report name, the field name of each column / row in the report to be created, and the target data.

8. The report generation device according to claim 7, characterized in that: Also includes: A display request processing module, used to respond to the visual display request and display the second interactive interface; A display data acquisition module, used to obtain the identifier of the target report input in the second interactive interface; Obtaining a location identifier of target data inputted in the second interactive interface; Obtaining an identifier of a target chart style input in the second interactive interface; The graphical report generation module is used to respond to the graphical report generation request input in the second interactive interface, call the interface of the chart template corresponding to the target chart style, and generate a target graphical report based on the target data in the target report.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store programs; The processor is used to execute the program so that the electronic device can implement the report generation method according to any one of claims 1 to 6.

10. A readable storage medium, characterized in that: The readable storage medium carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device can implement the report generation method according to any one of claims 1 to 6.