CN114817267A - Method, apparatus and medium for generating data report - Google Patents
Method, apparatus and medium for generating data report Download PDFInfo
- Publication number
- CN114817267A CN114817267A CN202210529714.6A CN202210529714A CN114817267A CN 114817267 A CN114817267 A CN 114817267A CN 202210529714 A CN202210529714 A CN 202210529714A CN 114817267 A CN114817267 A CN 114817267A
- Authority
- CN
- China
- Prior art keywords
- data
- report
- task
- generating
- template
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
- G06F16/2433—Query languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24553—Query execution of query operations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Embodiments of the present disclosure relate to a method, apparatus, and medium for generating a data report, the method including: receiving a structured database query statement for querying data; analyzing the received query statement of the structured database so as to determine a target task and a target data node required for generating a data report; determining the target task as a data task and a report task; based on the determined data task, inquiring the determined node and executing the data task in a distributed manner, so as to obtain the data of the data report; generating a report template for presenting the acquired data based on the determined report task; and generating a data report according to the acquired data and the generated report template. Therefore, the electronic data report which has various formats and comprises various data and calculation tasks can be generated dynamically and quickly and accurately.
Description
Technical Field
Embodiments of the present disclosure relate generally to the field of data processing, and more particularly, to a method, computing device, and computer-readable storage medium for generating data reports.
Background
With the rapid development of the internet and the increasing amount of information, the data generated each day is increased in the scale of TB (TeraByte). With the continuous increase of data, report data in a database is extracted through a manual mode or a fixed template, so that a generated report cannot meet the report generation requirement. Combined report data processing techniques need to be provided for complex services to dynamically generate reports.
At present, report data processing tools in the prior art can only extract data from a database by means of a fixed template, and generate reports according to the corresponding template. In this case, if modifications to the report data or report format are required, the template needs to be redefined or made. This involves complex software or data analysis. According to the requirement of dynamic change, the dynamic generation of different types of reports based on complex report data is difficult to realize.
Meanwhile, the report data processing tool in the prior art can only generate reports on a single data node or operation node. If data which are stored on a plurality of data nodes in a distributed mode need to be processed and generated, a large amount of time is consumed for obtaining the data on the data nodes one by one. This may result in a long report generation time with multiple calculation tasks.
In summary, the conventional solution for generating a data report has the following disadvantages: the user is required to dynamically adjust and edit the fixed report template, so that the form of the data report is single, the operation of the user is complex, and meanwhile, the data report is generated on the determined data node or operation node, so that the report generation speed is low and the consumption of operation resources is large.
Disclosure of Invention
In view of the above problems, the present disclosure provides a method, a computing device and a computer-readable storage medium for generating a data report, which can dynamically generate an electronic data report having a plurality of formats and including a plurality of data and computing tasks more quickly and accurately.
According to a first aspect of the present disclosure, there is provided a method for generating a data report, comprising receiving a structured database query statement for querying data; analyzing the received query statement of the structured database so as to determine a target task and a target data node required for generating a data report; determining the target task as a data task and a report task; based on the determined data task, inquiring the determined node and executing the data task in a distributed manner, so as to obtain the data of the data report; generating a report template for presenting the acquired data based on the determined report task; and generating a data report according to the acquired data and the generated report template.
According to a second aspect of the present disclosure, there is provided a computing device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect of the disclosure.
In a third aspect of the present disclosure, a non-transitory computer readable storage medium is provided having stored thereon computer instructions for causing a computer to perform the method of the first aspect of the present disclosure.
In one embodiment, the method comprises: acquiring a condition triggering task for generating a data report; generating a data report in response to the condition triggering task being triggered; and feeding back the generated data report according to the condition in the condition triggering task.
In one embodiment, the condition-triggered task includes at least one of an event-triggered task, a time-triggered task, and a data threshold-triggered task.
In one embodiment, parsing the received structured database query statement comprises: determining target data to be acquired in the received query statement of the structured database; analyzing the acquisition mode of the target data to be acquired so as to determine whether the target data to be acquired is first data or second data; responding to the target data to be acquired as first data, and acquiring a target data node where the first data is located; and responding to the fact that the target data to be acquired is second data, decomposing the second data into first data according to a calculation mode, and acquiring target data nodes of the decomposed first data.
In one embodiment, querying the determined nodes and performing the data tasks distributively based on the determined data tasks comprises: inquiring a target data node where the first data is located, so as to obtain the first data; calculating second data according to the data task and the acquired first data; and acquiring the data of the data report based on the acquired first data and the calculated second data.
In one embodiment, generating a reporting template for presenting the obtained data based on the determined reporting task comprises: acquiring a preset layout definition file, wherein the preset layout definition file comprises data node configuration information and report layout information; linking the data node configuration information to the report layout information; and generating a report template with links to data nodes according to the report layout information.
In one embodiment, generating the data report includes: analyzing the report template to obtain the link of the data node; acquiring report data through a data node based on a link to the data node; acquiring type information of a data report to be generated selected by a user; based on the report data, selecting an application programming interface corresponding to the preset layout component according to the type information to generate a report component object; and filling the report component object in the report template to generate a data report.
In one embodiment, generating a reporting template for presenting the obtained data based on the determined reporting task comprises: generating a parent report template for presenting the acquired data; generating a subclass report template for presenting the acquired data; and associating the sub-type report template to the parent-type report template.
In one embodiment, generating the data report includes: generating a subclass data report according to the generated subclass report template; and transmitting the child data report to a parent report template so as to generate a parent data report.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements.
FIG. 1 shows a schematic diagram of a system 100 for implementing a method for generating a data report according to an embodiment of the present invention.
FIG. 2 illustrates a flow diagram of a method 200 for generating a data report in accordance with an embodiment of the present disclosure.
FIG. 3 illustrates a flow chart of a method 300 for generating a data report in accordance with an embodiment of the present disclosure.
FIG. 4 illustrates a flow diagram of a method 400 of parsing a received structured database query statement in accordance with an embodiment of the present disclosure.
FIG. 5 illustrates a flow diagram of a method 500 of generating a reporting template for presenting acquired data based on a determined reporting task, in accordance with an embodiment of the present disclosure.
FIG. 6 illustrates a flow diagram of a method 600 of generating a reporting template for presenting acquired data based on a determined reporting task, in accordance with an embodiment of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The term "include" and variations thereof as used herein is meant to be inclusive in an open-ended manner, i.e., "including but not limited to". Unless specifically stated otherwise, the term "or" means "and/or". The term "based on" means "based at least in part on". The terms "one example embodiment" and "one embodiment" mean "at least one example embodiment". The term "another embodiment" means "at least one additional embodiment". The terms "first," "second," and the like may refer to different or the same object. Other explicit and implicit definitions are also possible below.
As described above, in the case of a large amount of data and scattered storage, the conventional scheme for generating a data report has low operation efficiency and is prone to performance problems such as insufficient memory or abnormal memory in the case of a large amount of data of the data source. If a data report is generated by using frame coding modes such as POI (point of interest) and the like, such as PDF (Portable document Format), EXCEL (extensible markup language), WORD (WORD object) and the like, a large number of codes need to be written, for a report with a complex format, a large amount of time needs to be spent on writing related layout codes, such codes may be hundreds of lines or even thousands of lines, and meanwhile, for a data report with the same content but different file formats, a plurality of sets of generation codes need to be written, so that the workload is large, and the maintenance is difficult.
To address at least in part one or more of the above issues and other potential issues, example embodiments of the present disclosure provide a solution for generating data reports in which different types of data reports may be dynamically generated according to user requirements by generating a data report template. Meanwhile, based on the classification of the target tasks of the user into the data tasks and the report tasks, the data tasks of the report to be generated can be distributed on a plurality of nodes to execute the operation, and therefore the generation of the data report is accelerated.
FIG. 1 shows a schematic diagram of a system 100 for implementing a method for generating a data report according to an embodiment of the present invention. As shown in FIG. 1, the system 100 includes a computing device 110 and a reporting data management device 130 and a network 140. The computing device 110, the reporting data management device 130 may interact with data via a network 140 (e.g., the internet).
The reporting data managing device 130, for example, may store a plurality of different types of reporting data, such as transaction objects, transaction time, transaction amount, and the like. The reporting data managing device 130 can also transmit the stored reporting data to the computing device 110. The reporting data management apparatus may be a one-stop storage computing structure running on one or more computer nodes for implementing a high-concurrency, high-throughput query service, which may include special purpose processing units such as GPUs, FPGAs, and ASICs, as well as general purpose processing units such as CPUs. The report data management device 130, for example, queries a certain report data, so as to feed back the queried report data result to other devices or users.
With respect to the computing device 110, it is used, for example, to acquire report data from the report data managing device 130; and generating a data report about the report data aiming at the acquired report data. The generated report can comprise any digital file which can present report data, such as PDF, XML, TXT, Excel or word. The specific report format can be dynamically adjusted according to the data report type information required by the user. The computing device 110 may also compute the report data in a distributed manner on different compute nodes, so that the report data is finally summarized on the computing device 110 as a data report. Computing device 110 may have one or more processing units, including special purpose processing units such as GPUs, FPGAs, ASICs, and the like, as well as general purpose processing units such as a CPU. Additionally, one or more virtual machines may also be running on each computing device 110. In some embodiments, the computing device 110 and the reporting data management device 130 can be integrated or can be separate from each other. In some embodiments, computing device 110 includes, for example, a receiving module 112, a parsing module 114, a determining module 116, a querying module 118, a template generating module 120, and a report generating module 122.
A receiving module 112, the receiving module 112 configured to receive a structured database query statement for querying data.
A parsing module 114, the parsing module 114 configured to parse the received structured database query statement to determine a target task and a target data node required for generating the data report.
A determination module 116, the determination module 116 configured to determine the target task as a data task and a reporting task based on the determined target task.
A query module 118, the query module 118 configured to query the determined nodes and distributively execute the data tasks based on the determined data tasks, thereby obtaining data of the data report.
A template generation module 120, the template generation module 120 configured to generate a reporting template for presenting the obtained data based on the determined reporting task.
A report generation module 122, wherein the report generation module 122 is configured to generate a data report according to the acquired data and the generated report template.
FIG. 2 illustrates a flow diagram of a method 200 for generating a data report in accordance with an embodiment of the present disclosure. The method 200 may be performed by the computing device 110 as shown in FIG. 1, or may be performed at the electronic device 700 shown in FIG. 7. It should be understood that method 200 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the present disclosure is not limited in this respect.
At step 202, the computing device 110 may be configured to receive a structured database query statement for querying data.
In one embodiment, the structured database query statement may be a database query language commonly used in the art, such as an SQL statement. The database query language may include a name of a data source to be queried, a type of the data source, data source address information, and the like, where the data source address information may specifically be a Uniform Resource Locator (URL) address, and the like. The report layout information comprises report parameters and a preset layout component, the report parameters comprise report size information, style information and the like, and the preset layout component comprises a constant component, a variable component, a data source component and the like. The data source type includes JSON (JavaScript Object Notation), XML (eXtensible Markup Language), SQL (Structured Query Language), and other types.
At step 204, the computing device 110 may be configured to parse the received structured database query statement to determine the target tasks and target data nodes required for generating the data report.
In one embodiment, the computing device 110 parses the received structured database query statement. As described above, the structured database query statement may include the target tasks and target data nodes required for generating the data report. The target task may be a task to be performed to generate the datagram.
The tasks may include data tasks or reporting tasks. A data task is a task that is acquired or computed to generate a report. The report task is the structure or configuration information of the report to be acquired for generating the report.
The report data may include base data that can be directly obtained and high-level data that needs to be calculated by the calculation task, and the data task may include a calculation method of obtaining data in the report to be generated, an obtaining method of each data, and an obtaining address. For example, for advanced data, such as monthly sales for all merchants in the area, the following primary data may need to be obtained for calculation: all merchants within the data area, their quantity, the daily sales of each merchant, etc. In the context of the present application, high-level data may refer to data that requires at least one operation to be obtained, while primary data may refer to data that may be obtained directly from a database.
The report task is various information of the report to be acquired for generating the report. For example, the report task may include obtaining type information of the data report to be generated selected by the user. In an embodiment, the type information of the report to be generated includes PDF, XML, TXT, Excel, word, or the like, and specifically is data report type information required by a user, for example, if the user wants to obtain a data report in a PDF format, the user may select the type information of the report to be generated as the PDF format, so that the type information of the data report to be generated selected by the user is obtained as the PDF. Since different types of information require different types of APIs (Application Programming interfaces) to be called in the Apache POI. The Apache POI provides the API interface for reading and writing the document, wherein the types of different data reports to be generated are different and correspond to different API interfaces, so that the type information of the reports to be generated needs to be determined firstly.
At step 206, the computing device 110 may be configured to determine the target task as a data task and a reporting task based on the determined target task.
In one embodiment, the computing device 110 determines the target task classification determined in step 204 as a data task and a report task, so as to perform the data task and the report task in a classification manner in subsequent steps, thereby respectively determining corresponding data in the report to be generated and a format of the report to be generated.
At step 208, the computing device 110 may be configured to query the determined nodes and perform the data tasks distributively based on the determined data tasks, thereby obtaining data of the data report.
In one embodiment, the computing device 110 may determine the data of the report to be generated based on the determined data tasks. Determining the data may include querying the determined nodes and performing the data tasks in a distributed manner to obtain the data of the data report. For example, if the report to be generated includes primary data, the data is directly queried at the data source of the primary data. If the data can be directly obtained, the source information of the data, such as the data source, is obtained. If the data needs to be obtained through the high-order operation, the high-order operation is analyzed, so that the data needed in the high-order operation (for example, the calculated monthly sales of all the merchants in the area) and the data source of the data are obtained. If the parsed data is still dependent on other high-level data, it can be parsed until the high-level data is parsed into primary data that can be directly obtained. If the data originates from multiple data nodes, the data operations may be performed in a distributed manner at different nodes to determine high-level data. The resulting data is finally summarized at the computing device 110.
In this embodiment, the Data source information may provide a source for report related Data, and support multiple Data reading protocols, including but not limited to HTTP (Hyper text Transfer Protocol ), FTP (File Transfer Protocol, File Transfer Protocol), JDBC (Java Data Base Connectivity, database Connectivity), and other protocols. Based on the protocols, reading corresponding data streams from a database, a local disk or a remote service according to data source address information in the data source configuration information to acquire report data. While supporting a variety of data formats including, without limitation, XML or JSON, etc.
The report data source can be analyzed according to the determined analysis rule to obtain report data. Specifically, the URL address is, for example, Http: do, the URL address is used to call the data source; the data type information corresponding to the data source includes JSON, XML, or SQL format, and different data types correspond to different parsing rules, so that parsing rules need to be determined according to the data type information, for example, a data type in a JSON format corresponds to a JSON parsing rule, and the JSON parsing rule is used to parse the report data source to obtain report data.
At step 210, the computing device 110 may be configured to generate a reporting template for presenting the obtained data based on the determined reporting task.
In one embodiment, the computing device 110 may determine report layout information for the report to be generated based on the determined report task. The report layout information comprises information such as the style and the size of the data report to generate a report template, the report template is similar to a report frame and comprises the length, the width, the display style and the like of the data report, different positions of the report template correspond to different preset layout components, and the preset layout components are used for filling related data information.
In this embodiment, the purpose of analyzing the report layout information is to obtain all preset layout components in the report layout information, reference relevant data in the report data by using the preset layout components, and perform data filling on the report template through the preset layout components. The preset layout component comprises a constant component, a variable component, a data source component and the like.
At step 212, the computing device 110 may be configured to generate a data report based on the obtained data and the generated report template.
In one embodiment, the computing device 110 may populate the report template with report data and report component objects according to where the report component name is located in the report template to generate the data report. Since the report template is generated by report layout information, a corresponding preset layout component, such as a constant component, a variable component, or a data source component, is included in the report template at a corresponding position. And filling the report component object corresponding to the constant component, the variable component or the data source component in the report template to generate a corresponding data report.
By adopting the above measures, the computing device 110 obtains report data by using the data source configuration information in the preset layout definition file and generates a report template by using the report layout information; and selecting corresponding application programming interfaces to quote report data in the data source according to a preset layout component in the report layout information so as to generate a data report. The data report is generated by the method, and for multiple file formats of the same report, the data report can be completed only by compiling a set of preset layout definition files, so that a large amount of development time is saved, and the rapid development and the easy maintenance are really realized. Meanwhile, developers do not need to know the development related to PDF, word, Excel and the like, data service logic is more concentrated, and the working efficiency of the developers is improved.
FIG. 3 illustrates a flow chart of a method 300 for generating a data report in accordance with an embodiment of the present disclosure. The method 300 may be performed by the computing device 110 as shown in FIG. 1, or may be performed at the electronic device 700 shown in FIG. 7. It should be understood that method 300 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect. The method 300 includes various steps in the method 200 and may further include steps 302-306.
At step 302, the computing device 110 may obtain a conditional trigger task that generates a data report.
In one embodiment, the condition-triggered tasks that generate the data report include at least one of event-triggered tasks, time-triggered tasks, and data threshold-triggered tasks. The event-triggered task may, for example, automatically trigger the task of generating a data report upon the occurrence of some significant external event (e.g., a change in stock market index greater than some threshold), thereby automatically retrieving data or generating a report and optionally pushing to a user. The event may be dynamically set by the user.
The time task trigger may include, for example, automatically triggering a task of generating a data report at a set fixed or dynamic time, thereby automatically acquiring data or generating a report and optionally pushing to a user. For example, the user may set that the task of generating a data report is automatically triggered 15 minutes before 9 am on monday or 3 pm on friday after 30 pm, so as to automatically acquire data or generate a report and optionally push the report to the user. The time setting may be dynamically set by the user.
The data threshold triggering task may include, for example, a task of automatically triggering generation of a data report when set data reaches a certain threshold, so as to automatically acquire the data or generate a report and optionally push the report to a user. For example, a user may set that when certain data (e.g., a transaction amount) in a database is greater than a certain threshold, a task of generating a data report is automatically triggered, so that the data is automatically acquired or the report is generated and optionally pushed to the user. The data setting may be by a user dynamically selecting data and setting a threshold or threshold range for the selected data.
At step 304, the computing device 110 may generate a data report in response to the conditional trigger task being triggered.
In one embodiment, the computing device 110 may be triggered based on the condition-triggered tasks determined in step 302, such as event-triggered tasks, time-triggered tasks, and data threshold-triggered tasks, and generate a data report according to the method of generating a data report in method 200.
At step 306, the computing device 110 may feed back the generated data report according to the condition in the condition-triggered task.
In one embodiment, the computing device 110 may feed back the report to the user according to the set condition based on the report generated in step 304, thereby realizing automatic generation of the report and feedback of the report, so that the user can obtain the report and the report information instantly.
In addition, the computing device 110 may also monitor, when parsing the report data source according to the determined parsing rule to obtain report data, the parsing process corresponding to parsing the report data source according to the determined parsing rule to obtain report data; judging whether an alarm event triggering a preset alarm condition occurs in the analysis process; and if an alarm event triggering the preset alarm condition occurs, marking data corresponding to the alarm event. An alarm event occurs that triggers a preset alarm condition, which may be a preset threshold or other determination condition, and which may be set by a user. When the corresponding data value in the report data exceeds the preset threshold value, judging that the data value triggers a preset alarm event, marking the data corresponding to the alarm event, for example, by using a red font mark or a special symbol, and displaying the marked data in the data report to prompt a user that the related data is abnormal.
By adopting the above means, the computing device 110 can automatically generate the data report and feed the report back to the user under various combinations of conditions such as the preset time, the preset data threshold and the like, thereby realizing the instantaneity of the data report. Meanwhile, the computing device 110 may also determine whether the data report includes abnormal data according to a predetermined rule. And under the condition that abnormal data exist, the abnormal data are indexed, so that a user can quickly and accurately determine the abnormal condition of the data in the database.
FIG. 4 illustrates a flow diagram of a method 400 of parsing a received structured database query statement in accordance with an embodiment of the present disclosure. The method 400 may be performed by the computing device 110 as shown in FIG. 1, or may be performed at the electronic device 700 shown in FIG. 7. It should be understood that method 400 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At step 402, the computing device 110 may determine target data to be obtained in the received structured database query statement.
In one embodiment, the computing device 110 may determine target data to be obtained in the received structured database query statement, for example, target data to be presented in a report to be generated. The target data to be presented may be directly obtainable or may be obtainable by calculation.
At step 404, the computing device 110 may parse the obtaining manner of the target data to be obtained, thereby determining whether the target data to be obtained is the first data or the second data.
In one embodiment, the computing device 110 may classify the target data to be acquired into first data and second data based on the manner in which the target data is acquired, where the first data may be directly acquirable and the second data may be acquirable through computation.
At step 406, the computing device 110 may obtain a target data node at which the first data is located in response to the target data to be obtained being the first data.
In one embodiment, for first data that may be directly obtained, the computing device 110 may obtain the first data directly at a target data node, i.e., a data source, where the first data is located. The manner in which the data source is obtained has been described in method 200. In addition. The target data node (data source) may also be determined in one or more databases by means of a search or lookup.
At step 408, in response to the target data to be obtained being the second data, the computing device 110 may decompose the second data into the first data according to a computational manner and obtain a target data node of the decomposed first data.
In one embodiment, for the second data that can be obtained indirectly, i.e., by computation, the computing device 110 computationally decomposes the second data into the first data and obtains a target data node of the decomposed first data. A detailed description of the decomposition has been described in method 200. Acquiring the first data based on a target data node where the first data is inquired; and calculating second data according to the data task and the acquired first data. And finally, acquiring the data of the data report based on the acquired first data and the calculated second data.
FIG. 5 illustrates a flow diagram of a method 500 of generating a reporting template for presenting acquired data based on a determined reporting task, in accordance with an embodiment of the present disclosure. The method 500 may be performed by the computing device 110 as shown in FIG. 1, or may be performed at the electronic device 700 shown in FIG. 7. It should be understood that method 500 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At step 502, the computing device 110 obtains a preset layout definition file, wherein the preset layout definition file includes data node configuration information and report layout information.
In one embodiment, the computing device 110 may obtain a preset layout definition file of the data report to be generated, where the preset layout definition file includes data node configuration information and report layout information. The preset layout definition file can be a cross report, a complex report and any template of the report needing a style, which are designed by using report design software such as jasper, and can also be a task template for designing synchronous data and generating the report with a simple format by using data processing software such as button. The preset layout definition file is a part of the report template, which may be an xml-like file.
The preset layout definition file comprises information such as the style and the size of the electronic report to generate a report template, the report template is similar to a report frame and comprises the length, the width, the display style and the like of the electronic report, different positions of the report template correspond to different preset layout components, and the preset layout components are used for filling related data information.
At step 504, the computing device 110 links the data node configuration information to the report layout information.
In one embodiment, the computing device 110 may link the data node configuration information of the report template determined in step 502 to the report layout information by means of, for example, a hyperlink, so that each position in the preset layout definition file may be linked to a data node, thereby obtaining the corresponding data.
At step 506, the computing device 110 generates a report template including data nodes with links according to the report layout information.
In one embodiment, the computing device 110 may determine a report template for the report to be generated based on the report layout information, the data node configuration information, and the like determined in steps 502, 504.
Based on the generated report template, the computing device 110 may parse the report template to obtain the links of the data nodes. The purpose of analyzing the report layout information is to obtain all preset layout components in the report layout information, use the preset layout components to quote the related data in the report data, and use the preset layout components to perform data filling on the report template. The preset layout component comprises a constant component, a variable component, a data source component and the like.
The computing device 110 may obtain report data through the data nodes and obtain type information of the data report to be generated selected by the user based on the links to the data nodes. The acquisition data has been described above. The acquired type information is specifically type information of an electronic report required by a user, for example, if the user wants to acquire an electronic report in a PDF format, the user selects the type information of the electronic report to be generated to be in the PDF format, so that the type information of the electronic report to be generated selected by the user is acquired to be PDF. Because different types of the electronic report to be generated are different and correspond to different API interfaces, the type information of the report to be generated needs to be determined first.
The computing device 110 may select an application programming interface corresponding to the preset layout component to generate a report component object according to the type information based on the report data. Specifically, when the type information selected by the user is different, the corresponding application programming interfaces of the same preset layout component are also different, for example, the application programming interfaces corresponding to the same constant component of the PDF and Excel type information are not the same. And after the API interface type is determined, calling the determined application programming interface to circulate the report data through a preset layout component to generate a report component object, and packaging the corresponding data and the API interface by the report component object.
The computing device 110 can populate the report component objects in the report template to generate a data report. Specifically, the computing device 110 may populate the report component object in the report template to generate an electronic report based on where the report component name is located in the report template. Because the report template is generated by report layout information, the report template includes a corresponding preset layout component at a corresponding position, where the preset layout component is, for example, a constant component, a variable component, or a data source component, and the report component object corresponding to the constant component, the variable component, or the data source component is filled in the report template to generate a corresponding electronic report.
FIG. 6 illustrates a flow diagram of a method 600 of generating a reporting template for presenting acquired data based on a determined reporting task, in accordance with an embodiment of the present disclosure. The method 600 may be performed by the computing device 110 as shown in FIG. 1, or may be performed at the electronic device 700 shown in FIG. 7. It should be understood that method 600 may also include additional blocks not shown and/or may omit blocks shown, as the scope of the disclosure is not limited in this respect.
At step 602, the computing device 110 may generate a parent report template for presenting the acquired data.
In one embodiment, when the computing device 110 uses database information and report file processing software that utilizes jasper or keytle, etc., the computing device 110 may define portions of the data as parent data, thereby generating a parent report template. One or more sub-type report templates can be included under the parent type report template.
At step 604, the computing device 110 may generate a sub-category report template for presenting the acquired data.
In one embodiment, the computing device 110 may generate one or more child report templates for the generated parent report template. The sub-category report template may be attributed to the parent category report template, thereby further classifying the data.
At step 606, the computing device 110 may associate the child reporting template to the parent reporting template.
In one embodiment, the computing device 110 may associate the child reporting template determined in step 602 with the parent reporting template in step 604. Based on the template generated as described above, the computing device 110 generates a subclass data report according to the generated subclass report template; and generating a parent data report by transmitting the child data report to a parent report template, thereby generating a complex data report with inheritance and link relation.
By employing the above approach, the computing device 110 can enable a technician to develop complex data reports in a friendly data development disclosure manner. Meanwhile, the report generation method or equipment using the technical means is service-friendly, can produce reports required by users according to services, and can realize the task of conveniently managing the reports.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. For example, the computing device 110 as shown in fig. 1 may be implemented by the electronic device 700. As shown, electronic device 700 includes a Central Processing Unit (CPU)701 that may perform various suitable actions and processes according to computer program instructions stored in a Read Only Memory (ROM)702 or computer program instructions loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the random access memory 703, various programs and data necessary for the operation of the electronic apparatus 700 can also be stored. The central processing unit 701, the read only memory 702 and the random access memory 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
A plurality of components in the electronic apparatus 700 are connected to the input/output interface 705, including: an input unit 706 such as a keyboard, a mouse, a microphone, and the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The various processes and processes described above, such as methods 200, 300, 400, 500, and 600, may be performed by the central processing unit 701. For example, in some embodiments, methods 200, 300, 400, 500, and 600 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, some or all of the computer program may be loaded and/or installed onto the device 700 via the read only memory 702 and/or the communication unit 709. When loaded into the random access memory 703 and executed by the central processing unit 701, may perform one or more of the actions of the methods 200, 300, 400, 500 and 600 described above.
The present disclosure relates to methods, apparatuses, systems, electronic devices, computer-readable storage media and/or computer program products. The computer program product may include computer-readable program instructions for performing various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge computing devices. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (11)
1. A method for generating a data report, comprising:
receiving a structured database query statement for querying data;
analyzing the received query statement of the structured database so as to determine a target task and a target data node required for generating a data report;
determining the target task as a data task and a report task;
based on the determined data task, inquiring the determined node and executing the data task in a distributed manner, so as to obtain the data of the data report;
generating a report template for presenting the acquired data based on the determined report task; and
and generating a data report according to the acquired data and the generated report template.
2. The method of claim 1, comprising:
acquiring a condition triggering task for generating a data report;
generating a data report in response to the condition triggering task being triggered; and
and feeding back the generated data report according to the condition in the condition triggering task.
3. The method of claim 2, wherein the condition-triggered task comprises at least one of an event-triggered task, a time-triggered task, and a data threshold-triggered task.
4. The method of claim 1, wherein parsing the received structured database query statement comprises:
determining target data to be acquired in the received query statement of the structured database;
analyzing the acquisition mode of the target data to be acquired so as to determine whether the target data to be acquired is first data or second data;
responding to the target data to be acquired as first data, and acquiring a target data node where the first data is located; and
and responding to the fact that the target data to be acquired is second data, decomposing the second data into first data according to a calculation mode, and acquiring target data nodes of the decomposed first data.
5. The method of claim 4, wherein querying the determined nodes and performing the data tasks distributively based on the determined data tasks comprises:
inquiring a target data node where the first data is located, so as to obtain the first data;
calculating second data according to the data task and the acquired first data; and
and acquiring the data of the data report based on the acquired first data and the calculated second data.
6. The method of claim 1 or 4, wherein generating a reporting template for presenting the obtained data based on the determined reporting task comprises:
acquiring a preset layout definition file, wherein the preset layout definition file comprises data node configuration information and report layout information;
linking the data node configuration information to the report layout information; and
and generating a report template with links to data nodes according to the report layout information.
7. The method of claim 6, wherein generating a data report comprises:
analyzing the report template to obtain the link of the data node;
acquiring report data through a data node based on a link to the data node;
acquiring type information of a data report to be generated selected by a user;
based on the report data, selecting an application programming interface corresponding to the preset layout component according to the type information to generate a report component object; and
and filling the report component object in the report template to generate a data report.
8. The method of claim 1 or 4, wherein generating a reporting template for presenting the obtained data based on the determined reporting task comprises:
generating a parent report template for presenting the acquired data;
generating a subclass report template for presenting the acquired data; and
and associating the sub-type report template to the parent-type report template.
9. The method of claim 8, wherein generating a data report comprises:
generating a subclass data report according to the generated subclass report template; and
and transmitting the child data report to a parent report template so as to generate a parent data report.
10. A computing device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor;
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
11. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210529714.6A CN114817267A (en) | 2022-05-16 | 2022-05-16 | Method, apparatus and medium for generating data report |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210529714.6A CN114817267A (en) | 2022-05-16 | 2022-05-16 | Method, apparatus and medium for generating data report |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114817267A true CN114817267A (en) | 2022-07-29 |
Family
ID=82516133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210529714.6A Pending CN114817267A (en) | 2022-05-16 | 2022-05-16 | Method, apparatus and medium for generating data report |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114817267A (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819434A (en) * | 2012-07-24 | 2012-12-12 | 国家电网公司 | Method and device for showing power information communication scheduling report |
CN107977351A (en) * | 2017-12-28 | 2018-05-01 | 平安科技(深圳)有限公司 | Electronic report forms generation method, device, computer equipment and storage medium |
CN109542956A (en) * | 2018-10-17 | 2019-03-29 | 深圳壹账通智能科技有限公司 | Report form generation method, device, computer equipment and storage medium |
CN110148261A (en) * | 2019-04-15 | 2019-08-20 | 杭州瑾信科技有限公司 | Prompt information triggering method, device, computer equipment and storage medium |
CN110232178A (en) * | 2019-05-29 | 2019-09-13 | 北京中亦安图科技股份有限公司 | Report generation method and device |
CN111460773A (en) * | 2020-03-30 | 2020-07-28 | 京东数字科技控股有限公司 | Data processing method, device and system, electronic equipment and storage medium |
CN111966720A (en) * | 2020-07-30 | 2020-11-20 | 上海泛微网络科技股份有限公司 | Data processing method and related equipment |
CN112347748A (en) * | 2020-11-26 | 2021-02-09 | 北京百家科技集团有限公司 | Data report generation method and device, computer equipment and readable storage medium |
CN112949276A (en) * | 2021-03-31 | 2021-06-11 | 中国建设银行股份有限公司 | Report generation method and device, electronic equipment and storage medium |
WO2021169268A1 (en) * | 2020-02-28 | 2021-09-02 | 平安科技(深圳)有限公司 | Data processing method, apparatus and device, and storage medium |
CN114090608A (en) * | 2020-07-20 | 2022-02-25 | 北京沃东天骏信息技术有限公司 | Data report generation method and device |
CN114297994A (en) * | 2021-12-23 | 2022-04-08 | 中冶南方工程技术有限公司 | Method, system, device and storage medium for generating parameterized report |
-
2022
- 2022-05-16 CN CN202210529714.6A patent/CN114817267A/en active Pending
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102819434A (en) * | 2012-07-24 | 2012-12-12 | 国家电网公司 | Method and device for showing power information communication scheduling report |
CN107977351A (en) * | 2017-12-28 | 2018-05-01 | 平安科技(深圳)有限公司 | Electronic report forms generation method, device, computer equipment and storage medium |
CN109542956A (en) * | 2018-10-17 | 2019-03-29 | 深圳壹账通智能科技有限公司 | Report form generation method, device, computer equipment and storage medium |
CN110148261A (en) * | 2019-04-15 | 2019-08-20 | 杭州瑾信科技有限公司 | Prompt information triggering method, device, computer equipment and storage medium |
CN110232178A (en) * | 2019-05-29 | 2019-09-13 | 北京中亦安图科技股份有限公司 | Report generation method and device |
WO2021169268A1 (en) * | 2020-02-28 | 2021-09-02 | 平安科技(深圳)有限公司 | Data processing method, apparatus and device, and storage medium |
CN111460773A (en) * | 2020-03-30 | 2020-07-28 | 京东数字科技控股有限公司 | Data processing method, device and system, electronic equipment and storage medium |
CN114090608A (en) * | 2020-07-20 | 2022-02-25 | 北京沃东天骏信息技术有限公司 | Data report generation method and device |
CN111966720A (en) * | 2020-07-30 | 2020-11-20 | 上海泛微网络科技股份有限公司 | Data processing method and related equipment |
CN112347748A (en) * | 2020-11-26 | 2021-02-09 | 北京百家科技集团有限公司 | Data report generation method and device, computer equipment and readable storage medium |
CN112949276A (en) * | 2021-03-31 | 2021-06-11 | 中国建设银行股份有限公司 | Report generation method and device, electronic equipment and storage medium |
CN114297994A (en) * | 2021-12-23 | 2022-04-08 | 中冶南方工程技术有限公司 | Method, system, device and storage medium for generating parameterized report |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107977351B (en) | Electronic report generation method and device, computer equipment and storage medium | |
CN108874760B (en) | Report file generation method, report file generation device, computer equipment and storage medium | |
CN103389895B (en) | A kind of generation method and system of front end page | |
CN111061833B (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN112069201A (en) | Target data acquisition method and device | |
CN107402746B (en) | Method and device for automatically generating code file | |
US10970095B2 (en) | Obtaining insights from a distributed system for a dynamic, customized, context-sensitive help system | |
CN112148356B (en) | Document generation method, interface development method, device, server and storage medium | |
CN108717437B (en) | Search result display method and device and storage medium | |
CN109522341B (en) | Method, device and equipment for realizing SQL-based streaming data processing engine | |
US20160140184A1 (en) | Data source binding using an odata model | |
Gómez-Martínez et al. | ArgoSPE: Model-based software performance engineering | |
CN112926008A (en) | Method and device for generating form page, electronic equipment and storage medium | |
US10055269B2 (en) | Additional message information handling for applications | |
CN112241355B (en) | Link tracking method, system, computer readable storage medium and electronic device | |
CN116382703B (en) | Software package generation method, code development method and device, electronic equipment and medium | |
CN114817267A (en) | Method, apparatus and medium for generating data report | |
CN111241048A (en) | Web terminal log management method, device, medium and electronic equipment | |
CN116414814A (en) | Data checking method, device, equipment, storage medium and program product | |
CN115145652A (en) | Method, device, equipment and medium for creating data processing task | |
CN113901094B (en) | Data processing method, device, equipment and storage medium | |
CN110058858B (en) | JSON data processing method and device | |
CN113138767A (en) | Code language conversion method, device, electronic equipment and storage medium | |
CN111597205B (en) | Template configuration method, information extraction device, electronic equipment and medium | |
CN110737757B (en) | Method and apparatus for generating information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |