CN114462365A - Report generation method, device, equipment, storage medium and program product - Google Patents

Report generation method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN114462365A
CN114462365A CN202111613122.4A CN202111613122A CN114462365A CN 114462365 A CN114462365 A CN 114462365A CN 202111613122 A CN202111613122 A CN 202111613122A CN 114462365 A CN114462365 A CN 114462365A
Authority
CN
China
Prior art keywords
operator
statistical
child node
report
statistical item
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
Application number
CN202111613122.4A
Other languages
Chinese (zh)
Inventor
何春林
毛军
陶立宏
丰灵均
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qianxin Technology Group Co Ltd
Secworld Information Technology Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Qianxin Technology Group Co Ltd, Secworld Information Technology Beijing Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN202111613122.4A priority Critical patent/CN114462365A/en
Publication of CN114462365A publication Critical patent/CN114462365A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a report generation method, a report generation device, report generation equipment, a storage medium and a program product, wherein the method comprises the following steps: acquiring at least one statistical item; the statistical term comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data; determining a data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution sequence of the operator unit; and generating a report according to the data result corresponding to each statistical item. The method of the embodiment of the invention improves the efficiency of report generation.

Description

Report generation method, device, equipment, storage medium and program product
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for generating a report.
Background
In data-oriented business application, a report is compiled according to a certain format, content and method on the basis of daily data so as to realize the multi-dimensional and fine presentation of various information contained in data to a client and achieve the effect of clearly and intuitively presenting the data.
With the increasing and changing of the business scenes, different reports need to be generated to meet the requirements of different business scenes and different users. In the prior art, reports are generated by presetting fixed templates, and the report requirements under different service scenes cannot be met. Therefore, how to efficiently generate reports meeting different requirements is a problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a report generation method, apparatus, device, storage medium, and program product.
Specifically, the embodiment of the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides a report generating method, including:
obtaining at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for representing the calculation mode of the data;
determining a data result corresponding to each statistical item according to an operator unit and an execution sequence of the operator unit included in each statistical item;
and generating a report according to the data result corresponding to each statistical item.
Further, the determining the data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution order of the operator unit includes:
respectively constructing operator trees corresponding to the statistical items by the operator units in the statistical items according to the execution sequence of the operator units; the child nodes of the operator tree are the operator units, and the root nodes of the operator tree are the nodes corresponding to the statistical items;
and determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item.
Further, after the operator tree corresponding to each statistical term is constructed, the method further includes:
and combining the same operator units in each operator tree to obtain an operator forest, wherein the root nodes of the operator forest comprise the nodes corresponding to each statistical item.
Further, the determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item includes:
for a first root node, starting from the first root node, obtaining a calculation result of a first child node in an operator tree corresponding to the first root node in the operator forest by using a depth-first algorithm according to a calculation result of a second child node in the operator tree corresponding to at least one second root node which is calculated before and data elements of the second child node;
obtaining a data result of a statistical item corresponding to the first root node according to the calculation result of the first child node; the first root node is any one of the root nodes corresponding to the statistical items.
Further, the method further comprises:
and placing the calculation result of the second child node in the operator tree corresponding to the at least one second root node which is calculated before and the data element of the second child node into a cache.
Further, the obtaining, by using a depth-first algorithm, a calculation result of a first child node in an operator tree corresponding to the first root node in the operator forest includes:
determining whether a second child node identical to the first child node exists in the second child node;
if yes, determining whether the data elements calculated by the second child node which are the same as the first child node are the same as the data elements calculated by the first child node;
and if so, taking the calculation result of the second child node which is the same as the first child node as the calculation result of the first child node.
Further, the generating a report according to the data result corresponding to each statistical item includes:
and generating the report according to the data result corresponding to each statistical item and the report format parameter.
Further, the calculation method includes any one of the following:
counting, summing, time conversion, sorting, set intersection and set union.
In a second aspect, an embodiment of the present invention further provides a report generating apparatus, including:
the acquisition module is used for acquiring at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for representing the calculation mode of the data;
the determining module is used for determining a data result corresponding to each statistical item according to the operator unit and the execution sequence of the operator unit included in each statistical item;
and the generating module is used for generating a report according to the data result corresponding to each statistical item.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the report generating method according to the first aspect when executing the program.
In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the report generation method according to the first aspect.
In a fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the report generating method according to the first aspect are implemented.
According to the report generation method, the report generation device, the report generation equipment, the storage medium and the program product, the data result of the statistical item is determined by acquiring the statistical item in the report and according to the operator unit in the statistical item and the execution sequence of the operator unit; that is, the complex operation of the data result of the statistical item in the report is determined, and is converted into the process of executing the operator units according to the sequence, and finally the required report is generated; the complexity of generating the report and the statistical items is reduced, and the efficiency of generating the report is improved; in addition, different reports can be generated by selecting different statistical items by the user, and the requirements of different users on the reports in different scenes can be met.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a report generation method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an operator tree of the report generation method according to the embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating operator tree merging in the report generation method according to the embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a report generation system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a report generating apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method provided by the embodiment of the invention can be applied to a report generation scene, and the report generation efficiency is improved.
In the related technology, in data-oriented business application, a report is compiled according to a certain format, content and method on the basis of daily data, so that various information contained in the data can be presented to a client in a multidimensional and refined manner, and the effect of clearly and intuitively presenting the data is achieved.
With the increasing and changing of the business scenes, different reports need to be generated to meet the requirements of different business scenes and different users. In the prior art, reports are generated by presetting fixed templates, and the report requirements under different service scenes cannot be met. Therefore, how to efficiently generate reports meeting different requirements is a problem that needs to be solved urgently by those skilled in the art.
The report generation method of the embodiment of the invention determines the data result of the statistical item according to the operator unit and the execution sequence of the operator unit in the statistical item by acquiring the statistical item in the report; that is, the complex operation of the data result of the statistical item in the report is determined, and is converted into the process of executing the operator units according to the sequence, and finally the required report is generated; the complexity of generating the report and the statistical items is reduced, and the efficiency of generating the report is improved; in addition, different reports can be generated by selecting different statistical items by the user, and the requirements of different users on the reports in different scenes can be met.
The technical solution of the present invention is described in detail with specific embodiments in conjunction with fig. 1-6. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a flowchart illustrating a report generating method according to an embodiment of the present invention. As shown in fig. 1, the method provided by this embodiment includes:
step 101, obtaining at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data;
specifically, the report includes at least one statistical item, and the statistical item represents a statistical manner, including: count, Top N, histogram; different reports can be generated by selecting different statistical items by the user, and the requirements of different users on the reports under different scenes can be met. The statistical item comprises at least one operator unit, and the operator unit is used for expressing the calculation mode of the data; wherein, the calculation mode comprises any one of the following modes: counting, summing, time conversion, sorting, aggregate intersection and aggregate union; the operator unit can use SQL to calculate and can also use programming language to calculate, thus avoiding the uncertainty caused by analyzing SQL grammar when SQL statistics is more complex; the use of programming languages in complex computing scenarios may also improve the efficiency of computing compared to SQL.
For example: a report contains 3 statistical items, wherein the 3 statistical items comprise 6 operator units in total, and the operator units comprise counting, summation, time conversion, sequencing, set intersection and set union.
Step 102, determining a data result corresponding to each statistical item according to the operator unit and the execution sequence of the operator unit included in each statistical item;
specifically, when one statistical item includes a plurality of operator units, the operator units have a logical relationship of successive calculation, that is, an execution sequence of the operator units; and sequentially executing the data calculation modes corresponding to the operator units according to the execution sequence of the operator units in each statistical item, so that the calculation data result corresponding to the statistical item can be determined.
For example, the statistical item 1 includes 3 operator units, and the execution order is that the operator unit 2 is executed first, then the operator unit 3 is executed, and finally the operator unit 1 is executed, and after all the operator units are executed according to the execution order, the data result corresponding to the statistical item 1 can be determined.
And 103, generating a report according to the data result corresponding to each statistical item.
Specifically, when the report includes a plurality of statistical items, after the data result corresponding to each statistical item is determined, the report may be generated according to the data result corresponding to each statistical item and the report format parameter. Wherein, the report format parameter comprises at least one of the following items: catalog, format, font, background color, line thickness, or font size color.
For example, the report includes 5 statistical items, and after the data result corresponding to the 5 statistical items is determined, the corresponding content in the report is completed according to the data result of the 5 statistical items and the report format parameter, so as to generate the required report.
In the above embodiment, the data result of the statistical item is determined by obtaining the statistical item in the report and according to the operator unit in the statistical item and the execution sequence of the operator unit; that is, the complex operation of the data result of the statistical item in the report is determined, and is converted into the process of executing the operator units according to the sequence, and finally the required report is generated; the complexity of generating the report is reduced, and the efficiency of generating the report is improved; in addition, different reports can be generated by selecting different statistical items by the user, and the requirements of different users on the reports in different scenes can be met.
In an embodiment, determining the data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution order of the operator unit includes:
respectively constructing an operator tree corresponding to each statistical item by the operator units in each statistical item according to the execution sequence of the operator units; the child nodes of the operator tree are operator units, and the root node of the operator tree is a node corresponding to the statistical item;
and determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item.
Specifically, operator units in the statistical items are used for constructing operator trees corresponding to the statistical items according to the execution sequence of the operator units; namely, the operator tree corresponding to the statistical item can reflect the number of the operator units contained in the statistical item and can also reflect the execution sequence of the operator units; the child nodes of the operator tree are operator units, and the root node of the operator tree is a node corresponding to the statistical item; the operator units and the statistical items are expressed through the child nodes of the operator trees and the root nodes of the operator trees through the construction of the operator trees, and the relationship between the statistical items and each operator unit is visually cleared; and then determining the data result corresponding to each statistical item according to the operator tree corresponding to the statistical item.
For example, as shown in fig. 2, the operator tree includes 3 operator units, and the corresponding execution order is that operator unit 2 is executed first, then operator unit 3 is executed, and finally operator unit 1 is executed, and the child nodes of the operator tree are operator unit 1, operator unit 2, and operator unit 3; the root node of the operator tree is a node corresponding to the statistical item; according to the operator tree corresponding to each statistical item, namely according to the execution sequence of the operator unit 1, the operator unit 2 and the operator unit 3 and the operator unit 1, the operator unit 2 and the operator unit 3 in the operator tree, the data result corresponding to the statistical item can be determined.
In the above embodiment, an operator tree corresponding to a statistical item is constructed by using operator units in the statistical item and the execution order of the operator units; the number of the operator units contained in the statistical items can be reflected through the operator tree structure, the execution sequence of the operator units can also be reflected, the calculation logic of the statistical items is conveniently and clearly cleared, and the problem of calculation error of the data result of the statistical items caused by disordered calculation logic, namely wrong execution sequence of the operator units in the calculation process is solved; through the construction of the operator tree, the logic and the sequence of the statistical item data result calculation can be clearly presented, the complexity of the statistical item data result calculation in the report is reduced, and the report generation efficiency is improved.
In an embodiment, after the operator tree corresponding to each statistical term is constructed, the method further includes:
and combining the same operator units in each operator tree to obtain an operator forest, wherein the root nodes of the operator forest comprise nodes corresponding to each statistical item.
Specifically, after an operator tree corresponding to each statistical item is constructed, the same operator units in the operator tree are combined to obtain an operator forest, and the root nodes of the operator forest comprise nodes corresponding to each statistical item; the operator trees corresponding to the statistical items can be combined into an operator forest form by combining the same operator units in the operator trees corresponding to the statistical items, namely, discrete statistical items are combined into a set of statistical items with a connection relation, the connection relation of the statistical items is increased, and the connection degree among the statistical items is improved; and the same operator units are combined, so that the repeated calculation of the operator units can be avoided, and the calculation efficiency is improved.
For example, as shown in fig. 3, the operator tree corresponding to the statistical term 1 includes an operator unit 1, an operator unit 2, and an operator unit 3; the operator tree corresponding to the statistical item 2 comprises an operator unit 2 and an operator unit 4, so that the operator unit 2 in the statistical item 1 and the operator unit in the statistical item 2 can be combined to obtain an operator forest comprising 2 statistical items.
In the above embodiment, operator forests are obtained by merging the same operator units in the operator trees corresponding to each statistical term; the discrete statistical items are combined into a set of statistical items with connection relation, so that the connection relation of each statistical item is increased, and the connection degree among the statistical items is improved; and the same operator units are combined, so that the repeated calculation of the operator units can be avoided, and the calculation efficiency is improved.
In an embodiment, determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item includes:
aiming at a first root node, starting from the first root node, obtaining a calculation result of a first child node in an operator tree corresponding to the first root node in the operator forest by using a depth-first algorithm according to a calculation result of a second child node in the operator tree corresponding to at least one second root node which is calculated before and data elements of the second child node;
obtaining a data result of a statistical item corresponding to the first root node according to the calculation result of the first child node; the first root node is any one of the root nodes corresponding to the statistical items.
Specifically, when the operator forest includes an operator tree corresponding to a plurality of statistical terms, the data result of the operator unit to be currently calculated and the data result of the corresponding root node can be obtained by using the calculation result of the child node and the data element of the child node which are calculated previously; and traversing all child nodes in the operator tree corresponding to any node in the operator forest by using a depth-first algorithm, and obtaining the data result of the statistical item corresponding to the root node after traversing and obtaining the calculation results of all child nodes in the operator tree corresponding to the root node by using the depth-first algorithm.
For example, the report contains statistic item 1, statistic item 2 and statistic item 3; if the data result of the child node of the operator tree corresponding to the statistical item 1 is calculated, the statistical items 2 and 3 can obtain the data results of the operator units corresponding to the child nodes in the statistical items 2 and 3 by using the data result of the child node in the statistical item 1 and the corresponding data elements; and the depth-first algorithm can be used for obtaining the calculation result of any child node in the operator tree corresponding to any node in the operator forest.
In the above embodiment, by using the operator result of the child node and the data element of the child node that have been calculated before, that is, by using the data result that has been calculated and can be reused, the waste of calculation resources is avoided, and the efficiency is improved; the depth-first algorithm can be used for obtaining the calculation results of all the child nodes in a traversing manner, the omission of the child nodes is avoided, and the accuracy of the data result of the statistical item and the generation of the report is improved.
In an embodiment, the method for generating a report further includes:
and placing the calculation result of the second child node in the operator tree corresponding to the at least one second root node which is calculated before and the data element of the second child node into a cache.
Specifically, after the calculation results of the child nodes in the operator tree corresponding to the statistical items are calculated, the calculation results of the child nodes that have been calculated before and the data elements of the child nodes may be placed in a cache; the calculation result comprises a data result and a data element corresponding to the child node, so that the calculation result before is used in the subsequent calculation, and the waste of calculation resources is avoided.
For example, the calculated calculation mode corresponding to the child node 1 is 2-digit addition operation; the calculation result of child node 1 includes data result 3, data elements 1 and 2.
In the above embodiment, by placing the previously calculated calculation result of the child node and the data element of the child node into the cache, the subsequent calculation of the child node can conveniently use the previous calculation result, thereby avoiding the waste of calculation resources.
In an embodiment, obtaining a computation result of a first child node in an operator tree corresponding to a first root node in an operator forest by using a depth-first algorithm includes:
determining whether a second child node identical to the first child node exists in the second child node;
if yes, determining whether the data elements calculated by the second child node which are the same as the first child node are the same as the data elements calculated by the first child node;
and if so, taking the calculation result of the second child node which is the same as the first child node as the calculation result of the first child node.
Specifically, when a depth-first algorithm is used for obtaining a calculation result of a first child node in an operator tree corresponding to a first root node in an operator forest, for any first child node, whether a second child node which is the same as the first child node exists in a second child node is determined; if yes, determining whether the data elements calculated by the second child node which are the same as the first child node are the same as the data elements calculated by the first child node; if the first child node is the same as the second child node, taking the calculation result of the second child node which is the same as the first child node as the calculation result of the first child node; when all child nodes of an operator tree corresponding to the statistical items are obtained by traversing through a depth-first algorithm, whether child nodes which are the same as the child nodes to be calculated currently exist in the calculated child nodes is determined; if the calculated child nodes are the same as the child nodes to be calculated, whether the data elements of the calculated child nodes are the same as the data elements corresponding to the child nodes to be calculated is continuously determined; if it is finally determined that the calculated child node is the same as the child node to be calculated and the data element of the child node is the same as the data element corresponding to the child node to be calculated, that is, the calculation mode and the calculation data are the same, the result of the calculated child node can be used as the data result of the child node to be calculated.
For example, the calculated calculation mode corresponding to child node 1 includes 2-digit addition operation, the corresponding data elements are 1 and 2, and the corresponding data result is 3; that is, the calculation result stored in the cache by the calculated child node 1 includes the data result 3, the data elements 1 and 2; when the calculation result of the child node 2 is obtained by traversing through a depth-first algorithm, it is determined that the child node 1 is the same as the child node 2, that is, the child node 1 and the child node 2 are both 2-digit addition operation, whether the data elements of the child node 1 and the child node 2 are the same is continuously judged, if the data elements of the child node 2 are also 1 and 2, that is, the calculation mode and the data element corresponding to the child node 1 are the same as the calculation mode and the data element corresponding to the child node 2, the calculation result of the child node 1 is taken as the calculation result of the child node 2, that is, the data result 3 of the child node 1 is taken as the data result of the child node 2, that is, the data result of the child node 2 is 3.
In the above embodiment, the calculated child nodes and data elements are matched with the child nodes and data elements to be calculated, and if the calculated child nodes and data elements are the same, the calculation results of the calculated child nodes are used as the calculation results of the child nodes to be calculated; namely, the subsequent child nodes to be calculated can avoid the repeated calculation and the waste of calculation resources by using the calculation results of the child nodes which are calculated before.
Exemplarily, fig. 4 is a schematic structural diagram of a report generation system provided in an embodiment of the present invention, including:
the report template manager 410 is used for providing report statistical items and report format parameters which can be selected by a user;
an operator unit manager 420, configured to provide operator units included in the statistical terms, where the operator units represent a calculation mode;
the cache manager 430 is configured to cache the calculation result of the child node and the data result corresponding to the statistical item;
a statistic item manager 440 for associating statistic items with operator units to generate operator trees;
the execution manager 450 is used for merging the operator trees and determining the data result corresponding to each statistical item;
and the report generator 460 is configured to generate a report according to the data result corresponding to each statistical item and the report format parameter.
The following describes the report generation apparatus provided by the present invention, and the report generation apparatus described below and the report generation method described above may be referred to in correspondence with each other.
Fig. 5 is a schematic structural diagram of a report generation apparatus provided by the present invention. The report generating device provided by this embodiment includes:
an obtaining module 710, configured to obtain at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data; optionally, the obtaining module 710 is used to perform the functions of the report template manager 410 and the operator unit manager 420 in fig. 4;
a determining module 720, configured to determine, according to the operator unit included in each statistical item and the execution order of the operator unit, a data result corresponding to each statistical item; optionally, the determination module 720 is used to perform the functions of the cache manager 430, the statistics manager 440, and the execution manager 450 of FIG. 4;
the generating module 730 is used for generating a report according to the data result corresponding to each statistical item; optionally, the generating module 730 is used to perform the functions of the report generator 460 of fig. 4.
Optionally, the determining module 720 is specifically configured to: respectively constructing an operator tree corresponding to each statistical item by the operator units in each statistical item according to the execution sequence of the operator units; the child nodes of the operator tree are operator units, and the root node of the operator tree is a node corresponding to the statistical item;
and determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item.
Optionally, the determining module 720 is specifically configured to: after the operator tree corresponding to each statistical item is constructed, the method further comprises the following steps:
and combining the same operator units in each operator tree to obtain an operator forest, wherein the root nodes of the operator forest comprise nodes corresponding to each statistical item.
Optionally, the determining module 720 is specifically configured to: aiming at a first root node, starting from the first root node, obtaining a calculation result of a first child node in an operator tree corresponding to the first root node in the operator forest by using a depth-first algorithm according to a calculation result of a second child node in the operator tree corresponding to at least one second root node which is calculated before and data elements of the second child node;
obtaining a data result of a statistical item corresponding to the first root node according to the calculation result of the first child node; the first root node is any one of the root nodes corresponding to the statistical items.
Optionally, the determining module 720 is specifically configured to: and placing the calculation result of the second child node in the operator tree corresponding to the at least one second root node which is calculated before and the data element of the second child node into a cache.
Optionally, the determining module 720 is specifically configured to: determining whether a second child node identical to the first child node exists in the second child node;
if yes, determining whether the data elements calculated by the second child node which are the same as the first child node are the same as the data elements calculated by the first child node;
and if so, taking the calculation result of the second child node which is the same as the first child node as the calculation result of the first child node.
Optionally, the generating module 730 is specifically configured to: and generating a report according to the data result corresponding to each statistical item and the report format parameter.
Optionally, the obtaining module 710 is specifically configured to: the calculation method for obtaining the statistical item comprises any one of the following steps: counting, summing, time conversion, sorting, set intersection and set union.
The apparatus of the embodiment of the present invention is configured to perform the method of any of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again. Fig. 6 illustrates a physical structure diagram of an electronic device, which may include: a processor (processor)810, a communication Interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication Interface 820 and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call logic instructions in the memory 830 to perform a report generation method comprising: obtaining at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data; determining a data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution sequence of the operator unit; and generating a report according to the data result corresponding to each statistical item.
In addition, the logic instructions in the memory 830 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer being capable of executing the report generation method provided by the above methods, the method including: obtaining at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data; determining a data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution sequence of the operator unit; and generating a report according to the data result corresponding to each statistical item.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the report generating method provided above, the method including: obtaining at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for expressing the calculation mode of the data; determining a data result corresponding to each statistical item according to the operator unit included in each statistical item and the execution sequence of the operator unit; and generating a report according to the data result corresponding to each statistical item.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. A report generation method is characterized by comprising the following steps:
obtaining at least one statistical item; the statistical term comprises at least one operator unit; the operator unit is used for representing the calculation mode of the data;
determining a data result corresponding to each statistical item according to an operator unit and an execution sequence of the operator unit included in each statistical item;
and generating a report according to the data result corresponding to each statistical item.
2. A report generation method according to claim 1, wherein said determining the data result corresponding to each of the statistical items according to the operator units included in each of the statistical items and the execution order of the operator units respectively comprises:
respectively constructing operator trees corresponding to the statistical items by the operator units in the statistical items according to the execution sequence of the operator units; the child nodes of the operator tree are the operator units, and the root nodes of the operator tree are the nodes corresponding to the statistical items;
and determining a data result corresponding to each statistical item according to the operator tree corresponding to each statistical item.
3. A report generation method according to claim 2, wherein after the construction of the operator tree corresponding to each statistical term, further comprising:
and combining the same operator units in each operator tree to obtain an operator forest, wherein the root nodes of the operator forest comprise the nodes corresponding to each statistical item.
4. A report generation method according to claim 3, wherein said determining a data result corresponding to each of said statistical terms according to the operator tree corresponding to each of said statistical terms comprises:
for a first root node, starting from the first root node, obtaining a calculation result of a first child node in an operator tree corresponding to the first root node in the operator forest by using a depth-first algorithm according to a calculation result of a second child node in the operator tree corresponding to at least one second root node which is calculated before and data elements of the second child node;
obtaining a data result of a statistical item corresponding to the first root node according to the calculation result of the first child node; the first root node is any one of the root nodes corresponding to the statistical items.
5. A report generation method according to claim 4, characterized in that said method further comprises:
and placing the calculation result of the second child node in the operator tree corresponding to the at least one second root node which is calculated before and the data element of the second child node into a cache.
6. A report generation method according to claim 4 or 5, wherein said obtaining a calculation result of a first child node in an operator tree corresponding to said first root node in said operator forest by using a depth-first algorithm comprises:
determining whether a second child node identical to the first child node exists in the second child node;
if yes, determining whether the data elements calculated by the second child node which are the same as the first child node are the same as the data elements calculated by the first child node;
and if so, taking the calculation result of the second child node which is the same as the first child node as the calculation result of the first child node.
7. A report generation method according to any of the claims 1-5, wherein said generating a report according to the data result corresponding to each of said statistical items comprises:
and generating the report according to the data result corresponding to each statistical item and the report format parameter.
8. A report generation method according to any of the claims 1-5, characterized in that said calculation means comprises any of the following:
counting, summing, time conversion, sorting, set intersection and set union.
9. A report generation apparatus, comprising:
the acquisition module is used for acquiring at least one statistical item; the statistical item comprises at least one operator unit; the operator unit is used for representing the calculation mode of the data;
the determining module is used for determining a data result corresponding to each statistical item according to the operator unit and the execution sequence of the operator unit included in each statistical item;
and the generating module is used for generating a report according to the data result corresponding to each statistical item.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the report generating method according to any of claims 1 to 8 when executing said program.
11. A non-transitory computer readable storage medium, having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the report generating method according to any of the claims 1 to 8.
12. A computer program product having stored thereon executable instructions, characterized in that the instructions, when executed by a processor, cause the processor to carry out the steps of the report generating method according to any of the claims 1 to 8.
CN202111613122.4A 2021-12-27 2021-12-27 Report generation method, device, equipment, storage medium and program product Pending CN114462365A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111613122.4A CN114462365A (en) 2021-12-27 2021-12-27 Report generation method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111613122.4A CN114462365A (en) 2021-12-27 2021-12-27 Report generation method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN114462365A true CN114462365A (en) 2022-05-10

