CN115510130A - Report generation method and device, computer equipment and storage medium - Google Patents
Report generation method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN115510130A CN115510130A CN202211201230.5A CN202211201230A CN115510130A CN 115510130 A CN115510130 A CN 115510130A CN 202211201230 A CN202211201230 A CN 202211201230A CN 115510130 A CN115510130 A CN 115510130A
- Authority
- CN
- China
- Prior art keywords
- report
- initial
- data
- data source
- operator sequence
- 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/24—Querying
- G06F16/248—Presentation of query results
-
- 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/23—Updating
-
- 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
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application relates to a report generation method, a report generation device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence; acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field; calculating the initial data based on the first operator sequence to obtain intermediate data; performing polymerization treatment on the intermediate data to obtain an intermediate table; and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field. By adopting the method, the flexibility of the report can be improved. The invention can be applied to various systems related to reports, such as an Enterprise management system, an Enterprise Resource Planning (ERP) system, and the like.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a report generation method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
In an ERP (Enterprise Resource Planning) system, a report is an indispensable data carrier, and the report can be used for summarizing, analyzing, presenting, and the like data.
In the traditional technology, after the development of the ERP system is completed, the sources of the fields and the field data presented in the report are fixed, if the fields, the sources of the field data and the calculation logic of the field data in the report need to be changed, developers need to develop the report for the second time, and the flexibility of the report is poor.
Disclosure of Invention
In view of the above, it is necessary to provide a report generation method, an apparatus, a computer device, a computer readable storage medium and a computer program product, which can improve the flexibility of reports.
In a first aspect, the present application provides a report generation method. The method comprises the following steps:
acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field;
calculating the initial data based on the first operator sequence to obtain intermediate data;
performing polymerization treatment on the intermediate data to obtain an intermediate table;
and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
In an embodiment, the obtaining of the report configuration corresponding to the initial report includes:
acquiring a plurality of initial fields, and forming an initial report by the initial fields;
acquiring a data source identifier and a mapping relation configuration table corresponding to the data source identifier;
acquiring an operator sequence corresponding to the initial report, wherein the operator sequence comprises a first operator sequence and a second operator sequence;
and forming report configuration of the initial report based on the initial field, the data source identification, the mapping relation configuration table and the operator sequence.
In an embodiment, the obtaining the report configuration corresponding to the initial report further includes:
and updating the report configuration to obtain new report configuration in response to the operation of deleting the data source identifier in the report configuration or in response to the operation of adding the data source identifier in the report configuration.
In an embodiment, the obtaining an operator sequence corresponding to the initial report includes:
acquiring a computational logic relationship from a source field in the data source to an initial field in the initial report;
generating an operator sequence plug-in corresponding to the calculation logical relation based on the calculation logical relation;
and responding to the import operation of the operator sequence plug-in, displaying a plug-in identifier corresponding to the operator sequence plug-in a report configuration interface, and taking the operator sequence in the operator sequence plug-in as the operator sequence corresponding to the initial report.
In one embodiment, the obtaining the query field, and obtaining the initial data from the data source corresponding to the data source identification based on the query field includes:
and acquiring a query range and a query field, and acquiring initial data from a data source corresponding to the data source identification based on the query range and the query field.
In one embodiment, the obtaining the query field, and obtaining the initial data from the data source corresponding to the data source identification based on the query field includes:
acquiring a data source and a mapping relation configuration table corresponding to the data source identifier;
obtaining a target field corresponding to the query field in the data source based on a mapping relation configuration table corresponding to the data source identifier;
and mapping field data corresponding to the target field in the data source to the corresponding query field to obtain initial data.
In one embodiment, the performing calculation processing on the initial data based on the first operator sequence to obtain intermediate data includes:
and if a plurality of initial data exist, performing parallel computing processing on the plurality of initial data based on the first computing subsequence to obtain a plurality of intermediate data corresponding to the plurality of initial data.
In a second aspect, the application further provides a report generation device. The device comprises:
the acquisition module is used for acquiring the report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
the intercepting module is used for acquiring a query field and acquiring initial data from a data source corresponding to the data source identification based on the query field;
the first calculation module is used for calculating the initial data based on the first operator sequence to obtain intermediate data;
the aggregation module is used for carrying out aggregation processing on the intermediate data to obtain an intermediate table;
and the second calculation module is used for calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field;
calculating the initial data based on the first operator sequence to obtain intermediate data;
performing polymerization treatment on the intermediate data to obtain an intermediate table;
and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field;
calculating the initial data based on the first operator sequence to obtain intermediate data;
performing polymerization treatment on the intermediate data to obtain an intermediate table;
and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field;
calculating the initial data based on the first operator sequence to obtain intermediate data;
performing polymerization treatment on the intermediate data to obtain an intermediate table;
and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
The report generation method, the report generation device, the computer equipment, the storage medium and the computer program product acquire the report configuration and the query field corresponding to the initial report, acquire the initial data from the data source corresponding to the data source identification based on the query field, perform calculation processing on the initial data based on the first operator sequence to obtain intermediate data, perform aggregation processing on the intermediate data to obtain an intermediate table, and perform calculation processing on the intermediate table based on the second operator sequence to obtain the target report containing the query field. The method comprises the steps of obtaining initial data from a data source corresponding to a data source identification according to a query field, obtaining the initial data participating in calculation according to query requirements, reducing the data amount participating in calculation, improving the calculation speed, carrying out calculation processing on the initial data based on a first operator sequence, only modifying the operators and the operator sequence in the first operator sequence if the calculation logic of the initial data needs to be modified, improving the operability and convenience of calculation logic modification, aggregating the intermediate data to obtain an intermediate table, carrying out calculation processing on the intermediate table based on a second operator sequence to obtain a target report containing the query field, presenting the query field in the target report, achieving the variability of the field in the report, and improving the flexibility of the report.
Drawings
FIG. 1 is a diagram of an application environment of a report generation method in one embodiment;
FIG. 2 is a flowchart illustrating a report generation method according to an embodiment;
FIG. 3 is a flowchart illustrating the report configuration generation step in one embodiment;
FIG. 4 is a schematic flow chart diagram illustrating the initial data acquisition step in one embodiment;
FIG. 5 is a diagram illustrating an exemplary operating interface of a field library;
FIG. 6 is a diagram of an example embodiment of an operation interface for mapping establishment;
FIG. 7 is a diagram illustrating an operation interface for configuring report fields in one embodiment;
FIG. 8 is a schematic diagram of an operator interface for data source configuration in one embodiment;
FIG. 9 is a schematic operator interface diagram of an operator sequence configuration in one embodiment;
FIG. 10 is a flowchart illustrating the report generation step in one embodiment;
FIG. 11a is a diagram illustrating a source of data to initial data in one embodiment;
FIG. 11b is a diagram illustrating initial data to intermediate data in one embodiment;
FIG. 11c is a diagram of intermediate data to intermediate tables, in one embodiment;
FIG. 11d is a diagram of an embodiment intermediate to target report;
FIG. 12 is a block diagram showing the structure of a report generation apparatus according to an embodiment;
FIG. 13 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The report generation method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. Both the terminal and the server can be independently used for executing the report generation method provided by the embodiment of the application. The terminal and the server can also be cooperatively used for executing the report generation method provided in the embodiment of the application. For example, the terminal 102 sends a query field and a target report generation request, the server 104 receives the target report generation request, obtains a report configuration and a query field corresponding to an initial report, obtains initial data from a data source corresponding to a data source identifier based on the query field, performs calculation processing on the initial data based on a first operator sequence to obtain intermediate data, performs aggregation processing on the intermediate data to obtain an intermediate table, and performs calculation processing on the intermediate table based on a second operator sequence to obtain a target report including the query field. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a report generating method is provided, and the method may be applied to a computer device, where the computer device may be a terminal or a server, and is executed by the terminal or the server itself alone, or may be implemented through interaction between the terminal and the server. The embodiment is described by taking the method as an example applied to a computer device, and includes steps 202 to 210.
Wherein, the initial report form is a set report form. It is understood that a report containing all of the initial fields is set by the developer or user. Report configuration refers to the collection of configurations needed in the process of generating reports. The report configuration includes, but is not limited to, a data source, a mapping relationship configuration table corresponding to the data source, a calculation logic, and the like. The initial report can correspond to one or more report configurations, and the state of the report configuration can be set to be a disabled state and an enabled state according to requirements. The data source refers to a source object of data in the report. The data source may be an underlying material, a document, or other data bearing object. The data source identification refers to a character string representing a data source. It can be understood as the name of the data source. The data source identification may consist of letters, numbers, symbols, and the like. An operator refers to a computational step performed on data, e.g., sorting, grouping, aggregating, splitting, merging, adding and subtracting fields, function computation, and so forth. The operator sequence refers to a sequence formed by a plurality of operators according to a calculation sequence. It is understood that a sequence of a plurality of operators has a certain logical function.
Illustratively, the computer device obtains a report configuration corresponding to the initial report.
In one embodiment, the computer device obtains a starting instruction of the initial report, then queries a plurality of report configurations associated with the initial report identifier, queries states of the plurality of report configurations, and takes the report configuration with the enabled state as the report configuration corresponding to the initial report. At the same time, in a plurality of report configurations associated with one initial report identifier, the state of only one report configuration is a starting state, and the rest reports are configured to be a forbidden state.
In one embodiment, the computer device obtains a new creation instruction of the initial report, obtains an initial field of the initial report, forms the initial report with the initial field, and then obtains a report configuration corresponding to the initial report. The initial field and the report configuration can be set by an operator on an operation interface.
And step 204, acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field.
The query field refers to a field to be queried, and may be one or more initial fields. It can be understood as the fields displayed in the target report. Initial data refers to data obtained from a data source that corresponds to a query field.
Illustratively, the computer device obtains the query field and then obtains initial data corresponding to the query field from the data source corresponding to each data source identification.
In one embodiment, a computer device obtains a query field, obtains a source field corresponding to the query field according to a first relation table between an initial field and the source field, obtains a target field corresponding to the source field in a data source corresponding to a data source identifier according to a mapping relation configuration table corresponding to the data source identifier, and maps field data corresponding to the target field to the source field to obtain initial data.
And step 206, calculating the initial data based on the first operator sequence to obtain intermediate data.
The intermediate data refers to the result obtained by the initial data processing.
Illustratively, the computer device performs calculation processing on the initial data based on the first operator sequence, and the result of the processing is intermediate data.
The aggregation processing refers to a processing procedure of combining a plurality of intermediate data into one intermediate table. The aggregation process may be done based on an aggregation operator.
Illustratively, the computer device composes a plurality of intermediate data into an intermediate table.
In one embodiment, the computer device obtains a plurality of intermediate data, counts the number of the intermediate data to obtain a first statistical value, counts the number of the data sources to obtain a second statistical value, compares the first statistical value with the second statistical value, and forms the plurality of intermediate data into an intermediate table if the first statistical value is equal to the second statistical value.
In one embodiment, the computer device uses one of the intermediate data as an intermediate initial table, then adds a new column in the intermediate initial table, maps the field data of each field in one of the intermediate data to the added column, and repeats the above steps until all the intermediate data complete the mapping step, so as to obtain an intermediate table containing a plurality of intermediate data.
Step 210, calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field
Exemplarily, the computer device performs calculation processing on the intermediate table based on the second operator sequence, and a result obtained by the processing is the target report.
The report generation method comprises the steps of obtaining report configuration and query fields corresponding to an initial report, obtaining initial data from a data source corresponding to a data source identifier based on the query fields, carrying out calculation processing on the initial data based on a first operator sequence to obtain intermediate data, carrying out aggregation processing on the intermediate data to obtain an intermediate table, and carrying out calculation processing on the intermediate table based on a second operator sequence to obtain a target report containing the query fields. The method comprises the steps of obtaining initial data from a data source corresponding to a data source identification according to a query field, obtaining the initial data participating in calculation according to query requirements, reducing the data volume participating in calculation, improving the calculation speed, carrying out calculation processing on the initial data based on a first operator sequence, only modifying the sequence of operators and operators in the first operator sequence if the calculation logic of the initial data needs to be modified, improving the operability and convenience of the modification of the calculation logic, aggregating the intermediate data to obtain an intermediate table, carrying out calculation processing on the intermediate table based on a second operator sequence to obtain a target report containing the query field, presenting the query field in the target report, achieving the variability of the field in the report, and improving the flexibility of the report.
In an embodiment, as shown in fig. 3, acquiring the report configuration corresponding to the initial report includes:
Wherein, the initial field refers to the field in the initial report.
Illustratively, the computer device obtains a plurality of initial fields, and forms an initial report from the initial fields according to a certain sequence.
In one embodiment, an operator selects initial fields in a field configuration interface, firstly selects a target field library from the plurality of field libraries, the configuration interface displays fields in the target field library, the operator selects a plurality of initial fields from the plurality of fields in a clicking mode, and the computer equipment acquires the initial fields and forms an initial report form by the initial fields according to a certain sequence. Wherein, the field library refers to a collection of fields, and the field library includes a plurality of fields, such as materials, organizations, warehouses, and the like. Fields in the field library may be added, deleted, modified, etc. through the edit page.
The mapping relation configuration table refers to files of mapping relations among fields. The mapping relation configuration table can be in the form of a form, text and the like. One data source identifier may be associated with a plurality of mapping relationship configuration tables, and mapping fields corresponding to source fields in the data source in each mapping relationship configuration table may be different.
Illustratively, the computer device obtains a data source identification, and obtains a mapping relationship configuration table corresponding to the data source representation.
In one embodiment, an operator selects a data source identifier corresponding to an initial report from a data source library, and then selects a corresponding mapping configuration table from a plurality of mapping configuration tables associated with the data source identifier, where the mapping configuration table stores mapping relationships between source fields in the data source and initial fields in the initial report.
In one embodiment, if the data source identifier does not have an associated mapping relationship configuration table, the mapping relationship table is established through a mapping relationship configuration interface, the data source and the initial report are selected first, then the mapping relationship between the source field in the data source and the initial field in the initial report is established, and the mapping relationship configuration table between the data source and the initial report is stored in an associated manner with the data source identifier.
And step 306, acquiring an operator sequence corresponding to the initial report, wherein the operator sequence comprises a first operator sequence and a second operator sequence.
Illustratively, the computer device obtains an operator sequence corresponding to the initial report, where the operator sequence includes a first operator sequence and a second operator sequence.
In one embodiment, the computer device obtains an operator sequence corresponding to the initial report, wherein the operator sequence comprises a first operator sequence for calculating initial data, an intermediate operator sequence for aggregating intermediate data, and a second operator sequence for calculating the intermediate report.
And 308, forming report configuration of the initial report based on the initial field, the data source identification, the mapping relation configuration table and the operator sequence.
Illustratively, the computer device forms a report configuration of the initial report by the initial field, the data source identification, the mapping relation configuration table and the operator sequence.
In this embodiment, the initial field, the data source identifier, the mapping relationship configuration table, and the operator sequence are combined to form report configuration of the initial report, where 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 introduction of the operator sequence can all be completed by an operator through a setting page, and the operator can establish the initial report and report configuration corresponding to the initial report according to requirements, thereby improving flexibility of report generation, and flexibility of data sources and calculation logics in the report.
In one embodiment, the obtaining of the report configuration corresponding to the initial report further includes:
and updating the report configuration to obtain new report configuration in response to the operation of deleting the data source identifier in the report configuration or in response to the operation of adding the data source identifier in the report configuration.
Illustratively, the computer device deletes the corresponding data source identifier in the report configuration in response to an operation of deleting the data source identifier in the report configuration, or adds the data source identifier in the report configuration in response to an operation of adding the data source identifier in the report configuration, so as to obtain a new report configuration.
In one embodiment, an operator clicks a report modification key, a terminal displays an initial field, a data source identifier, a mapping relation configuration table and an operator sequence in an initial report, and the operator deletes and adds the data source identifier.
In the embodiment, the data source identifier in the report configuration is deleted or newly added, so that the data source of the initial report is changed, and the flexibility of the report is improved.
In one embodiment, the obtaining of the operator sequence corresponding to the initial report includes:
acquiring a calculation logic relation from a source field in a data source to an initial field in an initial report; generating an operator sequence plug-in corresponding to the calculation logical relation based on the calculation logical relation; and responding to the import operation of the operator sequence plug-in, displaying plug-in identifications corresponding to the operator sequence plug-in a report configuration interface, and taking the operator sequence in the operator sequence plug-in as an operator sequence corresponding to the initial report.
Wherein, calculating the logical relationship refers to a calculation process. The calculation logic relationship includes, but is not limited to, calculation steps, objects participating in the calculation corresponding to each calculation step, and the like. A plug-in refers to a saved file of a program written in an application program interface that complies with a certain specification. The report configuration interface is an interface for setting the report configuration. The report configuration interface includes, but is not limited to, report configuration identification, report field configuration, data source configuration, operator sequence configuration, and the like. Plug-in identification refers to the name of an operator sequence plug-in. The plug-in identification may consist of letters, numbers, symbols, etc.
Illustratively, the computer device obtains a calculation logical relationship from a source field in a data source to an initial field in an initial report, generates a corresponding operator sequence plug-in based on the calculation logical relationship, presents plug-in identifiers corresponding to the operator sequence plug-ins in a report configuration interface in response to import operations of the operator sequence plug-ins, and takes the operator sequence in the operator sequence plug-ins as the operator sequence corresponding to the initial report.
In one embodiment, the computer device responds to setting operation for an operator sequence, displays plug-in identifiers corresponding to a plurality of candidate operator sequence plug-ins in a report configuration interface of the terminal, and responds to selection operation for the plug-in identifiers, and takes 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.
In one embodiment, a computer device obtains a calculation logical relationship from a source field in a data source to an initial field in an initial report, sends the calculation logical relationship to a developer in response to sending operation for the calculation logical relationship, after receiving the calculation logical relationship, the developer writes an operator sequence plug-in corresponding to the calculation logical relationship, stores the operator sequence plug-in and a plug-in identifier in an operator sequence plug-in library, presents candidate plug-in identifiers meeting a screening condition in a report configuration interface in response to screening operation for the operator sequence plug-in, and takes an operator sequence in the operator sequence plug-in corresponding to the selected candidate plug-in identifier as an operator sequence corresponding to the initial report in response to selecting operation for the candidate plug-in identifiers.
In this embodiment, the operator sequence plug-in is introduced to complete the setting of the operator sequence in the report configuration corresponding to the initial report, so that an operator can quickly complete the setting and modification of the operator sequence, and the flexibility of the report configuration is improved.
In one embodiment, the method for obtaining the initial data from the data source corresponding to the data source identification based on the query field comprises the following steps:
and acquiring a query range and a query field, and acquiring initial data from a data source corresponding to the data source identification based on the query range and the query field.
The query scope refers to a limited scope of query contents. It can be understood as a scope of data screening. The query range may be a limited range of one field or a limited range of a plurality of fields. For example, date =2022, department = finance department.
Illustratively, the computer device obtains the query range and the query field, loads the data source corresponding to the data source identifier, and obtains initial data from the data source according to the query range and the query field.
In the embodiment, the initial data is obtained from the data source corresponding to the data source identification according to the query range and the query field, so that the initial data participating in calculation is accurately obtained, the data volume participating in calculation is reduced, and the report generation speed is increased.
In one embodiment, as shown in FIG. 4, obtaining initial data from a data source that corresponds to the data source identification based on the query field includes:
Illustratively, the computer device obtains a plurality of data source identifiers in report configuration and a mapping relationship configuration table corresponding to the data source identifiers.
In one embodiment, a computer device obtains an initial report starting instruction, obtains an initial report identifier from the initial report starting instruction, then obtains a report configuration associated with the initial report identifier, and obtains a plurality of data source identifiers and a mapping relationship configuration table corresponding to the data source identifiers from the report configuration.
Illustratively, the computer device converts the query field into a 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.
In one embodiment, the computer device obtains a query field, obtains a source field corresponding to the query field according to a second relation table between the initial field and the source field, and then converts the source field into a target field in a data source corresponding to the data source identifier according to a mapping relation configuration table corresponding to each data source identifier.
And 406, mapping field data corresponding to the target field in the data source to the corresponding query field to obtain initial data.
Illustratively, the computer device obtains field data corresponding to a target field in the data source, and then maps the field data to a query field corresponding to the target field to obtain initial data.
In one embodiment, the initial data is stored in the form of a data table.
In one embodiment, the initial data is stored in the form of text.
In the embodiment, the query field is converted into the target field through the field mapping configuration table corresponding to the data source identification, and the field data corresponding to the query field is obtained from the data source, so that the problem of inconsistent field names in each data source is solved, the initial data is obtained from each data source, the initial data is provided for the generation of the target report, the data volume participating in calculation is reduced, and the report generation speed is increased.
In one embodiment, the performing calculation processing on the initial data based on the first operator sequence to obtain intermediate data comprises:
if a plurality of initial data exist, the plurality of initial data are subjected to parallel computing processing based on the first computing subsequence, and a plurality of intermediate data corresponding to the plurality of initial data are obtained.
Illustratively, the computer device obtains a plurality of initial data, and performs parallel computing processing on the plurality of initial data according to a first operator sequence to obtain intermediate data corresponding to each initial data.
In one embodiment, the computer device acquires N initial data, then starts N processes, distributes each initial data to one process, and performs calculation processing on the initial data by each process based on a first operator sequence to obtain intermediate data corresponding to the initial data.
In one embodiment, a computer device takes N initial data, distributes the N initial data to a target process, the target process starts N threads, distributes each initial data to one thread, each thread performs calculation processing on the initial data based on a first operator sequence to obtain intermediate data corresponding to the initial data, and then each thread sends the intermediate data to the target process.
In this embodiment, the speed of generating the report can be increased by performing parallel calculation processing on a plurality of initial data.
In an exemplary embodiment, an operator develops an initial report through a report development device, and the report development device comprises a field library, a data source library, a mapping relation configuration table setting interface, a report configuration interface and the like. The field library includes a plurality of fields, each field includes a field name, a field type, and the like, and an operator may perform update operations such as adding, deleting, modifying, and the like on the fields in the field library according to the field library setting interface shown in fig. 5. The data source library comprises data source identifications of a plurality of data sources in a plurality of systems. An operator can establish a mapping relationship configuration table between a source field in a data source and a field in a field library according to the setting interface of the mapping relationship configuration table shown in fig. 6, and store the mapping relationship configuration table and a data source identifier in an associated manner.
The report configuration interface includes a report field configuration interface shown in fig. 7, a data source configuration interface shown in fig. 8, and an operator sequence configuration interface shown in fig. 9, where an operator inputs a name of a report configuration corresponding to an initial report below the name of the report field configuration interface shown in fig. 7, inputs a name of the initial report below a report entity, selects a target field library below the field library, presents fields in the target field library in the report field configuration, the operator selects an initial field by checking a box in front of a label, can set a name of a field in the field library finally presented in the target report by a field name (report setting), and can perform some related settings on the initial field, for example, whether to display by default, a calculation type, and the like, to complete the selection of the initial field in the initial report, and the report development apparatus composes the initial field into the initial report. An operator selects a mapping relationship configuration table corresponding to a data source through field mapping by checking a box data source in front of a label in a data source configuration interface as shown in fig. 8, and can also perform filtering setting and the like on loading of data in the data source. An operator provides the calculation logic between the data source and the initial report to a developer, the developer compiles a calculation sequence plug-in including a first operator sequence, an aggregation operator and a second operator sequence, and the operator selects a target operator sequence through an operator sequence configuration interface as shown in fig. 9. And finishing the setting of the initial report and the report configuration.
The operator uses the initial report to generate a target report, and a flow chart of data processing in the target report generation process is shown in fig. 10. An operator clicks an initial report, a query range and a query field are input, a computer device obtains an initial report identifier, a query range and a query field, a report configuration associated with the initial report identifier is obtained, a plurality of data source identifiers corresponding to the initial report and a mapping relation configuration table corresponding to the data source identifiers are obtained from the report configuration, then a data source corresponding to the data source identifier is loaded, the query field is converted into a target field in the data source corresponding to the data source identifier according to the mapping relation configuration table corresponding to each data source identifier, field data corresponding to the target field in the data source is obtained, then the field data is mapped to the query field corresponding to the target field to obtain initial data, the initial data is calculated based on a first operator sequence to obtain intermediate data, the intermediate data is aggregated to obtain an intermediate table, the intermediate table is calculated based on a second operator sequence table, and a target report containing the query field is obtained. In a specific embodiment, the data processing is as shown in FIGS. 11a, 11b, 11c, and 11 d.
In this embodiment, a report configuration and a query field corresponding to an initial report are obtained, initial data is obtained from a data source corresponding to a data source identifier based on the query field, intermediate data is obtained by performing calculation processing on the initial data based on a first operator sequence, the intermediate data is aggregated to obtain an intermediate table, and a target report including the query field is obtained by performing calculation processing on the intermediate table based on a second operator sequence. The method comprises the steps of obtaining initial data from a data source corresponding to a data source identification according to a query field, obtaining the initial data participating in calculation according to query requirements, reducing the data volume participating in calculation, improving the calculation speed, carrying out calculation processing on the initial data based on a first operator sequence, only modifying the sequence of operators and operators in the first operator sequence if the calculation logic of the initial data needs to be modified, improving the operability and convenience of the modification of the calculation logic, aggregating the intermediate data to obtain an intermediate table, carrying out calculation processing on the intermediate table based on a second operator sequence to obtain a target report containing the query field, presenting the query field in the target report, achieving the variability of the field in the report, and improving the flexibility of the report.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the application also provides a report generation device for realizing the report generation method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so the specific limitations in one or more report generation device embodiments provided below can refer to the limitations on the report generation method in the foregoing, and details are not described here.
In one embodiment, as shown in fig. 12, there is provided a report generating apparatus including: the device comprises an acquisition module, an interception module, a first calculation module, an aggregation module and a second calculation module, wherein:
an obtaining module 1202, configured to obtain a report configuration corresponding to an initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
an intercepting module 1204, configured to obtain a query field, and obtain initial data from a data source corresponding to the data source identifier based on the query field;
a first calculating module 1206, configured to perform calculation processing on the initial data based on the first operator sequence to obtain intermediate data;
an aggregation module 1208, configured to perform aggregation processing on the intermediate data to obtain an intermediate table;
and a second calculating module 1210, configured to perform calculation processing on the intermediate table based on the second operator sequence to obtain a target report including the query field.
In one embodiment, the obtaining module 1202 is further configured to: acquiring a plurality of initial fields, and forming an initial report by the plurality of initial fields; acquiring a data source identifier and a mapping relation configuration table corresponding to the data source identifier; acquiring an operator sequence corresponding to the initial report, wherein the operator sequence comprises a first operator sequence and a second operator sequence; and forming report configuration of the initial report based on the initial field, the data source identification, the mapping relation configuration table and the operator sequence.
In one embodiment, the obtaining module 1202 is further configured to: and updating the report configuration to obtain new report configuration in response to the operation of deleting the data source identifier in the report configuration or in response to the operation of adding the data source identifier in the report configuration.
In one embodiment, the obtaining module 1202 is further configured to: acquiring a calculation logic relationship from a source field in a data source to an initial field in an initial report; generating an operator sequence plug-in corresponding to the calculation logic relation based on the calculation logic relation; and responding to the import operation of the operator sequence plug-in, displaying plug-in identifications corresponding to the operator sequence plug-in a report configuration interface, and taking the operator sequence in the operator sequence plug-in as an operator sequence corresponding to the initial report.
In one embodiment, intercept module 1204 is further configured to: and acquiring a query range and a query field, and acquiring initial data from a data source corresponding to the data source identification based on the query range and the query field.
In one embodiment, intercept module 1204 is further configured to: acquiring a data source and a mapping relation configuration table corresponding to the data source identifier; obtaining a target field corresponding to the query field in the data source based on a mapping relation configuration table corresponding to the data source identification; and mapping field data corresponding to the target field in the data source to the corresponding query field to obtain initial data.
In one embodiment, the first calculation module 1206 is further to: if a plurality of initial data exist, the plurality of initial data are subjected to parallel computing processing based on the first computing subsequence, and a plurality of intermediate data corresponding to the plurality of initial data are obtained.
All or part of the modules in the report generation device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 13. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a report generating method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 13 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
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 for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include a Read-Only Memory (ROM), a magnetic tape, a floppy disk, a flash Memory, an optical Memory, a high-density embedded nonvolatile Memory, a resistive Random Access Memory (ReRAM), a Magnetic Random Access Memory (MRAM), a Ferroelectric Random Access Memory (FRAM), a Phase Change Memory (PCM), a graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. 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), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims (10)
1. A report generation method is characterized by comprising the following steps:
acquiring report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
acquiring a query field, and acquiring initial data from a data source corresponding to the data source identifier based on the query field;
calculating the initial data based on the first operator sequence to obtain intermediate data;
performing polymerization treatment on the intermediate data to obtain an intermediate table;
and calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
2. The method according to claim 1, wherein the obtaining of the report configuration corresponding to the initial report comprises:
acquiring a plurality of initial fields, and forming an initial report by the plurality of initial fields;
acquiring a data source identifier and a mapping relation configuration table corresponding to the data source identifier;
acquiring an operator sequence corresponding to the initial report, wherein the operator sequence comprises a first operator sequence and a second operator sequence;
and forming report configuration of the initial report based on the initial field, the data source identification, the mapping relation configuration table and the operator sequence.
3. The method according to claim 2, wherein the obtaining of the report configuration corresponding to the initial report further comprises:
and updating the report configuration to obtain new report configuration in response to the operation of deleting the data source identifier in the report configuration or in response to the operation of adding the data source identifier in the report configuration.
4. The method according to claim 2, wherein the obtaining of the operator sequence corresponding to the initial report comprises:
acquiring a calculation logic relationship from a source field in the data source to an initial field in the initial report;
generating an operator sequence plug-in corresponding to the calculation logical relation based on the calculation logical relation;
and responding to the import operation of the operator sequence plug-in, displaying plug-in identifiers corresponding to the operator sequence plug-in a report configuration interface, and taking the operator sequence in the operator sequence plug-in as the operator sequence corresponding to the initial report.
5. The method of claim 1, wherein the obtaining the query field, and wherein obtaining initial data from the data source corresponding to the data source identification based on the query field comprises:
and acquiring a query range and a query field, and acquiring initial data from a data source corresponding to the data source identification based on the query range and the query field.
6. The method of claim 1, wherein the obtaining the query field, and wherein obtaining initial data from the data source corresponding to the data source identification based on the query field comprises:
acquiring a data source and a mapping relation configuration table corresponding to the data source identifier;
obtaining a target field corresponding to the query field in the data source based on a mapping relation configuration table corresponding to the data source identifier;
and mapping field data corresponding to the target field in the data source to the corresponding query field to obtain initial data.
7. The method of claim 1, wherein the performing computation processing on the initial data based on the first operator sequence to obtain intermediate data comprises:
and if a plurality of initial data exist, performing parallel computing processing on the plurality of initial data based on the first arithmetic subsequence to obtain a plurality of intermediate data corresponding to the plurality of initial data.
8. A report generation apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring the report configuration corresponding to the initial report; the report configuration comprises a data source identifier, a first operator sequence and a second operator sequence;
the intercepting module is used for acquiring a query field and acquiring initial data from a data source corresponding to the data source identification based on the query field;
the first calculation module is used for calculating the initial data based on the first operator sequence to obtain intermediate data;
the aggregation module is used for carrying out aggregation processing on the intermediate data to obtain an intermediate table;
and the second calculation module is used for calculating the intermediate table based on the second operator sequence to obtain a target report containing the query field.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211201230.5A CN115510130A (en) | 2022-09-29 | 2022-09-29 | Report generation method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211201230.5A CN115510130A (en) | 2022-09-29 | 2022-09-29 | Report generation method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115510130A true CN115510130A (en) | 2022-12-23 |
Family
ID=84507466
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211201230.5A Pending CN115510130A (en) | 2022-09-29 | 2022-09-29 | Report generation method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115510130A (en) |
-
2022
- 2022-09-29 CN CN202211201230.5A patent/CN115510130A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112433712B (en) | Report display method, report display device, computer equipment and storage medium | |
CN114115844A (en) | Page generation method and device, computer equipment and storage medium | |
US9015591B2 (en) | Dynamic visualization generation and implementation | |
US9594762B2 (en) | Intelligent file management | |
CN112464625A (en) | Receipt generation method and device, computer equipment and storage medium | |
CN117390011A (en) | Report data processing method, device, computer equipment and storage medium | |
CN115857929A (en) | Resource data processing method and device, computer equipment and storage medium | |
CN115510130A (en) | Report generation method and device, computer equipment and storage medium | |
CN115168668A (en) | Information recommendation method and device, computer equipment and storage medium | |
CN114692056A (en) | Target page generation method and device, computer equipment and storage medium | |
CN114416235B (en) | Document display method, device, computer equipment and storage medium | |
CN114528045B (en) | Plug-in operation method, device, computer equipment and storage medium | |
CN113918996B (en) | Distributed data processing method, device, computer equipment and storage medium | |
CN114519062A (en) | Basic data updating method and device, computer equipment and storage medium | |
CN116775955A (en) | Data tag solidifying method, device, computer equipment and storage medium | |
CN114385630A (en) | Blood relationship combing method, apparatus, device, storage medium, and program product | |
CN117270880A (en) | Plug-in service privatization deployment method, device, computer equipment and storage medium | |
CN116204541A (en) | Multidimensional database updating method, multidimensional database updating device, computer equipment and storage medium | |
CN114201464A (en) | Data display method and device, computer equipment and storage medium | |
CN117389859A (en) | Method, device, computer equipment and storage medium for determining influence range | |
CN117435651A (en) | Test data processing method, device, computer equipment and storage medium | |
CN114092064A (en) | Electric power big data processing batch processing system, method, device, equipment and medium | |
CN114647630A (en) | File synchronization method, information generation method, file synchronization device, information generation device, computer equipment and storage medium | |
CN116304407A (en) | Page rendering method, device, computer equipment and storage medium | |
CN114138196A (en) | Power system data storage method and device, computer equipment and storage medium |
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 |