Report generation methods, devices, computer equipment, and storage media

By acquiring and processing report configuration and query fields in the ERP system, and generating target reports using operator sequences, the problem of poor flexibility in traditional reports is solved, and the variability of report fields and the speed of calculation are improved.

CN115510130BActive Publication Date: 2026-04-03KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In ERP systems, traditional reports have poor flexibility and cannot flexibly change fields, the source of field data, or calculation logic, requiring developers to perform secondary development.

Method used

By obtaining the initial report configuration, including the data source identifier, the first operator sequence, and the second operator sequence, the query fields are obtained and calculated to generate the target report.

Benefits of technology

It improves the flexibility and calculation speed of reports, simplifies the process of modifying calculation logic, and enables the variability of fields in reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510130B_ABST
    Figure CN115510130B_ABST
Patent Text Reader

Abstract

This application relates to a report generation method, apparatus, computer equipment, storage medium, and computer program product. The method includes: obtaining a report configuration corresponding to an initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence; obtaining a query field; obtaining initial data from the data source corresponding to the data source identifier based on the query field; performing calculations on the initial data based on the first operator sequence to obtain intermediate data; aggregating the intermediate data to obtain an intermediate table; and performing calculations on the intermediate table based on the second operator sequence to obtain a target report containing the query field. This method improves the flexibility of reports. This invention can be applied to various systems involving reports, such as enterprise management systems and Enterprise Resource Planning (ERP) systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a report generation method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] In ERP (Enterprise Resource Planning) systems, reports are an essential data carrier, used for summarizing, analyzing, and presenting data.

[0003] In traditional technologies, once an ERP system is developed, the fields presented in the reports and the sources of the field data are fixed. If it is necessary to change the fields in the reports, the sources of the field data, or the calculation logic of the field data, developers need to perform secondary development, resulting in poor report flexibility. Summary of the Invention

[0004] Therefore, it is necessary to provide a report generation method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the flexibility of reports in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a report generation method. The method includes:

[0006] Obtain the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence.

[0007] Obtain the query fields, and based on the query fields, obtain initial data from the data source corresponding to the data source identifier;

[0008] The initial data is processed based on the first operator sequence to obtain intermediate data;

[0009] The intermediate data is aggregated to obtain an intermediate table;

[0010] The intermediate table is processed based on the second operator sequence to obtain a target report containing the query fields.

[0011] In one embodiment, obtaining the report configuration corresponding to the initial report includes:

[0012] Obtain multiple initial fields and combine the multiple initial fields into an initial report;

[0013] Obtain the data source identifier and the mapping relationship configuration table corresponding to the data source identifier;

[0014] Obtain the operator sequence corresponding to the initial report, wherein the operator sequence includes a first operator sequence and a second operator sequence;

[0015] The report configuration of the initial report is composed based on the initial field, the data source identifier, the mapping relationship configuration table, and the operator sequence.

[0016] In one embodiment, obtaining the report configuration corresponding to the initial report further includes:

[0017] In response to an operation that deletes the data source identifier in the report configuration, or in response to an operation that adds the data source identifier in the report configuration, the report configuration is updated to obtain a new report configuration.

[0018] In one embodiment, obtaining the operator sequence corresponding to the initial report includes:

[0019] Obtain the calculation logic relationship between the source fields in the data source and the initial fields in the initial report;

[0020] Based on the computational logic relationship, an operator sequence plugin corresponding to the computational logic relationship is generated;

[0021] In response to the import operation of the operator sequence plugin, the plugin identifier corresponding to the operator sequence plugin is displayed in the report configuration interface, and the operator sequence in the operator sequence plugin is used as the operator sequence corresponding to the initial report.

[0022] In one embodiment, obtaining the query field and retrieving initial data from the data source corresponding to the data source identifier based on the query field includes:

[0023] Obtain the query range and query fields, and retrieve initial data from the data source corresponding to the data source identifier based on the query range and query fields.

[0024] In one embodiment, obtaining the query field and retrieving initial data from the data source corresponding to the data source identifier based on the query field includes:

[0025] Obtain the data source and mapping relationship configuration table corresponding to the data source identifier;

[0026] Based on the mapping relationship configuration table corresponding to the data source identifier, the target field in the data source corresponding to the query field is obtained;

[0027] The field data corresponding to the target field in the data source is mapped to the corresponding query field to obtain the initial data.

[0028] In one embodiment, the step of processing the initial data based on the first operator sequence to obtain intermediate data includes:

[0029] If there are multiple initial data, then the multiple initial data are processed in parallel based on the first operator sequence to obtain multiple intermediate data corresponding to the multiple initial data.