Family

ID=81408560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111613122.4A Pending CN114462365A (en) 2021-12-27 2021-12-27 Report generation method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114462365A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709613A (en) * 2015-07-16 2017-05-24 中国科学院信息工程研究所 Risk assessment method suitable for industrial control system
CN106919712A (en) * 2017-03-10 2017-07-04 深圳市科脉技术股份有限公司 The data statistical approach and system of form
CN109635011A (en) * 2018-10-31 2019-04-16 北京辰森世纪科技股份有限公司 Multistage gauge outfit report processing method, device and equipment based on data service metadata
CN109815389A (en) * 2019-02-02 2019-05-28 北京三快在线科技有限公司 Using the node matching method, apparatus and computer equipment of regulation engine
CN110399534A (en) * 2019-07-31 2019-11-01 京信通信系统(中国)有限公司 Terminal capabilities report form generation method, device, equipment and storage medium
CN113568915A (en) * 2021-07-29 2021-10-29 中国工商银行股份有限公司 Report generation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106709613A (en) * 2015-07-16 2017-05-24 中国科学院信息工程研究所 Risk assessment method suitable for industrial control system
CN106919712A (en) * 2017-03-10 2017-07-04 深圳市科脉技术股份有限公司 The data statistical approach and system of form
CN109635011A (en) * 2018-10-31 2019-04-16 北京辰森世纪科技股份有限公司 Multistage gauge outfit report processing method, device and equipment based on data service metadata
CN109815389A (en) * 2019-02-02 2019-05-28 北京三快在线科技有限公司 Using the node matching method, apparatus and computer equipment of regulation engine
CN110399534A (en) * 2019-07-31 2019-11-01 京信通信系统(中国)有限公司 Terminal capabilities report form generation method, device, equipment and storage medium
CN113568915A (en) * 2021-07-29 2021-10-29 中国工商银行股份有限公司 Report generation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
乔中南;: "dBASEⅢ报表程序自动生成系统", 广西科学院学报, no. 01 *
翁志良, 张华, 张俊辉, 李昭, 丁玉章: "一种基于树结构的数据报表发布体系及实现", 计算机应用, no. 03 *

