Structured query statement generation method for index processing, medium and equipment
By introducing a process flow metadata database and a visual configuration interface, structured query statements are generated, solving the problem of difficult-to-understand business logic in data warehouses, realizing controllable, efficient and agile data processing, and improving development efficiency and business logic transparency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, business logic in data warehouses and business intelligence systems is hidden in the code, making it difficult for business personnel to intuitively understand the definition of indicators, resulting in high communication costs, low development and operation efficiency, poor agility in responding to business needs, and difficulty in adapting to rapidly changing analysis scenarios.
A processing flow metadata database, a visual configuration interface, and an automatic generation mechanism for structured query statements based on indicator types are introduced. The processing sequence and indicator components are displayed through the visual configuration interface, and structured query statements are generated to achieve reusability and standardization of data processing logic.
It achieves controllability, efficiency, and agility in data processing, reduces manual coding, improves the transparency of business logic and development efficiency, reduces communication costs and error rates, and enhances the agility in responding to business needs.
Smart Images

Figure CN121807883A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of data processing and business intelligence technology, and in particular to a method, apparatus, readable storage medium and electronic device for generating structured query statements for index processing. Background Technology
[0002] In the field of data warehousing and business intelligence systems, the process of transforming raw data into analyzable business metrics involves multiple stages, including data extraction, data cleaning, and data aggregation. The data aggregation stage often involves multi-table joins, conditional filtering, grouping and aggregation, and cross-metric calculations.
[0003] The relevant technologies primarily rely on technicians manually writing and maintaining a large number of structured query statements to achieve data aggregation. This approach has significant limitations in practical applications: First, business logic is hidden in the code, making it difficult for business personnel to intuitively understand the metric definitions, resulting in high communication costs and ambiguity; second, development and maintenance efficiency is low and reliability is insufficient, as the script for each business metric needs to be developed, tested, and maintained independently, making modifications cumbersome and error-prone when business logic changes; third, it lacks agility in responding to business needs, with a long cycle from requirement submission to delivery and deployment, making it difficult to adapt to rapidly changing analytical scenarios. Summary of the Invention
[0004] This application provides a method, apparatus, readable storage medium, and electronic device for generating structured query statements for index processing, which can realize the reusability of data processing flow, transparency of business semantics, and improvement of development efficiency.
[0005] According to a first aspect of this application, a method for generating structured query statements for index processing is provided, the method comprising:
[0006] Based on the data aggregation request, the target processing flow is determined from the predefined candidate processing flows in the processing flow metadata database; wherein, the target processing flow defines the indicators to be statistically analyzed, the indicator types to which each indicator belongs, and the processing order between the indicators to be statistically analyzed; the indicator types include atomic indicators, derived indicators, and composite indicators composed of at least two derived indicators and / or atomic indicators through arithmetic operations;
[0007] The visual configuration interface displays the processing order among the statistical indicators in the target processing flow and the indicator components corresponding to each statistical indicator.
[0008] In response to detecting a selection operation applied to the indicator component, a target indicator is determined from the indicators to be statistically analyzed, and the indicator configuration information associated with the target indicator and the summary configuration information associated with the target processing flow are obtained.
[0009] According to the index type to which the target index belongs, the index configuration information and the summary configuration information, a target structured query statement for processing the target index is generated.
[0010] According to a second aspect of the present application, a structured query statement generation apparatus for index processing is provided, and the apparatus comprises:
[0011] A processing flow determination module is configured to determine a target processing flow from predefined candidate processing flows in a processing flow meta-database according to a data summary request, wherein the target processing flow defines to-be-counted indexes, index types to which the to-be-counted indexes belong and processing sequences between the to-be-counted indexes; the index types comprise atomic indexes, derived indexes and composite indexes composed of at least two derived indexes and / or atomic indexes through arithmetic operations;
[0012] A flow data display module is configured to display the processing sequences between the to-be-counted indexes and the index components corresponding to the to-be-counted indexes in the target processing flow through a visual configuration interface;
[0013] A configuration information acquisition module is configured to determine a target index from the to-be-counted indexes and acquire index configuration information associated with the target index and summary configuration information associated with the target processing flow in response to detecting a selection operation acting on the index component;
[0014] A processing instruction generation module is configured to generate a target structured query statement for processing the target index according to the index type to which the target index belongs, the index configuration information and the summary configuration information.
[0015] According to a third aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the structured query statement generation method for index processing according to the embodiments of the present application.
[0016] According to a fourth aspect of the present application, an electronic device is provided, which comprises a memory, a processor and a computer program stored in the memory and executable by the processor, and the processor implements the structured query statement generation method for index processing according to the embodiments of the present application when executing the computer program.
[0017] According to a fifth aspect of the present application, a computer program product is provided, which comprises a computer program, and the computer program is executed by a processor to implement the structured query statement generation method for index processing according to the embodiments of the present application.
[0018] The technical scheme of the application introduces a processing flow meta-database, a visual configuration interface and an automatic generation mechanism of structured query statements based on index types, and thus has made significant technical progress. First, a target processing flow is determined from the candidate processing flows predefined in the processing flow meta-database, and the to-be-counted indexes, the index types to which the to-be-counted indexes belong and the processing sequence are defined in the target processing flow, so as to realize the reusability and standardization of data processing logic. Second, the processing sequence between the to-be-counted indexes in the target processing flow and the index components corresponding to each to-be-counted index are displayed through the visual configuration interface, so that business personnel can directly participate in the configuration. Finally, the target structured query statement used for processing the target index is generated according to the index type to which the target index belongs, the index configuration information and the summary configuration information, so as to free technical personnel from manual coding, and thus the controllability, efficiency and agility of the data processing process are realized as a whole.
[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0021] Figure 1 is a flowchart of the structured query statement generation method for index processing provided according to embodiment one;
[0022] Figure 2 is a flowchart of the structured query statement generation method for index processing provided according to embodiment two;
[0023] Figure 3 is a structural schematic diagram of the structured query statement generation apparatus for index processing provided according to embodiment three of the application;
[0024] Figure 4 is a structural schematic diagram of an electronic device provided according to embodiment four of the application. DETAILED DESCRIPTION
[0025] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application, so that those skilled in the art can better understand the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of the present application.
[0026] It should be noted that the terms "first", "second", "target" and "candidate" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] Embodiment one
[0028] Figure 1 is a flowchart of a method for generating a structured query statement for index processing according to embodiment one, the present embodiment can be applied to a data processing scenario in an enterprise that needs to process business indexes based on a data warehouse, and generate reports, which is multi-step, reusable and contains complex calculations. The method can be executed by a structured query statement generation device for index processing, which is realized in the form of hardware and / or software and can be integrated into an electronic device running the system.
[0029] As Figure 1 shown, the method comprises:
[0030] S110, determining a target processing flow from the predefined candidate processing flows in the processing flow meta-database according to a data aggregation request; wherein the target processing flow defines to-be-aggregated indexes, index types to which each to-be-aggregated index belongs, and processing sequences between to-be-aggregated indexes; the index types include atomic indexes, derived indexes, and composite indexes composed of at least two derived indexes and / or atomic indexes through arithmetic operations.
[0031] S120, displaying the processing sequences between to-be-aggregated indexes and the index components corresponding to each to-be-aggregated index in the target processing flow through a visual configuration interface.
[0032] S130, in response to detecting the selection operation acting on the indicator component, determining a target indicator from the to-be-counted indicators and acquiring indicator configuration information associated with the target indicator and summary configuration information associated with the target processing flow.
[0033] S140, generating a target structured query language statement for processing the target indicator according to an indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information.
[0034] The processing flow meta-database refers to a special data repository for storing and managing pre-defined processing flow templates, and its core role is to realize the assetization and reuse of processing logic. The candidate processing flow refers to a pre-designed and stored processing flow template in the processing flow meta-database, which can be selected and executed. The target processing flow refers to a specific flow instance to be executed, which is matched and determined from the candidate processing flow according to the data summary request. The target processing flow defines the to-be-counted indicators, the indicator types to which each to-be-counted indicator belongs, and the processing order between the to-be-counted indicators.
[0035] The data summary request is an input instruction or operation starting point initiated by a user to trigger a specific data processing task. The data summary request expresses the user's business intention, and the specific content of the data summary request is not limited here and is determined according to actual business needs. For example, the data summary request can be "personnel resignation analysis table of different employee types in each organization". The to-be-counted indicator is the specific calculation goal and content to be achieved by the data summary request, which is the specific business metric that needs to be calculated. The indicator type is a classification of the complexity of the indicator calculation logic. Optionally, the indicator type includes atomic indicators, derived indicators, and composite indicators. Among them, the atomic indicator refers to a basic metric defined based on a single business fact through a basic aggregation function such as summation or counting, the derived indicator refers to a business indicator that adds business limitations or time limitations based on atomic indicators, and the composite indicator refers to a business indicator obtained by connecting at least two derived indicators and / or atomic indicators through arithmetic operators for secondary calculation. The processing order defines the logical dependency and execution order relationship between multiple to-be-counted indicators. Optionally, the processing order of the to-be-counted indicators is related to the indicator type of the to-be-counted indicators. Generally, the processing order of atomic indicators is earlier than that of derived indicators, and the processing order of derived indicators is earlier than that of composite indicators.
[0036] The specific content of the to-be-counted indicator is related to the data summary request and is not limited here. For example, in the case of the data summary request "personnel resignation analysis table of different employee types in each organization", the to-be-counted indicators can include the number of employees who resigned in the last 30 days, the number of employees who resigned in the last 180 days, the number of employees who resigned in the last 1 natural year, and the proportion of employees who resigned in the last half year to the number of employees who resigned in the last year, etc.
[0037] Among them, the number of employees leaving in the past 30 days, the number of employees leaving in the past 180 days, and the number of employees leaving in the past 1 natural year are derived indicators, and the number of employees leaving in the past 1 natural year and the proportion of employees leaving in the past half year to the number of employees leaving in the past year are composite indicators.
[0038] Among them, the visualization configuration interface provides a graphical interactive view for the user. On the visualization configuration interface, the defined processing sequence and the indicator component representing each to-be-counted indicator are displayed, and these components are the visualization entry for the user to view and operate. The selection operation is the triggering behavior of the user to a specific indicator component. The specific type of the selection operation is not limited here, and is determined according to actual business requirements. For example, the selection operation can be dragging or clicking.
[0039] In response to detecting the selection operation acting on the indicator component, the target indicator currently requiring configuration or processing is determined from the to-be-counted indicators, and the indicator configuration information related to the target indicator and the summary configuration information associated with the target processing flow are obtained. Among them, the indicator configuration information refers to the set of business rule data directly related to a specific target indicator, which is used to define the calculation logic and parameters of the target indicator itself. The content of the indicator configuration information depends on the type of the target indicator. The summary configuration information refers to the set of technical rule data related to the entire target processing flow, which is used to define the data processing execution environment and framework. The summary configuration information is independent of the business logic of a single to-be-counted indicator, and provides a unified context and physical mapping for the processing of all indicators in the flow.
[0040] According to the type of the target indicator, the corresponding indicator configuration information and the summary configuration information of the flow are parsed, and the built-in mapping rules and syntax templates are used to automatically assemble a complete target structured query statement. Among them, the indicator type is used as the top-level classification basis and syntax template selection basis for the generation logic, and its primary role is to determine the basic syntax framework and core generation rules for the subsequent code generation process. According to the indicator type, the corresponding code template and mapping logic are called from the pre-stored syntax rule library. The indicator configuration information is used as a parameter set carrying specific business calculation rules, and its role is to inject instantiated business logic into the above-mentioned syntax template. This information converts abstract business definitions into specific operation instructions. The summary configuration information defines the technical execution environment and data flow framework of the entire data processing task. Its role is to provide a complete data access context and result output path for the query core generated based on the business logic.
[0041] The technical scheme of the application introduces a processing flow meta-database, a visual configuration interface, and an automatic generation mechanism of structured query statements based on index types, and thus has made significant technical progress. First, a target processing flow is determined from the candidate processing flows predefined in the processing flow meta-database, and the to-be-counted indexes, the index types to which the to-be-counted indexes belong, and the processing sequence are defined in the target processing flow, so as to realize the reusability and standardization of data processing logic. Second, the processing sequence among the to-be-counted indexes in the target processing flow and the index components corresponding to the to-be-counted indexes are displayed through the visual configuration interface, so that business personnel can directly participate in the configuration. Finally, a target structured query statement for processing the target index is generated according to the index type to which the target index belongs, the index configuration information, and the summary configuration information, so as to free technical personnel from manual coding, and thus the controllability, efficiency, and agility of the data processing process are realized as a whole.
[0042] In an optional embodiment, the generating, according to the index type to which the target index belongs, the index configuration information, and the summary configuration information, of a target structured query statement for processing the target index comprises: if the index type to which the target index belongs is a composite index, extracting, from the index configuration information, an arithmetic operation used for processing the target index and derivative indexes and / or atomic indexes involved in performing the arithmetic operation; mapping the arithmetic operation used for processing the target index into an arithmetic operator, and mapping the derivative indexes and / or atomic indexes involved in performing the arithmetic operation into corresponding query expressions; combining the arithmetic operator and the query expressions to determine a selection clause of the target structured query statement; extracting a table identifier of a target summary table from the summary configuration information, and determining a from clause of the target structured query statement based on the table identifier of the target summary table; wherein the target summary table stores the index processing results of the derivative indexes and the atomic indexes; extracting a grouping field from the grouping aggregation configuration of the summary configuration information, and determining a grouping clause of the target structured query statement based on the grouping field.
[0043] If the target indicator belongs to a composite indicator, first extract the arithmetic operation used for processing the target indicator from the indicator configuration information, i.e. the mathematical calculation relationship defined at the business level such as addition and division; at the same time, extract the derived indicators and / or atomic indicators involved in the execution of the arithmetic operation, i.e. the basic components participating in the calculation. Then, map the extracted arithmetic operation to the arithmetic operator supported by the database query language, and map each derived indicator or atomic indicator involved to its predefined, independently executable query expression. The query expression refers to the complete or partial query code logic that can calculate an indicator value independently. Then, combine the mapped arithmetic operator and each query expression according to the formula structure defined by the business, thereby constructing the select clause of the target structured query statement. The select clause, i.e. the SELECT part, is the core part of the structured query statement for specifying the output result calculation logic.
[0044] At the same time, construct the context framework of the query according to the summary configuration information. Extract the table identifier of the target summary table, i.e. the name identifier of the target data table, from the summary configuration information, and determine the from clause of the target structured query statement, i.e. the FROM part, according to the table identifier. The target summary table is a pre-defined data table for storing the processing results of each business indicator. In addition, extract the grouping field from the grouping aggregation configuration of the summary configuration information, and generate the grouping clause of the target structured query statement, i.e. the GROUP BY part, based on the grouping field to determine the granularity of data summarization. The grouping aggregation configuration refers to the configuration part that defines the data grouping rule.
[0045] The business logic of a composite indicator is technically embodied as an operation on multiple basic query result sets. Traditional manual coding requires separate writing of underlying queries and then combination, which is prone to errors and the logic is hidden. The above technical solution realizes reliable and transparent conversion of high-level business logic to low-level machine instructions by decomposing the symbolic elements of the business formula one by one and accurately mapping them to executable components of the database language, and then automatically assembling them. This not only eliminates the errors of manual coding and ensures the accuracy of business definition, but also enables complex indicator calculations that rely on multiple-step intermediate results to be completed automatically with declarative configuration, significantly improving the reliability, maintainability and execution efficiency of data processing.
[0046] In an optional embodiment, the generating the target structured query statement for processing the target indicator according to the indicator type to which the target indicator belongs, the indicator configuration information and the summary configuration information comprises: if the indicator type to which the target indicator belongs is a derived indicator, extracting an atomic indicator, a filter condition and a time period required for processing the target indicator from the indicator configuration information; determining a selection clause of the target structured query statement based on the atomic indicator required for processing the target indicator; determining a condition clause of the target structured query statement based on the filter condition and the time period required for processing the target indicator; extracting a table identifier of a data source table from the summary configuration information and determining a from clause of the target structured query statement based on the table identifier of the data source table; extracting a grouping field from a grouping and aggregation configuration of the summary configuration information and determining a grouping clause of the target structured query statement based on the grouping field; wherein the atomic indicator is configured with a target field to be processed in the data source table and a processing manner used for processing the target field.
[0047] The derived indicator particularly refers to a business indicator which is stacked with specific business limitations or time range constraints on the basis of an atomic indicator. When the target indicator is a derived indicator, the principle of generating a structured query statement thereof is to realize separation configuration and automatic assembly of basic calculation and business limitation, so as to convert a business indicator definition containing specific constraint conditions into a directly executable database query.
[0048] Three core elements are extracted from the indicator configuration information: one is an atomic indicator required for processing the target indicator, that is, a basic measurement constituting a calculation core of the derived indicator without limitation; the other is a filter condition, that is, a business rule used for limiting a data range; and the third is a time period, that is, a rule used for limiting a data time range. The atomic indicator refers to a basic measurement defined by a basic aggregation function based on a single business fact, and its own configuration contains a target field to be processed in a data source table and a processing manner used for processing the target field.
[0049] The selection clause of the target structured query statement is directly determined based on the extracted atomic indicator, and the selection clause is used for defining data columns to be calculated and output in the query. Meanwhile, the condition clause of the target structured query statement is constructed based on the extracted filter condition and time period, and the condition clause is used for filtering source data rows in the query. The context of the query is provided by the summary configuration information, from which a table identifier of a data source table is extracted to determine the from clause of the target structured query statement, that is, a FROM part of the query source table; and a grouping field is extracted from a grouping and aggregation configuration thereof to determine a grouping clause of the target structured query statement, that is, a GROUP BY part, so as to define a granularity of data summary.
[0050] The business logic of the derived indicator is what calculation is performed on what data under what conditions. The traditional manual coding needs to couple the three, which is difficult to maintain and reuse. The technical solution can generate standardized calculation clauses (SELECT) and condition clauses (WHERE) by decoupling the configuration of "calculation" (atomic indicator) and "limitation" (filtering and time), and automatically assembling under the FROM and GROUP BY defined by the summary configuration. It realizes clear expression, flexible configuration and zero-error code conversion of business rules, greatly improving the definition, change and maintenance efficiency of complex business indicators.
[0051] In an optional embodiment, the generating the target structured query statement for processing the target indicator according to the type of the target indicator, the indicator configuration information and the summary configuration information comprises: if the type of the target indicator is an atomic indicator, extracting an inter-table mapping configuration, a field mapping configuration and a grouping aggregation configuration from the summary configuration information; wherein the grouping aggregation configuration comprises a dimension field configuration for defining grouping basis and an atomic indicator configuration for defining aggregation calculation; determining a data source table and a target summary table based on the inter-table mapping configuration, and generating a FROM clause and a write clause of the target structured query statement based on the data source table and the target summary table; determining a grouping clause of the target structured query statement based on the dimension field configuration, and determining a corresponding field expression of each dimension field in a SELECT clause based on the field mapping configuration; determining a corresponding aggregation expression of the atomic indicator in the SELECT clause based on the atomic indicator configuration; and combining the field expression of the dimension field and the aggregation expression of the atomic indicator to obtain a SELECT clause of the target structured query statement.
[0052] The atomic indicator specifically refers to a basic measurement based on a single business fact, defined by a basic aggregation function and cannot be divided, such as "sum" or "count" of a certain numerical field. When the target indicator is an atomic indicator, the principle of generating a structured query statement is to realize the automatic and standardized data processing pipeline construction from raw data to summary results through the hierarchical decoupling configuration method.
[0053] Firstly, necessary configurations are extracted from the summary configuration information, specifically three configurations: inter-table mapping configuration refers to the configuration that defines the correspondence between the data source table and the target summary table where the processing result is stored. Field mapping configuration refers to the configuration that defines the field correspondence and conversion relationship between the data source table and the target summary table. Grouping and aggregation configuration refers to the rule set that defines how data is grouped and aggregated, which further includes dimension field configuration and atomic indicator configuration. The dimension field configuration is used to specify the descriptive attribute field as the grouping basis, and the atomic indicator configuration is used to specify the numerical field to be aggregated, i.e. the target field and the aggregation function applied to it. The data source table is a database table that stores raw or detailed data. The target summary table is a data table used to store the final aggregation processing result.
[0054] Based on the above configurations extracted from the summary configuration information, automated assembly is performed: firstly, according to the inter-table mapping configuration, the data source table and the target summary table are determined, and the FROM clause of the target structured query statement is generated, i.e. the FROM part that specifies the data source and the INSERT INTO part that writes the result to the target summary table. Secondly, according to the dimension field configuration, the GROUP BY clause of the target structured query statement is determined; at the same time, according to the field mapping configuration, the corresponding field expression of each dimension field in the SELECT clause is determined. Field expression refers to the calculation or conversion form of a field in the output of the query. Then, according to the atomic indicator configuration, the corresponding aggregation expression of the atomic indicator in the SELECT clause is determined. Aggregation expression refers to the calculation result expression formed after applying the aggregation function to the field. Finally, the field expressions of all dimension fields and the aggregation expressions of atomic indicators are combined to form the complete SELECT clause of the target structured query statement, which is used to define the composition of the query result set.
[0055] Atomic indicator processing is the most basic and frequent operation in data warehouse construction. Traditional manual coding requires repeated writing of mode-fixed INSERT INTO, SELECT, FROM, GROUP BY, etc. The above technical solution decouples inter-table mapping, field mapping, dimension field configuration and atomic indicator configuration into independent configuration units, which can automatically synthesize standard data processing statements with completely correct syntax and business semantics, just like building blocks. Not only does it completely eliminate the syntax errors and consistency risks of manual coding, but also greatly improves the efficiency of data model development and maintenance through the reusability of configuration, laying a technical foundation for realizing large-scale, standardized and manageable data processing pipeline.
[0056] Embodiment Two
[0057] Figure 2is a flowchart of a structured query language generation method for index processing according to embodiment two. This embodiment is further optimized on the basis of the above-mentioned embodiment. Specifically, a index configuration operation is added before the index configuration information associated with the target index and the summary configuration information associated with the target processing flow are obtained.
[0058] As shown in Figure 2 , the method comprises:
[0059] S210, according to the index configuration request for the target index processing flow, determining the to-be-configured index and the index type to which the to-be-configured index belongs.
[0060] S220, according to the index type to which the to-be-configured index belongs, determining the configuration dimension corresponding to the to-be-configured index and the to-be-configured field associated with the configuration dimension.
[0061] S230, rendering an index configuration page for the to-be-configured index based on the configuration dimension and the to-be-configured field associated with the configuration dimension in the visualization configuration interface.
[0062] Among them, the index configuration request is an interactive instruction initiated by the user for a specific index in the target index processing flow, intending to set or modify the calculation rule thereof.
[0063] In response to the index configuration request, first, the to-be-configured index, i.e. the specific business measurement object that needs parameter setting at present, is determined; at the same time, the index type thereof, i.e. the classification of the complexity of the calculation logic of the index such as atomic index, derived index or composite index, is determined. Then, according to the index type to which the to-be-configured index belongs, the configuration dimension corresponding thereto is dynamically determined, which refers to different logical aspects or parameter categories that need to be set for the configuration of the index, for example, for a derived index, the configuration dimension usually includes atomic index, filtering condition and time period. For each configuration dimension, the to-be-configured field associated therewith is further determined, which refers to the parameter item that needs to be specifically input or selected by the user under the corresponding configuration dimension, for example, the to-be-configured field associated with the time period dimension may include time field, reference time, time direction and time span. Finally, based on the determined configuration dimension and the set of to-be-configured fields under each dimension, a structured index configuration page is dynamically rendered and generated on the visualization configuration interface. The page will clearly organize and display all the items that need to be configured, guiding the user to efficiently and completely complete parameter input.
[0064] Different types of indicators have different calculation logic and required parameters. The technical scheme of the present application realizes the accurate matching of the configuration interface and the business logic through the dynamic configuration interface generation mechanism based on the indicator type. The indicator definition work originally requiring technical background is transformed into a structured, guided visual configuration experience, which ensures that when the user configures any indicator, only the necessary parameter settings strictly corresponding to the logic of the indicator are seen and must be completed, avoiding omission and eliminating irrelevant configuration item interference, thereby significantly reducing the technical threshold of business personnel participating in the data processing process and improving the configuration accuracy.
[0065] In an optional embodiment, the determining, according to the type of the indicator to which the to-be-configured indicator belongs, of the configuration dimension corresponding to the to-be-configured indicator and the to-be-configured field associated with the configuration dimension comprises: if the type of the indicator to which the to-be-configured indicator belongs is a derived indicator, determining the atomic indicator, the filtering condition and the time period required for processing the to-be-configured indicator as the configuration dimension corresponding to the to-be-configured indicator; determining the time field, the reference time, the time direction and the time span as the to-be-configured field associated with the time period, and determining the business attribute as the to-be-configured field associated with the filtering condition; determining the target field to be processed in the data source table and the processing method used for processing the target field as the to-be-configured field associated with the filtering condition; if the type of the indicator to which the to-be-configured indicator belongs is a composite indicator, determining the arithmetic operation used for processing the to-be-configured indicator as the configuration dimension corresponding to the to-be-configured indicator; and determining the operation type of the arithmetic operation and the derived indicator and / or the atomic indicator involved in the execution of the arithmetic operation as the to-be-configured field associated with the configuration dimension.
[0066] The configuration dimension refers to the parameter group belonging to different logical categories required for complete definition of an indicator. The to-be-configured field refers to the parameter item that needs to be specifically set by the user under a certain specific configuration dimension.
[0067] Since the derived indicator is a type of indicator that is superimposed with business limitation and time limitation on the basis of atomic indicators, if the to-be-configured indicator is a derived indicator, it is configured to be decomposed into three core dimensions: one is the atomic indicator needed for processing the to-be-configured indicator, that is, the basic measurement constituting the calculation core; the second is the filtering condition, that is, the business rule for limiting the data range; and the third is the time period, that is, the rule for limiting the data time range. For the "time period" dimension, it is further determined that the to-be-configured fields thereof include: time field, reference time, time direction and time span. At the same time, the fields and their values of the business attributes such as "organization" used for business screening are determined as the to-be-configured fields associated with the filtering condition dimension. Among them, the time field refers to the date or time type field in the data source table used to calculate the time period, the reference time refers to the starting reference point of the calculation of the time period, such as the current date. The time direction refers to whether the period is forward or backward relative to the reference time. The time span refers to the length of the period, such as 30 days.
[0068] In addition, the target field in the data source table to be processed, that is, the numerical field to which the atomic indicator aggregation calculation is directed, and its processing method, that is, the aggregation function such as SUM or COUNT applied, are also associated to the configuration context of the filtering condition, so as to completely define the atomic indicator itself.
[0069] Since the composite indicator is a type of indicator that is composed of at least two derived indicators or atomic indicators through arithmetic operation. If the to-be-configured indicator is a composite indicator, it is determined that the core configuration dimension thereof is the arithmetic operation used for processing the to-be-configured indicator. For this dimension, it is determined that the to-be-configured fields thereof include: the operation type of the arithmetic operation and the derived indicators and / or atomic indicators involved in the execution of the arithmetic operation, that is, the operands in the formula.
[0070] The calculation logic of different types of indicators is different, and the required parameters are completely different. The above scheme can dynamically render a highly customized configuration form according to the type of the indicator by pre-mapping the logical structure of each type of indicator into a set of structured configuration dimensions and specific to-be-configured fields. It forcibly guides the user to provide all necessary parameters completely and accurately in the established logical order, eliminates configuration errors and omissions from the source, lays a solid foundation for subsequent generation of accurate structured query statements, and is a key link to realize "zero code" or "low code" data processing.
[0071] In an optional embodiment, before the obtaining the target indicator associated indicator configuration information and the target processing flow associated summary configuration information, the method further comprises: according to a summary configuration request for the target indicator processing flow, performing at least inter-table mapping configuration, field mapping configuration and grouping aggregation configuration on the target indicator processing flow through the visual configuration interface; wherein the inter-table mapping configuration is used to limit the data source table and the target summary table; the field mapping configuration is used to provide the mapping relationship between the fields of the data source table and the target summary table; the grouping aggregation configuration is configured by selecting the target field to be processed from the data source table through field selection, and is configured by setting the processing mode used for processing the target field through attribute setting.
[0072] The summary configuration request is an interactive instruction initiated by a user for the specific flow, and is intended to set the data source table, the target summary table and the summary rule. In response to the summary configuration request, the user is guided to complete at least three core configurations on the visual configuration interface: one is the inter-table mapping configuration, which is used to explicitly limit the corresponding relationship between the data source table and the target summary table involved in the entire processing flow. The second is the field mapping configuration, which is used to establish and specify the corresponding, conversion or derivation relationship between the fields of the data source table and the fields of the target summary table. The third is the grouping aggregation configuration, which is used to define the rules for grouping and summarizing data. In the grouping aggregation configuration process, the user specifies the target field to be processed, i.e., the numerical field that needs to be aggregated and calculated, by selecting the field of the data source table, and configures the processing mode used for processing the target field, i.e., the aggregation function applied to the target field such as summation, average, counting, etc., by setting the attributes of the target field.
[0073] The automatic execution of the data processing task not only needs to know "what to calculate", but also must be clear about "where to take", "where to store" and "how to organize". The above scheme clearly decomposes the technical framework of data processing into three independently configurable dimensions of inter-table mapping, field mapping and grouping aggregation, and centrally manages them in the visual interface, so that technical personnel or business experts can clearly and unambiguously define the physical implementation rules of the entire processing flow in a unified context. Not only does it provide indispensable context information for subsequent automatic and correct "instantiation" of business indicator logic into specific query statements, but also greatly improves the maintainability, reusability and manageability of the data processing flow itself, and is an important cornerstone for realizing the standardization and automation of data processing flow.
[0074] Embodiment Three
[0075] Figure 3is a structural diagram of a structured query language generation device for index processing provided in Embodiment Three of the present application. The present embodiment can be applied to a data processing scenario in which multi-step, reusable, and complex calculation business index processing and report generation based on a data warehouse are required in an enterprise. The device can be implemented by software and / or hardware, and can be integrated into an electronic device such as a smart terminal.
[0076] As shown in Figure 3 the device can include:
[0077] a processing flow determination module 310 configured to determine a target processing flow from candidate processing flows predefined in a processing flow meta-database according to a data aggregation request; wherein the target processing flow defines to-be-counted indexes, index types to which each to-be-counted index belongs, and processing orders between the to-be-counted indexes; the index types include atomic indexes, derived indexes, and composite indexes composed of at least two derived indexes and / or atomic indexes through arithmetic operations;
[0078] a flow data display module 320 configured to display the processing orders between the to-be-counted indexes and index components corresponding to each to-be-counted index in the target processing flow through a visual configuration interface;
[0079] a configuration information acquisition module 330 configured to determine a target index from the to-be-counted indexes and acquire index configuration information associated with the target index and aggregation configuration information associated with the target processing flow in response to detecting a selection operation acting on the index component;
[0080] a processing instruction generation module 340 configured to generate a target structured query language for processing the target index according to the index type to which the target index belongs, the index configuration information, and the aggregation configuration information.
[0081] The technical solution of the present application has made significant technical progress by introducing a processing flow meta-database, a visual configuration interface, and a structured query language automatic generation mechanism based on index types. First, by determining a target processing flow from candidate processing flows predefined in a processing flow meta-database, and defining to-be-counted indexes, index types to which each to-be-counted index belongs, and processing orders in the target processing flow, the reusability and standardization of data processing logic are achieved. Second, by displaying the processing orders between the to-be-counted indexes and the index components corresponding to each to-be-counted index in the target processing flow through a visual configuration interface, business personnel can directly participate in configuration. Finally, by generating a target structured query language for processing the target index according to the index type to which the target index belongs, the index configuration information, and the aggregation configuration information, technical personnel are liberated from manual coding, thereby achieving controllability, efficiency, and agility in the overall data processing process.
[0082] Optionally, the processing instruction generation module 340 comprises: a first information extraction submodule, configured to extract, if the target index belongs to a composite index, an arithmetic operation used for processing the target index and derivative indexes and / or atomic indexes involved in performing the arithmetic operation from the index configuration information; a first content mapping submodule, configured to map the arithmetic operation used for processing the target index into an arithmetic operator and map the derivative indexes and / or the atomic indexes involved in performing the arithmetic operation into corresponding query expressions; a first content combination submodule, configured to combine the arithmetic operator and the query expressions to determine a selection clause of the target structured query statement; a first from clause determination submodule, configured to extract a table identifier of a target summary table from the summary configuration information and determine a from clause of the target structured query statement based on the table identifier of the target summary table; wherein the target summary table stores index processing results of the derivative indexes and the atomic indexes; and a first grouping clause determination submodule, configured to extract a grouping field from grouping aggregation configuration of the summary configuration information and determine a grouping clause of the target structured query statement based on the grouping field.
[0083] Optionally, the processing instruction generation module 340 comprises: a second information extraction submodule, configured to extract, if the target index belongs to a derivative index, an atomic index, a filter condition and a time period required for processing the target index from the index configuration information; a selection clause determination submodule, configured to determine a selection clause of the target structured query statement based on the atomic index required for processing the target index; a condition clause determination submodule, configured to determine a condition clause of the target structured query statement based on the filter condition and the time period required for processing the target index; a first from clause determination submodule, configured to extract a table identifier of a data source table from the summary configuration information and determine a from clause of the target structured query statement based on the table identifier of the data source table; a second grouping clause determination submodule, configured to extract a grouping field from grouping aggregation configuration of the summary configuration information and determine a grouping clause of the target structured query statement based on the grouping field; wherein the atomic index is configured with a target field to be processed in the data source table and a processing manner used for processing the target field.
[0084] Optionally, the processing instruction generation module 340 comprises: a third information extraction submodule, configured to extract inter-table mapping configuration, field mapping configuration and grouping aggregation configuration from the summary configuration information if the target indicator belongs to an atomic indicator; wherein the grouping aggregation configuration comprises a dimension field configuration for defining grouping basis and an atomic indicator configuration for defining aggregation calculation; a related table determination submodule, configured to determine a data source table and a target summary table based on the inter-table mapping configuration, and generate a from clause and a write clause of the target structured query language statement based on the data source table and the target summary table; a field expression determination submodule, configured to determine a grouping clause of the target structured query language statement based on the dimension field configuration, and determine a corresponding field expression of each dimension field in a select clause based on the field mapping configuration; an aggregation expression determination submodule, configured to determine a corresponding aggregation expression of the atomic indicator in the select clause based on the atomic indicator configuration; and a second content combination submodule, configured to combine the field expression of the dimension field and the aggregation expression of the atomic indicator to obtain a select clause of the target structured query language statement.
[0085] Optionally, the apparatus further comprises: an indicator type determination module, configured to determine a to-be-configured indicator and an indicator type to which the to-be-configured indicator belongs according to an indicator configuration request for the target indicator processing flow before the target indicator associated indicator configuration information and the target processing flow associated summary configuration information are acquired; a to-be-configured content determination module, configured to determine a configuration dimension corresponding to the to-be-configured indicator and a to-be-configured field associated with the configuration dimension according to the indicator type to which the to-be-configured indicator belongs; and a configuration page rendering module, configured to render an indicator configuration page for the to-be-configured indicator in the visual configuration interface based on the configuration dimension and the to-be-configured field associated with the configuration dimension.
[0086] Optionally, the to-be-configured content determining module comprises: a first dimension determining submodule, configured to, if the index type to which the to-be-configured index belongs is a derived index, take the atomic index, the filtering condition, and the time period required for processing the to-be-configured index as the configuration dimension corresponding to the to-be-configured index; a first field determining submodule, configured to take the time field, the reference time, the time direction, and the time span as the to-be-configured field associated with the time period, and take the service attribute as the to-be-configured field associated with the filtering condition; a second field determining submodule, configured to take the target field to be processed in the data source table and the processing manner used for processing the target field as the to-be-configured field associated with the filtering condition; and a second dimension determining submodule, configured to, if the index type to which the to-be-configured index belongs is a composite index, take the arithmetic operation used for processing the to-be-configured index as the configuration dimension corresponding to the to-be-configured index; and a third field determining submodule, configured to take the operation type of the arithmetic operation and the derived index and / or the atomic index involved in performing the arithmetic operation as the to-be-configured field associated with the configuration dimension.
[0087] Optionally, the apparatus further comprises a summary configuration module, configured to, before the obtaining of the index configuration information associated with the target index and the summary configuration information associated with the target processing flow, perform at least inter-table mapping configuration, field mapping configuration, and grouping aggregation configuration on the target index processing flow according to a summary configuration request for the target index processing flow through the visual configuration interface; the inter-table mapping configuration is used for defining the data source table and the target summary table; the field mapping configuration is used for providing the mapping relationship between the fields of the data source table and the target summary table; and the grouping aggregation configuration is used for performing field selection configuration on the data source table to obtain the target field to be processed, and performing attribute setting configuration on the target field to obtain the processing manner used for processing the target field.
[0088] The apparatus for generating a structured query statement for index processing provided in the embodiments has the performance modules and beneficial effects corresponding to the method for generating a structured query statement for index processing.
[0089] Embodiment Four
[0090] According to the embodiments of the present application, the present application further provides an electronic device, a readable storage medium, and a computer program product.
[0091] Figure 4A structural diagram of an electronic device 410 that can be used to implement the embodiments is shown. The electronic device 410 includes at least one processor 411, and a memory, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., communicatively connected to the at least one processor 411, where the memory stores a computer program that can be executed by the at least one processor. The processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or loaded from the storage unit 418 into the random access memory (RAM) 413. Various programs and data required for the operation of the electronic device 410 can also be stored in the RAM 413. The processor 411, the ROM 412, and the RAM 413 are connected to each other through a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0092] Various components in the electronic device 410 are connected to the I / O interface 415, including an input unit 416, such as a keyboard, a mouse, etc., an output unit 417, such as various types of displays, a speaker, etc., a storage unit 418, such as a magnetic disk, an optical disk, etc., and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0093] The processor 411 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 performs various methods and processes described above, such as the structured query statement generation method for metric processing.
[0094] In some embodiments, the structured query statement generation method for metric processing can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the structured query statement generation method for metric processing described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured to perform the structured query statement generation method for metric processing by any other appropriate means, such as by means of firmware.
[0095] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0096] Computer programs implementing methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable computing apparatus to produce a machine, such that the computer program, when executed, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a standalone software package, or entirely on a remote machine or server.
[0097] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0098] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0099] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a structured query language generation server for metric processing), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0100] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0101] The embodiments of the present application further disclose a computer program product, which comprises a computer program, and the computer program, when executed by a processor, implements the method for generating a structured query language for metric processing provided by any of the embodiments of the present application. The program product and the method for generating a structured query language for metric processing disclosed by the embodiments of the present application belong to the same inventive concept, and thus will not be described here.
[0102] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the present application are achieved, which is not limited herein.
[0103] The foregoing detailed description has not been limited by a particular embodiment thereof. Alternative, equivalent embodiments of the application exist and are within the scope of the appended claims. Moreover, it should be appreciated that those skilled in the art can devise various modifications without departing from the scope of the appended claims.
Claims
1. A method for generating structured query statements for index processing, characterized in that, The method includes: Based on the data aggregation request, the target processing flow is determined from the predefined candidate processing flows in the processing flow metadata database; wherein, the target processing flow defines the indicators to be statistically analyzed, the indicator types to which each indicator belongs, and the processing order between the indicators to be statistically analyzed; the indicator types include atomic indicators, derived indicators, and composite indicators composed of at least two derived indicators and / or atomic indicators through arithmetic operations; The visual configuration interface displays the processing order among the statistical indicators in the target processing flow and the indicator components corresponding to each statistical indicator. In response to detecting a selection operation applied to the indicator component, a target indicator is determined from the indicators to be statistically analyzed, and the indicator configuration information associated with the target indicator and the summary configuration information associated with the target processing flow are obtained. Based on the indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information, a target structured query statement for processing the target indicator is generated.
2. The method according to claim 1, characterized in that, The step of generating a target structured query statement for processing the target indicator based on the indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information includes: If the target indicator belongs to a composite indicator, then the arithmetic operations used to process the target indicator and the derived indicators and / or atomic indicators involved in performing the arithmetic operations are extracted from the indicator configuration information. The arithmetic operations used to process the target index are mapped to arithmetic operators, and the derived indexes and / or atomic indexes involved in performing the arithmetic operations are mapped to corresponding query expressions; The arithmetic operators and the query expression are combined to determine the select clause of the target structured query statement; Extract the table identifier of the target summary table from the summary configuration information, and determine the subordinate clause of the target structured query statement based on the table identifier of the target summary table; wherein, the target summary table stores the indicator processing results of the derived indicators and the atomic indicators; Extract the grouping field from the grouping aggregation configuration of the summary configuration information, and determine the grouping clause of the target structured query statement based on the grouping field.
3. The method according to claim 1, characterized in that, The step of generating a target structured query statement for processing the target indicator based on the indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information includes: If the target indicator belongs to a derived indicator type, then the atomic indicators, filtering conditions, and time periods required to process the target indicator are extracted from the indicator configuration information. Based on the atomic indicators required to process the target indicators, determine the selection clause of the target structured query statement; Based on the filtering conditions and time period required to process the target indicators, determine the conditional clauses of the target structured query statement; Extract the table identifier of the data source table from the summarized configuration information, and determine the subordinate clause of the target structured query statement based on the table identifier of the data source table; Extract the grouping field from the grouping aggregation configuration of the summarized configuration information, and determine the grouping clause of the target structured query statement based on the grouping field; The atomic index is configured with the target field to be processed in the data source table and the processing method used to process the target field.
4. The method according to claim 1, characterized in that, The step of generating a target structured query statement for processing the target indicator based on the indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information includes: If the target indicator belongs to an atomic indicator, then the table mapping configuration, field mapping configuration, and grouping aggregation configuration are extracted from the summary configuration information; wherein, the grouping aggregation configuration includes the dimension field configuration for defining the grouping basis and the atomic indicator configuration for defining the aggregation calculation; Based on the table mapping configuration, the data source table and the target summary table are determined, and the subordinate clause and write clause of the target structured query statement are generated based on the data source table and the target summary table. Based on the configuration of the dimension fields, the grouping clauses of the target structured query statement are determined, and based on the field mapping configuration, the field expressions corresponding to each dimension field in the selection clause are determined; Based on the atomic indicator configuration, determine the aggregate expression corresponding to the atomic indicator in the selection clause; The field expression of the dimension field is combined with the aggregation expression of the atomic indicator to obtain the selection clause of the target structured query statement.
5. The method according to claim 1, characterized in that, Before obtaining the indicator configuration information associated with the target indicator and the summary configuration information associated with the target processing flow, the method further includes: Based on the indicator configuration request for the target indicator processing flow, determine the indicator to be configured and the indicator type to which the indicator to be configured belongs; Based on the metric type to which the metric to be configured belongs, determine the configuration dimension corresponding to the metric to be configured and the fields to be configured associated with the configuration dimension; Based on the configuration dimension and the fields to be configured associated with the configuration dimension, the visualization configuration interface renders the indicator configuration page for the indicator to be configured.
6. The method according to claim 5, characterized in that, The step of determining the configuration dimension corresponding to the configurable metric and the configuration field associated with the configuration dimension based on the metric type to which the configurable metric belongs includes: If the metric to be configured belongs to a derived metric, then the atomic metric, filtering conditions and time period required to process the metric to be configured will be used as the configuration dimensions corresponding to the metric to be configured. The time field, base time, time direction, and time span are determined as fields to be configured associated with the time period, and the business attributes are determined as fields to be configured associated with the filtering conditions. The target field to be processed and the processing method used to process the target field in the data source table are determined as the fields to be matched with the filtering conditions; If the indicator to be configured is a composite indicator, then the arithmetic operation used to process the indicator to be configured will be used to determine the configuration dimension corresponding to the indicator to be configured. The operation type of the arithmetic operation and the derived indicators and / or atomic indicators involved in performing the arithmetic operation are determined as the fields to be configured and associated with the configuration dimension.
7. The method according to claim 1, characterized in that, Before obtaining the indicator configuration information associated with the target indicator and the summary configuration information associated with the target processing flow, the method further includes: Based on the summary configuration request for the processing flow of the target indicator, the processing flow of the target indicator is configured with at least inter-table mapping, field mapping and grouping aggregation through the visual configuration interface; The table mapping configuration is used to limit the data source table and the target summary table; the field mapping configuration is used to provide the mapping relationship between the fields of the data source table and the target summary table; the grouping and aggregation configuration configures the target fields to be processed by selecting fields in the data source table, and configures the processing method used to process the target fields by setting attributes of the target fields.
8. A structured query statement generation device for index processing, characterized in that, The device includes: The processing flow determination module is used to determine the target processing flow from the predefined candidate processing flows in the processing flow metadata database according to the data aggregation request; wherein, the target processing flow defines the indicators to be statistically analyzed, the indicator types to which each indicator belongs, and the processing order between the indicators to be statistically analyzed; the indicator types include atomic indicators, derived indicators, and composite indicators composed of at least two derived indicators and / or atomic indicators through arithmetic operations; The process data display module is used to display the processing order between the statistical indicators in the target processing flow and the indicator components corresponding to each statistical indicator through a visual configuration interface. The configuration information acquisition module is used to, in response to the detection of a selection operation applied to the indicator component, determine the target indicator from the indicators to be statistically analyzed and acquire the indicator configuration information associated with the target indicator and the summary configuration information associated with the target processing flow; The processing instruction generation module is used to generate a target structured query statement for processing the target indicator based on the indicator type to which the target indicator belongs, the indicator configuration information, and the summary configuration information.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the structured query statement generation method for index processing as described in any one of claims 1-7.
10. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the structured query statement generation method for index processing as described in any one of claims 1-7.