[0030] Secondly, this application also provides a report generation apparatus. The apparatus includes:

[0031] The acquisition module is used to acquire the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence.

[0032] The interception module is used to obtain query fields and retrieve initial data from the data source corresponding to the data source identifier based on the query fields;

[0033] The first calculation module is used to perform calculations on the initial data based on the first operator sequence to obtain intermediate data;

[0034] The aggregation module is used to aggregate the intermediate data to obtain an intermediate table;

[0035] The second calculation module is used to perform calculations on the intermediate table based on the second operator sequence to obtain a target report containing the query fields.

[0036] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0037] Obtain the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence.

[0038] Obtain the query fields, and based on the query fields, obtain initial data from the data source corresponding to the data source identifier;

[0039] The initial data is processed based on the first operator sequence to obtain intermediate data;

[0040] The intermediate data is aggregated to obtain an intermediate table;

[0041] The intermediate table is processed based on the second operator sequence to obtain a target report containing the query fields.

[0042] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0043] Obtain the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence.

[0044] Obtain the query fields, and based on the query fields, obtain initial data from the data source corresponding to the data source identifier;

[0045] The initial data is processed based on the first operator sequence to obtain intermediate data;

[0046] The intermediate data is aggregated to obtain an intermediate table;

[0047] The intermediate table is processed based on the second operator sequence to obtain a target report containing the query fields.

[0048] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0049] Obtain the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence.

[0050] Obtain the query fields, and based on the query fields, obtain initial data from the data source corresponding to the data source identifier;

[0051] The initial data is processed based on the first operator sequence to obtain intermediate data;

[0052] The intermediate data is aggregated to obtain an intermediate table;

[0053] The intermediate table is processed based on the second operator sequence to obtain a target report containing the query fields.

[0054] The aforementioned report generation method, apparatus, computer equipment, storage medium, and computer program product obtain the report configuration and query fields corresponding to the initial report. Based on the query fields, initial data is obtained from the data source corresponding to the data source identifier. The initial data is processed using a first operator sequence to obtain intermediate data. The intermediate data is aggregated to obtain an intermediate table. The intermediate table is then processed using a second operator sequence to obtain a target report containing the query fields. Obtaining initial data from the data source corresponding to the data source identifier based on the query fields, and obtaining initial data for calculation based on query requirements, reduces the amount of data involved in the calculation and improves the calculation speed. Calculating the initial data using the first operator sequence allows for modification of the calculation logic; if modifications are needed, only the operators and their order within the first operator sequence need to be changed, improving the operability and convenience of modifying the calculation logic. Aggregating the intermediate data to obtain an intermediate table, and then processing the intermediate table using the second operator sequence, yields a target report containing the query fields. The target report presents the query fields, realizing the variability of fields in the report and improving the report's flexibility. Attached Figure Description

[0055] Figure 1 This is a diagram illustrating the application environment of a report generation method in one embodiment;

[0056] Figure 2 This is a flowchart illustrating a report generation method in one embodiment;

[0057] Figure 3 This is a flowchart illustrating the report configuration generation steps in one embodiment;

[0058] Figure 4 This is a flowchart illustrating the initial data acquisition steps in one embodiment;

[0059] Figure 5 This is a schematic diagram of the operation interface of the field library in one embodiment;

[0060] Figure 6 This is a schematic diagram of the operation interface for establishing mapping relationships in one embodiment;

[0061] Figure 7 A schematic diagram of the operation interface for configuring report fields in one embodiment;

[0062] Figure 8 A schematic diagram of the user interface for configuring the data source in one embodiment;

[0063] Figure 9 A schematic diagram of the user interface for configuring operator sequences in one embodiment;

[0064] Figure 10 This is a flowchart illustrating the report generation steps in one embodiment;

[0065] Figure 11a This is a schematic diagram illustrating the process from data source to initial data in one embodiment;

[0066] Figure 11b This is a schematic diagram illustrating the process from initial data to intermediate data in one embodiment;

[0067] Figure 11c This is a schematic diagram illustrating the process of intermediate data to an intermediate table in one embodiment;

[0068] Figure 11d This is a schematic diagram illustrating the process from an intermediate table to a target report in one embodiment.

[0069] Figure 12 This is a structural block diagram of a report generation device in one embodiment;