Similar Documents

Publication Publication Date Title
CN111917878B (en) Message processing method, device, equipment and storage medium
CN111726248A (en) Alarm root cause positioning method and device
CN110347888B (en) Order data processing method and device and storage medium
CN111241260A (en) Data processing method, device and equipment based on human-computer interaction and storage medium
CN115170048B (en) Workflow realization method, system and medium based on model and rule
CN112070416A (en) AI-based RPA process generation method, apparatus, device and medium
CN110888672B (en) Expression engine implementation method and system based on metadata architecture
CN111444158A (en) Long-short term user portrait generation method, device, equipment and readable storage medium
CN114462582A (en) Data processing method, device and equipment based on convolutional neural network model
CN110688539A (en) Model management system and method
CN113947468A (en) Data management method and platform
CN114091688A (en) Computing resource obtaining method and device, electronic equipment and storage medium
CN114462365A (en) Report generation method, device, equipment, storage medium and program product
CN110851173A (en) Report generation method and device
CN114091686B (en) Data processing method and device, electronic equipment and storage medium
US20220179862A1 (en) Optimizing breakeven points for enhancing system performance
CN115622862A (en) Computing power network system based on digital twins and computing power processing method
CN115018624A (en) Decision engine and method based on wind control strategy
CN111539529B (en) Event reasoning method and device
CN111159203B (en) Data association analysis method, platform, electronic equipment and storage medium
CN113626281A (en) Slow SQL statement tracking method and device, electronic equipment and storage medium
CN114118937A (en) Information recommendation method and device based on task, electronic equipment and storage medium
CN112070487A (en) AI-based RPA process generation method, apparatus, device and medium
CN117874211B (en) Intelligent question-answering method, system, medium and electronic equipment based on SAAS software
CN112597149B (en) Data table similarity determination method and device

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
CB02 Change of applicant information

Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant after: QAX Technology Group Inc.

Applicant after: Qianxin Wangshen information technology (Beijing) Co.,Ltd.

Address before: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant before: QAX Technology Group Inc.

Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc.

CB02 Change of applicant information