Report generation method, device, equipment and computer medium based on function analysis
By introducing a report generation method based on function analysis into the financial business platform, users can directly configure the function information of report cells, solving the problems of low and inflexible report generation efficiency in the existing technology, and achieving efficient and flexible report generation and update.
Patent Information
- Application Number
- CN202010478961.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-29
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2040-05-29
AI Technical Summary
The report generation method in the existing financial business platform needs to rely on the business calculation logic provided by developers' translation business personnel, resulting in high human communication costs, low efficiency, error-prone reporting systems, and cannot meet the requirements of real-time.
A report generation method based on function analysis is proposed. By outputting the configuration page associated with the report configuration request, users can configure the function information of each cell in the report, and parse these function information through the preset analysis engine to generate a report containing the running results.
It reduces the need for manpower communication, improves the efficiency and flexibility of report generation, and makes report updates more real-time, suitable for efficient and flexible reporting systems.
Smart Images

Figure CN111626028B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a report generation method, device, equipment and computer medium based on function analysis. Background Art
[0002] With the rapid development of Internet technology, especially Internet financial technology (Fintech), more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are being applied in the financial field.
[0003] There are more and more financial businesses, and each financial business has many business reports, such as tax return forms, business capital tables, etc. There are two forms of business reports in the current financial business platform. One type of business report is not associated with calculation functions and only stores fixed business data. This type of business report does not support flexible calculations. The other type of business report is associated with calculation functions, and data acquisition and data calculation are performed based on the calculation functions. Such data reports are more flexible. When the data source data changes, the table can be updated according to the technical function. However, development in the financial business platform is relatively troublesome. Specifically, business personnel give the calculation functions involved in the business report, and developers write fixed computer languages according to the technical formulas given by the business, and then generate them according to the computer language. Such a report generation method needs to rely on developers to translate the business calculation logic provided by business personnel. The human communication cost is high and the efficiency is low. The report is prone to errors and is not flexible enough. If the business calculation rules change, it is necessary to re-communicate and develop a new version and then iterate and update the version. This cannot meet the requirements of the reporting system with high real-time requirements. Summary of the invention
[0004] The main purpose of the present invention is to propose a report generation method, device, equipment and computer medium based on function analysis, aiming to solve the technical problems that the current report generation method needs to rely on developers to translate the business calculation logic provided by business personnel, the human communication cost is high and the efficiency is low, it is easy to make mistakes, and it is not flexible enough. If the business calculation rules change, the version needs to be iteratively updated, which cannot be met by the reporting system with high real-time requirements.
[0005] To achieve the above object, the present invention provides a report generation method based on function analysis, and the report generation method based on function analysis comprises the following steps:
[0006] When a report configuration request is received, a configuration page of a report associated with the report configuration request is output, so that a user can configure function information of each cell in the report on the configuration page;
[0007] Acquire function information configured based on the configuration page, and perform cyclic verification on configured cells according to the function information;
[0008] When the cell loop check passes, the function information is associated with the report and saved;
[0009] When it is detected that all the cells in the report are configured, the function information associated with the report is parsed by a preset parsing engine to generate a report containing the running results.
[0010] Optionally, when it is detected that all the cells in the report are configured, the step of parsing the function information associated with the report by a preset parsing engine to generate a report containing the running results includes:
[0011] When it is detected that all the cells in the report are configured, the function information of each cell in the report is obtained, and a directed graph is created according to the function information of each cell;
[0012] Traversing the directed graph, obtaining the priority of cells corresponding to each node in the directed graph, and sorting the cells from high to low according to their respective priorities to form a topological sequence;
[0013] The function information of each cell in the topological sequence is analyzed in sequence by a preset analysis engine, and calculation operations are performed to generate a report containing operation results.
[0014] Optionally, the step of sequentially parsing the function information of each cell in the topological sequence and performing calculation operations by a preset parsing engine to generate a report containing the operation results includes:
[0015] The function information of each cell in the topological sequence is analyzed in sequence by a preset analysis engine to obtain the number-taking function, common functions and four arithmetic operations in the operation information;
[0016] The initial value of the data acquisition function is obtained through a preset parsing engine, the initial value is processed according to the common function to obtain an intermediate value, the intermediate value is processed according to the four arithmetic operations, and a report containing the operation results is generated.
[0017] Optionally, the step of acquiring function information configured based on the configuration page and performing cyclic verification on configured cells according to the function information includes:
[0018] When it is detected that the function information of the cell in the report is configured based on the configuration page, acquiring the function information of the configured cell in the report;
[0019] Determine the dependency relationship of the configured cells according to the function information of the configured cells, and perform a cyclic check on the configured cells according to the dependency relationship.
[0020] Optionally, the step of determining the dependency of the configured cell according to the function information of the configured cell, and performing a cyclic check on the configured cell according to the dependency includes:
[0021] Determining the dependency relationship of the configured cells according to the function information of the configured cells;
[0022] Establish a directed graph according to the dependency relationship, obtain a starting node on each edge in the directed graph, and recursively trace back all dependent nodes associated with the starting node;
[0023] If the dependent node includes the start node, determining that the configured cell loop check in the report fails;
[0024] If the dependent node does not include the start node, it is determined that the loop check of the cells configured in the report has passed.
[0025] Optionally, after the step of acquiring function information configured based on the configuration page and performing cyclic verification on configured cells according to the function information, the method includes:
[0026] When the configured cell loop check in the report fails, a configuration error prompt is output.
[0027] Optionally, when it is detected that all the cells in the report are configured, after the step of parsing the function information associated with the report by a preset parsing engine to generate a report containing the running results, the step further includes:
[0028] Obtaining a report identifier of the report, and associating the running result with the report identifier and saving it in a preset database;
[0029] When receiving a report query request, obtaining a report identifier associated with the report query request;
[0030] The preset database is queried to obtain the running result corresponding to the report identifier, the running result is added to the report template corresponding to the report identifier, and a report is rendered and generated.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a report generation device based on function analysis, and the report generation device based on function analysis includes:
[0032] A request receiving module, configured to, upon receiving a report configuration request, output a configuration page of a report associated with the report configuration request, so that a user can configure data retrieval rules and operation rules for each cell in the report on the configuration page;
[0033] A loop verification module, configured to perform a loop verification on the configured cells in the report when detecting that function information of the cells in the report is configured based on the configuration page;
[0034] An information saving module, used for saving the function information of a cell configured in the report when the cell cyclic verification passes;
[0035] The parsing and generating module is used to parse the function information of each cell in the report according to the preset parsing rules when the operation information configuration of each cell in the report is completed, and generate a report containing the operation results.
[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a report generation device based on function analysis, and the report generation device based on function analysis includes: a memory, a processor, and a report generation program based on function analysis stored in the memory and executable on the processor, and when the report generation program based on function analysis is executed by the processor, the steps of the report generation method based on function analysis as described above are implemented.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer medium, on which a report generation program based on function analysis is stored, and when the report generation program based on function analysis is executed by a processor, the steps of the report generation method based on function analysis as described above are implemented.
[0038] The present invention provides a report generation method, device, equipment and computer medium based on function analysis. In the embodiment of the present invention, when receiving a report configuration request, the report generation device outputs a configuration page of a report associated with the report configuration request, so that the user can configure the function information of each cell in the report on the configuration page; that is, in the present embodiment, the business personnel can automatically configure the function information on the configuration page, and the report generation device obtains the function information configured based on the configuration page, and performs a cyclic check on the configured cells according to the function information; when the cell cyclic check passes, the report generation device determines that the function information configuration of the business personnel is correct, and the report generation device associates the function information with the report and saves it; when it is detected that all the cell configurations in the report are completed, the function information associated with the report is analyzed by a preset analysis engine, and a report containing the operation results is generated. In the embodiment of the present invention, the report is generated by analyzing the function information associated with the report by a preset analysis engine, and there is no need for developers and business personnel to communicate and connect, which reduces the waste of human resources. When the report is updated, the business personnel only need to configure the new function information on the configuration page to generate a new report. The technical solution of the embodiment of the present invention improves the efficiency and flexibility of report generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0040] Figure 2 It is a flowchart of the first embodiment of the report generation method based on function analysis of the present invention;
[0041] Figure 3 A schematic diagram of a specific scenario of creating a directed graph in the second embodiment of the report generation method based on function analysis of the present invention;
[0042] Figure 4 It is a functional module diagram of an embodiment of a report generation device based on function analysis of the present invention.
[0043] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0046] The report generation device based on function analysis in the embodiment of the present invention may be a PC or a server device.
[0047] like Figure 1 As shown, the report generation device based on function parsing may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0048] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0049] like Figure 1 As shown, the memory 1005 as a computer medium may include an operating system, a network communication module, a user interface module, and a report generation program based on function analysis.
[0050] exist Figure 1 In the device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the computer program corresponding to the function-analysis-based report generation stored in the memory 1005, and perform the operations in the following function-analysis-based report generation method.
[0051] Based on the above hardware structure, an embodiment of a report generation method based on function analysis of the present invention is proposed.
[0052] Reference Figure 2 , Figure 2 The flowchart of the first embodiment of the report generation method based on function analysis of the present invention is as follows. The report generation method based on function analysis in this embodiment includes:
[0053] Step S10: when a report configuration request is received, a configuration page of a report associated with the report configuration request is output, so that the user can configure function information of each cell in the report on the configuration page.
[0054] The report generation method based on function analysis in this embodiment is applied to a report generation device based on function analysis, also called a report generation device. The report generation device is a hardware carrier of a computer program corresponding to report generation based on function analysis. The report generation device is communicatively connected with data platforms of different financial institutions (including banking institutions, insurance institutions or securities institutions, etc.). The report generation device and the data platforms of financial institutions can realize data transmission. The report generation device can generate different types of reports based on data in the data platforms of different financial institutions.
[0055] The report generation device receives a report configuration request, and the triggering method of the report configuration request is not specifically limited, that is, the report configuration request can be actively triggered by the user, for example, the user outputs "report information" on the terminal to trigger the report configuration request; in addition, the report configuration request can also be automatically triggered by the report generation device, for example, the report generation device pre-sets the triggering condition of the report configuration request to automatically trigger when data update is detected, and the report generation device automatically triggers the report configuration request when data update is detected.
[0056] When the report generating device receives the report configuration request, the report generating device obtains the report identifier associated with the report configuration request (the report identifier refers to the identification information that uniquely identifies the report, such as the report name, report type, and report number), and the report generating device outputs the configuration page of the report associated with the report identifier, so that the user can configure the function information of each cell in the report on the configuration page, wherein the function information includes number-taking functions (the number-taking functions include the number-taking functions between reports and the number-taking functions within reports), commonly used functions (such as the If function, the MAX function, and the MIN function), four arithmetic operations functions (addition, subtraction, multiplication, and division functions), and other custom functions. The function types and calculation rules contained in the function information can be flexibly set according to business needs and are not specifically limited in this embodiment.
[0057] That is, in this embodiment, the report generation device generates configuration pages for different types of reports according to the report type, which facilitates the configuration of different types of reports. For example, the report generation device can configure tax return forms, corporate employee salary calculation forms, etc. This embodiment supports the configuration of different types of reports with function information, making the generated reports richer.
[0058] In this embodiment, the developer has developed a configuration page, and the configuration page supports defining the function information in each cell of the report, that is, the developer predefines the mapping rules between the cell coordinates in the report and the database storage, such as: the A3 coordinate cell in report 1, there will be a table of report 1 in the background, A will map a field name, 3 will correspond to a horizontal coordinate, and the user (also called business personnel) enters the configuration page corresponding to the report to be defined to set the function information. For example, the user enters the ledger report setting page to be defined, selects a cell, clicks the formula setting, and a formula setting drop-down box pops up. The page supports the selection of a series of built-in functions and the selection of addition, subtraction, multiplication and division functions. After the business selects a function, a pop-up box will provide a page to select other report cells. After selecting the cell, select the calculator to configure the four arithmetic functions. After saving, the calculation rules for this cell are set, and the function information of all cells of all ledger reports are set in turn.
[0059] In this embodiment, the generation of the report does not require the business personnel to communicate with the developers. The business personnel can directly configure the function information according to the draft formula in the configuration page. The report generation device can generate the report according to the function information set by the user in the configuration page. Specifically:
[0060] Step S20, obtaining function information configured based on the configuration page, and performing a cyclic check on the configured cells according to the function information.
[0061] When the report generating device detects that new function information is added in the configuration page, the report generating device obtains the function information of each cell in the report configured based on the configuration page, and the report generating device performs a loop check on the configured cells according to the function information, that is, the configuration information of the cell includes the four arithmetic operations configuration within the table, the four arithmetic operations configuration between tables, the number acquisition function, the summary function, etc. In order to avoid the existence of an infinite loop in each formula in the function information that cannot be parsed and calculated, the report generating device predefines an infinite loop check rule. The report generating device constructs a directed graph for all cells according to the function information of each cell. If the directed graph is not closed, the report generating device determines that the cell loop check has passed, and if the directed graph is closed, the report generating device determines that the cell loop check has failed.
[0062] In this embodiment, the report generation device predefines the circular verification rules of the function information. The report generation device constructs a directed graph according to the function information for circular verification to avoid the situation where the business personnel in the cell set the function information incorrectly, resulting in the inability to generate the report. In this embodiment, the report generation is more accurate.
[0063] Step S30, when the cell loop check passes, the function information is associated with the report and saved.
[0064] The report generation device predefines the mapping rules between the cell coordinates in the report and the database storage. The report generation device saves the function information of each cell into the database when the cell cycle check passes according to the mapping rules between the cell coordinates and the database storage set in the configuration page, so that the report generation device generates the report according to the function information configured by the user in the database, that is,
[0065] Step S40, when it is detected that all the cells in the report are configured, the function information associated with the report is parsed by a preset parsing engine to generate a report containing the running results.
[0066] When the report generating device completes the configuration of the function information in the cell of the report, the user can submit and save. When the report generating device receives the submit and save instruction, the report generating device detects that the configuration of all the cells in the report is completed, and the report generating device parses the function information associated with the report through a preset parsing engine (the preset parsing engine refers to a code tool with preset function information parsing rules and execution methods. For example, in this embodiment, the preset parsing engine can be ANTLR, which can be used to read, process, execute or translate structured text or binary files. ANTLR is widely used to build languages, tools and frameworks. ANTLR can generate a parser that can build and traverse a parsing tree from a grammatical perspective). The preset parsing engine obtains the number-taking function, the common function and the four arithmetic operation function in the function information. The report generating device obtains the source data according to the number-taking function, and the report generating device brings the source data into the cell for operation to generate a report containing the operation results.
[0067] In this embodiment, a configuration page is set, and the user can configure the function information of each cell in the report on the configuration page. When the report generation device detects that all the cell configurations in the report are completed, the function information associated with the report is parsed by the preset parsing engine to generate a report containing the running results. In the embodiment of the present invention, the function information associated with the report is parsed by the preset parsing engine to generate a report, and there is no need for developers and business personnel to communicate and connect, which reduces the waste of human resources. When the report is updated, the business personnel only need to configure the new function information on the configuration page to generate a new report. The technical solution of the embodiment of the present invention improves the efficiency and flexibility of report generation.
[0068] It can be understood that in this embodiment, when the function information in the configuration page is updated, the report generation device can generate reports based on the new function information, thereby improving the real-time performance of report updates. The report generation method based on function parsing in this embodiment is applied to financial institutions, making the reports generated by financial institutions more efficient and accurate.
[0069] Furthermore, based on the first embodiment of the report generation method based on function analysis of the present invention, a second embodiment of the report generation method based on function analysis of the present invention is proposed.
[0070] This embodiment is a refinement of step S40 in the first embodiment. This embodiment provides a specific implementation method of parsing function information associated with a report through a preset parsing engine to generate a report containing the running results, including:
[0071] When it is detected that all the cells in the report are configured, the function information of each cell in the report is obtained, and a directed graph is created according to the function information of each cell;
[0072] Traversing the directed graph, obtaining the priority of cells corresponding to each node in the directed graph, and sorting the cells from high to low according to their respective priorities to form a topological sequence;
[0073] The function information of each cell in the topological sequence is analyzed in sequence by a preset analysis engine, and calculation operations are performed to generate a report containing operation results.
[0074] That is, when the report generating device detects that all the cells in the report have been configured, the report generating device obtains the function information of each cell in the report, and the report generating device creates a directed graph according to the function information of each cell; the report generating device traverses the directed graph, and the report generating device uses the order of cells corresponding to each node in the directed graph as the priority of each cell in the report, and the report generating device sorts each cell in the report from high to low according to their respective priorities to form a topological sequence.
[0075] The report generating device parses the function information of each cell in the topological sequence in sequence and performs calculation operations through a preset analysis engine (the preset analysis engine is the same as that in the first embodiment and will not be described in detail in this embodiment) to generate a report containing the operation results. That is, the report generating device parses the function information of each cell in the topological sequence in sequence through a preset analysis engine to obtain the number-taking function, common functions and four arithmetic operations in the operation information; obtains the initial value of the number-taking function through the preset analysis engine, processes the initial value according to the common function to obtain the intermediate value, processes the intermediate value according to the four arithmetic operations, and generates a report containing the operation results.
[0076] For ease of understanding, examples are given in this embodiment, specifically:
[0077] The report generation device prioritizes all cells in the report according to the function information of the cells in the report, and compares all cells to nodes, and creates a directed graph through the nodes. The directed graph initialization will record all nodes and edges with in-degree 0; the topological sorting will be judged based on the traversal of nodes and edges with in-degree 0, and the result of the topological sequence will be returned after the traversal. Figure 3 As shown, Figure 3 This is a schematic diagram of a specific scenario of creating a directed graph in the second embodiment of the report generation method based on function analysis of the present invention. Figure 3The result of topological sorting is: 2->8->0->3->7->1->5->6->9->4->11->10->12. After the report generation device arranges the order, it is calculated using the parsing engine defined by antlr. The calculation rules are divided into number-taking functions, common functions, and four arithmetic operations. The calculation priority is number-taking functions->common functions->four arithmetic operations. The parsing calculation description is as follows: SELECT('number-taking table.E3', 'this period')+SELECT('number-taking table.B3', 'this period') / 0.17-IF(SELECT('number-taking table.B5', 'this period')>SELECT('number-taking table.C5', 'this period'), SELECT('number-taking table.B5', 'this period'), SELECT('number-taking table.C5', 'this period')). The first step is to obtain the values of all the data access functions and replace them, 58000+52000 / 0.17-IF(18000>86000,18000,86000); the second step is to execute the common function IF(18000>86000,18000,86000) with a value of 86000 and replace it. The result is 58000+52000 / 0.17-86000; the third step is to perform four arithmetic operations, and the result is 277882.35294117645.
[0078] In this embodiment, the report generation device creates a directed graph based on the function information of the cells in the report, determines the priority of the cells corresponding to each node according to the order of each node in the directed graph, and forms a topological sequence. The function information of each cell in the topological sequence is further parsed in turn through a preset parsing engine and calculation operations are performed to generate a report containing the operation results, thereby realizing flexible and efficient report generation.
[0079] Furthermore, based on the above-mentioned embodiment of the report generation method based on function analysis of the present invention, a third embodiment of the report generation method based on function analysis of the present invention is proposed.
[0080] This embodiment is a refinement of step S20 in the first embodiment. This embodiment provides a specific implementation method in which the report generating device obtains function information configured based on the configuration page and performs cyclic verification on the configured cells according to the function information, including:
[0081] When it is detected that the function information of the cell in the report is configured based on the configuration page, acquiring the function information of the configured cell in the report;
[0082] Determine the dependency relationship of the configured cells according to the function information of the configured cells, and perform a cyclic check on the configured cells according to the dependency relationship.
[0083] That is, when the report generating device detects that the function information of the cells in the report is configured based on the configuration page, the report generating device obtains the function information of the configured cells in the report, and the report generating device determines the dependency relationship of the configured cells according to the function information of the configured cells; a directed graph is established according to the dependency relationship, for example, the function information in the report generating device includes: the function information of the A1 cell includes a number-taking function: taking a number from the A2 cell, then there is a dependency relationship between the A1 cell and the A2 cell, the A1 cell is assigned a node, and the A2 cell is assigned a child node of the node corresponding to the A1 cell, and a directed graph is established, the report generating device obtains the starting node on each edge in the directed graph, and recursively traces back all dependent nodes associated with the starting node; for example, A1-A2-A3-A4-A1, if the dependent node includes the starting node, it is determined that the loop check of the configured cells in the report fails; if the dependent node does not include the starting node, it is determined that the loop check of the configured cells in the report passes.
[0084] For ease of understanding, examples are given in this embodiment, specifically:
[0085] The report generation device obtains the function information of all cells in the ledger report. The report generation device performs an infinite loop check on all configured cells based on the function information. An example of the loop check is as follows: TZ_0004_INST.JE2_1 = [TZ_0005_INST.JE1_1], TZ_0005_INST.JE1_1 = [TZ_0004_INST.JE2_1]; that is, the ledger report 4 cell JE2_1 depends on the ledger report 5 cell JE1_1, and vice versa, the ledger report 5 cell JE1_1 also depends on the ledger report 4 cell JE2_1.
[0086] In this embodiment, the report generation device performs the following loop verification logic:
[0087] a. Get the dependencies of all cells in the current ledger being operated (the background will be queried to get all the cell dependencies of TZ_0004_INST, the format is such as TZ_0004_INST.JE2_1=[TZ_0004_INST.JE1_1]);
[0088] b. After obtaining all dependencies, create a directed graph first. A directed graph includes nodes (nodes correspond to cells) and edges (edges correspond to function information). The graph created in the example is: TZ_0004_INST.JE2_1->TZ_0005_INST.JE1_1; TZ_0005_INST.JE1_1->TZ_0004_INST.JE2_1.
[0089] c. The report generation device determines whether there is a loop in the directed graph, that is, the report generation device obtains the existing loop node. The algorithm is based on traversing each edge of the graph in turn, taking the starting node, taking out the endNode node corresponding to the edge, and recursively taking all dependent nodes. If the dependent node includes the StartNode node of this edge, there is a loop, and the current node is put into the set collection. After the traversal is completed, it is returned. If the set collection has no value, there is no infinite loop, otherwise there is an infinite loop. In the example, the endNode node of TZ_0004_INST.JE2_1 of the edge TZ_0004_INST.JE2_1->TZ_0005_INST.JE1_1 depends on the edge [TZ_0005_INST.JE1_1,TZ_0004_INST.JE2_1], which includes TZ_0004_INST.JE2_1. Therefore, TZ_0004_INST.JE2_1 is an infinite loop node, so it is prompted that TZ_0004_INST.JE2_1 has a loop.
[0090] In this embodiment, the report generation device determines the dependency relationship between each cell in the report according to the function information, and then creates a directed graph according to the dependency relationship between the cells, and performs a circular check according to the directed graph, which can effectively avoid cell configuration errors, thereby improving the accuracy of the report. In addition, in this embodiment, developers do not need to understand the business logic, and business personnel do not need to communicate with developers. Business personnel can directly configure the cells of the report to achieve accurate generation of the report, making report generation more convenient.
[0091] Furthermore, based on the above-mentioned embodiment of the report generation method based on function analysis of the present invention, a fourth embodiment of the report generation method based on function analysis of the present invention is proposed.
[0092] This embodiment is the step after step S20 in the first embodiment. The difference between this embodiment and the above embodiment is that:
[0093] When the configured cell loop check in the report fails, a configuration error prompt is output.
[0094] In this embodiment, when the configured cell loop check in the report fails, the report generating device outputs a prompt of configuration error. In this embodiment, the report generating device performs real-time check according to the function information configured by the business personnel, which can ensure that the business personnel configure the correct function information.
[0095] Furthermore, based on the above-mentioned embodiment of the report generation method based on function analysis of the present invention, a fourth embodiment of the report generation method based on function analysis of the present invention is proposed.
[0096] This embodiment is the step after step S40 in the first embodiment. The difference between this embodiment and the above embodiment is that:
[0097] Obtaining a report identifier of the report, and associating the running result with the report identifier and saving it in a preset database;
[0098] When receiving a report query request, obtaining a report identifier associated with the report query request;
[0099] The preset database is queried to obtain the running result corresponding to the report identifier, the running result is added to the report template corresponding to the report identifier, and a report is rendered and generated.
[0100] When the report generating device completes the configuration of the function information of all cells in the report, the report generating device obtains the report identifier of the report (the report identifier refers to the pre-set report identifier information, such as the report number), and the report generating device associates the running result with the report identifier and saves it in a preset database (the preset database refers to a pre-set database for saving function information, running results and report identifier); when the report generating device receives a report query request, the report generating device obtains the report identifier associated with the report query request; the report generating device queries the preset database, the report generating device obtains the running result corresponding to the report identifier in the preset database, adds the running result to the report template corresponding to the report identifier, and renders and generates the report.
[0101] In this embodiment, the report generation device associates and saves the running results and the report identifier. When the user queries the report, he only needs to enter the report identifier. The report generation device can quickly query the running node corresponding to the report identifier, add the running results to the report template corresponding to the report identifier, and render and generate the report. There is no need to repeatedly run the function information, which improves the query efficiency and output efficiency of the report.
[0102] It can be understood that in this embodiment, if the function information in the report is updated, or the source data related to the report is updated, the report generation device quickly executes the steps of the first embodiment to facilitate timely updating of the report.
[0103] Reference Figure 4 The embodiment of the present invention provides a report generation device based on function analysis, and the report generation device based on function analysis includes:
[0104] The request receiving module 10 is used to output a configuration page of a report associated with the report configuration request when receiving the report configuration request, so that the user can configure the data retrieval rules and operation rules of each cell in the report in the configuration page;
[0105] A loop check module 20, configured to perform a loop check on the configured cells in the report when function information of the cells in the report is detected based on the configuration page;
[0106] The information saving module 30 is used to save the function information of the cell when the cell configured in the report passes the cyclic verification;
[0107] The parsing and generating module 40 is used to parse the function information of each cell in the report according to a preset parsing rule when the operation information of each cell in the report is configured, and generate a report containing the operation result.
[0108] In one embodiment, the analysis generation module 40 includes:
[0109] A creation submodule is used to obtain function information of each cell in the report when it is detected that all the cells in the report are configured, and to create a directed graph according to the function information of each cell;
[0110] A traversal and sorting submodule is used to traverse the directed graph, obtain the priority of the cells corresponding to each node in the directed graph, and sort the cells from high to low according to their respective priorities to form a topological sequence;
[0111] The parsing and executing submodule is used to parse the function information of each cell in the topological sequence in sequence through a preset parsing engine and perform calculation operations to generate a report containing the operation results.
[0112] In one embodiment, the parsing execution submodule includes:
[0113] A parsing and obtaining unit, used to parse the function information of each cell in the topological sequence in sequence through a preset parsing engine, and obtain the number-taking function, common functions and four arithmetic operations in the operation information;
[0114] The parsing execution unit is used to obtain the initial value of the number-taking function through a preset parsing engine, process the initial value according to the common function to obtain an intermediate value, process the intermediate value according to the four arithmetic operations, and generate a report containing the running results.
[0115] In one embodiment, the cyclic verification module includes:
[0116] A receiving and obtaining submodule, configured to obtain the function information of the configured cells in the report when detecting that the function information of the cells in the report is configured based on the configuration page;
[0117] The cyclic check submodule is used to determine the dependency relationship of the configured cells according to the function information of the configured cells, and perform cyclic check on the configured cells according to the dependency relationship.
[0118] In one embodiment, the cyclic check submodule includes:
[0119] A relationship determination unit, configured to determine the dependency relationship of the configured cells according to the function information of the configured cells;
[0120] A node tracing unit is used to establish a directed graph according to the dependency relationship, obtain a starting node on each edge in the directed graph, and recursively trace all dependent nodes associated with the starting node;
[0121] A first determination unit, configured to determine that a loop check of cells configured in the report fails if the dependent node includes the start node;
[0122] The second determination unit is configured to determine whether the loop check of the cells configured in the report has passed if the dependent node does not include the start node.
[0123] In one embodiment, the report generation device based on function analysis includes:
[0124] The error prompt module is used to output a configuration error prompt when the configured cell loop check in the report fails.
[0125] In one embodiment, the report generation device based on function analysis includes:
[0126] An acquisition and saving module is used to acquire a report identifier of the report, and associate the operation result with the report identifier and save it in a preset database;
[0127] A request receiving module, configured to obtain a report identifier associated with a report query request upon receiving the report query request;
[0128] The query rendering module is used to query the preset database, obtain the running result corresponding to the report identifier, add the running result to the report template corresponding to the report identifier, and render and generate a report.
[0129] The methods implemented when the modules in the report generation device based on function analysis in this embodiment are executed can refer to the various embodiments of the report generation method based on function analysis of the present invention, which will not be described in detail here.
[0130] In the embodiment of the present invention, when a report generation device receives a report configuration request, it outputs a configuration page of a report associated with the report configuration request, so that the user can configure the function information of each cell in the report on the configuration page; that is, in this embodiment, the business personnel can automatically configure the function information on the configuration page, and the report generation device obtains the function information configured based on the configuration page, and performs a cyclic check on the configured cells according to the function information; when the cell cyclic check passes, the report generation device determines that the business personnel's function information configuration is correct, and the report generation device associates the function information with the report and saves it; when it is detected that the configuration of all cells in the report is completed, the function information associated with the report is parsed by a preset parsing engine to generate a report containing the running results.
[0131] In the embodiment of the present invention, a report is generated by parsing the function information associated with the report through a preset parsing engine. There is no need for communication between developers and business personnel, which reduces the waste of human resources. When the report is updated, the business personnel only need to configure the new function information on the configuration page to generate a new report. The technical solution of the embodiment of the present invention improves the efficiency and flexibility of report generation.
[0132] An embodiment of the present invention further provides a computer medium.
[0133] The computer medium of the present invention stores a report generation program based on function analysis, and when the report generation program based on function analysis is executed by a processor, the steps of the report generation method based on function analysis as described above are implemented.
[0134] The method implemented when the report generation program based on function analysis running on the processor is executed can refer to the various embodiments of the report generation method based on function analysis of the present invention, which will not be described in detail here.
[0135] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0136] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0138] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A report generation method based on function analysis, It is characterized in that The report generation method based on function analysis includes the following steps: When a report configuration request is received, a configuration page of a report associated with the report configuration request is output, so that a user can configure function information of each cell in the report on the configuration page; Acquire function information configured based on the configuration page, and perform cyclic verification on configured cells according to the function information; When the cell loop check passes, the function information is associated with the report and saved; When it is detected that all the cells in the report are configured, the function information of each cell in the report is obtained, and a directed graph is created according to the function information of each cell; Traversing the directed graph, obtaining the priority of cells corresponding to each node in the directed graph, and sorting the cells from high to low according to their respective priorities to form a topological sequence; The function information of each cell in the topological sequence is analyzed in sequence by a preset analysis engine, and calculation operations are performed to generate a report containing operation results.
2. The report generation method based on function analysis as claimed in claim 1, It is characterized in that The step of sequentially parsing the function information of each cell in the topological sequence and performing calculation operations by a preset parsing engine to generate a report containing the operation results includes: The function information of each cell in the topological sequence is analyzed in sequence by a preset analysis engine to obtain the data acquisition function, common functions and four arithmetic operations in the operation information; The initial value of the data acquisition function is obtained through a preset parsing engine, the initial value is processed according to the common function to obtain an intermediate value, the intermediate value is processed according to the four arithmetic operations, and a report containing the operation results is generated.
3. The report generation method based on function analysis as claimed in claim 1, It is characterized in that The step of obtaining function information configured based on the configuration page and performing cyclic verification on configured cells according to the function information includes: When it is detected that the function information of the cell in the report is configured based on the configuration page, acquiring the function information of the configured cell in the report; Determine the dependency relationship of the configured cells according to the function information of the configured cells, and perform a cyclic check on the configured cells according to the dependency relationship.
4. The report generation method based on function analysis as claimed in claim 3, It is characterized in that The step of determining the dependency of the configured cells according to the function information of the configured cells, and performing a cyclic check on the configured cells according to the dependency, comprises: Determining the dependency relationship of the configured cells according to the function information of the configured cells; Establish a directed graph according to the dependency relationship, obtain a starting node on each edge in the directed graph, and recursively trace back all dependent nodes associated with the starting node; If the dependent node includes the start node, determining that the configured cell loop check in the report fails; If the dependent node does not include the start node, it is determined that the loop check of the cells configured in the report has passed.
5. The report generation method based on function analysis as claimed in claim 1, It is characterized in that After the step of obtaining function information configured based on the configuration page and performing cyclic verification on configured cells according to the function information, the method includes: When the configured cell loop check in the report fails, a configuration error prompt is output.
6. The report generation method based on function analysis according to any one of claims 1 to 5, It is characterized in that After the step of parsing the function information associated with the report by a preset parsing engine to generate a report containing the running results when it is detected that all the cells in the report are configured, the method further includes: Obtaining a report identifier of the report, and associating the running result with the report identifier and saving it in a preset database; When receiving a report query request, obtaining a report identifier associated with the report query request; The preset database is queried to obtain the running result corresponding to the report identifier, the running result is added to the report template corresponding to the report identifier, and a report is rendered and generated.
7. A report generation device based on function analysis, It is characterized in that The report generation device based on function analysis includes: A request receiving module, configured to, upon receiving a report configuration request, output a configuration page of a report associated with the report configuration request, so that a user can configure data retrieval rules and operation rules for each cell in the report on the configuration page; A loop verification module, configured to perform a loop verification on the configured cells in the report when detecting that function information of the cells in the report is configured based on the configuration page; An information saving module, used for saving the function information of a cell configured in the report when the cell cyclic verification passes; The parsing and generating module is used to obtain the function information of each cell in the report when it is detected that all the cell configurations in the report are completed, and create a directed graph according to the function information of each cell; traverse the directed graph to obtain the priority of the cell corresponding to each node in the directed graph, and sort the cells from high to low according to their respective priorities to form a topological sequence; parse the function information of each cell in the topological sequence in turn through a preset parsing engine and perform calculation operations to generate a report containing the operation results.
8. A report generation device based on function analysis, It is characterized in that The report generation device based on function analysis includes: a memory, a processor, and a report generation program based on function analysis stored in the memory and executable on the processor; When the report generation program based on function analysis is executed by the processor, the steps of the report generation method based on function analysis as claimed in any one of claims 1 to 6 are implemented.
9. A computer medium, It is characterized in that The computer medium stores a report generation program based on function analysis; When the report generation program based on function analysis is executed by a processor, the steps of the report generation method based on function analysis as claimed in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Effective complex report parsing engine and parsing method thereof
CN103019728A