[0070] Figure 13 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0072] The report generation method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated on server 104 or placed on the cloud or other network servers. Both the terminal and server can be used independently to execute the report generation method provided in this embodiment. The terminal and server can also work together to execute the report generation method provided in this embodiment. For example, terminal 102 sends a query field and a target report generation request; server 104 receives the target report generation request, obtains the report configuration and query field corresponding to the initial report, obtains initial data from the data source corresponding to the data source identifier based on the query field, performs calculations on the initial data based on a first operator sequence to obtain intermediate data, aggregates the intermediate data to obtain an intermediate table, and performs calculations on the intermediate table based on a second operator sequence to obtain the target report containing the query field. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0073] In one embodiment, such as Figure 2 As shown, a report generation method is provided. This method can be applied to computer devices, which can be terminals or servers. The method can be executed independently by the terminal or server, or it can be implemented through interaction between the terminal and the server. This embodiment uses the application of this method to a computer device as an example for illustration, including steps 202 to 210.

[0074] Step 202: Obtain the report configuration corresponding to the initial report; the report configuration includes the data source identifier, the first operator sequence, and the second operator sequence.

[0075] The initial report refers to the report that has been set up. It can be understood as a report containing all initial fields, set up by developers or users. Report configuration refers to the collection of configurations required during report generation. Report configuration includes, but is not limited to, data sources, mapping relationship configuration tables corresponding to data sources, calculation logic, etc. An initial report can correspond to one or more report configurations, and the status of report configurations can be set to disabled or enabled as needed. A data source refers to the object from which the data in the report originates. The data source can be basic data, documents, or other objects that carry data. A data source identifier is a string representing the data source. It can be understood as the name of the data source. The data source identifier can consist of letters, numbers, symbols, etc. An operator refers to a calculation step performed on data, such as sorting, grouping, aggregation, splitting, merging, adding or subtracting fields, function calculations, etc. An operator sequence refers to a sequence of multiple operators performed in a specific order. It can be understood as a sequence of multiple operators with a certain logical function.

[0076] For example, the computer device obtains the report configuration corresponding to the initial report.

[0077] In one embodiment, the computer device obtains the startup command for the initial report, then queries multiple report configurations associated with the initial report identifier, checks the status of the multiple report configurations, and uses the report configuration in the enabled state as the report configuration corresponding to the initial report. At any given time, among the multiple report configurations associated with an initial report identifier, only one report configuration is in the enabled state, while the rest are in the disabled state.

[0078] In one embodiment, the computer device receives a new instruction for an initial report, obtains the initial fields of the initial report, assembles the initial fields into an initial report, and then obtains the report configuration corresponding to the initial report. The initial fields and report configuration can be set by the operator through the user interface.

[0079] Step 204: Obtain the query fields and retrieve initial data from the data source corresponding to the data source identifier based on the query fields.

[0080] The query field refers to the field to be queried, which can be one or more initial fields. It can be understood as the field displayed in the target report. Initial data refers to the data obtained from the data source corresponding to the query field.

[0081] For example, the computer device obtains the query field and then retrieves the initial data corresponding to the query field from the data source corresponding to each data source identifier.

[0082] In one embodiment, the computer device obtains the query field, obtains the source field corresponding to the query field according to the first relationship table between the initial field and the source field, obtains the target field corresponding to the source field in the data source corresponding to the data source identifier according to the mapping relationship configuration table, and maps the field data corresponding to the target field to the source field to obtain the initial data.

[0083] Step 206: Perform calculations on the initial data based on the first operator sequence to obtain intermediate data.

[0084] Intermediate data refers to the results obtained from processing the initial data.

[0085] For example, the computer device performs calculations on the initial data based on a first operator sequence, and the result of the processing is intermediate data.

[0086] Step 208: Aggregate the intermediate data to obtain an intermediate table.

[0087] Aggregation processing refers to the process of combining multiple intermediate data into a single intermediate table. Aggregation processing can be accomplished based on aggregation operators.

[0088] For example, a computer device combines multiple pieces of intermediate data into an intermediate table.

[0089] In one embodiment, a computer device acquires multiple intermediate data, counts the number of intermediate data to obtain a first statistical value, counts the number of statistical data sources to obtain a second statistical value, and then compares the first statistical value with the second statistical value. If the first statistical value equals the second statistical value, the multiple intermediate data are combined into an intermediate table.

[0090] In one embodiment, the computer device uses one of the intermediate data as an intermediate initial table, then adds a column to the intermediate initial table, and maps the field data of each field in one of the intermediate data to the newly added column. The above steps are repeated until all the intermediate data has completed the mapping steps, resulting in an intermediate table containing multiple intermediate data.

[0091] Step 210: Perform calculations on the intermediate table based on the second operator sequence to obtain the target report containing the query fields.

[0092] For example, the computer device performs calculations on the intermediate table based on the second operator sequence, and the result is the target report.

