Generation method and device of general report, electronic equipment and storage medium
By analyzing report requirements and judging the source of indicator numbers, the integration of numbers from indicator pools and models is achieved, and the problems of data quality and maintenance difficulties in the existing technology are solved, and the efficiency and quality of report generation are improved.
Patent Information
- Application Number
- CN202311226974.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-03-21
AI Technical Summary
In the processing of massive data in the prior art, the data dimensions are incomplete, the inability to respond to urgent needs in a timely manner, the data source is complex, and blood-coordinated, resulting in difficult data quality and maintenance.
Provide a general report generation method. By analyzing report requirements, we judge the source of the number of indicators one by one, and decide to extract data from the indicator pool or model to ensure data quality, timeliness and completeness of blood combedding.
The integration of two methods of taking numbers from indicator pools and models is realized, which improves the data quality, timeliness and efficiency of report generation and simplifies data maintenance.
Smart Images

Figure CN119669368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, electronic device and computer-readable storage medium for generating a general report. Background Art
[0002] At present, data warehouse systems are usually used to process massive amounts of data. First, the data is cleaned and stored in the data warehouse, and then the dimensions are aggregated, associated, and subject domains are constructed according to the business. Then, the data is precipitated into corresponding indicators, and the final data is extracted using visualization tools to generate the required reports.
[0003] In the report development process, the lineage path of the final data is particularly important, which is related to the quality and authenticity of the entire report. For the existing data extraction solutions required for reports, one is to directly extract data from the indicator pool (Data Mart, DM). The data in the indicator pool comes from the direct processing and calculation of the model, and then a light processing is performed to obtain the data required for the report; the second is to directly extract data from the model, and manually write structured query language instructions (i.e. SQL instructions) to process the data and obtain the data required for the report.
[0004] However, when processing massive amounts of data, there are the following problems when directly extracting data from the indicator pool or directly extracting data from the model:
[0005] (1) If data is directly taken from the indicator pool, the data dimension in the indicator pool is incomplete; and
[0006] The data output period in the indicator pool is fixed, and if there is an urgent need, it cannot be responded to in time;
[0007] (2) If data is directly extracted from the model, the data source is too complex and the SQL command compilation is too cumbersome. In addition, it is difficult to sort out the data lineage, and the business is more complicated, which does not conform to the data governance principles.
[0008] (3) There is no clear stipulation that data should come from an indicator pool or model, which leads to inconsistent data collection methods by individuals or teams, making subsequent data maintenance difficult. Summary of the invention
[0009] The technical problem to be solved by the present invention is to address the above-mentioned deficiencies in the prior art and to provide a method, device, electronic device and computer-readable storage medium for generating a general report. The method can realize the integration of two methods: obtaining data from an indicator pool and obtaining data from a model, thereby ensuring the data quality, timeliness and completeness of the bloodline combing of the generated report and improving the efficiency of report generation.
[0010] In a first aspect, the present invention provides a method for generating a general report, comprising: in response to receiving a new report requirement, analyzing the report requirement to obtain a set of indicators required for the report; determining the data source of each indicator in the set of indicators required for the report one by one; extracting indicator data corresponding to each indicator according to the data source of each indicator; and summarizing the indicator data corresponding to each indicator in the set of indicators required for the report to generate a report.
[0011] Preferably, the step of determining one by one the data source of each indicator in the set of indicators required for the report specifically includes: determining one by one whether the ith indicator in the set of indicators required for the report needs to meet the high timeliness requirement, wherein i=1, 2, ..., N, and N is the number of indicators in the set of indicators required for the report; if the high timeliness requirement needs to be met, determining the data source of the ith indicator as the model; if the high timeliness requirement does not need to be met, determining the data source of the ith indicator according to the target account period and report development requirements.
[0012] Preferably, determining the data source of the i-th indicator according to the target account period and report development requirements specifically includes: judging whether there is target account period indicator data in the indicator pool; if there is target account period indicator data, judging whether the data quality of the target account period indicator data in the indicator pool meets the report development requirements, if it meets the report development requirements, determining the data source of the i-th indicator to be the indicator pool; if it does not meet the report development requirements, determining the data source of the i-th indicator to be the model; if there is no target account period indicator data, determining the data source of the i-th indicator to be the model.
[0013] Preferably, the indicator data corresponding to each indicator is extracted respectively according to the data source of each indicator, specifically including: if the data source of the ith indicator is the model, the indicator data corresponding to the ith indicator is extracted from the model; if the data source of the ith indicator is the indicator pool, the indicator data corresponding to the ith indicator is extracted from the indicator pool.
[0014] Preferably, before determining the data source of the i-th indicator according to the target account period and report development requirements if high timeliness requirements do not need to be met, the method for generating a general report further includes: obtaining the target account period and report development requirements according to report requirement analysis.
[0015] Preferably, the model is a model layer of a data warehouse, and the model is used to organize data according to defined fact tables, dimension tables and association relationships to support query, analysis and decision-making, wherein the model layer includes: a data warehouse derived summary data layer and a data warehouse detail data layer; the indicator pool is a data mart layer of a data warehouse, and is used to centrally store indicators or metrics related to the business. The indicator data in the indicator pool is derived from the model. When the wide table of the model layer has all the required indicators, the indicator data is processed and stored in the indicator pool.
[0016] In a second aspect, the present invention also provides a general report generation device, including: an analysis module, a judgment module, an extraction module and a generation module. The analysis module is used to respond to the receipt of a new report requirement and analyze the report requirement to obtain a set of indicators required for the report. The judgment module is connected to the analysis module and is used to judge the data source of each indicator in the set of indicators required for the report one by one. The extraction module is connected to the judgment module and is used to extract the indicator data corresponding to each indicator according to the data source of each indicator. The generation module is connected to the extraction module and is used to summarize the indicator data corresponding to each indicator in the set of indicators required for the report to generate a report.
[0017] Preferably, the judgment module comprises: a first judgment unit and a second judgment unit.
[0018] The first judgment unit is used to judge whether the i-th indicator in the indicator set required for the report needs to meet the high timeliness requirement, where i = 1, 2, ..., N, N is the number of indicators in the indicator set required for the report. The second judgment unit is connected to the first judgment unit and is used to determine the data source of the i-th indicator according to the target account period and report development requirements.
[0019] In a third aspect, the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for generating a general report provided in the first aspect.
[0020] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a general report provided in the first aspect above is implemented.
[0021] The invention provides a method, device, electronic device and computer-readable storage medium for generating a general report, which determines the data source of the indicators one by one to meet the requirements of complete extraction of indicator data. Therefore, the invention can realize the integration of the two methods of extracting data from the indicator pool and extracting data from the model, ensure the data quality, timeliness and completeness of the lineage combing of the generated report, and improve the efficiency of report generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a flowchart of a method for generating a general report according to Embodiment 1 of the present invention;
[0023] Figure 2 This is a flow chart of a method for generating a general report according to Embodiment 2 of the present invention;
[0024] Figure 3 This is a flow chart of a method for generating a general report according to Embodiment 3 of the present invention;
[0025] Figure 4This is a schematic diagram of the structure of a general report generation device in Example 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0027] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.
[0028] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.
[0029] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.
[0030] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.
[0031] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.
[0032] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.
[0033] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.
[0034] Embodiment 1:
[0035] This embodiment provides a method for generating a general report. Figure 1 As shown, the method for generating a general report includes:
[0036] Step S101, in response to receiving a new report requirement, analyzing the report requirement to obtain a set of indicators required for the report.
[0037] In this embodiment, each report consists of several indicators, as shown in Table 1. When a new report requirement is received, the indicators required for the report are analyzed, the number of indicator types is N, and a total number of N required indicator sets for the report is obtained.
[0038] Table 1 Examples of reports and indicators
[0039]
[0040] Step S102, determining the data source of each indicator in the indicator set required for the report one by one.
[0041] Specifically, step S102: determining the data source of each indicator in the indicator set required for the report one by one, including steps S1021 to S1023:
[0042] Step S1021 , determining one by one whether the i-th indicator in the indicator set required for the report needs to meet the high timeliness requirement, where i=1, 2, ..., N, where N is the number of indicators in the indicator set required for the report.
[0043] Step S1022: If high timeliness requirement needs to be met, the data source of the i-th indicator is determined to be the model.
[0044] Step S1023, if it is not necessary to meet the high timeliness requirement, the data source of the i-th indicator is determined according to the target account period and report development requirements.
[0045] Specifically, the model is the model layer of the data warehouse, and the model is used to organize data according to the definition of fact tables, dimension tables and association relationships to support query, analysis and decision-making. The model layer includes: the data warehouse derived summary data layer and the data warehouse detail data layer; the indicator pool is the data mart layer of the data warehouse, which is used to centrally store business-related indicators or metrics. The indicator data in the indicator pool comes from the model. When the wide table of the model layer has all the required indicators, the indicator data is processed and stored in the indicator pool.
[0046] In this embodiment, the logical architecture status of the indicator pool and the model layer is shown in Table 2. In the five-layer system of the data warehouse, the DWA (data warehouse aggregate data, data warehouse derived summary data layer) and DWD (data warehouse detail data, data warehouse detail data layer) layers are collectively referred to as the model layer, and the indicator pool is part of the DM (Data Mart) layer. The data in the indicator pool comes from the model, but because the data in the indicator pool comes from the wide table of the model layer, all the indicators required by the wide table must be available before all the indicator data of the wide table will be generated in the indicator pool. However, the development requirements of the report are usually not based on the account period. For example, the report generation time is required to be 2022-8-1, but the data in the indicator pool is only available on the 3rd of each month (the last update of the indicator data in the indicator pool is 2022-8-3). If there is no method in this embodiment, the report generated on 2022-8-1 will be shelved, causing a delay in the development progress. Therefore, the report indicators generated on 2022-8-1 need to meet high timeliness requirements, but the indicator pool cannot have report indicator data generated on 2022-8-1, so we can only extract data from the model. The data in the model are all detailed data with the finest time granularity, so they will definitely meet high timeliness requirements.
[0047] Table 2 Logical architecture status of indicator pool and model layer
[0048]
[0049]
[0050] Optionally, in step S1023: if high timeliness requirements do not need to be met, before determining the data source for the i-th indicator according to the target account period and report development requirements, the general report generation method further includes: obtaining the target account period and report development requirements according to report requirement analysis.
[0051] Specifically, step S1023: if there is no need to meet the high timeliness requirement, the data source of the i-th indicator is determined according to the target account period and report development requirements, including: judging whether the indicator pool has target account period indicator data; if there is target account period indicator data, judging whether the data quality of the target account period indicator data in the indicator pool meets the report development requirements; if it meets the report development requirements, determining the data source of the i-th indicator to be the indicator pool; if it does not meet the report development requirements, determining the data source of the i-th indicator to be the model; if there is no target account period indicator data, determining the data source of the i-th indicator to be the model.
[0052] In this embodiment, the data in the indicator pool cannot fully meet the report development requirements. For example, when the report requirement is to develop a "points analysis report", where the target account period is within three days, the report development requirement is to use the indicator data of the "newly added points" of City C, Province A. When extracting the corresponding indicator data of "newly added points within three days" from the indicator pool, it will be found that for some reason, the corresponding indicator of "newly added points within three days" in the indicator pool does not include the new points of all cities. The corresponding indicator data of "newly added points within three days" in the indicator pool may only have City A, Province A, and City B, Province A, and may not have the "newly added points" of City C, Province A. At this time, it is determined that the current indicator data is insufficient to support the demand, that is, the quality of the current indicator data does not meet the report development requirements. If the report development requirements are replaced with the indicator data that requires the use of the "newly added points" of City A, Province A, then it is determined that the current indicator data is sufficient to support the demand, that is, the quality of the current indicator data meets the report development requirements. This embodiment mainly verifies data quality by writing SQL scripts or configuring data audit nodes. According to the method of extracting data from the indicator pool in the prior art, it is necessary to wait for the indicator pool to be processed and have the data of c cities before the indicator data that meets the report development requirements can be extracted for generating reports. However, if the method of this embodiment is used, the c city data in the model is extracted in advance, so as to obtain the required complete data (that is, the indicator data whose data quality meets the report development requirements), which greatly saves development time. In addition, when the actual situation such as the fluctuation or caliber of the indicator data exceeds the threshold, it is also determined that the data quality of the indicator data does not meet the report development requirements. For example, the demand is the number of newly added points in City A, Province A. Even if the data already exists in the indicator pool at this time, the caliber of the indicator data (equivalent to the number of newly added points in City A, Province A) does not meet the latest caliber required by the party proposing the demand report. At this time, it is also determined that the data quality of the indicator data (equivalent to the number of newly added points in City A, Province A) does not meet the development requirements.
[0053] Step S103, extracting the indicator data corresponding to each indicator according to the data acquisition source of each indicator.
[0054] Specifically, step S103: extracting the indicator data corresponding to each indicator according to the data source of each indicator, including steps S1031 and S1032:
[0055] Step S1031, if the data source of the i-th indicator is the model, then extract the indicator data corresponding to the i-th indicator from the model.
[0056] Step S1032: if the data source of the i-th indicator is the indicator pool, then the indicator data corresponding to the i-th indicator is extracted from the indicator pool.
[0057] Step S104, summarizing the indicator data corresponding to each indicator in the indicator set required for the report to generate a report.
[0058] In this embodiment, by determining the data source of each indicator one by one, each type of indicator has its own data source, so extracting data for each indicator separately can greatly improve the integrity of the extracted indicator data. This embodiment abandons the previous practice of taking all indicators from the same data path, and integrates two data sources (indicator pool and model layer), so that the efficiency of report generation is greatly improved.
[0059] This embodiment provides a method for generating a general report. By determining the data source of the indicators one by one, the completeness extraction of indicator data can be satisfied with different requirements. This method integrates the two methods of extracting data from the indicator pool and extracting data from the model, thereby ensuring the data quality, timeliness and completeness of the lineage combing of the generated reports and improving the efficiency of report generation.
[0060] Embodiment 2:
[0061] This embodiment provides a method for generating a general report, such as Figure 2 As shown, the method for generating a general report includes:
[0062] S1. Receive new report development requirements.
[0063] S2. Indicators required for analysis report (the total number is N).
[0064] In this embodiment, when the general report generation device receives a new report requirement, it analyzes the indicators required for the report, the number of indicator types is N, and obtains a total of N sets of indicators required for the report.
[0065] S3. Determine whether the i-th (initial value of i is 1) category indicator needs to meet the high timeliness requirement.
[0066] S4. If this indicator needs to meet high timeliness requirements, and the latest account period data of this indicator has not been processed and landed in the indicator pool, you should directly write a SQL script to actively extract data from the model.
[0067] In this embodiment, the data in the indicator pool is derived from the model, but because the data in the indicator pool is derived from the wide table at the model layer, all the indicators required for the wide table must be available before all the indicator data of the wide table can be generated in the indicator pool. However, the report development requirements are usually not based on the account period. For example, the report generation time is required to be 2022-8-1, but the data in the indicator pool is only available on the 3rd of each month (the last update of the indicator data in the indicator pool is 2022-8-3). Without the method of this embodiment, the report generated on 2022-8-1 will be shelved, causing the development progress to be delayed. Therefore, the report indicators with a generation time of 2022-8-1 need to meet the high timeliness requirements, but the indicator pool cannot have the report indicator data with a generation time of 2022-8-1, and can only be extracted from the model. The data in the model are all detailed data with the finest time granularity, so they must be able to meet the high timeliness requirements.
[0068] E. If this indicator does not require high timeliness, you can check in the indicator pool whether the account period required for the report development needs is available.
[0069] F. If it is confirmed that the indicator account period is available, you can further verify whether the indicator data quality meets the requirements of this report development by writing SQL scripts or configuring data audit nodes. If the indicator data quality meets the requirements of this report development, it proves that the indicator can directly obtain data from the indicator pool; if the indicator data quality does not meet the requirements of this report development, you also need to rewrite the SQL script to obtain data from the model.
[0070] In this embodiment, the data in the indicator pool cannot fully meet the requirements for report development. For example, when the report requirement is to develop an "Analysis Report on Points Situation", where the target accounting period is within three days, the report development requirement is to use the indicator data of "New Points Added" in City c of Province A. When extracting the corresponding indicator data of "New Points Added within Three Days" from the indicator pool, it is found that for some reason, the corresponding indicator of "New Points Added within Three Days" in the indicator pool does not include the new points added in all cities. The corresponding indicator data of "New Points Added within Three Days" in the indicator pool may only have the new points added in City a and City b of Province A, and may exactly not have the "New Points Added" in City c of Province A. At this time, it is determined that the current indicator data is not sufficient to support the requirement, that is, the quality of the current indicator data does not meet the report development requirement. If the report development requirement is replaced by the indicator data of "New Points Added" in City a of Province A, at this time, it is determined that the current indicator data is sufficient to support the requirement, that is, the quality of the current indicator data meets the report development requirement. This embodiment mainly uses the method of writing SQL scripts or configuring data auditing nodes to verify data quality. According to the method of simply fetching data from the indicator pool in the prior art, it is necessary to wait for the indicator pool to be processed and have the data of City c before extracting the indicator data that meets the report development requirement for generating reports. However, if the method of this embodiment is used to extract the data of City c in the model in advance, so as to obtain the required complete data (that is, the indicator data with data quality meeting the report development requirement), the development time can be greatly saved. In addition, when the actual situation such as the fluctuation or caliber of the indicator data exceeds the threshold, it is also determined that the data quality of the indicator data does not meet the report development requirement. For example, the requirement is the new points added in City a of Province A. Even if the data already exists in the indicator pool at this time, but the caliber of the indicator data (equivalent to the new points added in City a of Province A) does not meet the latest caliber required by the requester of the required report, at this time, it is also determined that the data quality of the indicator data (equivalent to the new points added in City a of Province A) does not meet the development requirement.
[0071] S5. If the accounting period of the indicator does not exist, the idea of "fetching data from the indicator pool" should be abandoned and instead "fetching data from the model" should be adopted.
[0072] S6. Thus, the data fetching for such indicators is completed.
[0073] S7. Determine whether all the data for the report indicators has been fetched (i < N)? If not, then i = i + 1 and return to step 2; if all the data has been fetched, then the N types of indicators are jointly used to form a new report.
[0074] In this embodiment, by judging the data fetching sources of each indicator one by one, each type of indicator has its own data source. Therefore, by extracting data for each indicator separately, the integrity of the extracted indicator data can be greatly improved. This embodiment abandons the previous practice of all indicators being fetched from the same data path, combines two data sources (the indicator pool and the model layer), and greatly improves the report generation efficiency.
[0075] This embodiment provides a method for generating a general report. By determining the data source of the indicators one by one, the completeness extraction of indicator data can be satisfied with different requirements. This method integrates the two methods of extracting data from the indicator pool and extracting data from the model, thereby ensuring the data quality, timeliness and completeness of the lineage combing of the generated reports and improving the efficiency of report generation.
[0076] Embodiment 3:
[0077] This embodiment provides a method for generating a general report, such as Figure 3 As shown, the method for generating a general report includes:
[0078] s1. Start developing new reports.
[0079] In this embodiment, when a customer starts to develop a new report, a new report requirement is sent to a general report generation device.
[0080] s2. Analyze the indicators required for developing reports.
[0081] In this embodiment, when the general report generation device receives a new report requirement, it analyzes the indicators required for the report, the number of indicator types is N, and obtains a total of N sets of indicators required for the report.
[0082] s3. Determine the data source of each type of indicator in turn.
[0083] In this embodiment, it is determined one by one whether the i-th indicator in the set of indicators required for the report needs to meet the high timeliness requirement, where i=1, 2, ..., N, and N is the number of indicators in the set of indicators required for the report. If the high timeliness requirement needs to be met, the data source of the i-th indicator is determined to be the model. The target account period and report development requirements are obtained according to the report requirements analysis. If the high timeliness requirement does not need to be met, the data source of the i-th indicator is determined according to the target account period and report development requirements, including: judging whether there is target account period indicator data in the indicator pool; if there is target account period indicator data, judging whether the data quality of the target account period indicator data in the indicator pool meets the report development requirements, if it meets the report development requirements, determining the data source of the i-th indicator to be the indicator pool, if it does not meet the report development requirements, determining the data source of the i-th indicator to be the model; if there is no target account period indicator data, determining the data source of the i-th indicator to be the model.
[0084] In this embodiment, the data in the indicator pool is derived from the model, but because the data in the indicator pool is derived from the wide table at the model layer, all the indicators required for the wide table must be available before all the indicator data of the wide table can be generated in the indicator pool. However, the report development requirements are usually not based on the account period. For example, the report generation time is required to be 2022-8-1, but the data in the indicator pool is only available on the 3rd of each month (the last update of the indicator data in the indicator pool is 2022-8-3). Without the method of this embodiment, the report generated on 2022-8-1 will be shelved, causing the development progress to be delayed. Therefore, the report indicators with a generation time of 2022-8-1 need to meet the high timeliness requirements, but the indicator pool cannot have the report indicator data with a generation time of 2022-8-1, and can only be extracted from the model. The data in the model are all detailed data with the finest time granularity, so they must be able to meet the high timeliness requirements.
[0085] In this embodiment, the data in the indicator pool cannot fully meet the report development requirements. For example, when the report requirement is to develop a "points analysis report", where the target account period is within three days, the report development requirement is to use the indicator data of the "newly added points" of City C, Province A. When extracting the corresponding indicator data of "newly added points within three days" from the indicator pool, it will be found that for some reason, the corresponding indicator of "newly added points within three days" in the indicator pool does not include the new points of all cities. The corresponding indicator data of "newly added points within three days" in the indicator pool may only have City A, Province A, and City B, Province A, and may not have the "newly added points" of City C, Province A. At this time, it is determined that the current indicator data is insufficient to support the demand, that is, the quality of the current indicator data does not meet the report development requirements. If the report development requirements are replaced with the indicator data that requires the use of the "newly added points" of City A, Province A, then it is determined that the current indicator data is sufficient to support the demand, that is, the quality of the current indicator data meets the development requirements. This embodiment mainly verifies the data quality by writing SQL scripts or configuring data audit nodes. According to the method of extracting data from the indicator pool in the prior art, it is necessary to wait for the indicator pool to be processed and have the data of c cities before the indicator data that meets the report development requirements can be extracted for generating reports. However, if the method of this embodiment is used, the c city data in the model is extracted in advance, so as to obtain the required complete data (that is, the indicator data whose data quality meets the report development requirements), which greatly saves development time. In addition, when the actual situation such as the fluctuation or caliber of the indicator data exceeds the threshold, it is also determined that the data quality of the indicator data does not meet the report development requirements. For example, the demand is the number of newly added points in City A, Province A. Even if the data already exists in the indicator pool at this time, the caliber of the indicator data (equivalent to the number of newly added points in City A, Province A) does not meet the latest caliber required by the party proposing the demand report. At this time, it is also determined that the data quality of the indicator data (equivalent to the number of newly added points in City A, Province A) does not meet the development requirements.
[0086] s4. After taking out all indicators, gather all indicator data together.
[0087] s5. Generate a new report.
[0088] In this embodiment, the indicator data corresponding to each indicator is extracted according to the data source of each indicator, including: if the data source of the i-th indicator is the model, the indicator data corresponding to the i-th indicator is extracted from the model. If the data source of the i-th indicator is the indicator pool, the indicator data corresponding to the i-th indicator is extracted from the indicator pool. The indicator data corresponding to each indicator in the indicator set required for the report is summarized to generate a report.
[0089] In this embodiment, by determining the data source of each indicator one by one, each type of indicator has its own data source, so extracting data for each indicator separately can greatly improve the integrity of the extracted indicator data. This embodiment abandons the previous practice of taking all indicators from the same data path, and integrates two data sources (indicator pool and model layer), so that the efficiency of report generation is greatly improved.
[0090] This embodiment provides a method for generating a general report. By determining the data source of the indicators one by one, the completeness extraction of indicator data can be satisfied with different requirements. This method integrates the two methods of extracting data from the indicator pool and extracting data from the model, thereby ensuring the data quality, timeliness and completeness of the lineage combing of the generated reports and improving the efficiency of report generation.
[0091] Embodiment 4:
[0092] like Figure 4 As shown, this embodiment provides a general report generation device, including: an analysis module 21, a judgment module 22, an extraction module 23 and a generation module 24, the analysis module 21, for responding to receiving a new report demand, analyzing the report demand to obtain a set of indicators required for the report, the judgment module 22, connected to the analysis module 21, for determining the data source of each indicator in the set of indicators required for the report one by one, the extraction module 23, connected to the judgment module 22, for extracting the indicator data corresponding to each indicator according to the data source of each indicator, and the generation module 24, connected to the extraction module 23, for summarizing the indicator data corresponding to each indicator in the set of indicators required for the report to generate a report.
[0093] Specifically, the judgment module 22 includes: a first judgment unit 221 and a second judgment unit 222. The first judgment unit 221 is used to judge whether the i-th indicator in the indicator set required for the report needs to meet the high timeliness requirement, where i = 1, 2, ..., N, N is the number of indicators in the indicator set required for the report. The second judgment unit 222 is connected to the first judgment unit 221, and is used to determine the data source of the i-th indicator according to the target account period and report development requirements.
[0094] Specifically, the second judgment unit 222 includes: an account period judgment subunit, a second judgment subunit, the account period judgment subunit is used to judge whether the indicator pool has target account period indicator data, and a data quality judgment subunit is connected to the account period judgment subunit, and is used to judge whether the data quality of the target account period indicator data in the indicator pool meets the report development requirements.
[0095] Specifically, the extraction module 23 includes: a first extraction unit 231 and a second extraction unit 232. The first extraction unit 231 is used to extract the indicator data corresponding to the i-th indicator from the model if the data source of the i-th indicator is the model, and the second extraction unit 232 is used to extract the indicator data corresponding to the i-th indicator from the indicator pool if the data source of the i-th indicator is the indicator pool.
[0096] Optionally, the judgment module 22 further includes: an analysis unit 220, configured to obtain a target account period and report development requirements according to report requirements analysis.
[0097] It can be understood that the above-mentioned general report generation device is used to execute the method corresponding to the embodiment 1 provided above. Therefore, the beneficial effects that can be achieved can refer to the method of the embodiment 1 above and the beneficial effects of the corresponding scheme in the specific implementation method below, which will not be repeated here.
[0098] Embodiment 5:
[0099] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for generating a general report in the above embodiment.
[0100] Embodiment 6:
[0101] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating a general report in the above embodiment is implemented.
[0102] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for generating a general report, characterized in that: include: In response to receiving a new report requirement, analyzing the report requirement to obtain a set of indicators required for the report; Determine the data source of each indicator in the indicator set required for the report one by one; Extract the corresponding indicator data of each indicator according to the data source of each indicator; The indicator data corresponding to each indicator in the indicator set required for the report is aggregated to generate a report.
2. The method for generating a general report according to claim 1, characterized in that: Determining the data source of each indicator in the indicator set required for the report one by one specifically includes: Determine one by one whether the i-th indicator in the indicator set required for the report needs to meet the high timeliness requirement, where i = 1, 2, ..., N, N is the number of indicators in the indicator set required for the report; If high timeliness requirements need to be met, the data source of the i-th indicator is determined to be the model; If there is no need to meet high timeliness requirements, the data source for the i-th indicator shall be determined based on the target account period and report development requirements.
3. The method for generating a general report according to claim 2, characterized in that: Determining the data source of the i-th indicator according to the target account period and report development requirements specifically includes: Determine whether the indicator pool contains target account period indicator data; If there is target account period indicator data, determine whether the data quality of the target account period indicator data in the indicator pool meets the report development requirements. If it meets the report development requirements, determine that the data source of the i-th indicator is the indicator pool; if it does not meet the report development requirements, determine that the data source of the i-th indicator is the model; If there is no target account period indicator data, the data source of the i-th indicator is determined to be the model.
4. The method for generating a general report according to claim 2, characterized in that: The step of extracting the indicator data corresponding to each indicator according to the data source of each indicator specifically includes: If the data source of the i-th indicator is the model, the indicator data corresponding to the i-th indicator is extracted from the model; If the data source of the i-th indicator is the indicator pool, the indicator data corresponding to the i-th indicator is extracted from the indicator pool.
5. The method for generating a general report according to claim 2, characterized in that: If the high timeliness requirement does not need to be met, before determining the data source of the i-th indicator according to the target account period and report development requirements, it also includes: Analyze the report requirements to obtain the target payment period and report development requirements.
6. The method for generating a general report according to claim 3, characterized in that: The model is a model layer of a data warehouse, and the model is used to organize data according to defined fact tables, dimension tables and association relationships to support query, analysis and decision making, wherein the model layer includes: a data warehouse derived summary data layer and a data warehouse detail data layer; The indicator pool is the data mart layer of the data warehouse, which is used to centrally store business-related indicators or metrics. The indicator data in the indicator pool comes from the model. When the wide table of the model layer has all the required indicators, the indicator data is processed and stored in the indicator pool.
7. A general report generation device, characterized in that: include: Analysis module, judgment module, extraction module and generation module, The analysis module is used to analyze the report requirements in response to receiving new report requirements to obtain the set of indicators required for the report. The judgment module is connected to the analysis module and is used to judge the data source of each indicator in the indicator set required for the report one by one. The extraction module is connected to the judgment module and is used to extract the indicator data corresponding to each indicator according to the data source of each indicator. The generation module is connected to the extraction module and is used to summarize the indicator data corresponding to each indicator in the indicator set required for the report to generate the report.
8. The general report generation device according to claim 7, characterized in that: The judgment module includes: a first judgment unit and a second judgment unit, The first judgment unit is used to judge whether the i-th indicator in the indicator set required for the report needs to meet the high timeliness requirement, where i=1, 2, ..., N, N is the number of indicators in the indicator set required for the report, The second judgment unit is connected to the first judgment unit and is used to determine the data source of the i-th indicator according to the target account period and report development requirements.
9. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for generating a general report according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a general report according to any one of claims 1 to 6 is implemented.