Business report generation method and device and readable storage medium
Drag and drop the metadata asset ID through the front-end interface and assemble intelligent SQL using the blood relationship of the metadata architecture, solving the problems of coarse granularity and single functions in the existing business report generation method, improving report output efficiency and data query efficiency , reduces costs.
Patent Information
- Application Number
- CN202411281058.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-31
AI Technical Summary
The existing business report generation method has a coarse management size, a single function, and is unfriendly to the business side, resulting in low data query efficiency and high cost, and cannot meet the rapid growth and timeliness requirements of business needs.
Receive user requests through the front-end interface, obtain the metadata asset ID selected by the user, judge permissions, use the blood relationship of the metadata architecture to assemble the intelligent structured query language SQL, generate business reports, and realize the assembly and data query of intelligent SQL .
It improves the output efficiency of business reports, reduces development costs, realizes efficient data query and analysis, and solves the problems of coarse granularity and single functions of management.
Smart Images

Figure CN119226291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to a method and device for generating a business report and a readable storage medium. Background Art
[0002] Before 2016, when each business department needed to obtain data for business reports, they had to manually write SQL (Structured Query Language) statements to query and export data. This repeated construction and maintenance was not conducive to business sedimentation, and each demand cycle was long, inefficient, and costly.
[0003] With the continuous expansion of the company's business, there are more and more demands for report acquisition. In order to innovate business development and solve the contradiction between the increasing business volume and the increasing timeliness requirements, a method for generating business reports is urgently needed. However, the existing business report generation method has the following disadvantages:
[0004] (1) Coarse management granularity: The backend management of data is actually a series of Excel tables, and the backend management granularity of the data table is only at the table level;
[0005] (2) Single function: The front-end interface cannot realize the output of reports by dragging and dropping different table fields, nor can it realize the integration of tables from different systems and domains. Data are still isolated islands. The object-oriented approach is biased towards the IT side and is not friendly to the business side. In the end, the business will still tend to develop data once and for all, and develop repeatedly. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a method, device and readable storage medium for generating a business report in view of the above-mentioned deficiencies in the prior art, so as to solve the problems that the existing business report generation method has coarse management granularity, single function and is not friendly to the business side.
[0007] In a first aspect, the present invention provides a method for generating a business report, the method comprising:
[0008] Receive business requests triggered by users through the front-end interface;
[0009] Acquire, according to the business request, a metadata asset ID selected by the user through a drag operation and required as a result column, where the asset type corresponding to the metadata asset ID includes a dimension, an indicator and / or a label;
[0010] Determine whether the user has the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags;
[0011] In response to the user having the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags, intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed;
[0012] Execute the assembled SQL to generate corresponding business reports.
[0013] Furthermore, the indicators include indicator set indicators and non-indicator set indicators, and the labels include indicator set labels and non-indicator set labels.
[0014] Furthermore, the method further comprises:
[0015] Acquire a data retrieval condition selected by the user through a drag operation, where the data retrieval condition is used to perform conditional filtering on at least one tag as a condition;
[0016] The intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between metadata assets in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed, which specifically includes:
[0017] Intelligent addressing of metadata is performed according to the data retrieval conditions, the metadata asset ID as the result column, and the blood relationship between the metadata assets in the metadata architecture, and the assembly of intelligent SQL is completed.
[0018] Furthermore, the intelligent addressing of metadata is performed according to the data retrieval condition and the metadata asset ID as the result column and the blood relationship between metadata assets in the metadata architecture to complete the assembly of intelligent SQL, which specifically includes:
[0019] Obtain the data retrieval condition and the domains involved in all assets in the metadata asset ID as the result column;
[0020] Query the domain master table and domain master key of the domains involved in all the assets;
[0021] cyclically acquiring the data extraction parameters corresponding to the data extraction condition and the metadata asset ID as the result column according to the data extraction account period;
[0022] Based on the blood relationship between metadata assets in the metadata architecture, the data to be extracted corresponding to the data extraction parameters are bound to the domain master table and domain master key of the corresponding data extraction period;
[0023] The assembly of the intelligent SQL is completed according to the binding result.
[0024] Furthermore, the data extraction parameters include database field code, data table name, asset type and at least one of the following: condition operation type, condition value, whether the result column is deduplicated, result column aggregation function, digital table, and digital table level.
[0025] Furthermore, if there are multiple domains involved in all the assets, while querying the domain master table and domain master key of the domains involved in all the assets, the method also includes:
[0026] The cross-domain relationship between the multiple domains involved in all the assets is queried to verify whether the cross-domain relationship is configured.
[0027] Furthermore, the assembling of the intelligent SQL according to the binding result specifically includes:
[0028] According to the binding result, the data tables are associated by using the SQL language, the corresponding query conditions are assembled into the corresponding data tables, and the result columns are assembled and converted to obtain the corresponding SQL statements;
[0029] When multiple SQL statements for fetching data from multiple account periods are involved, the SQL statements for fetching data from multiple account periods are assembled through union all to complete the assembly of intelligent SQL.
[0030] In a second aspect, the present invention provides a device for generating a business report, the device comprising:
[0031] The request receiving module is used to receive the service request triggered by the user through the front-end interface;
[0032] An asset ID acquisition module, connected to the request receiving module, is used to acquire the metadata asset ID selected by the user through the drag operation as the result column according to the business request, and the asset type corresponding to the metadata asset ID includes dimension, indicator and / or label;
[0033] A permission verification module, connected to the asset ID acquisition module, is used to determine whether the user has the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags;
[0034] An intelligent assembly module, connected to the permission verification module, is used to perform intelligent addressing of metadata according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture in response to the user having the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags, and complete the assembly of the intelligent structured query language SQL;
[0035] The business report generation module is connected to the intelligent assembly module and is used to execute the assembled SQL to generate corresponding business reports.
[0036] In a third aspect, the present invention provides a device for generating a business report, 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 business report described in the first aspect.
[0037] In a fourth aspect, the present invention 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 business report described in the first aspect above is implemented.
[0038] The present invention provides a method, device and readable storage medium for generating a business report. First, a business request triggered by a user through a front-end interface is received; and according to the business request, a metadata asset ID selected by the user through a drag operation as a result column is obtained, and the asset type corresponding to the metadata asset ID includes dimensions, indicators and / or tags; then, it is determined whether the user has the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags; and in response to the user having the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags, intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between each metadata asset in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed; finally, the assembled SQL is executed to generate the corresponding business report. Through the present invention, users can simply drag dimensions, indicators and labels through the front-end interface to complete the combination of reports. The back-end uses the blood relationship and metadata architecture to perform intelligent addressing based on the dimension, indicator and label combination fed back by the front-end, and the management granularity is reduced from the table level to the field level, thereby realizing the assembly of intelligent SQL. This process greatly speeds up the output of business reports, reduces chimney-style development, improves the output timeliness of business reports, reduces the development cost of business reports, and realizes efficient data query and analysis. It solves the problems of coarse management granularity, single function and unfriendly to business side use in the existing business report generation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a flow chart of a method for generating a business report according to Embodiment 1 of the present invention;
[0040] Figure 2 This is a schematic diagram of a front-end interface of Embodiment 1 of the present invention;
[0041] Figure 3 This is a schematic diagram of an interface for filtering a dimension list according to Embodiment 1 of the present invention;
[0042] Figure 4 is a schematic diagram of a metadata architecture according to Embodiment 1 of the present invention;
[0043] Figure 5 This is a schematic diagram of the result after the intelligent SQL assembly of Example 1 of the present invention;
[0044] Figure 6 This is a schematic diagram of another front-end interface according to Embodiment 1 of the present invention;
[0045] Figure 7 This is a schematic diagram of the structure of a device for generating a business report according to Embodiment 2 of the present invention;
[0046] Figure 8 This is a schematic diagram of the structure of a device for generating a business report according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] It can be understood that the terms "first", "second", etc. in the embodiments of the present invention are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0053] 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.
[0054] 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.
[0055] 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.
[0056] Embodiment 1:
[0057] This embodiment provides a method for generating a business report, such as Figure 1 As shown, the method includes:
[0058] Step S101: receiving a service request triggered by a user through a front-end interface.
[0059] In this embodiment, in order to realize the rapid generation of business reports, based on the big data platform, the data tables and fields used by the business are managed through metadata, the management granularity is reduced from the table level to the field level, the blood relationship between data tables and fields is sorted out, the front-end application interface and interface capabilities are developed, the reports used by the business are broken down into indicators, and tags are published. Users can complete the combination of reports by dragging and dropping operations on the front-end interface.
[0060] Step S102: acquiring the metadata asset ID selected by the user through the dragging operation as the result column according to the business request, where the asset type corresponding to the metadata asset ID includes dimension, indicator and / or label;
[0061] In this embodiment, the user can add predefined dimensions, indicators, and labels to the result column by dragging through the front-end interface, such as Figure 2 As shown, when the user drags the four metadata assets of the city (real time), current day billing income (actually collected total), current month cumulative - monthly rental billing income (actually collected total), and current month cumulative - call duration on the left to the result column area on the right, and clicks Preview or Save, a business request is triggered. After receiving the business request, the backend obtains the metadata asset ID of each metadata asset in the result column. For example, the metadata asset ID of the current month cumulative - call duration is A10105.
[0062] In this embodiment, the asset type corresponding to the metadata asset ID includes dimensions, indicators, and tags:
[0063] (1) Dimension: The data in the database has levels and code values; dimensions include: city of origin (real-time), organization of origin (integrated), county channel code, account opening year and month, channel classification (2019), etc.
[0064] (2) Indicators: The data in the database can be converted into units and are mainly used for quantification and summary, usually involving amounts and values; indicators include: points balance, number of network access months, current day billing income (actually collected total amount), current day billing income (actually collected total amount), current day voice billing income (actually collected total amount), current day SMS billing income (actually collected total amount), current day value-added billing income (actually collected total amount), current day monthly rental billing income (actually collected total amount), current day other billing income (actually collected total amount), etc.;
[0065] (3) Tags: These are divided into value-added tags (data in the database has coded values) and valueless tags (data that is used directly). Tags include new users, off-network users, monthly cumulative-pure monthly rental user ID, online user ID, user type, user number, user status code, broadband user-fusion ID, work order number, user number, calling number, acceptance number, acceptance time, work order serial number, work order filing time, work order type, complaint problem category, whether it is a repeated complaint, etc.
[0066] It should be noted that having a value and having no value can be understood as whether there is a code table, for example, the user number has no value.
[0067] like Figure 2 As shown in the figure, the asset type of the city (real time) is the dimension, and the asset types of the current day's billing income (actually collected total), the current month's cumulative monthly rental billing income (actually collected total), and the current month's cumulative call duration are indicators. When the user clicks on the city (real time) dimension, a pop-up window will appear. Figure 3 The interface diagram of the filter dimension list shown is to facilitate users to select the corresponding dimension.
[0068] Optionally, the indicators include indicator set indicators and non-indicator set indicators, and the labels include indicator set labels and non-indicator set labels.
[0069] In this embodiment, the indicators include indicator set indicators and non-indicator set indicators, and the labels include indicator set labels and non-indicator set labels. The indicator set indicators and indicator set labels are located in the indicator set. The indicator set is a set consisting of indicators and labels. This set can help users quickly select and combine different labels and indicators when creating reports to meet specific analysis needs or business scenarios (report scenarios). For example, the indicator set of the daily arrears user table may include: daily arrears-arrears account code (label), daily arrears-arrears bill type (label), daily arrears-reduced arrears user identification (label), daily arrears-late payment fee (indicator), daily arrears-arrears amount (indicator), user number (label), etc.
[0070] like Figure 2 As shown, when the user clicks on the indicators and labels in the "Indicator Label Selection" tab, the selected indicators and labels are non-indicator set indicators and non-indicator set labels; when the user clicks on the "Indicator Set" tab and selects indicators and labels in a certain indicator set, these indicators and labels are indicator set indicators and indicator set labels.
[0071] It should be noted that the platform can predefine corresponding indicator sets including labels and / or indicators according to different report scenarios.
[0072] Step S103: Determine whether the user has the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags.
[0073] In this embodiment, each dimension, indicator, and tag must be authorized before use. Users in the corresponding cities can usually only view their own city dimensions. For example, users in Shantou can only view Shantou data. Specifically, according to the dimension permissions (city) authorized by the user in the business request message, the message is reassembled, and the asset is verified to be valid, and it is determined whether the user has the corresponding asset permissions.
[0074] Step S104: In response to the user having the corresponding dimension permissions and the asset permissions corresponding to each of the indicators and / or tags, intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture, and the assembly of intelligent SQL (Structured Query Language) is completed.
[0075] In this embodiment, when the user has the corresponding dimension permissions and the asset permissions corresponding to each indicator and / or tag, the backend performs intelligent addressing of metadata based on the blood relationship between metadata assets in the metadata architecture and automatically completes the SQL assembly. For example, the schematic diagram of the metadata architecture can be as follows: Figure 4 As shown, the association relationship between the commonly used metadata data table data related to the database is displayed.
[0076] Optionally, the method further comprises:
[0077] Acquire a data retrieval condition selected by the user through a drag operation, where the data retrieval condition is used to perform conditional filtering on at least one tag as a condition;
[0078] The intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between metadata assets in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed, which specifically includes:
[0079] Intelligent addressing of metadata is performed according to the data retrieval conditions, the metadata asset ID as the result column, and the blood relationship between the metadata assets in the metadata architecture, and the assembly of intelligent SQL is completed.
[0080] In this embodiment, the user can also select the corresponding data retrieval conditions by dragging and dropping, and perform conditional filtering on multiple metadata tags (operation types include: in, between, not in, like, like_, _like, not like_, _notlike, not like, =, <, >, <=, >=, expression).
[0081] Optionally, performing intelligent addressing of metadata according to the data retrieval condition and the metadata asset ID as the result column and the blood relationship between metadata assets in the metadata architecture to complete the assembly of intelligent SQL specifically includes:
[0082] Obtain the data retrieval condition and the domains involved in all assets in the metadata asset ID as the result column;
[0083] Query the domain master table and domain master key of the domains involved in all the assets;
[0084] cyclically acquiring the data extraction parameters corresponding to the data extraction condition and the metadata asset ID as the result column according to the data extraction account period;
[0085] Based on the blood relationship between metadata assets in the metadata architecture, the data to be extracted corresponding to the data extraction parameters are bound to the domain master table and domain master key of the corresponding data extraction period;
[0086] The assembly of the intelligent SQL is completed according to the binding result.
[0087] In this embodiment, multiple domains can be divided according to the main table and primary key. For example, in the user domain, the domain main table can be the user table, the domain primary key can be the user code, and other tables in the user domain are associated together through the user code. For example, the ledger domain, financial installment domain, terminal sales domain, smart home small area, etc. are all associated through different domain primary keys.
[0088] In this embodiment, each metadata asset ID can set its own data retrieval account period. By default, the data retrieval account period corresponding to all metadata asset IDs is the default public account period, for example, Figure 2The default public account period is the month before the current date. When only the data collection period of the current day's billing income (actually collected total amount) is changed to yesterday, the final display is the current day's billing income (actually collected total amount) of yesterday corresponding to the city, and the current month's cumulative monthly rent billing income (actually collected total amount) and the current month's cumulative call duration corresponding to the city in the previous month. It should be noted that by setting different data collection periods for metadata asset IDs, statistical data from different time periods can be compared, for example, statistical data from different months can be compared.
[0089] In this embodiment, the data extraction parameters include database field code, data table name, asset type and at least one of the following: condition operation type, condition value, whether the result column is deduplicated, result column aggregation function, digital table, and digital table level.
[0090] In an optional embodiment, after querying the domain master table and domain master key of the domain involved in all the assets, it is possible to first determine whether there are indicator set assets. If there are indicator set assets, check whether multiple indicator set assets are involved. When multiple indicator set assets are not involved, execute subsequent steps.
[0091] Optionally, if there are multiple domains involved in all the assets, while querying the domain master table and domain master key of the domains involved in all the assets, the method further includes:
[0092] The cross-domain relationship between the multiple domains involved in all the assets is queried to verify whether the cross-domain relationship is configured.
[0093] In this embodiment, if a multi-domain association is involved, it is checked whether a cross-domain relationship is configured. For example, the configuration relationship of the main domain and the subdomain can be as shown in Table 1:
[0094] Table 1: Configuration relationship between main domain and subdomain
[0095]
[0096]
[0097] Optionally, the assembling of the intelligent SQL according to the binding result specifically includes:
[0098] According to the binding result, the data tables are associated by using the SQL language, the corresponding query conditions are assembled into the corresponding data tables, and the result columns are assembled and converted to obtain the corresponding SQL statements;
[0099] When multiple SQL statements for fetching data from multiple account periods are involved, the SQL statements for fetching data from multiple account periods are assembled through union all to complete the assembly of intelligent SQL.
[0100] In this embodiment, the assembly of intelligent SQL includes:
[0101] (1) Intelligent SQL assembly - data table association: The metadata information is divided according to the data retrieval period and domain. The data tables in the same domain are associated through left join using the domain primary key. The indicator set asset data table is grouped by the primary key and then associated with left join.
[0102] (2) Intelligent SQL assembly - query condition assembly: Assemble the query conditions into the corresponding data table through the where condition, and associate the code value condition field with the code table through lev_id using left join.
[0103] (3) Intelligent SQL assembly - assembling and converting query columns (i.e., result columns): Query result columns are assembled through select, unit conversion replaces fields, aggregate function replaces fields, code value conversion replaces fields, and deduplication functions are added.
[0104] (4) Intelligent SQL Assembly - Multiple Account Periods: Multiple account period SQLs are assembled through union all.
[0105] For example, the result diagram after intelligent SQL assembly can be as follows Figure 5 shown.
[0106] Step S105: Execute the assembled SQL to generate a corresponding business report.
[0107] In this embodiment, the business report is generated by executing the assembled SQL.
[0108] The method for generating business reports provided by the present invention allows the business to complete the combination of reports through simple indicators and labels dragging and dropping on the front-end interface. The back-end uses the indicators and label combinations fed back by the front-end to intelligently address data from the table information managed by metadata, find the association relationship between the tables to be used, and dynamically assemble SQL to output the result data, thereby realizing rapid assembly and output of business reports, reducing chimney-style development, improving the output timeliness of business reports, reducing the development cost of business reports, and realizing efficient data query and analysis.
[0109] In an optional embodiment, in addition to generating business reports, detailed queries can also be implemented. The front-end interface can set corresponding options for users to choose from. For example, when the back-end determines that the user is querying for summaries, a corresponding business report is generated. When the back-end determines that the user is querying for details, the corresponding information can be displayed in a table or list format.
[0110] For example, Figure 6 The test data shown will export a "Smart Home Network FTTR Development Details", select Figure 6 The 12 tags and dimensions shown (including indicator sets and non-indicator sets) are first verified for permissions based on the selected tags, indicators, dimensions, corresponding account periods (default public account periods), and associated conditions to confirm that the user has the authority to the asset. Then, the domains, domain master tables, domain primary keys, tables involved in dimensions, tables and fields involved in indicators and tags are searched to determine whether to obtain details and reports. Finally, intelligent SQL assembly is performed, including data table association, query condition assembly, series assembly, conversion, multi-account period query, etc., to generate the most appropriate SQL to complete data query and services.
[0111] In a specific embodiment, in order to implement metadata-driven intelligent addressing services, using a metadata-driven model to cover the data life cycle, the method for generating a business report may include the following steps:
[0112] S1. The user logs in to the authentication platform, jumps to the self-service application system platform, searches by name, and selects the metadata asset ID that the user needs to query (asset types are divided into: indicators, indicator set indicators <with units>, valued tags, indicator set valued tags <with non-hierarchical code table>; valueless tags, indicator set valueless tags <no conversion required>; dimension tags, indicator set dimension tags <with hierarchical code table>; assets are horizontal tables, indicator set assets are vertical tables).
[0113] Specifically, each asset type is described as follows:
[0114] 1 Indicator (i.e. non-indicator set indicator): the data in the database can be converted into units;
[0115] 2nd dimension (i.e., non-index set dimension): the data in the database has levels and code values;
[0116] 3 Valued labels (i.e. non-index set valued labels): the data in the database has coded values;
[0117] 4 No-value labels (i.e., non-indicator set no-value labels): data used directly;
[0118] 5. Indicator set indicators: vertical table, the data in the database can be converted into units;
[0119] 6. Indicator set dimension: vertical table, the data in the database has levels and code values;
[0120] 7 Indicator set has value labels: vertical table, the data in the database has code values;
[0121] 8 indicator sets without value labels: vertical table, data used directly.
[0122] It should be noted that the indicator set is a set of indicators and tags, which can help users quickly select and combine different tags and indicators when creating reports to meet specific analysis needs or business scenarios (report scenarios). For example, the indicator set of the daily arrears user table may include: daily arrears-arrears account code (tag), daily arrears-arrears bill type (tag), daily arrears-arrears account period, daily arrears-reduced arrears user identification (tag), daily arrears-late payment fee (indicator), daily arrears-arrears amount (tag), user number (tag), etc.
[0123] S2. Data retrieval conditions: The user selects a tag as a condition in the condition column; and performs conditional filtering on multiple metadata tags (operation types include: in, between, not in, like, like_, _like, not like_, _not like, notlike, =, <, >, <=, >=, expression).
[0124] S3. Data retrieval results: Users select the label as the result column in the data retrieval result column, and set the data retrieval period for each asset (the default public period can be used); retrieve details by default; or add aggregation functions to the column to perform aggregation (max\min\avg\sum\count), deduplication, and obtain code value operations.
[0125] S4. The front-end self-service application sends a request to the big data API service interface.
[0126] S5. Reassemble the message according to the dimension permissions (city) authorized by the user requesting the message, and verify whether the assets are valid, whether the application system is invalid (monthly assessment), and whether the user has asset permissions (user group authorization, user confidentiality level authorization).
[0127] S6. Obtain the domains involved in all assets according to the account period for data retrieval, and query the domain master table, domain primary key, and cross-domain relationship of the domain involved (if multiple domain associations are involved, verify whether cross-domain relationships are configured), and determine whether the domain master table data of the corresponding account period exists.
[0128] S7. Determine whether there are indicator set assets. If there are indicator set assets, check whether multiple indicator set assets are involved (the indicator set is a vertical table, and the association between vertical tables will produce a Cartesian product. If indicator set assets appear, it is necessary to determine whether multiple indicator set assets appear).
[0129] S8. According to the retrieval period, the conditions are obtained in a loop, the database field code of the retrieval series asset ID, the data table name (set the table alias), the asset type (multiple indicator sets are not allowed), the condition operation type, the condition value, whether the retrieval series is to be deduplicated, the retrieval series aggregation function, the retrieval digital table, the retrieval digital table level, and the domain master table and domain primary key of the corresponding account period are bound.
[0130] S9. Determine whether to query details or summary, whether indicator set assets are involved (indicator set assets are grouped by and then associated based on the corresponding domain primary key), and parse custom expressions.
[0131] S10. Intelligent SQL assembly - data table association: The metadata information is divided according to the account period-domain. The data tables in the same domain are associated through left join using the domain primary key. The indicator set asset data table is grouped by the primary key and then associated with left join.
[0132] S11. Intelligent SQL assembly - query condition assembly: Assemble the query conditions into the corresponding data table through the where condition, and associate the code value condition field with the code table through lev_id using left join.
[0133] S12. Intelligent SQL assembly - assemble and convert data columns: Query result columns are assembled through select, unit conversion replaces fields, aggregate function replaces fields, code value conversion replaces fields, and deduplication function is added.
[0134] S13. Intelligent SQL assembly - multiple account periods: Multiple account period SQL is assembled through union all.
[0135] It should be noted that the method for generating a business report provided by the present invention has the following features:
[0136] Beneficial effects:
[0137] a) Realize intelligent addressing: By establishing intelligent routing, the platform automatically finds the physical table and association method that best suits the business logic based on the blood relationship and metadata architecture, and dynamically generates the most appropriate SQL to complete data query and service.
[0138] b) Realize cross-domain query: Through the master data management model and the master-slave relationship management of the domain, cross-domain integration is achieved. Through the automatic splitting, condition sinking, language translation and other capabilities of the cross-domain computing engine, cross-database query capabilities of different databases are achieved.
[0139] c) Realize vertical table association: Through the indicator set management mode, the principle of priority processing of vertical tables is implemented, and the single vertical table association query and multi-vertical table conditional query capabilities are supported.
[0140] The method for generating a business report provided by an embodiment of the present invention first receives a business request triggered by a user through a front-end interface; and obtains the metadata asset ID selected by the user through a drag operation as a result column according to the business request, and the asset type corresponding to the metadata asset ID includes dimensions, indicators and / or tags; then determines whether the user has the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags; and in response to the user having the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags, performs intelligent addressing of metadata according to the metadata asset ID as the result column and the blood relationship between each metadata asset in the metadata architecture, and completes the assembly of the intelligent structured query language SQL; finally, executes the assembled SQL to generate the corresponding business report. Through the present invention, the user can simply drag dimensions, indicators and tags through the front-end interface to complete the combination of reports, and the back-end performs intelligent addressing based on the dimension, indicator and tag combination fed back by the front-end, using blood relationship and metadata architecture, and the management granularity is reduced from table level to field level, thereby realizing the assembly of intelligent SQL, which greatly speeds up the output of business reports, reduces chimney-style development, improves the output timeliness of business reports, reduces the development cost of business reports, and realizes efficient data query and analysis. The present invention solves the problems of existing business report generation methods, such as coarse management granularity, single function and unfriendly to business users.
[0141] Embodiment 2:
[0142] like Figure 7 As shown, this embodiment provides a device for generating a business report, which is used to execute the above-mentioned method for generating a business report, including:
[0143] The request receiving module 11 is used to receive the service request triggered by the user through the front-end interface;
[0144] The asset ID acquisition module 12 is connected to the request receiving module 11 and is used to acquire the metadata asset ID selected by the user through the drag operation as the result column according to the business request, and the asset type corresponding to the metadata asset ID includes dimension, indicator and / or label;
[0145] The permission verification module 13 is connected to the asset ID acquisition module 12 and is used to determine whether the user has the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags;
[0146] The intelligent assembly module 14 is connected to the permission verification module 13, and is used to perform intelligent addressing of metadata according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture in response to the user having the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags, and complete the assembly of the intelligent structured query language SQL;
[0147] The business report generation module 15 is connected to the intelligent assembly module 14 and is used to execute the assembled SQL to generate corresponding business reports.
[0148] Optionally, the indicators include indicator set indicators and non-indicator set indicators, and the labels include indicator set labels and non-indicator set labels.
[0149] Optionally, the device further comprises:
[0150] A data acquisition condition acquisition module, used to acquire the data acquisition condition selected by the user through a drag operation, wherein the data acquisition condition is used to perform conditional filtering on at least one tag as a condition;
[0151] The intelligent assembly module 14 includes:
[0152] The SQL assembly unit is used to perform intelligent addressing of metadata according to the data retrieval conditions and the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture, and complete the assembly of intelligent SQL.
[0153] Optionally, the SQL assembly unit specifically includes:
[0154] A domain acquisition unit, used for acquiring the data acquisition condition and the domains involved in all assets in the metadata asset ID as the result column;
[0155] A first query unit, used for querying the domain master table and domain master key of the domains involved in all the assets;
[0156] A data extraction parameter acquisition unit, used for cyclically acquiring the data extraction parameters corresponding to the data extraction condition and the metadata asset ID as the result column according to the data extraction account period;
[0157] A binding unit, for binding the data to be extracted corresponding to the data extraction parameter and the domain master table and domain master key of the corresponding data extraction account period based on the blood relationship between the metadata assets in the metadata architecture;
[0158] The assembling unit is used to complete the assembly of the intelligent SQL according to the binding result.
[0159] Optionally, the data extraction parameters include database field code, data table name, asset type and at least one of the following: condition operation type, condition value, whether the result column is deduplicated, result column aggregation function, digital table, and digital table level.
[0160] Optionally, if there are multiple domains involved in all the assets, the SQL assembly unit further includes:
[0161] The second query unit is used to query the cross-domain relationship between the multiple domains involved in all the assets, and verify whether the cross-domain relationship is configured.
[0162] Optionally, the assembly unit specifically includes:
[0163] A first assembling unit is used to associate the data tables through the SQL language according to the binding result, assemble the corresponding query conditions into the corresponding data tables, and assemble and convert the result columns to obtain the corresponding SQL statements;
[0164] The second assembling unit is used to assemble the SQL statements of multiple data retrieval periods through union all when multiple SQL statements of data retrieval periods are involved, so as to complete the assembly of intelligent SQL.
[0165] Embodiment 3:
[0166] refer to Figure 8 This embodiment provides a device for generating a business report, including a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the method for generating a business report in Example 1.
[0167] The memory 21 is connected to the processor 22. The memory 21 may be a flash memory, a read-only memory or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.
[0168] Embodiment 4:
[0169] This embodiment 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 business report in the above-mentioned embodiment 1 is implemented.
[0170] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.
[0171] In summary, the method, device and readable storage medium for generating a business report provided by the embodiments of the present invention first receive a business request triggered by a user through a front-end interface; and obtain the metadata asset ID selected by the user through a drag operation as a result column according to the business request, and the asset type corresponding to the metadata asset ID includes dimensions, indicators and / or tags; then determine whether the user has the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags; and in response to the user having the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags, perform intelligent addressing of metadata according to the metadata asset ID as the result column and the blood relationship between each metadata asset in the metadata architecture, and complete the assembly of the intelligent structured query language SQL; finally, execute the assembled SQL to generate the corresponding business report. Through the present invention, users can simply drag dimensions, indicators and labels through the front-end interface to complete the combination of reports. The back-end uses the blood relationship and metadata architecture to perform intelligent addressing based on the dimension, indicator and label combination fed back by the front-end, and the management granularity is reduced from the table level to the field level, thereby realizing the assembly of intelligent SQL. This process greatly speeds up the output of business reports, reduces chimney-style development, improves the output timeliness of business reports, reduces the development cost of business reports, and realizes efficient data query and analysis. It solves the problems of coarse management granularity, single function and unfriendly to business side use in the existing business report generation method.
[0172] 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 business report, characterized in that: The method comprises: Receive business requests triggered by users through the front-end interface; Acquire, according to the business request, a metadata asset ID selected by the user through a drag operation and required as a result column, where the asset type corresponding to the metadata asset ID includes a dimension, an indicator and / or a label; Determine whether the user has the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags; In response to the user having the corresponding dimension authority and the asset authority corresponding to each of the indicators and / or tags, intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed; Execute the assembled SQL to generate corresponding business reports.
2. The method according to claim 1, characterized in that The indicators include indicator set indicators and non-indicator set indicators, and the labels include indicator set labels and non-indicator set labels.
3. The method according to claim 1, characterized in that The method further comprises: Acquire a data retrieval condition selected by the user through a drag operation, where the data retrieval condition is used to perform conditional filtering on at least one tag as a condition; The intelligent addressing of metadata is performed according to the metadata asset ID as the result column and the blood relationship between metadata assets in the metadata architecture, and the assembly of the intelligent structured query language SQL is completed, which specifically includes: Intelligent addressing of metadata is performed according to the data retrieval conditions, the metadata asset ID as the result column, and the blood relationship between the metadata assets in the metadata architecture, and the assembly of intelligent SQL is completed.
4. The method according to claim 3, characterized in that The intelligent addressing of metadata is performed according to the data retrieval condition and the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture to complete the assembly of the intelligent SQL, which specifically includes: Obtain the data retrieval condition and the domains involved in all assets in the metadata asset ID as the result column; Query the domain master table and domain master key of the domains involved in all the assets; cyclically acquiring the data extraction parameters corresponding to the data extraction condition and the metadata asset ID as the result column according to the data extraction account period; Based on the blood relationship between metadata assets in the metadata architecture, the data to be extracted corresponding to the data extraction parameters are bound to the domain master table and domain master key of the corresponding data extraction period; The assembly of the intelligent SQL is completed according to the binding result.
5. The method according to claim 4, characterized in that The data extraction parameters include database field code, data table name, asset type and at least one of the following: condition operation type, condition value, whether the result column is deduplicated, result column aggregation function, digital table, and digital table level.
6. The method according to claim 4, characterized in that If there are multiple domains involved in all the assets, while querying the domain master table and domain master key of the domains involved in all the assets, the method further includes: The cross-domain relationship between the multiple domains involved in all the assets is queried to verify whether the cross-domain relationship is configured.
7. The method according to claim 4, characterized in that The assembling of the intelligent SQL according to the binding result specifically includes: According to the binding result, the data tables are associated by using the SQL language, the corresponding query conditions are assembled into the corresponding data tables, and the result columns are assembled and converted to obtain the corresponding SQL statements; When multiple SQL statements for fetching data from multiple account periods are involved, the SQL statements for fetching data from multiple account periods are assembled through union all to complete the assembly of intelligent SQL.
8. A device for generating a business report, characterized in that: The device comprises: The request receiving module is used to receive the service request triggered by the user through the front-end interface; An asset ID acquisition module, connected to the request receiving module, is used to acquire the metadata asset ID selected by the user through the drag operation as the result column according to the business request, and the asset type corresponding to the metadata asset ID includes dimension, indicator and / or label; A permission verification module, connected to the asset ID acquisition module, is used to determine whether the user has the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags; An intelligent assembly module, connected to the permission verification module, is used to perform intelligent addressing of metadata according to the metadata asset ID as the result column and the blood relationship between the metadata assets in the metadata architecture in response to the user having the corresponding dimension permission and the asset permission corresponding to each of the indicators and / or tags, and complete the assembly of the intelligent structured query language SQL; The business report generation module is connected to the intelligent assembly module and is used to execute the assembled SQL to generate corresponding business reports.
9. A device for generating a business report, characterized in that: It 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 business report according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a business report according to any one of claims 1 to 7 is implemented.