[0093] In the above report generation method, the report configuration and query fields corresponding to the initial report are obtained. Initial data is retrieved from the data source corresponding to the data source identifier based on the query fields. Intermediate data is obtained by calculating and processing the initial data based on the first operator sequence. The intermediate data is then aggregated to obtain an intermediate table. Finally, the intermediate table is calculated and processed based on the second operator sequence to obtain the target report containing the query fields. Retrieving initial data from the data source corresponding to the data source identifier based on the query fields and obtaining the initial data participating in the calculation based on the query requirements reduces the amount of data involved in the calculation and improves the calculation speed. Calculating and processing the initial data based on the first operator sequence allows for modification of the calculation logic; if modifications to the initial data calculation logic are needed, only the operators and their order need to be changed, improving the operability and convenience of modifying the calculation logic. Aggregating the intermediate data to obtain the intermediate table and then calculating and processing the intermediate table based on the second operator sequence yields the target report containing the query fields. The target report presents the query fields, realizing the variability of the fields in the report and improving the flexibility of the report.

[0094] In one embodiment, such as Figure 3 As shown, the report configuration for obtaining the initial report includes:

[0095] Step 302: Obtain multiple initial fields and combine them into an initial report.

[0096] The initial fields refer to the fields in the initial report.

[0097] For example, a computer device obtains multiple initial fields and arranges the initial fields in a certain order to form an initial report.

[0098] In one embodiment, the operator selects initial fields in the field configuration interface. First, a target field library is selected from multiple field libraries. The configuration interface displays the fields in the target field library. The operator selects multiple initial fields by clicking. The computer device retrieves the initial fields and arranges them into an initial report in a specific order. Here, a field library refers to a collection of fields, containing multiple fields such as materials, organizations, and warehouses. Fields in the field library can be added, deleted, and modified through the editing page.

[0099] Step 304: Obtain the data source identifier and the mapping relationship configuration table corresponding to the data source identifier.

[0100] In this context, the mapping configuration table refers to a file containing the mapping relationships between fields. The mapping configuration table can be in the form of a form, text, etc. One data source identifier can be associated with multiple mapping configuration tables, and the mapping fields corresponding to the source fields in the data source can be different in each mapping configuration table.

[0101] For example, the computer device obtains the data source identifier and obtains the mapping relationship configuration table corresponding to the data source identifier.

[0102] In one embodiment, the operator selects the data source identifier corresponding to the initial report from the data source library, and then selects a corresponding mapping relationship configuration table from the multiple mapping relationship configuration tables associated with the data source identifier. The corresponding mapping relationship configuration table stores the mapping relationship between the source fields in the data source and the initial fields in the initial report.

[0103] In one embodiment, if the data source identifier does not have an associated mapping relationship configuration table, a mapping relationship table is created through the mapping relationship configuration interface. First, the data source and the initial report are selected, and then the mapping relationship between the source fields in the data source and the initial fields in the initial report is established. The mapping relationship configuration table between the data source and the initial report is then associated with and saved with the data source identifier.

[0104] Step 306: Obtain the operator sequence corresponding to the initial report. The operator sequence includes the first operator sequence and the second operator sequence.

[0105] For example, the computer device obtains the operator sequence corresponding to the initial report, the operator sequence including a first operator sequence and a second operator sequence.

[0106] In one embodiment, the computer device obtains an operator sequence corresponding to an initial report. The operator sequence includes a first operator sequence for calculating the initial data, an intermediate operator sequence for aggregating intermediate data, and a second operator sequence for calculating the intermediate table.

[0107] Step 308: Based on the initial fields, data source identifier, mapping relationship configuration table, and operator sequence, construct the report configuration of the initial report.

[0108] For example, the computer device assembles the initial report configuration into the initial report using the initial fields, data source identifier, mapping relationship configuration table, and operator sequence.

[0109] In this embodiment, the initial field, data source identifier, mapping relationship configuration table, and operator sequence are combined to form the report configuration of the initial report. The selection of the initial field, the selection of the data source identifier, the establishment and selection of the mapping relationship configuration table, and the import of the operator sequence can all be completed by the operator through the settings page. The operator can build the initial report and the corresponding report configuration according to the needs, which improves the flexibility of report generation, as well as the flexibility of data sources and calculation logic in the report.

[0110] In one embodiment, obtaining the report configuration corresponding to the initial report further includes:

[0111] In response to the deletion of a data source identifier in the report configuration, or in response to the addition of a data source identifier in the report configuration, the report configuration is updated to obtain a new report configuration.

[0112] For example, in response to an operation to delete a data source identifier in a report configuration, the computer device deletes the corresponding data source identifier in the report configuration, or in response to an operation to add a data source identifier in the report configuration, adds a data source identifier in the report configuration, thereby obtaining a new report configuration.

[0113] In one embodiment, when an operator clicks the report modification button, the terminal displays the initial fields, data source identifier, mapping relationship configuration table, and operator sequence in the initial report. The operator can then delete or add data source identifiers.

[0114] In this embodiment, the data source of the initial report is changed by deleting or adding data source identifiers in the report configuration, thereby improving the flexibility of the report.

[0115] In one embodiment, obtaining the operator sequence corresponding to the initial report includes:

[0116] Obtain the calculation logic relationship between the source fields in the data source and the initial fields in the initial report; based on the calculation logic relationship, generate the operator sequence plugin corresponding to the calculation logic relationship; in response to the import operation of the operator sequence plugin, display the plugin identifier corresponding to the operator sequence plugin in the report configuration interface, and use the operator sequence in the operator sequence plugin as the operator sequence corresponding to the initial report.

[0117] The computational logic relationship refers to the computational process. This includes, but is not limited to, computational steps and the objects involved in each step. A plugin is a saved file of a program written according to a specific application programming interface (API). The report configuration interface is the interface for setting report configurations. This includes, but is not limited to, report configuration identifiers, report field configurations, data source configurations, operator sequence configurations, etc. The plugin identifier is the name of the operator sequence plugin. Plugin identifiers can consist of letters, numbers, symbols, etc.

[0118] For example, the computer device obtains the calculation logic relationship between the source field in the data source and the initial field in the initial report. Based on the above calculation logic relationship, it generates the corresponding operator sequence plugin. In response to the import operation of the operator sequence plugin, the plugin identifier corresponding to the operator sequence plugin is displayed in the report configuration interface, and the operator sequence in the operator sequence plugin is used as the operator sequence corresponding to the initial report.

[0119] In one embodiment, in response to a setting operation for an operator sequence, the computer device displays the plug-in identifiers corresponding to multiple candidate operator sequence plug-ins in the report configuration interface of the terminal, and in response to a selection operation for a plug-in identifier, uses the operator sequence in the candidate operator sequence plug-in corresponding to the selected plug-in identifier as the operator sequence corresponding to the initial report.

[0120] In one embodiment, the computer device obtains the calculation logic relationship from the source field in the data source to the initial field in the initial report. In response to the sending operation for the calculation logic relationship, the computer device sends the calculation logic relationship to the developer. After receiving the calculation logic relationship, the developer writes the operator sequence plugin corresponding to the calculation logic relationship and saves the operator sequence plugin and the plugin identifier in the operator sequence plugin library. In response to the filtering operation for the operator sequence plugin, the computer device presents the candidate plugin identifiers that meet the filtering conditions in the report configuration interface. In response to the selection operation for the candidate plugin identifier, the computer device uses the operator sequence in the operator sequence plugin corresponding to the selected candidate plugin identifier as the operator sequence corresponding to the initial report.

[0121] In this embodiment, by importing the operator sequence plugin, the operator sequence settings in the report configuration corresponding to the initial report are completed. Operators can quickly complete the setting and modification of the operator sequence, improving the flexibility of the report configuration.

[0122] In one embodiment, retrieving the query field and obtaining initial data from the data source corresponding to the data source identifier based on the query field includes:

[0123] Get the query range and query fields, and retrieve the initial data from the data source corresponding to the data source identifier based on the query range and query fields.

[0124] The query scope refers to the limited range of the query content. It can be understood as the range of data filtering. The query scope can be a limitation of one field or multiple fields. For example, date = 2022, department = finance department.

[0125] For example, the computer device obtains the query range and query fields, then loads the data source corresponding to the data source identifier, and obtains initial data from the data source based on the query range and query fields.

[0126] In this embodiment, initial data is obtained from the data source corresponding to the data source identifier based on the query range and query fields. This accurately obtains the initial data to be used in the calculation, reduces the amount of data involved in the calculation, and improves the speed of report generation.

[0127] In one embodiment, such as Figure 4 As shown, retrieving initial data from the data source corresponding to the data source identifier based on the query fields includes:

[0128] Step 402: Obtain the data source and mapping relationship configuration table corresponding to the data source identifier.

[0129] For example, the computer device obtains multiple data source identifiers in the report configuration, as well as a mapping relationship configuration table corresponding to the data source identifiers.

[0130] In one embodiment, the computer device obtains an initial report launch instruction, retrieves an initial report identifier from the initial report launch instruction, then retrieves the report configuration associated with the initial report identifier, and retrieves a configuration table of multiple data source identifiers and their corresponding mapping relationships from the report configuration.

[0131] Step 404: Based on the mapping relationship configuration table corresponding to the data source identifier, obtain the target field in the data source that corresponds to the query field.

[0132] For example, the computer device converts the query fields into target fields in the data source corresponding to each data source identifier based on the mapping relationship configuration table corresponding to each data source identifier.

[0133] In one embodiment, the computer device obtains the query field, obtains the source field corresponding to the query field according to the second relationship table between the initial field and the source field, and then converts the source field into the target field in the data source corresponding to the data source identifier according to the mapping relationship configuration table corresponding to each data source identifier.

[0134] Step 406: Map the field data corresponding to the target field in the data source to the corresponding query field to obtain the initial data.

[0135] For example, a computer device obtains the field data corresponding to the target field in the data source, and then maps the field data to the query field corresponding to the target field to obtain the initial data.

[0136] In one embodiment, the initial data is stored in the form of a data table.

[0137] In one embodiment, the initial data is stored in text format.

[0138] In this embodiment, the query field is converted into the target field by the field mapping configuration table corresponding to the data source identifier, and the field data corresponding to the query field is obtained from the data source. This overcomes the problem of inconsistent field names in various data sources, realizes the acquisition of initial data from various data sources, provides initial data for the generation of the target report, reduces the amount of data involved in the calculation, and improves the speed of report generation.

[0139] In one embodiment, the intermediate data obtained by processing the initial data based on the first operator sequence includes:

[0140] If there are multiple initial data, the multiple initial data are processed in parallel based on the first operator sequence to obtain multiple intermediate data corresponding to the multiple initial data.

[0141] For example, a computer device acquires multiple initial data points, performs parallel calculations on the multiple initial data points according to a first operator sequence, and obtains intermediate data corresponding to each initial data point.

[0142] In one embodiment, a computer device acquires N initial data points, then starts N processes, distributing each initial data point to one process. Each process performs calculations on the initial data points based on a first operator sequence to obtain intermediate data corresponding to the initial data points.

[0143] In one embodiment, the computer device takes N initial data points and distributes them to the target process. The target process starts N threads, and distributes each initial data point to one thread. Each thread performs calculations on the initial data based on a first operator sequence to obtain intermediate data corresponding to the initial data. Then, each thread sends the intermediate data to the target process.

[0144] In this embodiment, the speed of report generation can be improved by performing parallel calculations on multiple initial data.

[0145] In one exemplary embodiment, an operator develops an initial report using a report development device. The report development device includes a field library, a data source library, a mapping relationship configuration table setting interface, and a report configuration interface. The field library contains multiple fields, each including a field name, field type, etc., which the operator can configure according to... Figure 5 The field database settings interface shown allows users to add, delete, modify, and update fields in the field database. The data source database includes data source identifiers from multiple data sources across multiple systems. Operators can then configure the settings according to the following... Figure 6 The mapping configuration table settings interface shown allows you to set up a mapping relationship configuration table between source fields in the data source and fields in the field library, and then associate and save the mapping relationship configuration table with the data source identifier.

[0146] The report configuration interface includes, for example: Figure 7 The report field configuration interface shown is as follows: Figure 8 The data source configuration interface shown is as follows: Figure 9 The operator sequence configuration interface shown is where the operator can configure the sequence as follows: Figure 7The report field configuration interface shown allows users to enter the name of the initial report under "Name" and the name of the initial report under "Report Entity." Under "Field Library," a target field library is selected. The report field configuration displays the fields from the target field library. Users select initial fields by checking the boxes before the labels. The "Field Name" (Report Settings) option allows users to set the final name of the field in the target report. Users can also configure other settings for the initial fields, such as default display and calculation type. After selecting the initial fields, the report development device will assemble them into an initial report. Users can then... Figure 8 The data source configuration interface shown allows users to select data sources by checking the boxes before their labels, configure mapping relationships with the corresponding data sources through field mapping, and set filtering settings for data loading from the data source. Operators provide the calculation logic between the data source and the initial report to the developers. The developers then create a calculation sequence plugin containing a first operator sequence, an aggregation operator, and a second operator sequence. Operators can then use methods such as... Figure 9 Select the target operator sequence in the operator sequence configuration interface shown. Complete the initial report and report configuration settings.

[0147] Operators use the initial report to generate the target report. The flowchart of data processing during the target report generation process is as follows: Figure 10 As shown. The operator clicks the initial report, enters the query range and query fields, and the computer device obtains the initial report identifier, query range, and query fields. It also obtains the report configuration associated with the initial report identifier, retrieves multiple data source identifiers corresponding to the initial report, and the mapping relationship configuration table corresponding to the data source identifiers from the report configuration. Then, it loads the data sources corresponding to the data source identifiers. Based on the mapping relationship configuration table corresponding to each data source identifier, the query fields are converted into target fields in the data source corresponding to the data source identifier. The field data corresponding to the target fields in the data source is obtained, and then the field data is mapped to the query fields corresponding to the target fields to obtain the initial data. The initial data is then processed based on the first operator sequence to obtain intermediate data. The intermediate data is then aggregated to obtain an intermediate table. The intermediate table is then processed based on the second operator sequence to obtain the target report containing the query fields. In a specific embodiment, the data processing process is as follows: Figure 11a , 11b As shown in 11c and 11d.

[0148] In this embodiment, the report configuration and query fields corresponding to the initial report are obtained. Initial data is retrieved from the data source corresponding to the data source identifier based on the query fields. Intermediate data is obtained by processing the initial data using a first operator sequence. The intermediate data is then aggregated to obtain an intermediate table. Finally, the intermediate table is processed using a second operator sequence to obtain the target report containing the query fields. Retrieving initial data from the data source corresponding to the data source identifier based on the query fields, and retrieving initial data for calculation based on query requirements, reduces the amount of data involved in the calculation and improves the calculation speed. Processing the initial data using the first operator sequence allows for modification of the calculation logic; if modifications are needed, only the operators and their order need to be changed, improving the operability and convenience of modifying the calculation logic. Aggregating the intermediate data to obtain the intermediate table, and then processing the intermediate table using the second operator sequence, yields the target report containing the query fields. The target report presents the query fields, realizing the variability of fields in the report and improving the report's flexibility.

[0149] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0150] Based on the same inventive concept, this application also provides a report generation device for implementing the report generation method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more report generation device embodiments provided below can be found in the limitations of the report generation method described above, and will not be repeated here.

[0151] In one embodiment, such as Figure 12 As shown, a report generation device is provided, including: an acquisition module, a truncation module, a first calculation module, an aggregation module, and a second calculation module, wherein:

[0152] The acquisition module 1202 is used to acquire the report configuration corresponding to the initial report; the report configuration includes the data source identifier, the first operator sequence, and the second operator sequence;

[0153] The interception module 1204 is used to obtain query fields and retrieve initial data from the data source corresponding to the data source identifier based on the query fields;

[0154] The first calculation module 1206 is used to process the initial data based on the first operator sequence to obtain intermediate data;

[0155] The aggregation module 1208 is used to aggregate intermediate data to obtain an intermediate table;

[0156] The second calculation module 1210 is used to perform calculations on the intermediate table based on the second operator sequence to obtain the target report containing the query fields.

[0157] In one embodiment, the acquisition module 1202 is further configured to: acquire multiple initial fields and combine the multiple initial fields into an initial report; acquire a data source identifier and a mapping relationship configuration table corresponding to the data source identifier; acquire an operator sequence corresponding to the initial report, the operator sequence including a first operator sequence and a second operator sequence; and assemble a report configuration of the initial report based on the initial fields, the data source identifier, the mapping relationship configuration table, and the operator sequence.

[0158] In one embodiment, the acquisition module 1202 is further configured to: update the report configuration in response to an operation of deleting the data source identifier in the report configuration, or in response to an operation of adding the data source identifier in the report configuration, to obtain a new report configuration.

[0159] In one embodiment, the acquisition module 1202 is further configured to: acquire the calculation logic relationship between the source field in the data source and the initial field in the initial report; generate the operator sequence plugin corresponding to the calculation logic relationship based on the calculation logic relationship; and, in response to the import operation of the operator sequence plugin, display the plugin identifier corresponding to the operator sequence plugin in the report configuration interface, and use the operator sequence in the operator sequence plugin as the operator sequence corresponding to the initial report.

[0160] In one embodiment, the interception module 1204 is further configured to: obtain the query range and query fields, and obtain initial data from the data source corresponding to the data source identifier based on the query range and query fields.

[0161] In one embodiment, the interception module 1204 is further configured to: obtain the data source and mapping relationship configuration table corresponding to the data source identifier; obtain the target field in the data source corresponding to the query field based on the mapping relationship configuration table corresponding to the data source identifier; and map the field data corresponding to the target field in the data source to the corresponding query field to obtain the initial data.

[0162] In one embodiment, the first calculation module 1206 is further configured to: if there are multiple initial data, perform parallel calculations on the multiple initial data based on the first operator sequence to obtain multiple intermediate data corresponding to the multiple initial data.

[0163] Each module in the aforementioned report generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0164] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a report generation method. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0165] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0166] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0167] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0168] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0169] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0170] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0171] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0172] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A report generation method, characterized in that, The method includes: Obtain the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, and a second operator sequence; obtain the operator sequence corresponding to the initial report, the operator sequence including a first operator sequence, an intermediate operator sequence, and a second operator sequence, including: obtaining the calculation logic relationship from the source field in the data source to the initial field in the initial report; in response to the editing operation for the calculation logic relationship, obtaining the operator sequence plugin corresponding to the calculation logic relationship; in response to the import operation of the operator sequence plugin, displaying the plugin identifier corresponding to the operator sequence plugin in the report configuration interface, and using the operator sequence in the operator sequence plugin as the operator sequence corresponding to the initial report; the operator sequence refers to a sequence of multiple operators arranged in an operational order and having logical functions; Obtain the query fields, and based on the query fields, obtain initial data from the data source corresponding to the data source identifier; The initial data is processed based on the first operator sequence to obtain intermediate data; The intermediate data is aggregated based on the intermediate operator sequence to obtain an intermediate table; The intermediate table is processed based on the second operator sequence to obtain a target report containing the query fields.

2. The method according to claim 1, characterized in that, The report configuration for obtaining the initial report includes: Obtain multiple initial fields and combine the multiple initial fields into an initial report; Obtain the data source identifier and the mapping relationship configuration table corresponding to the data source identifier; Obtain the operator sequence corresponding to the initial report, wherein the operator sequence includes a first operator sequence and a second operator sequence; The report configuration of the initial report is composed based on the initial field, the data source identifier, the mapping relationship configuration table, and the operator sequence.

3. The method according to claim 2, characterized in that, The report configuration for obtaining the initial report also includes: In response to an operation that deletes the data source identifier in the report configuration, or in response to an operation that adds the data source identifier in the report configuration, the report configuration is updated to obtain a new report configuration.

4. The method according to claim 1, characterized in that, The intermediate data is aggregated to obtain an intermediate table, which includes: The first statistical value is obtained by counting the number of the intermediate data. The second statistical value is obtained by counting the number of data sources. Compare the first statistical value with the second statistical value; If the first statistical value is equal to the second statistical value, then the multiple intermediate data are combined into an intermediate table.

5. The method according to claim 1, characterized in that, The step of obtaining the query field and retrieving initial data from the data source corresponding to the data source identifier based on the query field includes: Obtain the query range and query fields, and retrieve initial data from the data source corresponding to the data source identifier based on the query range and query fields.

6. The method according to claim 1, characterized in that, The step of obtaining the query field and retrieving initial data from the data source corresponding to the data source identifier based on the query field includes: Obtain the data source and mapping relationship configuration table corresponding to the data source identifier; Based on the mapping relationship configuration table corresponding to the data source identifier, the target field in the data source corresponding to the query field is obtained; The field data corresponding to the target field in the data source is mapped to the corresponding query field to obtain the initial data.

7. The method according to claim 1, characterized in that, The intermediate data obtained by processing the initial data based on the first operator sequence includes: If there are multiple initial data, then the multiple initial data are processed in parallel based on the first operator sequence to obtain multiple intermediate data corresponding to the multiple initial data.

8. A report generation device, characterized in that, The device includes: The acquisition module is used to acquire the report configuration corresponding to the initial report; the report configuration includes a data source identifier, a first operator sequence, an intermediate operator sequence, and a second operator sequence; acquiring the operator sequence corresponding to the initial report, the operator sequence including the first operator sequence and the second operator sequence, includes: acquiring the calculation logic relationship from the source fields in the data source to the initial fields in the initial report; in response to an editing operation on the calculation logic relationship, acquiring the operator sequence plugin corresponding to the calculation logic relationship; in response to an import operation on the operator sequence plugin, displaying the plugin identifier corresponding to the operator sequence plugin in the report configuration interface, and using the operator sequence in the operator sequence plugin as the operator sequence corresponding to the initial report; the operator sequence refers to a sequence of multiple operators arranged in an operational order and having logical functions; The interception module is used to obtain query fields and retrieve initial data from the data source corresponding to the data source identifier based on the query fields; The first calculation module is used to perform calculations on the initial data based on the first operator sequence to obtain intermediate data; An aggregation module is used to aggregate the intermediate data based on the intermediate operator sequence to obtain an intermediate table; The second calculation module is used to perform calculations on the intermediate table based on the second operator sequence to obtain a target report containing the query fields.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data table processing method and device, computer equipment and storage medium

    CN114579584A

  • Report generation method and device, computer equipment and storage medium

    CN115061721A